diff --git a/aws_client/CHANGELOG.md b/aws_client/CHANGELOG.md index 640eaf892..5a93a8fbe 100644 --- a/aws_client/CHANGELOG.md +++ b/aws_client/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.5.0 + +- Generate all the APIs with version v2.1635.0 of the AWS SDK + ## 0.4.3 - Updated `pubspec.yaml`. diff --git a/aws_client/README.md b/aws_client/README.md index 93a9cf1c5..53f68595a 100644 --- a/aws_client/README.md +++ b/aws_client/README.md @@ -180,6 +180,7 @@ The following is a list of APIs that are currently available inside this package - AmazonApiGatewayV2 (`package:aws_client/api_gateway_v2`) - Amazon AppConfig (`package:aws_client/app_config`) - AWS AppConfig Data (`package:aws_client/app_config_data`) +- AppFabric (`package:aws_client/app_fabric`) - Amazon Appflow (`package:aws_client/appflow`) - Amazon AppIntegrations Service (`package:aws_client/app_integrations`) - Application Auto Scaling (`package:aws_client/application_auto_scaling`) @@ -190,18 +191,26 @@ The following is a list of APIs that are currently available inside this package - Amazon AppStream (`package:aws_client/app_stream`) - AWS AppSync (`package:aws_client/app_sync`) - AWS ARC - Zonal Shift (`package:aws_client/arc_zonal_shift`) +- AWS Artifact (`package:aws_client/artifact`) - Amazon Athena (`package:aws_client/athena`) - AWS Audit Manager (`package:aws_client/audit_manager`) - Auto Scaling (`package:aws_client/auto_scaling`) - AWS Auto Scaling Plans (`package:aws_client/auto_scaling_plans`) +- AWS B2B Data Interchange (`package:aws_client/b2_bi`) - AWS Backup (`package:aws_client/backup`) - AWS Backup Gateway (`package:aws_client/backup_gateway`) - AWS Backup Storage (`package:aws_client/backup_storage`) - AWS Batch (`package:aws_client/batch`) +- AWS Billing and Cost Management Data Exports (`package:aws_client/bcm_data_exports`) +- Amazon Bedrock (`package:aws_client/bedrock`) +- Agents for Amazon Bedrock (`package:aws_client/bedrock_agent`) +- Agents for Amazon Bedrock Runtime (`package:aws_client/bedrock_agent_runtime`) +- Amazon Bedrock Runtime (`package:aws_client/bedrock_runtime`) - AWSBillingConductor (`package:aws_client/billingconductor`) - Braket (`package:aws_client/braket`) - AWS Budgets (`package:aws_client/budgets`) - AWS Cost Explorer Service (`package:aws_client/cost_explorer`) +- AWS Chatbot (`package:aws_client/chatbot`) - Amazon Chime (`package:aws_client/chime`) - Amazon Chime SDK Identity (`package:aws_client/chime_sdk_identity`) - Amazon Chime SDK Media Pipelines (`package:aws_client/chime_sdk_media_pipelines`) @@ -209,6 +218,7 @@ The following is a list of APIs that are currently available inside this package - Amazon Chime SDK Messaging (`package:aws_client/chime_sdk_messaging`) - Amazon Chime SDK Voice (`package:aws_client/chime_sdk_voice`) - AWS Clean Rooms Service (`package:aws_client/clean_rooms`) +- AWS Clean Rooms ML (`package:aws_client/clean_rooms_ml`) - AWS Cloud9 (`package:aws_client/cloud9`) - AWS Cloud Control API (`package:aws_client/cloud_control`) - Amazon CloudDirectory (`package:aws_client/cloud_directory`) @@ -224,8 +234,10 @@ The following is a list of APIs that are currently available inside this package - AWS CodeBuild (`package:aws_client/code_build`) - Amazon CodeCatalyst (`package:aws_client/code_catalyst`) - AWS CodeCommit (`package:aws_client/code_commit`) +- AWS CodeConnections (`package:aws_client/code_connections`) - AWS CodeDeploy (`package:aws_client/code_deploy`) - Amazon CodeGuru Reviewer (`package:aws_client/code_guru_reviewer`) +- Amazon CodeGuru Security (`package:aws_client/code_guru_security`) - Amazon CodeGuru Profiler (`package:aws_client/code_guru_profiler`) - AWS CodePipeline (`package:aws_client/code_pipeline`) - AWS CodeStar (`package:aws_client/code_star`) @@ -243,14 +255,18 @@ The following is a list of APIs that are currently available inside this package - AmazonConnectCampaignService (`package:aws_client/connect_campaigns`) - Amazon Connect Cases (`package:aws_client/connect_cases`) - Amazon Connect Participant Service (`package:aws_client/connect_participant`) +- AWS Control Catalog (`package:aws_client/control_catalog`) - AWS Control Tower (`package:aws_client/control_tower`) +- Cost Optimization Hub (`package:aws_client/cost_optimization_hub`) - AWS Cost and Usage Report Service (`package:aws_client/cost_and_usage_report_service`) - Amazon Connect Customer Profiles (`package:aws_client/customer_profiles`) - AWS Glue DataBrew (`package:aws_client/data_brew`) - AWS Data Exchange (`package:aws_client/data_exchange`) - AWS Data Pipeline (`package:aws_client/data_pipeline`) - AWS DataSync (`package:aws_client/data_sync`) +- Amazon DataZone (`package:aws_client/data_zone`) - Amazon DynamoDB Accelerator (DAX) (`package:aws_client/dax`) +- AWSDeadlineCloud (`package:aws_client/deadline`) - Amazon Detective (`package:aws_client/detective`) - AWS Device Farm (`package:aws_client/device_farm`) - Amazon DevOps Guru (`package:aws_client/dev_ops_guru`) @@ -270,6 +286,7 @@ The following is a list of APIs that are currently available inside this package - Amazon Elastic Container Registry Public (`package:aws_client/ecr_public`) - Amazon EC2 Container Service (`package:aws_client/ecs`) - Amazon Elastic Kubernetes Service (`package:aws_client/eks`) +- Amazon EKS Auth (`package:aws_client/eks_auth`) - Amazon Elastic Inference (`package:aws_client/elastic_inference`) - Amazon ElastiCache (`package:aws_client/elasti_cache`) - AWS Elastic Beanstalk (`package:aws_client/elastic_beanstalk`) @@ -282,6 +299,7 @@ The following is a list of APIs that are currently available inside this package - Amazon EMR Containers (`package:aws_client/emr_containers`) - EMR Serverless (`package:aws_client/emr_serverless`) - AWS Marketplace Entitlement Service (`package:aws_client/marketplace_entitlement_service`) +- AWS EntityResolution (`package:aws_client/entity_resolution`) - Amazon Elasticsearch Service (`package:aws_client/elasticsearch_service`) - Amazon EventBridge (`package:aws_client/event_bridge`) - Amazon CloudWatch Events (`package:aws_client/cloud_watch_events`) @@ -294,6 +312,7 @@ The following is a list of APIs that are currently available inside this package - Amazon Forecast Service (`package:aws_client/forecast`) - Amazon Forecast Query Service (`package:aws_client/forecastquery`) - Amazon Fraud Detector (`package:aws_client/fraud_detector`) +- AWS Free Tier (`package:aws_client/free_tier`) - Amazon FSx (`package:aws_client/f_sx`) - Amazon GameLift (`package:aws_client/game_lift`) - GameSparks (`package:aws_client/game_sparks`) @@ -313,6 +332,7 @@ The following is a list of APIs that are currently available inside this package - EC2 Image Builder (`package:aws_client/imagebuilder`) - AWS Import/Export (`package:aws_client/import_export`) - Amazon Inspector (`package:aws_client/inspector`) +- Inspector Scan (`package:aws_client/inspector_scan`) - Inspector2 (`package:aws_client/inspector2`) - Amazon CloudWatch Internet Monitor (`package:aws_client/internet_monitor`) - AWS IoT (`package:aws_client/iot`) @@ -351,6 +371,7 @@ The following is a list of APIs that are currently available inside this package - AWS Key Management Service (`package:aws_client/kms`) - AWS Lake Formation (`package:aws_client/lake_formation`) - AWS Lambda (`package:aws_client/lambda`) +- AWS Launch Wizard (`package:aws_client/launch_wizard`) - Amazon Lex Model Building Service (`package:aws_client/lex_model_building_service`) - AWS License Manager (`package:aws_client/license_manager`) - AWS License Manager Linux Subscriptions (`package:aws_client/license_manager_linux_subscriptions`) @@ -365,8 +386,12 @@ The following is a list of APIs that are currently available inside this package - Amazon Machine Learning (`package:aws_client/machine_learning`) - Amazon Macie (`package:aws_client/macie`) - Amazon Macie 2 (`package:aws_client/macie2`) +- MailManager (`package:aws_client/mail_manager`) - Amazon Managed Blockchain (`package:aws_client/managed_blockchain`) +- Amazon Managed Blockchain Query (`package:aws_client/managed_blockchain_query`) +- AWS Marketplace Agreement Service (`package:aws_client/marketplace_agreement`) - AWS Marketplace Catalog Service (`package:aws_client/marketplace_catalog`) +- AWS Marketplace Deployment Service (`package:aws_client/marketplace_deployment`) - AWS Marketplace Commerce Analytics (`package:aws_client/marketplace_commerce_analytics`) - AWS MediaConnect (`package:aws_client/media_connect`) - AWS Elemental MediaConvert (`package:aws_client/media_convert`) @@ -377,6 +402,7 @@ The following is a list of APIs that are currently available inside this package - AWS Elemental MediaStore (`package:aws_client/media_store`) - AWS Elemental MediaStore Data Plane (`package:aws_client/media_store_data`) - AWS MediaTailor (`package:aws_client/media_tailor`) +- AWS Health Imaging (`package:aws_client/medical_imaging`) - Amazon MemoryDB (`package:aws_client/memory_db`) - AWSMarketplace Metering (`package:aws_client/marketplace_metering`) - Application Migration Service (`package:aws_client/mgn`) @@ -392,8 +418,10 @@ The following is a list of APIs that are currently available inside this package - Amazon Mechanical Turk (`package:aws_client/m_turk`) - AmazonMWAA (`package:aws_client/mwaa`) - Amazon Neptune (`package:aws_client/neptune`) +- Amazon NeptuneData (`package:aws_client/neptunedata`) - AWS Network Firewall (`package:aws_client/network_firewall`) - AWS Network Manager (`package:aws_client/network_manager`) +- Amazon CloudWatch Network Monitor (`package:aws_client/network_monitor`) - AmazonNimbleStudio (`package:aws_client/nimble`) - CloudWatch Observability Access Manager (`package:aws_client/oam`) - Amazon Omics (`package:aws_client/omics`) @@ -405,6 +433,9 @@ The following is a list of APIs that are currently available inside this package - Amazon OpenSearch Ingestion (`package:aws_client/osis`) - AWS Outposts (`package:aws_client/outposts`) - AWS Panorama (`package:aws_client/panorama`) +- Payment Cryptography Control Plane (`package:aws_client/payment_cryptography`) +- Payment Cryptography Data Plane (`package:aws_client/payment_cryptography_data`) +- PcaConnectorAd (`package:aws_client/pca_connector_ad`) - Amazon Personalize (`package:aws_client/personalize`) - Amazon Personalize Events (`package:aws_client/personalize_events`) - Amazon Personalize Runtime (`package:aws_client/personalize_runtime`) @@ -417,6 +448,8 @@ The following is a list of APIs that are currently available inside this package - AWS Price List Service (`package:aws_client/pricing`) - AWS Private 5G (`package:aws_client/private_networks`) - AWS Proton (`package:aws_client/proton`) +- QBusiness (`package:aws_client/q_business`) +- Amazon Q Connect (`package:aws_client/q_connect`) - Amazon QLDB (`package:aws_client/qldb`) - Amazon QLDB Session (`package:aws_client/qldb_session`) - Amazon QuickSight (`package:aws_client/quick_sight`) @@ -428,6 +461,7 @@ The following is a list of APIs that are currently available inside this package - Redshift Data API Service (`package:aws_client/redshift_data`) - Redshift Serverless (`package:aws_client/redshift_serverless`) - Amazon Rekognition (`package:aws_client/rekognition`) +- AWS re:Post Private (`package:aws_client/repostspace`) - AWS Resilience Hub (`package:aws_client/resiliencehub`) - AWS Resource Explorer (`package:aws_client/resource_explorer_2`) - AWS Resource Groups (`package:aws_client/resource_groups`) @@ -439,6 +473,7 @@ The following is a list of APIs that are currently available inside this package - AWS Route53 Recovery Control Config (`package:aws_client/route_53_recovery_control_config`) - AWS Route53 Recovery Readiness (`package:aws_client/route_53_recovery_readiness`) - Amazon Route 53 Domains (`package:aws_client/route_53_domains`) +- Route 53 Profiles (`package:aws_client/route_53_profiles`) - Amazon Route 53 Resolver (`package:aws_client/route_53_resolver`) - CloudWatch RUM (`package:aws_client/rum`) - Amazon Lex Runtime Service (`package:aws_client/lex_runtime_service`) @@ -486,17 +521,22 @@ The following is a list of APIs that are currently available inside this package - AWS Storage Gateway (`package:aws_client/storage_gateway`) - Amazon DynamoDB Streams (`package:aws_client/dynamo_db_streams`) - AWS Security Token Service (`package:aws_client/sts`) +- AWS Supply Chain (`package:aws_client/supply_chain`) - AWS Support (`package:aws_client/support`) - AWS Support App (`package:aws_client/support_app`) - Amazon Simple Workflow Service (`package:aws_client/swf`) - Synthetics (`package:aws_client/synthetics`) +- Tax Settings (`package:aws_client/tax_settings`) - Amazon Textract (`package:aws_client/textract`) +- Timestream InfluxDB (`package:aws_client/timestream_influx_db`) - Amazon Timestream Query (`package:aws_client/timestream_query`) - Amazon Timestream Write (`package:aws_client/timestream_write`) - AWS Telco Network Builder (`package:aws_client/tnb`) - Amazon Transcribe Service (`package:aws_client/transcribe`) - AWS Transfer Family (`package:aws_client/transfer`) - Amazon Translate (`package:aws_client/translate`) +- TrustedAdvisor Public API (`package:aws_client/trusted_advisor`) +- Amazon Verified Permissions (`package:aws_client/verified_permissions`) - Amazon Voice ID (`package:aws_client/voice_id`) - Amazon VPC Lattice (`package:aws_client/vpc_lattice`) - AWS WAF (`package:aws_client/waf`) @@ -509,5 +549,6 @@ The following is a list of APIs that are currently available inside this package - Amazon WorkMail (`package:aws_client/work_mail`) - Amazon WorkMail Message Flow (`package:aws_client/work_mail_message_flow`) - Amazon WorkSpaces (`package:aws_client/work_spaces`) +- Amazon WorkSpaces Thin Client (`package:aws_client/work_spaces_thin_client`) - Amazon WorkSpaces Web (`package:aws_client/work_spaces_web`) - AWS X-Ray (`package:aws_client/x_ray`) \ No newline at end of file diff --git a/aws_client/lib/app_fabric_2023_05_19.dart b/aws_client/lib/app_fabric_2023_05_19.dart new file mode 100644 index 000000000..0f232ae3b --- /dev/null +++ b/aws_client/lib/app_fabric_2023_05_19.dart @@ -0,0 +1 @@ +export '../src/generated/app_fabric/v2023_05_19.dart'; diff --git a/aws_client/lib/artifact_2018_05_10.dart b/aws_client/lib/artifact_2018_05_10.dart new file mode 100644 index 000000000..699e8119e --- /dev/null +++ b/aws_client/lib/artifact_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/artifact/v2018_05_10.dart'; diff --git a/aws_client/lib/b2_bi_2022_06_23.dart b/aws_client/lib/b2_bi_2022_06_23.dart new file mode 100644 index 000000000..ff3398892 --- /dev/null +++ b/aws_client/lib/b2_bi_2022_06_23.dart @@ -0,0 +1 @@ +export '../src/generated/b2_bi/v2022_06_23.dart'; diff --git a/aws_client/lib/bcm_data_exports_2023_11_26.dart b/aws_client/lib/bcm_data_exports_2023_11_26.dart new file mode 100644 index 000000000..196a7d76c --- /dev/null +++ b/aws_client/lib/bcm_data_exports_2023_11_26.dart @@ -0,0 +1 @@ +export '../src/generated/bcm_data_exports/v2023_11_26.dart'; diff --git a/aws_client/lib/bedrock_2023_04_20.dart b/aws_client/lib/bedrock_2023_04_20.dart new file mode 100644 index 000000000..3dd4b0e27 --- /dev/null +++ b/aws_client/lib/bedrock_2023_04_20.dart @@ -0,0 +1 @@ +export '../src/generated/bedrock/v2023_04_20.dart'; diff --git a/aws_client/lib/bedrock_agent_2023_06_05.dart b/aws_client/lib/bedrock_agent_2023_06_05.dart new file mode 100644 index 000000000..bc8d0cd7e --- /dev/null +++ b/aws_client/lib/bedrock_agent_2023_06_05.dart @@ -0,0 +1 @@ +export '../src/generated/bedrock_agent/v2023_06_05.dart'; diff --git a/aws_client/lib/bedrock_agent_runtime_2023_07_26.dart b/aws_client/lib/bedrock_agent_runtime_2023_07_26.dart new file mode 100644 index 000000000..70f6f61df --- /dev/null +++ b/aws_client/lib/bedrock_agent_runtime_2023_07_26.dart @@ -0,0 +1 @@ +export '../src/generated/bedrock_agent_runtime/v2023_07_26.dart'; diff --git a/aws_client/lib/bedrock_runtime_2023_09_30.dart b/aws_client/lib/bedrock_runtime_2023_09_30.dart new file mode 100644 index 000000000..cce51c429 --- /dev/null +++ b/aws_client/lib/bedrock_runtime_2023_09_30.dart @@ -0,0 +1 @@ +export '../src/generated/bedrock_runtime/v2023_09_30.dart'; diff --git a/aws_client/lib/chatbot_2017_10_11.dart b/aws_client/lib/chatbot_2017_10_11.dart new file mode 100644 index 000000000..a09ff377f --- /dev/null +++ b/aws_client/lib/chatbot_2017_10_11.dart @@ -0,0 +1 @@ +export '../src/generated/chatbot/v2017_10_11.dart'; diff --git a/aws_client/lib/clean_rooms_ml_2023_09_06.dart b/aws_client/lib/clean_rooms_ml_2023_09_06.dart new file mode 100644 index 000000000..1c47722cd --- /dev/null +++ b/aws_client/lib/clean_rooms_ml_2023_09_06.dart @@ -0,0 +1 @@ +export '../src/generated/clean_rooms_ml/v2023_09_06.dart'; diff --git a/aws_client/lib/code_connections_2023_12_01.dart b/aws_client/lib/code_connections_2023_12_01.dart new file mode 100644 index 000000000..78518e7c9 --- /dev/null +++ b/aws_client/lib/code_connections_2023_12_01.dart @@ -0,0 +1 @@ +export '../src/generated/code_connections/v2023_12_01.dart'; diff --git a/aws_client/lib/code_guru_security_2018_05_10.dart b/aws_client/lib/code_guru_security_2018_05_10.dart new file mode 100644 index 000000000..b9f155840 --- /dev/null +++ b/aws_client/lib/code_guru_security_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/code_guru_security/v2018_05_10.dart'; diff --git a/aws_client/lib/control_catalog_2018_05_10.dart b/aws_client/lib/control_catalog_2018_05_10.dart new file mode 100644 index 000000000..ef248f544 --- /dev/null +++ b/aws_client/lib/control_catalog_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/control_catalog/v2018_05_10.dart'; diff --git a/aws_client/lib/cost_optimization_hub_2022_07_26.dart b/aws_client/lib/cost_optimization_hub_2022_07_26.dart new file mode 100644 index 000000000..5f0c43602 --- /dev/null +++ b/aws_client/lib/cost_optimization_hub_2022_07_26.dart @@ -0,0 +1 @@ +export '../src/generated/cost_optimization_hub/v2022_07_26.dart'; diff --git a/aws_client/lib/data_zone_2018_05_10.dart b/aws_client/lib/data_zone_2018_05_10.dart new file mode 100644 index 000000000..e132ee12e --- /dev/null +++ b/aws_client/lib/data_zone_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/data_zone/v2018_05_10.dart'; diff --git a/aws_client/lib/deadline_2023_10_12.dart b/aws_client/lib/deadline_2023_10_12.dart new file mode 100644 index 000000000..8bf874ce9 --- /dev/null +++ b/aws_client/lib/deadline_2023_10_12.dart @@ -0,0 +1 @@ +export '../src/generated/deadline/v2023_10_12.dart'; diff --git a/aws_client/lib/eks_auth_2023_11_26.dart b/aws_client/lib/eks_auth_2023_11_26.dart new file mode 100644 index 000000000..b9be23325 --- /dev/null +++ b/aws_client/lib/eks_auth_2023_11_26.dart @@ -0,0 +1 @@ +export '../src/generated/eks_auth/v2023_11_26.dart'; diff --git a/aws_client/lib/entity_resolution_2018_05_10.dart b/aws_client/lib/entity_resolution_2018_05_10.dart new file mode 100644 index 000000000..6efb45c47 --- /dev/null +++ b/aws_client/lib/entity_resolution_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/entity_resolution/v2018_05_10.dart'; diff --git a/aws_client/lib/free_tier_2023_09_07.dart b/aws_client/lib/free_tier_2023_09_07.dart new file mode 100644 index 000000000..98cc698d4 --- /dev/null +++ b/aws_client/lib/free_tier_2023_09_07.dart @@ -0,0 +1 @@ +export '../src/generated/free_tier/v2023_09_07.dart'; diff --git a/aws_client/lib/inspector_scan_2023_08_08.dart b/aws_client/lib/inspector_scan_2023_08_08.dart new file mode 100644 index 000000000..9ccbb6305 --- /dev/null +++ b/aws_client/lib/inspector_scan_2023_08_08.dart @@ -0,0 +1 @@ +export '../src/generated/inspector_scan/v2023_08_08.dart'; diff --git a/aws_client/lib/launch_wizard_2018_05_10.dart b/aws_client/lib/launch_wizard_2018_05_10.dart new file mode 100644 index 000000000..3f236cc91 --- /dev/null +++ b/aws_client/lib/launch_wizard_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/launch_wizard/v2018_05_10.dart'; diff --git a/aws_client/lib/mail_manager_2023_10_17.dart b/aws_client/lib/mail_manager_2023_10_17.dart new file mode 100644 index 000000000..8782b8dbb --- /dev/null +++ b/aws_client/lib/mail_manager_2023_10_17.dart @@ -0,0 +1 @@ +export '../src/generated/mail_manager/v2023_10_17.dart'; diff --git a/aws_client/lib/managed_blockchain_query_2023_05_04.dart b/aws_client/lib/managed_blockchain_query_2023_05_04.dart new file mode 100644 index 000000000..5ab06bd65 --- /dev/null +++ b/aws_client/lib/managed_blockchain_query_2023_05_04.dart @@ -0,0 +1 @@ +export '../src/generated/managed_blockchain_query/v2023_05_04.dart'; diff --git a/aws_client/lib/marketplace_agreement_2020_03_01.dart b/aws_client/lib/marketplace_agreement_2020_03_01.dart new file mode 100644 index 000000000..ddbd1845e --- /dev/null +++ b/aws_client/lib/marketplace_agreement_2020_03_01.dart @@ -0,0 +1 @@ +export '../src/generated/marketplace_agreement/v2020_03_01.dart'; diff --git a/aws_client/lib/marketplace_deployment_2023_01_25.dart b/aws_client/lib/marketplace_deployment_2023_01_25.dart new file mode 100644 index 000000000..e30403f95 --- /dev/null +++ b/aws_client/lib/marketplace_deployment_2023_01_25.dart @@ -0,0 +1 @@ +export '../src/generated/marketplace_deployment/v2023_01_25.dart'; diff --git a/aws_client/lib/medical_imaging_2023_07_19.dart b/aws_client/lib/medical_imaging_2023_07_19.dart new file mode 100644 index 000000000..c0b87f3fa --- /dev/null +++ b/aws_client/lib/medical_imaging_2023_07_19.dart @@ -0,0 +1 @@ +export '../src/generated/medical_imaging/v2023_07_19.dart'; diff --git a/aws_client/lib/neptunedata_2023_08_01.dart b/aws_client/lib/neptunedata_2023_08_01.dart new file mode 100644 index 000000000..6985ebde7 --- /dev/null +++ b/aws_client/lib/neptunedata_2023_08_01.dart @@ -0,0 +1 @@ +export '../src/generated/neptunedata/v2023_08_01.dart'; diff --git a/aws_client/lib/network_monitor_2023_08_01.dart b/aws_client/lib/network_monitor_2023_08_01.dart new file mode 100644 index 000000000..b4c46a483 --- /dev/null +++ b/aws_client/lib/network_monitor_2023_08_01.dart @@ -0,0 +1 @@ +export '../src/generated/network_monitor/v2023_08_01.dart'; diff --git a/aws_client/lib/payment_cryptography_2021_09_14.dart b/aws_client/lib/payment_cryptography_2021_09_14.dart new file mode 100644 index 000000000..764c9dba0 --- /dev/null +++ b/aws_client/lib/payment_cryptography_2021_09_14.dart @@ -0,0 +1 @@ +export '../src/generated/payment_cryptography/v2021_09_14.dart'; diff --git a/aws_client/lib/payment_cryptography_data_2022_02_03.dart b/aws_client/lib/payment_cryptography_data_2022_02_03.dart new file mode 100644 index 000000000..c0e322004 --- /dev/null +++ b/aws_client/lib/payment_cryptography_data_2022_02_03.dart @@ -0,0 +1 @@ +export '../src/generated/payment_cryptography_data/v2022_02_03.dart'; diff --git a/aws_client/lib/pca_connector_ad_2018_05_10.dart b/aws_client/lib/pca_connector_ad_2018_05_10.dart new file mode 100644 index 000000000..887b0fc6c --- /dev/null +++ b/aws_client/lib/pca_connector_ad_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/pca_connector_ad/v2018_05_10.dart'; diff --git a/aws_client/lib/q_business_2023_11_27.dart b/aws_client/lib/q_business_2023_11_27.dart new file mode 100644 index 000000000..b4d0e67cb --- /dev/null +++ b/aws_client/lib/q_business_2023_11_27.dart @@ -0,0 +1 @@ +export '../src/generated/q_business/v2023_11_27.dart'; diff --git a/aws_client/lib/q_connect_2020_10_19.dart b/aws_client/lib/q_connect_2020_10_19.dart new file mode 100644 index 000000000..44e564665 --- /dev/null +++ b/aws_client/lib/q_connect_2020_10_19.dart @@ -0,0 +1 @@ +export '../src/generated/q_connect/v2020_10_19.dart'; diff --git a/aws_client/lib/repostspace_2022_05_13.dart b/aws_client/lib/repostspace_2022_05_13.dart new file mode 100644 index 000000000..1f8221291 --- /dev/null +++ b/aws_client/lib/repostspace_2022_05_13.dart @@ -0,0 +1 @@ +export '../src/generated/repostspace/v2022_05_13.dart'; diff --git a/aws_client/lib/route_53_profiles_2018_05_10.dart b/aws_client/lib/route_53_profiles_2018_05_10.dart new file mode 100644 index 000000000..7775f000f --- /dev/null +++ b/aws_client/lib/route_53_profiles_2018_05_10.dart @@ -0,0 +1 @@ +export '../src/generated/route_53_profiles/v2018_05_10.dart'; diff --git a/aws_client/lib/src/generated/access_analyzer/v2019_11_01.dart b/aws_client/lib/src/generated/access_analyzer/v2019_11_01.dart index 338b6c82d..62d48ca5c 100644 --- a/aws_client/lib/src/generated/access_analyzer/v2019_11_01.dart +++ b/aws_client/lib/src/generated/access_analyzer/v2019_11_01.dart @@ -19,21 +19,37 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Identity and Access Management Access Analyzer helps identify potential -/// resource-access risks by enabling you to identify any policies that grant +/// Identity and Access Management Access Analyzer helps you to set, verify, and +/// refine your IAM policies by providing a suite of capabilities. Its features +/// include findings for external and unused access, basic and custom policy +/// checks for validating policies, and policy generation to generate +/// fine-grained policies. To start using IAM Access Analyzer to identify +/// external or unused access, you first need to create an analyzer. +/// +/// External access analyzers help identify potential risks of accessing +/// resources by enabling you to identify any resource policies that grant /// access to an external principal. It does this by using logic-based reasoning /// to analyze resource-based policies in your Amazon Web Services environment. /// An external principal can be another Amazon Web Services account, a root /// user, an IAM user or role, a federated user, an Amazon Web Services service, -/// or an anonymous user. You can also use IAM Access Analyzer to preview and -/// validate public and cross-account access to your resources before deploying -/// permissions changes. This guide describes the Identity and Access Management -/// Access Analyzer operations that you can call programmatically. For general -/// information about IAM Access Analyzer, see Unused access analyzers help identify potential identity access risks +/// by enabling you to identify unused IAM roles, unused access keys, unused +/// console passwords, and IAM principals with unused service and action-level +/// permissions. +/// +/// Beyond findings, IAM Access Analyzer provides basic and custom policy checks +/// to validate IAM policies before deploying permissions changes. You can use +/// policy generation to refine permissions by attaching a policy generated +/// using access activity logged in CloudTrail logs. +/// +/// This guide describes the IAM Access Analyzer operations that you can call +/// programmatically. For general information about IAM Access Analyzer, see Identity /// and Access Management Access Analyzer in the IAM User Guide. -/// -/// To start using IAM Access Analyzer, you first need to create an analyzer. class AccessAnalyzer { final _s.RestJsonProtocol _protocol; AccessAnalyzer({ @@ -122,6 +138,103 @@ class AccessAnalyzer { ); } + /// Checks whether the specified access isn't allowed by a policy. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [UnprocessableEntityException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [access] : + /// An access object containing the permissions that shouldn't be granted by + /// the specified policy. + /// + /// Parameter [policyDocument] : + /// The JSON policy document to use as the content for the policy. + /// + /// Parameter [policyType] : + /// The type of policy. Identity policies grant permissions to IAM principals. + /// Identity policies include managed and inline policies for IAM roles, + /// users, and groups. + /// + /// Resource policies grant permissions on Amazon Web Services resources. + /// Resource policies include trust policies for IAM roles and bucket policies + /// for Amazon S3 buckets. You can provide a generic input such as identity + /// policy or resource policy or a specific input such as managed policy or + /// Amazon S3 bucket policy. + Future checkAccessNotGranted({ + required List access, + required String policyDocument, + required AccessCheckPolicyType policyType, + }) async { + final $payload = { + 'access': access, + 'policyDocument': policyDocument, + 'policyType': policyType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/policy/check-access-not-granted', + exceptionFnMap: _exceptionFns, + ); + return CheckAccessNotGrantedResponse.fromJson(response); + } + + /// Checks whether new access is allowed for an updated policy when compared + /// to the existing policy. + /// + /// You can find examples for reference policies and learn how to set up and + /// run a custom policy check for new access in the IAM + /// Access Analyzer custom policy checks samples repository on GitHub. The + /// reference policies in this repository are meant to be passed to the + /// existingPolicyDocument request parameter. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [UnprocessableEntityException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [existingPolicyDocument] : + /// The JSON policy document to use as the content for the existing policy. + /// + /// Parameter [newPolicyDocument] : + /// The JSON policy document to use as the content for the updated policy. + /// + /// Parameter [policyType] : + /// The type of policy to compare. Identity policies grant permissions to IAM + /// principals. Identity policies include managed and inline policies for IAM + /// roles, users, and groups. + /// + /// Resource policies grant permissions on Amazon Web Services resources. + /// Resource policies include trust policies for IAM roles and bucket policies + /// for Amazon S3 buckets. You can provide a generic input such as identity + /// policy or resource policy or a specific input such as managed policy or + /// Amazon S3 bucket policy. + Future checkNoNewAccess({ + required String existingPolicyDocument, + required String newPolicyDocument, + required AccessCheckPolicyType policyType, + }) async { + final $payload = { + 'existingPolicyDocument': existingPolicyDocument, + 'newPolicyDocument': newPolicyDocument, + 'policyType': policyType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/policy/check-no-new-access', + exceptionFnMap: _exceptionFns, + ); + return CheckNoNewAccessResponse.fromJson(response); + } + /// Creates an access preview that allows you to preview IAM Access Analyzer /// findings for your resource before deploying resource permissions. /// @@ -180,9 +293,11 @@ class AccessAnalyzer { /// The name of the analyzer to create. /// /// Parameter [type] : - /// The type of analyzer to create. Only ACCOUNT and ORGANIZATION analyzers - /// are supported. You can create only one analyzer per account per Region. - /// You can create up to 5 analyzers per organization per Region. + /// The type of analyzer to create. Only ACCOUNT, + /// ORGANIZATION, ACCOUNT_UNUSED_ACCESS, and + /// ORGANIZATION_UNUSED_ACCESS analyzers are supported. You can + /// create only one analyzer per account per Region. You can create up to 5 + /// analyzers per organization per Region. /// /// Parameter [archiveRules] : /// Specifies the archive rules to add for the analyzer. Archive rules @@ -192,13 +307,20 @@ class AccessAnalyzer { /// Parameter [clientToken] : /// A client token. /// + /// Parameter [configuration] : + /// Specifies the configuration of the analyzer. If the analyzer is an unused + /// access analyzer, the specified scope of unused access is used for the + /// configuration. If the analyzer is an external access analyzer, this field + /// is not used. + /// /// Parameter [tags] : - /// The tags to apply to the analyzer. + /// An array of key-value pairs to apply to the analyzer. Future createAnalyzer({ required String analyzerName, required Type type, List? archiveRules, String? clientToken, + AnalyzerConfiguration? configuration, Map? tags, }) async { final $payload = { @@ -206,6 +328,7 @@ class AccessAnalyzer { 'type': type.toValue(), if (archiveRules != null) 'archiveRules': archiveRules, 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (configuration != null) 'configuration': configuration, if (tags != null) 'tags': tags, }; final response = await _protocol.send( @@ -449,7 +572,10 @@ class AccessAnalyzer { return GetArchiveRuleResponse.fromJson(response); } - /// Retrieves information about the specified finding. + /// Retrieves information about the specified finding. GetFinding and + /// GetFindingV2 both use access-analyzer:GetFinding in the + /// Action element of an IAM policy statement. You must have + /// permission to perform the access-analyzer:GetFinding action. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -481,6 +607,51 @@ class AccessAnalyzer { return GetFindingResponse.fromJson(response); } + /// Retrieves information about the specified finding. GetFinding and + /// GetFindingV2 both use access-analyzer:GetFinding in the + /// Action element of an IAM policy statement. You must have + /// permission to perform the access-analyzer:GetFinding action. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analyzerArn] : + /// The ARN + /// of the analyzer that generated the finding. + /// + /// Parameter [id] : + /// The ID of the finding to retrieve. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. + /// + /// Parameter [nextToken] : + /// A token used for pagination of results returned. + Future getFindingV2({ + required String analyzerArn, + required String id, + int? maxResults, + String? nextToken, + }) async { + final $query = >{ + 'analyzerArn': [analyzerArn], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/findingv2/${Uri.encodeComponent(id)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetFindingV2Response.fromJson(response); + } + /// Retrieves the policy that was generated using /// StartPolicyGeneration. /// @@ -620,7 +791,8 @@ class AccessAnalyzer { } /// Retrieves a list of resources of the specified type that have been - /// analyzed by the specified analyzer.. + /// analyzed by the specified external access analyzer. This action is not + /// supported for unused access analyzers. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -732,6 +904,10 @@ class AccessAnalyzer { } /// Retrieves a list of findings generated by the specified analyzer. + /// ListFindings and ListFindingsV2 both use + /// access-analyzer:ListFindings in the Action + /// element of an IAM policy statement. You must have permission to perform + /// the access-analyzer:ListFindings action. /// /// To learn about filter keys that you can use to retrieve a list of /// findings, see access-analyzer:ListFindings in the Action + /// element of an IAM policy statement. You must have permission to perform + /// the access-analyzer:ListFindings action. + /// + /// To learn about filter keys that you can use to retrieve a list of + /// findings, see IAM + /// Access Analyzer filter keys in the IAM User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analyzerArn] : + /// The ARN + /// of the analyzer to retrieve findings from. + /// + /// Parameter [filter] : + /// A filter to match for the findings to return. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. + /// + /// Parameter [nextToken] : + /// A token used for pagination of results returned. + Future listFindingsV2({ + required String analyzerArn, + Map? filter, + int? maxResults, + String? nextToken, + SortCriteria? sort, + }) async { + final $payload = { + 'analyzerArn': analyzerArn, + if (filter != null) 'filter': filter, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (sort != null) 'sort': sort, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/findingv2', + exceptionFnMap: _exceptionFns, + ); + return ListFindingsV2Response.fromJson(response); + } + /// Lists all of the policy generations requested in the last seven days. /// /// May throw [ValidationException]. @@ -1096,9 +1325,7 @@ class AccessAnalyzer { /// Parameter [policyType] : /// The type of policy to validate. Identity policies grant permissions to IAM /// principals. Identity policies include managed and inline policies for IAM - /// roles, users, and groups. They also include service-control policies - /// (SCPs) that are attached to an Amazon Web Services organization, - /// organizational unit (OU), or an account. + /// roles, users, and groups. /// /// Resource policies grant permissions on Amazon Web Services resources. /// Resource policies include trust policies for IAM roles and bucket policies @@ -1106,6 +1333,10 @@ class AccessAnalyzer { /// policy or resource policy or a specific input such as managed policy or /// Amazon S3 bucket policy. /// + /// Service control policies (SCPs) are a type of organization policy attached + /// to an Amazon Web Services organization, organizational unit (OU), or an + /// account. + /// /// Parameter [locale] : /// The locale to use for localizing the findings. /// @@ -1157,6 +1388,53 @@ class AccessAnalyzer { } } +/// Contains information about actions that define permissions to check against +/// a policy. +class Access { + /// A list of actions for the access permissions. Any strings that can be used + /// as an action in an IAM policy can be used in the list of actions to check. + final List actions; + + Access({ + required this.actions, + }); + + Map toJson() { + final actions = this.actions; + return { + 'actions': actions, + }; + } +} + +enum AccessCheckPolicyType { + identityPolicy, + resourcePolicy, +} + +extension AccessCheckPolicyTypeValueExtension on AccessCheckPolicyType { + String toValue() { + switch (this) { + case AccessCheckPolicyType.identityPolicy: + return 'IDENTITY_POLICY'; + case AccessCheckPolicyType.resourcePolicy: + return 'RESOURCE_POLICY'; + } + } +} + +extension AccessCheckPolicyTypeFromString on String { + AccessCheckPolicyType toAccessCheckPolicyType() { + switch (this) { + case 'IDENTITY_POLICY': + return AccessCheckPolicyType.identityPolicy; + case 'RESOURCE_POLICY': + return AccessCheckPolicyType.resourcePolicy; + } + throw Exception('$this is not known in enum AccessCheckPolicyType'); + } +} + /// Contains information about an access preview. class AccessPreview { /// The ARN of the analyzer used to generate the access preview. @@ -1770,6 +2048,35 @@ class AnalyzedResourceSummary { } } +/// Contains information about the configuration of an unused access analyzer +/// for an Amazon Web Services organization or account. +class AnalyzerConfiguration { + /// Specifies the configuration of an unused access analyzer for an Amazon Web + /// Services organization or account. External access analyzers do not support + /// any configuration. + final UnusedAccessConfiguration? unusedAccess; + + AnalyzerConfiguration({ + this.unusedAccess, + }); + + factory AnalyzerConfiguration.fromJson(Map json) { + return AnalyzerConfiguration( + unusedAccess: json['unusedAccess'] != null + ? UnusedAccessConfiguration.fromJson( + json['unusedAccess'] as Map) + : null, + ); + } + + Map toJson() { + final unusedAccess = this.unusedAccess; + return { + if (unusedAccess != null) 'unusedAccess': unusedAccess, + }; + } +} + enum AnalyzerStatus { active, creating, @@ -1832,6 +2139,10 @@ class AnalyzerSummary { /// analyzer. final Type type; + /// Specifies whether the analyzer is an external access or unused access + /// analyzer. + final AnalyzerConfiguration? configuration; + /// The resource that was most recently analyzed by the analyzer. final String? lastResourceAnalyzed; @@ -1855,6 +2166,7 @@ class AnalyzerSummary { required this.name, required this.status, required this.type, + this.configuration, this.lastResourceAnalyzed, this.lastResourceAnalyzedAt, this.statusReason, @@ -1868,6 +2180,10 @@ class AnalyzerSummary { name: json['name'] as String, status: (json['status'] as String).toAnalyzerStatus(), type: (json['type'] as String).toType(), + configuration: json['configuration'] != null + ? AnalyzerConfiguration.fromJson( + json['configuration'] as Map) + : null, lastResourceAnalyzed: json['lastResourceAnalyzed'] as String?, lastResourceAnalyzedAt: timeStampFromJson(json['lastResourceAnalyzedAt']), statusReason: json['statusReason'] != null @@ -1884,6 +2200,7 @@ class AnalyzerSummary { final name = this.name; final status = this.status; final type = this.type; + final configuration = this.configuration; final lastResourceAnalyzed = this.lastResourceAnalyzed; final lastResourceAnalyzedAt = this.lastResourceAnalyzedAt; final statusReason = this.statusReason; @@ -1894,6 +2211,7 @@ class AnalyzerSummary { 'name': name, 'status': status.toValue(), 'type': type.toValue(), + if (configuration != null) 'configuration': configuration, if (lastResourceAnalyzed != null) 'lastResourceAnalyzed': lastResourceAnalyzed, if (lastResourceAnalyzedAt != null) @@ -1961,6 +2279,147 @@ class CancelPolicyGenerationResponse { } } +class CheckAccessNotGrantedResponse { + /// The message indicating whether the specified access is allowed. + final String? message; + + /// A description of the reasoning of the result. + final List? reasons; + + /// The result of the check for whether the access is allowed. If the result is + /// PASS, the specified policy doesn't allow any of the specified + /// permissions in the access object. If the result is FAIL, the + /// specified policy might allow some or all of the permissions in the access + /// object. + final CheckAccessNotGrantedResult? result; + + CheckAccessNotGrantedResponse({ + this.message, + this.reasons, + this.result, + }); + + factory CheckAccessNotGrantedResponse.fromJson(Map json) { + return CheckAccessNotGrantedResponse( + message: json['message'] as String?, + reasons: (json['reasons'] as List?) + ?.whereNotNull() + .map((e) => ReasonSummary.fromJson(e as Map)) + .toList(), + result: (json['result'] as String?)?.toCheckAccessNotGrantedResult(), + ); + } + + Map toJson() { + final message = this.message; + final reasons = this.reasons; + final result = this.result; + return { + if (message != null) 'message': message, + if (reasons != null) 'reasons': reasons, + if (result != null) 'result': result.toValue(), + }; + } +} + +enum CheckAccessNotGrantedResult { + pass, + fail, +} + +extension CheckAccessNotGrantedResultValueExtension + on CheckAccessNotGrantedResult { + String toValue() { + switch (this) { + case CheckAccessNotGrantedResult.pass: + return 'PASS'; + case CheckAccessNotGrantedResult.fail: + return 'FAIL'; + } + } +} + +extension CheckAccessNotGrantedResultFromString on String { + CheckAccessNotGrantedResult toCheckAccessNotGrantedResult() { + switch (this) { + case 'PASS': + return CheckAccessNotGrantedResult.pass; + case 'FAIL': + return CheckAccessNotGrantedResult.fail; + } + throw Exception('$this is not known in enum CheckAccessNotGrantedResult'); + } +} + +class CheckNoNewAccessResponse { + /// The message indicating whether the updated policy allows new access. + final String? message; + + /// A description of the reasoning of the result. + final List? reasons; + + /// The result of the check for new access. If the result is PASS, + /// no new access is allowed by the updated policy. If the result is + /// FAIL, the updated policy might allow new access. + final CheckNoNewAccessResult? result; + + CheckNoNewAccessResponse({ + this.message, + this.reasons, + this.result, + }); + + factory CheckNoNewAccessResponse.fromJson(Map json) { + return CheckNoNewAccessResponse( + message: json['message'] as String?, + reasons: (json['reasons'] as List?) + ?.whereNotNull() + .map((e) => ReasonSummary.fromJson(e as Map)) + .toList(), + result: (json['result'] as String?)?.toCheckNoNewAccessResult(), + ); + } + + Map toJson() { + final message = this.message; + final reasons = this.reasons; + final result = this.result; + return { + if (message != null) 'message': message, + if (reasons != null) 'reasons': reasons, + if (result != null) 'result': result.toValue(), + }; + } +} + +enum CheckNoNewAccessResult { + pass, + fail, +} + +extension CheckNoNewAccessResultValueExtension on CheckNoNewAccessResult { + String toValue() { + switch (this) { + case CheckNoNewAccessResult.pass: + return 'PASS'; + case CheckNoNewAccessResult.fail: + return 'FAIL'; + } + } +} + +extension CheckNoNewAccessResultFromString on String { + CheckNoNewAccessResult toCheckNoNewAccessResult() { + switch (this) { + case 'PASS': + return CheckNoNewAccessResult.pass; + case 'FAIL': + return CheckNoNewAccessResult.fail; + } + throw Exception('$this is not known in enum CheckNoNewAccessResult'); + } +} + /// Contains information about CloudTrail access. class CloudTrailDetails { /// The ARN of the service role that IAM Access Analyzer uses to access your @@ -2052,6 +2511,12 @@ class CloudTrailProperties { /// configuration as a type-value pair. You can specify only one type of access /// control configuration. class Configuration { + /// The access control configuration is for a DynamoDB stream. + final DynamodbStreamConfiguration? dynamodbStream; + + /// The access control configuration is for a DynamoDB table or index. + final DynamodbTableConfiguration? dynamodbTable; + /// The access control configuration is for an Amazon EBS volume snapshot. final EbsSnapshotConfiguration? ebsSnapshot; @@ -2073,9 +2538,12 @@ class Configuration { /// The access control configuration is for an Amazon RDS DB snapshot. final RdsDbSnapshotConfiguration? rdsDbSnapshot; - /// The access control configuration is for an Amazon S3 Bucket. + /// The access control configuration is for an Amazon S3 bucket. final S3BucketConfiguration? s3Bucket; + /// The access control configuration is for an Amazon S3 directory bucket. + final S3ExpressDirectoryBucketConfiguration? s3ExpressDirectoryBucket; + /// The access control configuration is for a Secrets Manager secret. final SecretsManagerSecretConfiguration? secretsManagerSecret; @@ -2086,6 +2554,8 @@ class Configuration { final SqsQueueConfiguration? sqsQueue; Configuration({ + this.dynamodbStream, + this.dynamodbTable, this.ebsSnapshot, this.ecrRepository, this.efsFileSystem, @@ -2094,6 +2564,7 @@ class Configuration { this.rdsDbClusterSnapshot, this.rdsDbSnapshot, this.s3Bucket, + this.s3ExpressDirectoryBucket, this.secretsManagerSecret, this.snsTopic, this.sqsQueue, @@ -2101,6 +2572,14 @@ class Configuration { factory Configuration.fromJson(Map json) { return Configuration( + dynamodbStream: json['dynamodbStream'] != null + ? DynamodbStreamConfiguration.fromJson( + json['dynamodbStream'] as Map) + : null, + dynamodbTable: json['dynamodbTable'] != null + ? DynamodbTableConfiguration.fromJson( + json['dynamodbTable'] as Map) + : null, ebsSnapshot: json['ebsSnapshot'] != null ? EbsSnapshotConfiguration.fromJson( json['ebsSnapshot'] as Map) @@ -2132,6 +2611,10 @@ class Configuration { ? S3BucketConfiguration.fromJson( json['s3Bucket'] as Map) : null, + s3ExpressDirectoryBucket: json['s3ExpressDirectoryBucket'] != null + ? S3ExpressDirectoryBucketConfiguration.fromJson( + json['s3ExpressDirectoryBucket'] as Map) + : null, secretsManagerSecret: json['secretsManagerSecret'] != null ? SecretsManagerSecretConfiguration.fromJson( json['secretsManagerSecret'] as Map) @@ -2148,6 +2631,8 @@ class Configuration { } Map toJson() { + final dynamodbStream = this.dynamodbStream; + final dynamodbTable = this.dynamodbTable; final ebsSnapshot = this.ebsSnapshot; final ecrRepository = this.ecrRepository; final efsFileSystem = this.efsFileSystem; @@ -2156,10 +2641,13 @@ class Configuration { final rdsDbClusterSnapshot = this.rdsDbClusterSnapshot; final rdsDbSnapshot = this.rdsDbSnapshot; final s3Bucket = this.s3Bucket; + final s3ExpressDirectoryBucket = this.s3ExpressDirectoryBucket; final secretsManagerSecret = this.secretsManagerSecret; final snsTopic = this.snsTopic; final sqsQueue = this.sqsQueue; return { + if (dynamodbStream != null) 'dynamodbStream': dynamodbStream, + if (dynamodbTable != null) 'dynamodbTable': dynamodbTable, if (ebsSnapshot != null) 'ebsSnapshot': ebsSnapshot, if (ecrRepository != null) 'ecrRepository': ecrRepository, if (efsFileSystem != null) 'efsFileSystem': efsFileSystem, @@ -2169,6 +2657,8 @@ class Configuration { 'rdsDbClusterSnapshot': rdsDbClusterSnapshot, if (rdsDbSnapshot != null) 'rdsDbSnapshot': rdsDbSnapshot, if (s3Bucket != null) 's3Bucket': s3Bucket, + if (s3ExpressDirectoryBucket != null) + 's3ExpressDirectoryBucket': s3ExpressDirectoryBucket, if (secretsManagerSecret != null) 'secretsManagerSecret': secretsManagerSecret, if (snsTopic != null) 'snsTopic': snsTopic, @@ -2278,6 +2768,94 @@ class Criterion { } } +/// The proposed access control configuration for a DynamoDB stream. You can +/// propose a configuration for a new DynamoDB stream or an existing DynamoDB +/// stream that you own by specifying the policy for the DynamoDB stream. For +/// more information, see PutResourcePolicy. +/// +///
    +///
  • +/// If the configuration is for an existing DynamoDB stream and you do not +/// specify the DynamoDB policy, then the access preview uses the existing +/// DynamoDB policy for the stream. +///
  • +///
  • +/// If the access preview is for a new resource and you do not specify the +/// policy, then the access preview assumes a DynamoDB stream without a policy. +///
  • +///
  • +/// To propose deletion of an existing DynamoDB stream policy, you can specify +/// an empty string for the DynamoDB policy. +///
  • +///
+class DynamodbStreamConfiguration { + /// The proposed resource policy defining who can access or manage the DynamoDB + /// stream. + final String? streamPolicy; + + DynamodbStreamConfiguration({ + this.streamPolicy, + }); + + factory DynamodbStreamConfiguration.fromJson(Map json) { + return DynamodbStreamConfiguration( + streamPolicy: json['streamPolicy'] as String?, + ); + } + + Map toJson() { + final streamPolicy = this.streamPolicy; + return { + if (streamPolicy != null) 'streamPolicy': streamPolicy, + }; + } +} + +/// The proposed access control configuration for a DynamoDB table or index. You +/// can propose a configuration for a new DynamoDB table or index or an existing +/// DynamoDB table or index that you own by specifying the policy for the +/// DynamoDB table or index. For more information, see PutResourcePolicy. +/// +///
    +///
  • +/// If the configuration is for an existing DynamoDB table or index and you do +/// not specify the DynamoDB policy, then the access preview uses the existing +/// DynamoDB policy for the table or index. +///
  • +///
  • +/// If the access preview is for a new resource and you do not specify the +/// policy, then the access preview assumes a DynamoDB table without a policy. +///
  • +///
  • +/// To propose deletion of an existing DynamoDB table or index policy, you can +/// specify an empty string for the DynamoDB policy. +///
  • +///
+class DynamodbTableConfiguration { + /// The proposed resource policy defining who can access or manage the DynamoDB + /// table. + final String? tablePolicy; + + DynamodbTableConfiguration({ + this.tablePolicy, + }); + + factory DynamodbTableConfiguration.fromJson(Map json) { + return DynamodbTableConfiguration( + tablePolicy: json['tablePolicy'] as String?, + ); + } + + Map toJson() { + final tablePolicy = this.tablePolicy; + return { + if (tablePolicy != null) 'tablePolicy': tablePolicy, + }; + } +} + /// The proposed access control configuration for an Amazon EBS volume snapshot. /// You can propose a configuration for a new Amazon EBS volume snapshot or an /// Amazon EBS volume snapshot that you own by specifying the user IDs, groups, @@ -2473,6 +3051,70 @@ class EfsFileSystemConfiguration { } } +/// Contains information about an external access finding. +class ExternalAccessDetails { + /// The condition in the analyzed policy statement that resulted in an external + /// access finding. + final Map condition; + + /// The action in the analyzed policy statement that an external principal has + /// permission to use. + final List? action; + + /// Specifies whether the external access finding is public. + final bool? isPublic; + + /// The external principal that has access to a resource within the zone of + /// trust. + final Map? principal; + + /// The sources of the external access finding. This indicates how the access + /// that generated the finding is granted. It is populated for Amazon S3 bucket + /// findings. + final List? sources; + + ExternalAccessDetails({ + required this.condition, + this.action, + this.isPublic, + this.principal, + this.sources, + }); + + factory ExternalAccessDetails.fromJson(Map json) { + return ExternalAccessDetails( + condition: (json['condition'] as Map) + .map((k, e) => MapEntry(k, e as String)), + action: (json['action'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + isPublic: json['isPublic'] as bool?, + principal: (json['principal'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + sources: (json['sources'] as List?) + ?.whereNotNull() + .map((e) => FindingSource.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final condition = this.condition; + final action = this.action; + final isPublic = this.isPublic; + final principal = this.principal; + final sources = this.sources; + return { + 'condition': condition, + if (action != null) 'action': action, + if (isPublic != null) 'isPublic': isPublic, + if (principal != null) 'principal': principal, + if (sources != null) 'sources': sources, + }; + } +} + /// Contains information about a finding. class Finding { /// The time at which the resource was analyzed. @@ -2510,7 +3152,8 @@ class Finding { /// to the resource. final bool? isPublic; - /// The external principal that access to a resource within the zone of trust. + /// The external principal that has access to a resource within the zone of + /// trust. final Map? principal; /// The resource that an external principal has access to. @@ -2631,6 +3274,83 @@ extension FindingChangeTypeFromString on String { } } +/// Contains information about an external access or unused access finding. Only +/// one parameter can be used in a FindingDetails object. +class FindingDetails { + /// The details for an external access analyzer finding. + final ExternalAccessDetails? externalAccessDetails; + + /// The details for an unused access analyzer finding with an unused IAM role + /// finding type. + final UnusedIamRoleDetails? unusedIamRoleDetails; + + /// The details for an unused access analyzer finding with an unused IAM user + /// access key finding type. + final UnusedIamUserAccessKeyDetails? unusedIamUserAccessKeyDetails; + + /// The details for an unused access analyzer finding with an unused IAM user + /// password finding type. + final UnusedIamUserPasswordDetails? unusedIamUserPasswordDetails; + + /// The details for an unused access analyzer finding with an unused permission + /// finding type. + final UnusedPermissionDetails? unusedPermissionDetails; + + FindingDetails({ + this.externalAccessDetails, + this.unusedIamRoleDetails, + this.unusedIamUserAccessKeyDetails, + this.unusedIamUserPasswordDetails, + this.unusedPermissionDetails, + }); + + factory FindingDetails.fromJson(Map json) { + return FindingDetails( + externalAccessDetails: json['externalAccessDetails'] != null + ? ExternalAccessDetails.fromJson( + json['externalAccessDetails'] as Map) + : null, + unusedIamRoleDetails: json['unusedIamRoleDetails'] != null + ? UnusedIamRoleDetails.fromJson( + json['unusedIamRoleDetails'] as Map) + : null, + unusedIamUserAccessKeyDetails: + json['unusedIamUserAccessKeyDetails'] != null + ? UnusedIamUserAccessKeyDetails.fromJson( + json['unusedIamUserAccessKeyDetails'] as Map) + : null, + unusedIamUserPasswordDetails: json['unusedIamUserPasswordDetails'] != null + ? UnusedIamUserPasswordDetails.fromJson( + json['unusedIamUserPasswordDetails'] as Map) + : null, + unusedPermissionDetails: json['unusedPermissionDetails'] != null + ? UnusedPermissionDetails.fromJson( + json['unusedPermissionDetails'] as Map) + : null, + ); + } + + Map toJson() { + final externalAccessDetails = this.externalAccessDetails; + final unusedIamRoleDetails = this.unusedIamRoleDetails; + final unusedIamUserAccessKeyDetails = this.unusedIamUserAccessKeyDetails; + final unusedIamUserPasswordDetails = this.unusedIamUserPasswordDetails; + final unusedPermissionDetails = this.unusedPermissionDetails; + return { + if (externalAccessDetails != null) + 'externalAccessDetails': externalAccessDetails, + if (unusedIamRoleDetails != null) + 'unusedIamRoleDetails': unusedIamRoleDetails, + if (unusedIamUserAccessKeyDetails != null) + 'unusedIamUserAccessKeyDetails': unusedIamUserAccessKeyDetails, + if (unusedIamUserPasswordDetails != null) + 'unusedIamUserPasswordDetails': unusedIamUserPasswordDetails, + if (unusedPermissionDetails != null) + 'unusedPermissionDetails': unusedPermissionDetails, + }; + } +} + /// The source of the finding. This indicates how the access that generated the /// finding is granted. It is populated for Amazon S3 bucket findings. class FindingSource { @@ -2904,26 +3624,156 @@ class FindingSummary { final isPublic = this.isPublic; final principal = this.principal; final resource = this.resource; - final sources = this.sources; + final sources = this.sources; + return { + 'analyzedAt': iso8601ToJson(analyzedAt), + 'condition': condition, + 'createdAt': iso8601ToJson(createdAt), + 'id': id, + 'resourceOwnerAccount': resourceOwnerAccount, + 'resourceType': resourceType.toValue(), + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (action != null) 'action': action, + if (error != null) 'error': error, + if (isPublic != null) 'isPublic': isPublic, + if (principal != null) 'principal': principal, + if (resource != null) 'resource': resource, + if (sources != null) 'sources': sources, + }; + } +} + +/// Contains information about a finding. +class FindingSummaryV2 { + /// The time at which the resource-based policy or IAM entity that generated the + /// finding was analyzed. + final DateTime analyzedAt; + + /// The time at which the finding was created. + final DateTime createdAt; + + /// The ID of the finding. + final String id; + + /// The Amazon Web Services account ID that owns the resource. + final String resourceOwnerAccount; + + /// The type of the resource that the external principal has access to. + final ResourceType resourceType; + + /// The status of the finding. + final FindingStatus status; + + /// The time at which the finding was most recently updated. + final DateTime updatedAt; + + /// The error that resulted in an Error finding. + final String? error; + + /// The type of the external access or unused access finding. + final FindingType? findingType; + + /// The resource that the external principal has access to. + final String? resource; + + FindingSummaryV2({ + required this.analyzedAt, + required this.createdAt, + required this.id, + required this.resourceOwnerAccount, + required this.resourceType, + required this.status, + required this.updatedAt, + this.error, + this.findingType, + this.resource, + }); + + factory FindingSummaryV2.fromJson(Map json) { + return FindingSummaryV2( + analyzedAt: nonNullableTimeStampFromJson(json['analyzedAt'] as Object), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + id: json['id'] as String, + resourceOwnerAccount: json['resourceOwnerAccount'] as String, + resourceType: (json['resourceType'] as String).toResourceType(), + status: (json['status'] as String).toFindingStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + error: json['error'] as String?, + findingType: (json['findingType'] as String?)?.toFindingType(), + resource: json['resource'] as String?, + ); + } + + Map toJson() { + final analyzedAt = this.analyzedAt; + final createdAt = this.createdAt; + final id = this.id; + final resourceOwnerAccount = this.resourceOwnerAccount; + final resourceType = this.resourceType; + final status = this.status; + final updatedAt = this.updatedAt; + final error = this.error; + final findingType = this.findingType; + final resource = this.resource; return { 'analyzedAt': iso8601ToJson(analyzedAt), - 'condition': condition, 'createdAt': iso8601ToJson(createdAt), 'id': id, 'resourceOwnerAccount': resourceOwnerAccount, 'resourceType': resourceType.toValue(), 'status': status.toValue(), 'updatedAt': iso8601ToJson(updatedAt), - if (action != null) 'action': action, if (error != null) 'error': error, - if (isPublic != null) 'isPublic': isPublic, - if (principal != null) 'principal': principal, + if (findingType != null) 'findingType': findingType.toValue(), if (resource != null) 'resource': resource, - if (sources != null) 'sources': sources, }; } } +enum FindingType { + externalAccess, + unusedIAMRole, + unusedIAMUserAccessKey, + unusedIAMUserPassword, + unusedPermission, +} + +extension FindingTypeValueExtension on FindingType { + String toValue() { + switch (this) { + case FindingType.externalAccess: + return 'ExternalAccess'; + case FindingType.unusedIAMRole: + return 'UnusedIAMRole'; + case FindingType.unusedIAMUserAccessKey: + return 'UnusedIAMUserAccessKey'; + case FindingType.unusedIAMUserPassword: + return 'UnusedIAMUserPassword'; + case FindingType.unusedPermission: + return 'UnusedPermission'; + } + } +} + +extension FindingTypeFromString on String { + FindingType toFindingType() { + switch (this) { + case 'ExternalAccess': + return FindingType.externalAccess; + case 'UnusedIAMRole': + return FindingType.unusedIAMRole; + case 'UnusedIAMUserAccessKey': + return FindingType.unusedIAMUserAccessKey; + case 'UnusedIAMUserPassword': + return FindingType.unusedIAMUserPassword; + case 'UnusedPermission': + return FindingType.unusedPermission; + } + throw Exception('$this is not known in enum FindingType'); + } +} + /// Contains the text for the generated policy. class GeneratedPolicy { /// The text to use as the content for the new policy. The policy is created @@ -3154,6 +4004,113 @@ class GetFindingResponse { } } +class GetFindingV2Response { + /// The time at which the resource-based policy or IAM entity that generated the + /// finding was analyzed. + final DateTime analyzedAt; + + /// The time at which the finding was created. + final DateTime createdAt; + + /// A localized message that explains the finding and provides guidance on how + /// to address it. + final List findingDetails; + + /// The ID of the finding to retrieve. + final String id; + + /// Tye Amazon Web Services account ID that owns the resource. + final String resourceOwnerAccount; + + /// The type of the resource identified in the finding. + final ResourceType resourceType; + + /// The status of the finding. + final FindingStatus status; + + /// The time at which the finding was updated. + final DateTime updatedAt; + + /// An error. + final String? error; + + /// The type of the finding. For external access analyzers, the type is + /// ExternalAccess. For unused access analyzers, the type can be + /// UnusedIAMRole, UnusedIAMUserAccessKey, + /// UnusedIAMUserPassword, or UnusedPermission. + final FindingType? findingType; + + /// A token used for pagination of results returned. + final String? nextToken; + + /// The resource that generated the finding. + final String? resource; + + GetFindingV2Response({ + required this.analyzedAt, + required this.createdAt, + required this.findingDetails, + required this.id, + required this.resourceOwnerAccount, + required this.resourceType, + required this.status, + required this.updatedAt, + this.error, + this.findingType, + this.nextToken, + this.resource, + }); + + factory GetFindingV2Response.fromJson(Map json) { + return GetFindingV2Response( + analyzedAt: nonNullableTimeStampFromJson(json['analyzedAt'] as Object), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + findingDetails: (json['findingDetails'] as List) + .whereNotNull() + .map((e) => FindingDetails.fromJson(e as Map)) + .toList(), + id: json['id'] as String, + resourceOwnerAccount: json['resourceOwnerAccount'] as String, + resourceType: (json['resourceType'] as String).toResourceType(), + status: (json['status'] as String).toFindingStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + error: json['error'] as String?, + findingType: (json['findingType'] as String?)?.toFindingType(), + nextToken: json['nextToken'] as String?, + resource: json['resource'] as String?, + ); + } + + Map toJson() { + final analyzedAt = this.analyzedAt; + final createdAt = this.createdAt; + final findingDetails = this.findingDetails; + final id = this.id; + final resourceOwnerAccount = this.resourceOwnerAccount; + final resourceType = this.resourceType; + final status = this.status; + final updatedAt = this.updatedAt; + final error = this.error; + final findingType = this.findingType; + final nextToken = this.nextToken; + final resource = this.resource; + return { + 'analyzedAt': iso8601ToJson(analyzedAt), + 'createdAt': iso8601ToJson(createdAt), + 'findingDetails': findingDetails, + 'id': id, + 'resourceOwnerAccount': resourceOwnerAccount, + 'resourceType': resourceType.toValue(), + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (error != null) 'error': error, + if (findingType != null) 'findingType': findingType.toValue(), + if (nextToken != null) 'nextToken': nextToken, + if (resource != null) 'resource': resource, + }; + } +} + class GetGeneratedPolicyResponse { /// A GeneratedPolicyResult object that contains the generated /// policies and associated details. @@ -3881,6 +4838,39 @@ class ListFindingsResponse { } } +class ListFindingsV2Response { + /// A list of findings retrieved from the analyzer that match the filter + /// criteria specified, if any. + final List findings; + + /// A token used for pagination of results returned. + final String? nextToken; + + ListFindingsV2Response({ + required this.findings, + this.nextToken, + }); + + factory ListFindingsV2Response.fromJson(Map json) { + return ListFindingsV2Response( + findings: (json['findings'] as List) + .whereNotNull() + .map((e) => FindingSummaryV2.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final findings = this.findings; + final nextToken = this.nextToken; + return { + 'findings': findings, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListPolicyGenerationsResponse { /// A PolicyGeneration object that contains details about the /// generated policy. @@ -4556,6 +5546,44 @@ extension ReasonCodeFromString on String { } } +/// Contains information about the reasoning why a check for access passed or +/// failed. +class ReasonSummary { + /// A description of the reasoning of a result of checking for access. + final String? description; + + /// The identifier for the reason statement. + final String? statementId; + + /// The index number of the reason statement. + final int? statementIndex; + + ReasonSummary({ + this.description, + this.statementId, + this.statementIndex, + }); + + factory ReasonSummary.fromJson(Map json) { + return ReasonSummary( + description: json['description'] as String?, + statementId: json['statementId'] as String?, + statementIndex: json['statementIndex'] as int?, + ); + } + + Map toJson() { + final description = this.description; + final statementId = this.statementId; + final statementIndex = this.statementIndex; + return { + if (description != null) 'description': description, + if (statementId != null) 'statementId': statementId, + if (statementIndex != null) 'statementIndex': statementIndex, + }; + } +} + enum ResourceType { awsS3Bucket, awsIamRole, @@ -4570,6 +5598,9 @@ enum ResourceType { awsRdsDBSnapshot, awsRdsDBClusterSnapshot, awsSnsTopic, + awsS3ExpressDirectoryBucket, + awsDynamoDBTable, + awsDynamoDBStream, } extension ResourceTypeValueExtension on ResourceType { @@ -4601,6 +5632,12 @@ extension ResourceTypeValueExtension on ResourceType { return 'AWS::RDS::DBClusterSnapshot'; case ResourceType.awsSnsTopic: return 'AWS::SNS::Topic'; + case ResourceType.awsS3ExpressDirectoryBucket: + return 'AWS::S3Express::DirectoryBucket'; + case ResourceType.awsDynamoDBTable: + return 'AWS::DynamoDB::Table'; + case ResourceType.awsDynamoDBStream: + return 'AWS::DynamoDB::Stream'; } } } @@ -4634,6 +5671,12 @@ extension ResourceTypeFromString on String { return ResourceType.awsRdsDBClusterSnapshot; case 'AWS::SNS::Topic': return ResourceType.awsSnsTopic; + case 'AWS::S3Express::DirectoryBucket': + return ResourceType.awsS3ExpressDirectoryBucket; + case 'AWS::DynamoDB::Table': + return ResourceType.awsDynamoDBTable; + case 'AWS::DynamoDB::Stream': + return ResourceType.awsDynamoDBStream; } throw Exception('$this is not known in enum ResourceType'); } @@ -4804,6 +5847,42 @@ class S3BucketConfiguration { } } +/// Proposed access control configuration for an Amazon S3 directory bucket. You +/// can propose a configuration for a new Amazon S3 directory bucket or an +/// existing Amazon S3 directory bucket that you own by specifying the Amazon S3 +/// bucket policy. If the configuration is for an existing Amazon S3 directory +/// bucket and you do not specify the Amazon S3 bucket policy, the access +/// preview uses the existing policy attached to the directory bucket. If the +/// access preview is for a new resource and you do not specify the Amazon S3 +/// bucket policy, the access preview assumes an directory bucket without a +/// policy. To propose deletion of an existing bucket policy, you can specify an +/// empty string. For more information about Amazon S3 directory bucket +/// policies, see Example +/// directory bucket policies for S3 Express One Zone. +class S3ExpressDirectoryBucketConfiguration { + /// The proposed bucket policy for the Amazon S3 directory bucket. + final String? bucketPolicy; + + S3ExpressDirectoryBucketConfiguration({ + this.bucketPolicy, + }); + + factory S3ExpressDirectoryBucketConfiguration.fromJson( + Map json) { + return S3ExpressDirectoryBucketConfiguration( + bucketPolicy: json['bucketPolicy'] as String?, + ); + } + + Map toJson() { + final bucketPolicy = this.bucketPolicy; + return { + if (bucketPolicy != null) 'bucketPolicy': bucketPolicy, + }; + } +} + /// The PublicAccessBlock configuration to apply to this Amazon S3 /// bucket. If the proposed configuration is for an existing Amazon S3 bucket /// and the configuration is not specified, the access preview uses the existing @@ -5194,6 +6273,8 @@ class TrailProperties { enum Type { account, organization, + accountUnusedAccess, + organizationUnusedAccess, } extension TypeValueExtension on Type { @@ -5203,6 +6284,10 @@ extension TypeValueExtension on Type { return 'ACCOUNT'; case Type.organization: return 'ORGANIZATION'; + case Type.accountUnusedAccess: + return 'ACCOUNT_UNUSED_ACCESS'; + case Type.organizationUnusedAccess: + return 'ORGANIZATION_UNUSED_ACCESS'; } } } @@ -5214,6 +6299,10 @@ extension TypeFromString on String { return Type.account; case 'ORGANIZATION': return Type.organization; + case 'ACCOUNT_UNUSED_ACCESS': + return Type.accountUnusedAccess; + case 'ORGANIZATION_UNUSED_ACCESS': + return Type.organizationUnusedAccess; } throw Exception('$this is not known in enum Type'); } @@ -5232,6 +6321,202 @@ class UntagResourceResponse { } } +/// Contains information about an unused access analyzer. +class UnusedAccessConfiguration { + /// The specified access age in days for which to generate findings for unused + /// access. For example, if you specify 90 days, the analyzer will generate + /// findings for IAM entities within the accounts of the selected organization + /// for any access that hasn't been used in 90 or more days since the analyzer's + /// last scan. You can choose a value between 1 and 180 days. + final int? unusedAccessAge; + + UnusedAccessConfiguration({ + this.unusedAccessAge, + }); + + factory UnusedAccessConfiguration.fromJson(Map json) { + return UnusedAccessConfiguration( + unusedAccessAge: json['unusedAccessAge'] as int?, + ); + } + + Map toJson() { + final unusedAccessAge = this.unusedAccessAge; + return { + if (unusedAccessAge != null) 'unusedAccessAge': unusedAccessAge, + }; + } +} + +/// Contains information about an unused access finding for an action. IAM +/// Access Analyzer charges for unused access analysis based on the number of +/// IAM roles and users analyzed per month. For more details on pricing, see IAM Access +/// Analyzer pricing. +class UnusedAction { + /// The action for which the unused access finding was generated. + final String action; + + /// The time at which the action was last accessed. + final DateTime? lastAccessed; + + UnusedAction({ + required this.action, + this.lastAccessed, + }); + + factory UnusedAction.fromJson(Map json) { + return UnusedAction( + action: json['action'] as String, + lastAccessed: timeStampFromJson(json['lastAccessed']), + ); + } + + Map toJson() { + final action = this.action; + final lastAccessed = this.lastAccessed; + return { + 'action': action, + if (lastAccessed != null) 'lastAccessed': iso8601ToJson(lastAccessed), + }; + } +} + +/// Contains information about an unused access finding for an IAM role. IAM +/// Access Analyzer charges for unused access analysis based on the number of +/// IAM roles and users analyzed per month. For more details on pricing, see IAM Access +/// Analyzer pricing. +class UnusedIamRoleDetails { + /// The time at which the role was last accessed. + final DateTime? lastAccessed; + + UnusedIamRoleDetails({ + this.lastAccessed, + }); + + factory UnusedIamRoleDetails.fromJson(Map json) { + return UnusedIamRoleDetails( + lastAccessed: timeStampFromJson(json['lastAccessed']), + ); + } + + Map toJson() { + final lastAccessed = this.lastAccessed; + return { + if (lastAccessed != null) 'lastAccessed': iso8601ToJson(lastAccessed), + }; + } +} + +/// Contains information about an unused access finding for an IAM user access +/// key. IAM Access Analyzer charges for unused access analysis based on the +/// number of IAM roles and users analyzed per month. For more details on +/// pricing, see IAM Access +/// Analyzer pricing. +class UnusedIamUserAccessKeyDetails { + /// The ID of the access key for which the unused access finding was generated. + final String accessKeyId; + + /// The time at which the access key was last accessed. + final DateTime? lastAccessed; + + UnusedIamUserAccessKeyDetails({ + required this.accessKeyId, + this.lastAccessed, + }); + + factory UnusedIamUserAccessKeyDetails.fromJson(Map json) { + return UnusedIamUserAccessKeyDetails( + accessKeyId: json['accessKeyId'] as String, + lastAccessed: timeStampFromJson(json['lastAccessed']), + ); + } + + Map toJson() { + final accessKeyId = this.accessKeyId; + final lastAccessed = this.lastAccessed; + return { + 'accessKeyId': accessKeyId, + if (lastAccessed != null) 'lastAccessed': iso8601ToJson(lastAccessed), + }; + } +} + +/// Contains information about an unused access finding for an IAM user +/// password. IAM Access Analyzer charges for unused access analysis based on +/// the number of IAM roles and users analyzed per month. For more details on +/// pricing, see IAM Access +/// Analyzer pricing. +class UnusedIamUserPasswordDetails { + /// The time at which the password was last accessed. + final DateTime? lastAccessed; + + UnusedIamUserPasswordDetails({ + this.lastAccessed, + }); + + factory UnusedIamUserPasswordDetails.fromJson(Map json) { + return UnusedIamUserPasswordDetails( + lastAccessed: timeStampFromJson(json['lastAccessed']), + ); + } + + Map toJson() { + final lastAccessed = this.lastAccessed; + return { + if (lastAccessed != null) 'lastAccessed': iso8601ToJson(lastAccessed), + }; + } +} + +/// Contains information about an unused access finding for a permission. IAM +/// Access Analyzer charges for unused access analysis based on the number of +/// IAM roles and users analyzed per month. For more details on pricing, see IAM Access +/// Analyzer pricing. +class UnusedPermissionDetails { + /// The namespace of the Amazon Web Services service that contains the unused + /// actions. + final String serviceNamespace; + + /// A list of unused actions for which the unused access finding was generated. + final List? actions; + + /// The time at which the permission last accessed. + final DateTime? lastAccessed; + + UnusedPermissionDetails({ + required this.serviceNamespace, + this.actions, + this.lastAccessed, + }); + + factory UnusedPermissionDetails.fromJson(Map json) { + return UnusedPermissionDetails( + serviceNamespace: json['serviceNamespace'] as String, + actions: (json['actions'] as List?) + ?.whereNotNull() + .map((e) => UnusedAction.fromJson(e as Map)) + .toList(), + lastAccessed: timeStampFromJson(json['lastAccessed']), + ); + } + + Map toJson() { + final serviceNamespace = this.serviceNamespace; + final actions = this.actions; + final lastAccessed = this.lastAccessed; + return { + 'serviceNamespace': serviceNamespace, + if (actions != null) 'actions': actions, + if (lastAccessed != null) 'lastAccessed': iso8601ToJson(lastAccessed), + }; + } +} + /// A finding in a policy. Each finding is an actionable recommendation that can /// be used to improve the policy. class ValidatePolicyFinding { @@ -5347,6 +6632,7 @@ enum ValidatePolicyResourceType { awsS3MultiRegionAccessPoint, awsS3ObjectLambdaAccessPoint, awsIamAssumeRolePolicyDocument, + awsDynamoDBTable, } extension ValidatePolicyResourceTypeValueExtension @@ -5363,6 +6649,8 @@ extension ValidatePolicyResourceTypeValueExtension return 'AWS::S3ObjectLambda::AccessPoint'; case ValidatePolicyResourceType.awsIamAssumeRolePolicyDocument: return 'AWS::IAM::AssumeRolePolicyDocument'; + case ValidatePolicyResourceType.awsDynamoDBTable: + return 'AWS::DynamoDB::Table'; } } } @@ -5380,6 +6668,8 @@ extension ValidatePolicyResourceTypeFromString on String { return ValidatePolicyResourceType.awsS3ObjectLambdaAccessPoint; case 'AWS::IAM::AssumeRolePolicyDocument': return ValidatePolicyResourceType.awsIamAssumeRolePolicyDocument; + case 'AWS::DynamoDB::Table': + return ValidatePolicyResourceType.awsDynamoDBTable; } throw Exception('$this is not known in enum ValidatePolicyResourceType'); } @@ -5460,6 +6750,11 @@ class InternalServerException extends _s.GenericAwsException { : super(type: type, code: 'InternalServerException', message: message); } +class InvalidParameterException extends _s.GenericAwsException { + InvalidParameterException({String? type, String? message}) + : super(type: type, code: 'InvalidParameterException', message: message); +} + class ResourceNotFoundException extends _s.GenericAwsException { ResourceNotFoundException({String? type, String? message}) : super(type: type, code: 'ResourceNotFoundException', message: message); @@ -5478,6 +6773,12 @@ class ThrottlingException extends _s.GenericAwsException { : super(type: type, code: 'ThrottlingException', message: message); } +class UnprocessableEntityException extends _s.GenericAwsException { + UnprocessableEntityException({String? type, String? message}) + : super( + type: type, code: 'UnprocessableEntityException', message: message); +} + class ValidationException extends _s.GenericAwsException { ValidationException({String? type, String? message}) : super(type: type, code: 'ValidationException', message: message); @@ -5490,12 +6791,16 @@ final _exceptionFns = { ConflictException(type: type, message: message), 'InternalServerException': (type, message) => InternalServerException(type: type, message: message), + 'InvalidParameterException': (type, message) => + InvalidParameterException(type: type, message: message), 'ResourceNotFoundException': (type, message) => ResourceNotFoundException(type: type, message: message), 'ServiceQuotaExceededException': (type, message) => ServiceQuotaExceededException(type: type, message: message), 'ThrottlingException': (type, message) => ThrottlingException(type: type, message: message), + 'UnprocessableEntityException': (type, message) => + UnprocessableEntityException(type: type, message: message), 'ValidationException': (type, message) => ValidationException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/acm_pca/v2017_08_22.dart b/aws_client/lib/src/generated/acm_pca/v2017_08_22.dart index 63664b6bf..fae38d3c5 100644 --- a/aws_client/lib/src/generated/acm_pca/v2017_08_22.dart +++ b/aws_client/lib/src/generated/acm_pca/v2017_08_22.dart @@ -37,7 +37,7 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// Private CA rejects an otherwise valid request because the request exceeds /// the operation's quota for the number of requests per second. When a request /// is throttled, Amazon Web Services Private CA returns a ThrottlingException +/// href="https://docs.aws.amazon.com/privateca/latest/APIReference/CommonErrors.html">ThrottlingException /// error. Amazon Web Services Private CA does not guarantee a minimum request /// rate for APIs. /// @@ -127,25 +127,21 @@ class AcmPca { /// handling CA keys. /// /// Default: FIPS_140_2_LEVEL_3_OR_HIGHER - /// - /// Note: FIPS_140_2_LEVEL_3_OR_HIGHER is not supported in - /// the following Regions: - /// - ///
    - ///
  • - /// ap-northeast-3 - ///
  • - ///
  • - /// ap-southeast-3 - ///
  • - ///
- /// When creating a CA in these Regions, you must provide + /// + /// Some Amazon Web Services Regions do not support the default. When creating + /// a CA in these Regions, you must provide /// FIPS_140_2_LEVEL_2_OR_HIGHER as the argument for /// KeyStorageSecurityStandard. Failure to do this results in an /// InvalidArgsException with the message, "A certificate /// authority cannot be created in this region with the specified security /// standard." /// + /// For information about security standard support in various Regions, see Storage + /// and security compliance of Amazon Web Services Private CA private + /// keys. + /// + /// /// Parameter [revocationConfiguration] : /// Contains information to enable Online Certificate Status Protocol (OCSP) /// support, to enable a certificate revocation list (CRL), to enable both, or @@ -1193,7 +1189,7 @@ class AcmPca { /// SigningAlgorithm parameter used to sign a CSR in the /// CreateCertificateAuthority action. /// - /// The specified signing algorithm family (RSA or ECDSA) much match the + /// The specified signing algorithm family (RSA or ECDSA) must match the /// algorithm family of the CA's secret key. /// /// @@ -1233,12 +1229,12 @@ class AcmPca { /// Parameter [idempotencyToken] : /// Alphanumeric string that can be used to distinguish between calls to the /// IssueCertificate action. Idempotency tokens for - /// IssueCertificate time out after one minute. Therefore, if you call - /// IssueCertificate multiple times with the same idempotency token - /// within one minute, Amazon Web Services Private CA recognizes that you are - /// requesting only one certificate and will issue only one. If you change the - /// idempotency token for each call, Amazon Web Services Private CA recognizes - /// that you are requesting multiple certificates. + /// IssueCertificate time out after five minutes. Therefore, if you + /// call IssueCertificate multiple times with the same idempotency + /// token within five minutes, Amazon Web Services Private CA recognizes that + /// you are requesting only one certificate and will issue only one. If you + /// change the idempotency token for each call, Amazon Web Services Private CA + /// recognizes that you are requesting multiple certificates. /// /// Parameter [templateArn] : /// Specifies a custom configuration template to use when issuing a @@ -1275,7 +1271,7 @@ class AcmPca { /// The ValidityNotBefore value is expressed as an explicit date /// and time, using the Validity type value /// ABSOLUTE. For more information, see Validity + /// href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_Validity.html">Validity /// in this API reference and Validity /// in RFC 5280. @@ -1327,6 +1323,9 @@ class AcmPca { /// in the response. Use this NextToken value in a subsequent /// request to retrieve additional items. /// + /// Although the maximum value is 1000, the action only returns a maximum of + /// 100 items. + /// /// Parameter [nextToken] : /// Use this parameter when paginating results in a subsequent request after /// you receive a response with truncated results. Set it to the value of the @@ -2733,10 +2732,12 @@ class CreateCertificateAuthorityResponse { /// setting the Enabled parameter to true. Your private CA /// writes CRLs to an S3 bucket that you specify in the S3BucketName /// parameter. You can hide the name of your bucket by specifying a value for -/// the CustomCname parameter. Your private CA copies the CNAME or the S3 -/// bucket name to the CRL Distribution Points extension of each -/// certificate it issues. Your S3 bucket policy must give write permission to -/// Amazon Web Services Private CA. +/// the CustomCname parameter. Your private CA by default copies the +/// CNAME or the S3 bucket name to the CRL Distribution Points extension +/// of each certificate it issues. If you want to configure this default +/// behavior to be something different, you can set the +/// CrlDistributionPointExtensionConfiguration parameter. Your S3 bucket +/// policy must give write permission to Amazon Web Services Private CA. /// /// Amazon Web Services Private CA assets that are stored in Amazon S3 can be /// protected with encryption. For more information, see CRL Distribution Points extension /// that enables the use of an alias for the CRL distribution point. Use this /// value if you don't want the name of your S3 bucket to be public. @@ -2887,6 +2895,7 @@ class CrlConfiguration { CrlConfiguration({ required this.enabled, + this.crlDistributionPointExtensionConfiguration, this.customCname, this.expirationInDays, this.s3BucketName, @@ -2896,6 +2905,12 @@ class CrlConfiguration { factory CrlConfiguration.fromJson(Map json) { return CrlConfiguration( enabled: json['Enabled'] as bool, + crlDistributionPointExtensionConfiguration: + json['CrlDistributionPointExtensionConfiguration'] != null + ? CrlDistributionPointExtensionConfiguration.fromJson( + json['CrlDistributionPointExtensionConfiguration'] + as Map) + : null, customCname: json['CustomCname'] as String?, expirationInDays: json['ExpirationInDays'] as int?, s3BucketName: json['S3BucketName'] as String?, @@ -2905,12 +2920,17 @@ class CrlConfiguration { Map toJson() { final enabled = this.enabled; + final crlDistributionPointExtensionConfiguration = + this.crlDistributionPointExtensionConfiguration; final customCname = this.customCname; final expirationInDays = this.expirationInDays; final s3BucketName = this.s3BucketName; final s3ObjectAcl = this.s3ObjectAcl; return { 'Enabled': enabled, + if (crlDistributionPointExtensionConfiguration != null) + 'CrlDistributionPointExtensionConfiguration': + crlDistributionPointExtensionConfiguration, if (customCname != null) 'CustomCname': customCname, if (expirationInDays != null) 'ExpirationInDays': expirationInDays, if (s3BucketName != null) 'S3BucketName': s3BucketName, @@ -2919,6 +2939,45 @@ class CrlConfiguration { } } +/// Contains configuration information for the default behavior of the CRL +/// Distribution Point (CDP) extension in certificates issued by your CA. This +/// extension contains a link to download the CRL, so you can check whether a +/// certificate has been revoked. To choose whether you want this extension +/// omitted or not in certificates issued by your CA, you can set the +/// OmitExtension parameter. +class CrlDistributionPointExtensionConfiguration { + /// Configures whether the CRL Distribution Point extension should be populated + /// with the default URL to the CRL. If set to true, then the CDP + /// extension will not be present in any certificates issued by that CA unless + /// otherwise specified through CSR or API passthrough. + /// + /// Only set this if you have another way to distribute the CRL Distribution + /// Points ffor certificates issued by your CA, such as the Matter Distributed + /// Compliance Ledger + /// + /// This configuration cannot be enabled with a custom CNAME set. + /// + final bool omitExtension; + + CrlDistributionPointExtensionConfiguration({ + required this.omitExtension, + }); + + factory CrlDistributionPointExtensionConfiguration.fromJson( + Map json) { + return CrlDistributionPointExtensionConfiguration( + omitExtension: json['OmitExtension'] as bool, + ); + } + + Map toJson() { + final omitExtension = this.omitExtension; + return { + 'OmitExtension': omitExtension, + }; + } +} + /// Describes the certificate extensions to be added to the certificate signing /// request (CSR). class CsrExtensions { diff --git a/aws_client/lib/src/generated/amp/v2020_08_01.dart b/aws_client/lib/src/generated/amp/v2020_08_01.dart index ba28b6a78..4bfc07e56 100644 --- a/aws_client/lib/src/generated/amp/v2020_08_01.dart +++ b/aws_client/lib/src/generated/amp/v2020_08_01.dart @@ -19,7 +19,32 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Amazon Managed Service for Prometheus +/// Amazon Managed Service for Prometheus is a serverless, Prometheus-compatible +/// monitoring service for container metrics that makes it easier to securely +/// monitor container environments at scale. With Amazon Managed Service for +/// Prometheus, you can use the same open-source Prometheus data model and query +/// language that you use today to monitor the performance of your containerized +/// workloads, and also enjoy improved scalability, availability, and security +/// without having to manage the underlying infrastructure. +/// +/// For more information about Amazon Managed Service for Prometheus, see the Amazon +/// Managed Service for Prometheus User Guide. +/// +/// Amazon Managed Service for Prometheus includes two APIs. +/// +///
    +///
  • +/// Use the Amazon Web Services API described in this guide to manage Amazon +/// Managed Service for Prometheus resources, such as workspaces, rule groups, +/// and alert managers. +///
  • +///
  • +/// Use the Prometheus-compatible +/// API to work within your Prometheus workspace. +///
  • +///
class Prometheus { final _s.RestJsonProtocol _protocol; Prometheus({ @@ -49,7 +74,10 @@ class Prometheus { _protocol.close(); } - /// Create an alert manager definition. + /// The CreateAlertManagerDefinition operation creates the alert + /// manager definition in a workspace. If a workspace already has an alert + /// manager definition, don't use this operation to update it. Instead, use + /// PutAlertManagerDefinition. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -60,14 +88,18 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [data] : - /// The alert manager definition data. + /// The alert manager definition to add. A base64-encoded version of the YAML + /// alert manager definition file. + /// + /// For details about the alert manager definition, see AlertManagedDefinitionData. /// /// Parameter [workspaceId] : - /// The ID of the workspace in which to create the alert manager definition. + /// The ID of the workspace to add the alert manager definition to. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future createAlertManagerDefinition({ required Uint8List data, required String workspaceId, @@ -87,7 +119,9 @@ class Prometheus { return CreateAlertManagerDefinitionResponse.fromJson(response); } - /// Create logging configuration. + /// The CreateLoggingConfiguration operation creates a logging + /// configuration for the workspace. Use this operation to set the CloudWatch + /// log group to which the logs will be published to. /// /// May throw [ValidationException]. /// May throw [ResourceNotFoundException]. @@ -95,15 +129,15 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [logGroupArn] : - /// The ARN of the CW log group to which the vended log data will be - /// published. + /// The ARN of the CloudWatch log group to which the vended log data will be + /// published. This log group must exist prior to calling this API. /// /// Parameter [workspaceId] : - /// The ID of the workspace to vend logs to. + /// The ID of the workspace to create the logging configuration for. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future createLoggingConfiguration({ required String logGroupArn, required String workspaceId, @@ -122,7 +156,13 @@ class Prometheus { return CreateLoggingConfigurationResponse.fromJson(response); } - /// Create a rule group namespace. + /// The CreateRuleGroupsNamespace operation creates a rule groups + /// namespace within a workspace. A rule groups namespace is associated with + /// exactly one rules file. A workspace can have multiple rule groups + /// namespaces. + /// + /// Use this operation only to create new rule groups namespaces. To update an + /// existing rule groups namespace, use PutRuleGroupsNamespace. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -133,20 +173,26 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [data] : - /// The namespace data that define the rule groups. + /// The rules file to use in the new namespace. + /// + /// Contains the base64-encoded version of the YAML rules file. + /// + /// For details about the rule groups namespace structure, see RuleGroupsNamespaceData. /// /// Parameter [name] : - /// The rule groups namespace name. + /// The name for the new rule groups namespace. /// /// Parameter [workspaceId] : - /// The ID of the workspace in which to create the rule group namespace. + /// The ID of the workspace to add the rule groups namespace. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. /// /// Parameter [tags] : - /// Optional, user-provided tags for this rule groups namespace. + /// The list of tag keys and values to associate with the rule groups + /// namespace. Future createRuleGroupsNamespace({ required Uint8List data, required String name, @@ -170,7 +216,92 @@ class Prometheus { return CreateRuleGroupsNamespaceResponse.fromJson(response); } - /// Creates a new AMP workspace. + /// The CreateScraper operation creates a scraper to collect + /// metrics. A scraper pulls metrics from Prometheus-compatible sources within + /// an Amazon EKS cluster, and sends them to your Amazon Managed Service for + /// Prometheus workspace. You can configure the scraper to control what + /// metrics are collected, and what transformations are applied prior to + /// sending them to your workspace. + /// + /// If needed, an IAM role will be created for you that gives Amazon Managed + /// Service for Prometheus access to the metrics in your cluster. For more + /// information, see Using + /// roles for scraping metrics from EKS in the Amazon Managed Service + /// for Prometheus User Guide. + /// + /// You cannot update a scraper. If you want to change the configuration of + /// the scraper, create a new scraper and delete the old one. + /// + /// The scrapeConfiguration parameter contains the base64-encoded + /// version of the YAML configuration file. + /// + /// For more information about collectors, including what metrics are + /// collected, and how to configure the scraper, see Amazon + /// Web Services managed collectors in the Amazon Managed Service for + /// Prometheus User Guide. + /// + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [destination] : + /// The Amazon Managed Service for Prometheus workspace to send metrics to. + /// + /// Parameter [scrapeConfiguration] : + /// The configuration file to use in the new scraper. For more information, + /// see Scraper + /// configuration in the Amazon Managed Service for Prometheus User + /// Guide. + /// + /// Parameter [source] : + /// The Amazon EKS cluster from which the scraper will collect metrics. + /// + /// Parameter [alias] : + /// (optional) a name to associate with the scraper. This is for your use, and + /// does not need to be unique. + /// + /// Parameter [clientToken] : + /// (Optional) A unique, case-sensitive identifier that you can provide to + /// ensure the idempotency of the request. + /// + /// Parameter [tags] : + /// (Optional) The list of tag keys and values to associate with the scraper. + Future createScraper({ + required Destination destination, + required ScrapeConfiguration scrapeConfiguration, + required Source source, + String? alias, + String? clientToken, + Map? tags, + }) async { + final $payload = { + 'destination': destination, + 'scrapeConfiguration': scrapeConfiguration, + 'source': source, + if (alias != null) 'alias': alias, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/scrapers', + exceptionFnMap: _exceptionFns, + ); + return CreateScraperResponse.fromJson(response); + } + + /// Creates a Prometheus workspace. A workspace is a logical space dedicated + /// to the storage and querying of Prometheus metrics. You can have one or + /// more workspaces in each Region in your account. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -180,23 +311,36 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [alias] : - /// An optional user-assigned alias for this workspace. This alias is for user - /// reference and does not need to be unique. + /// An alias that you assign to this workspace to help you identify it. It + /// does not need to be unique. + /// + /// Blank spaces at the beginning or end of the alias that you specify will be + /// trimmed from the value used. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. + /// + /// Parameter [kmsKeyArn] : + /// (optional) The ARN for a customer managed KMS key to use for encrypting + /// data within your workspace. For more information about using your own key + /// in your workspace, see Encryption + /// at rest in the Amazon Managed Service for Prometheus User + /// Guide. /// /// Parameter [tags] : - /// Optional, user-provided tags for this workspace. + /// The list of tag keys and values to associate with the workspace. Future createWorkspace({ String? alias, String? clientToken, + String? kmsKeyArn, Map? tags, }) async { final $payload = { if (alias != null) 'alias': alias, 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, if (tags != null) 'tags': tags, }; final response = await _protocol.send( @@ -208,7 +352,7 @@ class Prometheus { return CreateWorkspaceResponse.fromJson(response); } - /// Deletes an alert manager definition. + /// Deletes the alert manager definition from a workspace. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -218,11 +362,11 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace in which to delete the alert manager definition. + /// The ID of the workspace to delete the alert manager definition from. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future deleteAlertManagerDefinition({ required String workspaceId, String? clientToken, @@ -240,7 +384,7 @@ class Prometheus { ); } - /// Delete logging configuration. + /// Deletes the logging configuration for a workspace. /// /// May throw [ConflictException]. /// May throw [ValidationException]. @@ -249,11 +393,11 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace to vend logs to. + /// The ID of the workspace containing the logging configuration to delete. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future deleteLoggingConfiguration({ required String workspaceId, String? clientToken, @@ -270,7 +414,8 @@ class Prometheus { ); } - /// Delete a rule groups namespace. + /// Deletes one rule groups namespace and its associated rule groups + /// definition. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -280,14 +425,15 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [name] : - /// The rule groups namespace name. + /// The name of the rule groups namespace to delete. /// /// Parameter [workspaceId] : - /// The ID of the workspace to delete rule group definition. + /// The ID of the workspace containing the rule groups namespace and + /// definition to delete. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future deleteRuleGroupsNamespace({ required String name, required String workspaceId, @@ -306,7 +452,44 @@ class Prometheus { ); } - /// Deletes an AMP workspace. + /// The DeleteScraper operation deletes one scraper, and stops + /// any metrics collection that the scraper performs. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// + /// Parameter [scraperId] : + /// The ID of the scraper to delete. + /// + /// Parameter [clientToken] : + /// (Optional) A unique, case-sensitive identifier that you can provide to + /// ensure the idempotency of the request. + Future deleteScraper({ + required String scraperId, + String? clientToken, + }) async { + final $query = >{ + if (clientToken != null) 'clientToken': [clientToken], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/scrapers/${Uri.encodeComponent(scraperId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeleteScraperResponse.fromJson(response); + } + + /// Deletes an existing workspace. + /// + /// When you delete a workspace, the data that has been ingested into it is + /// not immediately deleted. It will be permanently deleted within one month. + /// /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -319,8 +502,8 @@ class Prometheus { /// The ID of the workspace to delete. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future deleteWorkspace({ required String workspaceId, String? clientToken, @@ -337,7 +520,8 @@ class Prometheus { ); } - /// Describes an alert manager definition. + /// Retrieves the full information about the alert manager definition for a + /// workspace. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -346,7 +530,7 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace to describe. + /// The ID of the workspace to retrieve the alert manager definition from. Future describeAlertManagerDefinition({ required String workspaceId, @@ -361,7 +545,8 @@ class Prometheus { return DescribeAlertManagerDefinitionResponse.fromJson(response); } - /// Describes logging configuration. + /// Returns complete information about the current logging configuration of + /// the workspace. /// /// May throw [ValidationException]. /// May throw [ResourceNotFoundException]. @@ -369,7 +554,7 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace to vend logs to. + /// The ID of the workspace to describe the logging configuration for. Future describeLoggingConfiguration({ required String workspaceId, }) async { @@ -382,7 +567,9 @@ class Prometheus { return DescribeLoggingConfigurationResponse.fromJson(response); } - /// Describe a rule groups namespace. + /// Returns complete information about one rule groups namespace. To retrieve + /// a list of rule groups namespaces, use + /// ListRuleGroupsNamespaces. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -391,10 +578,10 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [name] : - /// The rule groups namespace. + /// The name of the rule groups namespace that you want information for. /// /// Parameter [workspaceId] : - /// The ID of the workspace to describe. + /// The ID of the workspace containing the rule groups namespace. Future describeRuleGroupsNamespace({ required String name, required String workspaceId, @@ -409,7 +596,30 @@ class Prometheus { return DescribeRuleGroupsNamespaceResponse.fromJson(response); } - /// Describes an existing AMP workspace. + /// The DescribeScraper operation displays information about an + /// existing scraper. + /// + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// + /// Parameter [scraperId] : + /// The ID of the scraper to describe. + Future describeScraper({ + required String scraperId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/scrapers/${Uri.encodeComponent(scraperId)}', + exceptionFnMap: _exceptionFns, + ); + return DescribeScraperResponse.fromJson(response); + } + + /// Returns information about an existing workspace. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -431,7 +641,25 @@ class Prometheus { return DescribeWorkspaceResponse.fromJson(response); } - /// Lists rule groups namespaces. + /// The GetDefaultScraperConfiguration operation returns the + /// default scraper configuration used when Amazon EKS creates a scraper for + /// you. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + Future + getDefaultScraperConfiguration() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/scraperconfiguration', + exceptionFnMap: _exceptionFns, + ); + return GetDefaultScraperConfigurationResponse.fromJson(response); + } + + /// Returns a list of rule groups namespaces in a workspace. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -440,19 +668,25 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace. + /// The ID of the workspace containing the rule groups namespaces. /// /// Parameter [maxResults] : - /// Maximum results to return in response (default=100, maximum=1000). + /// The maximum number of results to return. The default is 100. /// /// Parameter [name] : - /// Optional filter for rule groups namespace name. Only the rule groups - /// namespace that begin with this value will be returned. + /// Use this parameter to filter the rule groups namespaces that are returned. + /// Only the namespaces with names that begin with the value that you specify + /// are returned. /// /// Parameter [nextToken] : - /// Pagination token to request the next page in a paginated list. This token - /// is obtained from the output of the previous ListRuleGroupsNamespaces - /// request. + /// The token for the next set of items to return. You receive this token from + /// a previous call, and use it to get the next page of results. The other + /// parameters must be the same as the initial call. + /// + /// For example, if your initial request has maxResults of 10, + /// and there are 12 rule groups namespaces to return, then your initial + /// request will return 10 and a nextToken. Using the next token + /// in a subsequent call will return the remaining 2 namespaces. Future listRuleGroupsNamespaces({ required String workspaceId, int? maxResults, @@ -481,7 +715,75 @@ class Prometheus { return ListRuleGroupsNamespacesResponse.fromJson(response); } - /// Lists the tags you have assigned to the resource. + /// The ListScrapers operation lists all of the scrapers in your + /// account. This includes scrapers being created or deleted. You can + /// optionally filter the returned list. + /// + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// + /// Parameter [filters] : + /// (Optional) A list of key-value pairs to filter the list of scrapers + /// returned. Keys include status, sourceArn, + /// destinationArn, and alias. + /// + /// Filters on the same key are OR'd together, and filters on + /// different keys are AND'd together. For example, + /// status=ACTIVE&status=CREATING&alias=Test, will return + /// all scrapers that have the alias Test, and are either in status ACTIVE or + /// CREATING. + /// + /// To find all active scrapers that are sending metrics to a specific Amazon + /// Managed Service for Prometheus workspace, you would use the ARN of the + /// workspace in a query: + /// + /// status=ACTIVE&destinationArn=arn:aws:aps:us-east-1:123456789012:workspace/ws-example1-1234-abcd-56ef-123456789012 + /// + /// If this is included, it filters the results to only the scrapers that + /// match the filter. + /// + /// Parameter [maxResults] : + /// Optional) The maximum number of scrapers to return in one + /// ListScrapers operation. The range is 1-1000. + /// + /// If you omit this parameter, the default of 100 is used. + /// + /// Parameter [nextToken] : + /// (Optional) The token for the next set of items to return. (You received + /// this token from a previous call.) + Future listScrapers({ + Map>? filters, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (filters != null) + for (var e in filters.entries) e.key: e.value, + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/scrapers', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListScrapersResponse.fromJson(response); + } + + /// The ListTagsForResource operation returns the tags that are + /// associated with an Amazon Managed Service for Prometheus resource. + /// Currently, the only resources that can be tagged are workspaces and rule + /// groups namespaces. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -490,7 +792,8 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [resourceArn] : - /// The ARN of the resource. + /// The ARN of the resource to list tages for. Must be a workspace or rule + /// groups namespace resource. Future listTagsForResource({ required String resourceArn, }) async { @@ -503,7 +806,8 @@ class Prometheus { return ListTagsForResourceResponse.fromJson(response); } - /// Lists all AMP workspaces, including workspaces being created or deleted. + /// Lists all of the Amazon Managed Service for Prometheus workspaces in your + /// account. This includes workspaces being created or deleted. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -511,15 +815,25 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [alias] : - /// Optional filter for workspace alias. Only the workspaces with aliases that - /// begin with this value will be returned. + /// If this is included, it filters the results to only the workspaces with + /// names that start with the value that you specify here. + /// + /// Amazon Managed Service for Prometheus will automatically strip any blank + /// spaces from the beginning and end of the alias that you specify. /// /// Parameter [maxResults] : - /// Maximum results to return in response (default=100, maximum=1000). + /// The maximum number of workspaces to return per request. The default is + /// 100. /// /// Parameter [nextToken] : - /// Pagination token to request the next page in a paginated list. This token - /// is obtained from the output of the previous ListWorkspaces request. + /// The token for the next set of items to return. You receive this token from + /// a previous call, and use it to get the next page of results. The other + /// parameters must be the same as the initial call. + /// + /// For example, if your initial request has maxResults of 10, + /// and there are 12 workspaces to return, then your initial request will + /// return 10 and a nextToken. Using the next token in a + /// subsequent call will return the remaining 2 workspaces. Future listWorkspaces({ String? alias, int? maxResults, @@ -546,7 +860,10 @@ class Prometheus { return ListWorkspacesResponse.fromJson(response); } - /// Update an alert manager definition. + /// Updates an existing alert manager definition in a workspace. If the + /// workspace does not already have an alert manager definition, don't use + /// this operation to create it. Instead, use + /// CreateAlertManagerDefinition. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -557,14 +874,18 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [data] : - /// The alert manager definition data. + /// The alert manager definition to use. A base64-encoded version of the YAML + /// alert manager definition file. + /// + /// For details about the alert manager definition, see AlertManagedDefinitionData. /// /// Parameter [workspaceId] : - /// The ID of the workspace in which to update the alert manager definition. + /// The ID of the workspace to update the alert manager definition in. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future putAlertManagerDefinition({ required Uint8List data, required String workspaceId, @@ -584,7 +905,16 @@ class Prometheus { return PutAlertManagerDefinitionResponse.fromJson(response); } - /// Update a rule groups namespace. + /// Updates an existing rule groups namespace within a workspace. A rule + /// groups namespace is associated with exactly one rules file. A workspace + /// can have multiple rule groups namespaces. + /// + /// Use this operation only to update existing rule groups namespaces. To + /// create a new rule groups namespace, use + /// CreateRuleGroupsNamespace. + /// + /// You can't use this operation to add tags to an existing rule groups + /// namespace. Instead, use TagResource. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -595,17 +925,21 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [data] : - /// The namespace data that define the rule groups. + /// The new rules file to use in the namespace. A base64-encoded version of + /// the YAML rule groups file. + /// + /// For details about the rule groups namespace structure, see RuleGroupsNamespaceData. /// /// Parameter [name] : - /// The rule groups namespace name. + /// The name of the rule groups namespace that you are updating. /// /// Parameter [workspaceId] : - /// The ID of the workspace in which to update the rule group namespace. + /// The ID of the workspace where you are updating the rule groups namespace. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future putRuleGroupsNamespace({ required Uint8List data, required String name, @@ -626,7 +960,14 @@ class Prometheus { return PutRuleGroupsNamespaceResponse.fromJson(response); } - /// Creates tags for the specified resource. + /// The TagResource operation associates tags with an Amazon + /// Managed Service for Prometheus resource. The only resources that can be + /// tagged are workspaces and rule groups namespaces. + /// + /// If you specify a new tag key for the resource, this tag is appended to the + /// list of tags associated with the resource. If you specify a tag key that + /// is already associated with the resource, the new tag value that you + /// specify replaces the previous value for that tag. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -635,7 +976,12 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [resourceArn] : - /// The ARN of the resource. + /// The ARN of the workspace or rule groups namespace to apply tags to. + /// + /// Parameter [tags] : + /// The list of tag keys and values to associate with the resource. + /// + /// Keys may not begin with aws:. Future tagResource({ required String resourceArn, required Map tags, @@ -651,7 +997,9 @@ class Prometheus { ); } - /// Deletes tags from the specified resource. + /// Removes the specified tags from an Amazon Managed Service for Prometheus + /// resource. The only resources that can be tagged are workspaces and rule + /// groups namespaces. /// /// May throw [ThrottlingException]. /// May throw [ValidationException]. @@ -660,10 +1008,10 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [resourceArn] : - /// The ARN of the resource. + /// The ARN of the workspace or rule groups namespace. /// /// Parameter [tagKeys] : - /// One or more tag keys + /// The keys of the tags to remove. Future untagResource({ required String resourceArn, required List tagKeys, @@ -680,7 +1028,8 @@ class Prometheus { ); } - /// Update logging configuration. + /// Updates the log group ARN or the workspace ID of the current logging + /// configuration. /// /// May throw [ConflictException]. /// May throw [ValidationException]. @@ -689,15 +1038,15 @@ class Prometheus { /// May throw [InternalServerException]. /// /// Parameter [logGroupArn] : - /// The ARN of the CW log group to which the vended log data will be + /// The ARN of the CloudWatch log group to which the vended log data will be /// published. /// /// Parameter [workspaceId] : - /// The ID of the workspace to vend logs to. + /// The ID of the workspace to update the logging configuration for. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future updateLoggingConfiguration({ required String logGroupArn, required String workspaceId, @@ -716,7 +1065,7 @@ class Prometheus { return UpdateLoggingConfigurationResponse.fromJson(response); } - /// Updates an AMP workspace alias. + /// Updates the alias of an existing workspace. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -727,14 +1076,17 @@ class Prometheus { /// May throw [ServiceQuotaExceededException]. /// /// Parameter [workspaceId] : - /// The ID of the workspace being updated. + /// The ID of the workspace to update. /// /// Parameter [alias] : - /// The new alias of the workspace. + /// The new alias for the workspace. It does not need to be unique. + /// + /// Amazon Managed Service for Prometheus will automatically strip any blank + /// spaces from the beginning and end of the alias that you specify. /// /// Parameter [clientToken] : - /// Optional, unique, case-sensitive, user-provided identifier to ensure the - /// idempotency of the request. + /// A unique identifier that you can provide to ensure the idempotency of the + /// request. Case-sensitive. Future updateWorkspaceAlias({ required String workspaceId, String? alias, @@ -753,18 +1105,23 @@ class Prometheus { } } -/// Represents the properties of an alert manager definition. +/// The details of an alert manager definition. class AlertManagerDefinitionDescription { - /// The time when the alert manager definition was created. + /// The date and time that the alert manager definition was created. final DateTime createdAt; - /// The alert manager definition. + /// The actual alert manager definition. + /// + /// For details about the alert manager definition, see AlertManagedDefinitionData. final Uint8List data; - /// The time when the alert manager definition was modified. + /// The date and time that the alert manager definition was most recently + /// changed. final DateTime modifiedAt; - /// The status of alert manager definition. + /// A structure that displays the current status of the alert manager + /// definition.. final AlertManagerDefinitionStatus status; AlertManagerDefinitionDescription({ @@ -799,12 +1156,12 @@ class AlertManagerDefinitionDescription { } } -/// Represents the status of a definition. +/// The status of the alert manager. class AlertManagerDefinitionStatus { - /// Status code of this definition. + /// The current status of the alert manager. final AlertManagerDefinitionStatusCode statusCode; - /// The reason for failure if any. + /// If there is a failure, the reason for the failure. final String? statusReason; AlertManagerDefinitionStatus({ @@ -830,7 +1187,7 @@ class AlertManagerDefinitionStatus { } } -/// State of an alert manager definition. +/// State of an AlertManagerDefinition. enum AlertManagerDefinitionStatusCode { creating, active, @@ -881,9 +1238,35 @@ extension AlertManagerDefinitionStatusCodeFromString on String { } } -/// Represents the output of a CreateAlertManagerDefinition operation. +/// The AmpConfiguration structure defines the Amazon Managed +/// Service for Prometheus instance a scraper should send metrics to. +class AmpConfiguration { + /// ARN of the Amazon Managed Service for Prometheus workspace. + final String workspaceArn; + + AmpConfiguration({ + required this.workspaceArn, + }); + + factory AmpConfiguration.fromJson(Map json) { + return AmpConfiguration( + workspaceArn: json['workspaceArn'] as String, + ); + } + + Map toJson() { + final workspaceArn = this.workspaceArn; + return { + 'workspaceArn': workspaceArn, + }; + } +} + +/// Represents the output of a CreateAlertManagerDefinition +/// operation. class CreateAlertManagerDefinitionResponse { - /// The status of alert manager definition. + /// A structure that displays the current status of the alert manager + /// definition. final AlertManagerDefinitionStatus status; CreateAlertManagerDefinitionResponse({ @@ -906,9 +1289,10 @@ class CreateAlertManagerDefinitionResponse { } } -/// Represents the output of a CreateLoggingConfiguration operation. +/// Represents the output of a CreateLoggingConfiguration +/// operation. class CreateLoggingConfigurationResponse { - /// The status of the logging configuration. + /// A structure that displays the current status of the logging configuration. final LoggingConfigurationStatus status; CreateLoggingConfigurationResponse({ @@ -931,18 +1315,18 @@ class CreateLoggingConfigurationResponse { } } -/// Represents the output of a CreateRuleGroupsNamespace operation. +/// Represents the output of a CreateRuleGroupsNamespace operation. class CreateRuleGroupsNamespaceResponse { - /// The Amazon Resource Name (ARN) of this rule groups namespace. + /// The Amazon Resource Name (ARN) of the new rule groups namespace. final String arn; - /// The rule groups namespace name. + /// The name of the new rule groups namespace. final String name; - /// The status of rule groups namespace. + /// A structure that returns the current status of the rule groups namespace. final RuleGroupsNamespaceStatus status; - /// The tags of this rule groups namespace. + /// The list of tag keys and values that are associated with the namespace. final Map? tags; CreateRuleGroupsNamespaceResponse({ @@ -978,24 +1362,75 @@ class CreateRuleGroupsNamespaceResponse { } } -/// Represents the output of a CreateWorkspace operation. +/// Represents the output of a CreateScraper operation. +class CreateScraperResponse { + /// The Amazon Resource Name (ARN) of the new scraper. + final String arn; + + /// The ID of the new scraper. + final String scraperId; + + /// A structure that displays the current status of the scraper. + final ScraperStatus status; + + /// The list of tag keys and values that are associated with the scraper. + final Map? tags; + + CreateScraperResponse({ + required this.arn, + required this.scraperId, + required this.status, + this.tags, + }); + + factory CreateScraperResponse.fromJson(Map json) { + return CreateScraperResponse( + arn: json['arn'] as String, + scraperId: json['scraperId'] as String, + status: ScraperStatus.fromJson(json['status'] as Map), + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final scraperId = this.scraperId; + final status = this.status; + final tags = this.tags; + return { + 'arn': arn, + 'scraperId': scraperId, + 'status': status, + if (tags != null) 'tags': tags, + }; + } +} + +/// Represents the output of a CreateWorkspace operation. class CreateWorkspaceResponse { - /// The ARN of the workspace that was just created. + /// The ARN for the new workspace. final String arn; - /// The status of the workspace that was just created (usually CREATING). + /// The current status of the new workspace. Immediately after you create the + /// workspace, the status is usually CREATING. final WorkspaceStatus status; - /// The generated ID of the workspace that was just created. + /// The unique ID for the new workspace. final String workspaceId; - /// The tags of this workspace. + /// (optional) If the workspace was created with a customer managed KMS key, the + /// ARN for the key used. + final String? kmsKeyArn; + + /// The list of tag keys and values that are associated with the workspace. final Map? tags; CreateWorkspaceResponse({ required this.arn, required this.status, required this.workspaceId, + this.kmsKeyArn, this.tags, }); @@ -1004,6 +1439,7 @@ class CreateWorkspaceResponse { arn: json['arn'] as String, status: WorkspaceStatus.fromJson(json['status'] as Map), workspaceId: json['workspaceId'] as String, + kmsKeyArn: json['kmsKeyArn'] as String?, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -1013,19 +1449,52 @@ class CreateWorkspaceResponse { final arn = this.arn; final status = this.status; final workspaceId = this.workspaceId; + final kmsKeyArn = this.kmsKeyArn; final tags = this.tags; return { 'arn': arn, 'status': status, 'workspaceId': workspaceId, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, if (tags != null) 'tags': tags, }; } } -/// Represents the output of a DescribeAlertManagerDefinition operation. +/// Represents the output of a DeleteScraper operation. +class DeleteScraperResponse { + /// The ID of the scraper to delete. + final String scraperId; + + /// The current status of the scraper. + final ScraperStatus status; + + DeleteScraperResponse({ + required this.scraperId, + required this.status, + }); + + factory DeleteScraperResponse.fromJson(Map json) { + return DeleteScraperResponse( + scraperId: json['scraperId'] as String, + status: ScraperStatus.fromJson(json['status'] as Map), + ); + } + + Map toJson() { + final scraperId = this.scraperId; + final status = this.status; + return { + 'scraperId': scraperId, + 'status': status, + }; + } +} + +/// Represents the output of a DescribeAlertManagerDefinition +/// operation. class DescribeAlertManagerDefinitionResponse { - /// The properties of the selected workspace's alert manager definition. + /// The alert manager definition. final AlertManagerDefinitionDescription alertManagerDefinition; DescribeAlertManagerDefinitionResponse({ @@ -1048,10 +1517,10 @@ class DescribeAlertManagerDefinitionResponse { } } -/// Represents the output of a DescribeLoggingConfiguration operation. +/// Represents the output of a DescribeLoggingConfiguration +/// operation. class DescribeLoggingConfigurationResponse { - /// Metadata object containing information about the logging configuration of a - /// workspace. + /// A structure that displays the information about the logging configuration. final LoggingConfigurationMetadata loggingConfiguration; DescribeLoggingConfigurationResponse({ @@ -1074,9 +1543,10 @@ class DescribeLoggingConfigurationResponse { } } -/// Represents the output of a DescribeRuleGroupsNamespace operation. +/// Represents the output of a DescribeRuleGroupsNamespace +/// operation. class DescribeRuleGroupsNamespaceResponse { - /// The selected rule groups namespace. + /// The information about the rule groups namespace. final RuleGroupsNamespaceDescription ruleGroupsNamespace; DescribeRuleGroupsNamespaceResponse({ @@ -1099,9 +1569,33 @@ class DescribeRuleGroupsNamespaceResponse { } } -/// Represents the output of a DescribeWorkspace operation. +/// Represents the output of a DescribeScraper operation. +class DescribeScraperResponse { + /// Contains details about the scraper. + final ScraperDescription scraper; + + DescribeScraperResponse({ + required this.scraper, + }); + + factory DescribeScraperResponse.fromJson(Map json) { + return DescribeScraperResponse( + scraper: + ScraperDescription.fromJson(json['scraper'] as Map), + ); + } + + Map toJson() { + final scraper = this.scraper; + return { + 'scraper': scraper, + }; + } +} + +/// Represents the output of a DescribeWorkspace operation. class DescribeWorkspaceResponse { - /// The properties of the selected workspace. + /// A structure that contains details about the workspace. final WorkspaceDescription workspace; DescribeWorkspaceResponse({ @@ -1123,12 +1617,113 @@ class DescribeWorkspaceResponse { } } -/// Represents the output of a ListRuleGroupsNamespaces operation. +/// Where to send the metrics from a scraper. +class Destination { + /// The Amazon Managed Service for Prometheusworkspace to send metrics to. + final AmpConfiguration? ampConfiguration; + + Destination({ + this.ampConfiguration, + }); + + factory Destination.fromJson(Map json) { + return Destination( + ampConfiguration: json['ampConfiguration'] != null + ? AmpConfiguration.fromJson( + json['ampConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final ampConfiguration = this.ampConfiguration; + return { + if (ampConfiguration != null) 'ampConfiguration': ampConfiguration, + }; + } +} + +/// The EksConfiguration structure describes the connection to the +/// Amazon EKS cluster from which a scraper collects metrics. +class EksConfiguration { + /// ARN of the Amazon EKS cluster. + final String clusterArn; + + /// A list of subnet IDs for the Amazon EKS cluster VPC configuration. + final List subnetIds; + + /// A list of the security group IDs for the Amazon EKS cluster VPC + /// configuration. + final List? securityGroupIds; + + EksConfiguration({ + required this.clusterArn, + required this.subnetIds, + this.securityGroupIds, + }); + + factory EksConfiguration.fromJson(Map json) { + return EksConfiguration( + clusterArn: json['clusterArn'] as String, + subnetIds: (json['subnetIds'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + securityGroupIds: (json['securityGroupIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final clusterArn = this.clusterArn; + final subnetIds = this.subnetIds; + final securityGroupIds = this.securityGroupIds; + return { + 'clusterArn': clusterArn, + 'subnetIds': subnetIds, + if (securityGroupIds != null) 'securityGroupIds': securityGroupIds, + }; + } +} + +/// Represents the output of a GetDefaultScraperConfiguration +/// operation. +class GetDefaultScraperConfigurationResponse { + /// The configuration file. Base 64 encoded. For more information, see Scraper + /// configurationin the Amazon Managed Service for Prometheus User + /// Guide. + final Uint8List configuration; + + GetDefaultScraperConfigurationResponse({ + required this.configuration, + }); + + factory GetDefaultScraperConfigurationResponse.fromJson( + Map json) { + return GetDefaultScraperConfigurationResponse( + configuration: _s.decodeUint8List(json['configuration']! as String), + ); + } + + Map toJson() { + final configuration = this.configuration; + return { + 'configuration': base64Encode(configuration), + }; + } +} + +/// Represents the output of a ListRuleGroupsNamespaces operation. class ListRuleGroupsNamespacesResponse { - /// The list of the selected rule groups namespaces. + /// The returned list of rule groups namespaces. final List ruleGroupsNamespaces; - /// Pagination token to use when requesting the next page in this list. + /// A token indicating that there are more results to retrieve. You can use this + /// token as part of your next ListRuleGroupsNamespaces request to + /// retrieve those results. final String? nextToken; ListRuleGroupsNamespacesResponse({ @@ -1157,7 +1752,44 @@ class ListRuleGroupsNamespacesResponse { } } +/// Represents the output of a ListScrapers operation. +class ListScrapersResponse { + /// A list of ScraperSummary structures giving information about + /// scrapers in the account that match the filters provided. + final List scrapers; + + /// A token indicating that there are more results to retrieve. You can use this + /// token as part of your next ListScrapers operation to retrieve + /// those results. + final String? nextToken; + + ListScrapersResponse({ + required this.scrapers, + this.nextToken, + }); + + factory ListScrapersResponse.fromJson(Map json) { + return ListScrapersResponse( + scrapers: (json['scrapers'] as List) + .whereNotNull() + .map((e) => ScraperSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final scrapers = this.scrapers; + final nextToken = this.nextToken; + return { + 'scrapers': scrapers, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListTagsForResourceResponse { + /// The list of tag keys and values associated with the resource. final Map? tags; ListTagsForResourceResponse({ @@ -1179,13 +1811,15 @@ class ListTagsForResourceResponse { } } -/// Represents the output of a ListWorkspaces operation. +/// Represents the output of a ListWorkspaces operation. class ListWorkspacesResponse { - /// The list of existing workspaces, including those undergoing creation or - /// deletion. + /// An array of WorkspaceSummary structures containing information + /// about the workspaces requested. final List workspaces; - /// Pagination token to use when requesting the next page in this list. + /// A token indicating that there are more results to retrieve. You can use this + /// token as part of your next ListWorkspaces request to retrieve + /// those results. final String? nextToken; ListWorkspacesResponse({ @@ -1213,21 +1847,22 @@ class ListWorkspacesResponse { } } -/// Represents the properties of a logging configuration metadata. +/// Contains information about the logging configuration. class LoggingConfigurationMetadata { - /// The time when the logging configuration was created. + /// The date and time that the logging configuration was created. final DateTime createdAt; - /// The ARN of the CW log group to which the vended log data will be published. + /// The ARN of the CloudWatch log group to which the vended log data will be + /// published. final String logGroupArn; - /// The time when the logging configuration was modified. + /// The date and time that the logging configuration was most recently changed. final DateTime modifiedAt; - /// The status of the logging configuration. + /// The current status of the logging configuration. final LoggingConfigurationStatus status; - /// The workspace where the logging configuration exists. + /// The ID of the workspace the logging configuration is for. final String workspace; LoggingConfigurationMetadata({ @@ -1265,12 +1900,12 @@ class LoggingConfigurationMetadata { } } -/// Represents the status of a logging configuration. +/// The status of the logging configuration. class LoggingConfigurationStatus { - /// Status code of the logging configuration. + /// The current status of the logging configuration. final LoggingConfigurationStatusCode statusCode; - /// The reason for failure if any. + /// If failed, the reason for the failure. final String? statusReason; LoggingConfigurationStatus({ @@ -1347,9 +1982,9 @@ extension LoggingConfigurationStatusCodeFromString on String { } } -/// Represents the output of a PutAlertManagerDefinition operation. +/// Represents the output of a PutAlertManagerDefinition operation. class PutAlertManagerDefinitionResponse { - /// The status of alert manager definition. + /// A structure that returns the current status of the alert manager definition. final AlertManagerDefinitionStatus status; PutAlertManagerDefinitionResponse({ @@ -1372,18 +2007,18 @@ class PutAlertManagerDefinitionResponse { } } -/// Represents the output of a PutRuleGroupsNamespace operation. +/// Represents the output of a PutRuleGroupsNamespace operation. class PutRuleGroupsNamespaceResponse { - /// The Amazon Resource Name (ARN) of this rule groups namespace. + /// The ARN of the rule groups namespace. final String arn; - /// The rule groups namespace name. + /// The name of the rule groups namespace that was updated. final String name; - /// The status of rule groups namespace. + /// A structure that includes the current status of the rule groups namespace. final RuleGroupsNamespaceStatus status; - /// The tags of this rule groups namespace. + /// The list of tag keys and values that are associated with the namespace. final Map? tags; PutRuleGroupsNamespaceResponse({ @@ -1418,27 +2053,31 @@ class PutRuleGroupsNamespaceResponse { } } -/// Represents a description of the rule groups namespace. +/// The details about one rule groups namespace. class RuleGroupsNamespaceDescription { - /// The Amazon Resource Name (ARN) of this rule groups namespace. + /// The ARN of the rule groups namespace. final String arn; - /// The time when the rule groups namespace was created. + /// The date and time that the rule groups namespace was created. final DateTime createdAt; - /// The rule groups namespace data. + /// The rule groups file used in the namespace. + /// + /// For details about the rule groups namespace structure, see RuleGroupsNamespaceData. final Uint8List data; - /// The time when the rule groups namespace was modified. + /// The date and time that the rule groups namespace was most recently changed. final DateTime modifiedAt; - /// The rule groups namespace name. + /// The name of the rule groups namespace. final String name; - /// The status of rule groups namespace. + /// The current status of the rule groups namespace. final RuleGroupsNamespaceStatus status; - /// The tags of this rule groups namespace. + /// The list of tag keys and values that are associated with the rule groups + /// namespace. final Map? tags; RuleGroupsNamespaceDescription({ @@ -1485,12 +2124,12 @@ class RuleGroupsNamespaceDescription { } } -/// Represents the status of a namespace. +/// The status information about a rule groups namespace. class RuleGroupsNamespaceStatus { - /// Status code of this namespace. + /// The current status of the namespace. final RuleGroupsNamespaceStatusCode statusCode; - /// The reason for failure if any. + /// The reason for the failure, if any. final String? statusReason; RuleGroupsNamespaceStatus({ @@ -1566,24 +2205,26 @@ extension RuleGroupsNamespaceStatusCodeFromString on String { } } -/// Represents a summary of the rule groups namespace. +/// The high-level information about a rule groups namespace. To retrieve more +/// information, use DescribeRuleGroupsNamespace. class RuleGroupsNamespaceSummary { - /// The Amazon Resource Name (ARN) of this rule groups namespace. + /// The ARN of the rule groups namespace. final String arn; - /// The time when the rule groups namespace was created. + /// The date and time that the rule groups namespace was created. final DateTime createdAt; - /// The time when the rule groups namespace was modified. + /// The date and time that the rule groups namespace was most recently changed. final DateTime modifiedAt; - /// The rule groups namespace name. + /// The name of the rule groups namespace. final String name; - /// The status of rule groups namespace. + /// A structure that displays the current status of the rule groups namespace. final RuleGroupsNamespaceStatus status; - /// The tags of this rule groups namespace. + /// The list of tag keys and values that are associated with the rule groups + /// namespace. final Map? tags; RuleGroupsNamespaceSummary({ @@ -1626,6 +2267,335 @@ class RuleGroupsNamespaceSummary { } } +/// A scrape configuration for a scraper, base 64 encoded. For more information, +/// see Scraper +/// configuration in the Amazon Managed Service for Prometheus User +/// Guide. +class ScrapeConfiguration { + /// The base 64 encoded scrape configuration file. + final Uint8List? configurationBlob; + + ScrapeConfiguration({ + this.configurationBlob, + }); + + factory ScrapeConfiguration.fromJson(Map json) { + return ScrapeConfiguration( + configurationBlob: + _s.decodeNullableUint8List(json['configurationBlob'] as String?), + ); + } + + Map toJson() { + final configurationBlob = this.configurationBlob; + return { + if (configurationBlob != null) + 'configurationBlob': base64Encode(configurationBlob), + }; + } +} + +/// The ScraperDescription structure contains the full details +/// about one scraper in your account. +class ScraperDescription { + /// The Amazon Resource Name (ARN) of the scraper. + final String arn; + + /// The date and time that the scraper was created. + final DateTime createdAt; + + /// The Amazon Managed Service for Prometheus workspace the scraper sends + /// metrics to. + final Destination destination; + + /// The date and time that the scraper was last modified. + final DateTime lastModifiedAt; + + /// The Amazon Resource Name (ARN) of the IAM role that provides permissions for + /// the scraper to discover and collect metrics on your behalf. + final String roleArn; + + /// The configuration file in use by the scraper. + final ScrapeConfiguration scrapeConfiguration; + + /// The ID of the scraper. + final String scraperId; + + /// The Amazon EKS cluster from which the scraper collects metrics. + final Source source; + + /// A structure that contains the current status of the scraper. + final ScraperStatus status; + + /// (Optional) A name associated with the scraper. + final String? alias; + + /// If there is a failure, the reason for the failure. + final String? statusReason; + + /// (Optional) The list of tag keys and values associated with the scraper. + final Map? tags; + + ScraperDescription({ + required this.arn, + required this.createdAt, + required this.destination, + required this.lastModifiedAt, + required this.roleArn, + required this.scrapeConfiguration, + required this.scraperId, + required this.source, + required this.status, + this.alias, + this.statusReason, + this.tags, + }); + + factory ScraperDescription.fromJson(Map json) { + return ScraperDescription( + arn: json['arn'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + destination: + Destination.fromJson(json['destination'] as Map), + lastModifiedAt: + nonNullableTimeStampFromJson(json['lastModifiedAt'] as Object), + roleArn: json['roleArn'] as String, + scrapeConfiguration: ScrapeConfiguration.fromJson( + json['scrapeConfiguration'] as Map), + scraperId: json['scraperId'] as String, + source: Source.fromJson(json['source'] as Map), + status: ScraperStatus.fromJson(json['status'] as Map), + alias: json['alias'] as String?, + statusReason: json['statusReason'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final createdAt = this.createdAt; + final destination = this.destination; + final lastModifiedAt = this.lastModifiedAt; + final roleArn = this.roleArn; + final scrapeConfiguration = this.scrapeConfiguration; + final scraperId = this.scraperId; + final source = this.source; + final status = this.status; + final alias = this.alias; + final statusReason = this.statusReason; + final tags = this.tags; + return { + 'arn': arn, + 'createdAt': unixTimestampToJson(createdAt), + 'destination': destination, + 'lastModifiedAt': unixTimestampToJson(lastModifiedAt), + 'roleArn': roleArn, + 'scrapeConfiguration': scrapeConfiguration, + 'scraperId': scraperId, + 'source': source, + 'status': status, + if (alias != null) 'alias': alias, + if (statusReason != null) 'statusReason': statusReason, + if (tags != null) 'tags': tags, + }; + } +} + +/// The ScraperStatus structure contains status information about +/// the scraper. +class ScraperStatus { + /// The current status of the scraper. + final ScraperStatusCode statusCode; + + ScraperStatus({ + required this.statusCode, + }); + + factory ScraperStatus.fromJson(Map json) { + return ScraperStatus( + statusCode: (json['statusCode'] as String).toScraperStatusCode(), + ); + } + + Map toJson() { + final statusCode = this.statusCode; + return { + 'statusCode': statusCode.toValue(), + }; + } +} + +/// State of a scraper. +enum ScraperStatusCode { + creating, + active, + deleting, + creationFailed, + deletionFailed, +} + +extension ScraperStatusCodeValueExtension on ScraperStatusCode { + String toValue() { + switch (this) { + case ScraperStatusCode.creating: + return 'CREATING'; + case ScraperStatusCode.active: + return 'ACTIVE'; + case ScraperStatusCode.deleting: + return 'DELETING'; + case ScraperStatusCode.creationFailed: + return 'CREATION_FAILED'; + case ScraperStatusCode.deletionFailed: + return 'DELETION_FAILED'; + } + } +} + +extension ScraperStatusCodeFromString on String { + ScraperStatusCode toScraperStatusCode() { + switch (this) { + case 'CREATING': + return ScraperStatusCode.creating; + case 'ACTIVE': + return ScraperStatusCode.active; + case 'DELETING': + return ScraperStatusCode.deleting; + case 'CREATION_FAILED': + return ScraperStatusCode.creationFailed; + case 'DELETION_FAILED': + return ScraperStatusCode.deletionFailed; + } + throw Exception('$this is not known in enum ScraperStatusCode'); + } +} + +/// The ScraperSummary structure contains a summary of the details +/// about one scraper in your account. +class ScraperSummary { + /// The Amazon Resource Name (ARN) of the scraper. + final String arn; + + /// The date and time that the scraper was created. + final DateTime createdAt; + + /// The Amazon Managed Service for Prometheus workspace the scraper sends + /// metrics to. + final Destination destination; + + /// The date and time that the scraper was last modified. + final DateTime lastModifiedAt; + + /// The Amazon Resource Name (ARN) of the IAM role that provides permissions for + /// the scraper to discover and collect metrics on your behalf. + final String roleArn; + + /// The ID of the scraper. + final String scraperId; + + /// The Amazon EKS cluster from which the scraper collects metrics. + final Source source; + + /// A structure that contains the current status of the scraper. + final ScraperStatus status; + + /// (Optional) A name associated with the scraper. + final String? alias; + + /// If there is a failure, the reason for the failure. + final String? statusReason; + + /// (Optional) The list of tag keys and values associated with the scraper. + final Map? tags; + + ScraperSummary({ + required this.arn, + required this.createdAt, + required this.destination, + required this.lastModifiedAt, + required this.roleArn, + required this.scraperId, + required this.source, + required this.status, + this.alias, + this.statusReason, + this.tags, + }); + + factory ScraperSummary.fromJson(Map json) { + return ScraperSummary( + arn: json['arn'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + destination: + Destination.fromJson(json['destination'] as Map), + lastModifiedAt: + nonNullableTimeStampFromJson(json['lastModifiedAt'] as Object), + roleArn: json['roleArn'] as String, + scraperId: json['scraperId'] as String, + source: Source.fromJson(json['source'] as Map), + status: ScraperStatus.fromJson(json['status'] as Map), + alias: json['alias'] as String?, + statusReason: json['statusReason'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final createdAt = this.createdAt; + final destination = this.destination; + final lastModifiedAt = this.lastModifiedAt; + final roleArn = this.roleArn; + final scraperId = this.scraperId; + final source = this.source; + final status = this.status; + final alias = this.alias; + final statusReason = this.statusReason; + final tags = this.tags; + return { + 'arn': arn, + 'createdAt': unixTimestampToJson(createdAt), + 'destination': destination, + 'lastModifiedAt': unixTimestampToJson(lastModifiedAt), + 'roleArn': roleArn, + 'scraperId': scraperId, + 'source': source, + 'status': status, + if (alias != null) 'alias': alias, + if (statusReason != null) 'statusReason': statusReason, + if (tags != null) 'tags': tags, + }; + } +} + +/// The source of collected metrics for a scraper. +class Source { + /// The Amazon EKS cluster from which a scraper collects metrics. + final EksConfiguration? eksConfiguration; + + Source({ + this.eksConfiguration, + }); + + factory Source.fromJson(Map json) { + return Source( + eksConfiguration: json['eksConfiguration'] != null + ? EksConfiguration.fromJson( + json['eksConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final eksConfiguration = this.eksConfiguration; + return { + if (eksConfiguration != null) 'eksConfiguration': eksConfiguration, + }; + } +} + class TagResourceResponse { TagResourceResponse(); @@ -1650,9 +2620,10 @@ class UntagResourceResponse { } } -/// Represents the output of an UpdateLoggingConfiguration operation. +/// Represents the output of an UpdateLoggingConfiguration +/// operation. class UpdateLoggingConfigurationResponse { - /// The status of the logging configuration. + /// A structure that contains the current status of the logging configuration. final LoggingConfigurationStatus status; UpdateLoggingConfigurationResponse({ @@ -1675,27 +2646,33 @@ class UpdateLoggingConfigurationResponse { } } -/// Represents the properties of a workspace. +/// The full details about one Amazon Managed Service for Prometheus workspace +/// in your account. class WorkspaceDescription { - /// The Amazon Resource Name (ARN) of this workspace. + /// The ARN of the workspace. final String arn; - /// The time when the workspace was created. + /// The date and time that the workspace was created. final DateTime createdAt; - /// The status of this workspace. + /// The current status of the workspace. final WorkspaceStatus status; - /// Unique string identifying this workspace. + /// The unique ID for the workspace. final String workspaceId; - /// Alias of this workspace. + /// The alias that is assigned to this workspace to help identify it. It may not + /// be unique. final String? alias; - /// Prometheus endpoint URI. + /// (optional) If the workspace was created with a customer managed KMS key, the + /// ARN for the key used. + final String? kmsKeyArn; + + /// The Prometheus endpoint available for this workspace. final String? prometheusEndpoint; - /// The tags of this workspace. + /// The list of tag keys and values that are associated with the workspace. final Map? tags; WorkspaceDescription({ @@ -1704,6 +2681,7 @@ class WorkspaceDescription { required this.status, required this.workspaceId, this.alias, + this.kmsKeyArn, this.prometheusEndpoint, this.tags, }); @@ -1715,6 +2693,7 @@ class WorkspaceDescription { status: WorkspaceStatus.fromJson(json['status'] as Map), workspaceId: json['workspaceId'] as String, alias: json['alias'] as String?, + kmsKeyArn: json['kmsKeyArn'] as String?, prometheusEndpoint: json['prometheusEndpoint'] as String?, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), @@ -1727,6 +2706,7 @@ class WorkspaceDescription { final status = this.status; final workspaceId = this.workspaceId; final alias = this.alias; + final kmsKeyArn = this.kmsKeyArn; final prometheusEndpoint = this.prometheusEndpoint; final tags = this.tags; return { @@ -1735,15 +2715,16 @@ class WorkspaceDescription { 'status': status, 'workspaceId': workspaceId, if (alias != null) 'alias': alias, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, if (prometheusEndpoint != null) 'prometheusEndpoint': prometheusEndpoint, if (tags != null) 'tags': tags, }; } } -/// Represents the status of a workspace. +/// The status of the workspace. class WorkspaceStatus { - /// Status code of this workspace. + /// The current status of the workspace. final WorkspaceStatusCode statusCode; WorkspaceStatus({ @@ -1808,24 +2789,30 @@ extension WorkspaceStatusCodeFromString on String { } } -/// Represents a summary of the properties of a workspace. +/// The information about one Amazon Managed Service for Prometheus workspace in +/// your account. class WorkspaceSummary { - /// The AmazonResourceName of this workspace. + /// The ARN of the workspace. final String arn; - /// The time when the workspace was created. + /// The date and time that the workspace was created. final DateTime createdAt; - /// The status of this workspace. + /// The current status of the workspace. final WorkspaceStatus status; - /// Unique string identifying this workspace. + /// The unique ID for the workspace. final String workspaceId; - /// Alias of this workspace. + /// The alias that is assigned to this workspace to help identify it. It may not + /// be unique. final String? alias; - /// The tags of this workspace. + /// (optional) If the workspace was created with a customer managed KMS key, the + /// ARN for the key used. + final String? kmsKeyArn; + + /// The list of tag keys and values that are associated with the workspace. final Map? tags; WorkspaceSummary({ @@ -1834,6 +2821,7 @@ class WorkspaceSummary { required this.status, required this.workspaceId, this.alias, + this.kmsKeyArn, this.tags, }); @@ -1844,6 +2832,7 @@ class WorkspaceSummary { status: WorkspaceStatus.fromJson(json['status'] as Map), workspaceId: json['workspaceId'] as String, alias: json['alias'] as String?, + kmsKeyArn: json['kmsKeyArn'] as String?, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -1855,6 +2844,7 @@ class WorkspaceSummary { final status = this.status; final workspaceId = this.workspaceId; final alias = this.alias; + final kmsKeyArn = this.kmsKeyArn; final tags = this.tags; return { 'arn': arn, @@ -1862,6 +2852,7 @@ class WorkspaceSummary { 'status': status, 'workspaceId': workspaceId, if (alias != null) 'alias': alias, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, if (tags != null) 'tags': tags, }; } diff --git a/aws_client/lib/src/generated/amplify/v2017_07_25.dart b/aws_client/lib/src/generated/amplify/v2017_07_25.dart index d0a42cdf5..1b6dfcce6 100644 --- a/aws_client/lib/src/generated/amplify/v2017_07_25.dart +++ b/aws_client/lib/src/generated/amplify/v2017_07_25.dart @@ -20,10 +20,10 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; /// Amplify enables developers to develop and deploy cloud-powered mobile and -/// web apps. The Amplify Console provides a continuous delivery and hosting -/// service for web applications. For more information, see the Amplify -/// Console User Guide. The Amplify Framework is a comprehensive set of +/// Hosting User Guide. The Amplify Framework is a comprehensive set of /// SDKs, libraries, tools, and documentation for client app development. For /// more information, see the Amplify /// Framework. @@ -65,7 +65,7 @@ class Amplify { /// May throw [DependentServiceFailureException]. /// /// Parameter [name] : - /// The name for an Amplify app. + /// The name of the Amplify app. /// /// Parameter [accessToken] : /// The personal access token for a GitHub repository for an Amplify app. The @@ -82,7 +82,7 @@ class Amplify { /// Existing Amplify apps deployed from a GitHub repository using OAuth /// continue to work with CI/CD. However, we strongly recommend that you /// migrate these apps to use the GitHub App. For more information, see Migrating + /// href="https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth">Migrating /// an existing OAuth app to the Amplify GitHub App in the Amplify User /// Guide . /// @@ -107,7 +107,7 @@ class Amplify { /// The custom rewrite and redirect rules for an Amplify app. /// /// Parameter [description] : - /// The description for an Amplify app. + /// The description of the Amplify app. /// /// Parameter [enableAutoBranchCreation] : /// Enables automated branch creation for an Amplify app. @@ -120,12 +120,17 @@ class Amplify { /// Enables the auto building of branches for an Amplify app. /// /// Parameter [enableBranchAutoDeletion] : - /// Automatically disconnects a branch in the Amplify Console when you delete + /// Automatically disconnects a branch in the Amplify console when you delete /// a branch from your Git repository. /// /// Parameter [environmentVariables] : /// The environment variables map for an Amplify app. /// + /// For a list of the environment variables that are accessible to Amplify by + /// default, see Amplify + /// Environment variables in the Amplify Hosting User Guide. + /// /// Parameter [iamServiceRoleArn] : /// The AWS Identity and Access Management (IAM) service role for an Amplify /// app. @@ -145,7 +150,7 @@ class Amplify { /// Existing Amplify apps deployed from a GitHub repository using OAuth /// continue to work with CI/CD. However, we strongly recommend that you /// migrate these apps to use the GitHub App. For more information, see Migrating + /// href="https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth">Migrating /// an existing OAuth app to the Amplify GitHub App in the Amplify User /// Guide . /// @@ -157,7 +162,7 @@ class Amplify { /// WEB_DYNAMIC. /// /// Parameter [repository] : - /// The repository for an Amplify app. + /// The Git repository for the Amplify app. /// /// Parameter [tags] : /// The tag for an Amplify app. @@ -221,6 +226,12 @@ class Amplify { /// Creates a new backend environment for an Amplify app. /// + /// This API is available only to Amplify Gen 1 applications where the backend + /// is created using Amplify Studio or the Amplify command line interface + /// (CLI). This API isn’t available to Amplify Gen 2 applications. When you + /// deploy an application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [NotFoundException]. @@ -274,9 +285,20 @@ class Amplify { /// Parameter [branchName] : /// The name for the branch. /// + /// Parameter [backend] : + /// The backend for a Branch of an Amplify app. Use for a backend + /// created from an CloudFormation stack. + /// + /// This field is available to Amplify Gen 2 apps only. When you deploy an + /// application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. + /// /// Parameter [backendEnvironmentArn] : - /// The Amazon Resource Name (ARN) for a backend environment that is part of - /// an Amplify app. + /// The Amazon Resource Name (ARN) for a backend environment that is part of a + /// Gen 1 Amplify app. + /// + /// This field is available to Amplify Gen 1 apps only where the backend is + /// created using Amplify Studio or the Amplify command line interface (CLI). /// /// Parameter [basicAuthCredentials] : /// The basic authorization credentials for the branch. You must base64-encode @@ -332,6 +354,7 @@ class Amplify { Future createBranch({ required String appId, required String branchName, + Backend? backend, String? backendEnvironmentArn, String? basicAuthCredentials, String? buildSpec, @@ -351,6 +374,7 @@ class Amplify { }) async { final $payload = { 'branchName': branchName, + if (backend != null) 'backend': backend, if (backendEnvironmentArn != null) 'backendEnvironmentArn': backendEnvironmentArn, if (basicAuthCredentials != null) @@ -386,6 +410,11 @@ class Amplify { /// Creates a deployment for a manually deployed Amplify app. Manually /// deployed apps are not connected to a repository. /// + /// The maximum duration between the CreateDeployment call and + /// the StartDeployment call cannot exceed 8 hours. If the + /// duration exceeds 8 hours, the StartDeployment call and the + /// associated Job will fail. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. @@ -395,7 +424,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch, for the job. + /// The name of the branch to use for the job. /// /// Parameter [fileMap] : /// An optional file map that contains the file name as the key and the file @@ -446,6 +475,11 @@ class Amplify { /// The required AWS Identity and Access Management (IAM) service role for the /// Amazon Resource Name (ARN) for automatically creating subdomains. /// + /// Parameter [certificateSettings] : + /// The type of SSL/TLS certificate to use for your custom domain. If you + /// don't specify a certificate type, Amplify uses the default certificate + /// that it provisions and manages for you. + /// /// Parameter [enableAutoSubDomain] : /// Enables the automated creation of subdomains for branches. Future createDomainAssociation({ @@ -454,6 +488,7 @@ class Amplify { required List subDomainSettings, List? autoSubDomainCreationPatterns, String? autoSubDomainIAMRole, + CertificateSettings? certificateSettings, bool? enableAutoSubDomain, }) async { final $payload = { @@ -463,6 +498,8 @@ class Amplify { 'autoSubDomainCreationPatterns': autoSubDomainCreationPatterns, if (autoSubDomainIAMRole != null) 'autoSubDomainIAMRole': autoSubDomainIAMRole, + if (certificateSettings != null) + 'certificateSettings': certificateSettings, if (enableAutoSubDomain != null) 'enableAutoSubDomain': enableAutoSubDomain, }; @@ -534,6 +571,12 @@ class Amplify { /// Deletes a backend environment for an Amplify app. /// + /// This API is available only to Amplify Gen 1 applications where the backend + /// is created using Amplify Studio or the Amplify command line interface + /// (CLI). This API isn’t available to Amplify Gen 2 applications. When you + /// deploy an application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [NotFoundException]. @@ -571,7 +614,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch. + /// The name of the branch. Future deleteBranch({ required String appId, required String branchName, @@ -625,7 +668,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch, for the job. + /// The name of the branch to use for the job. /// /// Parameter [jobId] : /// The unique ID for the job. @@ -707,7 +750,7 @@ class Amplify { return GenerateAccessLogsResult.fromJson(response); } - /// Returns an existing Amplify app by appID. + /// Returns an existing Amplify app specified by an app ID. /// /// May throw [BadRequestException]. /// May throw [NotFoundException]. @@ -752,6 +795,12 @@ class Amplify { /// Returns a backend environment for an Amplify app. /// + /// This API is available only to Amplify Gen 1 applications where the backend + /// is created using Amplify Studio or the Amplify command line interface + /// (CLI). This API isn’t available to Amplify Gen 2 applications. When you + /// deploy an application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [NotFoundException]. @@ -787,7 +836,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch. + /// The name of the branch. Future getBranch({ required String appId, required String branchName, @@ -840,7 +889,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The branch name for the job. + /// The name of the branch to use for the job. /// /// Parameter [jobId] : /// The unique ID for the job. @@ -952,7 +1001,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -971,6 +1020,12 @@ class Amplify { /// Lists the backend environments for an Amplify app. /// + /// This API is available only to Amplify Gen 1 applications where the backend + /// is created using Amplify Studio or the Amplify command line interface + /// (CLI). This API isn’t available to Amplify Gen 2 applications. When you + /// deploy an application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. @@ -998,7 +1053,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (environmentName != null) 'environmentName': [environmentName], @@ -1040,7 +1095,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -1081,7 +1136,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -1108,7 +1163,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for a branch. + /// The name of the branch to use for the request. /// /// Parameter [maxResults] : /// The maximum number of records to list in a single response. @@ -1127,7 +1182,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -1190,7 +1245,7 @@ class Amplify { 'maxResults', maxResults, 0, - 100, + 50, ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -1209,6 +1264,11 @@ class Amplify { /// Starts a deployment for a manually deployed app. Manually deployed apps /// are not connected to a repository. /// + /// The maximum duration between the CreateDeployment call and + /// the StartDeployment call cannot exceed 8 hours. If the + /// duration exceeds 8 hours, the StartDeployment call and the + /// associated Job will fail. + /// /// May throw [BadRequestException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. @@ -1219,7 +1279,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch, for the job. + /// The name of the branch to use for the job. /// /// Parameter [jobId] : /// The job ID for this deployment, generated by the create deployment @@ -1261,14 +1321,15 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The branch name for the job. + /// The name of the branch to use for the job. /// /// Parameter [jobType] : /// Describes the type for the job. The job type RELEASE starts a /// new job with the latest change from the specified branch. This value is - /// available only for apps that are connected to a repository. The job type - /// RETRY retries an existing job. If the job type value is - /// RETRY, the jobId is also required. + /// available only for apps that are connected to a repository. + /// + /// The job type RETRY retries an existing job. If the job type + /// value is RETRY, the jobId is also required. /// /// Parameter [commitId] : /// The commit ID from a third-party repository provider for the job. @@ -1284,7 +1345,7 @@ class Amplify { /// jobType is RETRY. /// /// Parameter [jobReason] : - /// A descriptive reason for starting this job. + /// A descriptive reason for starting the job. Future startJob({ required String appId, required String branchName, @@ -1325,7 +1386,7 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch, for the job. + /// The name of the branch to use for the stop job request. /// /// Parameter [jobId] : /// The unique id for the job. @@ -1422,7 +1483,7 @@ class Amplify { /// Existing Amplify apps deployed from a GitHub repository using OAuth /// continue to work with CI/CD. However, we strongly recommend that you /// migrate these apps to use the GitHub App. For more information, see Migrating + /// href="https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth">Migrating /// an existing OAuth app to the Amplify GitHub App in the Amplify User /// Guide . /// @@ -1459,7 +1520,7 @@ class Amplify { /// Enables branch auto-building for an Amplify app. /// /// Parameter [enableBranchAutoDeletion] : - /// Automatically disconnects a branch in the Amplify Console when you delete + /// Automatically disconnects a branch in the Amplify console when you delete /// a branch from your Git repository. /// /// Parameter [environmentVariables] : @@ -1489,7 +1550,7 @@ class Amplify { /// Existing Amplify apps deployed from a GitHub repository using OAuth /// continue to work with CI/CD. However, we strongly recommend that you /// migrate these apps to use the GitHub App. For more information, see Migrating + /// href="https://docs.aws.amazon.com/amplify/latest/userguide/setting-up-GitHub-access.html#migrating-to-github-app-auth">Migrating /// an existing OAuth app to the Amplify GitHub App in the Amplify User /// Guide . /// @@ -1501,7 +1562,7 @@ class Amplify { /// WEB_DYNAMIC. /// /// Parameter [repository] : - /// The name of the repository for an Amplify app + /// The name of the Git repository for an Amplify app. Future updateApp({ required String appId, String? accessToken, @@ -1571,11 +1632,22 @@ class Amplify { /// The unique ID for an Amplify app. /// /// Parameter [branchName] : - /// The name for the branch. + /// The name of the branch. + /// + /// Parameter [backend] : + /// The backend for a Branch of an Amplify app. Use for a backend + /// created from an CloudFormation stack. + /// + /// This field is available to Amplify Gen 2 apps only. When you deploy an + /// application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. /// /// Parameter [backendEnvironmentArn] : - /// The Amazon Resource Name (ARN) for a backend environment that is part of - /// an Amplify app. + /// The Amazon Resource Name (ARN) for a backend environment that is part of a + /// Gen 1 Amplify app. + /// + /// This field is available to Amplify Gen 1 apps only where the backend is + /// created using Amplify Studio or the Amplify command line interface (CLI). /// /// Parameter [basicAuthCredentials] : /// The basic authorization credentials for the branch. You must base64-encode @@ -1628,6 +1700,7 @@ class Amplify { Future updateBranch({ required String appId, required String branchName, + Backend? backend, String? backendEnvironmentArn, String? basicAuthCredentials, String? buildSpec, @@ -1645,6 +1718,7 @@ class Amplify { String? ttl, }) async { final $payload = { + if (backend != null) 'backend': backend, if (backendEnvironmentArn != null) 'backendEnvironmentArn': backendEnvironmentArn, if (basicAuthCredentials != null) @@ -1698,6 +1772,9 @@ class Amplify { /// The required AWS Identity and Access Management (IAM) service role for the /// Amazon Resource Name (ARN) for automatically creating subdomains. /// + /// Parameter [certificateSettings] : + /// The type of SSL/TLS certificate to use for your custom domain. + /// /// Parameter [enableAutoSubDomain] : /// Enables the automated creation of subdomains for branches. /// @@ -1708,6 +1785,7 @@ class Amplify { required String domainName, List? autoSubDomainCreationPatterns, String? autoSubDomainIAMRole, + CertificateSettings? certificateSettings, bool? enableAutoSubDomain, List? subDomainSettings, }) async { @@ -1716,6 +1794,8 @@ class Amplify { 'autoSubDomainCreationPatterns': autoSubDomainCreationPatterns, if (autoSubDomainIAMRole != null) 'autoSubDomainIAMRole': autoSubDomainIAMRole, + if (certificateSettings != null) + 'certificateSettings': certificateSettings, if (enableAutoSubDomain != null) 'enableAutoSubDomain': enableAutoSubDomain, if (subDomainSettings != null) 'subDomainSettings': subDomainSettings, @@ -1790,6 +1870,11 @@ class App { final bool enableBranchAutoBuild; /// The environment variables for the Amplify app. + /// + /// For a list of the environment variables that are accessible to Amplify by + /// default, see Amplify + /// Environment variables in the Amplify Hosting User Guide. final Map environmentVariables; /// The name for the Amplify app. @@ -1832,7 +1917,7 @@ class App { /// Enables automated branch creation for the Amplify app. final bool? enableAutoBranchCreation; - /// Automatically disconnect a branch in the Amplify Console when you delete a + /// Automatically disconnect a branch in the Amplify console when you delete a /// branch from your Git repository. final bool? enableBranchAutoDeletion; @@ -2117,7 +2202,36 @@ class AutoBranchCreationConfig { } } -/// Describes the backend environment for an Amplify app. +/// Describes the backend associated with an Amplify Branch. +/// +/// This property is available to Amplify Gen 2 apps only. When you deploy an +/// application with Amplify Gen 2, you provision the app's backend +/// infrastructure using Typescript code. +class Backend { + /// The Amazon Resource Name (ARN) for the CloudFormation stack. + final String? stackArn; + + Backend({ + this.stackArn, + }); + + factory Backend.fromJson(Map json) { + return Backend( + stackArn: json['stackArn'] as String?, + ); + } + + Map toJson() { + final stackArn = this.stackArn; + return { + if (stackArn != null) 'stackArn': stackArn, + }; + } +} + +/// Describes the backend environment associated with a Branch of a +/// Gen 1 Amplify app. Amplify Gen 1 applications are created using Amplify +/// Studio or the Amplify command line interface (CLI). class BackendEnvironment { /// The Amazon Resource Name (ARN) for a backend environment that is part of an /// Amplify app. @@ -2235,9 +2349,14 @@ class Branch { /// A list of custom resources that are linked to this branch. final List? associatedResources; + final Backend? backend; /// The Amazon Resource Name (ARN) for a backend environment that is part of an /// Amplify app. + /// + /// This property is available to Amplify Gen 1 apps only. When you deploy an + /// application with Amplify Gen 2, you provision the app's backend + /// infrastructure using Typescript code. final String? backendEnvironmentArn; /// The basic authorization credentials for a branch of an Amplify app. You must @@ -2290,6 +2409,7 @@ class Branch { required this.ttl, required this.updateTime, this.associatedResources, + this.backend, this.backendEnvironmentArn, this.basicAuthCredentials, this.buildSpec, @@ -2329,6 +2449,9 @@ class Branch { ?.whereNotNull() .map((e) => e as String) .toList(), + backend: json['backend'] != null + ? Backend.fromJson(json['backend'] as Map) + : null, backendEnvironmentArn: json['backendEnvironmentArn'] as String?, basicAuthCredentials: json['basicAuthCredentials'] as String?, buildSpec: json['buildSpec'] as String?, @@ -2361,6 +2484,7 @@ class Branch { final ttl = this.ttl; final updateTime = this.updateTime; final associatedResources = this.associatedResources; + final backend = this.backend; final backendEnvironmentArn = this.backendEnvironmentArn; final basicAuthCredentials = this.basicAuthCredentials; final buildSpec = this.buildSpec; @@ -2390,6 +2514,7 @@ class Branch { 'updateTime': unixTimestampToJson(updateTime), if (associatedResources != null) 'associatedResources': associatedResources, + if (backend != null) 'backend': backend, if (backendEnvironmentArn != null) 'backendEnvironmentArn': backendEnvironmentArn, if (basicAuthCredentials != null) @@ -2407,6 +2532,132 @@ class Branch { } } +/// Describes the current SSL/TLS certificate that is in use for the domain. If +/// you are using CreateDomainAssociation to create a new domain +/// association, Certificate describes the new certificate that you +/// are creating. +class Certificate { + /// The type of SSL/TLS certificate that you want to use. + /// + /// Specify AMPLIFY_MANAGED to use the default certificate that + /// Amplify provisions for you. + /// + /// Specify CUSTOM to use your own certificate that you have + /// already added to Certificate Manager in your Amazon Web Services account. + /// Make sure you request (or import) the certificate in the US East (N. + /// Virginia) Region (us-east-1). For more information about using ACM, see Importing + /// certificates into Certificate Manager in the ACM User guide . + final CertificateType type; + + /// The DNS record for certificate verification. + final String? certificateVerificationDNSRecord; + + /// The Amazon resource name (ARN) for a custom certificate that you have + /// already added to Certificate Manager in your Amazon Web Services account. + /// + /// This field is required only when the certificate type is + /// CUSTOM. + final String? customCertificateArn; + + Certificate({ + required this.type, + this.certificateVerificationDNSRecord, + this.customCertificateArn, + }); + + factory Certificate.fromJson(Map json) { + return Certificate( + type: (json['type'] as String).toCertificateType(), + certificateVerificationDNSRecord: + json['certificateVerificationDNSRecord'] as String?, + customCertificateArn: json['customCertificateArn'] as String?, + ); + } + + Map toJson() { + final type = this.type; + final certificateVerificationDNSRecord = + this.certificateVerificationDNSRecord; + final customCertificateArn = this.customCertificateArn; + return { + 'type': type.toValue(), + if (certificateVerificationDNSRecord != null) + 'certificateVerificationDNSRecord': certificateVerificationDNSRecord, + if (customCertificateArn != null) + 'customCertificateArn': customCertificateArn, + }; + } +} + +/// The type of SSL/TLS certificate to use for your custom domain. If a +/// certificate type isn't specified, Amplify uses the default +/// AMPLIFY_MANAGED certificate. +class CertificateSettings { + /// The certificate type. + /// + /// Specify AMPLIFY_MANAGED to use the default certificate that + /// Amplify provisions for you. + /// + /// Specify CUSTOM to use your own certificate that you have + /// already added to Certificate Manager in your Amazon Web Services account. + /// Make sure you request (or import) the certificate in the US East (N. + /// Virginia) Region (us-east-1). For more information about using ACM, see Importing + /// certificates into Certificate Manager in the ACM User guide. + final CertificateType type; + + /// The Amazon resource name (ARN) for the custom certificate that you have + /// already added to Certificate Manager in your Amazon Web Services account. + /// + /// This field is required only when the certificate type is + /// CUSTOM. + final String? customCertificateArn; + + CertificateSettings({ + required this.type, + this.customCertificateArn, + }); + + Map toJson() { + final type = this.type; + final customCertificateArn = this.customCertificateArn; + return { + 'type': type.toValue(), + if (customCertificateArn != null) + 'customCertificateArn': customCertificateArn, + }; + } +} + +enum CertificateType { + amplifyManaged, + custom, +} + +extension CertificateTypeValueExtension on CertificateType { + String toValue() { + switch (this) { + case CertificateType.amplifyManaged: + return 'AMPLIFY_MANAGED'; + case CertificateType.custom: + return 'CUSTOM'; + } + } +} + +extension CertificateTypeFromString on String { + CertificateType toCertificateType() { + switch (this) { + case 'AMPLIFY_MANAGED': + return CertificateType.amplifyManaged; + case 'CUSTOM': + return CertificateType.custom; + } + throw Exception('$this is not known in enum CertificateType'); + } +} + class CreateAppResult { final App app; @@ -2579,7 +2830,7 @@ class CustomRule { ///
200
/// Represents a 200 rewrite rule. ///
301
- /// Represents a 301 (moved pemanently) redirect rule. This and all future + /// Represents a 301 (moved permanently) redirect rule. This and all future /// requests should be directed to the target URL. ///
302
/// Represents a 302 temporary redirect rule. @@ -2758,8 +3009,7 @@ class DeleteWebhookResult { } } -/// Describes a domain association that associates a custom domain with an -/// Amplify app. +/// Describes the association between a custom domain and an Amplify app. class DomainAssociation { /// The Amazon Resource Name (ARN) for the domain association. final String domainAssociationArn; @@ -2773,7 +3023,8 @@ class DomainAssociation { /// Enables the automated creation of subdomains for branches. final bool enableAutoSubDomain; - /// The reason for the current status of the domain association. + /// Additional information that describes why the domain association is in the + /// current state. final String statusReason; /// The subdomains for the domain association. @@ -2786,9 +3037,47 @@ class DomainAssociation { /// Amazon Resource Name (ARN) for automatically creating subdomains. final String? autoSubDomainIAMRole; + /// Describes the SSL/TLS certificate for the domain association. This can be + /// your own custom certificate or the default certificate that Amplify + /// provisions for you. + /// + /// If you are updating your domain to use a different certificate, + /// certificate points to the new certificate that is being created + /// instead of the current active certificate. Otherwise, + /// certificate points to the current active certificate. + final Certificate? certificate; + /// The DNS record for certificate verification. final String? certificateVerificationDNSRecord; + /// The status of the domain update operation that is currently in progress. The + /// following list describes the valid update states. + ///
REQUESTING_CERTIFICATE
+ /// The certificate is in the process of being updated. + ///
PENDING_VERIFICATION
+ /// Indicates that an Amplify managed certificate is in the process of being + /// verified. This occurs during the creation of a custom domain or when a + /// custom domain is updated to use a managed certificate. + ///
IMPORTING_CUSTOM_CERTIFICATE
+ /// Indicates that an Amplify custom certificate is in the process of being + /// imported. This occurs during the creation of a custom domain or when a + /// custom domain is updated to use a custom certificate. + ///
PENDING_DEPLOYMENT
+ /// Indicates that the subdomain or certificate changes are being propagated. + ///
AWAITING_APP_CNAME
+ /// Amplify is waiting for CNAME records corresponding to subdomains to be + /// propagated. If your custom domain is on Route 53, Amplify handles this for + /// you automatically. For more information about custom domains, see Setting + /// up custom domains in the Amplify Hosting User Guide. + ///
UPDATE_COMPLETE
+ /// The certificate has been associated with a domain. + ///
UPDATE_FAILED
+ /// The certificate has failed to be provisioned or associated, and there is no + /// existing active certificate to roll back to. + ///
+ final UpdateStatus? updateStatus; + DomainAssociation({ required this.domainAssociationArn, required this.domainName, @@ -2798,7 +3087,9 @@ class DomainAssociation { required this.subDomains, this.autoSubDomainCreationPatterns, this.autoSubDomainIAMRole, + this.certificate, this.certificateVerificationDNSRecord, + this.updateStatus, }); factory DomainAssociation.fromJson(Map json) { @@ -2818,8 +3109,12 @@ class DomainAssociation { .map((e) => e as String) .toList(), autoSubDomainIAMRole: json['autoSubDomainIAMRole'] as String?, + certificate: json['certificate'] != null + ? Certificate.fromJson(json['certificate'] as Map) + : null, certificateVerificationDNSRecord: json['certificateVerificationDNSRecord'] as String?, + updateStatus: (json['updateStatus'] as String?)?.toUpdateStatus(), ); } @@ -2832,8 +3127,10 @@ class DomainAssociation { final subDomains = this.subDomains; final autoSubDomainCreationPatterns = this.autoSubDomainCreationPatterns; final autoSubDomainIAMRole = this.autoSubDomainIAMRole; + final certificate = this.certificate; final certificateVerificationDNSRecord = this.certificateVerificationDNSRecord; + final updateStatus = this.updateStatus; return { 'domainAssociationArn': domainAssociationArn, 'domainName': domainName, @@ -2845,8 +3142,10 @@ class DomainAssociation { 'autoSubDomainCreationPatterns': autoSubDomainCreationPatterns, if (autoSubDomainIAMRole != null) 'autoSubDomainIAMRole': autoSubDomainIAMRole, + if (certificate != null) 'certificate': certificate, if (certificateVerificationDNSRecord != null) 'certificateVerificationDNSRecord': certificateVerificationDNSRecord, + if (updateStatus != null) 'updateStatus': updateStatus.toValue(), }; } } @@ -2855,7 +3154,9 @@ enum DomainStatus { pendingVerification, inProgress, available, + importingCustomCertificate, pendingDeployment, + awaitingAppCname, failed, creating, requestingCertificate, @@ -2871,8 +3172,12 @@ extension DomainStatusValueExtension on DomainStatus { return 'IN_PROGRESS'; case DomainStatus.available: return 'AVAILABLE'; + case DomainStatus.importingCustomCertificate: + return 'IMPORTING_CUSTOM_CERTIFICATE'; case DomainStatus.pendingDeployment: return 'PENDING_DEPLOYMENT'; + case DomainStatus.awaitingAppCname: + return 'AWAITING_APP_CNAME'; case DomainStatus.failed: return 'FAILED'; case DomainStatus.creating: @@ -2894,8 +3199,12 @@ extension DomainStatusFromString on String { return DomainStatus.inProgress; case 'AVAILABLE': return DomainStatus.available; + case 'IMPORTING_CUSTOM_CERTIFICATE': + return DomainStatus.importingCustomCertificate; case 'PENDING_DEPLOYMENT': return DomainStatus.pendingDeployment; + case 'AWAITING_APP_CNAME': + return DomainStatus.awaitingAppCname; case 'FAILED': return DomainStatus.failed; case 'CREATING': @@ -4054,6 +4363,59 @@ class UpdateDomainAssociationResult { } } +enum UpdateStatus { + requestingCertificate, + pendingVerification, + importingCustomCertificate, + pendingDeployment, + awaitingAppCname, + updateComplete, + updateFailed, +} + +extension UpdateStatusValueExtension on UpdateStatus { + String toValue() { + switch (this) { + case UpdateStatus.requestingCertificate: + return 'REQUESTING_CERTIFICATE'; + case UpdateStatus.pendingVerification: + return 'PENDING_VERIFICATION'; + case UpdateStatus.importingCustomCertificate: + return 'IMPORTING_CUSTOM_CERTIFICATE'; + case UpdateStatus.pendingDeployment: + return 'PENDING_DEPLOYMENT'; + case UpdateStatus.awaitingAppCname: + return 'AWAITING_APP_CNAME'; + case UpdateStatus.updateComplete: + return 'UPDATE_COMPLETE'; + case UpdateStatus.updateFailed: + return 'UPDATE_FAILED'; + } + } +} + +extension UpdateStatusFromString on String { + UpdateStatus toUpdateStatus() { + switch (this) { + case 'REQUESTING_CERTIFICATE': + return UpdateStatus.requestingCertificate; + case 'PENDING_VERIFICATION': + return UpdateStatus.pendingVerification; + case 'IMPORTING_CUSTOM_CERTIFICATE': + return UpdateStatus.importingCustomCertificate; + case 'PENDING_DEPLOYMENT': + return UpdateStatus.pendingDeployment; + case 'AWAITING_APP_CNAME': + return UpdateStatus.awaitingAppCname; + case 'UPDATE_COMPLETE': + return UpdateStatus.updateComplete; + case 'UPDATE_FAILED': + return UpdateStatus.updateFailed; + } + throw Exception('$this is not known in enum UpdateStatus'); + } +} + /// The result structure for the update webhook request. class UpdateWebhookResult { /// Describes a webhook that connects repository events to an Amplify app. diff --git a/aws_client/lib/src/generated/amplify_ui_builder/v2021_08_11.dart b/aws_client/lib/src/generated/amplify_ui_builder/v2021_08_11.dart index 84d6cd9d8..8446f0a68 100644 --- a/aws_client/lib/src/generated/amplify_ui_builder/v2021_08_11.dart +++ b/aws_client/lib/src/generated/amplify_ui_builder/v2021_08_11.dart @@ -271,7 +271,10 @@ class AmplifyUIBuilder { ); } - /// Exchanges an access code for a token. + /// + /// This is for internal use. + /// + /// Amplify uses this action to exchange an access code for a token. /// /// May throw [InvalidParameterException]. /// @@ -393,6 +396,40 @@ class AmplifyUIBuilder { return ExportThemesResponse.fromJson(response); } + /// Returns an existing code generation job. + /// + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [appId] : + /// The unique ID of the Amplify app associated with the code generation job. + /// + /// Parameter [environmentName] : + /// The name of the backend environment that is a part of the Amplify app + /// associated with the code generation job. + /// + /// Parameter [id] : + /// The unique ID of the code generation job. + Future getCodegenJob({ + required String appId, + required String environmentName, + required String id, + }) async { + final response = await _protocol.sendRaw( + payload: null, + method: 'GET', + requestUri: + '/app/${Uri.encodeComponent(appId)}/environment/${Uri.encodeComponent(environmentName)}/codegen-jobs/${Uri.encodeComponent(id)}', + exceptionFnMap: _exceptionFns, + ); + final $json = await _s.jsonFromResponse(response); + return GetCodegenJobResponse( + job: CodegenJob.fromJson($json), + ); + } + /// Returns an existing component for an Amplify app. /// /// May throw [InternalServerException]. @@ -513,6 +550,51 @@ class AmplifyUIBuilder { ); } + /// Retrieves a list of code generation jobs for a specified Amplify app and + /// backend environment. + /// + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [appId] : + /// The unique ID for the Amplify app. + /// + /// Parameter [environmentName] : + /// The name of the backend environment that is a part of the Amplify app. + /// + /// Parameter [maxResults] : + /// The maximum number of jobs to retrieve. + /// + /// Parameter [nextToken] : + /// The token to request the next page of results. + Future listCodegenJobs({ + required String appId, + required String environmentName, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/app/${Uri.encodeComponent(appId)}/environment/${Uri.encodeComponent(environmentName)}/codegen-jobs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListCodegenJobsResponse.fromJson(response); + } + /// Retrieves a list of components for a specified Amplify app and backend /// environment. /// @@ -601,6 +683,28 @@ class AmplifyUIBuilder { return ListFormsResponse.fromJson(response); } + /// Returns a list of tags for a specified Amazon Resource Name (ARN). + /// + /// May throw [UnauthorizedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) to use to list tags. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + /// Retrieves a list of themes for a specified Amplify app and backend /// environment. /// @@ -676,7 +780,11 @@ class AmplifyUIBuilder { ); } - /// Refreshes a previously issued access token that might have expired. + /// + /// This is for internal use. + /// + /// Amplify uses this action to refresh a previously issued access token that + /// might have expired. /// /// May throw [InvalidParameterException]. /// @@ -699,6 +807,105 @@ class AmplifyUIBuilder { return RefreshTokenResponse.fromJson(response); } + /// Starts a code generation job for a specified Amplify app and backend + /// environment. + /// + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [appId] : + /// The unique ID for the Amplify app. + /// + /// Parameter [codegenJobToCreate] : + /// The code generation job resource configuration. + /// + /// Parameter [environmentName] : + /// The name of the backend environment that is a part of the Amplify app. + /// + /// Parameter [clientToken] : + /// The idempotency token used to ensure that the code generation job request + /// completes only once. + Future startCodegenJob({ + required String appId, + required StartCodegenJobData codegenJobToCreate, + required String environmentName, + String? clientToken, + }) async { + final $query = >{ + if (clientToken != null) 'clientToken': [clientToken], + }; + final response = await _protocol.sendRaw( + payload: codegenJobToCreate, + method: 'POST', + requestUri: + '/app/${Uri.encodeComponent(appId)}/environment/${Uri.encodeComponent(environmentName)}/codegen-jobs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + final $json = await _s.jsonFromResponse(response); + return StartCodegenJobResponse( + entity: CodegenJob.fromJson($json), + ); + } + + /// Tags the resource with a tag key and value. + /// + /// May throw [UnauthorizedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) to use to tag a resource. + /// + /// Parameter [tags] : + /// A list of tag key value pairs for a specified Amazon Resource Name (ARN). + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Untags a resource with a specified Amazon Resource Name (ARN). + /// + /// May throw [UnauthorizedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) to use to untag a resource. + /// + /// Parameter [tagKeys] : + /// The tag keys to use to untag a resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + /// Updates an existing component. /// /// May throw [ResourceConflictException]. @@ -885,56 +1092,863 @@ class ActionParameters { this.url, }); - factory ActionParameters.fromJson(Map json) { - return ActionParameters( - anchor: json['anchor'] != null - ? ComponentProperty.fromJson(json['anchor'] as Map) - : null, - fields: (json['fields'] as Map?)?.map((k, e) => - MapEntry(k, ComponentProperty.fromJson(e as Map))), - global: json['global'] != null - ? ComponentProperty.fromJson(json['global'] as Map) - : null, - id: json['id'] != null - ? ComponentProperty.fromJson(json['id'] as Map) - : null, - model: json['model'] as String?, - state: json['state'] != null - ? MutationActionSetStateParameter.fromJson( - json['state'] as Map) - : null, - target: json['target'] != null - ? ComponentProperty.fromJson(json['target'] as Map) - : null, - type: json['type'] != null - ? ComponentProperty.fromJson(json['type'] as Map) - : null, - url: json['url'] != null - ? ComponentProperty.fromJson(json['url'] as Map) - : null, + factory ActionParameters.fromJson(Map json) { + return ActionParameters( + anchor: json['anchor'] != null + ? ComponentProperty.fromJson(json['anchor'] as Map) + : null, + fields: (json['fields'] as Map?)?.map((k, e) => + MapEntry(k, ComponentProperty.fromJson(e as Map))), + global: json['global'] != null + ? ComponentProperty.fromJson(json['global'] as Map) + : null, + id: json['id'] != null + ? ComponentProperty.fromJson(json['id'] as Map) + : null, + model: json['model'] as String?, + state: json['state'] != null + ? MutationActionSetStateParameter.fromJson( + json['state'] as Map) + : null, + target: json['target'] != null + ? ComponentProperty.fromJson(json['target'] as Map) + : null, + type: json['type'] != null + ? ComponentProperty.fromJson(json['type'] as Map) + : null, + url: json['url'] != null + ? ComponentProperty.fromJson(json['url'] as Map) + : null, + ); + } + + Map toJson() { + final anchor = this.anchor; + final fields = this.fields; + final global = this.global; + final id = this.id; + final model = this.model; + final state = this.state; + final target = this.target; + final type = this.type; + final url = this.url; + return { + if (anchor != null) 'anchor': anchor, + if (fields != null) 'fields': fields, + if (global != null) 'global': global, + if (id != null) 'id': id, + if (model != null) 'model': model, + if (state != null) 'state': state, + if (target != null) 'target': target, + if (type != null) 'type': type, + if (url != null) 'url': url, + }; + } +} + +/// Describes the API configuration for a code generation job. +class ApiConfiguration { + /// The configuration for an application using DataStore APIs. + final DataStoreRenderConfig? dataStoreConfig; + + /// The configuration for an application using GraphQL APIs. + final GraphQLRenderConfig? graphQLConfig; + + /// The configuration for an application with no API being used. + final NoApiRenderConfig? noApiConfig; + + ApiConfiguration({ + this.dataStoreConfig, + this.graphQLConfig, + this.noApiConfig, + }); + + factory ApiConfiguration.fromJson(Map json) { + return ApiConfiguration( + dataStoreConfig: json['dataStoreConfig'] != null + ? DataStoreRenderConfig.fromJson( + json['dataStoreConfig'] as Map) + : null, + graphQLConfig: json['graphQLConfig'] != null + ? GraphQLRenderConfig.fromJson( + json['graphQLConfig'] as Map) + : null, + noApiConfig: json['noApiConfig'] != null + ? NoApiRenderConfig.fromJson( + json['noApiConfig'] as Map) + : null, + ); + } + + Map toJson() { + final dataStoreConfig = this.dataStoreConfig; + final graphQLConfig = this.graphQLConfig; + final noApiConfig = this.noApiConfig; + return { + if (dataStoreConfig != null) 'dataStoreConfig': dataStoreConfig, + if (graphQLConfig != null) 'graphQLConfig': graphQLConfig, + if (noApiConfig != null) 'noApiConfig': noApiConfig, + }; + } +} + +/// Dependency package that may be required for the project code to run. +class CodegenDependency { + /// Determines if the dependency package is using Semantic versioning. If set to + /// true, it indicates that the dependency package uses Semantic versioning. + final bool? isSemVer; + + /// Name of the dependency package. + final String? name; + + /// Indicates the reason to include the dependency package in your project code. + final String? reason; + + /// Indicates the version of the supported dependency package. + final String? supportedVersion; + + CodegenDependency({ + this.isSemVer, + this.name, + this.reason, + this.supportedVersion, + }); + + factory CodegenDependency.fromJson(Map json) { + return CodegenDependency( + isSemVer: json['isSemVer'] as bool?, + name: json['name'] as String?, + reason: json['reason'] as String?, + supportedVersion: json['supportedVersion'] as String?, + ); + } + + Map toJson() { + final isSemVer = this.isSemVer; + final name = this.name; + final reason = this.reason; + final supportedVersion = this.supportedVersion; + return { + if (isSemVer != null) 'isSemVer': isSemVer, + if (name != null) 'name': name, + if (reason != null) 'reason': reason, + if (supportedVersion != null) 'supportedVersion': supportedVersion, + }; + } +} + +/// Describes the feature flags that you can specify for a code generation job. +class CodegenFeatureFlags { + /// Specifies whether a code generation job supports non models. + final bool? isNonModelSupported; + + /// Specifes whether a code generation job supports data relationships. + final bool? isRelationshipSupported; + + CodegenFeatureFlags({ + this.isNonModelSupported, + this.isRelationshipSupported, + }); + + factory CodegenFeatureFlags.fromJson(Map json) { + return CodegenFeatureFlags( + isNonModelSupported: json['isNonModelSupported'] as bool?, + isRelationshipSupported: json['isRelationshipSupported'] as bool?, + ); + } + + Map toJson() { + final isNonModelSupported = this.isNonModelSupported; + final isRelationshipSupported = this.isRelationshipSupported; + return { + if (isNonModelSupported != null) + 'isNonModelSupported': isNonModelSupported, + if (isRelationshipSupported != null) + 'isRelationshipSupported': isRelationshipSupported, + }; + } +} + +/// Describes the enums in a generic data schema. +class CodegenGenericDataEnum { + /// The list of enum values in the generic data schema. + final List values; + + CodegenGenericDataEnum({ + required this.values, + }); + + factory CodegenGenericDataEnum.fromJson(Map json) { + return CodegenGenericDataEnum( + values: (json['values'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final values = this.values; + return { + 'values': values, + }; + } +} + +/// Describes a field in a generic data schema. +class CodegenGenericDataField { + /// The data type for the generic data field. + final CodegenGenericDataFieldDataType dataType; + + /// The value of the data type for the generic data field. + final String dataTypeValue; + + /// Specifies whether the generic data field is an array. + final bool isArray; + + /// Specifies whether the generic data field is read-only. + final bool readOnly; + + /// Specifies whether the generic data field is required. + final bool required; + + /// The relationship of the generic data schema. + final CodegenGenericDataRelationshipType? relationship; + + CodegenGenericDataField({ + required this.dataType, + required this.dataTypeValue, + required this.isArray, + required this.readOnly, + required this.required, + this.relationship, + }); + + factory CodegenGenericDataField.fromJson(Map json) { + return CodegenGenericDataField( + dataType: + (json['dataType'] as String).toCodegenGenericDataFieldDataType(), + dataTypeValue: json['dataTypeValue'] as String, + isArray: json['isArray'] as bool, + readOnly: json['readOnly'] as bool, + required: json['required'] as bool, + relationship: json['relationship'] != null + ? CodegenGenericDataRelationshipType.fromJson( + json['relationship'] as Map) + : null, + ); + } + + Map toJson() { + final dataType = this.dataType; + final dataTypeValue = this.dataTypeValue; + final isArray = this.isArray; + final readOnly = this.readOnly; + final required = this.required; + final relationship = this.relationship; + return { + 'dataType': dataType.toValue(), + 'dataTypeValue': dataTypeValue, + 'isArray': isArray, + 'readOnly': readOnly, + 'required': required, + if (relationship != null) 'relationship': relationship, + }; + } +} + +enum CodegenGenericDataFieldDataType { + id, + string, + int, + float, + awsDate, + awsTime, + awsDateTime, + awsTimestamp, + awsEmail, + awsurl, + awsIPAddress, + boolean, + awsjson, + awsPhone, + $enum, + model, + nonModel, +} + +extension CodegenGenericDataFieldDataTypeValueExtension + on CodegenGenericDataFieldDataType { + String toValue() { + switch (this) { + case CodegenGenericDataFieldDataType.id: + return 'ID'; + case CodegenGenericDataFieldDataType.string: + return 'String'; + case CodegenGenericDataFieldDataType.int: + return 'Int'; + case CodegenGenericDataFieldDataType.float: + return 'Float'; + case CodegenGenericDataFieldDataType.awsDate: + return 'AWSDate'; + case CodegenGenericDataFieldDataType.awsTime: + return 'AWSTime'; + case CodegenGenericDataFieldDataType.awsDateTime: + return 'AWSDateTime'; + case CodegenGenericDataFieldDataType.awsTimestamp: + return 'AWSTimestamp'; + case CodegenGenericDataFieldDataType.awsEmail: + return 'AWSEmail'; + case CodegenGenericDataFieldDataType.awsurl: + return 'AWSURL'; + case CodegenGenericDataFieldDataType.awsIPAddress: + return 'AWSIPAddress'; + case CodegenGenericDataFieldDataType.boolean: + return 'Boolean'; + case CodegenGenericDataFieldDataType.awsjson: + return 'AWSJSON'; + case CodegenGenericDataFieldDataType.awsPhone: + return 'AWSPhone'; + case CodegenGenericDataFieldDataType.$enum: + return 'Enum'; + case CodegenGenericDataFieldDataType.model: + return 'Model'; + case CodegenGenericDataFieldDataType.nonModel: + return 'NonModel'; + } + } +} + +extension CodegenGenericDataFieldDataTypeFromString on String { + CodegenGenericDataFieldDataType toCodegenGenericDataFieldDataType() { + switch (this) { + case 'ID': + return CodegenGenericDataFieldDataType.id; + case 'String': + return CodegenGenericDataFieldDataType.string; + case 'Int': + return CodegenGenericDataFieldDataType.int; + case 'Float': + return CodegenGenericDataFieldDataType.float; + case 'AWSDate': + return CodegenGenericDataFieldDataType.awsDate; + case 'AWSTime': + return CodegenGenericDataFieldDataType.awsTime; + case 'AWSDateTime': + return CodegenGenericDataFieldDataType.awsDateTime; + case 'AWSTimestamp': + return CodegenGenericDataFieldDataType.awsTimestamp; + case 'AWSEmail': + return CodegenGenericDataFieldDataType.awsEmail; + case 'AWSURL': + return CodegenGenericDataFieldDataType.awsurl; + case 'AWSIPAddress': + return CodegenGenericDataFieldDataType.awsIPAddress; + case 'Boolean': + return CodegenGenericDataFieldDataType.boolean; + case 'AWSJSON': + return CodegenGenericDataFieldDataType.awsjson; + case 'AWSPhone': + return CodegenGenericDataFieldDataType.awsPhone; + case 'Enum': + return CodegenGenericDataFieldDataType.$enum; + case 'Model': + return CodegenGenericDataFieldDataType.model; + case 'NonModel': + return CodegenGenericDataFieldDataType.nonModel; + } + throw Exception( + '$this is not known in enum CodegenGenericDataFieldDataType'); + } +} + +/// Describes a model in a generic data schema. +class CodegenGenericDataModel { + /// The fields in the generic data model. + final Map fields; + + /// The primary keys of the generic data model. + final List primaryKeys; + + /// Specifies whether the generic data model is a join table. + final bool? isJoinTable; + + CodegenGenericDataModel({ + required this.fields, + required this.primaryKeys, + this.isJoinTable, + }); + + factory CodegenGenericDataModel.fromJson(Map json) { + return CodegenGenericDataModel( + fields: (json['fields'] as Map).map((k, e) => MapEntry( + k, CodegenGenericDataField.fromJson(e as Map))), + primaryKeys: (json['primaryKeys'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + isJoinTable: json['isJoinTable'] as bool?, + ); + } + + Map toJson() { + final fields = this.fields; + final primaryKeys = this.primaryKeys; + final isJoinTable = this.isJoinTable; + return { + 'fields': fields, + 'primaryKeys': primaryKeys, + if (isJoinTable != null) 'isJoinTable': isJoinTable, + }; + } +} + +/// Describes a non-model in a generic data schema. +class CodegenGenericDataNonModel { + /// The fields in a generic data schema non model. + final Map fields; + + CodegenGenericDataNonModel({ + required this.fields, + }); + + factory CodegenGenericDataNonModel.fromJson(Map json) { + return CodegenGenericDataNonModel( + fields: (json['fields'] as Map).map((k, e) => MapEntry( + k, CodegenGenericDataField.fromJson(e as Map))), + ); + } + + Map toJson() { + final fields = this.fields; + return { + 'fields': fields, + }; + } +} + +/// Describes the relationship between generic data models. +class CodegenGenericDataRelationshipType { + /// The name of the related model in the data relationship. + final String relatedModelName; + + /// The data relationship type. + final GenericDataRelationshipType type; + + /// The associated fields of the data relationship. + final List? associatedFields; + + /// The value of the belongsTo field on the related data model. + final String? belongsToFieldOnRelatedModel; + + /// Specifies whether the relationship can unlink the associated model. + final bool? canUnlinkAssociatedModel; + + /// Specifies whether the @index directive is supported for a + /// hasMany data relationship. + final bool? isHasManyIndex; + + /// The name of the related join field in the data relationship. + final String? relatedJoinFieldName; + + /// The name of the related join table in the data relationship. + final String? relatedJoinTableName; + + /// The related model fields in the data relationship. + final List? relatedModelFields; + + CodegenGenericDataRelationshipType({ + required this.relatedModelName, + required this.type, + this.associatedFields, + this.belongsToFieldOnRelatedModel, + this.canUnlinkAssociatedModel, + this.isHasManyIndex, + this.relatedJoinFieldName, + this.relatedJoinTableName, + this.relatedModelFields, + }); + + factory CodegenGenericDataRelationshipType.fromJson( + Map json) { + return CodegenGenericDataRelationshipType( + relatedModelName: json['relatedModelName'] as String, + type: (json['type'] as String).toGenericDataRelationshipType(), + associatedFields: (json['associatedFields'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + belongsToFieldOnRelatedModel: + json['belongsToFieldOnRelatedModel'] as String?, + canUnlinkAssociatedModel: json['canUnlinkAssociatedModel'] as bool?, + isHasManyIndex: json['isHasManyIndex'] as bool?, + relatedJoinFieldName: json['relatedJoinFieldName'] as String?, + relatedJoinTableName: json['relatedJoinTableName'] as String?, + relatedModelFields: (json['relatedModelFields'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final relatedModelName = this.relatedModelName; + final type = this.type; + final associatedFields = this.associatedFields; + final belongsToFieldOnRelatedModel = this.belongsToFieldOnRelatedModel; + final canUnlinkAssociatedModel = this.canUnlinkAssociatedModel; + final isHasManyIndex = this.isHasManyIndex; + final relatedJoinFieldName = this.relatedJoinFieldName; + final relatedJoinTableName = this.relatedJoinTableName; + final relatedModelFields = this.relatedModelFields; + return { + 'relatedModelName': relatedModelName, + 'type': type.toValue(), + if (associatedFields != null) 'associatedFields': associatedFields, + if (belongsToFieldOnRelatedModel != null) + 'belongsToFieldOnRelatedModel': belongsToFieldOnRelatedModel, + if (canUnlinkAssociatedModel != null) + 'canUnlinkAssociatedModel': canUnlinkAssociatedModel, + if (isHasManyIndex != null) 'isHasManyIndex': isHasManyIndex, + if (relatedJoinFieldName != null) + 'relatedJoinFieldName': relatedJoinFieldName, + if (relatedJoinTableName != null) + 'relatedJoinTableName': relatedJoinTableName, + if (relatedModelFields != null) 'relatedModelFields': relatedModelFields, + }; + } +} + +/// Describes the configuration for a code generation job that is associated +/// with an Amplify app. +class CodegenJob { + /// The ID of the Amplify app associated with the code generation job. + final String appId; + + /// The name of the backend environment associated with the code generation job. + final String environmentName; + + /// The unique ID for the code generation job. + final String id; + + /// The CodegenJobAsset to use for the code generation job. + final CodegenJobAsset? asset; + + /// Specifies whether to autogenerate forms in the code generation job. + final bool? autoGenerateForms; + + /// The time that the code generation job was created. + final DateTime? createdAt; + + /// Lists the dependency packages that may be required for the project code to + /// run. + final List? dependencies; + final CodegenFeatureFlags? features; + final CodegenJobGenericDataSchema? genericDataSchema; + + /// The time that the code generation job was modified. + final DateTime? modifiedAt; + final CodegenJobRenderConfig? renderConfig; + + /// The status of the code generation job. + final CodegenJobStatus? status; + + /// The customized status message for the code generation job. + final String? statusMessage; + + /// One or more key-value pairs to use when tagging the code generation job. + final Map? tags; + + CodegenJob({ + required this.appId, + required this.environmentName, + required this.id, + this.asset, + this.autoGenerateForms, + this.createdAt, + this.dependencies, + this.features, + this.genericDataSchema, + this.modifiedAt, + this.renderConfig, + this.status, + this.statusMessage, + this.tags, + }); + + factory CodegenJob.fromJson(Map json) { + return CodegenJob( + appId: json['appId'] as String, + environmentName: json['environmentName'] as String, + id: json['id'] as String, + asset: json['asset'] != null + ? CodegenJobAsset.fromJson(json['asset'] as Map) + : null, + autoGenerateForms: json['autoGenerateForms'] as bool?, + createdAt: timeStampFromJson(json['createdAt']), + dependencies: (json['dependencies'] as List?) + ?.whereNotNull() + .map((e) => CodegenDependency.fromJson(e as Map)) + .toList(), + features: json['features'] != null + ? CodegenFeatureFlags.fromJson( + json['features'] as Map) + : null, + genericDataSchema: json['genericDataSchema'] != null + ? CodegenJobGenericDataSchema.fromJson( + json['genericDataSchema'] as Map) + : null, + modifiedAt: timeStampFromJson(json['modifiedAt']), + renderConfig: json['renderConfig'] != null + ? CodegenJobRenderConfig.fromJson( + json['renderConfig'] as Map) + : null, + status: (json['status'] as String?)?.toCodegenJobStatus(), + statusMessage: json['statusMessage'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final appId = this.appId; + final environmentName = this.environmentName; + final id = this.id; + final asset = this.asset; + final autoGenerateForms = this.autoGenerateForms; + final createdAt = this.createdAt; + final dependencies = this.dependencies; + final features = this.features; + final genericDataSchema = this.genericDataSchema; + final modifiedAt = this.modifiedAt; + final renderConfig = this.renderConfig; + final status = this.status; + final statusMessage = this.statusMessage; + final tags = this.tags; + return { + 'appId': appId, + 'environmentName': environmentName, + 'id': id, + if (asset != null) 'asset': asset, + if (autoGenerateForms != null) 'autoGenerateForms': autoGenerateForms, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (dependencies != null) 'dependencies': dependencies, + if (features != null) 'features': features, + if (genericDataSchema != null) 'genericDataSchema': genericDataSchema, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (renderConfig != null) 'renderConfig': renderConfig, + if (status != null) 'status': status.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (tags != null) 'tags': tags, + }; + } +} + +/// Describes an asset for a code generation job. +class CodegenJobAsset { + /// The URL to use to access the asset. + final String? downloadUrl; + + CodegenJobAsset({ + this.downloadUrl, + }); + + factory CodegenJobAsset.fromJson(Map json) { + return CodegenJobAsset( + downloadUrl: json['downloadUrl'] as String?, + ); + } + + Map toJson() { + final downloadUrl = this.downloadUrl; + return { + if (downloadUrl != null) 'downloadUrl': downloadUrl, + }; + } +} + +/// Describes the data schema for a code generation job. +class CodegenJobGenericDataSchema { + /// The type of the data source for the schema. Currently, the only valid value + /// is an Amplify DataStore. + final CodegenJobGenericDataSourceType dataSourceType; + + /// The name of a CodegenGenericDataEnum. + final Map enums; + + /// The name of a CodegenGenericDataModel. + final Map models; + + /// The name of a CodegenGenericDataNonModel. + final Map nonModels; + + CodegenJobGenericDataSchema({ + required this.dataSourceType, + required this.enums, + required this.models, + required this.nonModels, + }); + + factory CodegenJobGenericDataSchema.fromJson(Map json) { + return CodegenJobGenericDataSchema( + dataSourceType: (json['dataSourceType'] as String) + .toCodegenJobGenericDataSourceType(), + enums: (json['enums'] as Map).map((k, e) => MapEntry( + k, CodegenGenericDataEnum.fromJson(e as Map))), + models: (json['models'] as Map).map((k, e) => MapEntry( + k, CodegenGenericDataModel.fromJson(e as Map))), + nonModels: (json['nonModels'] as Map).map((k, e) => + MapEntry(k, + CodegenGenericDataNonModel.fromJson(e as Map))), + ); + } + + Map toJson() { + final dataSourceType = this.dataSourceType; + final enums = this.enums; + final models = this.models; + final nonModels = this.nonModels; + return { + 'dataSourceType': dataSourceType.toValue(), + 'enums': enums, + 'models': models, + 'nonModels': nonModels, + }; + } +} + +enum CodegenJobGenericDataSourceType { + dataStore, +} + +extension CodegenJobGenericDataSourceTypeValueExtension + on CodegenJobGenericDataSourceType { + String toValue() { + switch (this) { + case CodegenJobGenericDataSourceType.dataStore: + return 'DataStore'; + } + } +} + +extension CodegenJobGenericDataSourceTypeFromString on String { + CodegenJobGenericDataSourceType toCodegenJobGenericDataSourceType() { + switch (this) { + case 'DataStore': + return CodegenJobGenericDataSourceType.dataStore; + } + throw Exception( + '$this is not known in enum CodegenJobGenericDataSourceType'); + } +} + +/// Describes the configuration information for rendering the UI component +/// associated with the code generation job. +class CodegenJobRenderConfig { + /// The name of the ReactStartCodegenJobData object. + final ReactStartCodegenJobData? react; + + CodegenJobRenderConfig({ + this.react, + }); + + factory CodegenJobRenderConfig.fromJson(Map json) { + return CodegenJobRenderConfig( + react: json['react'] != null + ? ReactStartCodegenJobData.fromJson( + json['react'] as Map) + : null, + ); + } + + Map toJson() { + final react = this.react; + return { + if (react != null) 'react': react, + }; + } +} + +enum CodegenJobStatus { + inProgress, + failed, + succeeded, +} + +extension CodegenJobStatusValueExtension on CodegenJobStatus { + String toValue() { + switch (this) { + case CodegenJobStatus.inProgress: + return 'in_progress'; + case CodegenJobStatus.failed: + return 'failed'; + case CodegenJobStatus.succeeded: + return 'succeeded'; + } + } +} + +extension CodegenJobStatusFromString on String { + CodegenJobStatus toCodegenJobStatus() { + switch (this) { + case 'in_progress': + return CodegenJobStatus.inProgress; + case 'failed': + return CodegenJobStatus.failed; + case 'succeeded': + return CodegenJobStatus.succeeded; + } + throw Exception('$this is not known in enum CodegenJobStatus'); + } +} + +/// A summary of the basic information about the code generation job. +class CodegenJobSummary { + /// The unique ID of the Amplify app associated with the code generation job. + final String appId; + + /// The name of the backend environment associated with the code generation job. + final String environmentName; + + /// The unique ID for the code generation job summary. + final String id; + + /// The time that the code generation job summary was created. + final DateTime? createdAt; + + /// The time that the code generation job summary was modified. + final DateTime? modifiedAt; + + CodegenJobSummary({ + required this.appId, + required this.environmentName, + required this.id, + this.createdAt, + this.modifiedAt, + }); + + factory CodegenJobSummary.fromJson(Map json) { + return CodegenJobSummary( + appId: json['appId'] as String, + environmentName: json['environmentName'] as String, + id: json['id'] as String, + createdAt: timeStampFromJson(json['createdAt']), + modifiedAt: timeStampFromJson(json['modifiedAt']), ); } Map toJson() { - final anchor = this.anchor; - final fields = this.fields; - final global = this.global; + final appId = this.appId; + final environmentName = this.environmentName; final id = this.id; - final model = this.model; - final state = this.state; - final target = this.target; - final type = this.type; - final url = this.url; + final createdAt = this.createdAt; + final modifiedAt = this.modifiedAt; return { - if (anchor != null) 'anchor': anchor, - if (fields != null) 'fields': fields, - if (global != null) 'global': global, - if (id != null) 'id': id, - if (model != null) 'model': model, - if (state != null) 'state': state, - if (target != null) 'target': target, - if (type != null) 'type': type, - if (url != null) 'url': url, + 'appId': appId, + 'environmentName': environmentName, + 'id': id, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), }; } } @@ -1980,6 +2994,19 @@ class CreateThemeResponse { } } +/// Describes the DataStore configuration for an API for a code generation job. +class DataStoreRenderConfig { + DataStoreRenderConfig(); + + factory DataStoreRenderConfig.fromJson(Map _) { + return DataStoreRenderConfig(); + } + + Map toJson() { + return {}; + } +} + /// Describes the configuration of a request to exchange an access code for a /// token. class ExchangeCodeForTokenRequestBody { @@ -3166,6 +4193,56 @@ class FormSummary { } } +enum GenericDataRelationshipType { + hasMany, + hasOne, + belongsTo, +} + +extension GenericDataRelationshipTypeValueExtension + on GenericDataRelationshipType { + String toValue() { + switch (this) { + case GenericDataRelationshipType.hasMany: + return 'HAS_MANY'; + case GenericDataRelationshipType.hasOne: + return 'HAS_ONE'; + case GenericDataRelationshipType.belongsTo: + return 'BELONGS_TO'; + } + } +} + +extension GenericDataRelationshipTypeFromString on String { + GenericDataRelationshipType toGenericDataRelationshipType() { + switch (this) { + case 'HAS_MANY': + return GenericDataRelationshipType.hasMany; + case 'HAS_ONE': + return GenericDataRelationshipType.hasOne; + case 'BELONGS_TO': + return GenericDataRelationshipType.belongsTo; + } + throw Exception('$this is not known in enum GenericDataRelationshipType'); + } +} + +class GetCodegenJobResponse { + /// The configuration settings for the code generation job. + final CodegenJob? job; + + GetCodegenJobResponse({ + this.job, + }); + + Map toJson() { + final job = this.job; + return { + if (job != null) 'job': job, + }; + } +} + class GetComponentResponse { /// Represents the configuration settings for the component. final Component? component; @@ -3237,6 +4314,151 @@ class GetThemeResponse { } } +/// Describes the GraphQL configuration for an API for a code generation job. +class GraphQLRenderConfig { + /// The path to the GraphQL fragments file, relative to the component output + /// directory. + final String fragmentsFilePath; + + /// The path to the GraphQL mutations file, relative to the component output + /// directory. + final String mutationsFilePath; + + /// The path to the GraphQL queries file, relative to the component output + /// directory. + final String queriesFilePath; + + /// The path to the GraphQL subscriptions file, relative to the component output + /// directory. + final String subscriptionsFilePath; + + /// The path to the GraphQL types file, relative to the component output + /// directory. + final String typesFilePath; + + GraphQLRenderConfig({ + required this.fragmentsFilePath, + required this.mutationsFilePath, + required this.queriesFilePath, + required this.subscriptionsFilePath, + required this.typesFilePath, + }); + + factory GraphQLRenderConfig.fromJson(Map json) { + return GraphQLRenderConfig( + fragmentsFilePath: json['fragmentsFilePath'] as String, + mutationsFilePath: json['mutationsFilePath'] as String, + queriesFilePath: json['queriesFilePath'] as String, + subscriptionsFilePath: json['subscriptionsFilePath'] as String, + typesFilePath: json['typesFilePath'] as String, + ); + } + + Map toJson() { + final fragmentsFilePath = this.fragmentsFilePath; + final mutationsFilePath = this.mutationsFilePath; + final queriesFilePath = this.queriesFilePath; + final subscriptionsFilePath = this.subscriptionsFilePath; + final typesFilePath = this.typesFilePath; + return { + 'fragmentsFilePath': fragmentsFilePath, + 'mutationsFilePath': mutationsFilePath, + 'queriesFilePath': queriesFilePath, + 'subscriptionsFilePath': subscriptionsFilePath, + 'typesFilePath': typesFilePath, + }; + } +} + +enum JSModule { + es2020, + esnext, +} + +extension JSModuleValueExtension on JSModule { + String toValue() { + switch (this) { + case JSModule.es2020: + return 'es2020'; + case JSModule.esnext: + return 'esnext'; + } + } +} + +extension JSModuleFromString on String { + JSModule toJSModule() { + switch (this) { + case 'es2020': + return JSModule.es2020; + case 'esnext': + return JSModule.esnext; + } + throw Exception('$this is not known in enum JSModule'); + } +} + +enum JSScript { + jsx, + tsx, + js, +} + +extension JSScriptValueExtension on JSScript { + String toValue() { + switch (this) { + case JSScript.jsx: + return 'jsx'; + case JSScript.tsx: + return 'tsx'; + case JSScript.js: + return 'js'; + } + } +} + +extension JSScriptFromString on String { + JSScript toJSScript() { + switch (this) { + case 'jsx': + return JSScript.jsx; + case 'tsx': + return JSScript.tsx; + case 'js': + return JSScript.js; + } + throw Exception('$this is not known in enum JSScript'); + } +} + +enum JSTarget { + es2015, + es2020, +} + +extension JSTargetValueExtension on JSTarget { + String toValue() { + switch (this) { + case JSTarget.es2015: + return 'es2015'; + case JSTarget.es2020: + return 'es2020'; + } + } +} + +extension JSTargetFromString on String { + JSTarget toJSTarget() { + switch (this) { + case 'es2015': + return JSTarget.es2015; + case 'es2020': + return JSTarget.es2020; + } + throw Exception('$this is not known in enum JSTarget'); + } +} + enum LabelDecorator { required, optional, @@ -3270,6 +4492,38 @@ extension LabelDecoratorFromString on String { } } +class ListCodegenJobsResponse { + /// The list of code generation jobs for the Amplify app. + final List entities; + + /// The pagination token that's included if more results are available. + final String? nextToken; + + ListCodegenJobsResponse({ + required this.entities, + this.nextToken, + }); + + factory ListCodegenJobsResponse.fromJson(Map json) { + return ListCodegenJobsResponse( + entities: (json['entities'] as List) + .whereNotNull() + .map((e) => CodegenJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final entities = this.entities; + final nextToken = this.nextToken; + return { + 'entities': entities, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListComponentsResponse { /// The list of components for the Amplify app. final List entities; @@ -3334,6 +4588,29 @@ class ListFormsResponse { } } +class ListTagsForResourceResponse { + /// A list of tag key value pairs for a specified Amazon Resource Name (ARN). + final Map tags; + + ListTagsForResourceResponse({ + required this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map) + .map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + 'tags': tags, + }; + } +} + class ListThemesResponse { /// The list of themes for the Amplify app. final List entities; @@ -3404,6 +4681,19 @@ class MutationActionSetStateParameter { } } +/// Describes the configuration for an application with no API being used. +class NoApiRenderConfig { + NoApiRenderConfig(); + + factory NoApiRenderConfig.fromJson(Map _) { + return NoApiRenderConfig(); + } + + Map toJson() { + return {}; + } +} + /// Stores information for generating Amplify DataStore queries. Use a /// Predicate to retrieve a subset of the data in a collection. class Predicate { @@ -3486,6 +4776,78 @@ class PutMetadataFlagBody { } } +/// Describes the code generation job configuration for a React project. +class ReactStartCodegenJobData { + /// The API configuration for the code generation job. + final ApiConfiguration? apiConfiguration; + + /// Lists the dependency packages that may be required for the project code to + /// run. + final Map? dependencies; + + /// Specifies whether the code generation job should render inline source maps. + final bool? inlineSourceMap; + + /// The JavaScript module type. + final JSModule? module; + + /// Specifies whether the code generation job should render type declaration + /// files. + final bool? renderTypeDeclarations; + + /// The file type to use for a JavaScript project. + final JSScript? script; + + /// The ECMAScript specification to use. + final JSTarget? target; + + ReactStartCodegenJobData({ + this.apiConfiguration, + this.dependencies, + this.inlineSourceMap, + this.module, + this.renderTypeDeclarations, + this.script, + this.target, + }); + + factory ReactStartCodegenJobData.fromJson(Map json) { + return ReactStartCodegenJobData( + apiConfiguration: json['apiConfiguration'] != null + ? ApiConfiguration.fromJson( + json['apiConfiguration'] as Map) + : null, + dependencies: (json['dependencies'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + inlineSourceMap: json['inlineSourceMap'] as bool?, + module: (json['module'] as String?)?.toJSModule(), + renderTypeDeclarations: json['renderTypeDeclarations'] as bool?, + script: (json['script'] as String?)?.toJSScript(), + target: (json['target'] as String?)?.toJSTarget(), + ); + } + + Map toJson() { + final apiConfiguration = this.apiConfiguration; + final dependencies = this.dependencies; + final inlineSourceMap = this.inlineSourceMap; + final module = this.module; + final renderTypeDeclarations = this.renderTypeDeclarations; + final script = this.script; + final target = this.target; + return { + if (apiConfiguration != null) 'apiConfiguration': apiConfiguration, + if (dependencies != null) 'dependencies': dependencies, + if (inlineSourceMap != null) 'inlineSourceMap': inlineSourceMap, + if (module != null) 'module': module.toValue(), + if (renderTypeDeclarations != null) + 'renderTypeDeclarations': renderTypeDeclarations, + if (script != null) 'script': script.toValue(), + if (target != null) 'target': target.toValue(), + }; + } +} + /// Describes a refresh token. class RefreshTokenRequestBody { /// The token to use to refresh a previously issued access token that might have @@ -3664,6 +5026,65 @@ class SortProperty { } } +/// The code generation job resource configuration. +class StartCodegenJobData { + /// The code generation configuration for the codegen job. + final CodegenJobRenderConfig renderConfig; + + /// Specifies whether to autogenerate forms in the code generation job. + final bool? autoGenerateForms; + + /// The feature flags for a code generation job. + final CodegenFeatureFlags? features; + + /// The data schema to use for a code generation job. + final CodegenJobGenericDataSchema? genericDataSchema; + + /// One or more key-value pairs to use when tagging the code generation job + /// data. + final Map? tags; + + StartCodegenJobData({ + required this.renderConfig, + this.autoGenerateForms, + this.features, + this.genericDataSchema, + this.tags, + }); + + Map toJson() { + final renderConfig = this.renderConfig; + final autoGenerateForms = this.autoGenerateForms; + final features = this.features; + final genericDataSchema = this.genericDataSchema; + final tags = this.tags; + return { + 'renderConfig': renderConfig, + if (autoGenerateForms != null) 'autoGenerateForms': autoGenerateForms, + if (features != null) 'features': features, + if (genericDataSchema != null) 'genericDataSchema': genericDataSchema, + if (tags != null) 'tags': tags, + }; + } +} + +class StartCodegenJobResponse { + /// The code generation job for a UI component that is associated with an + /// Amplify app. + final CodegenJob? entity; + + StartCodegenJobResponse({ + this.entity, + }); + + Map toJson() { + final entity = this.entity; + return { + if (entity != null) 'entity': entity, + }; + } +} + enum StorageAccessLevel { public, protected, @@ -3697,6 +5118,18 @@ extension StorageAccessLevelFromString on String { } } +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + /// A theme is a collection of style settings that apply globally to the /// components associated with an Amplify application. class Theme { @@ -3916,6 +5349,18 @@ extension TokenProvidersFromString on String { } } +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + /// Updates and saves all of the information about a component, based on /// component ID. class UpdateComponentData { @@ -4255,6 +5700,11 @@ class ServiceQuotaExceededException extends _s.GenericAwsException { message: message); } +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + class UnauthorizedException extends _s.GenericAwsException { UnauthorizedException({String? type, String? message}) : super(type: type, code: 'UnauthorizedException', message: message); @@ -4271,6 +5721,8 @@ final _exceptionFns = { ResourceNotFoundException(type: type, message: message), 'ServiceQuotaExceededException': (type, message) => ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), 'UnauthorizedException': (type, message) => UnauthorizedException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/api_gateway/v2015_07_09.dart b/aws_client/lib/src/generated/api_gateway/v2015_07_09.dart index 2a26f8df3..7f39493af 100644 --- a/aws_client/lib/src/generated/api_gateway/v2015_07_09.dart +++ b/aws_client/lib/src/generated/api_gateway/v2015_07_09.dart @@ -21,7 +21,7 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// Amazon API Gateway helps developers deliver robust, secure, and scalable /// mobile and web application back ends. API Gateway allows developers to -/// securely connect mobile and web applications to APIs that run on AWS Lambda, +/// securely connect mobile and web applications to APIs that run on Lambda, /// Amazon EC2, or other publicly addressable web services that are hosted /// outside of AWS. class ApiGateway { @@ -62,8 +62,8 @@ class ApiGateway { /// May throw [TooManyRequestsException]. /// /// Parameter [customerId] : - /// An AWS Marketplace customer identifier , when integrating with the AWS - /// SaaS Marketplace. + /// An Amazon Web Services Marketplace customer identifier, when integrating + /// with the Amazon Web Services SaaS Marketplace. /// /// Parameter [description] : /// The description of the ApiKey. @@ -459,9 +459,9 @@ class ApiGateway { /// The name of the DomainName resource. /// /// Parameter [certificateArn] : - /// The reference to an AWS-managed certificate that will be used by - /// edge-optimized endpoint for this domain name. AWS Certificate Manager is - /// the only supported source. + /// The reference to an Amazon Web Services-managed certificate that will be + /// used by edge-optimized endpoint for this domain name. Certificate Manager + /// is the only supported source. /// /// Parameter [certificateBody] : /// [Deprecated] The body of the server certificate that will be used by @@ -495,9 +495,9 @@ class ApiGateway { /// ACM imported or private CA certificate ARN as the regionalCertificateArn. /// /// Parameter [regionalCertificateArn] : - /// The reference to an AWS-managed certificate that will be used by regional - /// endpoint for this domain name. AWS Certificate Manager is the only - /// supported source. + /// The reference to an Amazon Web Services-managed certificate that will be + /// used by regional endpoint for this domain name. Certificate Manager is the + /// only supported source. /// /// Parameter [regionalCertificateName] : /// The user-friendly name of the certificate that will be used by regional @@ -581,7 +581,8 @@ class ApiGateway { /// /// Parameter [schema] : /// The schema for the model. For application/json models, this - /// should be JSON schema draft 4 model. + /// should be JSON schema draft 4 model. The maximum size of the model is 400 + /// KB. Future createModel({ required String contentType, required String name, @@ -698,7 +699,7 @@ class ApiGateway { /// /// Parameter [apiKeySource] : /// The source of the API key for metering requests according to a usage plan. - /// Valid values are: >HEADER to read the API key from the + /// Valid values are: HEADER to read the API key from the /// X-API-Key header of a request. AUTHORIZER to /// read the API key from the UsageIdentifierKey from a custom /// authorizer. @@ -975,8 +976,8 @@ class ApiGateway { /// /// Parameter [targetArns] : /// The ARN of the network load balancer of the VPC targeted by the VPC link. - /// The network load balancer must be owned by the same AWS account of the API - /// owner. + /// The network load balancer must be owned by the same Amazon Web Services + /// account of the API owner. /// /// Parameter [description] : /// The description of the VPC link. @@ -1696,8 +1697,8 @@ class ApiGateway { /// May throw [TooManyRequestsException]. /// /// Parameter [customerId] : - /// The identifier of a customer in AWS Marketplace or an external system, - /// such as a developer portal. + /// The identifier of a customer in Amazon Web Services Marketplace or an + /// external system, such as a developer portal. /// /// Parameter [includeValues] : /// A boolean flag to specify whether (true) or not @@ -3255,9 +3256,9 @@ class ApiGateway { /// /// Parameter [mode] : /// A query parameter to indicate whether to overwrite - /// (OVERWRITE) any existing DocumentationParts definition or to - /// merge (MERGE) the new definition into the existing one. The - /// default value is MERGE. + /// (overwrite) any existing DocumentationParts definition or to + /// merge (merge) the new definition into the existing one. The + /// default value is merge. Future importDocumentationParts({ required Uint8List body, required String restApiId, @@ -3316,11 +3317,6 @@ class ApiGateway { /// To handle imported basepath, set parameters as /// basepath=ignore, basepath=prepend or /// basepath=split. - /// - /// For example, the AWS CLI command to exclude documentation from the - /// imported API is: - /// - /// The AWS CLI command to set the regional endpoint on the imported API is: Future importRestApi({ required Uint8List body, bool? failOnWarnings, @@ -4305,7 +4301,7 @@ class ApiGateway { /// The version identifier of the to-be-updated documentation version. /// /// Parameter [restApiId] : - /// The string identifier of the associated RestApi.. + /// The string identifier of the associated RestApi. /// /// Parameter [patchOperations] : /// For more information about supported patch operations, see HTTP, HTTP_PROXY, AWS, +/// AWS_PROXY, or Mock integration. class Integration { /// A list of request parameters whose values API Gateway caches. To be valid /// values for cacheKeyParameters, these parameters must also be @@ -6894,10 +6892,13 @@ class Integration { /// Gateway to assume, use the role's Amazon Resource Name (ARN). To require /// that the caller's identity be passed through from the request, specify the /// string arn:aws:iam::\*:user/\*. To use resource-based - /// permissions on supported AWS services, specify null. + /// permissions on supported Amazon Web Services services, specify null. final String? credentials; - /// Specifies the integration's HTTP method type. + /// Specifies the integration's HTTP method type. For the Type property, if you + /// specify MOCK, this property is optional. For Lambda + /// integrations, you must set the integration method to POST. For + /// all other types, you must specify this property. final String? httpMethod; /// Specifies the integration's responses. @@ -6963,10 +6964,8 @@ class Integration { /// /// For HTTP or HTTP_PROXY integrations, the URI must /// be a fully formed, encoded HTTP(S) URL according to the RFC-3986 - /// specification, for either standard integration, where - /// connectionType is not VPC_LINK, or private - /// integration, where connectionType is VPC_LINK. For - /// a private HTTP integration, the URI is not used for routing. For + /// specification for standard integrations. If connectionType is + /// VPC_LINK specify the Network Load Balancer DNS name. For /// AWS or AWS_PROXY integrations, the URI is of the /// form /// arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}. @@ -6977,11 +6976,11 @@ class Integration { /// Web Services service action-based API, using an /// Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing /// {service_api} refers to a supported action {name} plus any required input - /// parameters. Alternatively, path can be used for an AWS service path-based - /// API. The ensuing service_api refers to the path to an Amazon Web Services - /// service resource, including the region of the integrated Amazon Web Services - /// service, if applicable. For example, for integration with the S3 API of - /// GetObject, the uri can be either + /// parameters. Alternatively, path can be used for an Amazon Web Services + /// service path-based API. The ensuing service_api refers to the path to an + /// Amazon Web Services service resource, including the region of the integrated + /// Amazon Web Services service, if applicable. For example, for integration + /// with the S3 API of GetObject, the uri can be either /// arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} /// or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} final String? uri; @@ -7109,9 +7108,9 @@ class IntegrationResponse { /// if the success response returns nothing and the error response returns some /// string, you could use the .+ regex to match error response. /// However, make sure that the error response does not contain any newline - /// (\n) character in such cases. If the back end is an AWS Lambda - /// function, the AWS Lambda function error header is matched. For all other - /// HTTP and AWS back ends, the HTTP status code is matched. + /// (\n) character in such cases. If the back end is an Lambda + /// function, the Lambda function error header is matched. For all other HTTP + /// and Amazon Web Services back ends, the HTTP status code is matched. final String? selectionPattern; /// Specifies the status code that is used to map the integration response to an @@ -7156,11 +7155,11 @@ class IntegrationResponse { } /// The integration type. The valid value is HTTP for integrating -/// an API method with an HTTP backend; AWS with any AWS service -/// endpoints; MOCK for testing without actually invoking the -/// backend; HTTP_PROXY for integrating with the HTTP proxy -/// integration; AWS_PROXY for integrating with the Lambda proxy -/// integration. +/// an API method with an HTTP backend; AWS with any Amazon Web +/// Services service endpoints; MOCK for testing without actually +/// invoking the backend; HTTP_PROXY for integrating with the HTTP +/// proxy integration; AWS_PROXY for integrating with the Lambda +/// proxy integration. enum IntegrationType { http, aws, @@ -7433,67 +7432,45 @@ class MethodResponse { /// Specifies the method setting properties. class MethodSetting { - /// Specifies whether the cached responses are encrypted. The PATCH path for - /// this setting is /{method_setting_key}/caching/dataEncrypted, - /// and the value is a Boolean. + /// Specifies whether the cached responses are encrypted. final bool? cacheDataEncrypted; /// Specifies the time to live (TTL), in seconds, for cached responses. The - /// higher the TTL, the longer the response will be cached. The PATCH path for - /// this setting is /{method_setting_key}/caching/ttlInSeconds, and - /// the value is an integer. + /// higher the TTL, the longer the response will be cached. final int? cacheTtlInSeconds; /// Specifies whether responses should be cached and returned for requests. A - /// cache cluster must be enabled on the stage for responses to be cached. The - /// PATCH path for this setting is - /// /{method_setting_key}/caching/enabled, and the value is a - /// Boolean. + /// cache cluster must be enabled on the stage for responses to be cached. final bool? cachingEnabled; /// Specifies whether data trace logging is enabled for this method, which - /// affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for - /// this setting is /{method_setting_key}/logging/dataTrace, and - /// the value is a Boolean. + /// affects the log entries pushed to Amazon CloudWatch Logs. This can be useful + /// to troubleshoot APIs, but can result in logging sensitive data. We recommend + /// that you don't enable this option for production APIs. final bool? dataTraceEnabled; /// Specifies the logging level for this method, which affects the log entries - /// pushed to Amazon CloudWatch Logs. The PATCH path for this setting is - /// /{method_setting_key}/logging/loglevel, and the available - /// levels are OFF, ERROR, and INFO. - /// Choose ERROR to write only error-level entries to CloudWatch - /// Logs, or choose INFO to include all ERROR events - /// as well as extra informational events. + /// pushed to Amazon CloudWatch Logs. Valid values are OFF, + /// ERROR, and INFO. Choose ERROR to + /// write only error-level entries to CloudWatch Logs, or choose + /// INFO to include all ERROR events as well as extra + /// informational events. final String? loggingLevel; - /// Specifies whether Amazon CloudWatch metrics are enabled for this method. The - /// PATCH path for this setting is - /// /{method_setting_key}/metrics/enabled, and the value is a - /// Boolean. + /// Specifies whether Amazon CloudWatch metrics are enabled for this method. final bool? metricsEnabled; /// Specifies whether authorization is required for a cache invalidation - /// request. The PATCH path for this setting is - /// /{method_setting_key}/caching/requireAuthorizationForCacheControl, - /// and the value is a Boolean. + /// request. final bool? requireAuthorizationForCacheControl; - /// Specifies the throttling burst limit. The PATCH path for this setting is - /// /{method_setting_key}/throttling/burstLimit, and the value is - /// an integer. + /// Specifies the throttling burst limit. final int? throttlingBurstLimit; - /// Specifies the throttling rate limit. The PATCH path for this setting is - /// /{method_setting_key}/throttling/rateLimit, and the value is a - /// double. + /// Specifies the throttling rate limit. final double? throttlingRateLimit; - /// Specifies how to handle unauthorized requests for cache invalidation. The - /// PATCH path for this setting is - /// /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy, - /// and the available values are FAIL_WITH_403, - /// SUCCEED_WITH_RESPONSE_HEADER, - /// SUCCEED_WITHOUT_RESPONSE_HEADER. + /// Specifies how to handle unauthorized requests for cache invalidation. final UnauthorizedCacheControlHeaderStrategy? unauthorizedCacheControlHeaderStrategy; @@ -8183,6 +8160,9 @@ class RestApi { /// of the caller and Method configuration. final String? policy; + /// The API's root resource ID. + final String? rootResourceId; + /// The collection of tags. Each tag element is associated with a given /// resource. final Map? tags; @@ -8205,6 +8185,7 @@ class RestApi { this.minimumCompressionSize, this.name, this.policy, + this.rootResourceId, this.tags, this.version, this.warnings, @@ -8228,6 +8209,7 @@ class RestApi { minimumCompressionSize: json['minimumCompressionSize'] as int?, name: json['name'] as String?, policy: json['policy'] as String?, + rootResourceId: json['rootResourceId'] as String?, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), version: json['version'] as String?, @@ -8249,6 +8231,7 @@ class RestApi { final minimumCompressionSize = this.minimumCompressionSize; final name = this.name; final policy = this.policy; + final rootResourceId = this.rootResourceId; final tags = this.tags; final version = this.version; final warnings = this.warnings; @@ -8266,6 +8249,7 @@ class RestApi { 'minimumCompressionSize': minimumCompressionSize, if (name != null) 'name': name, if (policy != null) 'policy': policy, + if (rootResourceId != null) 'rootResourceId': rootResourceId, if (tags != null) 'tags': tags, if (version != null) 'version': version, if (warnings != null) 'warnings': warnings, @@ -8499,7 +8483,9 @@ class Stage { /// Settings for logging access in this stage. final AccessLogSettings? accessLogSettings; - /// Specifies whether a cache cluster is enabled for the stage. + /// Specifies whether a cache cluster is enabled for the stage. To activate a + /// method-level cache, set CachingEnabled to true for + /// a method. final bool? cacheClusterEnabled; /// The stage's cache capacity in GB. For more information about choosing a @@ -8773,7 +8759,7 @@ class TestInvokeAuthorizerResponse { /// authorizer succeeded. final int? clientStatus; - /// The execution latency of the test authorizer request. + /// The execution latency, in ms, of the test authorizer request. final int? latency; /// The API Gateway execution log for the test authorizer request. @@ -8838,7 +8824,7 @@ class TestInvokeMethodResponse { /// The headers of the HTTP response. final Map? headers; - /// The execution latency of the test invoke request. + /// The execution latency, in ms, of the test invoke request. final int? latency; /// The API Gateway execution log for the test invoke request. @@ -9077,8 +9063,8 @@ class UsagePlan { /// The name of a usage plan. final String? name; - /// The AWS Markeplace product identifier to associate with the usage plan as a - /// SaaS product on AWS Marketplace. + /// The Amazon Web Services Marketplace product identifier to associate with the + /// usage plan as a SaaS product on the Amazon Web Services Marketplace. final String? productCode; /// The target maximum number of permitted requests per a given unit time @@ -9282,8 +9268,8 @@ class VpcLink { final Map? tags; /// The ARN of the network load balancer of the VPC targeted by the VPC link. - /// The network load balancer must be owned by the same AWS account of the API - /// owner. + /// The network load balancer must be owned by the same Amazon Web Services + /// account of the API owner. final List? targetArns; VpcLink({ diff --git a/aws_client/lib/src/generated/api_gateway_v2/v2018_11_29.dart b/aws_client/lib/src/generated/api_gateway_v2/v2018_11_29.dart index 292819faa..c6b381853 100644 --- a/aws_client/lib/src/generated/api_gateway_v2/v2018_11_29.dart +++ b/aws_client/lib/src/generated/api_gateway_v2/v2018_11_29.dart @@ -1283,7 +1283,7 @@ class ApiGatewayV2 { ); } - /// Deletes a route request parameter. + /// Deletes a route request parameter. Supported only for WebSocket APIs. /// /// May throw [NotFoundException]. /// May throw [TooManyRequestsException]. @@ -2879,7 +2879,7 @@ class ApiGatewayV2 { /// action can be append, overwrite or remove. For values, you can provide /// static values, or map request data, stage variables, or context variables /// that are evaluated at runtime. To learn more, see Transforming + /// href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html">Transforming /// API requests and responses. /// /// Parameter [requestTemplates] : @@ -4585,7 +4585,7 @@ class CreateIntegrationResult { /// href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html">Working /// with AWS service integrations for HTTP APIs. /// - /// For HTTP API itegrations, without a specified integrationSubtype request + /// For HTTP API integrations, without a specified integrationSubtype request /// parameters are a key-value map specifying how to transform HTTP requests /// before sending them to backend integrations. The key should follow the /// pattern <action>:<header|querystring|path>.<location>. The @@ -6451,7 +6451,7 @@ class GetIntegrationResult { /// href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html">Working /// with AWS service integrations for HTTP APIs. /// - /// For HTTP API itegrations, without a specified integrationSubtype request + /// For HTTP API integrations, without a specified integrationSubtype request /// parameters are a key-value map specifying how to transform HTTP requests /// before sending them to backend integrations. The key should follow the /// pattern <action>:<header|querystring|path>.<location>. The @@ -7740,7 +7740,7 @@ class Integration { /// href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html">Working /// with AWS service integrations for HTTP APIs. /// - /// For HTTP API itegrations, without a specified integrationSubtype request + /// For HTTP API integrations, without a specified integrationSubtype request /// parameters are a key-value map specifying how to transform HTTP requests /// before sending them to backend integrations. The key should follow the /// pattern <action>:<header|querystring|path>.<location>. The @@ -9586,7 +9586,7 @@ class UpdateIntegrationResult { /// href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html">Working /// with AWS service integrations for HTTP APIs. /// - /// For HTTP API itegrations, without a specified integrationSubtype request + /// For HTTP API integrations, without a specified integrationSubtype request /// parameters are a key-value map specifying how to transform HTTP requests /// before sending them to backend integrations. The key should follow the /// pattern <action>:<header|querystring|path>.<location>. The diff --git a/aws_client/lib/src/generated/app_config/v2019_10_09.dart b/aws_client/lib/src/generated/app_config/v2019_10_09.dart index 00f0ba04a..ea050814a 100644 --- a/aws_client/lib/src/generated/app_config/v2019_10_09.dart +++ b/aws_client/lib/src/generated/app_config/v2019_10_09.dart @@ -19,51 +19,149 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Use AppConfig, a capability of Amazon Web Services Systems Manager, to -/// create, manage, and quickly deploy application configurations. AppConfig -/// supports controlled deployments to applications of any size and includes -/// built-in validation checks and monitoring. You can use AppConfig with -/// applications hosted on Amazon EC2 instances, Lambda, containers, mobile -/// applications, or IoT devices. +/// AppConfig feature flags and dynamic configurations help software builders +/// quickly and securely adjust application behavior in production environments +/// without full code deployments. AppConfig speeds up software release +/// frequency, improves application resiliency, and helps you address emergent +/// issues more quickly. With feature flags, you can gradually release new +/// capabilities to users and measure the impact of those changes before fully +/// deploying the new capabilities to all users. With operational flags and +/// dynamic configurations, you can update block lists, allow lists, throttling +/// limits, logging verbosity, and perform other operational tuning to quickly +/// respond to issues in production environments. +/// +/// AppConfig is a capability of Amazon Web Services Systems Manager. +/// +/// Despite the fact that application configuration content can vary greatly +/// from application to application, AppConfig supports the following use cases, +/// which cover a broad spectrum of customer needs: /// -/// To prevent errors when deploying application configurations, especially for -/// production systems where a simple typo could cause an unexpected outage, -/// AppConfig includes validators. A validator provides a syntactic or semantic -/// check to ensure that the configuration you want to deploy works as intended. -/// To validate your application configuration data, you provide a schema or an -/// Amazon Web Services Lambda function that runs against the configuration. The -/// configuration deployment or update can only proceed when the configuration -/// data is valid. +///
    +///
  • +/// Feature flags and toggles - Safely release new capabilities to your +/// customers in a controlled environment. Instantly roll back changes if you +/// experience a problem. +///
  • +///
  • +/// Application tuning - Carefully introduce application changes while +/// testing the impact of those changes with users in production environments. +///
  • +///
  • +/// Allow list or block list - Control access to premium features or +/// instantly block specific users without deploying new code. +///
  • +///
  • +/// Centralized configuration storage - Keep your configuration data +/// organized and consistent across all of your workloads. You can use AppConfig +/// to deploy configuration data stored in the AppConfig hosted configuration +/// store, Secrets Manager, Systems Manager, Parameter Store, or Amazon S3. +///
  • +///
+/// How AppConfig works /// -/// During a configuration deployment, AppConfig monitors the application to -/// ensure that the deployment is successful. If the system encounters an error, -/// AppConfig rolls back the change to minimize impact for your application -/// users. You can configure a deployment strategy for each application or -/// environment that includes deployment criteria, including velocity, bake -/// time, and alarms to monitor. Similar to error monitoring, if a deployment -/// triggers an alarm, AppConfig automatically rolls back to the previous -/// version. +/// This section provides a high-level description of how AppConfig works and +/// how you get started. +///
1. Identify configuration values in code you want to manage in the +/// cloud
+/// Before you start creating AppConfig artifacts, we recommend you identify +/// configuration data in your code that you want to dynamically manage using +/// AppConfig. Good examples include feature flags or toggles, allow and block +/// lists, logging verbosity, service limits, and throttling rules, to name a +/// few. /// -/// AppConfig supports multiple use cases. Here are some examples: +/// If your configuration data already exists in the cloud, you can take +/// advantage of AppConfig validation, deployment, and extension features to +/// further streamline configuration data management. +///
2. Create an application namespace
+/// To create a namespace, you create an AppConfig artifact called an +/// application. An application is simply an organizational construct like a +/// folder. +///
3. Create environments
+/// For each AppConfig application, you define one or more environments. An +/// environment is a logical grouping of targets, such as applications in a +/// Beta or Production environment, Lambda functions, +/// or containers. You can also define environments for application +/// subcomponents, such as the Web, Mobile, and +/// Back-end. +/// +/// You can configure Amazon CloudWatch alarms for each environment. The system +/// monitors alarms during a configuration deployment. If an alarm is triggered, +/// the system rolls back the configuration. +///
4. Create a configuration profile
+/// A configuration profile includes, among other things, a URI that enables +/// AppConfig to locate your configuration data in its stored location and a +/// profile type. AppConfig supports two configuration profile types: feature +/// flags and freeform configurations. Feature flag configuration profiles store +/// their data in the AppConfig hosted configuration store and the URI is simply +/// hosted. For freeform configuration profiles, you can store your +/// data in the AppConfig hosted configuration store or any Amazon Web Services +/// service that integrates with AppConfig, as described in Creating +/// a free form configuration profile in the the AppConfig User +/// Guide. +/// +/// A configuration profile can also include optional validators to ensure your +/// configuration data is syntactically and semantically correct. AppConfig +/// performs a check using the validators when you start a deployment. If any +/// errors are detected, the deployment rolls back to the previous configuration +/// data. +///
5. Deploy configuration data
+/// When you create a new deployment, you specify the following: /// ///
    ///
  • -/// Feature flags: Use AppConfig to turn on new features that require a -/// timely deployment, such as a product launch or announcement. +/// An application ID +///
  • +///
  • +/// A configuration profile ID ///
  • ///
  • -/// Application tuning: Use AppConfig to carefully introduce changes to -/// your application that can only be tested with production traffic. +/// A configuration version ///
  • ///
  • -/// Allow list: Use AppConfig to allow premium subscribers to access paid -/// content. +/// An environment ID where you want to deploy the configuration data ///
  • ///
  • -/// Operational issues: Use AppConfig to reduce stress on your -/// application when a dependency or other external factor impacts the system. +/// A deployment strategy ID that defines how fast you want the changes to take +/// effect ///
  • ///
+/// When you call the StartDeployment +/// API action, AppConfig performs the following tasks: +///
    +///
  1. +/// Retrieves the configuration data from the underlying data store by using the +/// location URI in the configuration profile. +///
  2. +///
  3. +/// Verifies the configuration data is syntactically and semantically correct by +/// using the validators you specified when you created your configuration +/// profile. +///
  4. +///
  5. +/// Caches a copy of the data so it is ready to be retrieved by your +/// application. This cached copy is called the deployed data. +///
6. Retrieve the configuration
+/// You can configure AppConfig Agent as a local host and have the agent poll +/// AppConfig for configuration updates. The agent calls the StartConfigurationSession +/// and GetLatestConfiguration +/// API actions and caches your configuration data locally. To retrieve the +/// data, your application makes an HTTP call to the localhost server. AppConfig +/// Agent supports several use cases, as described in Simplified +/// retrieval methods in the the AppConfig User Guide. +/// +/// If AppConfig Agent isn't supported for your use case, you can configure your +/// application to poll AppConfig for configuration updates by directly calling +/// the StartConfigurationSession +/// and GetLatestConfiguration +/// API actions. +///
/// This reference is intended to be used with the AppConfig /// User Guide. @@ -103,6 +201,7 @@ class AppConfig { /// configuration data for a mobile application installed by your users. /// /// May throw [BadRequestException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [InternalServerException]. /// /// Parameter [name] : @@ -185,6 +284,7 @@ class AppConfig { /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. /// /// Parameter [applicationId] : /// The application ID. @@ -203,8 +303,12 @@ class AppConfig { /// ssm-parameter://<parameter name> or the ARN. /// ///
  • + /// For an Amazon Web Services CodePipeline pipeline, specify the URI in the + /// following format: codepipeline://<pipeline name>. + ///
  • + ///
  • /// For an Secrets Manager secret, specify the URI in the following format: - /// secrets-manager://<secret name>. + /// secretsmanager://<secret name>. ///
  • ///
  • /// For an Amazon S3 object, specify the URI in the following format: @@ -224,6 +328,15 @@ class AppConfig { /// Parameter [description] : /// A description of the configuration profile. /// + /// Parameter [kmsKeyIdentifier] : + /// The identifier for an Key Management Service key to encrypt new + /// configuration data versions in the AppConfig hosted configuration store. + /// This attribute is only used for hosted configuration types. + /// The identifier can be an KMS key ID, alias, or the Amazon Resource Name + /// (ARN) of the key ID or alias. To encrypt data managed in other + /// configuration stores, see the documentation for how to specify an KMS key + /// for that particular service. + /// /// Parameter [retrievalRoleArn] : /// The ARN of an IAM role with permission to access the configuration at the /// specified LocationUri. @@ -257,6 +370,7 @@ class AppConfig { required String locationUri, required String name, String? description, + String? kmsKeyIdentifier, String? retrievalRoleArn, Map? tags, String? type, @@ -266,6 +380,7 @@ class AppConfig { 'LocationUri': locationUri, 'Name': name, if (description != null) 'Description': description, + if (kmsKeyIdentifier != null) 'KmsKeyIdentifier': kmsKeyIdentifier, if (retrievalRoleArn != null) 'RetrievalRoleArn': retrievalRoleArn, if (tags != null) 'Tags': tags, if (type != null) 'Type': type, @@ -288,6 +403,7 @@ class AppConfig { /// percentage grows, and bake time. /// /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [BadRequestException]. /// /// Parameter [deploymentDurationInMinutes] : @@ -413,6 +529,7 @@ class AppConfig { /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. /// May throw [BadRequestException]. + /// May throw [ServiceQuotaExceededException]. /// /// Parameter [applicationId] : /// The application ID. @@ -458,12 +575,30 @@ class AppConfig { /// of creating or deploying a configuration. /// /// You can create your own extensions or use the Amazon Web Services authored - /// extensions provided by AppConfig. For most use cases, to create your own - /// extension, you must create an Lambda function to perform any computation - /// and processing defined in the extension. For more information about - /// extensions, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// extensions provided by AppConfig. For an AppConfig extension that uses + /// Lambda, you must create a Lambda function to perform any computation and + /// processing defined in the extension. If you plan to create custom versions + /// of the Amazon Web Services authored notification extensions, you only need + /// to specify an Amazon Resource Name (ARN) in the Uri field for + /// the new extension version. + /// + ///
      + ///
    • + /// For a custom EventBridge notification extension, enter the ARN of the + /// EventBridge default events in the Uri field. + ///
    • + ///
    • + /// For a custom Amazon SNS notification extension, enter the ARN of an Amazon + /// SNS topic in the Uri field. + ///
    • + ///
    • + /// For a custom Amazon SQS notification extension, enter the ARN of an Amazon + /// SQS message queue in the Uri field. + ///
    • + ///
    + /// For more information about extensions, see Extending + /// workflows in the AppConfig User Guide. /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -536,8 +671,8 @@ class AppConfig { /// association is a specified relationship between an extension and an /// AppConfig resource, such as an application or a configuration profile. For /// more information about extensions and associations, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. @@ -657,6 +792,7 @@ class AppConfig { contentType: _s.extractHeaderStringValue(response.headers, 'Content-Type'), description: _s.extractHeaderStringValue(response.headers, 'Description'), + kmsKeyArn: _s.extractHeaderStringValue(response.headers, 'KmsKeyArn'), versionLabel: _s.extractHeaderStringValue(response.headers, 'VersionLabel'), versionNumber: @@ -1099,8 +1235,8 @@ class AppConfig { /// Returns information about an AppConfig extension association. For more /// information about extensions and associations, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. @@ -1156,6 +1292,7 @@ class AppConfig { contentType: _s.extractHeaderStringValue(response.headers, 'Content-Type'), description: _s.extractHeaderStringValue(response.headers, 'Description'), + kmsKeyArn: _s.extractHeaderStringValue(response.headers, 'KmsKeyArn'), versionLabel: _s.extractHeaderStringValue(response.headers, 'VersionLabel'), versionNumber: @@ -1382,8 +1519,8 @@ class AppConfig { /// Lists all AppConfig extension associations in the account. For more /// information about extensions and associations, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [InternalServerException]. /// May throw [BadRequestException]. @@ -1440,8 +1577,8 @@ class AppConfig { /// Lists all custom and Amazon Web Services authored AppConfig extensions in /// the account. For more information about extensions, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [InternalServerException]. /// May throw [BadRequestException]. @@ -1573,7 +1710,8 @@ class AppConfig { /// Parameter [configurationVersion] : /// The configuration version to deploy. If deploying an AppConfig hosted /// configuration version, you can specify either the version number or - /// version label. + /// version label. For all other configurations, you must specify the version + /// number. /// /// Parameter [deploymentStrategyId] : /// The deployment strategy ID. @@ -1584,6 +1722,10 @@ class AppConfig { /// Parameter [description] : /// A description of the deployment. /// + /// Parameter [dynamicExtensionParameters] : + /// A map of dynamic extension parameter names to values to pass to associated + /// extensions with PRE_START_DEPLOYMENT actions. + /// /// Parameter [kmsKeyIdentifier] : /// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses /// this ID to encrypt the configuration data using a customer managed key. @@ -1599,6 +1741,7 @@ class AppConfig { required String deploymentStrategyId, required String environmentId, String? description, + Map? dynamicExtensionParameters, String? kmsKeyIdentifier, Map? tags, }) async { @@ -1607,6 +1750,8 @@ class AppConfig { 'ConfigurationVersion': configurationVersion, 'DeploymentStrategyId': deploymentStrategyId, if (description != null) 'Description': description, + if (dynamicExtensionParameters != null) + 'DynamicExtensionParameters': dynamicExtensionParameters, if (kmsKeyIdentifier != null) 'KmsKeyIdentifier': kmsKeyIdentifier, if (tags != null) 'Tags': tags, }; @@ -1756,6 +1901,15 @@ class AppConfig { /// Parameter [description] : /// A description of the configuration profile. /// + /// Parameter [kmsKeyIdentifier] : + /// The identifier for a Key Management Service key to encrypt new + /// configuration data versions in the AppConfig hosted configuration store. + /// This attribute is only used for hosted configuration types. + /// The identifier can be an KMS key ID, alias, or the Amazon Resource Name + /// (ARN) of the key ID or alias. To encrypt data managed in other + /// configuration stores, see the documentation for how to specify an KMS key + /// for that particular service. + /// /// Parameter [name] : /// The name of the configuration profile. /// @@ -1769,12 +1923,14 @@ class AppConfig { required String applicationId, required String configurationProfileId, String? description, + String? kmsKeyIdentifier, String? name, String? retrievalRoleArn, List? validators, }) async { final $payload = { if (description != null) 'Description': description, + if (kmsKeyIdentifier != null) 'KmsKeyIdentifier': kmsKeyIdentifier, if (name != null) 'Name': name, if (retrievalRoleArn != null) 'RetrievalRoleArn': retrievalRoleArn, if (validators != null) 'Validators': validators, @@ -1930,8 +2086,8 @@ class AppConfig { /// Updates an AppConfig extension. For more information about extensions, see /// Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. @@ -1977,8 +2133,8 @@ class AppConfig { /// Updates an association. For more information about extensions and /// associations, see Working - /// with AppConfig extensions in the AppConfig User Guide. + /// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending + /// workflows in the AppConfig User Guide. /// /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. @@ -2404,6 +2560,17 @@ class ConfigurationProfile { /// The configuration profile ID. final String? id; + /// The Amazon Resource Name of the Key Management Service key to encrypt new + /// configuration data versions in the AppConfig hosted configuration store. + /// This attribute is only used for hosted configuration types. To + /// encrypt data managed in other configuration stores, see the documentation + /// for how to specify an KMS key for that particular service. + final String? kmsKeyArn; + + /// The Key Management Service key identifier (key ID, key alias, or key ARN) + /// provided when the resource was created or updated. + final String? kmsKeyIdentifier; + /// The URI location of the configuration. final String? locationUri; @@ -2433,6 +2600,8 @@ class ConfigurationProfile { this.applicationId, this.description, this.id, + this.kmsKeyArn, + this.kmsKeyIdentifier, this.locationUri, this.name, this.retrievalRoleArn, @@ -2445,6 +2614,8 @@ class ConfigurationProfile { applicationId: json['ApplicationId'] as String?, description: json['Description'] as String?, id: json['Id'] as String?, + kmsKeyArn: json['KmsKeyArn'] as String?, + kmsKeyIdentifier: json['KmsKeyIdentifier'] as String?, locationUri: json['LocationUri'] as String?, name: json['Name'] as String?, retrievalRoleArn: json['RetrievalRoleArn'] as String?, @@ -2460,6 +2631,8 @@ class ConfigurationProfile { final applicationId = this.applicationId; final description = this.description; final id = this.id; + final kmsKeyArn = this.kmsKeyArn; + final kmsKeyIdentifier = this.kmsKeyIdentifier; final locationUri = this.locationUri; final name = this.name; final retrievalRoleArn = this.retrievalRoleArn; @@ -2469,6 +2642,8 @@ class ConfigurationProfile { if (applicationId != null) 'ApplicationId': applicationId, if (description != null) 'Description': description, if (id != null) 'Id': id, + if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn, + if (kmsKeyIdentifier != null) 'KmsKeyIdentifier': kmsKeyIdentifier, if (locationUri != null) 'LocationUri': locationUri, if (name != null) 'Name': name, if (retrievalRoleArn != null) 'RetrievalRoleArn': retrievalRoleArn, @@ -2645,8 +2820,8 @@ class Deployment { /// Parameter Store. final String? kmsKeyArn; - /// The KMS key identifier (key ID, key alias, or key ARN). AppConfig uses this - /// ID to encrypt the configuration data using a customer managed key. + /// The Key Management Service key identifier (key ID, key alias, or key ARN) + /// provided when the resource was created or updated. final String? kmsKeyIdentifier; /// The percentage of targets for which the deployment is available. @@ -2658,6 +2833,9 @@ class Deployment { /// The state of the deployment. final DeploymentState? state; + /// A user-defined label for an AppConfig hosted configuration version. + final String? versionLabel; + Deployment({ this.applicationId, this.appliedExtensions, @@ -2680,6 +2858,7 @@ class Deployment { this.percentageComplete, this.startedAt, this.state, + this.versionLabel, }); factory Deployment.fromJson(Map json) { @@ -2711,6 +2890,7 @@ class Deployment { percentageComplete: json['PercentageComplete'] as double?, startedAt: timeStampFromJson(json['StartedAt']), state: (json['State'] as String?)?.toDeploymentState(), + versionLabel: json['VersionLabel'] as String?, ); } @@ -2736,6 +2916,7 @@ class Deployment { final percentageComplete = this.percentageComplete; final startedAt = this.startedAt; final state = this.state; + final versionLabel = this.versionLabel; return { if (applicationId != null) 'ApplicationId': applicationId, if (appliedExtensions != null) 'AppliedExtensions': appliedExtensions, @@ -2764,6 +2945,7 @@ class Deployment { if (percentageComplete != null) 'PercentageComplete': percentageComplete, if (startedAt != null) 'StartedAt': iso8601ToJson(startedAt), if (state != null) 'State': state.toValue(), + if (versionLabel != null) 'VersionLabel': versionLabel, }; } } @@ -2774,10 +2956,21 @@ class DeploymentEvent { final List? actionInvocations; /// A description of the deployment event. Descriptions include, but are not - /// limited to, the user account or the Amazon CloudWatch alarm ARN that - /// initiated a rollback, the percentage of hosts that received the deployment, - /// or in the case of an internal error, a recommendation to attempt a new - /// deployment. + /// limited to, the following: + /// + ///
      + ///
    • + /// The Amazon Web Services account or the Amazon CloudWatch alarm ARN that + /// initiated a rollback. + ///
    • + ///
    • + /// The percentage of hosts that received the deployment. + ///
    • + ///
    • + /// A recommendation to attempt a new deployment (in the case of an internal + /// error). + ///
    • + ///
    final String? description; /// The type of deployment event. Deployment event types include the start, @@ -3070,6 +3263,9 @@ class DeploymentSummary { /// The state of the deployment. final DeploymentState? state; + /// A user-defined label for an AppConfig hosted configuration version. + final String? versionLabel; + DeploymentSummary({ this.completedAt, this.configurationName, @@ -3082,6 +3278,7 @@ class DeploymentSummary { this.percentageComplete, this.startedAt, this.state, + this.versionLabel, }); factory DeploymentSummary.fromJson(Map json) { @@ -3097,6 +3294,7 @@ class DeploymentSummary { percentageComplete: json['PercentageComplete'] as double?, startedAt: timeStampFromJson(json['StartedAt']), state: (json['State'] as String?)?.toDeploymentState(), + versionLabel: json['VersionLabel'] as String?, ); } @@ -3112,6 +3310,7 @@ class DeploymentSummary { final percentageComplete = this.percentageComplete; final startedAt = this.startedAt; final state = this.state; + final versionLabel = this.versionLabel; return { if (completedAt != null) 'CompletedAt': iso8601ToJson(completedAt), if (configurationName != null) 'ConfigurationName': configurationName, @@ -3127,6 +3326,7 @@ class DeploymentSummary { if (percentageComplete != null) 'PercentageComplete': percentageComplete, if (startedAt != null) 'StartedAt': iso8601ToJson(startedAt), if (state != null) 'State': state.toValue(), + if (versionLabel != null) 'VersionLabel': versionLabel, }; } } @@ -3643,6 +3843,11 @@ class HostedConfigurationVersion { /// A description of the configuration. final String? description; + /// The Amazon Resource Name of the Key Management Service key that was used to + /// encrypt this specific version of the configuration data in the AppConfig + /// hosted configuration store. + final String? kmsKeyArn; + /// A user-defined label for an AppConfig hosted configuration version. final String? versionLabel; @@ -3655,6 +3860,7 @@ class HostedConfigurationVersion { this.content, this.contentType, this.description, + this.kmsKeyArn, this.versionLabel, this.versionNumber, }); @@ -3665,6 +3871,7 @@ class HostedConfigurationVersion { final content = this.content; final contentType = this.contentType; final description = this.description; + final kmsKeyArn = this.kmsKeyArn; final versionLabel = this.versionLabel; final versionNumber = this.versionNumber; return { @@ -3689,6 +3896,11 @@ class HostedConfigurationVersionSummary { /// A description of the configuration. final String? description; + /// The Amazon Resource Name of the Key Management Service key that was used to + /// encrypt this specific version of the configuration data in the AppConfig + /// hosted configuration store. + final String? kmsKeyArn; + /// A user-defined label for an AppConfig hosted configuration version. final String? versionLabel; @@ -3700,6 +3912,7 @@ class HostedConfigurationVersionSummary { this.configurationProfileId, this.contentType, this.description, + this.kmsKeyArn, this.versionLabel, this.versionNumber, }); @@ -3711,6 +3924,7 @@ class HostedConfigurationVersionSummary { configurationProfileId: json['ConfigurationProfileId'] as String?, contentType: json['ContentType'] as String?, description: json['Description'] as String?, + kmsKeyArn: json['KmsKeyArn'] as String?, versionLabel: json['VersionLabel'] as String?, versionNumber: json['VersionNumber'] as int?, ); @@ -3721,6 +3935,7 @@ class HostedConfigurationVersionSummary { final configurationProfileId = this.configurationProfileId; final contentType = this.contentType; final description = this.description; + final kmsKeyArn = this.kmsKeyArn; final versionLabel = this.versionLabel; final versionNumber = this.versionNumber; return { @@ -3729,6 +3944,7 @@ class HostedConfigurationVersionSummary { 'ConfigurationProfileId': configurationProfileId, if (contentType != null) 'ContentType': contentType, if (description != null) 'Description': description, + if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn, if (versionLabel != null) 'VersionLabel': versionLabel, if (versionNumber != null) 'VersionNumber': versionNumber, }; @@ -3804,32 +4020,41 @@ class Monitor { /// Notification Service topic entered in an extension when invoked. Parameter /// values are specified in an extension association. For more information about /// extensions, see Working -/// with AppConfig extensions in the AppConfig User Guide. +/// href="https://docs.aws.amazon.com/appconfig/latest/userguide/working-with-appconfig-extensions.html">Extending +/// workflows in the AppConfig User Guide. class Parameter { /// Information about the parameter. final String? description; + /// Indicates whether this parameter's value can be supplied at the extension's + /// action point instead of during extension association. Dynamic parameters + /// can't be marked Required. + final bool? dynamicValue; + /// A parameter value must be specified in the extension association. final bool? required; Parameter({ this.description, + this.dynamicValue, this.required, }); factory Parameter.fromJson(Map json) { return Parameter( description: json['Description'] as String?, + dynamicValue: json['Dynamic'] as bool?, required: json['Required'] as bool?, ); } Map toJson() { final description = this.description; + final dynamicValue = this.dynamicValue; final required = this.required; return { if (description != null) 'Description': description, + if (dynamicValue != null) 'Dynamic': dynamicValue, if (required != null) 'Required': required, }; } diff --git a/aws_client/lib/src/generated/app_fabric/v2023_05_19.dart b/aws_client/lib/src/generated/app_fabric/v2023_05_19.dart new file mode 100644 index 000000000..5b6c4260c --- /dev/null +++ b/aws_client/lib/src/generated/app_fabric/v2023_05_19.dart @@ -0,0 +1,3115 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Amazon Web Services AppFabric quickly connects software as a service (SaaS) +/// applications across your organization. This allows IT and security teams to +/// easily manage and secure applications using a standard schema, and employees +/// can complete everyday tasks faster using generative artificial intelligence +/// (AI). You can use these APIs to complete AppFabric tasks, such as setting up +/// audit log ingestions or viewing user access. For more information about +/// AppFabric, including the required permissions to use the service, see the Amazon Web +/// Services AppFabric Administration Guide. For more information about +/// using the Command Line Interface (CLI) to manage your AppFabric resources, +/// see the AppFabric +/// section of the CLI Reference. +class AppFabric { + final _s.RestJsonProtocol _protocol; + AppFabric({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'appfabric', + signingName: 'appfabric', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Gets user access details in a batch request. + /// + /// This action polls data from the tasks that are kicked off by the + /// StartUserAccessTasks action. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [taskIdList] : + /// The tasks IDs to use for the request. + Future batchGetUserAccessTasks({ + required String appBundleIdentifier, + required List taskIdList, + }) async { + final $payload = { + 'appBundleIdentifier': appBundleIdentifier, + 'taskIdList': taskIdList, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/useraccess/batchget', + exceptionFnMap: _exceptionFns, + ); + return BatchGetUserAccessTasksResponse.fromJson(response); + } + + /// Establishes a connection between Amazon Web Services AppFabric and an + /// application, which allows AppFabric to call the APIs of the application. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appAuthorizationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app authorization to use for the request. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle that contains the app authorization to use for the request. + /// + /// Parameter [authRequest] : + /// Contains OAuth2 authorization information. + /// + /// This is required if the app authorization for the request is configured + /// with an OAuth2 (oauth2) authorization type. + Future connectAppAuthorization({ + required String appAuthorizationIdentifier, + required String appBundleIdentifier, + AuthRequest? authRequest, + }) async { + final $payload = { + if (authRequest != null) 'authRequest': authRequest, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations/${Uri.encodeComponent(appAuthorizationIdentifier)}/connect', + exceptionFnMap: _exceptionFns, + ); + return ConnectAppAuthorizationResponse.fromJson(response); + } + + /// Creates an app authorization within an app bundle, which allows AppFabric + /// to connect to an application. + /// + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [app] : + /// The name of the application. + /// + /// Valid values are: + /// + ///
      + ///
    • + /// SLACK + ///
    • + ///
    • + /// ASANA + ///
    • + ///
    • + /// JIRA + ///
    • + ///
    • + /// M365 + ///
    • + ///
    • + /// M365AUDITLOGS + ///
    • + ///
    • + /// ZOOM + ///
    • + ///
    • + /// ZENDESK + ///
    • + ///
    • + /// OKTA + ///
    • + ///
    • + /// GOOGLE + ///
    • + ///
    • + /// DROPBOX + ///
    • + ///
    • + /// SMARTSHEET + ///
    • + ///
    • + /// CISCO + ///
    • + ///
    + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [authType] : + /// The authorization type for the app authorization. + /// + /// Parameter [credential] : + /// Contains credentials for the application, such as an API key or OAuth2 + /// client ID and secret. + /// + /// Specify credentials that match the authorization type for your request. + /// For example, if the authorization type for your request is OAuth2 + /// (oauth2), then you should provide only the OAuth2 + /// credentials. + /// + /// Parameter [tenant] : + /// Contains information about an application tenant, such as the application + /// display name and identifier. + /// + /// Parameter [clientToken] : + /// Specifies a unique, case-sensitive identifier that you provide to ensure + /// the idempotency of the request. This lets you safely retry the request + /// without accidentally performing the same operation a second time. Passing + /// the same value to a later call to an operation requires that you also pass + /// the same value for all other parameters. We recommend that you use a UUID type + /// of value. + /// + /// If you don't provide this value, then Amazon Web Services generates a + /// random one for you. + /// + /// If you retry the operation with the same ClientToken, but + /// with different parameters, the retry fails with an + /// IdempotentParameterMismatch error. + /// + /// Parameter [tags] : + /// A map of the key-value pairs of the tag or tags to assign to the resource. + Future createAppAuthorization({ + required String app, + required String appBundleIdentifier, + required AuthType authType, + required Credential credential, + required Tenant tenant, + String? clientToken, + List? tags, + }) async { + final $payload = { + 'app': app, + 'authType': authType.toValue(), + 'credential': credential, + 'tenant': tenant, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations', + exceptionFnMap: _exceptionFns, + ); + return CreateAppAuthorizationResponse.fromJson(response); + } + + /// Creates an app bundle to collect data from an application using AppFabric. + /// + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [clientToken] : + /// Specifies a unique, case-sensitive identifier that you provide to ensure + /// the idempotency of the request. This lets you safely retry the request + /// without accidentally performing the same operation a second time. Passing + /// the same value to a later call to an operation requires that you also pass + /// the same value for all other parameters. We recommend that you use a UUID type + /// of value. + /// + /// If you don't provide this value, then Amazon Web Services generates a + /// random one for you. + /// + /// If you retry the operation with the same ClientToken, but + /// with different parameters, the retry fails with an + /// IdempotentParameterMismatch error. + /// + /// Parameter [customerManagedKeyIdentifier] : + /// The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to + /// use to encrypt the application data. If this is not specified, an Amazon + /// Web Services owned key is used for encryption. + /// + /// Parameter [tags] : + /// A map of the key-value pairs of the tag or tags to assign to the resource. + Future createAppBundle({ + String? clientToken, + String? customerManagedKeyIdentifier, + List? tags, + }) async { + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (customerManagedKeyIdentifier != null) + 'customerManagedKeyIdentifier': customerManagedKeyIdentifier, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/appbundles', + exceptionFnMap: _exceptionFns, + ); + return CreateAppBundleResponse.fromJson(response); + } + + /// Creates a data ingestion for an application. + /// + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [app] : + /// The name of the application. + /// + /// Valid values are: + /// + ///
      + ///
    • + /// SLACK + ///
    • + ///
    • + /// ASANA + ///
    • + ///
    • + /// JIRA + ///
    • + ///
    • + /// M365 + ///
    • + ///
    • + /// M365AUDITLOGS + ///
    • + ///
    • + /// ZOOM + ///
    • + ///
    • + /// ZENDESK + ///
    • + ///
    • + /// OKTA + ///
    • + ///
    • + /// GOOGLE + ///
    • + ///
    • + /// DROPBOX + ///
    • + ///
    • + /// SMARTSHEET + ///
    • + ///
    • + /// CISCO + ///
    • + ///
    + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionType] : + /// The ingestion type. + /// + /// Parameter [tenantId] : + /// The ID of the application tenant. + /// + /// Parameter [clientToken] : + /// Specifies a unique, case-sensitive identifier that you provide to ensure + /// the idempotency of the request. This lets you safely retry the request + /// without accidentally performing the same operation a second time. Passing + /// the same value to a later call to an operation requires that you also pass + /// the same value for all other parameters. We recommend that you use a UUID type + /// of value. + /// + /// If you don't provide this value, then Amazon Web Services generates a + /// random one for you. + /// + /// If you retry the operation with the same ClientToken, but + /// with different parameters, the retry fails with an + /// IdempotentParameterMismatch error. + /// + /// Parameter [tags] : + /// A map of the key-value pairs of the tag or tags to assign to the resource. + Future createIngestion({ + required String app, + required String appBundleIdentifier, + required IngestionType ingestionType, + required String tenantId, + String? clientToken, + List? tags, + }) async { + final $payload = { + 'app': app, + 'ingestionType': ingestionType.toValue(), + 'tenantId': tenantId, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions', + exceptionFnMap: _exceptionFns, + ); + return CreateIngestionResponse.fromJson(response); + } + + /// Creates an ingestion destination, which specifies how an application's + /// ingested data is processed by Amazon Web Services AppFabric and where it's + /// delivered. + /// + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [destinationConfiguration] : + /// Contains information about the destination of ingested data. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + /// + /// Parameter [processingConfiguration] : + /// Contains information about how ingested data is processed. + /// + /// Parameter [clientToken] : + /// Specifies a unique, case-sensitive identifier that you provide to ensure + /// the idempotency of the request. This lets you safely retry the request + /// without accidentally performing the same operation a second time. Passing + /// the same value to a later call to an operation requires that you also pass + /// the same value for all other parameters. We recommend that you use a UUID type + /// of value. + /// + /// If you don't provide this value, then Amazon Web Services generates a + /// random one for you. + /// + /// If you retry the operation with the same ClientToken, but + /// with different parameters, the retry fails with an + /// IdempotentParameterMismatch error. + /// + /// Parameter [tags] : + /// A map of the key-value pairs of the tag or tags to assign to the resource. + Future createIngestionDestination({ + required String appBundleIdentifier, + required DestinationConfiguration destinationConfiguration, + required String ingestionIdentifier, + required ProcessingConfiguration processingConfiguration, + String? clientToken, + List? tags, + }) async { + final $payload = { + 'destinationConfiguration': destinationConfiguration, + 'processingConfiguration': processingConfiguration, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/ingestiondestinations', + exceptionFnMap: _exceptionFns, + ); + return CreateIngestionDestinationResponse.fromJson(response); + } + + /// Deletes an app authorization. You must delete the associated ingestion + /// before you can delete an app authorization. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appAuthorizationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app authorization to use for the request. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + Future deleteAppAuthorization({ + required String appAuthorizationIdentifier, + required String appBundleIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations/${Uri.encodeComponent(appAuthorizationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an app bundle. You must delete all associated app authorizations + /// before you can delete an app bundle. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The ID or Amazon Resource Name (ARN) of the app bundle that needs to be + /// deleted. + Future deleteAppBundle({ + required String appBundleIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an ingestion. You must stop (disable) the ingestion and you must + /// delete all associated ingestion destinations before you can delete an app + /// ingestion. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future deleteIngestion({ + required String appBundleIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an ingestion destination. + /// + /// This deletes the association between an ingestion and it's destination. It + /// doesn't delete previously ingested data or the storage destination, such + /// as the Amazon S3 bucket where the data is delivered. If the ingestion + /// destination is deleted while the associated ingestion is enabled, the + /// ingestion will fail and is eventually disabled. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionDestinationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion destination to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future deleteIngestionDestination({ + required String appBundleIdentifier, + required String ingestionDestinationIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/ingestiondestinations/${Uri.encodeComponent(ingestionDestinationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Returns information about an app authorization. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appAuthorizationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app authorization to use for the request. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + Future getAppAuthorization({ + required String appAuthorizationIdentifier, + required String appBundleIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations/${Uri.encodeComponent(appAuthorizationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetAppAuthorizationResponse.fromJson(response); + } + + /// Returns information about an app bundle. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + Future getAppBundle({ + required String appBundleIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetAppBundleResponse.fromJson(response); + } + + /// Returns information about an ingestion. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future getIngestion({ + required String appBundleIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetIngestionResponse.fromJson(response); + } + + /// Returns information about an ingestion destination. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionDestinationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion destination to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future getIngestionDestination({ + required String appBundleIdentifier, + required String ingestionDestinationIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/ingestiondestinations/${Uri.encodeComponent(ingestionDestinationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetIngestionDestinationResponse.fromJson(response); + } + + /// Returns a list of all app authorizations configured for an app bundle. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [maxResults] : + /// The maximum number of results that are returned per call. You can use + /// nextToken to obtain further pages of results. + /// + /// This is only an upper limit. The actual number of results returned per + /// call might be fewer than the specified maximum. + /// + /// Parameter [nextToken] : + /// If nextToken is returned, there are more results available. + /// The value of nextToken is a unique pagination token for each + /// page. Make the call again using the returned token to retrieve the next + /// page. Keep all other arguments unchanged. Each pagination token expires + /// after 24 hours. Using an expired pagination token will return an HTTP + /// 400 InvalidToken error. + Future listAppAuthorizations({ + required String appBundleIdentifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAppAuthorizationsResponse.fromJson(response); + } + + /// Returns a list of app bundles. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results that are returned per call. You can use + /// nextToken to obtain further pages of results. + /// + /// This is only an upper limit. The actual number of results returned per + /// call might be fewer than the specified maximum. + /// + /// Parameter [nextToken] : + /// If nextToken is returned, there are more results available. + /// The value of nextToken is a unique pagination token for each + /// page. Make the call again using the returned token to retrieve the next + /// page. Keep all other arguments unchanged. Each pagination token expires + /// after 24 hours. Using an expired pagination token will return an HTTP + /// 400 InvalidToken error. + Future listAppBundles({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/appbundles', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAppBundlesResponse.fromJson(response); + } + + /// Returns a list of all ingestion destinations configured for an ingestion. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + /// + /// Parameter [maxResults] : + /// The maximum number of results that are returned per call. You can use + /// nextToken to obtain further pages of results. + /// + /// This is only an upper limit. The actual number of results returned per + /// call might be fewer than the specified maximum. + /// + /// Parameter [nextToken] : + /// If nextToken is returned, there are more results available. + /// The value of nextToken is a unique pagination token for each + /// page. Make the call again using the returned token to retrieve the next + /// page. Keep all other arguments unchanged. Each pagination token expires + /// after 24 hours. Using an expired pagination token will return an HTTP + /// 400 InvalidToken error. + Future listIngestionDestinations({ + required String appBundleIdentifier, + required String ingestionIdentifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/ingestiondestinations', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListIngestionDestinationsResponse.fromJson(response); + } + + /// Returns a list of all ingestions configured for an app bundle. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [maxResults] : + /// The maximum number of results that are returned per call. You can use + /// nextToken to obtain further pages of results. + /// + /// This is only an upper limit. The actual number of results returned per + /// call might be fewer than the specified maximum. + /// + /// Parameter [nextToken] : + /// If nextToken is returned, there are more results available. + /// The value of nextToken is a unique pagination token for each + /// page. Make the call again using the returned token to retrieve the next + /// page. Keep all other arguments unchanged. Each pagination token expires + /// after 24 hours. Using an expired pagination token will return an HTTP + /// 400 InvalidToken error. + Future listIngestions({ + required String appBundleIdentifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListIngestionsResponse.fromJson(response); + } + + /// Returns a list of tags for a resource. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource for which you want to + /// retrieve tags. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Starts (enables) an ingestion, which collects data from an application. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future startIngestion({ + required String appBundleIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/start', + exceptionFnMap: _exceptionFns, + ); + } + + /// Starts the tasks to search user access status for a specific email + /// address. + /// + /// The tasks are stopped when the user access status data is found. The tasks + /// are terminated when the API calls to the application time out. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [email] : + /// The email address of the target user. + Future startUserAccessTasks({ + required String appBundleIdentifier, + required String email, + }) async { + final $payload = { + 'appBundleIdentifier': appBundleIdentifier, + 'email': email, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/useraccess/start', + exceptionFnMap: _exceptionFns, + ); + return StartUserAccessTasksResponse.fromJson(response); + } + + /// Stops (disables) an ingestion. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future stopIngestion({ + required String appBundleIdentifier, + required String ingestionIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/stop', + exceptionFnMap: _exceptionFns, + ); + } + + /// Assigns one or more tags (key-value pairs) to the specified resource. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource that you want to tag. + /// + /// Parameter [tags] : + /// A map of the key-value pairs of the tag or tags to assign to the resource. + Future tagResource({ + required String resourceArn, + required List tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes a tag or tags from a resource. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource that you want to untag. + /// + /// Parameter [tagKeys] : + /// The keys of the key-value pairs for the tag or tags you want to remove + /// from the specified resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates an app authorization within an app bundle, which allows AppFabric + /// to connect to an application. + /// + /// If the app authorization was in a connected state, updating + /// the app authorization will set it back to a PendingConnect + /// state. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appAuthorizationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app authorization to use for the request. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [credential] : + /// Contains credentials for the application, such as an API key or OAuth2 + /// client ID and secret. + /// + /// Specify credentials that match the authorization type of the app + /// authorization to update. For example, if the authorization type of the app + /// authorization is OAuth2 (oauth2), then you should provide + /// only the OAuth2 credentials. + /// + /// Parameter [tenant] : + /// Contains information about an application tenant, such as the application + /// display name and identifier. + Future updateAppAuthorization({ + required String appAuthorizationIdentifier, + required String appBundleIdentifier, + Credential? credential, + Tenant? tenant, + }) async { + final $payload = { + if (credential != null) 'credential': credential, + if (tenant != null) 'tenant': tenant, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/appauthorizations/${Uri.encodeComponent(appAuthorizationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateAppAuthorizationResponse.fromJson(response); + } + + /// Updates an ingestion destination, which specifies how an application's + /// ingested data is processed by Amazon Web Services AppFabric and where it's + /// delivered. + /// + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [appBundleIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the app bundle to use for the request. + /// + /// Parameter [destinationConfiguration] : + /// Contains information about the destination of ingested data. + /// + /// Parameter [ingestionDestinationIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion destination to use for the request. + /// + /// Parameter [ingestionIdentifier] : + /// The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of + /// the ingestion to use for the request. + Future updateIngestionDestination({ + required String appBundleIdentifier, + required DestinationConfiguration destinationConfiguration, + required String ingestionDestinationIdentifier, + required String ingestionIdentifier, + }) async { + final $payload = { + 'destinationConfiguration': destinationConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/appbundles/${Uri.encodeComponent(appBundleIdentifier)}/ingestions/${Uri.encodeComponent(ingestionIdentifier)}/ingestiondestinations/${Uri.encodeComponent(ingestionDestinationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateIngestionDestinationResponse.fromJson(response); + } +} + +/// Contains API key credential information. +class ApiKeyCredential { + /// An API key for an application. + final String apiKey; + + ApiKeyCredential({ + required this.apiKey, + }); + + Map toJson() { + final apiKey = this.apiKey; + return { + 'apiKey': apiKey, + }; + } +} + +/// Contains information about an app authorization. +class AppAuthorization { + /// The name of the application. + final String app; + + /// The Amazon Resource Name (ARN) of the app authorization. + final String appAuthorizationArn; + + /// The Amazon Resource Name (ARN) of the app bundle for the app authorization. + final String appBundleArn; + + /// The authorization type. + final AuthType authType; + + /// The timestamp of when the app authorization was created. + final DateTime createdAt; + + /// The state of the app authorization. + /// + /// The following states are possible: + /// + ///
      + ///
    • + /// PendingConnect: The initial state of the app authorization. The + /// app authorization is created but not yet connected. + ///
    • + ///
    • + /// Connected: The app authorization is connected to the + /// application, and is ready to be used. + ///
    • + ///
    • + /// ConnectionValidationFailed: The app authorization received a + /// validation exception when trying to connect to the application. If the app + /// authorization is in this state, you should verify the configured credentials + /// and try to connect the app authorization again. + ///
    • + ///
    • + /// TokenAutoRotationFailed: AppFabric failed to refresh the access + /// token. If the app authorization is in this state, you should try to + /// reconnect the app authorization. + ///
    • + ///
    + final AppAuthorizationStatus status; + + /// Contains information about an application tenant, such as the application + /// display name and identifier. + final Tenant tenant; + + /// The timestamp of when the app authorization was last updated. + final DateTime updatedAt; + + /// The application URL for the OAuth flow. + final String? authUrl; + + /// The user persona of the app authorization. + /// + /// This field should always be admin. + final Persona? persona; + + AppAuthorization({ + required this.app, + required this.appAuthorizationArn, + required this.appBundleArn, + required this.authType, + required this.createdAt, + required this.status, + required this.tenant, + required this.updatedAt, + this.authUrl, + this.persona, + }); + + factory AppAuthorization.fromJson(Map json) { + return AppAuthorization( + app: json['app'] as String, + appAuthorizationArn: json['appAuthorizationArn'] as String, + appBundleArn: json['appBundleArn'] as String, + authType: (json['authType'] as String).toAuthType(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + status: (json['status'] as String).toAppAuthorizationStatus(), + tenant: Tenant.fromJson(json['tenant'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + authUrl: json['authUrl'] as String?, + persona: (json['persona'] as String?)?.toPersona(), + ); + } + + Map toJson() { + final app = this.app; + final appAuthorizationArn = this.appAuthorizationArn; + final appBundleArn = this.appBundleArn; + final authType = this.authType; + final createdAt = this.createdAt; + final status = this.status; + final tenant = this.tenant; + final updatedAt = this.updatedAt; + final authUrl = this.authUrl; + final persona = this.persona; + return { + 'app': app, + 'appAuthorizationArn': appAuthorizationArn, + 'appBundleArn': appBundleArn, + 'authType': authType.toValue(), + 'createdAt': iso8601ToJson(createdAt), + 'status': status.toValue(), + 'tenant': tenant, + 'updatedAt': iso8601ToJson(updatedAt), + if (authUrl != null) 'authUrl': authUrl, + if (persona != null) 'persona': persona.toValue(), + }; + } +} + +enum AppAuthorizationStatus { + pendingConnect, + connected, + connectionValidationFailed, + tokenAutoRotationFailed, +} + +extension AppAuthorizationStatusValueExtension on AppAuthorizationStatus { + String toValue() { + switch (this) { + case AppAuthorizationStatus.pendingConnect: + return 'PendingConnect'; + case AppAuthorizationStatus.connected: + return 'Connected'; + case AppAuthorizationStatus.connectionValidationFailed: + return 'ConnectionValidationFailed'; + case AppAuthorizationStatus.tokenAutoRotationFailed: + return 'TokenAutoRotationFailed'; + } + } +} + +extension AppAuthorizationStatusFromString on String { + AppAuthorizationStatus toAppAuthorizationStatus() { + switch (this) { + case 'PendingConnect': + return AppAuthorizationStatus.pendingConnect; + case 'Connected': + return AppAuthorizationStatus.connected; + case 'ConnectionValidationFailed': + return AppAuthorizationStatus.connectionValidationFailed; + case 'TokenAutoRotationFailed': + return AppAuthorizationStatus.tokenAutoRotationFailed; + } + throw Exception('$this is not known in enum AppAuthorizationStatus'); + } +} + +/// Contains a summary of an app authorization. +class AppAuthorizationSummary { + /// The name of the application. + final String app; + + /// The Amazon Resource Name (ARN) of the app authorization. + final String appAuthorizationArn; + + /// The Amazon Resource Name (ARN) of the app bundle for the app authorization. + final String appBundleArn; + + /// The state of the app authorization. + /// + /// The following states are possible: + /// + ///
      + ///
    • + /// PendingConnect: The initial state of the app authorization. The + /// app authorization is created but not yet connected. + ///
    • + ///
    • + /// Connected: The app authorization is connected to the + /// application, and is ready to be used. + ///
    • + ///
    • + /// ConnectionValidationFailed: The app authorization received a + /// validation exception when trying to connect to the application. If the app + /// authorization is in this state, you should verify the configured credentials + /// and try to connect the app authorization again. + ///
    • + ///
    • + /// TokenAutoRotationFailed: AppFabric failed to refresh the access + /// token. If the app authorization is in this state, you should try to + /// reconnect the app authorization. + ///
    • + ///
    + final AppAuthorizationStatus status; + + /// Contains information about an application tenant, such as the application + /// display name and identifier. + final Tenant tenant; + + /// Timestamp for when the app authorization was last updated. + final DateTime updatedAt; + + AppAuthorizationSummary({ + required this.app, + required this.appAuthorizationArn, + required this.appBundleArn, + required this.status, + required this.tenant, + required this.updatedAt, + }); + + factory AppAuthorizationSummary.fromJson(Map json) { + return AppAuthorizationSummary( + app: json['app'] as String, + appAuthorizationArn: json['appAuthorizationArn'] as String, + appBundleArn: json['appBundleArn'] as String, + status: (json['status'] as String).toAppAuthorizationStatus(), + tenant: Tenant.fromJson(json['tenant'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + ); + } + + Map toJson() { + final app = this.app; + final appAuthorizationArn = this.appAuthorizationArn; + final appBundleArn = this.appBundleArn; + final status = this.status; + final tenant = this.tenant; + final updatedAt = this.updatedAt; + return { + 'app': app, + 'appAuthorizationArn': appAuthorizationArn, + 'appBundleArn': appBundleArn, + 'status': status.toValue(), + 'tenant': tenant, + 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// Contains information about an app bundle. +class AppBundle { + /// The Amazon Resource Name (ARN) of the app bundle. + final String arn; + + /// The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used + /// to encrypt the application data. + final String? customerManagedKeyArn; + + AppBundle({ + required this.arn, + this.customerManagedKeyArn, + }); + + factory AppBundle.fromJson(Map json) { + return AppBundle( + arn: json['arn'] as String, + customerManagedKeyArn: json['customerManagedKeyArn'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final customerManagedKeyArn = this.customerManagedKeyArn; + return { + 'arn': arn, + if (customerManagedKeyArn != null) + 'customerManagedKeyArn': customerManagedKeyArn, + }; + } +} + +/// Contains a summary of an app bundle. +class AppBundleSummary { + /// The Amazon Resource Name (ARN) of the app bundle. + final String arn; + + AppBundleSummary({ + required this.arn, + }); + + factory AppBundleSummary.fromJson(Map json) { + return AppBundleSummary( + arn: json['arn'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + return { + 'arn': arn, + }; + } +} + +/// Contains information about an audit log destination configuration. +class AuditLogDestinationConfiguration { + /// Contains information about an audit log destination. + final Destination destination; + + AuditLogDestinationConfiguration({ + required this.destination, + }); + + factory AuditLogDestinationConfiguration.fromJson(Map json) { + return AuditLogDestinationConfiguration( + destination: + Destination.fromJson(json['destination'] as Map), + ); + } + + Map toJson() { + final destination = this.destination; + return { + 'destination': destination, + }; + } +} + +/// Contains information about an audit log processing configuration. +class AuditLogProcessingConfiguration { + /// The format in which the audit logs need to be formatted. + final Format format; + + /// The event schema in which the audit logs need to be formatted. + final Schema schema; + + AuditLogProcessingConfiguration({ + required this.format, + required this.schema, + }); + + factory AuditLogProcessingConfiguration.fromJson(Map json) { + return AuditLogProcessingConfiguration( + format: (json['format'] as String).toFormat(), + schema: (json['schema'] as String).toSchema(), + ); + } + + Map toJson() { + final format = this.format; + final schema = this.schema; + return { + 'format': format.toValue(), + 'schema': schema.toValue(), + }; + } +} + +/// Contains authorization request information, which is required for Amazon Web +/// Services AppFabric to get the OAuth2 access token for an application. +class AuthRequest { + /// The authorization code returned by the application after permission is + /// granted in the application OAuth page (after clicking on the AuthURL). + final String code; + + /// The redirect URL that is specified in the AuthURL and the application + /// client. + final String redirectUri; + + AuthRequest({ + required this.code, + required this.redirectUri, + }); + + Map toJson() { + final code = this.code; + final redirectUri = this.redirectUri; + return { + 'code': code, + 'redirectUri': redirectUri, + }; + } +} + +enum AuthType { + oauth2, + apiKey, +} + +extension AuthTypeValueExtension on AuthType { + String toValue() { + switch (this) { + case AuthType.oauth2: + return 'oauth2'; + case AuthType.apiKey: + return 'apiKey'; + } + } +} + +extension AuthTypeFromString on String { + AuthType toAuthType() { + switch (this) { + case 'oauth2': + return AuthType.oauth2; + case 'apiKey': + return AuthType.apiKey; + } + throw Exception('$this is not known in enum AuthType'); + } +} + +class BatchGetUserAccessTasksResponse { + /// Contains a list of user access results. + final List? userAccessResultsList; + + BatchGetUserAccessTasksResponse({ + this.userAccessResultsList, + }); + + factory BatchGetUserAccessTasksResponse.fromJson(Map json) { + return BatchGetUserAccessTasksResponse( + userAccessResultsList: (json['userAccessResultsList'] as List?) + ?.whereNotNull() + .map((e) => UserAccessResultItem.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final userAccessResultsList = this.userAccessResultsList; + return { + if (userAccessResultsList != null) + 'userAccessResultsList': userAccessResultsList, + }; + } +} + +class ConnectAppAuthorizationResponse { + /// Contains a summary of the app authorization. + final AppAuthorizationSummary appAuthorizationSummary; + + ConnectAppAuthorizationResponse({ + required this.appAuthorizationSummary, + }); + + factory ConnectAppAuthorizationResponse.fromJson(Map json) { + return ConnectAppAuthorizationResponse( + appAuthorizationSummary: AppAuthorizationSummary.fromJson( + json['appAuthorizationSummary'] as Map), + ); + } + + Map toJson() { + final appAuthorizationSummary = this.appAuthorizationSummary; + return { + 'appAuthorizationSummary': appAuthorizationSummary, + }; + } +} + +class CreateAppAuthorizationResponse { + /// Contains information about an app authorization. + final AppAuthorization appAuthorization; + + CreateAppAuthorizationResponse({ + required this.appAuthorization, + }); + + factory CreateAppAuthorizationResponse.fromJson(Map json) { + return CreateAppAuthorizationResponse( + appAuthorization: AppAuthorization.fromJson( + json['appAuthorization'] as Map), + ); + } + + Map toJson() { + final appAuthorization = this.appAuthorization; + return { + 'appAuthorization': appAuthorization, + }; + } +} + +class CreateAppBundleResponse { + /// Contains information about an app bundle. + final AppBundle appBundle; + + CreateAppBundleResponse({ + required this.appBundle, + }); + + factory CreateAppBundleResponse.fromJson(Map json) { + return CreateAppBundleResponse( + appBundle: AppBundle.fromJson(json['appBundle'] as Map), + ); + } + + Map toJson() { + final appBundle = this.appBundle; + return { + 'appBundle': appBundle, + }; + } +} + +class CreateIngestionDestinationResponse { + /// Contains information about an ingestion destination. + final IngestionDestination ingestionDestination; + + CreateIngestionDestinationResponse({ + required this.ingestionDestination, + }); + + factory CreateIngestionDestinationResponse.fromJson( + Map json) { + return CreateIngestionDestinationResponse( + ingestionDestination: IngestionDestination.fromJson( + json['ingestionDestination'] as Map), + ); + } + + Map toJson() { + final ingestionDestination = this.ingestionDestination; + return { + 'ingestionDestination': ingestionDestination, + }; + } +} + +class CreateIngestionResponse { + /// Contains information about an ingestion. + final Ingestion ingestion; + + CreateIngestionResponse({ + required this.ingestion, + }); + + factory CreateIngestionResponse.fromJson(Map json) { + return CreateIngestionResponse( + ingestion: Ingestion.fromJson(json['ingestion'] as Map), + ); + } + + Map toJson() { + final ingestion = this.ingestion; + return { + 'ingestion': ingestion, + }; + } +} + +/// Contains credential information for an application. +class Credential { + /// Contains API key credential information. + final ApiKeyCredential? apiKeyCredential; + + /// Contains OAuth2 client credential information. + final Oauth2Credential? oauth2Credential; + + Credential({ + this.apiKeyCredential, + this.oauth2Credential, + }); + + Map toJson() { + final apiKeyCredential = this.apiKeyCredential; + final oauth2Credential = this.oauth2Credential; + return { + if (apiKeyCredential != null) 'apiKeyCredential': apiKeyCredential, + if (oauth2Credential != null) 'oauth2Credential': oauth2Credential, + }; + } +} + +class DeleteAppAuthorizationResponse { + DeleteAppAuthorizationResponse(); + + factory DeleteAppAuthorizationResponse.fromJson(Map _) { + return DeleteAppAuthorizationResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteAppBundleResponse { + DeleteAppBundleResponse(); + + factory DeleteAppBundleResponse.fromJson(Map _) { + return DeleteAppBundleResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteIngestionDestinationResponse { + DeleteIngestionDestinationResponse(); + + factory DeleteIngestionDestinationResponse.fromJson(Map _) { + return DeleteIngestionDestinationResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteIngestionResponse { + DeleteIngestionResponse(); + + factory DeleteIngestionResponse.fromJson(Map _) { + return DeleteIngestionResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Contains information about an audit log destination. +class Destination { + /// Contains information about an Amazon Kinesis Data Firehose delivery stream. + final FirehoseStream? firehoseStream; + + /// Contains information about an Amazon S3 bucket. + final S3Bucket? s3Bucket; + + Destination({ + this.firehoseStream, + this.s3Bucket, + }); + + factory Destination.fromJson(Map json) { + return Destination( + firehoseStream: json['firehoseStream'] != null + ? FirehoseStream.fromJson( + json['firehoseStream'] as Map) + : null, + s3Bucket: json['s3Bucket'] != null + ? S3Bucket.fromJson(json['s3Bucket'] as Map) + : null, + ); + } + + Map toJson() { + final firehoseStream = this.firehoseStream; + final s3Bucket = this.s3Bucket; + return { + if (firehoseStream != null) 'firehoseStream': firehoseStream, + if (s3Bucket != null) 's3Bucket': s3Bucket, + }; + } +} + +/// Contains information about the destination of ingested data. +class DestinationConfiguration { + /// Contains information about an audit log destination configuration. + final AuditLogDestinationConfiguration? auditLog; + + DestinationConfiguration({ + this.auditLog, + }); + + factory DestinationConfiguration.fromJson(Map json) { + return DestinationConfiguration( + auditLog: json['auditLog'] != null + ? AuditLogDestinationConfiguration.fromJson( + json['auditLog'] as Map) + : null, + ); + } + + Map toJson() { + final auditLog = this.auditLog; + return { + if (auditLog != null) 'auditLog': auditLog, + }; + } +} + +/// Contains information about an Amazon Kinesis Data Firehose delivery stream. +class FirehoseStream { + /// The name of the Amazon Kinesis Data Firehose delivery stream. + final String streamName; + + FirehoseStream({ + required this.streamName, + }); + + factory FirehoseStream.fromJson(Map json) { + return FirehoseStream( + streamName: json['streamName'] as String, + ); + } + + Map toJson() { + final streamName = this.streamName; + return { + 'streamName': streamName, + }; + } +} + +enum Format { + json, + parquet, +} + +extension FormatValueExtension on Format { + String toValue() { + switch (this) { + case Format.json: + return 'json'; + case Format.parquet: + return 'parquet'; + } + } +} + +extension FormatFromString on String { + Format toFormat() { + switch (this) { + case 'json': + return Format.json; + case 'parquet': + return Format.parquet; + } + throw Exception('$this is not known in enum Format'); + } +} + +class GetAppAuthorizationResponse { + /// Contains information about an app authorization. + final AppAuthorization appAuthorization; + + GetAppAuthorizationResponse({ + required this.appAuthorization, + }); + + factory GetAppAuthorizationResponse.fromJson(Map json) { + return GetAppAuthorizationResponse( + appAuthorization: AppAuthorization.fromJson( + json['appAuthorization'] as Map), + ); + } + + Map toJson() { + final appAuthorization = this.appAuthorization; + return { + 'appAuthorization': appAuthorization, + }; + } +} + +class GetAppBundleResponse { + /// Contains information about an app bundle. + final AppBundle appBundle; + + GetAppBundleResponse({ + required this.appBundle, + }); + + factory GetAppBundleResponse.fromJson(Map json) { + return GetAppBundleResponse( + appBundle: AppBundle.fromJson(json['appBundle'] as Map), + ); + } + + Map toJson() { + final appBundle = this.appBundle; + return { + 'appBundle': appBundle, + }; + } +} + +class GetIngestionDestinationResponse { + /// Contains information about an ingestion destination. + final IngestionDestination ingestionDestination; + + GetIngestionDestinationResponse({ + required this.ingestionDestination, + }); + + factory GetIngestionDestinationResponse.fromJson(Map json) { + return GetIngestionDestinationResponse( + ingestionDestination: IngestionDestination.fromJson( + json['ingestionDestination'] as Map), + ); + } + + Map toJson() { + final ingestionDestination = this.ingestionDestination; + return { + 'ingestionDestination': ingestionDestination, + }; + } +} + +class GetIngestionResponse { + /// Contains information about an ingestion. + final Ingestion ingestion; + + GetIngestionResponse({ + required this.ingestion, + }); + + factory GetIngestionResponse.fromJson(Map json) { + return GetIngestionResponse( + ingestion: Ingestion.fromJson(json['ingestion'] as Map), + ); + } + + Map toJson() { + final ingestion = this.ingestion; + return { + 'ingestion': ingestion, + }; + } +} + +/// Contains information about an ingestion. +class Ingestion { + /// The name of the application. + final String app; + + /// The Amazon Resource Name (ARN) of the app bundle for the ingestion. + final String appBundleArn; + + /// The Amazon Resource Name (ARN) of the ingestion. + final String arn; + + /// The timestamp of when the ingestion was created. + final DateTime createdAt; + + /// The type of the ingestion. + final IngestionType ingestionType; + + /// The status of the ingestion. + final IngestionState state; + + /// The ID of the application tenant. + final String tenantId; + + /// The timestamp of when the ingestion was last updated. + final DateTime updatedAt; + + Ingestion({ + required this.app, + required this.appBundleArn, + required this.arn, + required this.createdAt, + required this.ingestionType, + required this.state, + required this.tenantId, + required this.updatedAt, + }); + + factory Ingestion.fromJson(Map json) { + return Ingestion( + app: json['app'] as String, + appBundleArn: json['appBundleArn'] as String, + arn: json['arn'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + ingestionType: (json['ingestionType'] as String).toIngestionType(), + state: (json['state'] as String).toIngestionState(), + tenantId: json['tenantId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + ); + } + + Map toJson() { + final app = this.app; + final appBundleArn = this.appBundleArn; + final arn = this.arn; + final createdAt = this.createdAt; + final ingestionType = this.ingestionType; + final state = this.state; + final tenantId = this.tenantId; + final updatedAt = this.updatedAt; + return { + 'app': app, + 'appBundleArn': appBundleArn, + 'arn': arn, + 'createdAt': iso8601ToJson(createdAt), + 'ingestionType': ingestionType.toValue(), + 'state': state.toValue(), + 'tenantId': tenantId, + 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// Contains information about an ingestion destination. +class IngestionDestination { + /// The Amazon Resource Name (ARN) of the ingestion destination. + final String arn; + + /// Contains information about the destination of ingested data. + final DestinationConfiguration destinationConfiguration; + + /// The Amazon Resource Name (ARN) of the ingestion. + final String ingestionArn; + + /// Contains information about how ingested data is processed. + final ProcessingConfiguration processingConfiguration; + + /// The timestamp of when the ingestion destination was created. + final DateTime? createdAt; + + /// The state of the ingestion destination. + /// + /// The following states are possible: + /// + ///
      + ///
    • + /// Active: The ingestion destination is active and is ready to be + /// used. + ///
    • + ///
    • + /// Failed: The ingestion destination has failed. If the ingestion + /// destination is in this state, you should verify the ingestion destination + /// configuration and try again. + ///
    • + ///
    + final IngestionDestinationStatus? status; + + /// The reason for the current status of the ingestion destination. + /// + /// Only present when the status of ingestion destination is + /// Failed. + final String? statusReason; + + /// The timestamp of when the ingestion destination was last updated. + final DateTime? updatedAt; + + IngestionDestination({ + required this.arn, + required this.destinationConfiguration, + required this.ingestionArn, + required this.processingConfiguration, + this.createdAt, + this.status, + this.statusReason, + this.updatedAt, + }); + + factory IngestionDestination.fromJson(Map json) { + return IngestionDestination( + arn: json['arn'] as String, + destinationConfiguration: DestinationConfiguration.fromJson( + json['destinationConfiguration'] as Map), + ingestionArn: json['ingestionArn'] as String, + processingConfiguration: ProcessingConfiguration.fromJson( + json['processingConfiguration'] as Map), + createdAt: timeStampFromJson(json['createdAt']), + status: (json['status'] as String?)?.toIngestionDestinationStatus(), + statusReason: json['statusReason'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final arn = this.arn; + final destinationConfiguration = this.destinationConfiguration; + final ingestionArn = this.ingestionArn; + final processingConfiguration = this.processingConfiguration; + final createdAt = this.createdAt; + final status = this.status; + final statusReason = this.statusReason; + final updatedAt = this.updatedAt; + return { + 'arn': arn, + 'destinationConfiguration': destinationConfiguration, + 'ingestionArn': ingestionArn, + 'processingConfiguration': processingConfiguration, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (status != null) 'status': status.toValue(), + if (statusReason != null) 'statusReason': statusReason, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +enum IngestionDestinationStatus { + active, + failed, +} + +extension IngestionDestinationStatusValueExtension + on IngestionDestinationStatus { + String toValue() { + switch (this) { + case IngestionDestinationStatus.active: + return 'Active'; + case IngestionDestinationStatus.failed: + return 'Failed'; + } + } +} + +extension IngestionDestinationStatusFromString on String { + IngestionDestinationStatus toIngestionDestinationStatus() { + switch (this) { + case 'Active': + return IngestionDestinationStatus.active; + case 'Failed': + return IngestionDestinationStatus.failed; + } + throw Exception('$this is not known in enum IngestionDestinationStatus'); + } +} + +/// Contains a summary of an ingestion destination. +class IngestionDestinationSummary { + /// The Amazon Resource Name (ARN) of the ingestion destination. + final String arn; + + IngestionDestinationSummary({ + required this.arn, + }); + + factory IngestionDestinationSummary.fromJson(Map json) { + return IngestionDestinationSummary( + arn: json['arn'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + return { + 'arn': arn, + }; + } +} + +enum IngestionState { + enabled, + disabled, +} + +extension IngestionStateValueExtension on IngestionState { + String toValue() { + switch (this) { + case IngestionState.enabled: + return 'enabled'; + case IngestionState.disabled: + return 'disabled'; + } + } +} + +extension IngestionStateFromString on String { + IngestionState toIngestionState() { + switch (this) { + case 'enabled': + return IngestionState.enabled; + case 'disabled': + return IngestionState.disabled; + } + throw Exception('$this is not known in enum IngestionState'); + } +} + +/// Contains a summary of an ingestion. +class IngestionSummary { + /// The name of the application. + final String app; + + /// The Amazon Resource Name (ARN) of the ingestion. + final String arn; + + /// The status of the ingestion. + final IngestionState state; + + /// The ID of the application tenant. + final String tenantId; + + IngestionSummary({ + required this.app, + required this.arn, + required this.state, + required this.tenantId, + }); + + factory IngestionSummary.fromJson(Map json) { + return IngestionSummary( + app: json['app'] as String, + arn: json['arn'] as String, + state: (json['state'] as String).toIngestionState(), + tenantId: json['tenantId'] as String, + ); + } + + Map toJson() { + final app = this.app; + final arn = this.arn; + final state = this.state; + final tenantId = this.tenantId; + return { + 'app': app, + 'arn': arn, + 'state': state.toValue(), + 'tenantId': tenantId, + }; + } +} + +enum IngestionType { + auditLog, +} + +extension IngestionTypeValueExtension on IngestionType { + String toValue() { + switch (this) { + case IngestionType.auditLog: + return 'auditLog'; + } + } +} + +extension IngestionTypeFromString on String { + IngestionType toIngestionType() { + switch (this) { + case 'auditLog': + return IngestionType.auditLog; + } + throw Exception('$this is not known in enum IngestionType'); + } +} + +class ListAppAuthorizationsResponse { + /// Contains a list of app authorization summaries. + final List appAuthorizationSummaryList; + + /// If nextToken is returned, there are more results available. The + /// value of nextToken is a unique pagination token for each page. + /// Make the call again using the returned token to retrieve the next page. Keep + /// all other arguments unchanged. Each pagination token expires after 24 hours. + /// Using an expired pagination token will return an HTTP 400 InvalidToken + /// error. + final String? nextToken; + + ListAppAuthorizationsResponse({ + required this.appAuthorizationSummaryList, + this.nextToken, + }); + + factory ListAppAuthorizationsResponse.fromJson(Map json) { + return ListAppAuthorizationsResponse( + appAuthorizationSummaryList: (json['appAuthorizationSummaryList'] as List) + .whereNotNull() + .map((e) => + AppAuthorizationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final appAuthorizationSummaryList = this.appAuthorizationSummaryList; + final nextToken = this.nextToken; + return { + 'appAuthorizationSummaryList': appAuthorizationSummaryList, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAppBundlesResponse { + /// Contains a list of app bundle summaries. + final List appBundleSummaryList; + + /// If nextToken is returned, there are more results available. The + /// value of nextToken is a unique pagination token for each page. + /// Make the call again using the returned token to retrieve the next page. Keep + /// all other arguments unchanged. Each pagination token expires after 24 hours. + /// Using an expired pagination token will return an HTTP 400 InvalidToken + /// error. + final String? nextToken; + + ListAppBundlesResponse({ + required this.appBundleSummaryList, + this.nextToken, + }); + + factory ListAppBundlesResponse.fromJson(Map json) { + return ListAppBundlesResponse( + appBundleSummaryList: (json['appBundleSummaryList'] as List) + .whereNotNull() + .map((e) => AppBundleSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final appBundleSummaryList = this.appBundleSummaryList; + final nextToken = this.nextToken; + return { + 'appBundleSummaryList': appBundleSummaryList, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListIngestionDestinationsResponse { + /// Contains a list of ingestion destination summaries. + final List ingestionDestinations; + + /// If nextToken is returned, there are more results available. The + /// value of nextToken is a unique pagination token for each page. + /// Make the call again using the returned token to retrieve the next page. Keep + /// all other arguments unchanged. Each pagination token expires after 24 hours. + /// Using an expired pagination token will return an HTTP 400 InvalidToken + /// error. + final String? nextToken; + + ListIngestionDestinationsResponse({ + required this.ingestionDestinations, + this.nextToken, + }); + + factory ListIngestionDestinationsResponse.fromJson( + Map json) { + return ListIngestionDestinationsResponse( + ingestionDestinations: (json['ingestionDestinations'] as List) + .whereNotNull() + .map((e) => + IngestionDestinationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final ingestionDestinations = this.ingestionDestinations; + final nextToken = this.nextToken; + return { + 'ingestionDestinations': ingestionDestinations, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListIngestionsResponse { + /// Contains a list of ingestion summaries. + final List ingestions; + + /// If nextToken is returned, there are more results available. The + /// value of nextToken is a unique pagination token for each page. + /// Make the call again using the returned token to retrieve the next page. Keep + /// all other arguments unchanged. Each pagination token expires after 24 hours. + /// Using an expired pagination token will return an HTTP 400 InvalidToken + /// error. + final String? nextToken; + + ListIngestionsResponse({ + required this.ingestions, + this.nextToken, + }); + + factory ListIngestionsResponse.fromJson(Map json) { + return ListIngestionsResponse( + ingestions: (json['ingestions'] as List) + .whereNotNull() + .map((e) => IngestionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final ingestions = this.ingestions; + final nextToken = this.nextToken; + return { + 'ingestions': ingestions, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// A map of the key-value pairs for the tag or tags assigned to the specified + /// resource. + final List? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +/// Contains OAuth2 client credential information. +class Oauth2Credential { + /// The client ID of the client application. + final String clientId; + + /// The client secret of the client application. + final String clientSecret; + + Oauth2Credential({ + required this.clientId, + required this.clientSecret, + }); + + Map toJson() { + final clientId = this.clientId; + final clientSecret = this.clientSecret; + return { + 'clientId': clientId, + 'clientSecret': clientSecret, + }; + } +} + +enum Persona { + admin, + endUser, +} + +extension PersonaValueExtension on Persona { + String toValue() { + switch (this) { + case Persona.admin: + return 'admin'; + case Persona.endUser: + return 'endUser'; + } + } +} + +extension PersonaFromString on String { + Persona toPersona() { + switch (this) { + case 'admin': + return Persona.admin; + case 'endUser': + return Persona.endUser; + } + throw Exception('$this is not known in enum Persona'); + } +} + +/// Contains information about how ingested data is processed. +class ProcessingConfiguration { + /// Contains information about an audit log processing configuration. + final AuditLogProcessingConfiguration? auditLog; + + ProcessingConfiguration({ + this.auditLog, + }); + + factory ProcessingConfiguration.fromJson(Map json) { + return ProcessingConfiguration( + auditLog: json['auditLog'] != null + ? AuditLogProcessingConfiguration.fromJson( + json['auditLog'] as Map) + : null, + ); + } + + Map toJson() { + final auditLog = this.auditLog; + return { + if (auditLog != null) 'auditLog': auditLog, + }; + } +} + +enum ResultStatus { + inProgress, + completed, + failed, + expired, +} + +extension ResultStatusValueExtension on ResultStatus { + String toValue() { + switch (this) { + case ResultStatus.inProgress: + return 'IN_PROGRESS'; + case ResultStatus.completed: + return 'COMPLETED'; + case ResultStatus.failed: + return 'FAILED'; + case ResultStatus.expired: + return 'EXPIRED'; + } + } +} + +extension ResultStatusFromString on String { + ResultStatus toResultStatus() { + switch (this) { + case 'IN_PROGRESS': + return ResultStatus.inProgress; + case 'COMPLETED': + return ResultStatus.completed; + case 'FAILED': + return ResultStatus.failed; + case 'EXPIRED': + return ResultStatus.expired; + } + throw Exception('$this is not known in enum ResultStatus'); + } +} + +/// Contains information about an Amazon S3 bucket. +class S3Bucket { + /// The name of the Amazon S3 bucket. + final String bucketName; + + /// The object key to use. + final String? prefix; + + S3Bucket({ + required this.bucketName, + this.prefix, + }); + + factory S3Bucket.fromJson(Map json) { + return S3Bucket( + bucketName: json['bucketName'] as String, + prefix: json['prefix'] as String?, + ); + } + + Map toJson() { + final bucketName = this.bucketName; + final prefix = this.prefix; + return { + 'bucketName': bucketName, + if (prefix != null) 'prefix': prefix, + }; + } +} + +enum Schema { + ocsf, + raw, +} + +extension SchemaValueExtension on Schema { + String toValue() { + switch (this) { + case Schema.ocsf: + return 'ocsf'; + case Schema.raw: + return 'raw'; + } + } +} + +extension SchemaFromString on String { + Schema toSchema() { + switch (this) { + case 'ocsf': + return Schema.ocsf; + case 'raw': + return Schema.raw; + } + throw Exception('$this is not known in enum Schema'); + } +} + +class StartIngestionResponse { + StartIngestionResponse(); + + factory StartIngestionResponse.fromJson(Map _) { + return StartIngestionResponse(); + } + + Map toJson() { + return {}; + } +} + +class StartUserAccessTasksResponse { + /// Contains a list of user access task information. + final List? userAccessTasksList; + + StartUserAccessTasksResponse({ + this.userAccessTasksList, + }); + + factory StartUserAccessTasksResponse.fromJson(Map json) { + return StartUserAccessTasksResponse( + userAccessTasksList: (json['userAccessTasksList'] as List?) + ?.whereNotNull() + .map((e) => UserAccessTaskItem.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final userAccessTasksList = this.userAccessTasksList; + return { + if (userAccessTasksList != null) + 'userAccessTasksList': userAccessTasksList, + }; + } +} + +class StopIngestionResponse { + StopIngestionResponse(); + + factory StopIngestionResponse.fromJson(Map _) { + return StopIngestionResponse(); + } + + Map toJson() { + return {}; + } +} + +/// The key or keys of the key-value pairs for the tag or tags assigned to a +/// resource. +class Tag { + /// Tag key. + final String key; + + /// Tag value. + final String value; + + Tag({ + required this.key, + required this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['key'] as String, + value: json['value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Contains information about an error returned from a user access task. +class TaskError { + /// The code of the error. + final String? errorCode; + + /// The message of the error. + final String? errorMessage; + + TaskError({ + this.errorCode, + this.errorMessage, + }); + + factory TaskError.fromJson(Map json) { + return TaskError( + errorCode: json['errorCode'] as String?, + errorMessage: json['errorMessage'] as String?, + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; + return { + if (errorCode != null) 'errorCode': errorCode, + if (errorMessage != null) 'errorMessage': errorMessage, + }; + } +} + +/// Contains information about an application tenant. +class Tenant { + /// The display name of the tenant. + final String tenantDisplayName; + + /// The ID of the application tenant. + final String tenantIdentifier; + + Tenant({ + required this.tenantDisplayName, + required this.tenantIdentifier, + }); + + factory Tenant.fromJson(Map json) { + return Tenant( + tenantDisplayName: json['tenantDisplayName'] as String, + tenantIdentifier: json['tenantIdentifier'] as String, + ); + } + + Map toJson() { + final tenantDisplayName = this.tenantDisplayName; + final tenantIdentifier = this.tenantIdentifier; + return { + 'tenantDisplayName': tenantDisplayName, + 'tenantIdentifier': tenantIdentifier, + }; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateAppAuthorizationResponse { + /// Contains information about an app authorization. + final AppAuthorization appAuthorization; + + UpdateAppAuthorizationResponse({ + required this.appAuthorization, + }); + + factory UpdateAppAuthorizationResponse.fromJson(Map json) { + return UpdateAppAuthorizationResponse( + appAuthorization: AppAuthorization.fromJson( + json['appAuthorization'] as Map), + ); + } + + Map toJson() { + final appAuthorization = this.appAuthorization; + return { + 'appAuthorization': appAuthorization, + }; + } +} + +class UpdateIngestionDestinationResponse { + /// Contains information about an ingestion destination. + final IngestionDestination ingestionDestination; + + UpdateIngestionDestinationResponse({ + required this.ingestionDestination, + }); + + factory UpdateIngestionDestinationResponse.fromJson( + Map json) { + return UpdateIngestionDestinationResponse( + ingestionDestination: IngestionDestination.fromJson( + json['ingestionDestination'] as Map), + ); + } + + Map toJson() { + final ingestionDestination = this.ingestionDestination; + return { + 'ingestionDestination': ingestionDestination, + }; + } +} + +/// Contains information about a user's access to an application. +class UserAccessResultItem { + /// The name of the application. + final String? app; + + /// The email address of the target user. + final String? email; + + /// The status of the user access result item. + /// + /// The following states are possible: + /// + ///
      + ///
    • + /// IN_PROGRESS: The user access task is in progress. + ///
    • + ///
    • + /// COMPLETED: The user access task completed successfully. + ///
    • + ///
    • + /// FAILED: The user access task failed. + ///
    • + ///
    • + /// EXPIRED: The user access task expired. + ///
    • + ///
    + final ResultStatus? resultStatus; + + /// Contains information about an error returned from a user access task. + final TaskError? taskError; + + /// The unique ID of the task. + final String? taskId; + + /// The display name of the tenant. + final String? tenantDisplayName; + + /// The ID of the application tenant. + final String? tenantId; + + /// The first name of the user. + final String? userFirstName; + + /// The full name of the user. + final String? userFullName; + + /// The unique ID of user. + final String? userId; + + /// The last name of the user. + final String? userLastName; + + /// The status of the user returned by the application. + final String? userStatus; + + UserAccessResultItem({ + this.app, + this.email, + this.resultStatus, + this.taskError, + this.taskId, + this.tenantDisplayName, + this.tenantId, + this.userFirstName, + this.userFullName, + this.userId, + this.userLastName, + this.userStatus, + }); + + factory UserAccessResultItem.fromJson(Map json) { + return UserAccessResultItem( + app: json['app'] as String?, + email: json['email'] as String?, + resultStatus: (json['resultStatus'] as String?)?.toResultStatus(), + taskError: json['taskError'] != null + ? TaskError.fromJson(json['taskError'] as Map) + : null, + taskId: json['taskId'] as String?, + tenantDisplayName: json['tenantDisplayName'] as String?, + tenantId: json['tenantId'] as String?, + userFirstName: json['userFirstName'] as String?, + userFullName: json['userFullName'] as String?, + userId: json['userId'] as String?, + userLastName: json['userLastName'] as String?, + userStatus: json['userStatus'] as String?, + ); + } + + Map toJson() { + final app = this.app; + final email = this.email; + final resultStatus = this.resultStatus; + final taskError = this.taskError; + final taskId = this.taskId; + final tenantDisplayName = this.tenantDisplayName; + final tenantId = this.tenantId; + final userFirstName = this.userFirstName; + final userFullName = this.userFullName; + final userId = this.userId; + final userLastName = this.userLastName; + final userStatus = this.userStatus; + return { + if (app != null) 'app': app, + if (email != null) 'email': email, + if (resultStatus != null) 'resultStatus': resultStatus.toValue(), + if (taskError != null) 'taskError': taskError, + if (taskId != null) 'taskId': taskId, + if (tenantDisplayName != null) 'tenantDisplayName': tenantDisplayName, + if (tenantId != null) 'tenantId': tenantId, + if (userFirstName != null) 'userFirstName': userFirstName, + if (userFullName != null) 'userFullName': userFullName, + if (userId != null) 'userId': userId, + if (userLastName != null) 'userLastName': userLastName, + if (userStatus != null) 'userStatus': userStatus, + }; + } +} + +/// Contains information about a user access task. +class UserAccessTaskItem { + /// The name of the application. + final String app; + + /// The ID of the application tenant. + final String tenantId; + + /// Error from the task, if any. + final TaskError? error; + + /// The unique ID of the task. + final String? taskId; + + UserAccessTaskItem({ + required this.app, + required this.tenantId, + this.error, + this.taskId, + }); + + factory UserAccessTaskItem.fromJson(Map json) { + return UserAccessTaskItem( + app: json['app'] as String, + tenantId: json['tenantId'] as String, + error: json['error'] != null + ? TaskError.fromJson(json['error'] as Map) + : null, + taskId: json['taskId'] as String?, + ); + } + + Map toJson() { + final app = this.app; + final tenantId = this.tenantId; + final error = this.error; + final taskId = this.taskId; + return { + 'app': app, + 'tenantId': tenantId, + if (error != null) 'error': error, + if (taskId != null) 'taskId': taskId, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/app_integrations/v2020_07_29.dart b/aws_client/lib/src/generated/app_integrations/v2020_07_29.dart index 457c002da..48d46511e 100644 --- a/aws_client/lib/src/generated/app_integrations/v2020_07_29.dart +++ b/aws_client/lib/src/generated/app_integrations/v2020_07_29.dart @@ -58,6 +58,81 @@ class AppIntegrations { _protocol.close(); } + /// This API is in preview release and subject to change. + /// + /// Creates and persists an Application resource. + /// + /// May throw [InternalServiceError]. + /// May throw [ResourceQuotaExceededException]. + /// May throw [DuplicateResourceException]. + /// May throw [ThrottlingException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [UnsupportedOperationException]. + /// + /// Parameter [applicationSourceConfig] : + /// The configuration for where the application should be loaded from. + /// + /// Parameter [name] : + /// The name of the application. + /// + /// Parameter [namespace] : + /// The namespace of the application. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [description] : + /// The description of the application. + /// + /// Parameter [permissions] : + /// The configuration of events or requests that the application has access + /// to. + /// + /// Parameter [publications] : + /// The events that the application publishes. + /// + /// Parameter [subscriptions] : + /// The events that the application subscribes. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + Future createApplication({ + required ApplicationSourceConfig applicationSourceConfig, + required String name, + required String namespace, + String? clientToken, + String? description, + List? permissions, + List? publications, + List? subscriptions, + Map? tags, + }) async { + final $payload = { + 'ApplicationSourceConfig': applicationSourceConfig, + 'Name': name, + 'Namespace': namespace, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'Description': description, + if (permissions != null) 'Permissions': permissions, + if (publications != null) 'Publications': publications, + if (subscriptions != null) 'Subscriptions': subscriptions, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/applications', + exceptionFnMap: _exceptionFns, + ); + return CreateApplicationResponse.fromJson(response); + } + /// Creates and persists a DataIntegration resource. /// /// You cannot create a DataIntegration association for a DataIntegration that @@ -79,9 +154,6 @@ class AppIntegrations { /// Parameter [name] : /// The name of the DataIntegration. /// - /// Parameter [scheduleConfig] : - /// The name of the data and how often it should be pulled from the source. - /// /// Parameter [sourceURI] : /// The URI of the data source. /// @@ -101,30 +173,33 @@ class AppIntegrations { /// Parameter [objectConfiguration] : /// The configuration for what data should be pulled from the source. /// + /// Parameter [scheduleConfig] : + /// The name of the data and how often it should be pulled from the source. + /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For /// example, { "tags": {"key1":"value1", "key2":"value2"} }. Future createDataIntegration({ required String kmsKey, required String name, - required ScheduleConfiguration scheduleConfig, required String sourceURI, String? clientToken, String? description, FileConfiguration? fileConfiguration, Map>>? objectConfiguration, + ScheduleConfiguration? scheduleConfig, Map? tags, }) async { final $payload = { 'KmsKey': kmsKey, 'Name': name, - 'ScheduleConfig': scheduleConfig, 'SourceURI': sourceURI, 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), if (description != null) 'Description': description, if (fileConfiguration != null) 'FileConfiguration': fileConfiguration, if (objectConfiguration != null) 'ObjectConfiguration': objectConfiguration, + if (scheduleConfig != null) 'ScheduleConfig': scheduleConfig, if (tags != null) 'Tags': tags, }; final response = await _protocol.send( @@ -196,6 +271,28 @@ class AppIntegrations { return CreateEventIntegrationResponse.fromJson(response); } + /// Deletes the Application. Only Applications that don't have any Application + /// Associations can be deleted. + /// + /// May throw [InternalServiceError]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [arn] : + /// The Amazon Resource Name (ARN) of the Application. + Future deleteApplication({ + required String arn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/applications/${Uri.encodeComponent(arn)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes the DataIntegration. Only DataIntegrations that don't have any /// DataIntegrationAssociations can be deleted. Deleting a DataIntegration /// also deletes the underlying Amazon AppFlow flow and service linked role. @@ -249,6 +346,30 @@ class AppIntegrations { ); } + /// This API is in preview release and subject to change. + /// + /// Get an Application resource. + /// + /// May throw [InternalServiceError]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [arn] : + /// The Amazon Resource Name (ARN) of the Application. + Future getApplication({ + required String arn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/applications/${Uri.encodeComponent(arn)}', + exceptionFnMap: _exceptionFns, + ); + return GetApplicationResponse.fromJson(response); + } + /// Returns information about the DataIntegration. /// /// You cannot create a DataIntegration association for a DataIntegration that @@ -300,6 +421,88 @@ class AppIntegrations { return GetEventIntegrationResponse.fromJson(response); } + /// Returns a paginated list of application associations for an application. + /// + /// May throw [InternalServiceError]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [applicationId] : + /// A unique identifier for the Application. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listApplicationAssociations({ + required String applicationId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/applications/${Uri.encodeComponent(applicationId)}/associations', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListApplicationAssociationsResponse.fromJson(response); + } + + /// This API is in preview release and subject to change. + /// + /// Lists applications in the account. + /// + /// May throw [InternalServiceError]. + /// May throw [ThrottlingException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listApplications({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/applications', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListApplicationsResponse.fromJson(response); + } + /// Returns a paginated list of DataIntegration associations in the account. /// /// You cannot create a DataIntegration association for a DataIntegration that @@ -553,6 +756,64 @@ class AppIntegrations { ); } + /// This API is in preview release and subject to change. + /// + /// Updates and persists an Application resource. + /// + /// May throw [InternalServiceError]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [UnsupportedOperationException]. + /// + /// Parameter [arn] : + /// The Amazon Resource Name (ARN) of the Application. + /// + /// Parameter [applicationSourceConfig] : + /// The configuration for where the application should be loaded from. + /// + /// Parameter [description] : + /// The description of the application. + /// + /// Parameter [name] : + /// The name of the application. + /// + /// Parameter [permissions] : + /// The configuration of events or requests that the application has access + /// to. + /// + /// Parameter [publications] : + /// The events that the application publishes. + /// + /// Parameter [subscriptions] : + /// The events that the application subscribes. + Future updateApplication({ + required String arn, + ApplicationSourceConfig? applicationSourceConfig, + String? description, + String? name, + List? permissions, + List? publications, + List? subscriptions, + }) async { + final $payload = { + if (applicationSourceConfig != null) + 'ApplicationSourceConfig': applicationSourceConfig, + if (description != null) 'Description': description, + if (name != null) 'Name': name, + if (permissions != null) 'Permissions': permissions, + if (publications != null) 'Publications': publications, + if (subscriptions != null) 'Subscriptions': subscriptions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/applications/${Uri.encodeComponent(arn)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Updates the description of a DataIntegration. /// /// You cannot create a DataIntegration association for a DataIntegration that @@ -605,7 +866,7 @@ class AppIntegrations { /// The name of the event integration. /// /// Parameter [description] : - /// The description of the event inegration. + /// The description of the event integration. Future updateEventIntegration({ required String name, String? description, @@ -622,6 +883,159 @@ class AppIntegrations { } } +/// Summary information about the Application Association. +class ApplicationAssociationSummary { + /// The Amazon Resource Name (ARN) of the Application. + final String? applicationArn; + + /// The Amazon Resource Name (ARN) of the Application Association. + final String? applicationAssociationArn; + + /// The identifier for the client that is associated with the Application + /// Association. + final String? clientId; + + ApplicationAssociationSummary({ + this.applicationArn, + this.applicationAssociationArn, + this.clientId, + }); + + factory ApplicationAssociationSummary.fromJson(Map json) { + return ApplicationAssociationSummary( + applicationArn: json['ApplicationArn'] as String?, + applicationAssociationArn: json['ApplicationAssociationArn'] as String?, + clientId: json['ClientId'] as String?, + ); + } + + Map toJson() { + final applicationArn = this.applicationArn; + final applicationAssociationArn = this.applicationAssociationArn; + final clientId = this.clientId; + return { + if (applicationArn != null) 'ApplicationArn': applicationArn, + if (applicationAssociationArn != null) + 'ApplicationAssociationArn': applicationAssociationArn, + if (clientId != null) 'ClientId': clientId, + }; + } +} + +/// The configuration for where the application should be loaded from. +class ApplicationSourceConfig { + /// The external URL source for the application. + final ExternalUrlConfig? externalUrlConfig; + + ApplicationSourceConfig({ + this.externalUrlConfig, + }); + + factory ApplicationSourceConfig.fromJson(Map json) { + return ApplicationSourceConfig( + externalUrlConfig: json['ExternalUrlConfig'] != null + ? ExternalUrlConfig.fromJson( + json['ExternalUrlConfig'] as Map) + : null, + ); + } + + Map toJson() { + final externalUrlConfig = this.externalUrlConfig; + return { + if (externalUrlConfig != null) 'ExternalUrlConfig': externalUrlConfig, + }; + } +} + +/// Summary information about the Application. +class ApplicationSummary { + /// The Amazon Resource Name (ARN) of the Application. + final String? arn; + + /// The time when the application was created. + final DateTime? createdTime; + + /// A unique identifier for the Application. + final String? id; + + /// The time when the application was last modified. + final DateTime? lastModifiedTime; + + /// The name of the application. + final String? name; + + /// The namespace of the application. + final String? namespace; + + ApplicationSummary({ + this.arn, + this.createdTime, + this.id, + this.lastModifiedTime, + this.name, + this.namespace, + }); + + factory ApplicationSummary.fromJson(Map json) { + return ApplicationSummary( + arn: json['Arn'] as String?, + createdTime: timeStampFromJson(json['CreatedTime']), + id: json['Id'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + namespace: json['Namespace'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createdTime = this.createdTime; + final id = this.id; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final namespace = this.namespace; + return { + if (arn != null) 'Arn': arn, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (id != null) 'Id': id, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (namespace != null) 'Namespace': namespace, + }; + } +} + +class CreateApplicationResponse { + /// The Amazon Resource Name (ARN) of the Application. + final String? arn; + + /// A unique identifier for the Application. + final String? id; + + CreateApplicationResponse({ + this.arn, + this.id, + }); + + factory CreateApplicationResponse.fromJson(Map json) { + return CreateApplicationResponse( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + }; + } +} + class CreateDataIntegrationResponse { /// The Amazon Resource Name (ARN) final String? arn; @@ -838,6 +1252,18 @@ class DataIntegrationSummary { } } +class DeleteApplicationResponse { + DeleteApplicationResponse(); + + factory DeleteApplicationResponse.fromJson(Map _) { + return DeleteApplicationResponse(); + } + + Map toJson() { + return {}; + } +} + class DeleteDataIntegrationResponse { DeleteDataIntegrationResponse(); @@ -1015,6 +1441,39 @@ class EventIntegrationAssociation { } } +/// The external URL source for the application. +class ExternalUrlConfig { + /// The URL to access the application. + final String accessUrl; + + /// Additional URLs to allow list if different than the access URL. + final List? approvedOrigins; + + ExternalUrlConfig({ + required this.accessUrl, + this.approvedOrigins, + }); + + factory ExternalUrlConfig.fromJson(Map json) { + return ExternalUrlConfig( + accessUrl: json['AccessUrl'] as String, + approvedOrigins: (json['ApprovedOrigins'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final accessUrl = this.accessUrl; + final approvedOrigins = this.approvedOrigins; + return { + 'AccessUrl': accessUrl, + if (approvedOrigins != null) 'ApprovedOrigins': approvedOrigins, + }; + } +} + /// The configuration for what files should be pulled from the source. class FileConfiguration { /// Identifiers for the source folders to pull all files from recursively. @@ -1050,6 +1509,121 @@ class FileConfiguration { } } +class GetApplicationResponse { + /// The configuration for where the application should be loaded from. + final ApplicationSourceConfig? applicationSourceConfig; + + /// The Amazon Resource Name (ARN) of the Application. + final String? arn; + + /// The created time of the Application. + final DateTime? createdTime; + + /// The description of the application. + final String? description; + + /// A unique identifier for the Application. + final String? id; + + /// The last modified time of the Application. + final DateTime? lastModifiedTime; + + /// The name of the application. + final String? name; + + /// The namespace of the application. + final String? namespace; + + /// The configuration of events or requests that the application has access to. + final List? permissions; + + /// The events that the application publishes. + final List? publications; + + /// The events that the application subscribes. + final List? subscriptions; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + GetApplicationResponse({ + this.applicationSourceConfig, + this.arn, + this.createdTime, + this.description, + this.id, + this.lastModifiedTime, + this.name, + this.namespace, + this.permissions, + this.publications, + this.subscriptions, + this.tags, + }); + + factory GetApplicationResponse.fromJson(Map json) { + return GetApplicationResponse( + applicationSourceConfig: json['ApplicationSourceConfig'] != null + ? ApplicationSourceConfig.fromJson( + json['ApplicationSourceConfig'] as Map) + : null, + arn: json['Arn'] as String?, + createdTime: timeStampFromJson(json['CreatedTime']), + description: json['Description'] as String?, + id: json['Id'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + namespace: json['Namespace'] as String?, + permissions: (json['Permissions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + publications: (json['Publications'] as List?) + ?.whereNotNull() + .map((e) => Publication.fromJson(e as Map)) + .toList(), + subscriptions: (json['Subscriptions'] as List?) + ?.whereNotNull() + .map((e) => Subscription.fromJson(e as Map)) + .toList(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final applicationSourceConfig = this.applicationSourceConfig; + final arn = this.arn; + final createdTime = this.createdTime; + final description = this.description; + final id = this.id; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final namespace = this.namespace; + final permissions = this.permissions; + final publications = this.publications; + final subscriptions = this.subscriptions; + final tags = this.tags; + return { + if (applicationSourceConfig != null) + 'ApplicationSourceConfig': applicationSourceConfig, + if (arn != null) 'Arn': arn, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (namespace != null) 'Namespace': namespace, + if (permissions != null) 'Permissions': permissions, + if (publications != null) 'Publications': publications, + if (subscriptions != null) 'Subscriptions': subscriptions, + if (tags != null) 'Tags': tags, + }; + } +} + class GetDataIntegrationResponse { /// The Amazon Resource Name (ARN) for the DataIntegration. final String? arn; @@ -1216,6 +1790,75 @@ class GetEventIntegrationResponse { } } +class ListApplicationAssociationsResponse { + /// List of Application Associations for the Application. + final List? applicationAssociations; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListApplicationAssociationsResponse({ + this.applicationAssociations, + this.nextToken, + }); + + factory ListApplicationAssociationsResponse.fromJson( + Map json) { + return ListApplicationAssociationsResponse( + applicationAssociations: (json['ApplicationAssociations'] as List?) + ?.whereNotNull() + .map((e) => + ApplicationAssociationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final applicationAssociations = this.applicationAssociations; + final nextToken = this.nextToken; + return { + if (applicationAssociations != null) + 'ApplicationAssociations': applicationAssociations, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListApplicationsResponse { + /// The Applications associated with this account. + final List? applications; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListApplicationsResponse({ + this.applications, + this.nextToken, + }); + + factory ListApplicationsResponse.fromJson(Map json) { + return ListApplicationsResponse( + applications: (json['Applications'] as List?) + ?.whereNotNull() + .map((e) => ApplicationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final applications = this.applications; + final nextToken = this.nextToken; + return { + if (applications != null) 'Applications': applications, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListDataIntegrationAssociationsResponse { /// The Amazon Resource Name (ARN) and unique ID of the DataIntegration /// association. @@ -1381,6 +2024,43 @@ class ListTagsForResourceResponse { } } +/// The configuration of an event that the application publishes. +class Publication { + /// The name of the publication. + final String event; + + /// The JSON schema of the publication event. + final String schema; + + /// The description of the publication. + final String? description; + + Publication({ + required this.event, + required this.schema, + this.description, + }); + + factory Publication.fromJson(Map json) { + return Publication( + event: json['Event'] as String, + schema: json['Schema'] as String, + description: json['Description'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final schema = this.schema; + final description = this.description; + return { + 'Event': event, + 'Schema': schema, + if (description != null) 'Description': description, + }; + } +} + /// The name of the data and how often it should be pulled from the source. class ScheduleConfiguration { /// How often the data should be pulled from data source. @@ -1419,6 +2099,36 @@ class ScheduleConfiguration { } } +/// The configuration of an event that the application subscribes. +class Subscription { + /// The name of the subscription. + final String event; + + /// The description of the subscription. + final String? description; + + Subscription({ + required this.event, + this.description, + }); + + factory Subscription.fromJson(Map json) { + return Subscription( + event: json['Event'] as String, + description: json['Description'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final description = this.description; + return { + 'Event': event, + if (description != null) 'Description': description, + }; + } +} + class TagResourceResponse { TagResourceResponse(); @@ -1443,6 +2153,18 @@ class UntagResourceResponse { } } +class UpdateApplicationResponse { + UpdateApplicationResponse(); + + factory UpdateApplicationResponse.fromJson(Map _) { + return UpdateApplicationResponse(); + } + + Map toJson() { + return {}; + } +} + class UpdateDataIntegrationResponse { UpdateDataIntegrationResponse(); @@ -1505,6 +2227,14 @@ class ThrottlingException extends _s.GenericAwsException { : super(type: type, code: 'ThrottlingException', message: message); } +class UnsupportedOperationException extends _s.GenericAwsException { + UnsupportedOperationException({String? type, String? message}) + : super( + type: type, + code: 'UnsupportedOperationException', + message: message); +} + final _exceptionFns = { 'AccessDeniedException': (type, message) => AccessDeniedException(type: type, message: message), @@ -1520,4 +2250,6 @@ final _exceptionFns = { ResourceQuotaExceededException(type: type, message: message), 'ThrottlingException': (type, message) => ThrottlingException(type: type, message: message), + 'UnsupportedOperationException': (type, message) => + UnsupportedOperationException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/app_mesh/v2019_01_25.dart b/aws_client/lib/src/generated/app_mesh/v2019_01_25.dart index a2b4d9105..a321e80b6 100644 --- a/aws_client/lib/src/generated/app_mesh/v2019_01_25.dart +++ b/aws_client/lib/src/generated/app_mesh/v2019_01_25.dart @@ -3125,9 +3125,10 @@ class FileAccessLog { /// use a log driver, such as awslogs, to export the access logs to /// a log storage service such as Amazon CloudWatch Logs. You can also specify a /// path in the Envoy container's file system to write the files to disk. - ///
     <note> <p>The Envoy process must have write
    -  /// permissions to the path that you specify here. Otherwise, Envoy fails to
    -  /// bootstrap properly.</p> </note> 
    + /// + /// The Envoy process must have write permissions to the path that you specify + /// here. Otherwise, Envoy fails to bootstrap properly. + /// final String path; /// The specified format for the logs. The format is either @@ -3598,7 +3599,7 @@ class GrpcGatewayRouteMatch { /// The gateway route metadata to be matched on. final List? metadata; - /// The port number to match from the request. + /// The gateway route port to be matched on. final int? port; /// The fully qualified domain name for the service to match from the request. diff --git a/aws_client/lib/src/generated/app_runner/v2020_05_15.dart b/aws_client/lib/src/generated/app_runner/v2020_05_15.dart index 7b232db00..08214653d 100644 --- a/aws_client/lib/src/generated/app_runner/v2020_05_15.dart +++ b/aws_client/lib/src/generated/app_runner/v2020_05_15.dart @@ -142,15 +142,34 @@ class AppRunner { /// 1 of this name. When you use the same name in subsequent /// calls, App Runner creates incremental revisions of the configuration. /// - /// The name DefaultConfiguration is reserved (it's the - /// configuration that App Runner uses if you don't provide a custome one). - /// You can't use it to create a new auto scaling configuration, and you can't - /// create a revision of it. + /// Prior to the release of Auto + /// scale configuration enhancements, the name + /// DefaultConfiguration was reserved. /// - /// When you want to use your own auto scaling configuration for your App - /// Runner service, create a configuration with a different name, and - /// then provide it when you create or update your service. - /// + /// This restriction is no longer in place. You can now manage + /// DefaultConfiguration the same way you manage your custom auto + /// scaling configurations. This means you can do the following with the + /// DefaultConfiguration that App Runner provides: + /// + ///
      + ///
    • + /// Create new revisions of the DefaultConfiguration. + ///
    • + ///
    • + /// Delete the revisions of the DefaultConfiguration. + ///
    • + ///
    • + /// Delete the auto scaling configuration for which the App Runner + /// DefaultConfiguration was created. + ///
    • + ///
    • + /// If you delete the auto scaling configuration you can create another custom + /// auto scaling configuration with the same DefaultConfiguration + /// name. The original DefaultConfiguration resource provided by + /// App Runner remains in your account unless you make changes to it. + ///
    • + ///
    /// /// Parameter [maxConcurrency] : /// The maximum number of concurrent requests that you want an instance to @@ -235,9 +254,9 @@ class AppRunner { /// repositories from certain third-party providers. You can share a /// connection across multiple services. /// - /// A connection resource is needed to access GitHub repositories. GitHub - /// requires a user interface approval process through the App Runner console - /// before you can use the connection. + /// A connection resource is needed to access GitHub and Bitbucket + /// repositories. Both require a user interface approval process through the + /// App Runner console before you can use the connection. /// /// May throw [InvalidRequestException]. /// May throw [InternalServiceErrorException]. @@ -561,8 +580,10 @@ class AppRunner { } /// Delete an App Runner automatic scaling configuration resource. You can - /// delete a specific revision or the latest active revision. You can't delete - /// a configuration that's used by one or more App Runner services. + /// delete a top level auto scaling configuration, a specific revision of one, + /// or all revisions associated with the top level configuration. You can't + /// delete the default auto scaling configuration or a configuration that's + /// used by one or more App Runner services. /// /// May throw [InvalidRequestException]. /// May throw [InternalServiceErrorException]. @@ -576,9 +597,18 @@ class AppRunner { /// ending with either .../name or /// .../name/revision . If a revision isn't /// specified, the latest active revision is deleted. + /// + /// Parameter [deleteAllRevisions] : + /// Set to true to delete all of the revisions associated with + /// the AutoScalingConfigurationArn parameter value. + /// + /// When DeleteAllRevisions is set to true, the only + /// valid value for the Amazon Resource Name (ARN) is a partial ARN ending + /// with: .../name. Future deleteAutoScalingConfiguration({ required String autoScalingConfigurationArn, + bool? deleteAllRevisions, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.0', @@ -592,6 +622,8 @@ class AppRunner { headers: headers, payload: { 'AutoScalingConfigurationArn': autoScalingConfigurationArn, + if (deleteAllRevisions != null) + 'DeleteAllRevisions': deleteAllRevisions, }, ); @@ -1369,6 +1401,69 @@ class AppRunner { return ListServicesResponse.fromJson(jsonResponse.body); } + /// Returns a list of the associated App Runner services using an auto scaling + /// configuration. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceErrorException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [autoScalingConfigurationArn] : + /// The Amazon Resource Name (ARN) of the App Runner auto scaling + /// configuration that you want to list the services for. + /// + /// The ARN can be a full auto scaling configuration ARN, or a partial ARN + /// ending with either .../name or + /// .../name/revision . If a revision isn't + /// specified, the latest active revision is used. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in each response (result page). + /// It's used for a paginated request. + /// + /// If you don't specify MaxResults, the request retrieves all + /// available results in a single response. + /// + /// Parameter [nextToken] : + /// A token from a previous result page. It's used for a paginated request. + /// The request retrieves the next result page. All other parameter values + /// must be identical to the ones specified in the initial request. + /// + /// If you don't specify NextToken, the request retrieves the + /// first result page. + Future + listServicesForAutoScalingConfiguration({ + required String autoScalingConfigurationArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'AppRunner.ListServicesForAutoScalingConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AutoScalingConfigurationArn': autoScalingConfigurationArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListServicesForAutoScalingConfigurationResponse.fromJson( + jsonResponse.body); + } + /// List tags that are associated with for an App Runner resource. The /// response contains a list of tag key-value pairs. /// @@ -1696,6 +1791,45 @@ class AppRunner { ); } + /// Update an auto scaling configuration to be the default. The existing + /// default auto scaling configuration will be set to non-default + /// automatically. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceErrorException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [autoScalingConfigurationArn] : + /// The Amazon Resource Name (ARN) of the App Runner auto scaling + /// configuration that you want to set as the default. + /// + /// The ARN can be a full auto scaling configuration ARN, or a partial ARN + /// ending with either .../name or + /// .../name/revision . If a revision isn't + /// specified, the latest active revision is set as the default. + Future + updateDefaultAutoScalingConfiguration({ + required String autoScalingConfigurationArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'AppRunner.UpdateDefaultAutoScalingConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AutoScalingConfigurationArn': autoScalingConfigurationArn, + }, + ); + + return UpdateDefaultAutoScalingConfigurationResponse.fromJson( + jsonResponse.body); + } + /// Update an App Runner service. You can update the source configuration and /// instance configuration of the service. You can also update the ARN of the /// auto scaling configuration resource that's associated with the service. @@ -1957,6 +2091,20 @@ class AutoScalingConfiguration { /// stamp format. final DateTime? deletedAt; + /// Indicates if this auto scaling configuration has an App Runner service + /// associated with it. A value of true indicates one or more + /// services are associated. A value of false indicates no services + /// are associated. + final bool? hasAssociatedService; + + /// Indicates if this auto scaling configuration should be used as the default + /// for a new App Runner service that does not have an auto scaling + /// configuration ARN specified during creation. Each account can have only one + /// default AutoScalingConfiguration per region. The default + /// AutoScalingConfiguration can be any revision under the same + /// AutoScalingConfigurationName. + final bool? isDefault; + /// It's set to true for the configuration with the highest /// Revision among all configurations that share the same /// AutoScalingConfigurationName. It's set to false @@ -1995,6 +2143,8 @@ class AutoScalingConfiguration { this.autoScalingConfigurationRevision, this.createdAt, this.deletedAt, + this.hasAssociatedService, + this.isDefault, this.latest, this.maxConcurrency, this.maxSize, @@ -2012,6 +2162,8 @@ class AutoScalingConfiguration { json['AutoScalingConfigurationRevision'] as int?, createdAt: timeStampFromJson(json['CreatedAt']), deletedAt: timeStampFromJson(json['DeletedAt']), + hasAssociatedService: json['HasAssociatedService'] as bool?, + isDefault: json['IsDefault'] as bool?, latest: json['Latest'] as bool?, maxConcurrency: json['MaxConcurrency'] as int?, maxSize: json['MaxSize'] as int?, @@ -2027,6 +2179,8 @@ class AutoScalingConfiguration { this.autoScalingConfigurationRevision; final createdAt = this.createdAt; final deletedAt = this.deletedAt; + final hasAssociatedService = this.hasAssociatedService; + final isDefault = this.isDefault; final latest = this.latest; final maxConcurrency = this.maxConcurrency; final maxSize = this.maxSize; @@ -2041,6 +2195,9 @@ class AutoScalingConfiguration { 'AutoScalingConfigurationRevision': autoScalingConfigurationRevision, if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), if (deletedAt != null) 'DeletedAt': unixTimestampToJson(deletedAt), + if (hasAssociatedService != null) + 'HasAssociatedService': hasAssociatedService, + if (isDefault != null) 'IsDefault': isDefault, if (latest != null) 'Latest': latest, if (maxConcurrency != null) 'MaxConcurrency': maxConcurrency, if (maxSize != null) 'MaxSize': maxSize, @@ -2104,10 +2261,38 @@ class AutoScalingConfigurationSummary { /// AutoScalingConfigurationName. final int? autoScalingConfigurationRevision; + /// The time when the auto scaling configuration was created. It's in Unix time + /// stamp format. + final DateTime? createdAt; + + /// Indicates if this auto scaling configuration has an App Runner service + /// associated with it. A value of true indicates one or more + /// services are associated. A value of false indicates no services + /// are associated. + final bool? hasAssociatedService; + + /// Indicates if this auto scaling configuration should be used as the default + /// for a new App Runner service that does not have an auto scaling + /// configuration ARN specified during creation. Each account can have only one + /// default AutoScalingConfiguration per region. The default + /// AutoScalingConfiguration can be any revision under the same + /// AutoScalingConfigurationName. + final bool? isDefault; + + /// The current state of the auto scaling configuration. If the status of a + /// configuration revision is INACTIVE, it was deleted and can't be + /// used. Inactive configuration revisions are permanently removed some time + /// after they are deleted. + final AutoScalingConfigurationStatus? status; + AutoScalingConfigurationSummary({ this.autoScalingConfigurationArn, this.autoScalingConfigurationName, this.autoScalingConfigurationRevision, + this.createdAt, + this.hasAssociatedService, + this.isDefault, + this.status, }); factory AutoScalingConfigurationSummary.fromJson(Map json) { @@ -2118,6 +2303,10 @@ class AutoScalingConfigurationSummary { json['AutoScalingConfigurationName'] as String?, autoScalingConfigurationRevision: json['AutoScalingConfigurationRevision'] as int?, + createdAt: timeStampFromJson(json['CreatedAt']), + hasAssociatedService: json['HasAssociatedService'] as bool?, + isDefault: json['IsDefault'] as bool?, + status: (json['Status'] as String?)?.toAutoScalingConfigurationStatus(), ); } @@ -2126,6 +2315,10 @@ class AutoScalingConfigurationSummary { final autoScalingConfigurationName = this.autoScalingConfigurationName; final autoScalingConfigurationRevision = this.autoScalingConfigurationRevision; + final createdAt = this.createdAt; + final hasAssociatedService = this.hasAssociatedService; + final isDefault = this.isDefault; + final status = this.status; return { if (autoScalingConfigurationArn != null) 'AutoScalingConfigurationArn': autoScalingConfigurationArn, @@ -2133,6 +2326,11 @@ class AutoScalingConfigurationSummary { 'AutoScalingConfigurationName': autoScalingConfigurationName, if (autoScalingConfigurationRevision != null) 'AutoScalingConfigurationRevision': autoScalingConfigurationRevision, + if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), + if (hasAssociatedService != null) + 'HasAssociatedService': hasAssociatedService, + if (isDefault != null) 'IsDefault': isDefault, + if (status != null) 'Status': status.toValue(), }; } } @@ -2378,10 +2576,16 @@ class CodeRepository { ///
    final CodeConfiguration? codeConfiguration; + /// The path of the directory that stores source code and configuration files. + /// The build and start commands also execute from here. The path is absolute + /// from root and, if not specified, defaults to the repository root. + final String? sourceDirectory; + CodeRepository({ required this.repositoryUrl, required this.sourceCodeVersion, this.codeConfiguration, + this.sourceDirectory, }); factory CodeRepository.fromJson(Map json) { @@ -2393,6 +2597,7 @@ class CodeRepository { ? CodeConfiguration.fromJson( json['CodeConfiguration'] as Map) : null, + sourceDirectory: json['SourceDirectory'] as String?, ); } @@ -2400,10 +2605,12 @@ class CodeRepository { final repositoryUrl = this.repositoryUrl; final sourceCodeVersion = this.sourceCodeVersion; final codeConfiguration = this.codeConfiguration; + final sourceDirectory = this.sourceDirectory; return { 'RepositoryUrl': repositoryUrl, 'SourceCodeVersion': sourceCodeVersion, if (codeConfiguration != null) 'CodeConfiguration': codeConfiguration, + if (sourceDirectory != null) 'SourceDirectory': sourceDirectory, }; } } @@ -3681,6 +3888,34 @@ class InstanceConfiguration { } } +enum IpAddressType { + ipv4, + dualStack, +} + +extension IpAddressTypeValueExtension on IpAddressType { + String toValue() { + switch (this) { + case IpAddressType.ipv4: + return 'IPV4'; + case IpAddressType.dualStack: + return 'DUAL_STACK'; + } + } +} + +extension IpAddressTypeFromString on String { + IpAddressType toIpAddressType() { + switch (this) { + case 'IPV4': + return IpAddressType.ipv4; + case 'DUAL_STACK': + return IpAddressType.dualStack; + } + throw Exception('$this is not known in enum IpAddressType'); + } +} + class ListAutoScalingConfigurationsResponse { /// A list of summary information records for auto scaling configurations. In a /// paginated request, the request returns up to MaxResults records @@ -3833,6 +4068,41 @@ class ListOperationsResponse { } } +class ListServicesForAutoScalingConfigurationResponse { + /// A list of service ARN records. In a paginated request, the request returns + /// up to MaxResults records for each call. + final List serviceArnList; + + /// The token that you can pass in a subsequent request to get the next result + /// page. It's returned in a paginated request. + final String? nextToken; + + ListServicesForAutoScalingConfigurationResponse({ + required this.serviceArnList, + this.nextToken, + }); + + factory ListServicesForAutoScalingConfigurationResponse.fromJson( + Map json) { + return ListServicesForAutoScalingConfigurationResponse( + serviceArnList: (json['ServiceArnList'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final serviceArnList = this.serviceArnList; + final nextToken = this.nextToken; + return { + 'ServiceArnList': serviceArnList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListServicesResponse { /// A list of service summary information records. In a paginated request, the /// request returns up to MaxResults records for each call. @@ -3999,9 +4269,23 @@ class NetworkConfiguration { /// Network configuration settings for inbound message traffic. final IngressConfiguration? ingressConfiguration; + /// App Runner provides you with the option to choose between Internet + /// Protocol version 4 (IPv4) and dual stack (IPv4 and IPv6) for your + /// incoming public network configuration. This is an optional parameter. If you + /// do not specify an IpAddressType, it defaults to select IPv4. + /// + /// Currently, App Runner supports dual stack for only Public endpoint. Only + /// IPv4 is supported for Private endpoint. If you update a service that's using + /// dual-stack Public endpoint to a Private endpoint, your App Runner service + /// will default to support only IPv4 for Private endpoint and fail to receive + /// traffic originating from IPv6 endpoint. + /// + final IpAddressType? ipAddressType; + NetworkConfiguration({ this.egressConfiguration, this.ingressConfiguration, + this.ipAddressType, }); factory NetworkConfiguration.fromJson(Map json) { @@ -4014,17 +4298,20 @@ class NetworkConfiguration { ? IngressConfiguration.fromJson( json['IngressConfiguration'] as Map) : null, + ipAddressType: (json['IpAddressType'] as String?)?.toIpAddressType(), ); } Map toJson() { final egressConfiguration = this.egressConfiguration; final ingressConfiguration = this.ingressConfiguration; + final ipAddressType = this.ipAddressType; return { if (egressConfiguration != null) 'EgressConfiguration': egressConfiguration, if (ingressConfiguration != null) 'IngressConfiguration': ingressConfiguration, + if (ipAddressType != null) 'IpAddressType': ipAddressType.toValue(), }; } } @@ -4425,6 +4712,7 @@ class PauseServiceResponse { enum ProviderType { github, + bitbucket, } extension ProviderTypeValueExtension on ProviderType { @@ -4432,6 +4720,8 @@ extension ProviderTypeValueExtension on ProviderType { switch (this) { case ProviderType.github: return 'GITHUB'; + case ProviderType.bitbucket: + return 'BITBUCKET'; } } } @@ -4441,6 +4731,8 @@ extension ProviderTypeFromString on String { switch (this) { case 'GITHUB': return ProviderType.github; + case 'BITBUCKET': + return ProviderType.bitbucket; } throw Exception('$this is not known in enum ProviderType'); } @@ -4488,6 +4780,8 @@ enum Runtime { dotnet_6, php_81, ruby_31, + python_311, + nodejs_18, } extension RuntimeValueExtension on Runtime { @@ -4513,6 +4807,10 @@ extension RuntimeValueExtension on Runtime { return 'PHP_81'; case Runtime.ruby_31: return 'RUBY_31'; + case Runtime.python_311: + return 'PYTHON_311'; + case Runtime.nodejs_18: + return 'NODEJS_18'; } } } @@ -4540,6 +4838,10 @@ extension RuntimeFromString on String { return Runtime.php_81; case 'RUBY_31': return Runtime.ruby_31; + case 'PYTHON_311': + return Runtime.python_311; + case 'NODEJS_18': + return Runtime.nodejs_18; } throw Exception('$this is not known in enum Runtime'); } @@ -4595,12 +4897,11 @@ class Service { /// ///
      ///
    • - /// CREATE_FAILED – The service failed to create. To troubleshoot - /// this failure, read the failure events and logs, change any parameters that - /// need to be fixed, and retry the call to create the service. - /// - /// The failed service isn't usable, and still counts towards your service - /// quota. When you're done analyzing the failure, delete the service. + /// CREATE_FAILED – The service failed to create. The failed + /// service isn't usable, and still counts towards your service quota. To + /// troubleshoot this failure, read the failure events and logs, change any + /// parameters that need to be fixed, and rebuild your service using + /// UpdateService. ///
    • ///
    • /// DELETE_FAILED – The service failed to delete and can't be @@ -4859,12 +5160,11 @@ class ServiceSummary { /// ///
        ///
      • - /// CREATE_FAILED – The service failed to create. Read the failure - /// events and logs, change any parameters that need to be fixed, and retry the - /// call to create the service. - /// - /// The failed service isn't usable, and still counts towards your service - /// quota. When you're done analyzing the failure, delete the service. + /// CREATE_FAILED – The service failed to create. The failed + /// service isn't usable, and still counts towards your service quota. To + /// troubleshoot this failure, read the failure events and logs, change any + /// parameters that need to be fixed, and rebuild your service using + /// UpdateService. ///
      • ///
      • /// DELETE_FAILED – The service failed to delete and can't be @@ -5176,6 +5476,31 @@ class UntagResourceResponse { } } +class UpdateDefaultAutoScalingConfigurationResponse { + /// A description of the App Runner auto scaling configuration that was set as + /// default. + final AutoScalingConfiguration autoScalingConfiguration; + + UpdateDefaultAutoScalingConfigurationResponse({ + required this.autoScalingConfiguration, + }); + + factory UpdateDefaultAutoScalingConfigurationResponse.fromJson( + Map json) { + return UpdateDefaultAutoScalingConfigurationResponse( + autoScalingConfiguration: AutoScalingConfiguration.fromJson( + json['AutoScalingConfiguration'] as Map), + ); + } + + Map toJson() { + final autoScalingConfiguration = this.autoScalingConfiguration; + return { + 'AutoScalingConfiguration': autoScalingConfiguration, + }; + } +} + class UpdateServiceResponse { /// The unique ID of the asynchronous operation that this request started. You /// can use it combined with the ListOperations call to track the diff --git a/aws_client/lib/src/generated/app_stream/v2016_12_01.dart b/aws_client/lib/src/generated/app_stream/v2016_12_01.dart index bf0f7e99d..816d01090 100644 --- a/aws_client/lib/src/generated/app_stream/v2016_12_01.dart +++ b/aws_client/lib/src/generated/app_stream/v2016_12_01.dart @@ -63,6 +63,43 @@ class AppStream { _protocol.close(); } + /// Associates the specified app block builder with the specified app block. + /// + /// May throw [ConcurrentModificationException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterCombinationException]. + /// May throw [OperationNotPermittedException]. + /// + /// Parameter [appBlockArn] : + /// The ARN of the app block. + /// + /// Parameter [appBlockBuilderName] : + /// The name of the app block builder. + Future + associateAppBlockBuilderAppBlock({ + required String appBlockArn, + required String appBlockBuilderName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.AssociateAppBlockBuilderAppBlock' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AppBlockArn': appBlockArn, + 'AppBlockBuilderName': appBlockBuilderName, + }, + ); + + return AssociateAppBlockBuilderAppBlockResult.fromJson(jsonResponse.body); + } + /// Associates the specified application with the specified fleet. This is /// only supported for Elastic fleets. /// @@ -303,9 +340,6 @@ class AppStream { /// Parameter [name] : /// The name of the app block. /// - /// Parameter [setupScriptDetails] : - /// The setup script details of the app block. - /// /// Parameter [sourceS3Location] : /// The source S3 location of the app block. /// @@ -315,14 +349,27 @@ class AppStream { /// Parameter [displayName] : /// The display name of the app block. This is not displayed to the user. /// + /// Parameter [packagingType] : + /// The packaging type of the app block. + /// + /// Parameter [postSetupScriptDetails] : + /// The post setup script details of the app block. This can only be provided + /// for the APPSTREAM2 PackagingType. + /// + /// Parameter [setupScriptDetails] : + /// The setup script details of the app block. This must be provided for the + /// CUSTOM PackagingType. + /// /// Parameter [tags] : /// The tags assigned to the app block. Future createAppBlock({ required String name, - required ScriptDetails setupScriptDetails, required S3Location sourceS3Location, String? description, String? displayName, + PackagingType? packagingType, + ScriptDetails? postSetupScriptDetails, + ScriptDetails? setupScriptDetails, Map? tags, }) async { final headers = { @@ -337,10 +384,14 @@ class AppStream { headers: headers, payload: { 'Name': name, - 'SetupScriptDetails': setupScriptDetails, 'SourceS3Location': sourceS3Location, if (description != null) 'Description': description, if (displayName != null) 'DisplayName': displayName, + if (packagingType != null) 'PackagingType': packagingType.toValue(), + if (postSetupScriptDetails != null) + 'PostSetupScriptDetails': postSetupScriptDetails, + if (setupScriptDetails != null) + 'SetupScriptDetails': setupScriptDetails, if (tags != null) 'Tags': tags, }, ); @@ -348,6 +399,175 @@ class AppStream { return CreateAppBlockResult.fromJson(jsonResponse.body); } + /// Creates an app block builder. + /// + /// May throw [LimitExceededException]. + /// May throw [RequestLimitExceededException]. + /// May throw [InvalidAccountStatusException]. + /// May throw [InvalidRoleException]. + /// May throw [ConcurrentModificationException]. + /// May throw [OperationNotPermittedException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [ResourceNotAvailableException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterCombinationException]. + /// + /// Parameter [instanceType] : + /// The instance type to use when launching the app block builder. The + /// following instance types are available: + /// + ///
          + ///
        • + /// stream.standard.small + ///
        • + ///
        • + /// stream.standard.medium + ///
        • + ///
        • + /// stream.standard.large + ///
        • + ///
        • + /// stream.standard.xlarge + ///
        • + ///
        • + /// stream.standard.2xlarge + ///
        • + ///
        + /// + /// Parameter [name] : + /// The unique name for the app block builder. + /// + /// Parameter [platform] : + /// The platform of the app block builder. + /// + /// WINDOWS_SERVER_2019 is the only valid value. + /// + /// Parameter [vpcConfig] : + /// The VPC configuration for the app block builder. + /// + /// App block builders require that you specify at least two subnets in + /// different availability zones. + /// + /// Parameter [accessEndpoints] : + /// The list of interface VPC endpoint (interface endpoint) objects. + /// Administrators can connect to the app block builder only through the + /// specified endpoints. + /// + /// Parameter [description] : + /// The description of the app block builder. + /// + /// Parameter [displayName] : + /// The display name of the app block builder. + /// + /// Parameter [enableDefaultInternetAccess] : + /// Enables or disables default internet access for the app block builder. + /// + /// Parameter [iamRoleArn] : + /// The Amazon Resource Name (ARN) of the IAM role to apply to the app block + /// builder. To assume a role, the app block builder calls the AWS Security + /// Token Service (STS) AssumeRole API operation and passes the + /// ARN of the role to use. The operation creates a new session with temporary + /// credentials. AppStream 2.0 retrieves the temporary credentials and creates + /// the appstream_machine_role credential profile on the instance. + /// + /// For more information, see Using + /// an IAM Role to Grant Permissions to Applications and Scripts Running on + /// AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 + /// Administration Guide. + /// + /// Parameter [tags] : + /// The tags to associate with the app block builder. A tag is a key-value + /// pair, and the value is optional. For example, Environment=Test. If you do + /// not specify a value, Environment=. + /// + /// If you do not specify a value, the value is set to an empty string. + /// + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following special characters: + /// + /// _ . : / = + \ - @ + /// + /// For more information, see Tagging + /// Your Resources in the Amazon AppStream 2.0 Administration + /// Guide. + Future createAppBlockBuilder({ + required String instanceType, + required String name, + required AppBlockBuilderPlatformType platform, + required VpcConfig vpcConfig, + List? accessEndpoints, + String? description, + String? displayName, + bool? enableDefaultInternetAccess, + String? iamRoleArn, + Map? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.CreateAppBlockBuilder' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'InstanceType': instanceType, + 'Name': name, + 'Platform': platform.toValue(), + 'VpcConfig': vpcConfig, + if (accessEndpoints != null) 'AccessEndpoints': accessEndpoints, + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (enableDefaultInternetAccess != null) + 'EnableDefaultInternetAccess': enableDefaultInternetAccess, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateAppBlockBuilderResult.fromJson(jsonResponse.body); + } + + /// Creates a URL to start a create app block builder streaming session. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [OperationNotPermittedException]. + /// + /// Parameter [appBlockBuilderName] : + /// The name of the app block builder. + /// + /// Parameter [validity] : + /// The time that the streaming URL will be valid, in seconds. Specify a value + /// between 1 and 604800 seconds. The default is 3600 seconds. + Future + createAppBlockBuilderStreamingURL({ + required String appBlockBuilderName, + int? validity, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'PhotonAdminProxyService.CreateAppBlockBuilderStreamingURL' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AppBlockBuilderName': appBlockBuilderName, + if (validity != null) 'Validity': validity, + }, + ); + + return CreateAppBlockBuilderStreamingURLResult.fromJson(jsonResponse.body); + } + /// Creates an application. /// /// Applications are an Amazon AppStream 2.0 resource that stores the details @@ -800,6 +1020,10 @@ class AppStream { /// The maximum concurrent sessions of the Elastic fleet. This is required for /// Elastic fleets, and not allowed for other fleet types. /// + /// Parameter [maxSessionsPerInstance] : + /// The maximum number of user sessions on an instance. This only applies to + /// multi-session fleets. + /// /// Parameter [maxUserDurationInSeconds] : /// The maximum amount of time that a streaming session can remain active, in /// seconds. If users are still connected to a streaming instance five minutes @@ -807,7 +1031,7 @@ class AppStream { /// before being disconnected. After this time elapses, the instance is /// terminated and replaced by a new instance. /// - /// Specify a value between 600 and 360000. + /// Specify a value between 600 and 432000. /// /// Parameter [platform] : /// The fleet platform. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported @@ -867,6 +1091,7 @@ class AppStream { String? imageArn, String? imageName, int? maxConcurrentSessions, + int? maxSessionsPerInstance, int? maxUserDurationInSeconds, PlatformType? platform, S3Location? sessionScriptS3Location, @@ -904,6 +1129,8 @@ class AppStream { if (imageName != null) 'ImageName': imageName, if (maxConcurrentSessions != null) 'MaxConcurrentSessions': maxConcurrentSessions, + if (maxSessionsPerInstance != null) + 'MaxSessionsPerInstance': maxSessionsPerInstance, if (maxUserDurationInSeconds != null) 'MaxUserDurationInSeconds': maxUserDurationInSeconds, if (platform != null) 'Platform': platform.toValue(), @@ -1200,6 +1427,7 @@ class AppStream { /// May throw [InvalidRoleException]. /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterCombinationException]. + /// May throw [OperationNotPermittedException]. /// /// Parameter [name] : /// The name of the stack. @@ -1568,6 +1796,37 @@ class AppStream { ); } + /// Deletes an app block builder. + /// + /// An app block builder can only be deleted when it has no association with + /// an app block. + /// + /// May throw [OperationNotPermittedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [ResourceInUseException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [name] : + /// The name of the app block builder. + Future deleteAppBlockBuilder({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.DeleteAppBlockBuilder' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + }, + ); + } + /// Deletes an application. /// /// May throw [OperationNotPermittedException]. @@ -1862,13 +2121,17 @@ class AppStream { ); } - /// Retrieves a list that describes one or more app blocks. + /// Retrieves a list that describes one or more app block builder + /// associations. /// + /// May throw [InvalidParameterCombinationException]. /// May throw [OperationNotPermittedException]. - /// May throw [ResourceNotFoundException]. /// - /// Parameter [arns] : - /// The ARNs of the app blocks. + /// Parameter [appBlockArn] : + /// The ARN of the app block. + /// + /// Parameter [appBlockBuilderName] : + /// The name of the app block builder. /// /// Parameter [maxResults] : /// The maximum size of each page of results. @@ -1876,14 +2139,17 @@ class AppStream { /// Parameter [nextToken] : /// The pagination token used to retrieve the next page of results for this /// operation. - Future describeAppBlocks({ - List? arns, + Future + describeAppBlockBuilderAppBlockAssociations({ + String? appBlockArn, + String? appBlockBuilderName, int? maxResults, String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'PhotonAdminProxyService.DescribeAppBlocks' + 'X-Amz-Target': + 'PhotonAdminProxyService.DescribeAppBlockBuilderAppBlockAssociations' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -1892,44 +2158,40 @@ class AppStream { // TODO queryParams headers: headers, payload: { - if (arns != null) 'Arns': arns, + if (appBlockArn != null) 'AppBlockArn': appBlockArn, + if (appBlockBuilderName != null) + 'AppBlockBuilderName': appBlockBuilderName, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, }, ); - return DescribeAppBlocksResult.fromJson(jsonResponse.body); + return DescribeAppBlockBuilderAppBlockAssociationsResult.fromJson( + jsonResponse.body); } - /// Retrieves a list that describes one or more application fleet - /// associations. Either ApplicationArn or FleetName must be specified. + /// Retrieves a list that describes one or more app block builders. /// - /// May throw [InvalidParameterCombinationException]. /// May throw [OperationNotPermittedException]. - /// - /// Parameter [applicationArn] : - /// The ARN of the application. - /// - /// Parameter [fleetName] : - /// The name of the fleet. + /// May throw [ResourceNotFoundException]. /// /// Parameter [maxResults] : - /// The maximum size of each page of results. + /// The maximum size of each page of results. The maximum value is 25. + /// + /// Parameter [names] : + /// The names of the app block builders. /// /// Parameter [nextToken] : /// The pagination token used to retrieve the next page of results for this /// operation. - Future - describeApplicationFleetAssociations({ - String? applicationArn, - String? fleetName, + Future describeAppBlockBuilders({ int? maxResults, + List? names, String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': - 'PhotonAdminProxyService.DescribeApplicationFleetAssociations' + 'X-Amz-Target': 'PhotonAdminProxyService.DescribeAppBlockBuilders' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -1938,24 +2200,22 @@ class AppStream { // TODO queryParams headers: headers, payload: { - if (applicationArn != null) 'ApplicationArn': applicationArn, - if (fleetName != null) 'FleetName': fleetName, if (maxResults != null) 'MaxResults': maxResults, + if (names != null) 'Names': names, if (nextToken != null) 'NextToken': nextToken, }, ); - return DescribeApplicationFleetAssociationsResult.fromJson( - jsonResponse.body); + return DescribeAppBlockBuildersResult.fromJson(jsonResponse.body); } - /// Retrieves a list that describes one or more applications. + /// Retrieves a list that describes one or more app blocks. /// /// May throw [OperationNotPermittedException]. /// May throw [ResourceNotFoundException]. /// /// Parameter [arns] : - /// The ARNs for the applications. + /// The ARNs of the app blocks. /// /// Parameter [maxResults] : /// The maximum size of each page of results. @@ -1963,14 +2223,14 @@ class AppStream { /// Parameter [nextToken] : /// The pagination token used to retrieve the next page of results for this /// operation. - Future describeApplications({ + Future describeAppBlocks({ List? arns, int? maxResults, String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'PhotonAdminProxyService.DescribeApplications' + 'X-Amz-Target': 'PhotonAdminProxyService.DescribeAppBlocks' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -1985,17 +2245,104 @@ class AppStream { }, ); - return DescribeApplicationsResult.fromJson(jsonResponse.body); + return DescribeAppBlocksResult.fromJson(jsonResponse.body); } - /// Retrieves a list that describes one or more specified Directory Config - /// objects for AppStream 2.0, if the names for these objects are provided. - /// Otherwise, all Directory Config objects in the account are described. - /// These objects include the configuration information required to join - /// fleets and image builders to Microsoft Active Directory domains. + /// Retrieves a list that describes one or more application fleet + /// associations. Either ApplicationArn or FleetName must be specified. /// - /// Although the response syntax in this topic includes the account password, - /// this password is not returned in the actual response. + /// May throw [InvalidParameterCombinationException]. + /// May throw [OperationNotPermittedException]. + /// + /// Parameter [applicationArn] : + /// The ARN of the application. + /// + /// Parameter [fleetName] : + /// The name of the fleet. + /// + /// Parameter [maxResults] : + /// The maximum size of each page of results. + /// + /// Parameter [nextToken] : + /// The pagination token used to retrieve the next page of results for this + /// operation. + Future + describeApplicationFleetAssociations({ + String? applicationArn, + String? fleetName, + int? maxResults, + String? nextToken, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'PhotonAdminProxyService.DescribeApplicationFleetAssociations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (applicationArn != null) 'ApplicationArn': applicationArn, + if (fleetName != null) 'FleetName': fleetName, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return DescribeApplicationFleetAssociationsResult.fromJson( + jsonResponse.body); + } + + /// Retrieves a list that describes one or more applications. + /// + /// May throw [OperationNotPermittedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [arns] : + /// The ARNs for the applications. + /// + /// Parameter [maxResults] : + /// The maximum size of each page of results. + /// + /// Parameter [nextToken] : + /// The pagination token used to retrieve the next page of results for this + /// operation. + Future describeApplications({ + List? arns, + int? maxResults, + String? nextToken, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.DescribeApplications' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (arns != null) 'Arns': arns, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return DescribeApplicationsResult.fromJson(jsonResponse.body); + } + + /// Retrieves a list that describes one or more specified Directory Config + /// objects for AppStream 2.0, if the names for these objects are provided. + /// Otherwise, all Directory Config objects in the account are described. + /// These objects include the configuration information required to join + /// fleets and image builders to Microsoft Active Directory domains. + /// + /// Although the response syntax in this topic includes the account password, + /// this password is not returned in the actual response. /// /// May throw [ResourceNotFoundException]. /// @@ -2282,6 +2629,9 @@ class AppStream { /// federated user. The default is to authenticate users using a streaming /// URL. /// + /// Parameter [instanceId] : + /// The identifier for the instance hosting the session. + /// /// Parameter [limit] : /// The size of each page of results. The default value is 20 and the maximum /// value is 50. @@ -2297,6 +2647,7 @@ class AppStream { required String fleetName, required String stackName, AuthenticationType? authenticationType, + String? instanceId, int? limit, String? nextToken, String? userId, @@ -2316,6 +2667,7 @@ class AppStream { 'StackName': stackName, if (authenticationType != null) 'AuthenticationType': authenticationType.toValue(), + if (instanceId != null) 'InstanceId': instanceId, if (limit != null) 'Limit': limit, if (nextToken != null) 'NextToken': nextToken, if (userId != null) 'UserId': userId, @@ -2542,6 +2894,40 @@ class AppStream { ); } + /// Disassociates a specified app block builder from a specified app block. + /// + /// May throw [ConcurrentModificationException]. + /// May throw [InvalidParameterCombinationException]. + /// May throw [OperationNotPermittedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [appBlockArn] : + /// The ARN of the app block. + /// + /// Parameter [appBlockBuilderName] : + /// The name of the app block builder. + Future disassociateAppBlockBuilderAppBlock({ + required String appBlockArn, + required String appBlockBuilderName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'PhotonAdminProxyService.DisassociateAppBlockBuilderAppBlock' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AppBlockArn': appBlockArn, + 'AppBlockBuilderName': appBlockBuilderName, + }, + ); + } + /// Disassociates the specified application from the fleet. /// /// May throw [ConcurrentModificationException]. @@ -2850,6 +3236,46 @@ class AppStream { return ListTagsForResourceResponse.fromJson(jsonResponse.body); } + /// Starts an app block builder. + /// + /// An app block builder can only be started when it's associated with an app + /// block. + /// + /// Starting an app block builder starts a new instance, which is equivalent + /// to an elastic fleet instance with application builder assistance + /// functionality. + /// + /// May throw [ConcurrentModificationException]. + /// May throw [InvalidAccountStatusException]. + /// May throw [LimitExceededException]. + /// May throw [OperationNotPermittedException]. + /// May throw [RequestLimitExceededException]. + /// May throw [ResourceNotAvailableException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [name] : + /// The name of the app block builder. + Future startAppBlockBuilder({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.StartAppBlockBuilder' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + }, + ); + + return StartAppBlockBuilderResult.fromJson(jsonResponse.body); + } + /// Starts the specified fleet. /// /// May throw [ResourceNotFoundException]. @@ -2920,6 +3346,38 @@ class AppStream { return StartImageBuilderResult.fromJson(jsonResponse.body); } + /// Stops an app block builder. + /// + /// Stopping an app block builder terminates the instance, and the instance + /// state is not persisted. + /// + /// May throw [ConcurrentModificationException]. + /// May throw [OperationNotPermittedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [name] : + /// The name of the app block builder. + Future stopAppBlockBuilder({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.StopAppBlockBuilder' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + }, + ); + + return StopAppBlockBuilderResult.fromJson(jsonResponse.body); + } + /// Stops the specified fleet. /// /// May throw [ResourceNotFoundException]. @@ -3069,54 +3527,106 @@ class AppStream { ); } - /// Updates the specified application. + /// Updates an app block builder. + /// + /// If the app block builder is in the STARTING or + /// STOPPING state, you can't update it. If the app block builder + /// is in the RUNNING state, you can only update the DisplayName + /// and Description. If the app block builder is in the STOPPED + /// state, you can update any attribute except the Name. /// - /// May throw [OperationNotPermittedException]. /// May throw [ConcurrentModificationException]. + /// May throw [InvalidAccountStatusException]. + /// May throw [InvalidParameterCombinationException]. + /// May throw [InvalidRoleException]. + /// May throw [LimitExceededException]. + /// May throw [OperationNotPermittedException]. + /// May throw [RequestLimitExceededException]. + /// May throw [ResourceInUseException]. + /// May throw [ResourceNotAvailableException]. /// May throw [ResourceNotFoundException]. /// /// Parameter [name] : - /// The name of the application. This name is visible to users when display - /// name is not specified. + /// The unique name for the app block builder. /// - /// Parameter [appBlockArn] : - /// The ARN of the app block. + /// Parameter [accessEndpoints] : + /// The list of interface VPC endpoint (interface endpoint) objects. + /// Administrators can connect to the app block builder only through the + /// specified endpoints. /// /// Parameter [attributesToDelete] : - /// The attributes to delete for an application. + /// The attributes to delete from the app block builder. /// /// Parameter [description] : - /// The description of the application. + /// The description of the app block builder. /// /// Parameter [displayName] : - /// The display name of the application. This name is visible to users in the - /// application catalog. + /// The display name of the app block builder. /// - /// Parameter [iconS3Location] : - /// The icon S3 location of the application. + /// Parameter [enableDefaultInternetAccess] : + /// Enables or disables default internet access for the app block builder. /// - /// Parameter [launchParameters] : - /// The launch parameters of the application. + /// Parameter [iamRoleArn] : + /// The Amazon Resource Name (ARN) of the IAM role to apply to the app block + /// builder. To assume a role, the app block builder calls the AWS Security + /// Token Service (STS) AssumeRole API operation and passes the + /// ARN of the role to use. The operation creates a new session with temporary + /// credentials. AppStream 2.0 retrieves the temporary credentials and creates + /// the appstream_machine_role credential profile on the instance. /// - /// Parameter [launchPath] : - /// The launch path of the application. + /// For more information, see Using + /// an IAM Role to Grant Permissions to Applications and Scripts Running on + /// AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 + /// Administration Guide. /// - /// Parameter [workingDirectory] : - /// The working directory of the application. - Future updateApplication({ + /// Parameter [instanceType] : + /// The instance type to use when launching the app block builder. The + /// following instance types are available: + /// + ///
          + ///
        • + /// stream.standard.small + ///
        • + ///
        • + /// stream.standard.medium + ///
        • + ///
        • + /// stream.standard.large + ///
        • + ///
        • + /// stream.standard.xlarge + ///
        • + ///
        • + /// stream.standard.2xlarge + ///
        • + ///
        + /// + /// Parameter [platform] : + /// The platform of the app block builder. + /// + /// WINDOWS_SERVER_2019 is the only valid value. + /// + /// Parameter [vpcConfig] : + /// The VPC configuration for the app block builder. + /// + /// App block builders require that you specify at least two subnets in + /// different availability zones. + Future updateAppBlockBuilder({ required String name, - String? appBlockArn, - List? attributesToDelete, + List? accessEndpoints, + List? attributesToDelete, String? description, String? displayName, - S3Location? iconS3Location, - String? launchParameters, - String? launchPath, - String? workingDirectory, + bool? enableDefaultInternetAccess, + String? iamRoleArn, + String? instanceType, + PlatformType? platform, + VpcConfig? vpcConfig, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'PhotonAdminProxyService.UpdateApplication' + 'X-Amz-Target': 'PhotonAdminProxyService.UpdateAppBlockBuilder' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3126,14 +3636,89 @@ class AppStream { headers: headers, payload: { 'Name': name, - if (appBlockArn != null) 'AppBlockArn': appBlockArn, + if (accessEndpoints != null) 'AccessEndpoints': accessEndpoints, if (attributesToDelete != null) 'AttributesToDelete': attributesToDelete.map((e) => e.toValue()).toList(), if (description != null) 'Description': description, if (displayName != null) 'DisplayName': displayName, - if (iconS3Location != null) 'IconS3Location': iconS3Location, - if (launchParameters != null) 'LaunchParameters': launchParameters, + if (enableDefaultInternetAccess != null) + 'EnableDefaultInternetAccess': enableDefaultInternetAccess, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (instanceType != null) 'InstanceType': instanceType, + if (platform != null) 'Platform': platform.toValue(), + if (vpcConfig != null) 'VpcConfig': vpcConfig, + }, + ); + + return UpdateAppBlockBuilderResult.fromJson(jsonResponse.body); + } + + /// Updates the specified application. + /// + /// May throw [OperationNotPermittedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [name] : + /// The name of the application. This name is visible to users when display + /// name is not specified. + /// + /// Parameter [appBlockArn] : + /// The ARN of the app block. + /// + /// Parameter [attributesToDelete] : + /// The attributes to delete for an application. + /// + /// Parameter [description] : + /// The description of the application. + /// + /// Parameter [displayName] : + /// The display name of the application. This name is visible to users in the + /// application catalog. + /// + /// Parameter [iconS3Location] : + /// The icon S3 location of the application. + /// + /// Parameter [launchParameters] : + /// The launch parameters of the application. + /// + /// Parameter [launchPath] : + /// The launch path of the application. + /// + /// Parameter [workingDirectory] : + /// The working directory of the application. + Future updateApplication({ + required String name, + String? appBlockArn, + List? attributesToDelete, + String? description, + String? displayName, + S3Location? iconS3Location, + String? launchParameters, + String? launchPath, + String? workingDirectory, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'PhotonAdminProxyService.UpdateApplication' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + if (appBlockArn != null) 'AppBlockArn': appBlockArn, + if (attributesToDelete != null) + 'AttributesToDelete': + attributesToDelete.map((e) => e.toValue()).toList(), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (iconS3Location != null) 'IconS3Location': iconS3Location, + if (launchParameters != null) 'LaunchParameters': launchParameters, if (launchPath != null) 'LaunchPath': launchPath, if (workingDirectory != null) 'WorkingDirectory': workingDirectory, }, @@ -3510,6 +4095,10 @@ class AppStream { /// Parameter [maxConcurrentSessions] : /// The maximum number of concurrent sessions for a fleet. /// + /// Parameter [maxSessionsPerInstance] : + /// The maximum number of user sessions on an instance. This only applies to + /// multi-session fleets. + /// /// Parameter [maxUserDurationInSeconds] : /// The maximum amount of time that a streaming session can remain active, in /// seconds. If users are still connected to a streaming instance five minutes @@ -3517,7 +4106,7 @@ class AppStream { /// before being disconnected. After this time elapses, the instance is /// terminated and replaced by a new instance. /// - /// Specify a value between 600 and 360000. + /// Specify a value between 600 and 432000. /// /// Parameter [name] : /// A unique name for the fleet. @@ -3563,6 +4152,7 @@ class AppStream { String? imageName, String? instanceType, int? maxConcurrentSessions, + int? maxSessionsPerInstance, int? maxUserDurationInSeconds, String? name, PlatformType? platform, @@ -3602,6 +4192,8 @@ class AppStream { if (instanceType != null) 'InstanceType': instanceType, if (maxConcurrentSessions != null) 'MaxConcurrentSessions': maxConcurrentSessions, + if (maxSessionsPerInstance != null) + 'MaxSessionsPerInstance': maxSessionsPerInstance, if (maxUserDurationInSeconds != null) 'MaxUserDurationInSeconds': maxUserDurationInSeconds, if (name != null) 'Name': name, @@ -3894,8 +4486,8 @@ class AppBlock { /// The name of the app block. final String name; - /// The setup script details of the app block. - final ScriptDetails setupScriptDetails; + /// The errors of the app block. + final List? appBlockErrors; /// The created time of the app block. final DateTime? createdTime; @@ -3906,52 +4498,441 @@ class AppBlock { /// The display name of the app block. final String? displayName; + /// The packaging type of the app block. + final PackagingType? packagingType; + + /// The post setup script details of the app block. + /// + /// This only applies to app blocks with PackagingType APPSTREAM2. + final ScriptDetails? postSetupScriptDetails; + + /// The setup script details of the app block. + /// + /// This only applies to app blocks with PackagingType CUSTOM. + final ScriptDetails? setupScriptDetails; + /// The source S3 location of the app block. final S3Location? sourceS3Location; + /// The state of the app block. + /// + /// An app block with AppStream 2.0 packaging will be in the + /// INACTIVE state if no application package (VHD) is assigned to + /// it. After an application package (VHD) is created by an app block builder + /// for an app block, it becomes ACTIVE. + /// + /// Custom app blocks are always in the ACTIVE state and no action + /// is required to use them. + final AppBlockState? state; + AppBlock({ required this.arn, required this.name, - required this.setupScriptDetails, + this.appBlockErrors, this.createdTime, this.description, this.displayName, + this.packagingType, + this.postSetupScriptDetails, + this.setupScriptDetails, this.sourceS3Location, + this.state, + }); + + factory AppBlock.fromJson(Map json) { + return AppBlock( + arn: json['Arn'] as String, + name: json['Name'] as String, + appBlockErrors: (json['AppBlockErrors'] as List?) + ?.whereNotNull() + .map((e) => ErrorDetails.fromJson(e as Map)) + .toList(), + createdTime: timeStampFromJson(json['CreatedTime']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + packagingType: (json['PackagingType'] as String?)?.toPackagingType(), + postSetupScriptDetails: json['PostSetupScriptDetails'] != null + ? ScriptDetails.fromJson( + json['PostSetupScriptDetails'] as Map) + : null, + setupScriptDetails: json['SetupScriptDetails'] != null + ? ScriptDetails.fromJson( + json['SetupScriptDetails'] as Map) + : null, + sourceS3Location: json['SourceS3Location'] != null + ? S3Location.fromJson( + json['SourceS3Location'] as Map) + : null, + state: (json['State'] as String?)?.toAppBlockState(), + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final appBlockErrors = this.appBlockErrors; + final createdTime = this.createdTime; + final description = this.description; + final displayName = this.displayName; + final packagingType = this.packagingType; + final postSetupScriptDetails = this.postSetupScriptDetails; + final setupScriptDetails = this.setupScriptDetails; + final sourceS3Location = this.sourceS3Location; + final state = this.state; + return { + 'Arn': arn, + 'Name': name, + if (appBlockErrors != null) 'AppBlockErrors': appBlockErrors, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (packagingType != null) 'PackagingType': packagingType.toValue(), + if (postSetupScriptDetails != null) + 'PostSetupScriptDetails': postSetupScriptDetails, + if (setupScriptDetails != null) 'SetupScriptDetails': setupScriptDetails, + if (sourceS3Location != null) 'SourceS3Location': sourceS3Location, + if (state != null) 'State': state.toValue(), + }; + } +} + +/// Describes an app block builder. +class AppBlockBuilder { + /// The ARN of the app block builder. + final String arn; + + /// The instance type of the app block builder. + final String instanceType; + + /// The name of the app block builder. + final String name; + + /// The platform of the app block builder. + /// + /// WINDOWS_SERVER_2019 is the only valid value. + final AppBlockBuilderPlatformType platform; + + /// The state of the app block builder. + final AppBlockBuilderState state; + + /// The VPC configuration for the app block builder. + final VpcConfig vpcConfig; + + /// The list of interface VPC endpoint (interface endpoint) objects. + /// Administrators can connect to the app block builder only through the + /// specified endpoints. + final List? accessEndpoints; + + /// The app block builder errors. + final List? appBlockBuilderErrors; + + /// The creation time of the app block builder. + final DateTime? createdTime; + + /// The description of the app block builder. + final String? description; + + /// The display name of the app block builder. + final String? displayName; + + /// Indicates whether default internet access is enabled for the app block + /// builder. + final bool? enableDefaultInternetAccess; + + /// The ARN of the IAM role that is applied to the app block builder. + final String? iamRoleArn; + + /// The state change reason. + final AppBlockBuilderStateChangeReason? stateChangeReason; + + AppBlockBuilder({ + required this.arn, + required this.instanceType, + required this.name, + required this.platform, + required this.state, + required this.vpcConfig, + this.accessEndpoints, + this.appBlockBuilderErrors, + this.createdTime, + this.description, + this.displayName, + this.enableDefaultInternetAccess, + this.iamRoleArn, + this.stateChangeReason, + }); + + factory AppBlockBuilder.fromJson(Map json) { + return AppBlockBuilder( + arn: json['Arn'] as String, + instanceType: json['InstanceType'] as String, + name: json['Name'] as String, + platform: (json['Platform'] as String).toAppBlockBuilderPlatformType(), + state: (json['State'] as String).toAppBlockBuilderState(), + vpcConfig: VpcConfig.fromJson(json['VpcConfig'] as Map), + accessEndpoints: (json['AccessEndpoints'] as List?) + ?.whereNotNull() + .map((e) => AccessEndpoint.fromJson(e as Map)) + .toList(), + appBlockBuilderErrors: (json['AppBlockBuilderErrors'] as List?) + ?.whereNotNull() + .map((e) => ResourceError.fromJson(e as Map)) + .toList(), + createdTime: timeStampFromJson(json['CreatedTime']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + enableDefaultInternetAccess: json['EnableDefaultInternetAccess'] as bool?, + iamRoleArn: json['IamRoleArn'] as String?, + stateChangeReason: json['StateChangeReason'] != null + ? AppBlockBuilderStateChangeReason.fromJson( + json['StateChangeReason'] as Map) + : null, + ); + } + + Map toJson() { + final arn = this.arn; + final instanceType = this.instanceType; + final name = this.name; + final platform = this.platform; + final state = this.state; + final vpcConfig = this.vpcConfig; + final accessEndpoints = this.accessEndpoints; + final appBlockBuilderErrors = this.appBlockBuilderErrors; + final createdTime = this.createdTime; + final description = this.description; + final displayName = this.displayName; + final enableDefaultInternetAccess = this.enableDefaultInternetAccess; + final iamRoleArn = this.iamRoleArn; + final stateChangeReason = this.stateChangeReason; + return { + 'Arn': arn, + 'InstanceType': instanceType, + 'Name': name, + 'Platform': platform.toValue(), + 'State': state.toValue(), + 'VpcConfig': vpcConfig, + if (accessEndpoints != null) 'AccessEndpoints': accessEndpoints, + if (appBlockBuilderErrors != null) + 'AppBlockBuilderErrors': appBlockBuilderErrors, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (enableDefaultInternetAccess != null) + 'EnableDefaultInternetAccess': enableDefaultInternetAccess, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (stateChangeReason != null) 'StateChangeReason': stateChangeReason, + }; + } +} + +/// Describes an association between an app block builder and app block. +class AppBlockBuilderAppBlockAssociation { + /// The ARN of the app block. + final String appBlockArn; + + /// The name of the app block builder. + final String appBlockBuilderName; + + AppBlockBuilderAppBlockAssociation({ + required this.appBlockArn, + required this.appBlockBuilderName, + }); + + factory AppBlockBuilderAppBlockAssociation.fromJson( + Map json) { + return AppBlockBuilderAppBlockAssociation( + appBlockArn: json['AppBlockArn'] as String, + appBlockBuilderName: json['AppBlockBuilderName'] as String, + ); + } + + Map toJson() { + final appBlockArn = this.appBlockArn; + final appBlockBuilderName = this.appBlockBuilderName; + return { + 'AppBlockArn': appBlockArn, + 'AppBlockBuilderName': appBlockBuilderName, + }; + } +} + +enum AppBlockBuilderAttribute { + iamRoleArn, + accessEndpoints, + vpcConfigurationSecurityGroupIds, +} + +extension AppBlockBuilderAttributeValueExtension on AppBlockBuilderAttribute { + String toValue() { + switch (this) { + case AppBlockBuilderAttribute.iamRoleArn: + return 'IAM_ROLE_ARN'; + case AppBlockBuilderAttribute.accessEndpoints: + return 'ACCESS_ENDPOINTS'; + case AppBlockBuilderAttribute.vpcConfigurationSecurityGroupIds: + return 'VPC_CONFIGURATION_SECURITY_GROUP_IDS'; + } + } +} + +extension AppBlockBuilderAttributeFromString on String { + AppBlockBuilderAttribute toAppBlockBuilderAttribute() { + switch (this) { + case 'IAM_ROLE_ARN': + return AppBlockBuilderAttribute.iamRoleArn; + case 'ACCESS_ENDPOINTS': + return AppBlockBuilderAttribute.accessEndpoints; + case 'VPC_CONFIGURATION_SECURITY_GROUP_IDS': + return AppBlockBuilderAttribute.vpcConfigurationSecurityGroupIds; + } + throw Exception('$this is not known in enum AppBlockBuilderAttribute'); + } +} + +enum AppBlockBuilderPlatformType { + windowsServer_2019, +} + +extension AppBlockBuilderPlatformTypeValueExtension + on AppBlockBuilderPlatformType { + String toValue() { + switch (this) { + case AppBlockBuilderPlatformType.windowsServer_2019: + return 'WINDOWS_SERVER_2019'; + } + } +} + +extension AppBlockBuilderPlatformTypeFromString on String { + AppBlockBuilderPlatformType toAppBlockBuilderPlatformType() { + switch (this) { + case 'WINDOWS_SERVER_2019': + return AppBlockBuilderPlatformType.windowsServer_2019; + } + throw Exception('$this is not known in enum AppBlockBuilderPlatformType'); + } +} + +enum AppBlockBuilderState { + starting, + running, + stopping, + stopped, +} + +extension AppBlockBuilderStateValueExtension on AppBlockBuilderState { + String toValue() { + switch (this) { + case AppBlockBuilderState.starting: + return 'STARTING'; + case AppBlockBuilderState.running: + return 'RUNNING'; + case AppBlockBuilderState.stopping: + return 'STOPPING'; + case AppBlockBuilderState.stopped: + return 'STOPPED'; + } + } +} + +extension AppBlockBuilderStateFromString on String { + AppBlockBuilderState toAppBlockBuilderState() { + switch (this) { + case 'STARTING': + return AppBlockBuilderState.starting; + case 'RUNNING': + return AppBlockBuilderState.running; + case 'STOPPING': + return AppBlockBuilderState.stopping; + case 'STOPPED': + return AppBlockBuilderState.stopped; + } + throw Exception('$this is not known in enum AppBlockBuilderState'); + } +} + +/// Describes the reason why the last app block builder state change occurred. +class AppBlockBuilderStateChangeReason { + /// The state change reason code. + final AppBlockBuilderStateChangeReasonCode? code; + + /// The state change reason message. + final String? message; + + AppBlockBuilderStateChangeReason({ + this.code, + this.message, }); - factory AppBlock.fromJson(Map json) { - return AppBlock( - arn: json['Arn'] as String, - name: json['Name'] as String, - setupScriptDetails: ScriptDetails.fromJson( - json['SetupScriptDetails'] as Map), - createdTime: timeStampFromJson(json['CreatedTime']), - description: json['Description'] as String?, - displayName: json['DisplayName'] as String?, - sourceS3Location: json['SourceS3Location'] != null - ? S3Location.fromJson( - json['SourceS3Location'] as Map) - : null, - ); + factory AppBlockBuilderStateChangeReason.fromJson(Map json) { + return AppBlockBuilderStateChangeReason( + code: (json['Code'] as String?)?.toAppBlockBuilderStateChangeReasonCode(), + message: json['Message'] as String?, + ); + } + + Map toJson() { + final code = this.code; + final message = this.message; + return { + if (code != null) 'Code': code.toValue(), + if (message != null) 'Message': message, + }; + } +} + +enum AppBlockBuilderStateChangeReasonCode { + internalError, +} + +extension AppBlockBuilderStateChangeReasonCodeValueExtension + on AppBlockBuilderStateChangeReasonCode { + String toValue() { + switch (this) { + case AppBlockBuilderStateChangeReasonCode.internalError: + return 'INTERNAL_ERROR'; + } + } +} + +extension AppBlockBuilderStateChangeReasonCodeFromString on String { + AppBlockBuilderStateChangeReasonCode + toAppBlockBuilderStateChangeReasonCode() { + switch (this) { + case 'INTERNAL_ERROR': + return AppBlockBuilderStateChangeReasonCode.internalError; + } + throw Exception( + '$this is not known in enum AppBlockBuilderStateChangeReasonCode'); + } +} + +enum AppBlockState { + inactive, + active, +} + +extension AppBlockStateValueExtension on AppBlockState { + String toValue() { + switch (this) { + case AppBlockState.inactive: + return 'INACTIVE'; + case AppBlockState.active: + return 'ACTIVE'; + } } +} - Map toJson() { - final arn = this.arn; - final name = this.name; - final setupScriptDetails = this.setupScriptDetails; - final createdTime = this.createdTime; - final description = this.description; - final displayName = this.displayName; - final sourceS3Location = this.sourceS3Location; - return { - 'Arn': arn, - 'Name': name, - 'SetupScriptDetails': setupScriptDetails, - if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), - if (description != null) 'Description': description, - if (displayName != null) 'DisplayName': displayName, - if (sourceS3Location != null) 'SourceS3Location': sourceS3Location, - }; +extension AppBlockStateFromString on String { + AppBlockState toAppBlockState() { + switch (this) { + case 'INACTIVE': + return AppBlockState.inactive; + case 'ACTIVE': + return AppBlockState.active; + } + throw Exception('$this is not known in enum AppBlockState'); } } @@ -4241,6 +5222,37 @@ class ApplicationSettingsResponse { } } +class AssociateAppBlockBuilderAppBlockResult { + /// The list of app block builders associated with app blocks. + final AppBlockBuilderAppBlockAssociation? appBlockBuilderAppBlockAssociation; + + AssociateAppBlockBuilderAppBlockResult({ + this.appBlockBuilderAppBlockAssociation, + }); + + factory AssociateAppBlockBuilderAppBlockResult.fromJson( + Map json) { + return AssociateAppBlockBuilderAppBlockResult( + appBlockBuilderAppBlockAssociation: + json['AppBlockBuilderAppBlockAssociation'] != null + ? AppBlockBuilderAppBlockAssociation.fromJson( + json['AppBlockBuilderAppBlockAssociation'] + as Map) + : null, + ); + } + + Map toJson() { + final appBlockBuilderAppBlockAssociation = + this.appBlockBuilderAppBlockAssociation; + return { + if (appBlockBuilderAppBlockAssociation != null) + 'AppBlockBuilderAppBlockAssociation': + appBlockBuilderAppBlockAssociation, + }; + } +} + class AssociateApplicationFleetResult { /// If fleet name is specified, this returns the list of applications that are /// associated to it. If application ARN is specified, this returns the list of @@ -4460,16 +5472,27 @@ extension CertificateBasedAuthStatusFromString on String { /// Describes the capacity for a fleet. class ComputeCapacity { /// The desired number of streaming instances. - final int desiredInstances; + final int? desiredInstances; + + /// The desired number of user sessions for a multi-session fleet. This is not + /// allowed for single-session fleets. + /// + /// When you create a fleet, you must set either the DesiredSessions or + /// DesiredInstances attribute, based on the type of fleet you create. You can’t + /// define both attributes or leave both attributes blank. + final int? desiredSessions; ComputeCapacity({ - required this.desiredInstances, + this.desiredInstances, + this.desiredSessions, }); Map toJson() { final desiredInstances = this.desiredInstances; + final desiredSessions = this.desiredSessions; return { - 'DesiredInstances': desiredInstances, + if (desiredInstances != null) 'DesiredInstances': desiredInstances, + if (desiredSessions != null) 'DesiredSessions': desiredSessions, }; } } @@ -4479,10 +5502,41 @@ class ComputeCapacityStatus { /// The desired number of streaming instances. final int desired; + /// The number of user sessions currently being used for streaming sessions. + /// This only applies to multi-session fleets. + final int? activeUserSessions; + + /// The total number of session slots that are available for streaming or are + /// currently streaming. + /// + /// ActualUserSessionCapacity = AvailableUserSessionCapacity + + /// ActiveUserSessions + /// + /// This only applies to multi-session fleets. + final int? actualUserSessions; + /// The number of currently available instances that can be used to stream /// sessions. final int? available; + /// The number of idle session slots currently available for user sessions. + /// + /// AvailableUserSessionCapacity = ActualUserSessionCapacity - + /// ActiveUserSessions + /// + /// This only applies to multi-session fleets. + final int? availableUserSessions; + + /// The total number of sessions slots that are either running or pending. This + /// represents the total number of concurrent streaming sessions your fleet can + /// support in a steady state. + /// + /// DesiredUserSessionCapacity = ActualUserSessionCapacity + + /// PendingUserSessionCapacity + /// + /// This only applies to multi-session fleets. + final int? desiredUserSessions; + /// The number of instances in use for streaming. final int? inUse; @@ -4491,7 +5545,11 @@ class ComputeCapacityStatus { ComputeCapacityStatus({ required this.desired, + this.activeUserSessions, + this.actualUserSessions, this.available, + this.availableUserSessions, + this.desiredUserSessions, this.inUse, this.running, }); @@ -4499,7 +5557,11 @@ class ComputeCapacityStatus { factory ComputeCapacityStatus.fromJson(Map json) { return ComputeCapacityStatus( desired: json['Desired'] as int, + activeUserSessions: json['ActiveUserSessions'] as int?, + actualUserSessions: json['ActualUserSessions'] as int?, available: json['Available'] as int?, + availableUserSessions: json['AvailableUserSessions'] as int?, + desiredUserSessions: json['DesiredUserSessions'] as int?, inUse: json['InUse'] as int?, running: json['Running'] as int?, ); @@ -4507,12 +5569,22 @@ class ComputeCapacityStatus { Map toJson() { final desired = this.desired; + final activeUserSessions = this.activeUserSessions; + final actualUserSessions = this.actualUserSessions; final available = this.available; + final availableUserSessions = this.availableUserSessions; + final desiredUserSessions = this.desiredUserSessions; final inUse = this.inUse; final running = this.running; return { 'Desired': desired, + if (activeUserSessions != null) 'ActiveUserSessions': activeUserSessions, + if (actualUserSessions != null) 'ActualUserSessions': actualUserSessions, if (available != null) 'Available': available, + if (availableUserSessions != null) + 'AvailableUserSessions': availableUserSessions, + if (desiredUserSessions != null) + 'DesiredUserSessions': desiredUserSessions, if (inUse != null) 'InUse': inUse, if (running != null) 'Running': running, }; @@ -4542,6 +5614,60 @@ class CopyImageResponse { } } +class CreateAppBlockBuilderResult { + final AppBlockBuilder? appBlockBuilder; + + CreateAppBlockBuilderResult({ + this.appBlockBuilder, + }); + + factory CreateAppBlockBuilderResult.fromJson(Map json) { + return CreateAppBlockBuilderResult( + appBlockBuilder: json['AppBlockBuilder'] != null + ? AppBlockBuilder.fromJson( + json['AppBlockBuilder'] as Map) + : null, + ); + } + + Map toJson() { + final appBlockBuilder = this.appBlockBuilder; + return { + if (appBlockBuilder != null) 'AppBlockBuilder': appBlockBuilder, + }; + } +} + +class CreateAppBlockBuilderStreamingURLResult { + /// The elapsed time, in seconds after the Unix epoch, when this URL expires. + final DateTime? expires; + + /// The URL to start the streaming session. + final String? streamingURL; + + CreateAppBlockBuilderStreamingURLResult({ + this.expires, + this.streamingURL, + }); + + factory CreateAppBlockBuilderStreamingURLResult.fromJson( + Map json) { + return CreateAppBlockBuilderStreamingURLResult( + expires: timeStampFromJson(json['Expires']), + streamingURL: json['StreamingURL'] as String?, + ); + } + + Map toJson() { + final expires = this.expires; + final streamingURL = this.streamingURL; + return { + if (expires != null) 'Expires': unixTimestampToJson(expires), + if (streamingURL != null) 'StreamingURL': streamingURL, + }; + } +} + class CreateAppBlockResult { /// The app block. final AppBlock? appBlock; @@ -4848,6 +5974,18 @@ class CreateUserResult { } } +class DeleteAppBlockBuilderResult { + DeleteAppBlockBuilderResult(); + + factory DeleteAppBlockBuilderResult.fromJson(Map _) { + return DeleteAppBlockBuilderResult(); + } + + Map toJson() { + return {}; + } +} + class DeleteAppBlockResult { DeleteAppBlockResult(); @@ -5004,6 +6142,79 @@ class DeleteUserResult { } } +class DescribeAppBlockBuilderAppBlockAssociationsResult { + /// This list of app block builders associated with app blocks. + final List? + appBlockBuilderAppBlockAssociations; + + /// The pagination token used to retrieve the next page of results for this + /// operation. + final String? nextToken; + + DescribeAppBlockBuilderAppBlockAssociationsResult({ + this.appBlockBuilderAppBlockAssociations, + this.nextToken, + }); + + factory DescribeAppBlockBuilderAppBlockAssociationsResult.fromJson( + Map json) { + return DescribeAppBlockBuilderAppBlockAssociationsResult( + appBlockBuilderAppBlockAssociations: + (json['AppBlockBuilderAppBlockAssociations'] as List?) + ?.whereNotNull() + .map((e) => AppBlockBuilderAppBlockAssociation.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final appBlockBuilderAppBlockAssociations = + this.appBlockBuilderAppBlockAssociations; + final nextToken = this.nextToken; + return { + if (appBlockBuilderAppBlockAssociations != null) + 'AppBlockBuilderAppBlockAssociations': + appBlockBuilderAppBlockAssociations, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class DescribeAppBlockBuildersResult { + /// The list that describes one or more app block builders. + final List? appBlockBuilders; + + /// The pagination token used to retrieve the next page of results for this + /// operation. + final String? nextToken; + + DescribeAppBlockBuildersResult({ + this.appBlockBuilders, + this.nextToken, + }); + + factory DescribeAppBlockBuildersResult.fromJson(Map json) { + return DescribeAppBlockBuildersResult( + appBlockBuilders: (json['AppBlockBuilders'] as List?) + ?.whereNotNull() + .map((e) => AppBlockBuilder.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final appBlockBuilders = this.appBlockBuilders; + final nextToken = this.nextToken; + return { + if (appBlockBuilders != null) 'AppBlockBuilders': appBlockBuilders, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class DescribeAppBlocksResult { /// The app blocks in the list. final List? appBlocks; @@ -5575,6 +6786,19 @@ class DisableUserResult { } } +class DisassociateAppBlockBuilderAppBlockResult { + DisassociateAppBlockBuilderAppBlockResult(); + + factory DisassociateAppBlockBuilderAppBlockResult.fromJson( + Map _) { + return DisassociateAppBlockBuilderAppBlockResult(); + } + + Map toJson() { + return {}; + } +} + class DisassociateApplicationFleetResult { DisassociateApplicationFleetResult(); @@ -5820,6 +7044,36 @@ class EntitlementAttribute { } } +/// The error details. +class ErrorDetails { + /// The error code. + final String? errorCode; + + /// The error message. + final String? errorMessage; + + ErrorDetails({ + this.errorCode, + this.errorMessage, + }); + + factory ErrorDetails.fromJson(Map json) { + return ErrorDetails( + errorCode: json['ErrorCode'] as String?, + errorMessage: json['ErrorMessage'] as String?, + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; + return { + if (errorCode != null) 'ErrorCode': errorCode, + if (errorMessage != null) 'ErrorMessage': errorMessage, + }; + } +} + class ExpireSessionResult { ExpireSessionResult(); @@ -6040,6 +7294,10 @@ class Fleet { /// The maximum number of concurrent sessions for the fleet. final int? maxConcurrentSessions; + /// The maximum number of user sessions on an instance. This only applies to + /// multi-session fleets. + final int? maxSessionsPerInstance; + /// The maximum amount of time that a streaming session can remain active, in /// seconds. If users are still connected to a streaming instance five minutes /// before this limit is reached, they are prompted to save any open documents @@ -6090,6 +7348,7 @@ class Fleet { this.imageArn, this.imageName, this.maxConcurrentSessions, + this.maxSessionsPerInstance, this.maxUserDurationInSeconds, this.platform, this.sessionScriptS3Location, @@ -6126,6 +7385,7 @@ class Fleet { imageArn: json['ImageArn'] as String?, imageName: json['ImageName'] as String?, maxConcurrentSessions: json['MaxConcurrentSessions'] as int?, + maxSessionsPerInstance: json['MaxSessionsPerInstance'] as int?, maxUserDurationInSeconds: json['MaxUserDurationInSeconds'] as int?, platform: (json['Platform'] as String?)?.toPlatformType(), sessionScriptS3Location: json['SessionScriptS3Location'] != null @@ -6162,6 +7422,7 @@ class Fleet { final imageArn = this.imageArn; final imageName = this.imageName; final maxConcurrentSessions = this.maxConcurrentSessions; + final maxSessionsPerInstance = this.maxSessionsPerInstance; final maxUserDurationInSeconds = this.maxUserDurationInSeconds; final platform = this.platform; final sessionScriptS3Location = this.sessionScriptS3Location; @@ -6191,6 +7452,8 @@ class Fleet { if (imageName != null) 'ImageName': imageName, if (maxConcurrentSessions != null) 'MaxConcurrentSessions': maxConcurrentSessions, + if (maxSessionsPerInstance != null) + 'MaxSessionsPerInstance': maxSessionsPerInstance, if (maxUserDurationInSeconds != null) 'MaxUserDurationInSeconds': maxUserDurationInSeconds, if (platform != null) 'Platform': platform.toValue(), @@ -6212,6 +7475,7 @@ enum FleetAttribute { iamRoleArn, usbDeviceFilterStrings, sessionScriptS3Location, + maxSessionsPerInstance, } extension FleetAttributeValueExtension on FleetAttribute { @@ -6229,6 +7493,8 @@ extension FleetAttributeValueExtension on FleetAttribute { return 'USB_DEVICE_FILTER_STRINGS'; case FleetAttribute.sessionScriptS3Location: return 'SESSION_SCRIPT_S3_LOCATION'; + case FleetAttribute.maxSessionsPerInstance: + return 'MAX_SESSIONS_PER_INSTANCE'; } } } @@ -6248,6 +7514,8 @@ extension FleetAttributeFromString on String { return FleetAttribute.usbDeviceFilterStrings; case 'SESSION_SCRIPT_S3_LOCATION': return FleetAttribute.sessionScriptS3Location; + case 'MAX_SESSIONS_PER_INSTANCE': + return FleetAttribute.maxSessionsPerInstance; } throw Exception('$this is not known in enum FleetAttribute'); } @@ -7457,6 +8725,34 @@ class NetworkAccessConfiguration { } } +enum PackagingType { + custom, + appstream2, +} + +extension PackagingTypeValueExtension on PackagingType { + String toValue() { + switch (this) { + case PackagingType.custom: + return 'CUSTOM'; + case PackagingType.appstream2: + return 'APPSTREAM2'; + } + } +} + +extension PackagingTypeFromString on String { + PackagingType toPackagingType() { + switch (this) { + case 'CUSTOM': + return PackagingType.custom; + case 'APPSTREAM2': + return PackagingType.appstream2; + } + throw Exception('$this is not known in enum PackagingType'); + } +} + enum Permission { enabled, disabled, @@ -7489,6 +8785,7 @@ enum PlatformType { windows, windowsServer_2016, windowsServer_2019, + windowsServer_2022, amazonLinux2, } @@ -7501,6 +8798,8 @@ extension PlatformTypeValueExtension on PlatformType { return 'WINDOWS_SERVER_2016'; case PlatformType.windowsServer_2019: return 'WINDOWS_SERVER_2019'; + case PlatformType.windowsServer_2022: + return 'WINDOWS_SERVER_2022'; case PlatformType.amazonLinux2: return 'AMAZON_LINUX2'; } @@ -7516,6 +8815,8 @@ extension PlatformTypeFromString on String { return PlatformType.windowsServer_2016; case 'WINDOWS_SERVER_2019': return PlatformType.windowsServer_2019; + case 'WINDOWS_SERVER_2022': + return PlatformType.windowsServer_2022; case 'AMAZON_LINUX2': return PlatformType.amazonLinux2; } @@ -7595,17 +8896,42 @@ class S3Location { final String s3Bucket; /// The S3 key of the S3 object. - final String s3Key; + /// + /// This is required when used for the following: + /// + ///
          + ///
        • + /// IconS3Location (Actions: CreateApplication and UpdateApplication) + ///
        • + ///
        • + /// SessionScriptS3Location (Actions: CreateFleet and UpdateFleet) + ///
        • + ///
        • + /// ScriptDetails (Actions: CreateAppBlock) + ///
        • + ///
        • + /// SourceS3Location when creating an app block with CUSTOM + /// PackagingType (Actions: CreateAppBlock) + ///
        • + ///
        • + /// SourceS3Location when creating an app block with APPSTREAM2 + /// PackagingType, and using an existing application package (VHD file). In this + /// case, S3Key refers to the VHD file. If a new application + /// package is required, then S3Key is not required. (Actions: + /// CreateAppBlock) + ///
        • + ///
        + final String? s3Key; S3Location({ required this.s3Bucket, - required this.s3Key, + this.s3Key, }); factory S3Location.fromJson(Map json) { return S3Location( s3Bucket: json['S3Bucket'] as String, - s3Key: json['S3Key'] as String, + s3Key: json['S3Key'] as String?, ); } @@ -7614,7 +8940,7 @@ class S3Location { final s3Key = this.s3Key; return { 'S3Bucket': s3Bucket, - 'S3Key': s3Key, + if (s3Key != null) 'S3Key': s3Key, }; } } @@ -7723,6 +9049,9 @@ class Session { /// Specifies whether a user is connected to the streaming session. final SessionConnectionState? connectionState; + /// The identifier for the instance hosting the session. + final String? instanceId; + /// The time when the streaming session is set to expire. This time is based on /// the MaxUserDurationinSeconds value, which determines the /// maximum length of time that a streaming session can run. A streaming session @@ -7748,6 +9077,7 @@ class Session { required this.userId, this.authenticationType, this.connectionState, + this.instanceId, this.maxExpirationTime, this.networkAccessConfiguration, this.startTime, @@ -7764,6 +9094,7 @@ class Session { (json['AuthenticationType'] as String?)?.toAuthenticationType(), connectionState: (json['ConnectionState'] as String?)?.toSessionConnectionState(), + instanceId: json['InstanceId'] as String?, maxExpirationTime: timeStampFromJson(json['MaxExpirationTime']), networkAccessConfiguration: json['NetworkAccessConfiguration'] != null ? NetworkAccessConfiguration.fromJson( @@ -7781,6 +9112,7 @@ class Session { final userId = this.userId; final authenticationType = this.authenticationType; final connectionState = this.connectionState; + final instanceId = this.instanceId; final maxExpirationTime = this.maxExpirationTime; final networkAccessConfiguration = this.networkAccessConfiguration; final startTime = this.startTime; @@ -7793,6 +9125,7 @@ class Session { if (authenticationType != null) 'AuthenticationType': authenticationType.toValue(), if (connectionState != null) 'ConnectionState': connectionState.toValue(), + if (instanceId != null) 'InstanceId': instanceId, if (maxExpirationTime != null) 'MaxExpirationTime': unixTimestampToJson(maxExpirationTime), if (networkAccessConfiguration != null) @@ -8175,6 +9508,30 @@ extension StackErrorCodeFromString on String { } } +class StartAppBlockBuilderResult { + final AppBlockBuilder? appBlockBuilder; + + StartAppBlockBuilderResult({ + this.appBlockBuilder, + }); + + factory StartAppBlockBuilderResult.fromJson(Map json) { + return StartAppBlockBuilderResult( + appBlockBuilder: json['AppBlockBuilder'] != null + ? AppBlockBuilder.fromJson( + json['AppBlockBuilder'] as Map) + : null, + ); + } + + Map toJson() { + final appBlockBuilder = this.appBlockBuilder; + return { + if (appBlockBuilder != null) 'AppBlockBuilder': appBlockBuilder, + }; + } +} + class StartFleetResult { StartFleetResult(); @@ -8211,6 +9568,30 @@ class StartImageBuilderResult { } } +class StopAppBlockBuilderResult { + final AppBlockBuilder? appBlockBuilder; + + StopAppBlockBuilderResult({ + this.appBlockBuilder, + }); + + factory StopAppBlockBuilderResult.fromJson(Map json) { + return StopAppBlockBuilderResult( + appBlockBuilder: json['AppBlockBuilder'] != null + ? AppBlockBuilder.fromJson( + json['AppBlockBuilder'] as Map) + : null, + ); + } + + Map toJson() { + final appBlockBuilder = this.appBlockBuilder; + return { + if (appBlockBuilder != null) 'AppBlockBuilder': appBlockBuilder, + }; + } +} + class StopFleetResult { StopFleetResult(); @@ -8400,6 +9781,30 @@ class UntagResourceResponse { } } +class UpdateAppBlockBuilderResult { + final AppBlockBuilder? appBlockBuilder; + + UpdateAppBlockBuilderResult({ + this.appBlockBuilder, + }); + + factory UpdateAppBlockBuilderResult.fromJson(Map json) { + return UpdateAppBlockBuilderResult( + appBlockBuilder: json['AppBlockBuilder'] != null + ? AppBlockBuilder.fromJson( + json['AppBlockBuilder'] as Map) + : null, + ); + } + + Map toJson() { + final appBlockBuilder = this.appBlockBuilder; + return { + if (appBlockBuilder != null) 'AppBlockBuilder': appBlockBuilder, + }; + } +} + class UpdateApplicationResult { final Application? application; @@ -8751,24 +10156,46 @@ class UserSetting { /// Indicates whether the action is enabled or disabled. final Permission permission; + /// Specifies the number of characters that can be copied by end users from the + /// local device to the remote session, and to the local device from the remote + /// session. + /// + /// This can be specified only for the + /// CLIPBOARD_COPY_FROM_LOCAL_DEVICE and + /// CLIPBOARD_COPY_TO_LOCAL_DEVICE actions. + /// + /// This defaults to 20,971,520 (20 MB) when unspecified and the permission is + /// ENABLED. This can't be specified when the permission is + /// DISABLED. + /// + /// This can only be specified for AlwaysOn and OnDemand fleets. The attribute + /// is not supported on Elastic fleets. + /// + /// The value can be between 1 and 20,971,520 (20 MB). + final int? maximumLength; + UserSetting({ required this.action, required this.permission, + this.maximumLength, }); factory UserSetting.fromJson(Map json) { return UserSetting( action: (json['Action'] as String).toAction(), permission: (json['Permission'] as String).toPermission(), + maximumLength: json['MaximumLength'] as int?, ); } Map toJson() { final action = this.action; final permission = this.permission; + final maximumLength = this.maximumLength; return { 'Action': action.toValue(), 'Permission': permission.toValue(), + if (maximumLength != null) 'MaximumLength': maximumLength, }; } } diff --git a/aws_client/lib/src/generated/app_sync/v2017_07_25.dart b/aws_client/lib/src/generated/app_sync/v2017_07_25.dart index d7fe3d90c..4bd72234a 100644 --- a/aws_client/lib/src/generated/app_sync/v2017_07_25.dart +++ b/aws_client/lib/src/generated/app_sync/v2017_07_25.dart @@ -274,6 +274,25 @@ class AppSync { /// At-rest encryption flag for cache. You cannot update this setting after /// creation. /// + /// Parameter [healthMetricsConfig] : + /// Controls how cache health metrics will be emitted to CloudWatch. Cache + /// health metrics include: + /// + ///
          + ///
        • + /// NetworkBandwidthOutAllowanceExceeded: The network packets dropped because + /// the throughput exceeded the aggregated bandwidth limit. This is useful for + /// diagnosing bottlenecks in a cache configuration. + ///
        • + ///
        • + /// EngineCPUUtilization: The CPU utilization (percentage) allocated to the + /// Redis process. This is useful for diagnosing bottlenecks in a cache + /// configuration. + ///
        • + ///
        + /// Metrics will be recorded by API ID. You can set the value to + /// ENABLED or DISABLED. + /// /// Parameter [transitEncryptionEnabled] : /// Transit encryption flag when connecting to cache. You cannot update this /// setting after creation. @@ -283,6 +302,7 @@ class AppSync { required int ttl, required ApiCacheType type, bool? atRestEncryptionEnabled, + CacheHealthMetricsConfig? healthMetricsConfig, bool? transitEncryptionEnabled, }) async { final $payload = { @@ -291,6 +311,8 @@ class AppSync { 'type': type.toValue(), if (atRestEncryptionEnabled != null) 'atRestEncryptionEnabled': atRestEncryptionEnabled, + if (healthMetricsConfig != null) + 'healthMetricsConfig': healthMetricsConfig.toValue(), if (transitEncryptionEnabled != null) 'transitEncryptionEnabled': transitEncryptionEnabled, }; @@ -384,6 +406,19 @@ class AppSync { /// Parameter [lambdaConfig] : /// Lambda settings. /// + /// Parameter [metricsConfig] : + /// Enables or disables enhanced data source metrics for specified data + /// sources. Note that metricsConfig won't be used unless the + /// dataSourceLevelMetricsBehavior value is set to + /// PER_DATA_SOURCE_METRICS. If the + /// dataSourceLevelMetricsBehavior is set to + /// FULL_REQUEST_DATA_SOURCE_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + /// /// Parameter [openSearchServiceConfig] : /// Amazon OpenSearch Service settings. /// @@ -404,6 +439,7 @@ class AppSync { EventBridgeDataSourceConfig? eventBridgeConfig, HttpDataSourceConfig? httpConfig, LambdaDataSourceConfig? lambdaConfig, + DataSourceLevelMetricsConfig? metricsConfig, OpenSearchServiceDataSourceConfig? openSearchServiceConfig, RelationalDatabaseDataSourceConfig? relationalDatabaseConfig, String? serviceRoleArn, @@ -418,6 +454,7 @@ class AppSync { if (eventBridgeConfig != null) 'eventBridgeConfig': eventBridgeConfig, if (httpConfig != null) 'httpConfig': httpConfig, if (lambdaConfig != null) 'lambdaConfig': lambdaConfig, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (openSearchServiceConfig != null) 'openSearchServiceConfig': openSearchServiceConfig, if (relationalDatabaseConfig != null) @@ -477,6 +514,7 @@ class AppSync { /// May throw [NotFoundException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. + /// May throw [BadRequestException]. /// /// Parameter [apiId] : /// The GraphQL API ID. @@ -576,6 +614,19 @@ class AppSync { /// The value that indicates whether the GraphQL API is a standard API /// (GRAPHQL) or merged API (MERGED). /// + /// Parameter [enhancedMetricsConfig] : + /// The enhancedMetricsConfig object. + /// + /// Parameter [introspectionConfig] : + /// Sets the value of the GraphQL API to enable (ENABLED) or + /// disable (DISABLED) introspection. If no value is provided, + /// the introspection configuration will be set to ENABLED by + /// default. This field will produce an error if the operation attempts to use + /// the introspection feature while this field is disabled. + /// + /// For more information about introspection, see GraphQL introspection. + /// /// Parameter [lambdaAuthorizerConfig] : /// Configuration for Lambda function authorization. /// @@ -597,6 +648,25 @@ class AppSync { /// /// This field accepts any string input with a length of 0 - 256 characters. /// + /// Parameter [queryDepthLimit] : + /// The maximum depth a query can have in a single request. Depth refers to + /// the amount of nested levels allowed in the body of query. The default + /// value is 0 (or unspecified), which indicates there's no depth + /// limit. If you set a limit, it can be between 1 and + /// 75 nested levels. This field will produce a limit error if + /// the operation falls out of bounds. + /// + /// Note that fields can still be set to nullable or non-nullable. If a + /// non-nullable field produces an error, the error will be thrown upwards to + /// the first nullable field available. + /// + /// Parameter [resolverCountLimit] : + /// The maximum number of resolvers that can be invoked in a single request. + /// The default value is 0 (or unspecified), which will set the + /// limit to 10000. When specified, the limit value can be + /// between 1 and 10000. This field will produce a + /// limit error if the operation falls out of bounds. + /// /// Parameter [tags] : /// A TagMap object. /// @@ -617,22 +687,42 @@ class AppSync { required String name, List? additionalAuthenticationProviders, GraphQLApiType? apiType, + EnhancedMetricsConfig? enhancedMetricsConfig, + GraphQLApiIntrospectionConfig? introspectionConfig, LambdaAuthorizerConfig? lambdaAuthorizerConfig, LogConfig? logConfig, String? mergedApiExecutionRoleArn, OpenIDConnectConfig? openIDConnectConfig, String? ownerContact, + int? queryDepthLimit, + int? resolverCountLimit, Map? tags, UserPoolConfig? userPoolConfig, GraphQLApiVisibility? visibility, bool? xrayEnabled, }) async { + _s.validateNumRange( + 'queryDepthLimit', + queryDepthLimit, + 0, + 75, + ); + _s.validateNumRange( + 'resolverCountLimit', + resolverCountLimit, + 0, + 10000, + ); final $payload = { 'authenticationType': authenticationType.toValue(), 'name': name, if (additionalAuthenticationProviders != null) 'additionalAuthenticationProviders': additionalAuthenticationProviders, if (apiType != null) 'apiType': apiType.toValue(), + if (enhancedMetricsConfig != null) + 'enhancedMetricsConfig': enhancedMetricsConfig, + if (introspectionConfig != null) + 'introspectionConfig': introspectionConfig.toValue(), if (lambdaAuthorizerConfig != null) 'lambdaAuthorizerConfig': lambdaAuthorizerConfig, if (logConfig != null) 'logConfig': logConfig, @@ -641,6 +731,8 @@ class AppSync { if (openIDConnectConfig != null) 'openIDConnectConfig': openIDConnectConfig, if (ownerContact != null) 'ownerContact': ownerContact, + if (queryDepthLimit != null) 'queryDepthLimit': queryDepthLimit, + if (resolverCountLimit != null) 'resolverCountLimit': resolverCountLimit, if (tags != null) 'tags': tags, if (userPoolConfig != null) 'userPoolConfig': userPoolConfig, if (visibility != null) 'visibility': visibility.toValue(), @@ -706,6 +798,19 @@ class AppSync { /// Parameter [maxBatchSize] : /// The maximum batching size for a resolver. /// + /// Parameter [metricsConfig] : + /// Enables or disables enhanced resolver metrics for specified resolvers. + /// Note that metricsConfig won't be used unless the + /// resolverLevelMetricsBehavior value is set to + /// PER_RESOLVER_METRICS. If the + /// resolverLevelMetricsBehavior is set to + /// FULL_REQUEST_RESOLVER_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + /// /// Parameter [pipelineConfig] : /// The PipelineConfig. /// @@ -735,6 +840,7 @@ class AppSync { String? dataSourceName, ResolverKind? kind, int? maxBatchSize, + ResolverLevelMetricsConfig? metricsConfig, PipelineConfig? pipelineConfig, String? requestMappingTemplate, String? responseMappingTemplate, @@ -754,6 +860,7 @@ class AppSync { if (dataSourceName != null) 'dataSourceName': dataSourceName, if (kind != null) 'kind': kind.toValue(), if (maxBatchSize != null) 'maxBatchSize': maxBatchSize, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (pipelineConfig != null) 'pipelineConfig': pipelineConfig, if (requestMappingTemplate != null) 'requestMappingTemplate': requestMappingTemplate, @@ -908,6 +1015,7 @@ class AppSync { /// May throw [NotFoundException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. + /// May throw [BadRequestException]. /// /// Parameter [apiId] : /// The GraphQL API ID. @@ -1271,6 +1379,62 @@ class AppSync { return GetDataSourceResponse.fromJson(response); } + /// Retrieves the record of an existing introspection. If the retrieval is + /// successful, the result of the instrospection will also be returned. If the + /// retrieval fails the operation, an error message will be returned instead. + /// + /// May throw [BadRequestException]. + /// May throw [NotFoundException]. + /// May throw [InternalFailureException]. + /// + /// Parameter [introspectionId] : + /// The introspection ID. Each introspection contains a unique ID that can be + /// used to reference the instrospection record. + /// + /// Parameter [includeModelsSDL] : + /// A boolean flag that determines whether SDL should be generated for + /// introspected types or not. If set to true, each model will + /// contain an sdl property that contains the SDL for that type. + /// The SDL only contains the type data and no additional metadata or + /// directives. + /// + /// Parameter [maxResults] : + /// The maximum number of introspected types that will be returned in a single + /// response. + /// + /// Parameter [nextToken] : + /// Determines the number of types to be returned in a single response before + /// paginating. This value is typically taken from nextToken + /// value from the previous response. + Future getDataSourceIntrospection({ + required String introspectionId, + bool? includeModelsSDL, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 25, + ); + final $query = >{ + if (includeModelsSDL != null) + 'includeModelsSDL': [includeModelsSDL.toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v1/datasources/introspections/${Uri.encodeComponent(introspectionId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetDataSourceIntrospectionResponse.fromJson(response); + } + /// Retrieves a custom DomainName object. /// /// May throw [AccessDeniedException]. @@ -1339,6 +1503,31 @@ class AppSync { return GetGraphqlApiResponse.fromJson(response); } + /// Retrieves the list of environmental variable key-value pairs associated + /// with an API by its ID value. + /// + /// May throw [BadRequestException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedException]. + /// May throw [InternalFailureException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [apiId] : + /// The ID of the API from which the environmental variable list will be + /// retrieved. + Future + getGraphqlApiEnvironmentVariables({ + required String apiId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/apis/${Uri.encodeComponent(apiId)}/environmentVariables', + exceptionFnMap: _exceptionFns, + ); + return GetGraphqlApiEnvironmentVariablesResponse.fromJson(response); + } + /// Retrieves the introspection schema for a GraphQL API. /// /// May throw [GraphQLSchemaException]. @@ -1964,6 +2153,142 @@ class AppSync { return ListTypesByAssociationResponse.fromJson(response); } + /// Creates a list of environmental variables in an API by its ID value. + /// + /// When creating an environmental variable, it must follow the constraints + /// below: + /// + ///
          + ///
        • + /// Both JavaScript and VTL templates support environmental variables. + ///
        • + ///
        • + /// Environmental variables are not evaluated before function invocation. + ///
        • + ///
        • + /// Environmental variables only support string values. + ///
        • + ///
        • + /// Any defined value in an environmental variable is considered a string + /// literal and not expanded. + ///
        • + ///
        • + /// Variable evaluations should ideally be performed in the function code. + ///
        • + ///
        + /// When creating an environmental variable key-value pair, it must follow the + /// additional constraints below: + /// + ///
          + ///
        • + /// Keys must begin with a letter. + ///
        • + ///
        • + /// Keys must be at least two characters long. + ///
        • + ///
        • + /// Keys can only contain letters, numbers, and the underscore character (_). + ///
        • + ///
        • + /// Values can be up to 512 characters long. + ///
        • + ///
        • + /// You can configure up to 50 key-value pairs in a GraphQL API. + ///
        • + ///
        + /// You can create a list of environmental variables by adding it to the + /// environmentVariables payload as a list in the format + /// {"key1":"value1","key2":"value2", …}. Note that each call of + /// the PutGraphqlApiEnvironmentVariables action will result in + /// the overwriting of the existing environmental variable list of that API. + /// This means the existing environmental variables will be lost. To avoid + /// this, you must include all existing and new environmental variables in the + /// list each time you call this action. + /// + /// May throw [BadRequestException]. + /// May throw [ConcurrentModificationException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedException]. + /// May throw [InternalFailureException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [apiId] : + /// The ID of the API to which the environmental variable list will be + /// written. + /// + /// Parameter [environmentVariables] : + /// The list of environmental variables to add to the API. + /// + /// When creating an environmental variable key-value pair, it must follow the + /// additional constraints below: + /// + ///
          + ///
        • + /// Keys must begin with a letter. + ///
        • + ///
        • + /// Keys must be at least two characters long. + ///
        • + ///
        • + /// Keys can only contain letters, numbers, and the underscore character (_). + ///
        • + ///
        • + /// Values can be up to 512 characters long. + ///
        • + ///
        • + /// You can configure up to 50 key-value pairs in a GraphQL API. + ///
        • + ///
        + /// You can create a list of environmental variables by adding it to the + /// environmentVariables payload as a list in the format + /// {"key1":"value1","key2":"value2", …}. Note that each call of + /// the PutGraphqlApiEnvironmentVariables action will result in + /// the overwriting of the existing environmental variable list of that API. + /// This means the existing environmental variables will be lost. To avoid + /// this, you must include all existing and new environmental variables in the + /// list each time you call this action. + Future + putGraphqlApiEnvironmentVariables({ + required String apiId, + required Map environmentVariables, + }) async { + final $payload = { + 'environmentVariables': environmentVariables, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/v1/apis/${Uri.encodeComponent(apiId)}/environmentVariables', + exceptionFnMap: _exceptionFns, + ); + return PutGraphqlApiEnvironmentVariablesResponse.fromJson(response); + } + + /// Creates a new introspection. Returns the introspectionId of + /// the new introspection after its creation. + /// + /// May throw [NotFoundException]. + /// May throw [UnauthorizedException]. + /// May throw [InternalFailureException]. + /// May throw [BadRequestException]. + /// + /// Parameter [rdsDataApiConfig] : + /// The rdsDataApiConfig object data. + Future startDataSourceIntrospection({ + RdsDataApiConfig? rdsDataApiConfig, + }) async { + final $payload = { + if (rdsDataApiConfig != null) 'rdsDataApiConfig': rdsDataApiConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v1/datasources/introspections', + exceptionFnMap: _exceptionFns, + ); + return StartDataSourceIntrospectionResponse.fromJson(response); + } + /// Adds a new schema to your GraphQL API. /// /// This operation is asynchronous. Use to determine when it has completed. @@ -2174,16 +2499,38 @@ class AppSync { /// R4_8XLARGE: A r4.8xlarge instance type. ///
      • ///
      + /// + /// Parameter [healthMetricsConfig] : + /// Controls how cache health metrics will be emitted to CloudWatch. Cache + /// health metrics include: + /// + ///
        + ///
      • + /// NetworkBandwidthOutAllowanceExceeded: The network packets dropped because + /// the throughput exceeded the aggregated bandwidth limit. This is useful for + /// diagnosing bottlenecks in a cache configuration. + ///
      • + ///
      • + /// EngineCPUUtilization: The CPU utilization (percentage) allocated to the + /// Redis process. This is useful for diagnosing bottlenecks in a cache + /// configuration. + ///
      • + ///
      + /// Metrics will be recorded by API ID. You can set the value to + /// ENABLED or DISABLED. Future updateApiCache({ required ApiCachingBehavior apiCachingBehavior, required String apiId, required int ttl, required ApiCacheType type, + CacheHealthMetricsConfig? healthMetricsConfig, }) async { final $payload = { 'apiCachingBehavior': apiCachingBehavior.toValue(), 'ttl': ttl, 'type': type.toValue(), + if (healthMetricsConfig != null) + 'healthMetricsConfig': healthMetricsConfig.toValue(), }; final response = await _protocol.send( payload: $payload, @@ -2275,6 +2622,19 @@ class AppSync { /// Parameter [lambdaConfig] : /// The new Lambda configuration. /// + /// Parameter [metricsConfig] : + /// Enables or disables enhanced data source metrics for specified data + /// sources. Note that metricsConfig won't be used unless the + /// dataSourceLevelMetricsBehavior value is set to + /// PER_DATA_SOURCE_METRICS. If the + /// dataSourceLevelMetricsBehavior is set to + /// FULL_REQUEST_DATA_SOURCE_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + /// /// Parameter [openSearchServiceConfig] : /// The new OpenSearch configuration. /// @@ -2293,6 +2653,7 @@ class AppSync { EventBridgeDataSourceConfig? eventBridgeConfig, HttpDataSourceConfig? httpConfig, LambdaDataSourceConfig? lambdaConfig, + DataSourceLevelMetricsConfig? metricsConfig, OpenSearchServiceDataSourceConfig? openSearchServiceConfig, RelationalDatabaseDataSourceConfig? relationalDatabaseConfig, String? serviceRoleArn, @@ -2306,6 +2667,7 @@ class AppSync { if (eventBridgeConfig != null) 'eventBridgeConfig': eventBridgeConfig, if (httpConfig != null) 'httpConfig': httpConfig, if (lambdaConfig != null) 'lambdaConfig': lambdaConfig, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (openSearchServiceConfig != null) 'openSearchServiceConfig': openSearchServiceConfig, if (relationalDatabaseConfig != null) @@ -2357,6 +2719,7 @@ class AppSync { /// May throw [NotFoundException]. /// May throw [UnauthorizedException]. /// May throw [InternalFailureException]. + /// May throw [BadRequestException]. /// /// Parameter [apiId] : /// The GraphQL API ID. @@ -2448,6 +2811,9 @@ class AppSync { /// Parameter [apiId] : /// The API ID. /// + /// Parameter [authenticationType] : + /// The new authentication type for the GraphqlApi object. + /// /// Parameter [name] : /// The new name for the GraphqlApi object. /// @@ -2455,8 +2821,18 @@ class AppSync { /// A list of additional authentication providers for the /// GraphqlApi API. /// - /// Parameter [authenticationType] : - /// The new authentication type for the GraphqlApi object. + /// Parameter [enhancedMetricsConfig] : + /// The enhancedMetricsConfig object. + /// + /// Parameter [introspectionConfig] : + /// Sets the value of the GraphQL API to enable (ENABLED) or + /// disable (DISABLED) introspection. If no value is provided, + /// the introspection configuration will be set to ENABLED by + /// default. This field will produce an error if the operation attempts to use + /// the introspection feature while this field is disabled. + /// + /// For more information about introspection, see GraphQL introspection. /// /// Parameter [lambdaAuthorizerConfig] : /// Configuration for Lambda function authorization. @@ -2480,6 +2856,25 @@ class AppSync { /// /// This field accepts any string input with a length of 0 - 256 characters. /// + /// Parameter [queryDepthLimit] : + /// The maximum depth a query can have in a single request. Depth refers to + /// the amount of nested levels allowed in the body of query. The default + /// value is 0 (or unspecified), which indicates there's no depth + /// limit. If you set a limit, it can be between 1 and + /// 75 nested levels. This field will produce a limit error if + /// the operation falls out of bounds. + /// + /// Note that fields can still be set to nullable or non-nullable. If a + /// non-nullable field produces an error, the error will be thrown upwards to + /// the first nullable field available. + /// + /// Parameter [resolverCountLimit] : + /// The maximum number of resolvers that can be invoked in a single request. + /// The default value is 0 (or unspecified), which will set the + /// limit to 10000. When specified, the limit value can be + /// between 1 and 10000. This field will produce a + /// limit error if the operation falls out of bounds. + /// /// Parameter [userPoolConfig] : /// The new Amazon Cognito user pool configuration for the /// ~GraphqlApi object. @@ -2489,23 +2884,42 @@ class AppSync { /// GraphqlApi. Future updateGraphqlApi({ required String apiId, + required AuthenticationType authenticationType, required String name, List? additionalAuthenticationProviders, - AuthenticationType? authenticationType, + EnhancedMetricsConfig? enhancedMetricsConfig, + GraphQLApiIntrospectionConfig? introspectionConfig, LambdaAuthorizerConfig? lambdaAuthorizerConfig, LogConfig? logConfig, String? mergedApiExecutionRoleArn, OpenIDConnectConfig? openIDConnectConfig, String? ownerContact, + int? queryDepthLimit, + int? resolverCountLimit, UserPoolConfig? userPoolConfig, bool? xrayEnabled, }) async { + _s.validateNumRange( + 'queryDepthLimit', + queryDepthLimit, + 0, + 75, + ); + _s.validateNumRange( + 'resolverCountLimit', + resolverCountLimit, + 0, + 10000, + ); final $payload = { + 'authenticationType': authenticationType.toValue(), 'name': name, if (additionalAuthenticationProviders != null) 'additionalAuthenticationProviders': additionalAuthenticationProviders, - if (authenticationType != null) - 'authenticationType': authenticationType.toValue(), + if (enhancedMetricsConfig != null) + 'enhancedMetricsConfig': enhancedMetricsConfig, + if (introspectionConfig != null) + 'introspectionConfig': introspectionConfig.toValue(), if (lambdaAuthorizerConfig != null) 'lambdaAuthorizerConfig': lambdaAuthorizerConfig, if (logConfig != null) 'logConfig': logConfig, @@ -2514,6 +2928,8 @@ class AppSync { if (openIDConnectConfig != null) 'openIDConnectConfig': openIDConnectConfig, if (ownerContact != null) 'ownerContact': ownerContact, + if (queryDepthLimit != null) 'queryDepthLimit': queryDepthLimit, + if (resolverCountLimit != null) 'resolverCountLimit': resolverCountLimit, if (userPoolConfig != null) 'userPoolConfig': userPoolConfig, if (xrayEnabled != null) 'xrayEnabled': xrayEnabled, }; @@ -2574,6 +2990,19 @@ class AppSync { /// Parameter [maxBatchSize] : /// The maximum batching size for a resolver. /// + /// Parameter [metricsConfig] : + /// Enables or disables enhanced resolver metrics for specified resolvers. + /// Note that metricsConfig won't be used unless the + /// resolverLevelMetricsBehavior value is set to + /// PER_RESOLVER_METRICS. If the + /// resolverLevelMetricsBehavior is set to + /// FULL_REQUEST_RESOLVER_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + /// /// Parameter [pipelineConfig] : /// The PipelineConfig. /// @@ -2603,6 +3032,7 @@ class AppSync { String? dataSourceName, ResolverKind? kind, int? maxBatchSize, + ResolverLevelMetricsConfig? metricsConfig, PipelineConfig? pipelineConfig, String? requestMappingTemplate, String? responseMappingTemplate, @@ -2621,6 +3051,7 @@ class AppSync { if (dataSourceName != null) 'dataSourceName': dataSourceName, if (kind != null) 'kind': kind.toValue(), if (maxBatchSize != null) 'maxBatchSize': maxBatchSize, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (pipelineConfig != null) 'pipelineConfig': pipelineConfig, if (requestMappingTemplate != null) 'requestMappingTemplate': requestMappingTemplate, @@ -2862,6 +3293,25 @@ class ApiCache { /// creation. final bool? atRestEncryptionEnabled; + /// Controls how cache health metrics will be emitted to CloudWatch. Cache + /// health metrics include: + /// + ///
        + ///
      • + /// NetworkBandwidthOutAllowanceExceeded: The network packets dropped because + /// the throughput exceeded the aggregated bandwidth limit. This is useful for + /// diagnosing bottlenecks in a cache configuration. + ///
      • + ///
      • + /// EngineCPUUtilization: The CPU utilization (percentage) allocated to the + /// Redis process. This is useful for diagnosing bottlenecks in a cache + /// configuration. + ///
      • + ///
      + /// Metrics will be recorded by API ID. You can set the value to + /// ENABLED or DISABLED. + final CacheHealthMetricsConfig? healthMetricsConfig; + /// The cache instance status. /// ///
        @@ -2955,6 +3405,7 @@ class ApiCache { ApiCache({ this.apiCachingBehavior, this.atRestEncryptionEnabled, + this.healthMetricsConfig, this.status, this.transitEncryptionEnabled, this.ttl, @@ -2966,6 +3417,8 @@ class ApiCache { apiCachingBehavior: (json['apiCachingBehavior'] as String?)?.toApiCachingBehavior(), atRestEncryptionEnabled: json['atRestEncryptionEnabled'] as bool?, + healthMetricsConfig: (json['healthMetricsConfig'] as String?) + ?.toCacheHealthMetricsConfig(), status: (json['status'] as String?)?.toApiCacheStatus(), transitEncryptionEnabled: json['transitEncryptionEnabled'] as bool?, ttl: json['ttl'] as int?, @@ -2976,6 +3429,7 @@ class ApiCache { Map toJson() { final apiCachingBehavior = this.apiCachingBehavior; final atRestEncryptionEnabled = this.atRestEncryptionEnabled; + final healthMetricsConfig = this.healthMetricsConfig; final status = this.status; final transitEncryptionEnabled = this.transitEncryptionEnabled; final ttl = this.ttl; @@ -2985,6 +3439,8 @@ class ApiCache { 'apiCachingBehavior': apiCachingBehavior.toValue(), if (atRestEncryptionEnabled != null) 'atRestEncryptionEnabled': atRestEncryptionEnabled, + if (healthMetricsConfig != null) + 'healthMetricsConfig': healthMetricsConfig.toValue(), if (status != null) 'status': status.toValue(), if (transitEncryptionEnabled != null) 'transitEncryptionEnabled': transitEncryptionEnabled, @@ -3547,6 +4003,34 @@ class AwsIamConfig { } } +enum CacheHealthMetricsConfig { + enabled, + disabled, +} + +extension CacheHealthMetricsConfigValueExtension on CacheHealthMetricsConfig { + String toValue() { + switch (this) { + case CacheHealthMetricsConfig.enabled: + return 'ENABLED'; + case CacheHealthMetricsConfig.disabled: + return 'DISABLED'; + } + } +} + +extension CacheHealthMetricsConfigFromString on String { + CacheHealthMetricsConfig toCacheHealthMetricsConfig() { + switch (this) { + case 'ENABLED': + return CacheHealthMetricsConfig.enabled; + case 'DISABLED': + return CacheHealthMetricsConfig.disabled; + } + throw Exception('$this is not known in enum CacheHealthMetricsConfig'); + } +} + /// The caching configuration for a resolver that has caching activated. class CachingConfig { /// The TTL in seconds for a resolver that has caching activated. @@ -3990,6 +4474,19 @@ class DataSource { /// Lambda settings. final LambdaDataSourceConfig? lambdaConfig; + /// Enables or disables enhanced data source metrics for specified data sources. + /// Note that metricsConfig won't be used unless the + /// dataSourceLevelMetricsBehavior value is set to + /// PER_DATA_SOURCE_METRICS. If the + /// dataSourceLevelMetricsBehavior is set to + /// FULL_REQUEST_DATA_SOURCE_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + final DataSourceLevelMetricsConfig? metricsConfig; + /// The name of the data source. final String? name; @@ -4048,6 +4545,7 @@ class DataSource { this.eventBridgeConfig, this.httpConfig, this.lambdaConfig, + this.metricsConfig, this.name, this.openSearchServiceConfig, this.relationalDatabaseConfig, @@ -4079,6 +4577,8 @@ class DataSource { ? LambdaDataSourceConfig.fromJson( json['lambdaConfig'] as Map) : null, + metricsConfig: + (json['metricsConfig'] as String?)?.toDataSourceLevelMetricsConfig(), name: json['name'] as String?, openSearchServiceConfig: json['openSearchServiceConfig'] != null ? OpenSearchServiceDataSourceConfig.fromJson( @@ -4101,6 +4601,7 @@ class DataSource { final eventBridgeConfig = this.eventBridgeConfig; final httpConfig = this.httpConfig; final lambdaConfig = this.lambdaConfig; + final metricsConfig = this.metricsConfig; final name = this.name; final openSearchServiceConfig = this.openSearchServiceConfig; final relationalDatabaseConfig = this.relationalDatabaseConfig; @@ -4115,6 +4616,7 @@ class DataSource { if (eventBridgeConfig != null) 'eventBridgeConfig': eventBridgeConfig, if (httpConfig != null) 'httpConfig': httpConfig, if (lambdaConfig != null) 'lambdaConfig': lambdaConfig, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (name != null) 'name': name, if (openSearchServiceConfig != null) 'openSearchServiceConfig': openSearchServiceConfig, @@ -4126,41 +4628,392 @@ class DataSource { } } -enum DataSourceType { - awsLambda, - amazonDynamodb, - amazonElasticsearch, - none, - http, - relationalDatabase, - amazonOpensearchService, - amazonEventbridge, -} +/// Contains the introspected data that was retrieved from the data source. +class DataSourceIntrospectionModel { + /// The DataSourceIntrospectionModelField object data. + final List? fields; -extension DataSourceTypeValueExtension on DataSourceType { - String toValue() { - switch (this) { - case DataSourceType.awsLambda: - return 'AWS_LAMBDA'; - case DataSourceType.amazonDynamodb: - return 'AMAZON_DYNAMODB'; - case DataSourceType.amazonElasticsearch: - return 'AMAZON_ELASTICSEARCH'; - case DataSourceType.none: - return 'NONE'; - case DataSourceType.http: - return 'HTTP'; - case DataSourceType.relationalDatabase: - return 'RELATIONAL_DATABASE'; - case DataSourceType.amazonOpensearchService: - return 'AMAZON_OPENSEARCH_SERVICE'; - case DataSourceType.amazonEventbridge: - return 'AMAZON_EVENTBRIDGE'; - } + /// The array of DataSourceIntrospectionModelIndex objects. + final List? indexes; + + /// The name of the model. For example, this could be the name of a single table + /// in a database. + final String? name; + + /// The primary key stored as a DataSourceIntrospectionModelIndex + /// object. + final DataSourceIntrospectionModelIndex? primaryKey; + + /// Contains the output of the SDL that was generated from the introspected + /// types. This is controlled by the includeModelsSDL parameter of + /// the GetDataSourceIntrospection operation. + final String? sdl; + + DataSourceIntrospectionModel({ + this.fields, + this.indexes, + this.name, + this.primaryKey, + this.sdl, + }); + + factory DataSourceIntrospectionModel.fromJson(Map json) { + return DataSourceIntrospectionModel( + fields: (json['fields'] as List?) + ?.whereNotNull() + .map((e) => DataSourceIntrospectionModelField.fromJson( + e as Map)) + .toList(), + indexes: (json['indexes'] as List?) + ?.whereNotNull() + .map((e) => DataSourceIntrospectionModelIndex.fromJson( + e as Map)) + .toList(), + name: json['name'] as String?, + primaryKey: json['primaryKey'] != null + ? DataSourceIntrospectionModelIndex.fromJson( + json['primaryKey'] as Map) + : null, + sdl: json['sdl'] as String?, + ); } -} -extension DataSourceTypeFromString on String { + Map toJson() { + final fields = this.fields; + final indexes = this.indexes; + final name = this.name; + final primaryKey = this.primaryKey; + final sdl = this.sdl; + return { + if (fields != null) 'fields': fields, + if (indexes != null) 'indexes': indexes, + if (name != null) 'name': name, + if (primaryKey != null) 'primaryKey': primaryKey, + if (sdl != null) 'sdl': sdl, + }; + } +} + +/// Represents the fields that were retrieved from the introspected data. +class DataSourceIntrospectionModelField { + /// The length value of the introspected field. + final int? length; + + /// The name of the field that was retrieved from the introspected data. + final String? name; + + /// The DataSourceIntrospectionModelFieldType object data. + final DataSourceIntrospectionModelFieldType? type; + + DataSourceIntrospectionModelField({ + this.length, + this.name, + this.type, + }); + + factory DataSourceIntrospectionModelField.fromJson( + Map json) { + return DataSourceIntrospectionModelField( + length: json['length'] as int?, + name: json['name'] as String?, + type: json['type'] != null + ? DataSourceIntrospectionModelFieldType.fromJson( + json['type'] as Map) + : null, + ); + } + + Map toJson() { + final length = this.length; + final name = this.name; + final type = this.type; + return { + if (length != null) 'length': length, + if (name != null) 'name': name, + if (type != null) 'type': type, + }; + } +} + +/// Represents the type data for each field retrieved from the introspection. +class DataSourceIntrospectionModelFieldType { + /// Specifies the classification of data. For example, this could be set to + /// values like Scalar or NonNull to indicate a + /// fundamental property of the field. + /// + /// Valid values include: + /// + ///
          + ///
        • + /// Scalar: Indicates the value is a primitive type (scalar). + ///
        • + ///
        • + /// NonNull: Indicates the field cannot be null. + ///
        • + ///
        • + /// List: Indicates the field contains a list. + ///
        • + ///
        + final String? kind; + + /// The name of the data type that represents the field. For example, + /// String is a valid name value. + final String? name; + + /// The DataSourceIntrospectionModelFieldType object data. The + /// type is only present if + /// DataSourceIntrospectionModelFieldType.kind is set to + /// NonNull or List. + /// + /// The type typically contains its own kind and + /// name fields to represent the actual type data. For instance, + /// type could contain a kind value of + /// Scalar with a name value of String. + /// The values Scalar and String will be collectively + /// stored in the values field. + final DataSourceIntrospectionModelFieldType? type; + + /// The values of the type field. This field represents the AppSync + /// data type equivalent of the introspected field. + final List? values; + + DataSourceIntrospectionModelFieldType({ + this.kind, + this.name, + this.type, + this.values, + }); + + factory DataSourceIntrospectionModelFieldType.fromJson( + Map json) { + return DataSourceIntrospectionModelFieldType( + kind: json['kind'] as String?, + name: json['name'] as String?, + type: json['type'] != null + ? DataSourceIntrospectionModelFieldType.fromJson( + json['type'] as Map) + : null, + values: (json['values'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final kind = this.kind; + final name = this.name; + final type = this.type; + final values = this.values; + return { + if (kind != null) 'kind': kind, + if (name != null) 'name': name, + if (type != null) 'type': type, + if (values != null) 'values': values, + }; + } +} + +/// The index that was retrieved from the introspected data. +class DataSourceIntrospectionModelIndex { + /// The fields of the index. + final List? fields; + + /// The name of the index. + final String? name; + + DataSourceIntrospectionModelIndex({ + this.fields, + this.name, + }); + + factory DataSourceIntrospectionModelIndex.fromJson( + Map json) { + return DataSourceIntrospectionModelIndex( + fields: (json['fields'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + name: json['name'] as String?, + ); + } + + Map toJson() { + final fields = this.fields; + final name = this.name; + return { + if (fields != null) 'fields': fields, + if (name != null) 'name': name, + }; + } +} + +/// Represents the output of a DataSourceIntrospectionResult. This +/// is the populated result of a GetDataSourceIntrospection +/// operation. +class DataSourceIntrospectionResult { + /// The array of DataSourceIntrospectionModel objects. + final List? models; + + /// Determines the number of types to be returned in a single response before + /// paginating. This value is typically taken from nextToken value + /// from the previous response. + final String? nextToken; + + DataSourceIntrospectionResult({ + this.models, + this.nextToken, + }); + + factory DataSourceIntrospectionResult.fromJson(Map json) { + return DataSourceIntrospectionResult( + models: (json['models'] as List?) + ?.whereNotNull() + .map((e) => + DataSourceIntrospectionModel.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final models = this.models; + final nextToken = this.nextToken; + return { + if (models != null) 'models': models, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +enum DataSourceIntrospectionStatus { + processing, + failed, + success, +} + +extension DataSourceIntrospectionStatusValueExtension + on DataSourceIntrospectionStatus { + String toValue() { + switch (this) { + case DataSourceIntrospectionStatus.processing: + return 'PROCESSING'; + case DataSourceIntrospectionStatus.failed: + return 'FAILED'; + case DataSourceIntrospectionStatus.success: + return 'SUCCESS'; + } + } +} + +extension DataSourceIntrospectionStatusFromString on String { + DataSourceIntrospectionStatus toDataSourceIntrospectionStatus() { + switch (this) { + case 'PROCESSING': + return DataSourceIntrospectionStatus.processing; + case 'FAILED': + return DataSourceIntrospectionStatus.failed; + case 'SUCCESS': + return DataSourceIntrospectionStatus.success; + } + throw Exception('$this is not known in enum DataSourceIntrospectionStatus'); + } +} + +enum DataSourceLevelMetricsBehavior { + fullRequestDataSourceMetrics, + perDataSourceMetrics, +} + +extension DataSourceLevelMetricsBehaviorValueExtension + on DataSourceLevelMetricsBehavior { + String toValue() { + switch (this) { + case DataSourceLevelMetricsBehavior.fullRequestDataSourceMetrics: + return 'FULL_REQUEST_DATA_SOURCE_METRICS'; + case DataSourceLevelMetricsBehavior.perDataSourceMetrics: + return 'PER_DATA_SOURCE_METRICS'; + } + } +} + +extension DataSourceLevelMetricsBehaviorFromString on String { + DataSourceLevelMetricsBehavior toDataSourceLevelMetricsBehavior() { + switch (this) { + case 'FULL_REQUEST_DATA_SOURCE_METRICS': + return DataSourceLevelMetricsBehavior.fullRequestDataSourceMetrics; + case 'PER_DATA_SOURCE_METRICS': + return DataSourceLevelMetricsBehavior.perDataSourceMetrics; + } + throw Exception( + '$this is not known in enum DataSourceLevelMetricsBehavior'); + } +} + +enum DataSourceLevelMetricsConfig { + enabled, + disabled, +} + +extension DataSourceLevelMetricsConfigValueExtension + on DataSourceLevelMetricsConfig { + String toValue() { + switch (this) { + case DataSourceLevelMetricsConfig.enabled: + return 'ENABLED'; + case DataSourceLevelMetricsConfig.disabled: + return 'DISABLED'; + } + } +} + +extension DataSourceLevelMetricsConfigFromString on String { + DataSourceLevelMetricsConfig toDataSourceLevelMetricsConfig() { + switch (this) { + case 'ENABLED': + return DataSourceLevelMetricsConfig.enabled; + case 'DISABLED': + return DataSourceLevelMetricsConfig.disabled; + } + throw Exception('$this is not known in enum DataSourceLevelMetricsConfig'); + } +} + +enum DataSourceType { + awsLambda, + amazonDynamodb, + amazonElasticsearch, + none, + http, + relationalDatabase, + amazonOpensearchService, + amazonEventbridge, +} + +extension DataSourceTypeValueExtension on DataSourceType { + String toValue() { + switch (this) { + case DataSourceType.awsLambda: + return 'AWS_LAMBDA'; + case DataSourceType.amazonDynamodb: + return 'AMAZON_DYNAMODB'; + case DataSourceType.amazonElasticsearch: + return 'AMAZON_ELASTICSEARCH'; + case DataSourceType.none: + return 'NONE'; + case DataSourceType.http: + return 'HTTP'; + case DataSourceType.relationalDatabase: + return 'RELATIONAL_DATABASE'; + case DataSourceType.amazonOpensearchService: + return 'AMAZON_OPENSEARCH_SERVICE'; + case DataSourceType.amazonEventbridge: + return 'AMAZON_EVENTBRIDGE'; + } + } +} + +extension DataSourceTypeFromString on String { DataSourceType toDataSourceType() { switch (this) { case 'AWS_LAMBDA': @@ -4554,6 +5407,220 @@ class ElasticsearchDataSourceConfig { } } +/// Enables and controls the enhanced metrics feature. Enhanced metrics emit +/// granular data on API usage and performance such as AppSync request and error +/// counts, latency, and cache hits/misses. All enhanced metric data is sent to +/// your CloudWatch account, and you can configure the types of data that will +/// be sent. +/// +/// Enhanced metrics can be configured at the resolver, data source, and +/// operation levels. EnhancedMetricsConfig contains three required +/// parameters, each controlling one of these categories: +///
          +///
        1. +/// resolverLevelMetricsBehavior: Controls how resolver metrics +/// will be emitted to CloudWatch. Resolver metrics include: +/// +///
            +///
          • +/// GraphQL errors: The number of GraphQL errors that occurred. +///
          • +///
          • +/// Requests: The number of invocations that occurred during a request. +///
          • +///
          • +/// Latency: The time to complete a resolver invocation. +///
          • +///
          • +/// Cache hits: The number of cache hits during a request. +///
          • +///
          • +/// Cache misses: The number of cache misses during a request. +///
          • +///
          +/// These metrics can be emitted to CloudWatch per resolver or for all resolvers +/// in the request. Metrics will be recorded by API ID and resolver name. +/// resolverLevelMetricsBehavior accepts one of these values at a +/// time: +/// +///
            +///
          • +/// FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data +/// for all resolvers in the request. +///
          • +///
          • +/// PER_RESOLVER_METRICS: Records and emits metric data for +/// resolvers that have the metricsConfig value set to +/// ENABLED. +///
          • +///
        2. +///
        3. +/// dataSourceLevelMetricsBehavior: Controls how data source +/// metrics will be emitted to CloudWatch. Data source metrics include: +/// +///
            +///
          • +/// Requests: The number of invocations that occured during a request. +///
          • +///
          • +/// Latency: The time to complete a data source invocation. +///
          • +///
          • +/// Errors: The number of errors that occurred during a data source invocation. +///
          • +///
          +/// These metrics can be emitted to CloudWatch per data source or for all data +/// sources in the request. Metrics will be recorded by API ID and data source +/// name. dataSourceLevelMetricsBehavior accepts one of these +/// values at a time: +/// +///
            +///
          • +/// FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data +/// for all data sources in the request. +///
          • +///
          • +/// PER_DATA_SOURCE_METRICS: Records and emits metric data for data +/// sources that have the metricsConfig value set to +/// ENABLED. +///
          • +///
        4. +///
        5. +/// operationLevelMetricsConfig: Controls how operation metrics +/// will be emitted to CloudWatch. Operation metrics include: +/// +///
            +///
          • +/// Requests: The number of times a specified GraphQL operation was called. +///
          • +///
          • +/// GraphQL errors: The number of GraphQL errors that occurred during a +/// specified GraphQL operation. +///
          • +///
          +/// Metrics will be recorded by API ID and operation name. You can set the value +/// to ENABLED or DISABLED. +///
        +class EnhancedMetricsConfig { + /// Controls how data source metrics will be emitted to CloudWatch. Data source + /// metrics include: + /// + ///
          + ///
        • + /// Requests: The number of invocations that occured during a request. + ///
        • + ///
        • + /// Latency: The time to complete a data source invocation. + ///
        • + ///
        • + /// Errors: The number of errors that occurred during a data source invocation. + ///
        • + ///
        + /// These metrics can be emitted to CloudWatch per data source or for all data + /// sources in the request. Metrics will be recorded by API ID and data source + /// name. dataSourceLevelMetricsBehavior accepts one of these + /// values at a time: + /// + ///
          + ///
        • + /// FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data + /// for all data sources in the request. + ///
        • + ///
        • + /// PER_DATA_SOURCE_METRICS: Records and emits metric data for data + /// sources that have the metricsConfig value set to + /// ENABLED. + ///
        • + ///
        + final DataSourceLevelMetricsBehavior dataSourceLevelMetricsBehavior; + + /// Controls how operation metrics will be emitted to CloudWatch. Operation + /// metrics include: + /// + ///
          + ///
        • + /// Requests: The number of times a specified GraphQL operation was called. + ///
        • + ///
        • + /// GraphQL errors: The number of GraphQL errors that occurred during a + /// specified GraphQL operation. + ///
        • + ///
        + /// Metrics will be recorded by API ID and operation name. You can set the value + /// to ENABLED or DISABLED. + final OperationLevelMetricsConfig operationLevelMetricsConfig; + + /// Controls how resolver metrics will be emitted to CloudWatch. Resolver + /// metrics include: + /// + ///
          + ///
        • + /// GraphQL errors: The number of GraphQL errors that occurred. + ///
        • + ///
        • + /// Requests: The number of invocations that occurred during a request. + ///
        • + ///
        • + /// Latency: The time to complete a resolver invocation. + ///
        • + ///
        • + /// Cache hits: The number of cache hits during a request. + ///
        • + ///
        • + /// Cache misses: The number of cache misses during a request. + ///
        • + ///
        + /// These metrics can be emitted to CloudWatch per resolver or for all resolvers + /// in the request. Metrics will be recorded by API ID and resolver name. + /// resolverLevelMetricsBehavior accepts one of these values at a + /// time: + /// + ///
          + ///
        • + /// FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data + /// for all resolvers in the request. + ///
        • + ///
        • + /// PER_RESOLVER_METRICS: Records and emits metric data for + /// resolvers that have the metricsConfig value set to + /// ENABLED. + ///
        • + ///
        + final ResolverLevelMetricsBehavior resolverLevelMetricsBehavior; + + EnhancedMetricsConfig({ + required this.dataSourceLevelMetricsBehavior, + required this.operationLevelMetricsConfig, + required this.resolverLevelMetricsBehavior, + }); + + factory EnhancedMetricsConfig.fromJson(Map json) { + return EnhancedMetricsConfig( + dataSourceLevelMetricsBehavior: + (json['dataSourceLevelMetricsBehavior'] as String) + .toDataSourceLevelMetricsBehavior(), + operationLevelMetricsConfig: + (json['operationLevelMetricsConfig'] as String) + .toOperationLevelMetricsConfig(), + resolverLevelMetricsBehavior: + (json['resolverLevelMetricsBehavior'] as String) + .toResolverLevelMetricsBehavior(), + ); + } + + Map toJson() { + final dataSourceLevelMetricsBehavior = this.dataSourceLevelMetricsBehavior; + final operationLevelMetricsConfig = this.operationLevelMetricsConfig; + final resolverLevelMetricsBehavior = this.resolverLevelMetricsBehavior; + return { + 'dataSourceLevelMetricsBehavior': + dataSourceLevelMetricsBehavior.toValue(), + 'operationLevelMetricsConfig': operationLevelMetricsConfig.toValue(), + 'resolverLevelMetricsBehavior': resolverLevelMetricsBehavior.toValue(), + }; + } +} + /// Contains the list of errors generated. When using JavaScript, this will /// apply to the request or response function evaluation. class ErrorDetail { @@ -4924,6 +5991,66 @@ class GetApiCacheResponse { } } +class GetDataSourceIntrospectionResponse { + /// The introspection ID. Each introspection contains a unique ID that can be + /// used to reference the instrospection record. + final String? introspectionId; + + /// The DataSourceIntrospectionResult object data. + final DataSourceIntrospectionResult? introspectionResult; + + /// The status of the introspection during retrieval. By default, when a new + /// instrospection is being retrieved, the status will be set to + /// PROCESSING. Once the operation has been completed, the status + /// will change to SUCCESS or FAILED depending on how + /// the data was parsed. A FAILED operation will return an error + /// and its details as an introspectionStatusDetail. + final DataSourceIntrospectionStatus? introspectionStatus; + + /// The error detail field. When a FAILED + /// introspectionStatus is returned, the + /// introspectionStatusDetail will also return the exact error that + /// was generated during the operation. + final String? introspectionStatusDetail; + + GetDataSourceIntrospectionResponse({ + this.introspectionId, + this.introspectionResult, + this.introspectionStatus, + this.introspectionStatusDetail, + }); + + factory GetDataSourceIntrospectionResponse.fromJson( + Map json) { + return GetDataSourceIntrospectionResponse( + introspectionId: json['introspectionId'] as String?, + introspectionResult: json['introspectionResult'] != null + ? DataSourceIntrospectionResult.fromJson( + json['introspectionResult'] as Map) + : null, + introspectionStatus: (json['introspectionStatus'] as String?) + ?.toDataSourceIntrospectionStatus(), + introspectionStatusDetail: json['introspectionStatusDetail'] as String?, + ); + } + + Map toJson() { + final introspectionId = this.introspectionId; + final introspectionResult = this.introspectionResult; + final introspectionStatus = this.introspectionStatus; + final introspectionStatusDetail = this.introspectionStatusDetail; + return { + if (introspectionId != null) 'introspectionId': introspectionId, + if (introspectionResult != null) + 'introspectionResult': introspectionResult, + if (introspectionStatus != null) + 'introspectionStatus': introspectionStatus.toValue(), + if (introspectionStatusDetail != null) + 'introspectionStatusDetail': introspectionStatusDetail, + }; + } +} + class GetDataSourceResponse { /// The DataSource object. final DataSource? dataSource; @@ -4999,6 +6126,33 @@ class GetFunctionResponse { } } +class GetGraphqlApiEnvironmentVariablesResponse { + /// The payload containing each environmental variable in the "key" : + /// "value" format. + final Map? environmentVariables; + + GetGraphqlApiEnvironmentVariablesResponse({ + this.environmentVariables, + }); + + factory GetGraphqlApiEnvironmentVariablesResponse.fromJson( + Map json) { + return GetGraphqlApiEnvironmentVariablesResponse( + environmentVariables: + (json['environmentVariables'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final environmentVariables = this.environmentVariables; + return { + if (environmentVariables != null) + 'environmentVariables': environmentVariables, + }; + } +} + class GetGraphqlApiResponse { /// The GraphqlApi object. final GraphqlApi? graphqlApi; @@ -5146,6 +6300,35 @@ class GetTypeResponse { } } +enum GraphQLApiIntrospectionConfig { + enabled, + disabled, +} + +extension GraphQLApiIntrospectionConfigValueExtension + on GraphQLApiIntrospectionConfig { + String toValue() { + switch (this) { + case GraphQLApiIntrospectionConfig.enabled: + return 'ENABLED'; + case GraphQLApiIntrospectionConfig.disabled: + return 'DISABLED'; + } + } +} + +extension GraphQLApiIntrospectionConfigFromString on String { + GraphQLApiIntrospectionConfig toGraphQLApiIntrospectionConfig() { + switch (this) { + case 'ENABLED': + return GraphQLApiIntrospectionConfig.enabled; + case 'DISABLED': + return GraphQLApiIntrospectionConfig.disabled; + } + throw Exception('$this is not known in enum GraphQLApiIntrospectionConfig'); + } +} + enum GraphQLApiType { graphql, merged, @@ -5225,6 +6408,19 @@ class GraphqlApi { /// The DNS records for the API. final Map? dns; + /// The enhancedMetricsConfig object. + final EnhancedMetricsConfig? enhancedMetricsConfig; + + /// Sets the value of the GraphQL API to enable (ENABLED) or + /// disable (DISABLED) introspection. If no value is provided, the + /// introspection configuration will be set to ENABLED by default. + /// This field will produce an error if the operation attempts to use the + /// introspection feature while this field is disabled. + /// + /// For more information about introspection, see GraphQL introspection. + final GraphQLApiIntrospectionConfig? introspectionConfig; + /// Configuration for Lambda function authorization. final LambdaAuthorizerConfig? lambdaAuthorizerConfig; @@ -5251,6 +6447,25 @@ class GraphqlApi { /// This field accepts any string input with a length of 0 - 256 characters. final String? ownerContact; + /// The maximum depth a query can have in a single request. Depth refers to the + /// amount of nested levels allowed in the body of query. The default value is + /// 0 (or unspecified), which indicates there's no depth limit. If + /// you set a limit, it can be between 1 and 75 nested + /// levels. This field will produce a limit error if the operation falls out of + /// bounds. + /// + /// Note that fields can still be set to nullable or non-nullable. If a + /// non-nullable field produces an error, the error will be thrown upwards to + /// the first nullable field available. + final int? queryDepthLimit; + + /// The maximum number of resolvers that can be invoked in a single request. The + /// default value is 0 (or unspecified), which will set the limit + /// to 10000. When specified, the limit value can be between + /// 1 and 10000. This field will produce a limit error + /// if the operation falls out of bounds. + final int? resolverCountLimit; + /// The tags. final Map? tags; @@ -5281,6 +6496,8 @@ class GraphqlApi { this.arn, this.authenticationType, this.dns, + this.enhancedMetricsConfig, + this.introspectionConfig, this.lambdaAuthorizerConfig, this.logConfig, this.mergedApiExecutionRoleArn, @@ -5288,6 +6505,8 @@ class GraphqlApi { this.openIDConnectConfig, this.owner, this.ownerContact, + this.queryDepthLimit, + this.resolverCountLimit, this.tags, this.uris, this.userPoolConfig, @@ -5311,6 +6530,12 @@ class GraphqlApi { (json['authenticationType'] as String?)?.toAuthenticationType(), dns: (json['dns'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), + enhancedMetricsConfig: json['enhancedMetricsConfig'] != null + ? EnhancedMetricsConfig.fromJson( + json['enhancedMetricsConfig'] as Map) + : null, + introspectionConfig: (json['introspectionConfig'] as String?) + ?.toGraphQLApiIntrospectionConfig(), lambdaAuthorizerConfig: json['lambdaAuthorizerConfig'] != null ? LambdaAuthorizerConfig.fromJson( json['lambdaAuthorizerConfig'] as Map) @@ -5326,6 +6551,8 @@ class GraphqlApi { : null, owner: json['owner'] as String?, ownerContact: json['ownerContact'] as String?, + queryDepthLimit: json['queryDepthLimit'] as int?, + resolverCountLimit: json['resolverCountLimit'] as int?, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), uris: (json['uris'] as Map?) @@ -5348,6 +6575,8 @@ class GraphqlApi { final arn = this.arn; final authenticationType = this.authenticationType; final dns = this.dns; + final enhancedMetricsConfig = this.enhancedMetricsConfig; + final introspectionConfig = this.introspectionConfig; final lambdaAuthorizerConfig = this.lambdaAuthorizerConfig; final logConfig = this.logConfig; final mergedApiExecutionRoleArn = this.mergedApiExecutionRoleArn; @@ -5355,6 +6584,8 @@ class GraphqlApi { final openIDConnectConfig = this.openIDConnectConfig; final owner = this.owner; final ownerContact = this.ownerContact; + final queryDepthLimit = this.queryDepthLimit; + final resolverCountLimit = this.resolverCountLimit; final tags = this.tags; final uris = this.uris; final userPoolConfig = this.userPoolConfig; @@ -5370,6 +6601,10 @@ class GraphqlApi { if (authenticationType != null) 'authenticationType': authenticationType.toValue(), if (dns != null) 'dns': dns, + if (enhancedMetricsConfig != null) + 'enhancedMetricsConfig': enhancedMetricsConfig, + if (introspectionConfig != null) + 'introspectionConfig': introspectionConfig.toValue(), if (lambdaAuthorizerConfig != null) 'lambdaAuthorizerConfig': lambdaAuthorizerConfig, if (logConfig != null) 'logConfig': logConfig, @@ -5380,6 +6615,8 @@ class GraphqlApi { 'openIDConnectConfig': openIDConnectConfig, if (owner != null) 'owner': owner, if (ownerContact != null) 'ownerContact': ownerContact, + if (queryDepthLimit != null) 'queryDepthLimit': queryDepthLimit, + if (resolverCountLimit != null) 'resolverCountLimit': resolverCountLimit, if (tags != null) 'tags': tags, if (uris != null) 'uris': uris, if (userPoolConfig != null) 'userPoolConfig': userPoolConfig, @@ -6073,6 +7310,35 @@ class OpenSearchServiceDataSourceConfig { } } +enum OperationLevelMetricsConfig { + enabled, + disabled, +} + +extension OperationLevelMetricsConfigValueExtension + on OperationLevelMetricsConfig { + String toValue() { + switch (this) { + case OperationLevelMetricsConfig.enabled: + return 'ENABLED'; + case OperationLevelMetricsConfig.disabled: + return 'DISABLED'; + } + } +} + +extension OperationLevelMetricsConfigFromString on String { + OperationLevelMetricsConfig toOperationLevelMetricsConfig() { + switch (this) { + case 'ENABLED': + return OperationLevelMetricsConfig.enabled; + case 'DISABLED': + return OperationLevelMetricsConfig.disabled; + } + throw Exception('$this is not known in enum OperationLevelMetricsConfig'); + } +} + enum OutputType { sdl, json, @@ -6155,6 +7421,66 @@ class PipelineConfig { } } +class PutGraphqlApiEnvironmentVariablesResponse { + /// The payload containing each environmental variable in the "key" : + /// "value" format. + final Map? environmentVariables; + + PutGraphqlApiEnvironmentVariablesResponse({ + this.environmentVariables, + }); + + factory PutGraphqlApiEnvironmentVariablesResponse.fromJson( + Map json) { + return PutGraphqlApiEnvironmentVariablesResponse( + environmentVariables: + (json['environmentVariables'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final environmentVariables = this.environmentVariables; + return { + if (environmentVariables != null) + 'environmentVariables': environmentVariables, + }; + } +} + +/// Contains the metadata required to introspect the RDS cluster. +class RdsDataApiConfig { + /// The name of the database in the cluster. + final String databaseName; + + /// The resource ARN of the RDS cluster. + final String resourceArn; + + /// The secret's ARN that was obtained from Secrets Manager. A secret consists + /// of secret information, the secret value, plus metadata about the secret. A + /// secret value can be a string or binary. It typically includes the ARN, + /// secret name and description, policies, tags, encryption key from the Key + /// Management Service, and key rotation data. + final String secretArn; + + RdsDataApiConfig({ + required this.databaseName, + required this.resourceArn, + required this.secretArn, + }); + + Map toJson() { + final databaseName = this.databaseName; + final resourceArn = this.resourceArn; + final secretArn = this.secretArn; + return { + 'databaseName': databaseName, + 'resourceArn': resourceArn, + 'secretArn': secretArn, + }; + } +} + /// The Amazon Relational Database Service (Amazon RDS) HTTP endpoint /// configuration. class RdsHttpEndpointConfig { @@ -6314,6 +7640,19 @@ class Resolver { /// The maximum batching size for a resolver. final int? maxBatchSize; + /// Enables or disables enhanced resolver metrics for specified resolvers. Note + /// that metricsConfig won't be used unless the + /// resolverLevelMetricsBehavior value is set to + /// PER_RESOLVER_METRICS. If the + /// resolverLevelMetricsBehavior is set to + /// FULL_REQUEST_RESOLVER_METRICS instead, + /// metricsConfig will be ignored. However, you can still set its + /// value. + /// + /// metricsConfig can be ENABLED or + /// DISABLED. + final ResolverLevelMetricsConfig? metricsConfig; + /// The PipelineConfig. final PipelineConfig? pipelineConfig; @@ -6341,6 +7680,7 @@ class Resolver { this.fieldName, this.kind, this.maxBatchSize, + this.metricsConfig, this.pipelineConfig, this.requestMappingTemplate, this.resolverArn, @@ -6361,6 +7701,8 @@ class Resolver { fieldName: json['fieldName'] as String?, kind: (json['kind'] as String?)?.toResolverKind(), maxBatchSize: json['maxBatchSize'] as int?, + metricsConfig: + (json['metricsConfig'] as String?)?.toResolverLevelMetricsConfig(), pipelineConfig: json['pipelineConfig'] != null ? PipelineConfig.fromJson( json['pipelineConfig'] as Map) @@ -6385,6 +7727,7 @@ class Resolver { final fieldName = this.fieldName; final kind = this.kind; final maxBatchSize = this.maxBatchSize; + final metricsConfig = this.metricsConfig; final pipelineConfig = this.pipelineConfig; final requestMappingTemplate = this.requestMappingTemplate; final resolverArn = this.resolverArn; @@ -6399,6 +7742,7 @@ class Resolver { if (fieldName != null) 'fieldName': fieldName, if (kind != null) 'kind': kind.toValue(), if (maxBatchSize != null) 'maxBatchSize': maxBatchSize, + if (metricsConfig != null) 'metricsConfig': metricsConfig.toValue(), if (pipelineConfig != null) 'pipelineConfig': pipelineConfig, if (requestMappingTemplate != null) 'requestMappingTemplate': requestMappingTemplate, @@ -6440,6 +7784,64 @@ extension ResolverKindFromString on String { } } +enum ResolverLevelMetricsBehavior { + fullRequestResolverMetrics, + perResolverMetrics, +} + +extension ResolverLevelMetricsBehaviorValueExtension + on ResolverLevelMetricsBehavior { + String toValue() { + switch (this) { + case ResolverLevelMetricsBehavior.fullRequestResolverMetrics: + return 'FULL_REQUEST_RESOLVER_METRICS'; + case ResolverLevelMetricsBehavior.perResolverMetrics: + return 'PER_RESOLVER_METRICS'; + } + } +} + +extension ResolverLevelMetricsBehaviorFromString on String { + ResolverLevelMetricsBehavior toResolverLevelMetricsBehavior() { + switch (this) { + case 'FULL_REQUEST_RESOLVER_METRICS': + return ResolverLevelMetricsBehavior.fullRequestResolverMetrics; + case 'PER_RESOLVER_METRICS': + return ResolverLevelMetricsBehavior.perResolverMetrics; + } + throw Exception('$this is not known in enum ResolverLevelMetricsBehavior'); + } +} + +enum ResolverLevelMetricsConfig { + enabled, + disabled, +} + +extension ResolverLevelMetricsConfigValueExtension + on ResolverLevelMetricsConfig { + String toValue() { + switch (this) { + case ResolverLevelMetricsConfig.enabled: + return 'ENABLED'; + case ResolverLevelMetricsConfig.disabled: + return 'DISABLED'; + } + } +} + +extension ResolverLevelMetricsConfigFromString on String { + ResolverLevelMetricsConfig toResolverLevelMetricsConfig() { + switch (this) { + case 'ENABLED': + return ResolverLevelMetricsConfig.enabled; + case 'DISABLED': + return ResolverLevelMetricsConfig.disabled; + } + throw Exception('$this is not known in enum ResolverLevelMetricsConfig'); + } +} + enum RuntimeName { appsyncJs, } @@ -6785,6 +8187,55 @@ class SourceApiAssociationSummary { } } +class StartDataSourceIntrospectionResponse { + /// The introspection ID. Each introspection contains a unique ID that can be + /// used to reference the instrospection record. + final String? introspectionId; + + /// The status of the introspection during creation. By default, when a new + /// instrospection has been created, the status will be set to + /// PROCESSING. Once the operation has been completed, the status + /// will change to SUCCESS or FAILED depending on how + /// the data was parsed. A FAILED operation will return an error + /// and its details as an introspectionStatusDetail. + final DataSourceIntrospectionStatus? introspectionStatus; + + /// The error detail field. When a FAILED + /// introspectionStatus is returned, the + /// introspectionStatusDetail will also return the exact error that + /// was generated during the operation. + final String? introspectionStatusDetail; + + StartDataSourceIntrospectionResponse({ + this.introspectionId, + this.introspectionStatus, + this.introspectionStatusDetail, + }); + + factory StartDataSourceIntrospectionResponse.fromJson( + Map json) { + return StartDataSourceIntrospectionResponse( + introspectionId: json['introspectionId'] as String?, + introspectionStatus: (json['introspectionStatus'] as String?) + ?.toDataSourceIntrospectionStatus(), + introspectionStatusDetail: json['introspectionStatusDetail'] as String?, + ); + } + + Map toJson() { + final introspectionId = this.introspectionId; + final introspectionStatus = this.introspectionStatus; + final introspectionStatusDetail = this.introspectionStatusDetail; + return { + if (introspectionId != null) 'introspectionId': introspectionId, + if (introspectionStatus != null) + 'introspectionStatus': introspectionStatus.toValue(), + if (introspectionStatusDetail != null) + 'introspectionStatusDetail': introspectionStatusDetail, + }; + } +} + class StartSchemaCreationResponse { /// The current state of the schema (PROCESSING, FAILED, SUCCESS, or /// NOT_APPLICABLE). When the schema is in the ACTIVE state, you can add data. diff --git a/aws_client/lib/src/generated/appflow/v2020_08_23.dart b/aws_client/lib/src/generated/appflow/v2020_08_23.dart index 5d6894239..04204e600 100644 --- a/aws_client/lib/src/generated/appflow/v2020_08_23.dart +++ b/aws_client/lib/src/generated/appflow/v2020_08_23.dart @@ -249,6 +249,7 @@ class Appflow { /// May throw [ConflictException]. /// May throw [ConnectorAuthenticationException]. /// May throw [ConnectorServerException]. + /// May throw [AccessDeniedException]. /// /// Parameter [destinationFlowConfigList] : /// The configuration that controls how Amazon AppFlow places data in the @@ -874,6 +875,101 @@ class Appflow { return RegisterConnectorResponse.fromJson(response); } + /// Resets metadata about your connector entities that Amazon AppFlow stored + /// in its cache. Use this action when you want Amazon AppFlow to return the + /// latest information about the data that you have in a source application. + /// + /// Amazon AppFlow returns metadata about your entities when you use the + /// ListConnectorEntities or DescribeConnectorEntities actions. Following + /// these actions, Amazon AppFlow caches the metadata to reduce the number of + /// API requests that it must send to the source application. Amazon AppFlow + /// automatically resets the cache once every hour, but you can use this + /// action when you want to get the latest metadata right away. + /// + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// + /// Parameter [apiVersion] : + /// The API version that you specified in the connector profile that you’re + /// resetting cached metadata for. You must use this parameter only if the + /// connector supports multiple API versions or if the connector type is + /// CustomConnector. + /// + /// To look up how many versions a connector supports, use the + /// DescribeConnectors action. In the response, find the value that Amazon + /// AppFlow returns for the connectorVersion parameter. + /// + /// To look up the connector type, use the DescribeConnectorProfiles action. + /// In the response, find the value that Amazon AppFlow returns for the + /// connectorType parameter. + /// + /// To look up the API version that you specified in a connector profile, use + /// the DescribeConnectorProfiles action. + /// + /// Parameter [connectorEntityName] : + /// Use this parameter if you want to reset cached metadata about the details + /// for an individual entity. + /// + /// If you don't include this parameter in your request, Amazon AppFlow only + /// resets cached metadata about entity names, not entity details. + /// + /// Parameter [connectorProfileName] : + /// The name of the connector profile that you want to reset cached metadata + /// for. + /// + /// You can omit this parameter if you're resetting the cache for any of the + /// following connectors: Amazon Connect, Amazon EventBridge, Amazon Lookout + /// for Metrics, Amazon S3, or Upsolver. If you're resetting the cache for any + /// other connector, you must include this parameter in your request. + /// + /// Parameter [connectorType] : + /// The type of connector to reset cached metadata for. + /// + /// You must include this parameter in your request if you're resetting the + /// cache for any of the following connectors: Amazon Connect, Amazon + /// EventBridge, Amazon Lookout for Metrics, Amazon S3, or Upsolver. If you're + /// resetting the cache for any other connector, you can omit this parameter + /// from your request. + /// + /// Parameter [entitiesPath] : + /// Use this parameter only if you’re resetting the cached metadata about a + /// nested entity. Only some connectors support nested entities. A nested + /// entity is one that has another entity as a parent. To use this parameter, + /// specify the name of the parent entity. + /// + /// To look up the parent-child relationship of entities, you can send a + /// ListConnectorEntities request that omits the entitiesPath parameter. + /// Amazon AppFlow will return a list of top-level entities. For each one, it + /// indicates whether the entity has nested entities. Then, in a subsequent + /// ListConnectorEntities request, you can specify a parent entity name for + /// the entitiesPath parameter. Amazon AppFlow will return a list of the child + /// entities for that parent. + Future resetConnectorMetadataCache({ + String? apiVersion, + String? connectorEntityName, + String? connectorProfileName, + ConnectorType? connectorType, + String? entitiesPath, + }) async { + final $payload = { + if (apiVersion != null) 'apiVersion': apiVersion, + if (connectorEntityName != null) + 'connectorEntityName': connectorEntityName, + if (connectorProfileName != null) + 'connectorProfileName': connectorProfileName, + if (connectorType != null) 'connectorType': connectorType.toValue(), + if (entitiesPath != null) 'entitiesPath': entitiesPath, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/reset-connector-metadata-cache', + exceptionFnMap: _exceptionFns, + ); + } + /// Activates an existing flow. For on-demand flows, this operation runs the /// flow immediately. For schedule and event-triggered flows, this operation /// activates the flow. @@ -1169,6 +1265,7 @@ class Appflow { /// May throw [ConnectorAuthenticationException]. /// May throw [ConnectorServerException]. /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. /// /// Parameter [destinationFlowConfigList] : /// The configuration that controls how Amazon AppFlow transfers data to the @@ -1762,6 +1859,18 @@ class ConnectorConfiguration { /// A list of API versions that are supported by the connector. final List? supportedApiVersions; + /// The APIs of the connector application that Amazon AppFlow can use to + /// transfer your data. + final List? supportedDataTransferApis; + + /// The data transfer types that the connector supports. + ///
        RECORD
        + /// Structured records. + ///
        FILE
        + /// Files or binary data. + ///
        + final List? supportedDataTransferTypes; + /// Lists the connectors that are available for use as destinations. final List? supportedDestinationConnectors; @@ -1799,6 +1908,8 @@ class ConnectorConfiguration { this.registeredAt, this.registeredBy, this.supportedApiVersions, + this.supportedDataTransferApis, + this.supportedDataTransferTypes, this.supportedDestinationConnectors, this.supportedOperators, this.supportedSchedulingFrequencies, @@ -1850,6 +1961,14 @@ class ConnectorConfiguration { ?.whereNotNull() .map((e) => e as String) .toList(), + supportedDataTransferApis: (json['supportedDataTransferApis'] as List?) + ?.whereNotNull() + .map((e) => DataTransferApi.fromJson(e as Map)) + .toList(), + supportedDataTransferTypes: (json['supportedDataTransferTypes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toSupportedDataTransferType()) + .toList(), supportedDestinationConnectors: (json['supportedDestinationConnectors'] as List?) ?.whereNotNull() @@ -1898,6 +2017,8 @@ class ConnectorConfiguration { final registeredAt = this.registeredAt; final registeredBy = this.registeredBy; final supportedApiVersions = this.supportedApiVersions; + final supportedDataTransferApis = this.supportedDataTransferApis; + final supportedDataTransferTypes = this.supportedDataTransferTypes; final supportedDestinationConnectors = this.supportedDestinationConnectors; final supportedOperators = this.supportedOperators; final supportedSchedulingFrequencies = this.supportedSchedulingFrequencies; @@ -1935,6 +2056,11 @@ class ConnectorConfiguration { if (registeredBy != null) 'registeredBy': registeredBy, if (supportedApiVersions != null) 'supportedApiVersions': supportedApiVersions, + if (supportedDataTransferApis != null) + 'supportedDataTransferApis': supportedDataTransferApis, + if (supportedDataTransferTypes != null) + 'supportedDataTransferTypes': + supportedDataTransferTypes.map((e) => e.toValue()).toList(), if (supportedDestinationConnectors != null) 'supportedDestinationConnectors': supportedDestinationConnectors.map((e) => e.toValue()).toList(), @@ -1989,6 +2115,14 @@ class ConnectorDetail { /// The user who registered the connector. final String? registeredBy; + /// The data transfer types that the connector supports. + ///
        RECORD
        + /// Structured records. + ///
        FILE
        + /// Files or binary data. + ///
        + final List? supportedDataTransferTypes; + ConnectorDetail({ this.applicationType, this.connectorDescription, @@ -2001,6 +2135,7 @@ class ConnectorDetail { this.connectorVersion, this.registeredAt, this.registeredBy, + this.supportedDataTransferTypes, }); factory ConnectorDetail.fromJson(Map json) { @@ -2020,6 +2155,10 @@ class ConnectorDetail { connectorVersion: json['connectorVersion'] as String?, registeredAt: timeStampFromJson(json['registeredAt']), registeredBy: json['registeredBy'] as String?, + supportedDataTransferTypes: (json['supportedDataTransferTypes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toSupportedDataTransferType()) + .toList(), ); } @@ -2035,6 +2174,7 @@ class ConnectorDetail { final connectorVersion = this.connectorVersion; final registeredAt = this.registeredAt; final registeredBy = this.registeredBy; + final supportedDataTransferTypes = this.supportedDataTransferTypes; return { if (applicationType != null) 'applicationType': applicationType, if (connectorDescription != null) @@ -2050,6 +2190,9 @@ class ConnectorDetail { if (registeredAt != null) 'registeredAt': unixTimestampToJson(registeredAt), if (registeredBy != null) 'registeredBy': registeredBy, + if (supportedDataTransferTypes != null) + 'supportedDataTransferTypes': + supportedDataTransferTypes.map((e) => e.toValue()).toList(), }; } } @@ -3585,9 +3728,14 @@ class CustomConnectorSourceProperties { /// Custom properties that are required to use the custom connector as a source. final Map? customProperties; + /// The API of the connector application that Amazon AppFlow uses to transfer + /// your data. + final DataTransferApi? dataTransferApi; + CustomConnectorSourceProperties({ required this.entityName, this.customProperties, + this.dataTransferApi, }); factory CustomConnectorSourceProperties.fromJson(Map json) { @@ -3595,15 +3743,21 @@ class CustomConnectorSourceProperties { entityName: json['entityName'] as String, customProperties: (json['customProperties'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), + dataTransferApi: json['dataTransferApi'] != null + ? DataTransferApi.fromJson( + json['dataTransferApi'] as Map) + : null, ); } Map toJson() { final entityName = this.entityName; final customProperties = this.customProperties; + final dataTransferApi = this.dataTransferApi; return { 'entityName': entityName, if (customProperties != null) 'customProperties': customProperties, + if (dataTransferApi != null) 'dataTransferApi': dataTransferApi, }; } } @@ -3682,6 +3836,80 @@ extension DataPullModeFromString on String { } } +/// The API of the connector application that Amazon AppFlow uses to transfer +/// your data. +class DataTransferApi { + /// The name of the connector application API. + final String? name; + + /// You can specify one of the following types: + ///
        AUTOMATIC
        + /// The default. Optimizes a flow for datasets that fluctuate in size from small + /// to large. For each flow run, Amazon AppFlow chooses to use the SYNC or ASYNC + /// API type based on the amount of data that the run transfers. + ///
        SYNC
        + /// A synchronous API. This type of API optimizes a flow for small to + /// medium-sized datasets. + ///
        ASYNC
        + /// An asynchronous API. This type of API optimizes a flow for large datasets. + ///
        + final DataTransferApiType? type; + + DataTransferApi({ + this.name, + this.type, + }); + + factory DataTransferApi.fromJson(Map json) { + return DataTransferApi( + name: json['Name'] as String?, + type: (json['Type'] as String?)?.toDataTransferApiType(), + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + return { + if (name != null) 'Name': name, + if (type != null) 'Type': type.toValue(), + }; + } +} + +enum DataTransferApiType { + sync, + async, + automatic, +} + +extension DataTransferApiTypeValueExtension on DataTransferApiType { + String toValue() { + switch (this) { + case DataTransferApiType.sync: + return 'SYNC'; + case DataTransferApiType.async: + return 'ASYNC'; + case DataTransferApiType.automatic: + return 'AUTOMATIC'; + } + } +} + +extension DataTransferApiTypeFromString on String { + DataTransferApiType toDataTransferApiType() { + switch (this) { + case 'SYNC': + return DataTransferApiType.sync; + case 'ASYNC': + return DataTransferApiType.async; + case 'AUTOMATIC': + return DataTransferApiType.automatic; + } + throw Exception('$this is not known in enum DataTransferApiType'); + } +} + enum DatadogConnectorOperator { projection, between, @@ -4951,6 +5179,14 @@ class ExecutionResult { /// Provides any error message information related to the flow run. final ErrorInfo? errorInfo; + /// The maximum number of records that Amazon AppFlow receives in each page of + /// the response from your SAP application. + final int? maxPageSize; + + /// The number of processes that Amazon AppFlow ran at the same time when it + /// retrieved your data. + final int? numParallelProcesses; + /// The number of records processed in the flow run. final int? recordsProcessed; @@ -4958,6 +5194,8 @@ class ExecutionResult { this.bytesProcessed, this.bytesWritten, this.errorInfo, + this.maxPageSize, + this.numParallelProcesses, this.recordsProcessed, }); @@ -4968,6 +5206,8 @@ class ExecutionResult { errorInfo: json['errorInfo'] != null ? ErrorInfo.fromJson(json['errorInfo'] as Map) : null, + maxPageSize: json['maxPageSize'] as int?, + numParallelProcesses: json['numParallelProcesses'] as int?, recordsProcessed: json['recordsProcessed'] as int?, ); } @@ -4976,11 +5216,16 @@ class ExecutionResult { final bytesProcessed = this.bytesProcessed; final bytesWritten = this.bytesWritten; final errorInfo = this.errorInfo; + final maxPageSize = this.maxPageSize; + final numParallelProcesses = this.numParallelProcesses; final recordsProcessed = this.recordsProcessed; return { if (bytesProcessed != null) 'bytesProcessed': bytesProcessed, if (bytesWritten != null) 'bytesWritten': bytesWritten, if (errorInfo != null) 'errorInfo': errorInfo, + if (maxPageSize != null) 'maxPageSize': maxPageSize, + if (numParallelProcesses != null) + 'numParallelProcesses': numParallelProcesses, if (recordsProcessed != null) 'recordsProcessed': recordsProcessed, }; } @@ -7818,6 +8063,18 @@ class RegistrationOutput { } } +class ResetConnectorMetadataCacheResponse { + ResetConnectorMetadataCacheResponse(); + + factory ResetConnectorMetadataCacheResponse.fromJson(Map _) { + return ResetConnectorMetadataCacheResponse(); + } + + Map toJson() { + return {}; + } +} + enum S3ConnectorOperator { projection, lessThan, @@ -8313,6 +8570,19 @@ class SAPODataConnectorProfileProperties { /// The port number of the SAPOData instance. final int portNumber; + /// If you set this parameter to true, Amazon AppFlow bypasses the + /// single sign-on (SSO) settings in your SAP account when it accesses your SAP + /// OData instance. + /// + /// Whether you need this option depends on the types of credentials that you + /// applied to your SAP OData connection profile. If your profile uses basic + /// authentication credentials, SAP SSO can prevent Amazon AppFlow from + /// connecting to your account with your username and password. In this case, + /// bypassing SSO makes it possible for Amazon AppFlow to connect successfully. + /// However, if your profile uses OAuth credentials, this parameter has no + /// affect. + final bool? disableSSO; + /// The logon language of SAPOData instance. final String? logonLanguage; @@ -8328,6 +8598,7 @@ class SAPODataConnectorProfileProperties { required this.applicationServicePath, required this.clientNumber, required this.portNumber, + this.disableSSO, this.logonLanguage, this.oAuthProperties, this.privateLinkServiceName, @@ -8340,6 +8611,7 @@ class SAPODataConnectorProfileProperties { applicationServicePath: json['applicationServicePath'] as String, clientNumber: json['clientNumber'] as String, portNumber: json['portNumber'] as int, + disableSSO: json['disableSSO'] as bool?, logonLanguage: json['logonLanguage'] as String?, oAuthProperties: json['oAuthProperties'] != null ? OAuthProperties.fromJson( @@ -8354,6 +8626,7 @@ class SAPODataConnectorProfileProperties { final applicationServicePath = this.applicationServicePath; final clientNumber = this.clientNumber; final portNumber = this.portNumber; + final disableSSO = this.disableSSO; final logonLanguage = this.logonLanguage; final oAuthProperties = this.oAuthProperties; final privateLinkServiceName = this.privateLinkServiceName; @@ -8362,6 +8635,7 @@ class SAPODataConnectorProfileProperties { 'applicationServicePath': applicationServicePath, 'clientNumber': clientNumber, 'portNumber': portNumber, + if (disableSSO != null) 'disableSSO': disableSSO, if (logonLanguage != null) 'logonLanguage': logonLanguage, if (oAuthProperties != null) 'oAuthProperties': oAuthProperties, if (privateLinkServiceName != null) @@ -8446,25 +8720,103 @@ class SAPODataMetadata { } } +/// Sets the page size for each concurrent process that transfers OData +/// records from your SAP instance. A concurrent process is query that retrieves +/// a batch of records as part of a flow run. Amazon AppFlow can run multiple +/// concurrent processes in parallel to transfer data faster. +class SAPODataPaginationConfig { + /// The maximum number of records that Amazon AppFlow receives in each page of + /// the response from your SAP application. For transfers of OData records, the + /// maximum page size is 3,000. For transfers of data that comes from an ODP + /// provider, the maximum page size is 10,000. + final int maxPageSize; + + SAPODataPaginationConfig({ + required this.maxPageSize, + }); + + factory SAPODataPaginationConfig.fromJson(Map json) { + return SAPODataPaginationConfig( + maxPageSize: json['maxPageSize'] as int, + ); + } + + Map toJson() { + final maxPageSize = this.maxPageSize; + return { + 'maxPageSize': maxPageSize, + }; + } +} + +/// Sets the number of concurrent processes that transfer OData records +/// from your SAP instance. A concurrent process is query that retrieves a batch +/// of records as part of a flow run. Amazon AppFlow can run multiple concurrent +/// processes in parallel to transfer data faster. +class SAPODataParallelismConfig { + /// The maximum number of processes that Amazon AppFlow runs at the same time + /// when it retrieves your data from your SAP application. + final int maxParallelism; + + SAPODataParallelismConfig({ + required this.maxParallelism, + }); + + factory SAPODataParallelismConfig.fromJson(Map json) { + return SAPODataParallelismConfig( + maxParallelism: json['maxParallelism'] as int, + ); + } + + Map toJson() { + final maxParallelism = this.maxParallelism; + return { + 'maxParallelism': maxParallelism, + }; + } +} + /// The properties that are applied when using SAPOData as a flow source. class SAPODataSourceProperties { /// The object path specified in the SAPOData flow source. final String? objectPath; + /// Sets the page size for each concurrent process that transfers OData records + /// from your SAP instance. + final SAPODataPaginationConfig? paginationConfig; + + /// Sets the number of concurrent processes that transfers OData records from + /// your SAP instance. + final SAPODataParallelismConfig? parallelismConfig; + SAPODataSourceProperties({ this.objectPath, + this.paginationConfig, + this.parallelismConfig, }); factory SAPODataSourceProperties.fromJson(Map json) { return SAPODataSourceProperties( objectPath: json['objectPath'] as String?, + paginationConfig: json['paginationConfig'] != null + ? SAPODataPaginationConfig.fromJson( + json['paginationConfig'] as Map) + : null, + parallelismConfig: json['parallelismConfig'] != null + ? SAPODataParallelismConfig.fromJson( + json['parallelismConfig'] as Map) + : null, ); } Map toJson() { final objectPath = this.objectPath; + final paginationConfig = this.paginationConfig; + final parallelismConfig = this.parallelismConfig; return { if (objectPath != null) 'objectPath': objectPath, + if (paginationConfig != null) 'paginationConfig': paginationConfig, + if (parallelismConfig != null) 'parallelismConfig': parallelismConfig, }; } } @@ -9313,23 +9665,29 @@ extension ServiceNowConnectorOperatorFromString on String { /// The connector-specific profile credentials required when using ServiceNow. class ServiceNowConnectorProfileCredentials { + /// The OAuth 2.0 credentials required to authenticate the user. + final OAuth2Credentials? oAuth2Credentials; + /// The password that corresponds to the user name. - final String password; + final String? password; /// The name of the user. - final String username; + final String? username; ServiceNowConnectorProfileCredentials({ - required this.password, - required this.username, + this.oAuth2Credentials, + this.password, + this.username, }); Map toJson() { + final oAuth2Credentials = this.oAuth2Credentials; final password = this.password; final username = this.username; return { - 'password': password, - 'username': username, + if (oAuth2Credentials != null) 'oAuth2Credentials': oAuth2Credentials, + if (password != null) 'password': password, + if (username != null) 'username': username, }; } } @@ -10332,6 +10690,34 @@ class SuccessResponseHandlingConfig { } } +enum SupportedDataTransferType { + record, + file, +} + +extension SupportedDataTransferTypeValueExtension on SupportedDataTransferType { + String toValue() { + switch (this) { + case SupportedDataTransferType.record: + return 'RECORD'; + case SupportedDataTransferType.file: + return 'FILE'; + } + } +} + +extension SupportedDataTransferTypeFromString on String { + SupportedDataTransferType toSupportedDataTransferType() { + switch (this) { + case 'RECORD': + return SupportedDataTransferType.record; + case 'FILE': + return SupportedDataTransferType.file; + } + throw Exception('$this is not known in enum SupportedDataTransferType'); + } +} + /// Contains details regarding all the supported FieldTypes and /// their corresponding filterOperators and /// supportedValues. diff --git a/aws_client/lib/src/generated/application_auto_scaling/v2016_02_06.dart b/aws_client/lib/src/generated/application_auto_scaling/v2016_02_06.dart index dc3542bda..3bbe6b6bc 100644 --- a/aws_client/lib/src/generated/application_auto_scaling/v2016_02_06.dart +++ b/aws_client/lib/src/generated/application_auto_scaling/v2016_02_06.dart @@ -57,10 +57,13 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// Amazon Neptune clusters /// ///
      • +/// Amazon SageMaker endpoint variants +///
      • +///
      • /// Amazon SageMaker Serverless endpoint provisioned concurrency ///
      • ///
      • -/// Amazon SageMaker endpoint variants +/// Amazon SageMaker inference components ///
      • ///
      • /// Spot Fleets (Amazon EC2) @@ -137,9 +140,9 @@ class ApplicationAutoScaling { /// even if it no longer has an associated action. /// /// For more information, see Delete + /// href="https://docs.aws.amazon.com/autoscaling/application/userguide/create-step-scaling-policy-cli.html#delete-step-scaling-policy">Delete /// a step scaling policy and Delete + /// href="https://docs.aws.amazon.com/autoscaling/application/userguide/create-target-tracking-policy-cli.html#delete-target-tracking-policy">Delete /// a target tracking scaling policy in the Application Auto Scaling /// User Guide. /// @@ -244,6 +247,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. ///
      • + ///
      • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
      • ///
      /// /// Parameter [scalableDimension] : @@ -339,6 +347,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. ///
    • + ///
    • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
    • ///
    /// /// Parameter [serviceNamespace] : @@ -475,6 +487,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. ///
  • + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -570,6 +587,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [scheduledActionName] : @@ -710,6 +731,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -805,6 +831,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [serviceNamespace] : @@ -956,6 +986,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -1052,6 +1087,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// Future describeScalableTargets({ required ServiceNamespace serviceNamespace, @@ -1220,6 +1259,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -1316,6 +1360,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// Future describeScalingActivities({ required ServiceNamespace serviceNamespace, @@ -1483,6 +1531,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -1579,6 +1632,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// Future describeScalingPolicies({ required ServiceNamespace serviceNamespace, @@ -1742,6 +1799,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -1838,6 +1900,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [scheduledActionNames] : @@ -2059,6 +2125,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -2154,6 +2225,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [serviceNamespace] : @@ -2167,7 +2242,7 @@ class ApplicationAutoScaling { /// /// The following policy types are supported: /// - /// TargetTrackingScaling—Not supported for Amazon EMR + /// TargetTrackingScaling—Not supported for Amazon EMR. /// /// StepScaling—Not supported for DynamoDB, Amazon Comprehend, /// Lambda, Amazon Keyspaces, Amazon MSK, Amazon ElastiCache, or Neptune. @@ -2351,6 +2426,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -2446,6 +2526,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [scheduledActionName] : @@ -2697,6 +2781,11 @@ class ApplicationAutoScaling { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// /// /// Parameter [scalableDimension] : @@ -2792,6 +2881,10 @@ class ApplicationAutoScaling { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number + /// of copies across an endpoint for a SageMaker inference component. + ///
  • /// /// /// Parameter [serviceNamespace] : @@ -2840,10 +2933,10 @@ class ApplicationAutoScaling { /// Lambda provisioned concurrency /// ///
  • - /// SageMaker Serverless endpoint provisioned concurrency + /// SageMaker endpoint variants ///
  • ///
  • - /// SageMaker endpoint variants + /// SageMaker Serverless endpoint provisioned concurrency ///
  • ///
  • /// Spot Fleets @@ -3555,6 +3648,8 @@ enum MetricType { elastiCacheDatabaseMemoryUsageCountedForEvictPercentage, neptuneReaderAverageCPUUtilization, sageMakerVariantProvisionedConcurrencyUtilization, + elastiCacheDatabaseCapacityUsageCountedForEvictPercentage, + sageMakerInferenceComponentInvocationsPerCopy, } extension MetricTypeValueExtension on MetricType { @@ -3604,6 +3699,10 @@ extension MetricTypeValueExtension on MetricType { return 'NeptuneReaderAverageCPUUtilization'; case MetricType.sageMakerVariantProvisionedConcurrencyUtilization: return 'SageMakerVariantProvisionedConcurrencyUtilization'; + case MetricType.elastiCacheDatabaseCapacityUsageCountedForEvictPercentage: + return 'ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage'; + case MetricType.sageMakerInferenceComponentInvocationsPerCopy: + return 'SageMakerInferenceComponentInvocationsPerCopy'; } } } @@ -3656,6 +3755,11 @@ extension MetricTypeFromString on String { return MetricType.neptuneReaderAverageCPUUtilization; case 'SageMakerVariantProvisionedConcurrencyUtilization': return MetricType.sageMakerVariantProvisionedConcurrencyUtilization; + case 'ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage': + return MetricType + .elastiCacheDatabaseCapacityUsageCountedForEvictPercentage; + case 'SageMakerInferenceComponentInvocationsPerCopy': + return MetricType.sageMakerInferenceComponentInvocationsPerCopy; } throw Exception('$this is not known in enum MetricType'); } @@ -3764,8 +3868,8 @@ extension PolicyTypeFromString on String { /// CloudWatch. To determine whether a desired metric already exists by looking /// up its namespace and dimension using the CloudWatch metrics dashboard in the /// console, follow the procedure in Building -/// dashboards with CloudWatch in the Application Auto Scaling User +/// href="https://docs.aws.amazon.com/autoscaling/application/userguide/monitoring-cloudwatch.html">Monitor +/// your resources using CloudWatch in the Application Auto Scaling User /// Guide. class PredefinedMetricSpecification { /// The metric type. The ALBRequestCountPerTarget metric type @@ -3914,6 +4018,7 @@ enum ScalableDimension { elasticacheReplicationGroupReplicas, neptuneClusterReadReplicaCount, sagemakerVariantDesiredProvisionedConcurrency, + sagemakerInferenceComponentDesiredCopyCount, } extension ScalableDimensionValueExtension on ScalableDimension { @@ -3963,6 +4068,8 @@ extension ScalableDimensionValueExtension on ScalableDimension { return 'neptune:cluster:ReadReplicaCount'; case ScalableDimension.sagemakerVariantDesiredProvisionedConcurrency: return 'sagemaker:variant:DesiredProvisionedConcurrency'; + case ScalableDimension.sagemakerInferenceComponentDesiredCopyCount: + return 'sagemaker:inference-component:DesiredCopyCount'; } } } @@ -4014,6 +4121,8 @@ extension ScalableDimensionFromString on String { return ScalableDimension.neptuneClusterReadReplicaCount; case 'sagemaker:variant:DesiredProvisionedConcurrency': return ScalableDimension.sagemakerVariantDesiredProvisionedConcurrency; + case 'sagemaker:inference-component:DesiredCopyCount': + return ScalableDimension.sagemakerInferenceComponentDesiredCopyCount; } throw Exception('$this is not known in enum ScalableDimension'); } @@ -4120,6 +4229,11 @@ class ScalableTarget { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. ///
  • + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// final String resourceId; @@ -4218,6 +4332,10 @@ class ScalableTarget { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number of + /// copies across an endpoint for a SageMaker inference component. + ///
  • /// final ScalableDimension scalableDimension; @@ -4434,6 +4552,11 @@ class ScalingActivity { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// final String resourceId; @@ -4528,6 +4651,10 @@ class ScalingActivity { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number of + /// copies across an endpoint for a SageMaker inference component. + ///
  • /// final ScalableDimension scalableDimension; @@ -4788,6 +4915,11 @@ class ScalingPolicy { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// final String resourceId; @@ -4882,6 +5014,10 @@ class ScalingPolicy { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number of + /// copies across an endpoint for a SageMaker inference component. + ///
  • /// final ScalableDimension scalableDimension; @@ -5067,6 +5203,11 @@ class ScheduledAction { /// and the unique identifier is the resource ID. Example: /// endpoint/my-end-point/variant/KMeansClustering. /// + ///
  • + /// SageMaker inference component - The resource type is + /// inference-component and the unique identifier is the resource + /// ID. Example: inference-component/my-inference-component. + ///
  • /// final String resourceId; @@ -5208,6 +5349,10 @@ class ScheduledAction { /// sagemaker:variant:DesiredProvisionedConcurrency - The /// provisioned concurrency for a SageMaker Serverless endpoint. /// + ///
  • + /// sagemaker:inference-component:DesiredCopyCount - The number of + /// copies across an endpoint for a SageMaker inference component. + ///
  • /// final ScalableDimension? scalableDimension; @@ -5423,8 +5568,8 @@ extension ServiceNamespaceFromString on String { class StepAdjustment { /// The amount by which to scale, based on the specified adjustment type. A /// positive value adds to the current capacity while a negative number removes - /// from the current capacity. For exact capacity, you must specify a positive - /// value. + /// from the current capacity. For exact capacity, you must specify a + /// non-negative value. final int scalingAdjustment; /// The lower bound for the difference between the alarm threshold and the @@ -5475,6 +5620,10 @@ class StepAdjustment { /// Represents a step scaling policy configuration to use with Application Auto /// Scaling. +/// +/// For more information, see Step +/// scaling policies in the Application Auto Scaling User Guide. class StepScalingPolicyConfiguration { /// Specifies how the ScalingAdjustment value in a StepAdjustment @@ -5487,81 +5636,10 @@ class StepScalingPolicyConfiguration { final AdjustmentType? adjustmentType; /// The amount of time, in seconds, to wait for a previous scaling activity to - /// take effect. - /// - /// With scale-out policies, the intention is to continuously (but not - /// excessively) scale out. After Application Auto Scaling successfully scales - /// out using a step scaling policy, it starts to calculate the cooldown time. - /// The scaling policy won't increase the desired capacity again unless either a - /// larger scale out is triggered or the cooldown period ends. While the - /// cooldown period is in effect, capacity added by the initiating scale-out - /// activity is calculated as part of the desired capacity for the next - /// scale-out activity. For example, when an alarm triggers a step scaling - /// policy to increase the capacity by 2, the scaling activity completes - /// successfully, and a cooldown period starts. If the alarm triggers again - /// during the cooldown period but at a more aggressive step adjustment of 3, - /// the previous increase of 2 is considered part of the current capacity. - /// Therefore, only 1 is added to the capacity. - /// - /// With scale-in policies, the intention is to scale in conservatively to - /// protect your application’s availability, so scale-in activities are blocked - /// until the cooldown period has expired. However, if another alarm triggers a - /// scale-out activity during the cooldown period after a scale-in activity, - /// Application Auto Scaling scales out the target immediately. In this case, - /// the cooldown period for the scale-in activity stops and doesn't complete. - /// - /// Application Auto Scaling provides a default value of 600 for Amazon - /// ElastiCache replication groups and a default value of 300 for the following - /// scalable targets: - /// - ///
      - ///
    • - /// AppStream 2.0 fleets - ///
    • - ///
    • - /// Aurora DB clusters - ///
    • - ///
    • - /// ECS services - ///
    • - ///
    • - /// EMR clusters - ///
    • - ///
    • - /// Neptune clusters - ///
    • - ///
    • - /// SageMaker Serverless endpoint provisioned concurrency - ///
    • - ///
    • - /// SageMaker endpoint variants - ///
    • - ///
    • - /// Spot Fleets - ///
    • - ///
    • - /// Custom resources - ///
    • - ///
    - /// For all other scalable targets, the default value is 0: - /// - ///
      - ///
    • - /// Amazon Comprehend document classification and entity recognizer endpoints - ///
    • - ///
    • - /// DynamoDB tables and global secondary indexes - ///
    • - ///
    • - /// Amazon Keyspaces tables - ///
    • - ///
    • - /// Lambda provisioned concurrency - ///
    • - ///
    • - /// Amazon MSK broker storage - ///
    • - ///
    + /// take effect. If not specified, the default value is 300. For more + /// information, see Cooldown + /// period in the Application Auto Scaling User Guide. final int? cooldown; /// The aggregation type for the CloudWatch metrics. Valid values are @@ -5918,6 +5996,11 @@ class TargetTrackingMetricStat { /// Represents a target tracking scaling policy configuration to use with /// Application Auto Scaling. +/// +/// For more information, see Target +/// tracking scaling policies in the Application Auto Scaling User +/// Guide. class TargetTrackingScalingPolicyConfiguration { /// The target value for the metric. Although this property accepts numbers of /// type Double, it won't accept values that are either too small or too large. @@ -5949,133 +6032,16 @@ class TargetTrackingScalingPolicyConfiguration { final PredefinedMetricSpecification? predefinedMetricSpecification; /// The amount of time, in seconds, after a scale-in activity completes before - /// another scale-in activity can start. - /// - /// With the scale-in cooldown period, the intention is to scale in - /// conservatively to protect your application’s availability, so scale-in - /// activities are blocked until the cooldown period has expired. However, if - /// another alarm triggers a scale-out activity during the scale-in cooldown - /// period, Application Auto Scaling scales out the target immediately. In this - /// case, the scale-in cooldown period stops and doesn't complete. - /// - /// Application Auto Scaling provides a default value of 600 for Amazon - /// ElastiCache replication groups and a default value of 300 for the following - /// scalable targets: - /// - ///
      - ///
    • - /// AppStream 2.0 fleets - ///
    • - ///
    • - /// Aurora DB clusters - ///
    • - ///
    • - /// ECS services - ///
    • - ///
    • - /// EMR clusters - ///
    • - ///
    • - /// Neptune clusters - ///
    • - ///
    • - /// SageMaker Serverless endpoint provisioned concurrency - ///
    • - ///
    • - /// SageMaker endpoint variants - ///
    • - ///
    • - /// Spot Fleets - ///
    • - ///
    • - /// Custom resources - ///
    • - ///
    - /// For all other scalable targets, the default value is 0: - /// - ///
      - ///
    • - /// Amazon Comprehend document classification and entity recognizer endpoints - ///
    • - ///
    • - /// DynamoDB tables and global secondary indexes - ///
    • - ///
    • - /// Amazon Keyspaces tables - ///
    • - ///
    • - /// Lambda provisioned concurrency - ///
    • - ///
    • - /// Amazon MSK broker storage - ///
    • - ///
    + /// another scale-in activity can start. For more information and for default + /// values, see Define + /// cooldown periods in the Application Auto Scaling User Guide. final int? scaleInCooldown; /// The amount of time, in seconds, to wait for a previous scale-out activity to - /// take effect. - /// - /// With the scale-out cooldown period, the intention is to continuously - /// (but not excessively) scale out. After Application Auto Scaling successfully - /// scales out using a target tracking scaling policy, it starts to calculate - /// the cooldown time. The scaling policy won't increase the desired capacity - /// again unless either a larger scale out is triggered or the cooldown period - /// ends. While the cooldown period is in effect, the capacity added by the - /// initiating scale-out activity is calculated as part of the desired capacity - /// for the next scale-out activity. - /// - /// Application Auto Scaling provides a default value of 600 for Amazon - /// ElastiCache replication groups and a default value of 300 for the following - /// scalable targets: - /// - ///
      - ///
    • - /// AppStream 2.0 fleets - ///
    • - ///
    • - /// Aurora DB clusters - ///
    • - ///
    • - /// ECS services - ///
    • - ///
    • - /// EMR clusters - ///
    • - ///
    • - /// Neptune clusters - ///
    • - ///
    • - /// SageMaker Serverless endpoint provisioned concurrency - ///
    • - ///
    • - /// SageMaker endpoint variants - ///
    • - ///
    • - /// Spot Fleets - ///
    • - ///
    • - /// Custom resources - ///
    • - ///
    - /// For all other scalable targets, the default value is 0: - /// - ///
      - ///
    • - /// Amazon Comprehend document classification and entity recognizer endpoints - ///
    • - ///
    • - /// DynamoDB tables and global secondary indexes - ///
    • - ///
    • - /// Amazon Keyspaces tables - ///
    • - ///
    • - /// Lambda provisioned concurrency - ///
    • - ///
    • - /// Amazon MSK broker storage - ///
    • - ///
    + /// take effect. For more information and for default values, see Define + /// cooldown periods in the Application Auto Scaling User Guide. final int? scaleOutCooldown; TargetTrackingScalingPolicyConfiguration({ diff --git a/aws_client/lib/src/generated/application_discovery_service/v2015_11_01.dart b/aws_client/lib/src/generated/application_discovery_service/v2015_11_01.dart index d2017808e..c5d150419 100644 --- a/aws_client/lib/src/generated/application_discovery_service/v2015_11_01.dart +++ b/aws_client/lib/src/generated/application_discovery_service/v2015_11_01.dart @@ -19,14 +19,12 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Amazon Web Services Application Discovery Service helps you plan application -/// migration projects. It automatically identifies servers, virtual machines -/// (VMs), and network dependencies in your on-premises data centers. For more -/// information, see the Amazon Web Services -/// Application Discovery Service FAQ. Application Discovery Service offers -/// three ways of performing discovery and collecting data about your -/// on-premises servers: +/// Application Discovery Service FAQ. class ApplicationDiscovery { final _s.JsonProtocol _protocol; ApplicationDiscovery({ @@ -91,6 +89,39 @@ class ApplicationDiscovery { ); } + /// Deletes one or more agents or collectors as specified by ID. Deleting an + /// agent or collector does not delete the previously discovered data. To + /// delete the data collected, use + /// StartBatchDeleteConfigurationTask. + /// + /// May throw [AuthorizationErrorException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidParameterValueException]. + /// May throw [ServerInternalErrorException]. + /// + /// Parameter [deleteAgents] : + /// The list of agents to delete. + Future batchDeleteAgents({ + required List deleteAgents, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSPoseidonService_V2015_11_01.BatchDeleteAgents' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'deleteAgents': deleteAgents, + }, + ); + + return BatchDeleteAgentsResponse.fromJson(jsonResponse.body); + } + /// Deletes one or more import tasks, each identified by their import ID. Each /// import task has a number of records that can identify servers or /// applications. @@ -111,8 +142,13 @@ class ApplicationDiscovery { /// /// Parameter [importTaskIds] : /// The IDs for the import tasks that you want to delete. + /// + /// Parameter [deleteHistory] : + /// Set to true to remove the deleted import task from + /// DescribeImportTasks. Future batchDeleteImportData({ required List importTaskIds, + bool? deleteHistory, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -126,6 +162,7 @@ class ApplicationDiscovery { headers: headers, payload: { 'importTaskIds': importTaskIds, + if (deleteHistory != null) 'deleteHistory': deleteHistory, }, ); @@ -282,9 +319,9 @@ class ApplicationDiscovery { ); } - /// Lists agents or connectors as specified by ID or other filters. All - /// agents/connectors associated with your user account can be listed if you - /// call DescribeAgents as is without passing any parameters. + /// Lists agents or collectors as specified by ID or other filters. All + /// agents/collectors associated with your user can be listed if you call + /// DescribeAgents as is without passing any parameters. /// /// May throw [AuthorizationErrorException]. /// May throw [InvalidParameterException]. @@ -293,9 +330,9 @@ class ApplicationDiscovery { /// May throw [HomeRegionNotSetException]. /// /// Parameter [agentIds] : - /// The agent or the Connector IDs for which you want information. If you - /// specify no IDs, the system returns information about all agents/Connectors - /// associated with your Amazon Web Services user account. + /// The agent or the collector IDs for which you want information. If you + /// specify no IDs, the system returns information about all agents/collectors + /// associated with your user. /// /// Parameter [filters] : /// You can filter the request using various logical operators and a @@ -304,7 +341,7 @@ class ApplicationDiscovery { /// {"key": "collectionStatus", "value": "STARTED"} /// /// Parameter [maxResults] : - /// The total number of agents/Connectors to return in a single page of + /// The total number of agents/collectors to return in a single page of /// output. The maximum value is 100. /// /// Parameter [nextToken] : @@ -340,6 +377,40 @@ class ApplicationDiscovery { return DescribeAgentsResponse.fromJson(jsonResponse.body); } + /// Takes a unique deletion task identifier as input and returns metadata + /// about a configuration deletion task. + /// + /// May throw [AuthorizationErrorException]. + /// May throw [InvalidParameterValueException]. + /// May throw [ServerInternalErrorException]. + /// May throw [HomeRegionNotSetException]. + /// + /// Parameter [taskId] : + /// The ID of the task to delete. + Future + describeBatchDeleteConfigurationTask({ + required String taskId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSPoseidonService_V2015_11_01.DescribeBatchDeleteConfigurationTask' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'taskId': taskId, + }, + ); + + return DescribeBatchDeleteConfigurationTaskResponse.fromJson( + jsonResponse.body); + } + /// Retrieves attributes for a list of configuration item IDs. /// /// All of the supplied IDs must be for the same asset type from one of the @@ -400,9 +471,8 @@ class ApplicationDiscovery { } /// Lists exports as specified by ID. All continuous exports associated with - /// your user account can be listed if you call - /// DescribeContinuousExports as is without passing any - /// parameters. + /// your user can be listed if you call DescribeContinuousExports + /// as is without passing any parameters. /// /// May throw [AuthorizationErrorException]. /// May throw [InvalidParameterException]. @@ -632,9 +702,9 @@ class ApplicationDiscovery { /// configurationId /// /// - /// Also, all configuration items associated with your user account that have - /// tags can be listed if you call DescribeTags as is without - /// passing any parameters. + /// Also, all configuration items associated with your user that have tags can + /// be listed if you call DescribeTags as is without passing any + /// parameters. /// /// May throw [AuthorizationErrorException]. /// May throw [ResourceNotFoundException]. @@ -905,6 +975,48 @@ class ApplicationDiscovery { return ListServerNeighborsResponse.fromJson(jsonResponse.body); } + /// Takes a list of configurationId as input and starts an asynchronous + /// deletion task to remove the configurationItems. Returns a unique deletion + /// task identifier. + /// + /// May throw [LimitExceededException]. + /// May throw [AuthorizationErrorException]. + /// May throw [ServerInternalErrorException]. + /// May throw [HomeRegionNotSetException]. + /// May throw [OperationNotPermittedException]. + /// May throw [InvalidParameterValueException]. + /// + /// Parameter [configurationIds] : + /// The list of configuration IDs that will be deleted by the task. + /// + /// Parameter [configurationType] : + /// The type of configuration item to delete. Supported types are: SERVER. + Future + startBatchDeleteConfigurationTask({ + required List configurationIds, + required DeletionConfigurationItemType configurationType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSPoseidonService_V2015_11_01.StartBatchDeleteConfigurationTask' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'configurationIds': configurationIds, + 'configurationType': configurationType.toValue(), + }, + ); + + return StartBatchDeleteConfigurationTaskResponse.fromJson( + jsonResponse.body); + } + /// Start the continuous flow of agent's discovered data into Amazon Athena. /// /// May throw [ConflictErrorException]. @@ -931,7 +1043,7 @@ class ApplicationDiscovery { return StartContinuousExportResponse.fromJson(jsonResponse.body); } - /// Instructs the specified agents or connectors to start collecting data. + /// Instructs the specified agents to start collecting data. /// /// May throw [AuthorizationErrorException]. /// May throw [InvalidParameterException]. @@ -940,14 +1052,14 @@ class ApplicationDiscovery { /// May throw [HomeRegionNotSetException]. /// /// Parameter [agentIds] : - /// The IDs of the agents or connectors from which to start collecting data. - /// If you send a request to an agent/connector ID that you do not have - /// permission to contact, according to your Amazon Web Services account, the - /// service does not throw an exception. Instead, it returns the error in the - /// Description field. If you send a request to multiple - /// agents/connectors and you do not have permission to contact some of those - /// agents/connectors, the system does not throw an exception. Instead, the - /// system shows Failed in the Description field. + /// The IDs of the agents from which to start collecting data. If you send a + /// request to an agent ID that you do not have permission to contact, + /// according to your Amazon Web Services account, the service does not throw + /// an exception. Instead, it returns the error in the Description + /// field. If you send a request to multiple agents and you do not have + /// permission to contact some of those agents, the system does not throw an + /// exception. Instead, the system shows Failed in the + /// Description field. Future startDataCollectionByAgentIds({ required List agentIds, }) async { @@ -970,19 +1082,35 @@ class ApplicationDiscovery { return StartDataCollectionByAgentIdsResponse.fromJson(jsonResponse.body); } - /// Begins the export of discovered data to an S3 bucket. + /// Begins the export of a discovered data report to an Amazon S3 bucket + /// managed by Amazon Web Services. + /// + /// Exports might provide an estimate of fees and savings based on certain + /// information that you provide. Fee estimates do not include any taxes that + /// might apply. Your actual fees and savings depend on a variety of factors, + /// including your actual usage of Amazon Web Services services, which might + /// vary from the estimates provided in this report. + /// + /// If you do not specify preferences or agentIds in + /// the filter, a summary of all servers, applications, tags, and performance + /// is generated. This data is an aggregation of all server data collected + /// through on-premises tooling, file import, application grouping and + /// applying tags. /// /// If you specify agentIds in a filter, the task exports up to /// 72 hours of detailed data collected by the identified Application /// Discovery Agent, including network, process, and performance details. A /// time range for exported agent data may be set by using /// startTime and endTime. Export of detailed agent - /// data is limited to five concurrently running exports. + /// data is limited to five concurrently running exports. Export of detailed + /// agent data is limited to two exports per day. /// - /// If you do not include an agentIds filter, summary data is - /// exported that includes both Amazon Web Services Agentless Discovery - /// Connector data and summary data from Amazon Web Services Discovery Agents. - /// Export of summary data is limited to two exports per day. + /// If you enable ec2RecommendationsPreferences in + /// preferences , an Amazon EC2 instance matching the + /// characteristics of each server in Application Discovery Service is + /// generated. Changing the attributes of the + /// ec2RecommendationsPreferences changes the criteria of the + /// recommendation. /// /// May throw [AuthorizationErrorException]. /// May throw [InvalidParameterException]. @@ -1007,8 +1135,14 @@ class ApplicationDiscovery { /// agentId can be found in the results of the /// DescribeAgents API or CLI. If no filter is present, /// startTime and endTime are ignored and exported - /// data includes both Agentless Discovery Connector data and summary data - /// from Application Discovery agents. + /// data includes both Amazon Web Services Application Discovery Service + /// Agentless Collector collectors data and summary data from Application + /// Discovery Agent agents. + /// + /// Parameter [preferences] : + /// Indicates the type of data that needs to be exported. Only one ExportPreferences + /// can be enabled at any time. /// /// Parameter [startTime] : /// The start timestamp for exported data from the single Application @@ -1018,6 +1152,7 @@ class ApplicationDiscovery { DateTime? endTime, List? exportDataFormat, List? filters, + ExportPreferences? preferences, DateTime? startTime, }) async { final headers = { @@ -1035,6 +1170,7 @@ class ApplicationDiscovery { if (exportDataFormat != null) 'exportDataFormat': exportDataFormat.map((e) => e.toValue()).toList(), if (filters != null) 'filters': filters, + if (preferences != null) 'preferences': preferences, if (startTime != null) 'startTime': unixTimestampToJson(startTime), }, ); @@ -1044,11 +1180,12 @@ class ApplicationDiscovery { /// Starts an import task, which allows you to import details of your /// on-premises environment directly into Amazon Web Services Migration Hub - /// without having to use the Application Discovery Service (ADS) tools such - /// as the Discovery Connector or Discovery Agent. This gives you the option - /// to perform migration assessment and planning directly from your imported - /// data, including the ability to group your devices as applications and - /// track their migration status. + /// without having to use the Amazon Web Services Application Discovery + /// Service (Application Discovery Service) tools such as the Amazon Web + /// Services Application Discovery Service Agentless Collector or Application + /// Discovery Agent. This gives you the option to perform migration assessment + /// and planning directly from your imported data, including the ability to + /// group your devices as applications and track their migration status. /// /// To start an import request, do this: ///
      @@ -1169,7 +1306,7 @@ class ApplicationDiscovery { return StopContinuousExportResponse.fromJson(jsonResponse.body); } - /// Instructs the specified agents or connectors to stop collecting data. + /// Instructs the specified agents to stop collecting data. /// /// May throw [AuthorizationErrorException]. /// May throw [InvalidParameterException]. @@ -1178,7 +1315,7 @@ class ApplicationDiscovery { /// May throw [HomeRegionNotSetException]. /// /// Parameter [agentIds] : - /// The IDs of the agents or connectors from which to stop collecting data. + /// The IDs of the agents from which to stop collecting data. Future stopDataCollectionByAgentIds({ required List agentIds, }) async { @@ -1241,11 +1378,11 @@ class ApplicationDiscovery { } } -/// Information about agents or connectors that were instructed to start -/// collecting data. Information includes the agent/connector ID, a description -/// of the operation, and whether the agent/connector configuration was updated. +/// Information about agents that were instructed to start collecting data. +/// Information includes the agent ID, a description of the operation, and +/// whether the agent configuration was updated. class AgentConfigurationStatus { - /// The agent/connector ID. + /// The agent ID. final String? agentId; /// A description of the operation performed. @@ -1253,8 +1390,8 @@ class AgentConfigurationStatus { /// Information about the status of the StartDataCollection and /// StopDataCollection operations. The system has recorded the data - /// collection operation. The agent/connector receives this command the next - /// time it polls for a new command. + /// collection operation. The agent receives this command the next time it polls + /// for a new command. final bool? operationSucceeded; AgentConfigurationStatus({ @@ -1283,40 +1420,40 @@ class AgentConfigurationStatus { } } -/// Information about agents or connectors associated with the user’s Amazon Web -/// Services account. Information includes agent or connector IDs, IP addresses, -/// media access control (MAC) addresses, agent or connector health, hostname -/// where the agent or connector resides, and agent version for each agent. +/// Information about agents associated with the user’s Amazon Web Services +/// account. Information includes agent IDs, IP addresses, media access control +/// (MAC) addresses, agent or collector status, hostname where the agent +/// resides, and agent version for each agent. class AgentInfo { - /// The agent or connector ID. + /// The agent or collector ID. final String? agentId; - /// Network details about the host where the agent or connector resides. + /// Network details about the host where the agent or collector resides. final List? agentNetworkInfoList; /// Type of agent. final String? agentType; - /// Status of the collection process for an agent or connector. + /// Status of the collection process for an agent. final String? collectionStatus; /// The ID of the connector. final String? connectorId; - /// The health of the agent or connector. + /// The health of the agent. final AgentStatus? health; - /// The name of the host where the agent or connector resides. The host can be a + /// The name of the host where the agent or collector resides. The host can be a /// server or virtual machine. final String? hostName; - /// Time since agent or connector health was reported. + /// Time since agent health was reported. final String? lastHealthPingTime; /// Agent's first registration timestamp in UTC. final String? registeredTime; - /// The agent or connector version. + /// The agent or collector version. final String? version; AgentInfo({ @@ -1377,12 +1514,12 @@ class AgentInfo { } } -/// Network details about the host where the agent/connector resides. +/// Network details about the host where the agent/collector resides. class AgentNetworkInfo { - /// The IP address for the host where the agent/connector resides. + /// The IP address for the host where the agent/collector resides. final String? ipAddress; - /// The MAC address for the host where the agent/connector resides. + /// The MAC address for the host where the agent/collector resides. final String? macAddress; AgentNetworkInfo({ @@ -1468,6 +1605,219 @@ class AssociateConfigurationItemsToApplicationResponse { } } +/// An object representing the agent or data collector that failed to delete, +/// each containing agentId, errorMessage, and errorCode. +class BatchDeleteAgentError { + /// The ID of the agent or data collector to delete. + final String agentId; + + /// The type of error that occurred for the delete failed agent. Valid status + /// are: AGENT_IN_USE | NOT_FOUND | INTERNAL_SERVER_ERROR. + final DeleteAgentErrorCode errorCode; + + /// The description of the error that occurred for the delete failed agent. + final String errorMessage; + + BatchDeleteAgentError({ + required this.agentId, + required this.errorCode, + required this.errorMessage, + }); + + factory BatchDeleteAgentError.fromJson(Map json) { + return BatchDeleteAgentError( + agentId: json['agentId'] as String, + errorCode: (json['errorCode'] as String).toDeleteAgentErrorCode(), + errorMessage: json['errorMessage'] as String, + ); + } + + Map toJson() { + final agentId = this.agentId; + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; + return { + 'agentId': agentId, + 'errorCode': errorCode.toValue(), + 'errorMessage': errorMessage, + }; + } +} + +class BatchDeleteAgentsResponse { + /// A list of agent IDs that failed to delete during the deletion task, each + /// paired with an error message. + final List? errors; + + BatchDeleteAgentsResponse({ + this.errors, + }); + + factory BatchDeleteAgentsResponse.fromJson(Map json) { + return BatchDeleteAgentsResponse( + errors: (json['errors'] as List?) + ?.whereNotNull() + .map((e) => BatchDeleteAgentError.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final errors = this.errors; + return { + if (errors != null) 'errors': errors, + }; + } +} + +/// A metadata object that represents the deletion task being executed. +class BatchDeleteConfigurationTask { + /// The type of configuration item to delete. Supported types are: SERVER. + final DeletionConfigurationItemType? configurationType; + + /// The list of configuration IDs that were successfully deleted by the deletion + /// task. + final List? deletedConfigurations; + + /// A list of configuration IDs that produced warnings regarding their deletion, + /// paired with a warning message. + final List? deletionWarnings; + + /// An epoch seconds timestamp (UTC) of when the deletion task was completed or + /// failed. + final DateTime? endTime; + + /// A list of configuration IDs that failed to delete during the deletion task, + /// each paired with an error message. + final List? failedConfigurations; + + /// The list of configuration IDs that were originally requested to be deleted + /// by the deletion task. + final List? requestedConfigurations; + + /// An epoch seconds timestamp (UTC) of when the deletion task was started. + final DateTime? startTime; + + /// The current execution status of the deletion task. Valid status are: + /// INITIALIZING | VALIDATING | DELETING | COMPLETED | FAILED. + final BatchDeleteConfigurationTaskStatus? status; + + /// The deletion task's unique identifier. + final String? taskId; + + BatchDeleteConfigurationTask({ + this.configurationType, + this.deletedConfigurations, + this.deletionWarnings, + this.endTime, + this.failedConfigurations, + this.requestedConfigurations, + this.startTime, + this.status, + this.taskId, + }); + + factory BatchDeleteConfigurationTask.fromJson(Map json) { + return BatchDeleteConfigurationTask( + configurationType: (json['configurationType'] as String?) + ?.toDeletionConfigurationItemType(), + deletedConfigurations: (json['deletedConfigurations'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + deletionWarnings: (json['deletionWarnings'] as List?) + ?.whereNotNull() + .map((e) => DeletionWarning.fromJson(e as Map)) + .toList(), + endTime: timeStampFromJson(json['endTime']), + failedConfigurations: (json['failedConfigurations'] as List?) + ?.whereNotNull() + .map((e) => FailedConfiguration.fromJson(e as Map)) + .toList(), + requestedConfigurations: (json['requestedConfigurations'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + startTime: timeStampFromJson(json['startTime']), + status: + (json['status'] as String?)?.toBatchDeleteConfigurationTaskStatus(), + taskId: json['taskId'] as String?, + ); + } + + Map toJson() { + final configurationType = this.configurationType; + final deletedConfigurations = this.deletedConfigurations; + final deletionWarnings = this.deletionWarnings; + final endTime = this.endTime; + final failedConfigurations = this.failedConfigurations; + final requestedConfigurations = this.requestedConfigurations; + final startTime = this.startTime; + final status = this.status; + final taskId = this.taskId; + return { + if (configurationType != null) + 'configurationType': configurationType.toValue(), + if (deletedConfigurations != null) + 'deletedConfigurations': deletedConfigurations, + if (deletionWarnings != null) 'deletionWarnings': deletionWarnings, + if (endTime != null) 'endTime': unixTimestampToJson(endTime), + if (failedConfigurations != null) + 'failedConfigurations': failedConfigurations, + if (requestedConfigurations != null) + 'requestedConfigurations': requestedConfigurations, + if (startTime != null) 'startTime': unixTimestampToJson(startTime), + if (status != null) 'status': status.toValue(), + if (taskId != null) 'taskId': taskId, + }; + } +} + +enum BatchDeleteConfigurationTaskStatus { + initializing, + validating, + deleting, + completed, + failed, +} + +extension BatchDeleteConfigurationTaskStatusValueExtension + on BatchDeleteConfigurationTaskStatus { + String toValue() { + switch (this) { + case BatchDeleteConfigurationTaskStatus.initializing: + return 'INITIALIZING'; + case BatchDeleteConfigurationTaskStatus.validating: + return 'VALIDATING'; + case BatchDeleteConfigurationTaskStatus.deleting: + return 'DELETING'; + case BatchDeleteConfigurationTaskStatus.completed: + return 'COMPLETED'; + case BatchDeleteConfigurationTaskStatus.failed: + return 'FAILED'; + } + } +} + +extension BatchDeleteConfigurationTaskStatusFromString on String { + BatchDeleteConfigurationTaskStatus toBatchDeleteConfigurationTaskStatus() { + switch (this) { + case 'INITIALIZING': + return BatchDeleteConfigurationTaskStatus.initializing; + case 'VALIDATING': + return BatchDeleteConfigurationTaskStatus.validating; + case 'DELETING': + return BatchDeleteConfigurationTaskStatus.deleting; + case 'COMPLETED': + return BatchDeleteConfigurationTaskStatus.completed; + case 'FAILED': + return BatchDeleteConfigurationTaskStatus.failed; + } + throw Exception( + '$this is not known in enum BatchDeleteConfigurationTaskStatus'); + } +} + /// Error messages returned for each import task that you deleted as a response /// for this command. class BatchDeleteImportDataError { @@ -1742,17 +2092,17 @@ class ContinuousExportDescription { /// ///
    1. /// FIREHOSE_ROLE_MISSING - The Data Exploration feature is in an error state - /// because your IAM User is missing the AWSApplicationDiscoveryServiceFirehose - /// role. Turn on Data Exploration in Amazon Athena and try again. For more - /// information, see Step - /// 3: Provide Application Discovery Service Access to Non-Administrator Users - /// by Attaching Policies in the Application Discovery Service User Guide. + /// because your user is missing the Amazon Web + /// ServicesApplicationDiscoveryServiceFirehose role. Turn on Data Exploration + /// in Amazon Athena and try again. For more information, see Creating + /// the Amazon Web ServicesApplicationDiscoveryServiceFirehose Role in the + /// Application Discovery Service User Guide. ///
    2. ///
    3. /// FIREHOSE_STREAM_DOES_NOT_EXIST - The Data Exploration feature is in an error - /// state because your IAM User is missing one or more of the Kinesis data - /// delivery streams. + /// state because your user is missing one or more of the Kinesis data delivery + /// streams. ///
    4. ///
    5. /// INTERNAL_FAILURE - The Data Exploration feature is in an error state because @@ -2020,13 +2370,28 @@ class CustomerAgentInfo { } } +/// The inventory data for installed Agentless Collector collectors. class CustomerAgentlessCollectorInfo { + /// The number of active Agentless Collector collectors. final int activeAgentlessCollectors; + + /// The number of deny-listed Agentless Collector collectors. final int denyListedAgentlessCollectors; + + /// The number of healthy Agentless Collector collectors. final int healthyAgentlessCollectors; + + /// The number of Agentless Collector collectors with SHUTDOWN + /// status. final int shutdownAgentlessCollectors; + + /// The total number of Agentless Collector collectors. final int totalAgentlessCollectors; + + /// The number of unhealthy Agentless Collector collectors. final int unhealthyAgentlessCollectors; + + /// The number of unknown Agentless Collector collectors. final int unknownAgentlessCollectors; CustomerAgentlessCollectorInfo({ @@ -2226,6 +2591,67 @@ extension DataSourceFromString on String { } } +/// An object representing the agent or data collector to be deleted along with +/// the optional configurations for error handling. +class DeleteAgent { + /// The ID of the agent or data collector to delete. + final String agentId; + + /// Optional flag used to force delete an agent or data collector. It is needed + /// to delete any agent in HEALTHY/UNHEALTHY/RUNNING status. Note that deleting + /// an agent that is actively reporting health causes it to be re-registered + /// with a different agent ID after data collector re-connects with Amazon Web + /// Services. + final bool? force; + + DeleteAgent({ + required this.agentId, + this.force, + }); + + Map toJson() { + final agentId = this.agentId; + final force = this.force; + return { + 'agentId': agentId, + if (force != null) 'force': force, + }; + } +} + +enum DeleteAgentErrorCode { + notFound, + internalServerError, + agentInUse, +} + +extension DeleteAgentErrorCodeValueExtension on DeleteAgentErrorCode { + String toValue() { + switch (this) { + case DeleteAgentErrorCode.notFound: + return 'NOT_FOUND'; + case DeleteAgentErrorCode.internalServerError: + return 'INTERNAL_SERVER_ERROR'; + case DeleteAgentErrorCode.agentInUse: + return 'AGENT_IN_USE'; + } + } +} + +extension DeleteAgentErrorCodeFromString on String { + DeleteAgentErrorCode toDeleteAgentErrorCode() { + switch (this) { + case 'NOT_FOUND': + return DeleteAgentErrorCode.notFound; + case 'INTERNAL_SERVER_ERROR': + return DeleteAgentErrorCode.internalServerError; + case 'AGENT_IN_USE': + return DeleteAgentErrorCode.agentInUse; + } + throw Exception('$this is not known in enum DeleteAgentErrorCode'); + } +} + class DeleteApplicationsResponse { DeleteApplicationsResponse(); @@ -2250,12 +2676,74 @@ class DeleteTagsResponse { } } +enum DeletionConfigurationItemType { + server, +} + +extension DeletionConfigurationItemTypeValueExtension + on DeletionConfigurationItemType { + String toValue() { + switch (this) { + case DeletionConfigurationItemType.server: + return 'SERVER'; + } + } +} + +extension DeletionConfigurationItemTypeFromString on String { + DeletionConfigurationItemType toDeletionConfigurationItemType() { + switch (this) { + case 'SERVER': + return DeletionConfigurationItemType.server; + } + throw Exception('$this is not known in enum DeletionConfigurationItemType'); + } +} + +/// A configuration ID paired with a warning message. +class DeletionWarning { + /// The unique identifier of the configuration that produced a warning. + final String? configurationId; + + /// The integer warning code associated with the warning message. + final int? warningCode; + + /// A descriptive message of the warning the associated configuration ID + /// produced. + final String? warningText; + + DeletionWarning({ + this.configurationId, + this.warningCode, + this.warningText, + }); + + factory DeletionWarning.fromJson(Map json) { + return DeletionWarning( + configurationId: json['configurationId'] as String?, + warningCode: json['warningCode'] as int?, + warningText: json['warningText'] as String?, + ); + } + + Map toJson() { + final configurationId = this.configurationId; + final warningCode = this.warningCode; + final warningText = this.warningText; + return { + if (configurationId != null) 'configurationId': configurationId, + if (warningCode != null) 'warningCode': warningCode, + if (warningText != null) 'warningText': warningText, + }; + } +} + class DescribeAgentsResponse { - /// Lists agents or the Connector by ID or lists all agents/Connectors - /// associated with your user account if you did not specify an agent/Connector - /// ID. The output includes agent/Connector IDs, IP addresses, media access - /// control (MAC) addresses, agent/Connector health, host name where the - /// agent/Connector resides, and the version number of each agent/Connector. + /// Lists agents or the collector by ID or lists all agents/collectors + /// associated with your user, if you did not specify an agent/collector ID. The + /// output includes agent/collector IDs, IP addresses, media access control + /// (MAC) addresses, agent/collector health, host name where the agent/collector + /// resides, and the version number of each agent/collector. final List? agentsInfo; /// Token to retrieve the next set of results. For example, if you specified 100 @@ -2290,6 +2778,33 @@ class DescribeAgentsResponse { } } +class DescribeBatchDeleteConfigurationTaskResponse { + /// The BatchDeleteConfigurationTask that represents the deletion + /// task being executed. + final BatchDeleteConfigurationTask? task; + + DescribeBatchDeleteConfigurationTaskResponse({ + this.task, + }); + + factory DescribeBatchDeleteConfigurationTaskResponse.fromJson( + Map json) { + return DescribeBatchDeleteConfigurationTaskResponse( + task: json['task'] != null + ? BatchDeleteConfigurationTask.fromJson( + json['task'] as Map) + : null, + ); + } + + Map toJson() { + final task = this.task; + return { + if (task != null) 'task': task, + }; + } +} + class DescribeConfigurationsResponse { /// A key in the response map. The value is an array of data. final List>? configurations; @@ -2500,6 +3015,74 @@ class DisassociateConfigurationItemsFromApplicationResponse { } } +/// Indicates that the exported data must include EC2 instance type matches for +/// on-premises servers that are discovered through Amazon Web Services +/// Application Discovery Service. +class Ec2RecommendationsExportPreferences { + /// The recommended EC2 instance type that matches the CPU usage metric of + /// server performance data. + final UsageMetricBasis? cpuPerformanceMetricBasis; + + /// If set to true, the export preferences + /// is set to Ec2RecommendationsExportPreferences. + final bool? enabled; + + /// An array of instance types to exclude from recommendations. + final List? excludedInstanceTypes; + + /// The target Amazon Web Services Region for the recommendations. You can use + /// any of the Region codes available for the chosen service, as listed in Amazon Web + /// Services service endpoints in the Amazon Web Services General + /// Reference. + final String? preferredRegion; + + /// The recommended EC2 instance type that matches the Memory usage metric of + /// server performance data. + final UsageMetricBasis? ramPerformanceMetricBasis; + + /// The contract type for a reserved instance. If blank, we assume an On-Demand + /// instance is preferred. + final ReservedInstanceOptions? reservedInstanceOptions; + + /// The target tenancy to use for your recommended EC2 instances. + final Tenancy? tenancy; + + Ec2RecommendationsExportPreferences({ + this.cpuPerformanceMetricBasis, + this.enabled, + this.excludedInstanceTypes, + this.preferredRegion, + this.ramPerformanceMetricBasis, + this.reservedInstanceOptions, + this.tenancy, + }); + + Map toJson() { + final cpuPerformanceMetricBasis = this.cpuPerformanceMetricBasis; + final enabled = this.enabled; + final excludedInstanceTypes = this.excludedInstanceTypes; + final preferredRegion = this.preferredRegion; + final ramPerformanceMetricBasis = this.ramPerformanceMetricBasis; + final reservedInstanceOptions = this.reservedInstanceOptions; + final tenancy = this.tenancy; + return { + if (cpuPerformanceMetricBasis != null) + 'cpuPerformanceMetricBasis': cpuPerformanceMetricBasis, + if (enabled != null) 'enabled': enabled, + if (excludedInstanceTypes != null) + 'excludedInstanceTypes': excludedInstanceTypes, + if (preferredRegion != null) 'preferredRegion': preferredRegion, + if (ramPerformanceMetricBasis != null) + 'ramPerformanceMetricBasis': ramPerformanceMetricBasis, + if (reservedInstanceOptions != null) + 'reservedInstanceOptions': reservedInstanceOptions, + if (tenancy != null) 'tenancy': tenancy.toValue(), + }; + } +} + class ExportConfigurationsResponse { /// A unique identifier that you can use to query the export status. final String? exportId; @@ -2524,7 +3107,6 @@ class ExportConfigurationsResponse { enum ExportDataFormat { csv, - graphml, } extension ExportDataFormatValueExtension on ExportDataFormat { @@ -2532,8 +3114,6 @@ extension ExportDataFormatValueExtension on ExportDataFormat { switch (this) { case ExportDataFormat.csv: return 'CSV'; - case ExportDataFormat.graphml: - return 'GRAPHML'; } } } @@ -2543,8 +3123,6 @@ extension ExportDataFormatFromString on String { switch (this) { case 'CSV': return ExportDataFormat.csv; - case 'GRAPHML': - return ExportDataFormat.graphml; } throw Exception('$this is not known in enum ExportDataFormat'); } @@ -2672,6 +3250,29 @@ class ExportInfo { } } +/// Indicates the type of data that is being exported. Only one +/// ExportPreferences can be enabled for a StartExportTask +/// action. +class ExportPreferences { + /// If enabled, exported data includes EC2 instance type matches for on-premises + /// servers discovered through Amazon Web Services Application Discovery + /// Service. + final Ec2RecommendationsExportPreferences? ec2RecommendationsPreferences; + + ExportPreferences({ + this.ec2RecommendationsPreferences, + }); + + Map toJson() { + final ec2RecommendationsPreferences = this.ec2RecommendationsPreferences; + return { + if (ec2RecommendationsPreferences != null) + 'ec2RecommendationsPreferences': ec2RecommendationsPreferences, + }; + } +} + enum ExportStatus { failed, succeeded, @@ -2705,6 +3306,44 @@ extension ExportStatusFromString on String { } } +/// A configuration ID paired with an error message. +class FailedConfiguration { + /// The unique identifier of the configuration the failed to delete. + final String? configurationId; + + /// A descriptive message indicating why the associated configuration failed to + /// delete. + final String? errorMessage; + + /// The integer error code associated with the error message. + final int? errorStatusCode; + + FailedConfiguration({ + this.configurationId, + this.errorMessage, + this.errorStatusCode, + }); + + factory FailedConfiguration.fromJson(Map json) { + return FailedConfiguration( + configurationId: json['configurationId'] as String?, + errorMessage: json['errorMessage'] as String?, + errorStatusCode: json['errorStatusCode'] as int?, + ); + } + + Map toJson() { + final configurationId = this.configurationId; + final errorMessage = this.errorMessage; + final errorStatusCode = this.errorStatusCode; + return { + if (configurationId != null) 'configurationId': configurationId, + if (errorMessage != null) 'errorMessage': errorMessage, + if (errorStatusCode != null) 'errorStatusCode': errorStatusCode, + }; + } +} + /// A filter that can use conditional operators. /// /// For more information about filters, see toJson() { + final offeringClass = this.offeringClass; + final purchasingOption = this.purchasingOption; + final termLength = this.termLength; + return { + 'offeringClass': offeringClass.toValue(), + 'purchasingOption': purchasingOption.toValue(), + 'termLength': termLength.toValue(), + }; + } +} + +class StartBatchDeleteConfigurationTaskResponse { + /// The unique identifier associated with the newly started deletion task. + final String? taskId; + + StartBatchDeleteConfigurationTaskResponse({ + this.taskId, + }); + + factory StartBatchDeleteConfigurationTaskResponse.fromJson( + Map json) { + return StartBatchDeleteConfigurationTaskResponse( + taskId: json['taskId'] as String?, + ); + } + + Map toJson() { + final taskId = this.taskId; + return { + if (taskId != null) 'taskId': taskId, + }; + } +} + class StartContinuousExportResponse { /// The type of data collector used to gather this data (currently only offered /// for AGENT). @@ -3333,10 +4088,9 @@ class StartContinuousExportResponse { } class StartDataCollectionByAgentIdsResponse { - /// Information about agents or the connector that were instructed to start - /// collecting data. Information includes the agent/connector ID, a description - /// of the operation performed, and whether the agent/connector configuration - /// was updated. + /// Information about agents that were instructed to start collecting data. + /// Information includes the agent ID, a description of the operation performed, + /// and whether the agent configuration was updated. final List? agentsConfigurationStatus; StartDataCollectionByAgentIdsResponse({ @@ -3442,10 +4196,9 @@ class StopContinuousExportResponse { } class StopDataCollectionByAgentIdsResponse { - /// Information about the agents or connector that were instructed to stop - /// collecting data. Information includes the agent/connector ID, a description - /// of the operation performed, and whether the agent/connector configuration - /// was updated. + /// Information about the agents that were instructed to stop collecting data. + /// Information includes the agent ID, a description of the operation performed, + /// and whether the agent configuration was updated. final List? agentsConfigurationStatus; StopDataCollectionByAgentIdsResponse({ @@ -3522,6 +4275,62 @@ class TagFilter { } } +enum Tenancy { + dedicated, + shared, +} + +extension TenancyValueExtension on Tenancy { + String toValue() { + switch (this) { + case Tenancy.dedicated: + return 'DEDICATED'; + case Tenancy.shared: + return 'SHARED'; + } + } +} + +extension TenancyFromString on String { + Tenancy toTenancy() { + switch (this) { + case 'DEDICATED': + return Tenancy.dedicated; + case 'SHARED': + return Tenancy.shared; + } + throw Exception('$this is not known in enum Tenancy'); + } +} + +enum TermLength { + oneYear, + threeYear, +} + +extension TermLengthValueExtension on TermLength { + String toValue() { + switch (this) { + case TermLength.oneYear: + return 'ONE_YEAR'; + case TermLength.threeYear: + return 'THREE_YEAR'; + } + } +} + +extension TermLengthFromString on String { + TermLength toTermLength() { + switch (this) { + case 'ONE_YEAR': + return TermLength.oneYear; + case 'THREE_YEAR': + return TermLength.threeYear; + } + throw Exception('$this is not known in enum TermLength'); + } +} + class UpdateApplicationResponse { UpdateApplicationResponse(); @@ -3534,6 +4343,31 @@ class UpdateApplicationResponse { } } +/// Specifies the performance metrics to use for the server that is used for +/// recommendations. +class UsageMetricBasis { + /// A utilization metric that is used by the recommendations. + final String? name; + + /// Specifies the percentage of the specified utilization metric that is used by + /// the recommendations. + final double? percentageAdjust; + + UsageMetricBasis({ + this.name, + this.percentageAdjust, + }); + + Map toJson() { + final name = this.name; + final percentageAdjust = this.percentageAdjust; + return { + if (name != null) 'name': name, + if (percentageAdjust != null) 'percentageAdjust': percentageAdjust, + }; + } +} + enum OrderString { asc, desc, @@ -3591,6 +4425,11 @@ class InvalidParameterValueException extends _s.GenericAwsException { message: message); } +class LimitExceededException extends _s.GenericAwsException { + LimitExceededException({String? type, String? message}) + : super(type: type, code: 'LimitExceededException', message: message); +} + class OperationNotPermittedException extends _s.GenericAwsException { OperationNotPermittedException({String? type, String? message}) : super( @@ -3626,6 +4465,8 @@ final _exceptionFns = { InvalidParameterException(type: type, message: message), 'InvalidParameterValueException': (type, message) => InvalidParameterValueException(type: type, message: message), + 'LimitExceededException': (type, message) => + LimitExceededException(type: type, message: message), 'OperationNotPermittedException': (type, message) => OperationNotPermittedException(type: type, message: message), 'ResourceInUseException': (type, message) => diff --git a/aws_client/lib/src/generated/application_insights/v2018_11_25.dart b/aws_client/lib/src/generated/application_insights/v2018_11_25.dart index e0d13c1e3..0a71574d2 100644 --- a/aws_client/lib/src/generated/application_insights/v2018_11_25.dart +++ b/aws_client/lib/src/generated/application_insights/v2018_11_25.dart @@ -53,6 +53,48 @@ class ApplicationInsights { _protocol.close(); } + /// Adds a workload to a component. Each component can have at most five + /// workloads. + /// + /// May throw [ResourceInUseException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [componentName] : + /// The name of the component. + /// + /// Parameter [resourceGroupName] : + /// The name of the resource group. + /// + /// Parameter [workloadConfiguration] : + /// The configuration settings of the workload. The value is the escaped JSON + /// of the configuration. + Future addWorkload({ + required String componentName, + required String resourceGroupName, + required WorkloadConfiguration workloadConfiguration, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.AddWorkload' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComponentName': componentName, + 'ResourceGroupName': resourceGroupName, + 'WorkloadConfiguration': workloadConfiguration, + }, + ); + + return AddWorkloadResponse.fromJson(jsonResponse.body); + } + /// Adds an application that is created from a resource group. /// /// May throw [ResourceInUseException]. @@ -62,6 +104,10 @@ class ApplicationInsights { /// May throw [TagsAlreadyExistException]. /// May throw [AccessDeniedException]. /// + /// Parameter [attachMissingPermission] : + /// If set to true, the managed policies for SSM and CW will be attached to + /// the instance roles if they are missing. + /// /// Parameter [autoConfigEnabled] : /// Indicates whether Application Insights automatically configures /// unmonitored resources in the resource group. @@ -98,6 +144,7 @@ class ApplicationInsights { /// associated tag value (Value). The maximum length of a tag key /// is 128 characters. The maximum length of a tag value is 256 characters. Future createApplication({ + bool? attachMissingPermission, bool? autoConfigEnabled, bool? autoCreate, bool? cWEMonitorEnabled, @@ -118,6 +165,8 @@ class ApplicationInsights { // TODO queryParams headers: headers, payload: { + if (attachMissingPermission != null) + 'AttachMissingPermission': attachMissingPermission, if (autoConfigEnabled != null) 'AutoConfigEnabled': autoConfigEnabled, if (autoCreate != null) 'AutoCreate': autoCreate, if (cWEMonitorEnabled != null) 'CWEMonitorEnabled': cWEMonitorEnabled, @@ -343,8 +392,12 @@ class ApplicationInsights { /// /// Parameter [resourceGroupName] : /// The name of the resource group. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeApplication({ required String resourceGroupName, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -358,6 +411,7 @@ class ApplicationInsights { headers: headers, payload: { 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, }, ); @@ -376,9 +430,13 @@ class ApplicationInsights { /// /// Parameter [resourceGroupName] : /// The name of the resource group. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeComponent({ required String componentName, required String resourceGroupName, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -393,6 +451,7 @@ class ApplicationInsights { payload: { 'ComponentName': componentName, 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, }, ); @@ -410,10 +469,14 @@ class ApplicationInsights { /// /// Parameter [resourceGroupName] : /// The name of the resource group. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeComponentConfiguration({ required String componentName, required String resourceGroupName, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -428,6 +491,7 @@ class ApplicationInsights { payload: { 'ComponentName': componentName, 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, }, ); @@ -448,11 +512,19 @@ class ApplicationInsights { /// /// Parameter [tier] : /// The tier of the application component. + /// + /// Parameter [recommendationType] : + /// The recommended configuration type. + /// + /// Parameter [workloadName] : + /// The name of the workload. Future describeComponentConfigurationRecommendation({ required String componentName, required String resourceGroupName, required Tier tier, + RecommendationType? recommendationType, + String? workloadName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -469,6 +541,9 @@ class ApplicationInsights { 'ComponentName': componentName, 'ResourceGroupName': resourceGroupName, 'Tier': tier.toValue(), + if (recommendationType != null) + 'RecommendationType': recommendationType.toValue(), + if (workloadName != null) 'WorkloadName': workloadName, }, ); @@ -490,10 +565,14 @@ class ApplicationInsights { /// /// Parameter [resourceGroupName] : /// The name of the resource group. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeLogPattern({ required String patternName, required String patternSetName, required String resourceGroupName, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -509,6 +588,7 @@ class ApplicationInsights { 'PatternName': patternName, 'PatternSetName': patternSetName, 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, }, ); @@ -523,8 +603,12 @@ class ApplicationInsights { /// /// Parameter [observationId] : /// The ID of the observation. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeObservation({ required String observationId, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -538,6 +622,7 @@ class ApplicationInsights { headers: headers, payload: { 'ObservationId': observationId, + if (accountId != null) 'AccountId': accountId, }, ); @@ -552,8 +637,13 @@ class ApplicationInsights { /// /// Parameter [problemId] : /// The ID of the problem. + /// + /// Parameter [accountId] : + /// The AWS account ID for the owner of the resource group affected by the + /// problem. Future describeProblem({ required String problemId, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -567,6 +657,7 @@ class ApplicationInsights { headers: headers, payload: { 'ProblemId': problemId, + if (accountId != null) 'AccountId': accountId, }, ); @@ -581,8 +672,12 @@ class ApplicationInsights { /// /// Parameter [problemId] : /// The ID of the problem. + /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. Future describeProblemObservations({ required String problemId, + String? accountId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -596,17 +691,65 @@ class ApplicationInsights { headers: headers, payload: { 'ProblemId': problemId, + if (accountId != null) 'AccountId': accountId, }, ); return DescribeProblemObservationsResponse.fromJson(jsonResponse.body); } + /// Describes a workload and its configuration. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [componentName] : + /// The name of the component. + /// + /// Parameter [resourceGroupName] : + /// The name of the resource group. + /// + /// Parameter [workloadId] : + /// The ID of the workload. + /// + /// Parameter [accountId] : + /// The AWS account ID for the workload owner. + Future describeWorkload({ + required String componentName, + required String resourceGroupName, + required String workloadId, + String? accountId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.DescribeWorkload' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComponentName': componentName, + 'ResourceGroupName': resourceGroupName, + 'WorkloadId': workloadId, + if (accountId != null) 'AccountId': accountId, + }, + ); + + return DescribeWorkloadResponse.fromJson(jsonResponse.body); + } + /// Lists the IDs of the applications that you are monitoring. /// /// May throw [ValidationException]. /// May throw [InternalServerException]. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [maxResults] : /// The maximum number of results to return in a single call. To retrieve the /// remaining results, make another call with the returned @@ -615,6 +758,7 @@ class ApplicationInsights { /// Parameter [nextToken] : /// The token to request the next page of results. Future listApplications({ + String? accountId, int? maxResults, String? nextToken, }) async { @@ -635,6 +779,7 @@ class ApplicationInsights { // TODO queryParams headers: headers, payload: { + if (accountId != null) 'AccountId': accountId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, }, @@ -653,6 +798,9 @@ class ApplicationInsights { /// Parameter [resourceGroupName] : /// The name of the resource group. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [maxResults] : /// The maximum number of results to return in a single call. To retrieve the /// remaining results, make another call with the returned @@ -662,6 +810,7 @@ class ApplicationInsights { /// The token to request the next page of results. Future listComponents({ required String resourceGroupName, + String? accountId, int? maxResults, String? nextToken, }) async { @@ -683,6 +832,7 @@ class ApplicationInsights { headers: headers, payload: { 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, }, @@ -711,6 +861,9 @@ class ApplicationInsights { /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [endTime] : /// The end time of the event. /// @@ -743,6 +896,7 @@ class ApplicationInsights { /// Parameter [startTime] : /// The start time of the event. Future listConfigurationHistory({ + String? accountId, DateTime? endTime, ConfigurationEventStatus? eventStatus, int? maxResults, @@ -767,6 +921,7 @@ class ApplicationInsights { // TODO queryParams headers: headers, payload: { + if (accountId != null) 'AccountId': accountId, if (endTime != null) 'EndTime': unixTimestampToJson(endTime), if (eventStatus != null) 'EventStatus': eventStatus.toValue(), if (maxResults != null) 'MaxResults': maxResults, @@ -788,6 +943,9 @@ class ApplicationInsights { /// Parameter [resourceGroupName] : /// The name of the resource group. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [maxResults] : /// The maximum number of results to return in a single call. To retrieve the /// remaining results, make another call with the returned @@ -797,6 +955,7 @@ class ApplicationInsights { /// The token to request the next page of results. Future listLogPatternSets({ required String resourceGroupName, + String? accountId, int? maxResults, String? nextToken, }) async { @@ -818,6 +977,7 @@ class ApplicationInsights { headers: headers, payload: { 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, }, @@ -835,6 +995,9 @@ class ApplicationInsights { /// Parameter [resourceGroupName] : /// The name of the resource group. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [maxResults] : /// The maximum number of results to return in a single call. To retrieve the /// remaining results, make another call with the returned @@ -847,6 +1010,7 @@ class ApplicationInsights { /// The name of the log pattern set. Future listLogPatterns({ required String resourceGroupName, + String? accountId, int? maxResults, String? nextToken, String? patternSetName, @@ -869,6 +1033,7 @@ class ApplicationInsights { headers: headers, payload: { 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, if (patternSetName != null) 'PatternSetName': patternSetName, @@ -884,6 +1049,9 @@ class ApplicationInsights { /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// + /// Parameter [accountId] : + /// The AWS account ID for the resource group owner. + /// /// Parameter [componentName] : /// The name of the component. /// @@ -906,13 +1074,19 @@ class ApplicationInsights { /// The time when the problem was detected, in epoch seconds. If you don't /// specify a time frame for the request, problems within the past seven days /// are returned. + /// + /// Parameter [visibility] : + /// Specifies whether or not you can view the problem. If not specified, + /// visible and ignored problems are returned. Future listProblems({ + String? accountId, String? componentName, DateTime? endTime, int? maxResults, String? nextToken, String? resourceGroupName, DateTime? startTime, + Visibility? visibility, }) async { _s.validateNumRange( 'maxResults', @@ -931,12 +1105,14 @@ class ApplicationInsights { // TODO queryParams headers: headers, payload: { + if (accountId != null) 'AccountId': accountId, if (componentName != null) 'ComponentName': componentName, if (endTime != null) 'EndTime': unixTimestampToJson(endTime), if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + if (visibility != null) 'Visibility': visibility.toValue(), }, ); @@ -977,6 +1153,100 @@ class ApplicationInsights { return ListTagsForResourceResponse.fromJson(jsonResponse.body); } + /// Lists the workloads that are configured on a given component. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [componentName] : + /// The name of the component. + /// + /// Parameter [resourceGroupName] : + /// The name of the resource group. + /// + /// Parameter [accountId] : + /// The AWS account ID of the owner of the workload. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call. To retrieve the + /// remaining results, make another call with the returned + /// NextToken value. + /// + /// Parameter [nextToken] : + /// The token to request the next page of results. + Future listWorkloads({ + required String componentName, + required String resourceGroupName, + String? accountId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 40, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.ListWorkloads' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComponentName': componentName, + 'ResourceGroupName': resourceGroupName, + if (accountId != null) 'AccountId': accountId, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListWorkloadsResponse.fromJson(jsonResponse.body); + } + + /// Remove workload from a component. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [componentName] : + /// The name of the component. + /// + /// Parameter [resourceGroupName] : + /// The name of the resource group. + /// + /// Parameter [workloadId] : + /// The ID of the workload. + Future removeWorkload({ + required String componentName, + required String resourceGroupName, + required String workloadId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.RemoveWorkload' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComponentName': componentName, + 'ResourceGroupName': resourceGroupName, + 'WorkloadId': workloadId, + }, + ); + } + /// Add one or more tags (keys and values) to a specified application. A /// tag is a label that you optionally define and associate with an /// application. Tags can help you categorize and manage application in @@ -1068,6 +1338,10 @@ class ApplicationInsights { /// Parameter [resourceGroupName] : /// The name of the resource group. /// + /// Parameter [attachMissingPermission] : + /// If set to true, the managed policies for SSM and CW will be attached to + /// the instance roles if they are missing. + /// /// Parameter [autoConfigEnabled] : /// Turns auto-configuration on or off. /// @@ -1090,6 +1364,7 @@ class ApplicationInsights { /// problems. Future updateApplication({ required String resourceGroupName, + bool? attachMissingPermission, bool? autoConfigEnabled, bool? cWEMonitorEnabled, bool? opsCenterEnabled, @@ -1108,6 +1383,8 @@ class ApplicationInsights { headers: headers, payload: { 'ResourceGroupName': resourceGroupName, + if (attachMissingPermission != null) + 'AttachMissingPermission': attachMissingPermission, if (autoConfigEnabled != null) 'AutoConfigEnabled': autoConfigEnabled, if (cWEMonitorEnabled != null) 'CWEMonitorEnabled': cWEMonitorEnabled, if (opsCenterEnabled != null) 'OpsCenterEnabled': opsCenterEnabled, @@ -1172,6 +1449,7 @@ class ApplicationInsights { /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. /// May throw [InternalServerException]. + /// May throw [ResourceInUseException]. /// /// Parameter [componentName] : /// The name of the component. @@ -1290,6 +1568,128 @@ class ApplicationInsights { return UpdateLogPatternResponse.fromJson(jsonResponse.body); } + + /// Updates the visibility of the problem or specifies the problem as + /// RESOLVED. + /// + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [problemId] : + /// The ID of the problem. + /// + /// Parameter [updateStatus] : + /// The status of the problem. Arguments can be passed for only problems that + /// show a status of RECOVERING. + /// + /// Parameter [visibility] : + /// The visibility of a problem. When you pass a value of + /// IGNORED, the problem is removed from the default view, and + /// all notifications for the problem are suspended. When VISIBLE + /// is passed, the IGNORED action is reversed. + Future updateProblem({ + required String problemId, + UpdateStatus? updateStatus, + Visibility? visibility, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.UpdateProblem' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ProblemId': problemId, + if (updateStatus != null) 'UpdateStatus': updateStatus.toValue(), + if (visibility != null) 'Visibility': visibility.toValue(), + }, + ); + } + + /// Adds a workload to a component. Each component can have at most five + /// workloads. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [componentName] : + /// The name of the component. + /// + /// Parameter [resourceGroupName] : + /// The name of the resource group. + /// + /// Parameter [workloadConfiguration] : + /// The configuration settings of the workload. The value is the escaped JSON + /// of the configuration. + /// + /// Parameter [workloadId] : + /// The ID of the workload. + Future updateWorkload({ + required String componentName, + required String resourceGroupName, + required WorkloadConfiguration workloadConfiguration, + String? workloadId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'EC2WindowsBarleyService.UpdateWorkload' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComponentName': componentName, + 'ResourceGroupName': resourceGroupName, + 'WorkloadConfiguration': workloadConfiguration, + if (workloadId != null) 'WorkloadId': workloadId, + }, + ); + + return UpdateWorkloadResponse.fromJson(jsonResponse.body); + } +} + +class AddWorkloadResponse { + /// The configuration settings of the workload. The value is the escaped JSON of + /// the configuration. + final WorkloadConfiguration? workloadConfiguration; + + /// The ID of the workload. + final String? workloadId; + + AddWorkloadResponse({ + this.workloadConfiguration, + this.workloadId, + }); + + factory AddWorkloadResponse.fromJson(Map json) { + return AddWorkloadResponse( + workloadConfiguration: json['WorkloadConfiguration'] != null + ? WorkloadConfiguration.fromJson( + json['WorkloadConfiguration'] as Map) + : null, + workloadId: json['WorkloadId'] as String?, + ); + } + + Map toJson() { + final workloadConfiguration = this.workloadConfiguration; + final workloadId = this.workloadId; + return { + if (workloadConfiguration != null) + 'WorkloadConfiguration': workloadConfiguration, + if (workloadId != null) 'WorkloadId': workloadId, + }; + } } /// Describes a standalone resource or similarly grouped resources that the @@ -1368,6 +1768,13 @@ class ApplicationComponent { /// Describes the status of the application. class ApplicationInfo { + /// The AWS account ID for the owner of the application. + final String? accountId; + + /// If set to true, the managed policies for SSM and CW will be attached to the + /// instance roles if they are missing. + final bool? attachMissingPermission; + /// Indicates whether auto-configuration is turned on for this application. final bool? autoConfigEnabled; @@ -1407,6 +1814,8 @@ class ApplicationInfo { final String? resourceGroupName; ApplicationInfo({ + this.accountId, + this.attachMissingPermission, this.autoConfigEnabled, this.cWEMonitorEnabled, this.discoveryType, @@ -1419,6 +1828,8 @@ class ApplicationInfo { factory ApplicationInfo.fromJson(Map json) { return ApplicationInfo( + accountId: json['AccountId'] as String?, + attachMissingPermission: json['AttachMissingPermission'] as bool?, autoConfigEnabled: json['AutoConfigEnabled'] as bool?, cWEMonitorEnabled: json['CWEMonitorEnabled'] as bool?, discoveryType: (json['DiscoveryType'] as String?)?.toDiscoveryType(), @@ -1431,6 +1842,8 @@ class ApplicationInfo { } Map toJson() { + final accountId = this.accountId; + final attachMissingPermission = this.attachMissingPermission; final autoConfigEnabled = this.autoConfigEnabled; final cWEMonitorEnabled = this.cWEMonitorEnabled; final discoveryType = this.discoveryType; @@ -1440,6 +1853,9 @@ class ApplicationInfo { final remarks = this.remarks; final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, + if (attachMissingPermission != null) + 'AttachMissingPermission': attachMissingPermission, if (autoConfigEnabled != null) 'AutoConfigEnabled': autoConfigEnabled, if (cWEMonitorEnabled != null) 'CWEMonitorEnabled': cWEMonitorEnabled, if (discoveryType != null) 'DiscoveryType': discoveryType.toValue(), @@ -1492,6 +1908,10 @@ extension CloudWatchEventSourceFromString on String { /// The event information. class ConfigurationEvent { + /// The AWS account ID for the owner of the application to which the + /// configuration event belongs. + final String? accountId; + /// The details of the event in plain text. final String? eventDetail; @@ -1512,17 +1932,24 @@ class ConfigurationEvent { /// The resource monitored by Application Insights. final String? monitoredResourceARN; + /// The name of the resource group of the application to which the configuration + /// event belongs. + final String? resourceGroupName; + ConfigurationEvent({ + this.accountId, this.eventDetail, this.eventResourceName, this.eventResourceType, this.eventStatus, this.eventTime, this.monitoredResourceARN, + this.resourceGroupName, }); factory ConfigurationEvent.fromJson(Map json) { return ConfigurationEvent( + accountId: json['AccountId'] as String?, eventDetail: json['EventDetail'] as String?, eventResourceName: json['EventResourceName'] as String?, eventResourceType: (json['EventResourceType'] as String?) @@ -1531,17 +1958,21 @@ class ConfigurationEvent { (json['EventStatus'] as String?)?.toConfigurationEventStatus(), eventTime: timeStampFromJson(json['EventTime']), monitoredResourceARN: json['MonitoredResourceARN'] as String?, + resourceGroupName: json['ResourceGroupName'] as String?, ); } Map toJson() { + final accountId = this.accountId; final eventDetail = this.eventDetail; final eventResourceName = this.eventResourceName; final eventResourceType = this.eventResourceType; final eventStatus = this.eventStatus; final eventTime = this.eventTime; final monitoredResourceARN = this.monitoredResourceARN; + final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, if (eventDetail != null) 'EventDetail': eventDetail, if (eventResourceName != null) 'EventResourceName': eventResourceName, if (eventResourceType != null) @@ -1550,6 +1981,7 @@ class ConfigurationEvent { if (eventTime != null) 'EventTime': unixTimestampToJson(eventTime), if (monitoredResourceARN != null) 'MonitoredResourceARN': monitoredResourceARN, + if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, }; } } @@ -1858,6 +2290,9 @@ class DescribeComponentResponse { } class DescribeLogPatternResponse { + /// The AWS account ID for the resource group owner. + final String? accountId; + /// The successfully created log pattern. final LogPattern? logPattern; @@ -1865,12 +2300,14 @@ class DescribeLogPatternResponse { final String? resourceGroupName; DescribeLogPatternResponse({ + this.accountId, this.logPattern, this.resourceGroupName, }); factory DescribeLogPatternResponse.fromJson(Map json) { return DescribeLogPatternResponse( + accountId: json['AccountId'] as String?, logPattern: json['LogPattern'] != null ? LogPattern.fromJson(json['LogPattern'] as Map) : null, @@ -1879,9 +2316,11 @@ class DescribeLogPatternResponse { } Map toJson() { + final accountId = this.accountId; final logPattern = this.logPattern; final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, if (logPattern != null) 'LogPattern': logPattern, if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, }; @@ -1963,6 +2402,48 @@ class DescribeProblemResponse { } } +class DescribeWorkloadResponse { + /// The configuration settings of the workload. The value is the escaped JSON of + /// the configuration. + final WorkloadConfiguration? workloadConfiguration; + + /// The ID of the workload. + final String? workloadId; + + /// If logging is supported for the resource type, shows whether the component + /// has configured logs to be monitored. + final String? workloadRemarks; + + DescribeWorkloadResponse({ + this.workloadConfiguration, + this.workloadId, + this.workloadRemarks, + }); + + factory DescribeWorkloadResponse.fromJson(Map json) { + return DescribeWorkloadResponse( + workloadConfiguration: json['WorkloadConfiguration'] != null + ? WorkloadConfiguration.fromJson( + json['WorkloadConfiguration'] as Map) + : null, + workloadId: json['WorkloadId'] as String?, + workloadRemarks: json['WorkloadRemarks'] as String?, + ); + } + + Map toJson() { + final workloadConfiguration = this.workloadConfiguration; + final workloadId = this.workloadId; + final workloadRemarks = this.workloadRemarks; + return { + if (workloadConfiguration != null) + 'WorkloadConfiguration': workloadConfiguration, + if (workloadId != null) 'WorkloadId': workloadId, + if (workloadRemarks != null) 'WorkloadRemarks': workloadRemarks, + }; + } +} + enum DiscoveryType { resourceGroupBased, accountBased, @@ -2175,6 +2656,9 @@ class ListConfigurationHistoryResponse { } class ListLogPatternSetsResponse { + /// The AWS account ID for the resource group owner. + final String? accountId; + /// The list of log pattern sets. final List? logPatternSets; @@ -2186,6 +2670,7 @@ class ListLogPatternSetsResponse { final String? resourceGroupName; ListLogPatternSetsResponse({ + this.accountId, this.logPatternSets, this.nextToken, this.resourceGroupName, @@ -2193,6 +2678,7 @@ class ListLogPatternSetsResponse { factory ListLogPatternSetsResponse.fromJson(Map json) { return ListLogPatternSetsResponse( + accountId: json['AccountId'] as String?, logPatternSets: (json['LogPatternSets'] as List?) ?.whereNotNull() .map((e) => e as String) @@ -2203,10 +2689,12 @@ class ListLogPatternSetsResponse { } Map toJson() { + final accountId = this.accountId; final logPatternSets = this.logPatternSets; final nextToken = this.nextToken; final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, if (logPatternSets != null) 'LogPatternSets': logPatternSets, if (nextToken != null) 'NextToken': nextToken, if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, @@ -2215,6 +2703,9 @@ class ListLogPatternSetsResponse { } class ListLogPatternsResponse { + /// The AWS account ID for the resource group owner. + final String? accountId; + /// The list of log patterns. final List? logPatterns; @@ -2226,6 +2717,7 @@ class ListLogPatternsResponse { final String? resourceGroupName; ListLogPatternsResponse({ + this.accountId, this.logPatterns, this.nextToken, this.resourceGroupName, @@ -2233,6 +2725,7 @@ class ListLogPatternsResponse { factory ListLogPatternsResponse.fromJson(Map json) { return ListLogPatternsResponse( + accountId: json['AccountId'] as String?, logPatterns: (json['LogPatterns'] as List?) ?.whereNotNull() .map((e) => LogPattern.fromJson(e as Map)) @@ -2243,10 +2736,12 @@ class ListLogPatternsResponse { } Map toJson() { + final accountId = this.accountId; final logPatterns = this.logPatterns; final nextToken = this.nextToken; final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, if (logPatterns != null) 'LogPatterns': logPatterns, if (nextToken != null) 'NextToken': nextToken, if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, @@ -2255,6 +2750,9 @@ class ListLogPatternsResponse { } class ListProblemsResponse { + /// The AWS account ID for the resource group owner. + final String? accountId; + /// The token used to retrieve the next page of results. This value is /// null when there are no more results to return. final String? nextToken; @@ -2266,6 +2764,7 @@ class ListProblemsResponse { final String? resourceGroupName; ListProblemsResponse({ + this.accountId, this.nextToken, this.problemList, this.resourceGroupName, @@ -2273,6 +2772,7 @@ class ListProblemsResponse { factory ListProblemsResponse.fromJson(Map json) { return ListProblemsResponse( + accountId: json['AccountId'] as String?, nextToken: json['NextToken'] as String?, problemList: (json['ProblemList'] as List?) ?.whereNotNull() @@ -2283,10 +2783,12 @@ class ListProblemsResponse { } Map toJson() { + final accountId = this.accountId; final nextToken = this.nextToken; final problemList = this.problemList; final resourceGroupName = this.resourceGroupName; return { + if (accountId != null) 'AccountId': accountId, if (nextToken != null) 'NextToken': nextToken, if (problemList != null) 'ProblemList': problemList, if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, @@ -2321,6 +2823,38 @@ class ListTagsForResourceResponse { } } +class ListWorkloadsResponse { + /// The token to request the next page of results. + final String? nextToken; + + /// The list of workloads. + final List? workloadList; + + ListWorkloadsResponse({ + this.nextToken, + this.workloadList, + }); + + factory ListWorkloadsResponse.fromJson(Map json) { + return ListWorkloadsResponse( + nextToken: json['NextToken'] as String?, + workloadList: (json['WorkloadList'] as List?) + ?.whereNotNull() + .map((e) => Workload.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final workloadList = this.workloadList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (workloadList != null) 'WorkloadList': workloadList, + }; + } +} + enum LogFilter { error, warn, @@ -2800,6 +3334,10 @@ extension OsTypeFromString on String { /// Describes a problem that is detected by correlating observations. class Problem { + /// The AWS account ID for the owner of the resource group affected by the + /// problem. + final String? accountId; + /// The resource affected by the problem. final String? affectedResource; @@ -2822,6 +3360,12 @@ class Problem { /// was resolved. final int? recurringCount; + /// Specifies how the problem was resolved. If the value is + /// AUTOMATIC, the system resolved the problem. If the value is + /// MANUAL, the user resolved the problem. If the value is + /// UNRESOLVED, then the problem is not resolved. + final ResolutionMethod? resolutionMethod; + /// The name of the resource group affected by the problem. final String? resourceGroupName; @@ -2837,7 +3381,12 @@ class Problem { /// The name of the problem. final String? title; + /// Specifies whether or not you can view the problem. Updates to ignored + /// problems do not generate notifications. + final Visibility? visibility; + Problem({ + this.accountId, this.affectedResource, this.endTime, this.feedback, @@ -2845,15 +3394,18 @@ class Problem { this.insights, this.lastRecurrenceTime, this.recurringCount, + this.resolutionMethod, this.resourceGroupName, this.severityLevel, this.startTime, this.status, this.title, + this.visibility, }); factory Problem.fromJson(Map json) { return Problem( + accountId: json['AccountId'] as String?, affectedResource: json['AffectedResource'] as String?, endTime: timeStampFromJson(json['EndTime']), feedback: (json['Feedback'] as Map?)?.map((k, e) => @@ -2862,15 +3414,19 @@ class Problem { insights: json['Insights'] as String?, lastRecurrenceTime: timeStampFromJson(json['LastRecurrenceTime']), recurringCount: json['RecurringCount'] as int?, + resolutionMethod: + (json['ResolutionMethod'] as String?)?.toResolutionMethod(), resourceGroupName: json['ResourceGroupName'] as String?, severityLevel: (json['SeverityLevel'] as String?)?.toSeverityLevel(), startTime: timeStampFromJson(json['StartTime']), status: (json['Status'] as String?)?.toStatus(), title: json['Title'] as String?, + visibility: (json['Visibility'] as String?)?.toVisibility(), ); } Map toJson() { + final accountId = this.accountId; final affectedResource = this.affectedResource; final endTime = this.endTime; final feedback = this.feedback; @@ -2878,12 +3434,15 @@ class Problem { final insights = this.insights; final lastRecurrenceTime = this.lastRecurrenceTime; final recurringCount = this.recurringCount; + final resolutionMethod = this.resolutionMethod; final resourceGroupName = this.resourceGroupName; final severityLevel = this.severityLevel; final startTime = this.startTime; final status = this.status; final title = this.title; + final visibility = this.visibility; return { + if (accountId != null) 'AccountId': accountId, if (affectedResource != null) 'AffectedResource': affectedResource, if (endTime != null) 'EndTime': unixTimestampToJson(endTime), if (feedback != null) @@ -2893,15 +3452,51 @@ class Problem { if (lastRecurrenceTime != null) 'LastRecurrenceTime': unixTimestampToJson(lastRecurrenceTime), if (recurringCount != null) 'RecurringCount': recurringCount, + if (resolutionMethod != null) + 'ResolutionMethod': resolutionMethod.toValue(), if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName, if (severityLevel != null) 'SeverityLevel': severityLevel.toValue(), if (startTime != null) 'StartTime': unixTimestampToJson(startTime), if (status != null) 'Status': status.toValue(), if (title != null) 'Title': title, + if (visibility != null) 'Visibility': visibility.toValue(), }; } } +enum RecommendationType { + infraOnly, + workloadOnly, + all, +} + +extension RecommendationTypeValueExtension on RecommendationType { + String toValue() { + switch (this) { + case RecommendationType.infraOnly: + return 'INFRA_ONLY'; + case RecommendationType.workloadOnly: + return 'WORKLOAD_ONLY'; + case RecommendationType.all: + return 'ALL'; + } + } +} + +extension RecommendationTypeFromString on String { + RecommendationType toRecommendationType() { + switch (this) { + case 'INFRA_ONLY': + return RecommendationType.infraOnly; + case 'WORKLOAD_ONLY': + return RecommendationType.workloadOnly; + case 'ALL': + return RecommendationType.all; + } + throw Exception('$this is not known in enum RecommendationType'); + } +} + /// Describes observations related to the problem. class RelatedObservations { /// The list of observations related to the problem. @@ -2928,6 +3523,51 @@ class RelatedObservations { } } +class RemoveWorkloadResponse { + RemoveWorkloadResponse(); + + factory RemoveWorkloadResponse.fromJson(Map _) { + return RemoveWorkloadResponse(); + } + + Map toJson() { + return {}; + } +} + +enum ResolutionMethod { + manual, + automatic, + unresolved, +} + +extension ResolutionMethodValueExtension on ResolutionMethod { + String toValue() { + switch (this) { + case ResolutionMethod.manual: + return 'MANUAL'; + case ResolutionMethod.automatic: + return 'AUTOMATIC'; + case ResolutionMethod.unresolved: + return 'UNRESOLVED'; + } + } +} + +extension ResolutionMethodFromString on String { + ResolutionMethod toResolutionMethod() { + switch (this) { + case 'MANUAL': + return ResolutionMethod.manual; + case 'AUTOMATIC': + return ResolutionMethod.automatic; + case 'UNRESOLVED': + return ResolutionMethod.unresolved; + } + throw Exception('$this is not known in enum ResolutionMethod'); + } +} + enum SeverityLevel { informative, low, @@ -2971,6 +3611,7 @@ enum Status { resolved, pending, recurring, + recovering, } extension StatusValueExtension on Status { @@ -2984,6 +3625,8 @@ extension StatusValueExtension on Status { return 'PENDING'; case Status.recurring: return 'RECURRING'; + case Status.recovering: + return 'RECOVERING'; } } } @@ -2999,6 +3642,8 @@ extension StatusFromString on String { return Status.pending; case 'RECURRING': return Status.recurring; + case 'RECOVERING': + return Status.recovering; } throw Exception('$this is not known in enum Status'); } @@ -3096,6 +3741,9 @@ enum Tier { sqlServerFailoverClusterInstance, sharepoint, activeDirectory, + sapNetweaverStandard, + sapNetweaverDistributed, + sapNetweaverHighAvailability, } extension TierValueExtension on Tier { @@ -3137,6 +3785,12 @@ extension TierValueExtension on Tier { return 'SHAREPOINT'; case Tier.activeDirectory: return 'ACTIVE_DIRECTORY'; + case Tier.sapNetweaverStandard: + return 'SAP_NETWEAVER_STANDARD'; + case Tier.sapNetweaverDistributed: + return 'SAP_NETWEAVER_DISTRIBUTED'; + case Tier.sapNetweaverHighAvailability: + return 'SAP_NETWEAVER_HIGH_AVAILABILITY'; } } } @@ -3180,6 +3834,12 @@ extension TierFromString on String { return Tier.sharepoint; case 'ACTIVE_DIRECTORY': return Tier.activeDirectory; + case 'SAP_NETWEAVER_STANDARD': + return Tier.sapNetweaverStandard; + case 'SAP_NETWEAVER_DISTRIBUTED': + return Tier.sapNetweaverDistributed; + case 'SAP_NETWEAVER_HIGH_AVAILABILITY': + return Tier.sapNetweaverHighAvailability; } throw Exception('$this is not known in enum Tier'); } @@ -3278,6 +3938,192 @@ class UpdateLogPatternResponse { } } +class UpdateProblemResponse { + UpdateProblemResponse(); + + factory UpdateProblemResponse.fromJson(Map _) { + return UpdateProblemResponse(); + } + + Map toJson() { + return {}; + } +} + +enum UpdateStatus { + resolved, +} + +extension UpdateStatusValueExtension on UpdateStatus { + String toValue() { + switch (this) { + case UpdateStatus.resolved: + return 'RESOLVED'; + } + } +} + +extension UpdateStatusFromString on String { + UpdateStatus toUpdateStatus() { + switch (this) { + case 'RESOLVED': + return UpdateStatus.resolved; + } + throw Exception('$this is not known in enum UpdateStatus'); + } +} + +class UpdateWorkloadResponse { + /// The configuration settings of the workload. The value is the escaped JSON of + /// the configuration. + final WorkloadConfiguration? workloadConfiguration; + + /// The ID of the workload. + final String? workloadId; + + UpdateWorkloadResponse({ + this.workloadConfiguration, + this.workloadId, + }); + + factory UpdateWorkloadResponse.fromJson(Map json) { + return UpdateWorkloadResponse( + workloadConfiguration: json['WorkloadConfiguration'] != null + ? WorkloadConfiguration.fromJson( + json['WorkloadConfiguration'] as Map) + : null, + workloadId: json['WorkloadId'] as String?, + ); + } + + Map toJson() { + final workloadConfiguration = this.workloadConfiguration; + final workloadId = this.workloadId; + return { + if (workloadConfiguration != null) + 'WorkloadConfiguration': workloadConfiguration, + if (workloadId != null) 'WorkloadId': workloadId, + }; + } +} + +enum Visibility { + ignored, + visible, +} + +extension VisibilityValueExtension on Visibility { + String toValue() { + switch (this) { + case Visibility.ignored: + return 'IGNORED'; + case Visibility.visible: + return 'VISIBLE'; + } + } +} + +extension VisibilityFromString on String { + Visibility toVisibility() { + switch (this) { + case 'IGNORED': + return Visibility.ignored; + case 'VISIBLE': + return Visibility.visible; + } + throw Exception('$this is not known in enum Visibility'); + } +} + +/// Describes the workloads on a component. +class Workload { + /// The name of the component. + final String? componentName; + + /// The tier of the workload. + final Tier? tier; + + /// The ID of the workload. + final String? workloadId; + + /// The name of the workload. + final String? workloadName; + + /// If logging is supported for the resource type, shows whether the component + /// has configured logs to be monitored. + final String? workloadRemarks; + + Workload({ + this.componentName, + this.tier, + this.workloadId, + this.workloadName, + this.workloadRemarks, + }); + + factory Workload.fromJson(Map json) { + return Workload( + componentName: json['ComponentName'] as String?, + tier: (json['Tier'] as String?)?.toTier(), + workloadId: json['WorkloadId'] as String?, + workloadName: json['WorkloadName'] as String?, + workloadRemarks: json['WorkloadRemarks'] as String?, + ); + } + + Map toJson() { + final componentName = this.componentName; + final tier = this.tier; + final workloadId = this.workloadId; + final workloadName = this.workloadName; + final workloadRemarks = this.workloadRemarks; + return { + if (componentName != null) 'ComponentName': componentName, + if (tier != null) 'Tier': tier.toValue(), + if (workloadId != null) 'WorkloadId': workloadId, + if (workloadName != null) 'WorkloadName': workloadName, + if (workloadRemarks != null) 'WorkloadRemarks': workloadRemarks, + }; + } +} + +/// The configuration of the workload. +class WorkloadConfiguration { + /// The configuration settings of the workload. + final String? configuration; + + /// The configuration of the workload tier. + final Tier? tier; + + /// The name of the workload. + final String? workloadName; + + WorkloadConfiguration({ + this.configuration, + this.tier, + this.workloadName, + }); + + factory WorkloadConfiguration.fromJson(Map json) { + return WorkloadConfiguration( + configuration: json['Configuration'] as String?, + tier: (json['Tier'] as String?)?.toTier(), + workloadName: json['WorkloadName'] as String?, + ); + } + + Map toJson() { + final configuration = this.configuration; + final tier = this.tier; + final workloadName = this.workloadName; + return { + if (configuration != null) 'Configuration': configuration, + if (tier != null) 'Tier': tier.toValue(), + if (workloadName != null) 'WorkloadName': workloadName, + }; + } +} + class AccessDeniedException extends _s.GenericAwsException { AccessDeniedException({String? type, String? message}) : super(type: type, code: 'AccessDeniedException', message: message); diff --git a/aws_client/lib/src/generated/arc_zonal_shift/v2022_10_30.dart b/aws_client/lib/src/generated/arc_zonal_shift/v2022_10_30.dart index 295cb87d4..bce928592 100644 --- a/aws_client/lib/src/generated/arc_zonal_shift/v2022_10_30.dart +++ b/aws_client/lib/src/generated/arc_zonal_shift/v2022_10_30.dart @@ -19,33 +19,38 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// This is the API Reference Guide for the zonal shift feature of Amazon Route -/// 53 Application Recovery Controller. This guide is for developers who need -/// detailed information about zonal shift API actions, data types, and errors. +/// Welcome to the Zonal Shift API Reference Guide for Amazon Route 53 +/// Application Recovery Controller (Route 53 ARC). /// -/// Zonal shift is in preview release for Amazon Route 53 Application Recovery -/// Controller and is subject to change. +/// You can start a zonal shift to move traffic for a load balancer resource +/// away from an Availability Zone to help your application recover quickly from +/// an impairment in an Availability Zone. For example, you can recover your +/// application from a developer's bad code deployment or from an Amazon Web +/// Services infrastructure failure in a single Availability Zone. /// -/// Zonal shift in Route 53 ARC enables you to move traffic for a load balancer -/// resource away from an Availability Zone. Starting a zonal shift helps your -/// application recover immediately, for example, from a developer's bad code -/// deployment or from an AWS infrastructure failure in a single Availability -/// Zone, reducing the impact and time lost from an issue in one zone. +/// You can also configure zonal autoshift for a load balancer resource. Zonal +/// autoshift is a capability in Route 53 ARC where Amazon Web Services shifts +/// away application resource traffic from an Availability Zone, on your behalf, +/// to help reduce your time to recovery during events. Amazon Web Services +/// shifts away traffic for resources that are enabled for zonal autoshift +/// whenever Amazon Web Services determines that there's an issue in the +/// Availability Zone that could potentially affect customers. /// -/// Supported AWS resources are automatically registered with Route 53 ARC. -/// Resources that are registered for zonal shifts in Route 53 ARC are managed -/// resources in Route 53 ARC. You can start a zonal shift for any managed -/// resource in your account in a Region. At this time, you can only start a -/// zonal shift for Network Load Balancers and Application Load Balancers with -/// cross-zone load balancing turned off. -/// -/// Zonal shifts are temporary. You must specify an expiration when you start a -/// zonal shift, of up to three days initially. If you want to still keep -/// traffic away from an Availability Zone, you can update the zonal shift and -/// set a new expiration. You can also cancel a zonal shift, before it expires, -/// for example, if you're ready to restore traffic to the Availability Zone. -/// -/// For more information about using zonal shift, see the +/// You must prescale resource capacity in all Availability Zones in the Region +/// where your application is deployed, before you configure practice runs or +/// enable zonal autoshift for a resource. You should not rely on scaling on +/// demand when an autoshift or practice run starts. +/// +/// For more information about using zonal shift and zonal autoshift, see the Amazon /// Route 53 Application Recovery Controller Developer Guide. class ArcZonalShift { @@ -77,8 +82,12 @@ class ArcZonalShift { _protocol.close(); } - /// Cancel a zonal shift in Amazon Route 53 Application Recovery Controller - /// that you've started for a resource in your AWS account in an AWS Region. + /// Cancel a zonal shift in Amazon Route 53 Application Recovery Controller. + /// To cancel the zonal shift, specify the zonal shift ID. + /// + /// A zonal shift can be one that you've started for a resource in your Amazon + /// Web Services account in an Amazon Web Services Region, or it can be a + /// zonal shift started by a practice run with zonal autoshift. /// /// May throw [InternalServerException]. /// May throw [ConflictException]. @@ -101,13 +110,140 @@ class ArcZonalShift { return ZonalShift.fromJson(response); } + /// A practice run configuration for zonal autoshift is required when you + /// enable zonal autoshift. A practice run configuration includes + /// specifications for blocked dates and blocked time windows, and for Amazon + /// CloudWatch alarms that you create to use with practice runs. The alarms + /// that you specify are an outcome alarm, to monitor application + /// health during practice runs and, optionally, a blocking alarm, to + /// block practice runs from starting. + /// + /// For more information, see + /// Considerations when you configure zonal autoshift in the Amazon Route + /// 53 Application Recovery Controller Developer Guide. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [outcomeAlarms] : + /// The outcome alarm for practice runs is a required Amazon CloudWatch + /// alarm that you specify that ends a practice run when the alarm is in an + /// ALARM state. + /// + /// Configure the alarm to monitor the health of your application when traffic + /// is shifted away from an Availability Zone during each weekly practice run. + /// You should configure the alarm to go into an ALARM state if + /// your application is impacted by the zonal shift, and you want to stop the + /// zonal shift, to let traffic for the resource return to the Availability + /// Zone. + /// + /// Parameter [resourceIdentifier] : + /// The identifier of the resource to shift away traffic for when a practice + /// run starts a zonal shift. The identifier is the Amazon Resource Name (ARN) + /// for the resource. + /// + /// At this time, supported resources are Network Load Balancers and + /// Application Load Balancers with cross-zone load balancing turned off. + /// + /// Parameter [blockedDates] : + /// Optionally, you can block Route 53 ARC from starting practice runs for a + /// resource on specific calendar dates. + /// + /// The format for blocked dates is: YYYY-MM-DD. Keep in mind, when you + /// specify dates, that dates and times for practice runs are in UTC. Separate + /// multiple blocked dates with spaces. + /// + /// For example, if you have an application update scheduled to launch on May + /// 1, 2024, and you don't want practice runs to shift traffic away at that + /// time, you could set a blocked date for 2024-05-01. + /// + /// Parameter [blockedWindows] : + /// Optionally, you can block Route 53 ARC from starting practice runs for + /// specific windows of days and times. + /// + /// The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when + /// you specify dates, that dates and times for practice runs are in UTC. + /// Also, be aware of potential time adjustments that might be required for + /// daylight saving time differences. Separate multiple blocked windows with + /// spaces. + /// + /// For example, say you run business report summaries three days a week. For + /// this scenario, you might set the following recurring days and times as + /// blocked windows, for example: MON-20:30-21:30 WED-20:30-21:30 + /// FRI-20:30-21:30. + /// + /// Parameter [blockingAlarms] : + /// An Amazon CloudWatch alarm that you can specify for zonal autoshift + /// practice runs. This alarm blocks Route 53 ARC from starting practice run + /// zonal shifts, and ends a practice run that's in progress, when the alarm + /// is in an ALARM state. + Future + createPracticeRunConfiguration({ + required List outcomeAlarms, + required String resourceIdentifier, + List? blockedDates, + List? blockedWindows, + List? blockingAlarms, + }) async { + final $payload = { + 'outcomeAlarms': outcomeAlarms, + 'resourceIdentifier': resourceIdentifier, + if (blockedDates != null) 'blockedDates': blockedDates, + if (blockedWindows != null) 'blockedWindows': blockedWindows, + if (blockingAlarms != null) 'blockingAlarms': blockingAlarms, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/configuration', + exceptionFnMap: _exceptionFns, + ); + return CreatePracticeRunConfigurationResponse.fromJson(response); + } + + /// Deletes the practice run configuration for a resource. Before you can + /// delete a practice run configuration for a resource., you must disable + /// zonal autoshift for the resource. Practice runs must be configured for + /// zonal autoshift to be enabled. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceIdentifier] : + /// The identifier for the resource that you want to delete the practice run + /// configuration for. The identifier is the Amazon Resource Name (ARN) for + /// the resource. + Future + deletePracticeRunConfiguration({ + required String resourceIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/configuration/${Uri.encodeComponent(resourceIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return DeletePracticeRunConfigurationResponse.fromJson(response); + } + /// Get information about a resource that's been registered for zonal shifts - /// with Amazon Route 53 Application Recovery Controller in this AWS Region. - /// Resources that are registered for zonal shifts are managed resources in - /// Route 53 ARC. + /// with Amazon Route 53 Application Recovery Controller in this Amazon Web + /// Services Region. Resources that are registered for zonal shifts are + /// managed resources in Route 53 ARC. You can start zonal shifts and + /// configure zonal autoshift for managed resources. /// - /// At this time, you can only start a zonal shift for Network Load Balancers - /// and Application Load Balancers with cross-zone load balancing turned off. + /// At this time, you can only start a zonal shift or configure zonal + /// autoshift for Network Load Balancers and Application Load Balancers with + /// cross-zone load balancing turned off. /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -116,11 +252,11 @@ class ArcZonalShift { /// May throw [AccessDeniedException]. /// /// Parameter [resourceIdentifier] : - /// The identifier for the resource to include in a zonal shift. The - /// identifier is the Amazon Resource Name (ARN) for the resource. + /// The identifier for the resource to shift away traffic for. The identifier + /// is the Amazon Resource Name (ARN) for the resource. /// - /// At this time, you can only start a zonal shift for Network Load Balancers - /// and Application Load Balancers with cross-zone load balancing turned off. + /// At this time, supported resources are Network Load Balancers and + /// Application Load Balancers with cross-zone load balancing turned off. Future getManagedResource({ required String resourceIdentifier, }) async { @@ -134,11 +270,57 @@ class ArcZonalShift { return GetManagedResourceResponse.fromJson(response); } - /// Lists all the resources in your AWS account in this AWS Region that are - /// managed for zonal shifts in Amazon Route 53 Application Recovery - /// Controller, and information about them. The information includes their - /// Amazon Resource Names (ARNs), the Availability Zones the resources are - /// deployed in, and the resource name. + /// Returns the active autoshifts for a specified resource. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The number of objects that you want to return with this call. + /// + /// Parameter [nextToken] : + /// Specifies that you want to receive the next page of results. Valid only if + /// you received a NextToken response in the previous request. If + /// you did, it indicates that more output is available. Set this parameter to + /// the value provided by the previous call's NextToken response + /// to request the next page of results. + /// + /// Parameter [status] : + /// The status of the autoshift. + Future listAutoshifts({ + int? maxResults, + String? nextToken, + AutoshiftExecutionStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/autoshifts', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAutoshiftsResponse.fromJson(response); + } + + /// Lists all the resources in your Amazon Web Services account in this Amazon + /// Web Services Region that are managed for zonal shifts in Amazon Route 53 + /// Application Recovery Controller, and information about them. The + /// information includes the zonal autoshift status for the resource, as well + /// as the Amazon Resource Name (ARN), the Availability Zones that each + /// resource is deployed in, and the resource name. /// /// May throw [InternalServerException]. /// May throw [ThrottlingException]. @@ -178,8 +360,15 @@ class ArcZonalShift { return ListManagedResourcesResponse.fromJson(response); } - /// Lists all the active zonal shifts in Amazon Route 53 Application Recovery - /// Controller in your AWS account in this AWS Region. + /// Lists all active and completed zonal shifts in Amazon Route 53 Application + /// Recovery Controller in your Amazon Web Services account in this Amazon Web + /// Services Region. ListZonalShifts returns customer-started + /// zonal shifts, as well as practice run zonal shifts that Route 53 ARC + /// started on your behalf for zonal autoshift. + /// + /// The ListZonalShifts operation does not list autoshifts. For + /// more information about listing autoshifts, see ">ListAutoshifts. /// /// May throw [InternalServerException]. /// May throw [ThrottlingException]. @@ -196,6 +385,10 @@ class ArcZonalShift { /// the value provided by the previous call's NextToken response /// to request the next page of results. /// + /// Parameter [resourceIdentifier] : + /// The identifier for the resource that you want to list zonal shifts for. + /// The identifier is the Amazon Resource Name (ARN) for the resource. + /// /// Parameter [status] : /// A status for a zonal shift. /// @@ -204,7 +397,7 @@ class ArcZonalShift { /// ///
        ///
      • - /// ACTIVE: The zonal shift is started and active. + /// ACTIVE: The zonal shift has been started and active. ///
      • ///
      • /// EXPIRED: The zonal shift has expired (the expiry time was @@ -217,6 +410,7 @@ class ArcZonalShift { Future listZonalShifts({ int? maxResults, String? nextToken, + String? resourceIdentifier, ZonalShiftStatus? status, }) async { _s.validateNumRange( @@ -228,6 +422,8 @@ class ArcZonalShift { final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], + if (resourceIdentifier != null) + 'resourceIdentifier': [resourceIdentifier], if (status != null) 'status': [status.toValue()], }; final response = await _protocol.send( @@ -241,12 +437,13 @@ class ArcZonalShift { } /// You start a zonal shift to temporarily move load balancer traffic away - /// from an Availability Zone in a AWS Region, to help your application - /// recover immediately, for example, from a developer's bad code deployment - /// or from an AWS infrastructure failure in a single Availability Zone. You - /// can start a zonal shift in Route 53 ARC only for managed resources in your - /// account in an AWS Region. Resources are automatically registered with - /// Route 53 ARC by AWS services. + /// from an Availability Zone in an Amazon Web Services Region, to help your + /// application recover immediately, for example, from a developer's bad code + /// deployment or from an Amazon Web Services infrastructure failure in a + /// single Availability Zone. You can start a zonal shift in Route 53 ARC only + /// for managed resources in your Amazon Web Services account in an Amazon Web + /// Services Region. Resources are automatically registered with Route 53 ARC + /// by Amazon Web Services services. /// /// At this time, you can only start a zonal shift for Network Load Balancers /// and Application Load Balancers with cross-zone load balancing turned off. @@ -273,7 +470,7 @@ class ArcZonalShift { /// The Availability Zone that traffic is moved away from for a resource when /// you start a zonal shift. Until the zonal shift expires or you cancel it, /// traffic for the resource is instead moved to other Availability Zones in - /// the AWS Region. + /// the Amazon Web Services Region. /// /// Parameter [comment] : /// A comment that you enter about the zonal shift. Only the latest comment is @@ -293,20 +490,24 @@ class ArcZonalShift { /// /// To set a length of time for a zonal shift to be active, specify a whole /// number, and then one of the following, with no space: - ///
         <ul> <li> <p> <b>A lowercase letter
        -  /// m:</b> To specify that the value is in minutes.</p>
        -  /// </li> <li> <p> <b>A lowercase letter h:</b>
        -  /// To specify that the value is in hours.</p> </li> </ul>
        -  /// <p>For example: <code>20h</code> means the zonal shift
        -  /// expires in 20 hours. <code>120m</code> means the zonal shift
        -  /// expires in 120 minutes (2 hours).</p> 
        + /// + ///
          + ///
        • + /// A lowercase letter m: To specify that the value is in minutes. + ///
        • + ///
        • + /// A lowercase letter h: To specify that the value is in hours. + ///
        • + ///
        + /// For example: 20h means the zonal shift expires in 20 hours. + /// 120m means the zonal shift expires in 120 minutes (2 hours). /// /// Parameter [resourceIdentifier] : - /// The identifier for the resource to include in a zonal shift. The - /// identifier is the Amazon Resource Name (ARN) for the resource. + /// The identifier for the resource to shift away traffic for. The identifier + /// is the Amazon Resource Name (ARN) for the resource. /// - /// At this time, you can only start a zonal shift for Network Load Balancers - /// and Application Load Balancers with cross-zone load balancing turned off. + /// At this time, supported resources are Network Load Balancers and + /// Application Load Balancers with cross-zone load balancing turned off. Future startZonalShift({ required String awayFrom, required String comment, @@ -328,9 +529,124 @@ class ArcZonalShift { return ZonalShift.fromJson(response); } + /// Update a practice run configuration to change one or more of the + /// following: add, change, or remove the blocking alarm; change the outcome + /// alarm; or add, change, or remove blocking dates or time windows. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceIdentifier] : + /// The identifier for the resource that you want to update the practice run + /// configuration for. The identifier is the Amazon Resource Name (ARN) for + /// the resource. + /// + /// Parameter [blockedDates] : + /// Add, change, or remove blocked dates for a practice run in zonal + /// autoshift. + /// + /// Optionally, you can block practice runs for specific calendar dates. The + /// format for blocked dates is: YYYY-MM-DD. Keep in mind, when you specify + /// dates, that dates and times for practice runs are in UTC. Separate + /// multiple blocked dates with spaces. + /// + /// For example, if you have an application update scheduled to launch on May + /// 1, 2024, and you don't want practice runs to shift traffic away at that + /// time, you could set a blocked date for 2024-05-01. + /// + /// Parameter [blockedWindows] : + /// Add, change, or remove windows of days and times for when you can, + /// optionally, block Route 53 ARC from starting a practice run for a + /// resource. + /// + /// The format for blocked windows is: DAY:HH:SS-DAY:HH:SS. Keep in mind, when + /// you specify dates, that dates and times for practice runs are in UTC. + /// Also, be aware of potential time adjustments that might be required for + /// daylight saving time differences. Separate multiple blocked windows with + /// spaces. + /// + /// For example, say you run business report summaries three days a week. For + /// this scenario, you might set the following recurring days and times as + /// blocked windows, for example: MON-20:30-21:30 WED-20:30-21:30 + /// FRI-20:30-21:30. + /// + /// Parameter [blockingAlarms] : + /// Add, change, or remove the Amazon CloudWatch alarm that you optionally + /// specify as the blocking alarm for practice runs. + /// + /// Parameter [outcomeAlarms] : + /// Specify a new the Amazon CloudWatch alarm as the outcome alarm for + /// practice runs. + Future + updatePracticeRunConfiguration({ + required String resourceIdentifier, + List? blockedDates, + List? blockedWindows, + List? blockingAlarms, + List? outcomeAlarms, + }) async { + final $payload = { + if (blockedDates != null) 'blockedDates': blockedDates, + if (blockedWindows != null) 'blockedWindows': blockedWindows, + if (blockingAlarms != null) 'blockingAlarms': blockingAlarms, + if (outcomeAlarms != null) 'outcomeAlarms': outcomeAlarms, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/configuration/${Uri.encodeComponent(resourceIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdatePracticeRunConfigurationResponse.fromJson(response); + } + + /// You can update the zonal autoshift status for a resource, to enable or + /// disable zonal autoshift. When zonal autoshift is ENABLED, + /// Amazon Web Services shifts away resource traffic from an Availability + /// Zone, on your behalf, when Amazon Web Services determines that there's an + /// issue in the Availability Zone that could potentially affect customers. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceIdentifier] : + /// The identifier for the resource that you want to update the zonal + /// autoshift configuration for. The identifier is the Amazon Resource Name + /// (ARN) for the resource. + /// + /// Parameter [zonalAutoshiftStatus] : + /// The zonal autoshift status for the resource that you want to update the + /// zonal autoshift configuration for. + Future + updateZonalAutoshiftConfiguration({ + required String resourceIdentifier, + required ZonalAutoshiftStatus zonalAutoshiftStatus, + }) async { + final $payload = { + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/managedresources/${Uri.encodeComponent(resourceIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateZonalAutoshiftConfigurationResponse.fromJson(response); + } + /// Update an active zonal shift in Amazon Route 53 Application Recovery - /// Controller in your AWS account. You can update a zonal shift to set a new - /// expiration, or edit or replace the comment for the zonal shift. + /// Controller in your Amazon Web Services account. You can update a zonal + /// shift to set a new expiration, or edit or replace the comment for the + /// zonal shift. /// /// May throw [InternalServerException]. /// May throw [ConflictException]. @@ -418,6 +734,351 @@ extension AppliedStatusFromString on String { } } +enum AutoshiftAppliedStatus { + applied, + notApplied, +} + +extension AutoshiftAppliedStatusValueExtension on AutoshiftAppliedStatus { + String toValue() { + switch (this) { + case AutoshiftAppliedStatus.applied: + return 'APPLIED'; + case AutoshiftAppliedStatus.notApplied: + return 'NOT_APPLIED'; + } + } +} + +extension AutoshiftAppliedStatusFromString on String { + AutoshiftAppliedStatus toAutoshiftAppliedStatus() { + switch (this) { + case 'APPLIED': + return AutoshiftAppliedStatus.applied; + case 'NOT_APPLIED': + return AutoshiftAppliedStatus.notApplied; + } + throw Exception('$this is not known in enum AutoshiftAppliedStatus'); + } +} + +enum AutoshiftExecutionStatus { + active, + completed, +} + +extension AutoshiftExecutionStatusValueExtension on AutoshiftExecutionStatus { + String toValue() { + switch (this) { + case AutoshiftExecutionStatus.active: + return 'ACTIVE'; + case AutoshiftExecutionStatus.completed: + return 'COMPLETED'; + } + } +} + +extension AutoshiftExecutionStatusFromString on String { + AutoshiftExecutionStatus toAutoshiftExecutionStatus() { + switch (this) { + case 'ACTIVE': + return AutoshiftExecutionStatus.active; + case 'COMPLETED': + return AutoshiftExecutionStatus.completed; + } + throw Exception('$this is not known in enum AutoshiftExecutionStatus'); + } +} + +/// A complex structure that lists an autoshift that is currently active for a +/// managed resource and information about the autoshift. +/// +/// For more information, see How +/// zonal autoshift and practice runs work in the Amazon Route 53 +/// Application Recovery Controller Developer Guide. +class AutoshiftInResource { + /// The appliedStatus field specifies which application traffic + /// shift is in effect for a resource when there is more than one traffic shift + /// active. There can be more than one application traffic shift in progress at + /// the same time - that is, practice run zonal shifts, customer-started zonal + /// shifts, or an autoshift. The appliedStatus field for an + /// autoshift for a resource can have one of two values: APPLIED or + /// NOT_APPLIED. The zonal shift or autoshift that is currently in + /// effect for the resource has an applied status set to APPLIED. + /// + /// The overall principle for precedence is that zonal shifts that you start as + /// a customer take precedence autoshifts, which take precedence over practice + /// runs. That is, customer-started zonal shifts > autoshifts > practice + /// run zonal shifts. + /// + /// For more information, see How + /// zonal autoshift and practice runs work in the Amazon Route 53 + /// Application Recovery Controller Developer Guide. + final AutoshiftAppliedStatus appliedStatus; + + /// The Availability Zone that traffic is shifted away from for a resource, when + /// Amazon Web Services starts an autoshift. Until the autoshift ends, traffic + /// for the resource is instead directed to other Availability Zones in the + /// Amazon Web Services Region. An autoshift can end for a resource, for + /// example, when Amazon Web Services ends the autoshift for the Availability + /// Zone or when you disable zonal autoshift for the resource. + final String awayFrom; + + /// The time (UTC) when the autoshift started. + final DateTime startTime; + + AutoshiftInResource({ + required this.appliedStatus, + required this.awayFrom, + required this.startTime, + }); + + factory AutoshiftInResource.fromJson(Map json) { + return AutoshiftInResource( + appliedStatus: + (json['appliedStatus'] as String).toAutoshiftAppliedStatus(), + awayFrom: json['awayFrom'] as String, + startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), + ); + } + + Map toJson() { + final appliedStatus = this.appliedStatus; + final awayFrom = this.awayFrom; + final startTime = this.startTime; + return { + 'appliedStatus': appliedStatus.toValue(), + 'awayFrom': awayFrom, + 'startTime': unixTimestampToJson(startTime), + }; + } +} + +/// Information about an autoshift. Amazon Web Services starts an autoshift to +/// temporarily move traffic for a resource away from an Availability Zone in an +/// Amazon Web Services Region when Amazon Web Services determines that there's +/// an issue in the Availability Zone that could potentially affect customers. +/// You can configure zonal autoshift in Route 53 ARC for managed resources in +/// your Amazon Web Services account in a Region. Supported Amazon Web Services +/// resources are automatically registered with Route 53 ARC. +/// +/// Autoshifts are temporary. When the Availability Zone recovers, Amazon Web +/// Services ends the autoshift, and traffic for the resource is no longer +/// directed to the other Availability Zones in the Region. +/// +/// You can stop an autoshift for a resource by disabling zonal autoshift. +class AutoshiftSummary { + /// The Availability Zone that traffic is shifted away from for a resource when + /// Amazon Web Services starts an autoshift. Until the autoshift ends, traffic + /// for the resource is instead directed to other Availability Zones in the + /// Amazon Web Services Region. An autoshift can end for a resource, for + /// example, when Amazon Web Services ends the autoshift for the Availability + /// Zone or when you disable zonal autoshift for the resource. + final String awayFrom; + + /// The time (in UTC) when the autoshift ended. + final DateTime endTime; + + /// The time (in UTC) when the autoshift started. + final DateTime startTime; + + /// The status for an autoshift. + final AutoshiftExecutionStatus status; + + AutoshiftSummary({ + required this.awayFrom, + required this.endTime, + required this.startTime, + required this.status, + }); + + factory AutoshiftSummary.fromJson(Map json) { + return AutoshiftSummary( + awayFrom: json['awayFrom'] as String, + endTime: nonNullableTimeStampFromJson(json['endTime'] as Object), + startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), + status: (json['status'] as String).toAutoshiftExecutionStatus(), + ); + } + + Map toJson() { + final awayFrom = this.awayFrom; + final endTime = this.endTime; + final startTime = this.startTime; + final status = this.status; + return { + 'awayFrom': awayFrom, + 'endTime': unixTimestampToJson(endTime), + 'startTime': unixTimestampToJson(startTime), + 'status': status.toValue(), + }; + } +} + +/// A control condition is an alarm that you specify for a practice run. When +/// you configure practice runs with zonal autoshift for a resource, you specify +/// Amazon CloudWatch alarms, which you create in CloudWatch to use with the +/// practice run. The alarms that you specify are an outcome alarm, to +/// monitor application health during practice runs and, optionally, a +/// blocking alarm, to block practice runs from starting. +/// +/// Control condition alarms do not apply for autoshifts. +/// +/// For more information, see +/// Considerations when you configure zonal autoshift in the Amazon Route 53 +/// Application Recovery Controller Developer Guide. +class ControlCondition { + /// The Amazon Resource Name (ARN) for the Amazon CloudWatch alarm that you + /// specify as a control condition for a practice run. + final String alarmIdentifier; + + /// The type of alarm specified for a practice run. The only valid value is + /// CLOUDWATCH. + final ControlConditionType type; + + ControlCondition({ + required this.alarmIdentifier, + required this.type, + }); + + factory ControlCondition.fromJson(Map json) { + return ControlCondition( + alarmIdentifier: json['alarmIdentifier'] as String, + type: (json['type'] as String).toControlConditionType(), + ); + } + + Map toJson() { + final alarmIdentifier = this.alarmIdentifier; + final type = this.type; + return { + 'alarmIdentifier': alarmIdentifier, + 'type': type.toValue(), + }; + } +} + +enum ControlConditionType { + cloudwatch, +} + +extension ControlConditionTypeValueExtension on ControlConditionType { + String toValue() { + switch (this) { + case ControlConditionType.cloudwatch: + return 'CLOUDWATCH'; + } + } +} + +extension ControlConditionTypeFromString on String { + ControlConditionType toControlConditionType() { + switch (this) { + case 'CLOUDWATCH': + return ControlConditionType.cloudwatch; + } + throw Exception('$this is not known in enum ControlConditionType'); + } +} + +class CreatePracticeRunConfigurationResponse { + /// The Amazon Resource Name (ARN) of the resource that you configured the + /// practice run for. + final String arn; + + /// The name of the resource that you configured the practice run for. + final String name; + + /// A practice run configuration for a resource. Configurations include the + /// outcome alarm that you specify for practice runs, and, optionally, a + /// blocking alarm and blocking dates and windows. + final PracticeRunConfiguration practiceRunConfiguration; + + /// The status for zonal autoshift for a resource. When you specify the + /// autoshift status as ENABLED, Amazon Web Services shifts traffic + /// away from shifts away application resource traffic from an Availability + /// Zone, on your behalf, when Amazon Web Services determines that there's an + /// issue in the Availability Zone that could potentially affect customers. + /// + /// When you enable zonal autoshift, you must also configure practice runs for + /// the resource. + final ZonalAutoshiftStatus zonalAutoshiftStatus; + + CreatePracticeRunConfigurationResponse({ + required this.arn, + required this.name, + required this.practiceRunConfiguration, + required this.zonalAutoshiftStatus, + }); + + factory CreatePracticeRunConfigurationResponse.fromJson( + Map json) { + return CreatePracticeRunConfigurationResponse( + arn: json['arn'] as String, + name: json['name'] as String, + practiceRunConfiguration: PracticeRunConfiguration.fromJson( + json['practiceRunConfiguration'] as Map), + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String).toZonalAutoshiftStatus(), + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final practiceRunConfiguration = this.practiceRunConfiguration; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; + return { + 'arn': arn, + 'name': name, + 'practiceRunConfiguration': practiceRunConfiguration, + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + }; + } +} + +class DeletePracticeRunConfigurationResponse { + /// The Amazon Resource Name (ARN) of the resource that you deleted the practice + /// run for. + final String arn; + + /// The name of the resource that you deleted the practice run for. + final String name; + + /// The status of zonal autoshift for the resource. + final ZonalAutoshiftStatus zonalAutoshiftStatus; + + DeletePracticeRunConfigurationResponse({ + required this.arn, + required this.name, + required this.zonalAutoshiftStatus, + }); + + factory DeletePracticeRunConfigurationResponse.fromJson( + Map json) { + return DeletePracticeRunConfigurationResponse( + arn: json['arn'] as String, + name: json['name'] as String, + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String).toZonalAutoshiftStatus(), + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; + return { + 'arn': arn, + 'name': name, + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + }; + } +} + class GetManagedResourceResponse { /// A collection of key-value pairs that indicate whether resources are active /// in Availability Zones or not. The key name is the Availability Zone where @@ -430,14 +1091,31 @@ class GetManagedResourceResponse { /// The Amazon Resource Name (ARN) for the resource. final String? arn; + /// An array of the autoshifts that are active for the resource. + final List? autoshifts; + /// The name of the resource. final String? name; + /// The practice run configuration for zonal autoshift that's associated with + /// the resource. + final PracticeRunConfiguration? practiceRunConfiguration; + + /// The status for zonal autoshift for a resource. When the autoshift status is + /// ENABLED, Amazon Web Services shifts traffic for a resource away + /// from an Availability Zone, on your behalf, when Amazon Web Services + /// determines that there's an issue in the Availability Zone that could + /// potentially affect customers. + final ZonalAutoshiftStatus? zonalAutoshiftStatus; + GetManagedResourceResponse({ required this.appliedWeights, required this.zonalShifts, this.arn, + this.autoshifts, this.name, + this.practiceRunConfiguration, + this.zonalAutoshiftStatus, }); factory GetManagedResourceResponse.fromJson(Map json) { @@ -449,7 +1127,17 @@ class GetManagedResourceResponse { .map((e) => ZonalShiftInResource.fromJson(e as Map)) .toList(), arn: json['arn'] as String?, + autoshifts: (json['autoshifts'] as List?) + ?.whereNotNull() + .map((e) => AutoshiftInResource.fromJson(e as Map)) + .toList(), name: json['name'] as String?, + practiceRunConfiguration: json['practiceRunConfiguration'] != null + ? PracticeRunConfiguration.fromJson( + json['practiceRunConfiguration'] as Map) + : null, + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String?)?.toZonalAutoshiftStatus(), ); } @@ -457,12 +1145,56 @@ class GetManagedResourceResponse { final appliedWeights = this.appliedWeights; final zonalShifts = this.zonalShifts; final arn = this.arn; + final autoshifts = this.autoshifts; final name = this.name; + final practiceRunConfiguration = this.practiceRunConfiguration; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; return { 'appliedWeights': appliedWeights, 'zonalShifts': zonalShifts, if (arn != null) 'arn': arn, + if (autoshifts != null) 'autoshifts': autoshifts, if (name != null) 'name': name, + if (practiceRunConfiguration != null) + 'practiceRunConfiguration': practiceRunConfiguration, + if (zonalAutoshiftStatus != null) + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + }; + } +} + +class ListAutoshiftsResponse { + /// The items in the response list. + final List? items; + + /// Specifies that you want to receive the next page of results. Valid only if + /// you received a NextToken response in the previous request. If + /// you did, it indicates that more output is available. Set this parameter to + /// the value provided by the previous call's NextToken response to + /// request the next page of results. + final String? nextToken; + + ListAutoshiftsResponse({ + this.items, + this.nextToken, + }); + + factory ListAutoshiftsResponse.fromJson(Map json) { + return ListAutoshiftsResponse( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => AutoshiftSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, }; } } @@ -540,31 +1272,64 @@ class ListZonalShiftsResponse { } } -/// A complex structure for a managed resource in an account. +/// A complex structure for a managed resource in an Amazon Web Services account +/// with information about zonal shifts and autoshifts. /// -/// A managed resource is a Network Load Balancer or Application Load Balancer -/// that has been registered with Route 53 ARC by Elastic Load Balancing. You -/// can start a zonal shift in Route 53 ARC for a managed resource to -/// temporarily move traffic for the resource away from an Availability Zone in -/// an AWS Region. +/// A managed resource is a load balancer that has been registered with Route 53 +/// ARC by Elastic Load Balancing. You can start a zonal shift in Route 53 ARC +/// for a managed resource to temporarily move traffic for the resource away +/// from an Availability Zone in an Amazon Web Services Region. You can also +/// configure zonal autoshift for a managed resource. /// -/// At this time, you can only start a zonal shift for Network Load Balancers -/// and Application Load Balancers with cross-zone load balancing turned off. +/// At this time, managed resources are Network Load Balancers and Application +/// Load Balancers with cross-zone load balancing turned off. /// class ManagedResourceSummary { /// The Availability Zones that a resource is deployed in. final List availabilityZones; + /// A collection of key-value pairs that indicate whether resources are active + /// in Availability Zones or not. The key name is the Availability Zone where + /// the resource is deployed. The value is 1 or 0. + final Map? appliedWeights; + /// The Amazon Resource Name (ARN) for the managed resource. final String? arn; + /// An array of the autoshifts that have been completed for a resource. + final List? autoshifts; + /// The name of the managed resource. final String? name; + /// This status tracks whether a practice run configuration exists for a + /// resource. When you configure a practice run for a resource so that a + /// practice run configuration exists, Route 53 ARC sets this value to + /// ENABLED. If a you have not configured a practice run for the + /// resource, or delete a practice run configuration, Route 53 ARC sets the + /// value to DISABLED. + /// + /// Route 53 ARC updates this status; you can't set a practice run status to + /// ENABLED or DISABLED. + final ZonalAutoshiftStatus? practiceRunStatus; + + /// The status of autoshift for a resource. When you configure zonal autoshift + /// for a resource, you can set the value of the status to ENABLED + /// or DISABLED. + final ZonalAutoshiftStatus? zonalAutoshiftStatus; + + /// An array of the zonal shifts for a resource. + final List? zonalShifts; + ManagedResourceSummary({ required this.availabilityZones, + this.appliedWeights, this.arn, + this.autoshifts, this.name, + this.practiceRunStatus, + this.zonalAutoshiftStatus, + this.zonalShifts, }); factory ManagedResourceSummary.fromJson(Map json) { @@ -573,28 +1338,277 @@ class ManagedResourceSummary { .whereNotNull() .map((e) => e as String) .toList(), + appliedWeights: (json['appliedWeights'] as Map?) + ?.map((k, e) => MapEntry(k, e as double)), arn: json['arn'] as String?, + autoshifts: (json['autoshifts'] as List?) + ?.whereNotNull() + .map((e) => AutoshiftInResource.fromJson(e as Map)) + .toList(), name: json['name'] as String?, + practiceRunStatus: + (json['practiceRunStatus'] as String?)?.toZonalAutoshiftStatus(), + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String?)?.toZonalAutoshiftStatus(), + zonalShifts: (json['zonalShifts'] as List?) + ?.whereNotNull() + .map((e) => ZonalShiftInResource.fromJson(e as Map)) + .toList(), ); } Map toJson() { final availabilityZones = this.availabilityZones; + final appliedWeights = this.appliedWeights; final arn = this.arn; + final autoshifts = this.autoshifts; final name = this.name; + final practiceRunStatus = this.practiceRunStatus; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; + final zonalShifts = this.zonalShifts; return { 'availabilityZones': availabilityZones, + if (appliedWeights != null) 'appliedWeights': appliedWeights, if (arn != null) 'arn': arn, + if (autoshifts != null) 'autoshifts': autoshifts, if (name != null) 'name': name, + if (practiceRunStatus != null) + 'practiceRunStatus': practiceRunStatus.toValue(), + if (zonalAutoshiftStatus != null) + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + if (zonalShifts != null) 'zonalShifts': zonalShifts, + }; + } +} + +/// A practice run configuration for a resource includes the Amazon CloudWatch +/// alarms that you've specified for a practice run, as well as any blocked +/// dates or blocked windows for the practice run. +/// +/// You can update or delete a practice run configuration. Before you delete a +/// practice run configuration, you must disable zonal autoshift for the +/// resource. A practice run configuration is required when zonal autoshift is +/// enabled. +class PracticeRunConfiguration { + /// The outcome alarm for practice runs is an alarm that you specify that + /// ends a practice run when the alarm is in an ALARM state. + final List outcomeAlarms; + + /// An array of one or more dates that you can specify when Amazon Web Services + /// does not start practice runs for a resource. + /// + /// Specify blocked dates, in UTC, in the format YYYY-MM-DD, + /// separated by spaces. + final List? blockedDates; + + /// An array of one or more windows of days and times that you can block Route + /// 53 ARC from starting practice runs for a resource. + /// + /// Specify the blocked windows in UTC, using the format + /// DAY:HH:MM-DAY:HH:MM, separated by spaces. For example, + /// MON:18:30-MON:19:30 TUE:18:30-TUE:19:30. + final List? blockedWindows; + + /// The blocking alarm for practice runs is an optional alarm that you + /// can specify that blocks practice runs when the alarm is in an + /// ALARM state. + final List? blockingAlarms; + + PracticeRunConfiguration({ + required this.outcomeAlarms, + this.blockedDates, + this.blockedWindows, + this.blockingAlarms, + }); + + factory PracticeRunConfiguration.fromJson(Map json) { + return PracticeRunConfiguration( + outcomeAlarms: (json['outcomeAlarms'] as List) + .whereNotNull() + .map((e) => ControlCondition.fromJson(e as Map)) + .toList(), + blockedDates: (json['blockedDates'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + blockedWindows: (json['blockedWindows'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + blockingAlarms: (json['blockingAlarms'] as List?) + ?.whereNotNull() + .map((e) => ControlCondition.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final outcomeAlarms = this.outcomeAlarms; + final blockedDates = this.blockedDates; + final blockedWindows = this.blockedWindows; + final blockingAlarms = this.blockingAlarms; + return { + 'outcomeAlarms': outcomeAlarms, + if (blockedDates != null) 'blockedDates': blockedDates, + if (blockedWindows != null) 'blockedWindows': blockedWindows, + if (blockingAlarms != null) 'blockingAlarms': blockingAlarms, + }; + } +} + +enum PracticeRunOutcome { + failed, + interrupted, + pending, + succeeded, +} + +extension PracticeRunOutcomeValueExtension on PracticeRunOutcome { + String toValue() { + switch (this) { + case PracticeRunOutcome.failed: + return 'FAILED'; + case PracticeRunOutcome.interrupted: + return 'INTERRUPTED'; + case PracticeRunOutcome.pending: + return 'PENDING'; + case PracticeRunOutcome.succeeded: + return 'SUCCEEDED'; + } + } +} + +extension PracticeRunOutcomeFromString on String { + PracticeRunOutcome toPracticeRunOutcome() { + switch (this) { + case 'FAILED': + return PracticeRunOutcome.failed; + case 'INTERRUPTED': + return PracticeRunOutcome.interrupted; + case 'PENDING': + return PracticeRunOutcome.pending; + case 'SUCCEEDED': + return PracticeRunOutcome.succeeded; + } + throw Exception('$this is not known in enum PracticeRunOutcome'); + } +} + +class UpdatePracticeRunConfigurationResponse { + /// The Amazon Resource Name (ARN) of the resource that you updated the practice + /// run for. + final String arn; + + /// The name of the resource that you updated the practice run for. + final String name; + + /// The practice run configuration that was updated. + final PracticeRunConfiguration practiceRunConfiguration; + + /// The zonal autoshift status for the resource that you updated the practice + /// run for. + final ZonalAutoshiftStatus zonalAutoshiftStatus; + + UpdatePracticeRunConfigurationResponse({ + required this.arn, + required this.name, + required this.practiceRunConfiguration, + required this.zonalAutoshiftStatus, + }); + + factory UpdatePracticeRunConfigurationResponse.fromJson( + Map json) { + return UpdatePracticeRunConfigurationResponse( + arn: json['arn'] as String, + name: json['name'] as String, + practiceRunConfiguration: PracticeRunConfiguration.fromJson( + json['practiceRunConfiguration'] as Map), + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String).toZonalAutoshiftStatus(), + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final practiceRunConfiguration = this.practiceRunConfiguration; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; + return { + 'arn': arn, + 'name': name, + 'practiceRunConfiguration': practiceRunConfiguration, + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), + }; + } +} + +class UpdateZonalAutoshiftConfigurationResponse { + /// The identifier for the resource that you updated the zonal autoshift + /// configuration for. The identifier is the Amazon Resource Name (ARN) for the + /// resource. + final String resourceIdentifier; + + /// The zonal autoshift status for the resource that you updated the zonal + /// autoshift configuration for. + final ZonalAutoshiftStatus zonalAutoshiftStatus; + + UpdateZonalAutoshiftConfigurationResponse({ + required this.resourceIdentifier, + required this.zonalAutoshiftStatus, + }); + + factory UpdateZonalAutoshiftConfigurationResponse.fromJson( + Map json) { + return UpdateZonalAutoshiftConfigurationResponse( + resourceIdentifier: json['resourceIdentifier'] as String, + zonalAutoshiftStatus: + (json['zonalAutoshiftStatus'] as String).toZonalAutoshiftStatus(), + ); + } + + Map toJson() { + final resourceIdentifier = this.resourceIdentifier; + final zonalAutoshiftStatus = this.zonalAutoshiftStatus; + return { + 'resourceIdentifier': resourceIdentifier, + 'zonalAutoshiftStatus': zonalAutoshiftStatus.toValue(), }; } } +enum ZonalAutoshiftStatus { + enabled, + disabled, +} + +extension ZonalAutoshiftStatusValueExtension on ZonalAutoshiftStatus { + String toValue() { + switch (this) { + case ZonalAutoshiftStatus.enabled: + return 'ENABLED'; + case ZonalAutoshiftStatus.disabled: + return 'DISABLED'; + } + } +} + +extension ZonalAutoshiftStatusFromString on String { + ZonalAutoshiftStatus toZonalAutoshiftStatus() { + switch (this) { + case 'ENABLED': + return ZonalAutoshiftStatus.enabled; + case 'DISABLED': + return ZonalAutoshiftStatus.disabled; + } + throw Exception('$this is not known in enum ZonalAutoshiftStatus'); + } +} + class ZonalShift { /// The Availability Zone that traffic is moved away from for a resource when /// you start a zonal shift. Until the zonal shift expires or you cancel it, /// traffic for the resource is instead moved to other Availability Zones in the - /// AWS Region. + /// Amazon Web Services Region. final String awayFrom; /// A comment that you enter about the zonal shift. Only the latest comment is @@ -602,26 +1616,27 @@ class ZonalShift { /// existing comment string. final String comment; - /// The expiry time (expiration time) for the zonal shift. A zonal shift is - /// temporary and must be set to expire when you start the zonal shift. You can - /// initially set a zonal shift to expire in a maximum of three days (72 hours). - /// However, you can update a zonal shift to set a new expiration at any time. + /// The expiry time (expiration time) for a customer-started zonal shift. A + /// zonal shift is temporary and must be set to expire when you start the zonal + /// shift. You can initially set a zonal shift to expire in a maximum of three + /// days (72 hours). However, you can update a zonal shift to set a new + /// expiration at any time. /// /// When you start a zonal shift, you specify how long you want it to be active, /// which Route 53 ARC converts to an expiry time (expiration time). You can - /// cancel a zonal shift, for example, if you're ready to restore traffic to the - /// Availability Zone. Or you can update the zonal shift to specify another - /// length of time to expire in. + /// cancel a zonal shift when you're ready to restore traffic to the + /// Availability Zone, or just wait for it to expire. Or you can update the + /// zonal shift to specify another length of time to expire in. final DateTime expiryTime; - /// The identifier for the resource to include in a zonal shift. The identifier - /// is the Amazon Resource Name (ARN) for the resource. + /// The identifier for the resource to shift away traffic for. The identifier is + /// the Amazon Resource Name (ARN) for the resource. /// - /// At this time, you can only start a zonal shift for Network Load Balancers - /// and Application Load Balancers with cross-zone load balancing turned off. + /// At this time, supported resources are Network Load Balancers and Application + /// Load Balancers with cross-zone load balancing turned off. final String resourceIdentifier; - /// The time (UTC) when the zonal shift is started. + /// The time (UTC) when the zonal shift starts. final DateTime startTime; /// A status for a zonal shift. @@ -631,7 +1646,7 @@ class ZonalShift { /// ///
          ///
        • - /// ACTIVE: The zonal shift is started and active. + /// ACTIVE: The zonal shift has been started and active. ///
        • ///
        • /// EXPIRED: The zonal shift has expired (the expiry time was exceeded). @@ -690,14 +1705,30 @@ class ZonalShift { /// A complex structure that lists the zonal shifts for a managed resource and /// their statuses for the resource. class ZonalShiftInResource { - /// An appliedStatus for a zonal shift for a resource can have one - /// of two values: APPLIED or NOT_APPLIED. + /// The appliedStatus field specifies which application traffic + /// shift is in effect for a resource when there is more than one traffic shift + /// active. There can be more than one application traffic shift in progress at + /// the same time - that is, practice run zonal shifts, customer-started zonal + /// shifts, or an autoshift. The appliedStatus field for an + /// autoshift for a resource can have one of two values: APPLIED or + /// NOT_APPLIED. The zonal shift or autoshift that is currently in + /// effect for the resource has an applied status set to APPLIED. + /// + /// The overall principle for precedence is that zonal shifts that you start as + /// a customer take precedence autoshifts, which take precedence over practice + /// runs. That is, customer-started zonal shifts > autoshifts > practice + /// run zonal shifts. + /// + /// For more information, see How + /// zonal autoshift and practice runs work in the Amazon Route 53 + /// Application Recovery Controller Developer Guide. final AppliedStatus appliedStatus; /// The Availability Zone that traffic is moved away from for a resource when /// you start a zonal shift. Until the zonal shift expires or you cancel it, /// traffic for the resource is instead moved to other Availability Zones in the - /// AWS Region. + /// Amazon Web Services Region. final String awayFrom; /// A comment that you enter about the zonal shift. Only the latest comment is @@ -705,16 +1736,17 @@ class ZonalShiftInResource { /// overwrites any existing comment string. final String comment; - /// The expiry time (expiration time) for the zonal shift. A zonal shift is - /// temporary and must be set to expire when you start the zonal shift. You can - /// initially set a zonal shift to expire in a maximum of three days (72 hours). - /// However, you can update a zonal shift to set a new expiration at any time. + /// The expiry time (expiration time) for a customer-started zonal shift. A + /// zonal shift is temporary and must be set to expire when you start the zonal + /// shift. You can initially set a zonal shift to expire in a maximum of three + /// days (72 hours). However, you can update a zonal shift to set a new + /// expiration at any time. /// /// When you start a zonal shift, you specify how long you want it to be active, /// which Route 53 ARC converts to an expiry time (expiration time). You can - /// cancel a zonal shift, for example, if you're ready to restore traffic to the - /// Availability Zone. Or you can update the zonal shift to specify another - /// length of time to expire in. + /// cancel a zonal shift when you're ready to restore traffic to the + /// Availability Zone, or just wait for it to expire. Or you can update the + /// zonal shift to specify another length of time to expire in. final DateTime expiryTime; /// The identifier for the resource to include in a zonal shift. The identifier @@ -724,12 +1756,42 @@ class ZonalShiftInResource { /// and Application Load Balancers with cross-zone load balancing turned off. final String resourceIdentifier; - /// The time (UTC) when the zonal shift is started. + /// The time (UTC) when the zonal shift starts. final DateTime startTime; /// The identifier of a zonal shift. final String zonalShiftId; + /// The outcome, or end state, returned for a practice run. The following values + /// can be returned: + /// + ///
            + ///
          • + /// PENDING: Outcome value when a practice run is in progress. + ///
          • + ///
          • + /// SUCCEEDED: Outcome value when the outcome alarm specified for the + /// practice run configuration does not go into an ALARM state + /// during the practice run, and the practice run was not interrupted before it + /// completed the expected 30 minute zonal shift. + ///
          • + ///
          • + /// INTERRUPTED: Outcome value when the practice run was stopped before + /// the expected 30 minute zonal shift duration, or there was another problem + /// with the practice run that created an inconclusive outcome. + ///
          • + ///
          • + /// FAILED: Outcome value when the outcome alarm specified for the + /// practice run configuration goes into an ALARM state during the + /// practice run, and the practice run was not interrupted before it completed. + ///
          • + ///
          + /// For more information about practice run outcomes, see + /// Considerations when you configure zonal autoshift in the Amazon Route 53 + /// Application Recovery Controller Developer Guide. + final PracticeRunOutcome? practiceRunOutcome; + ZonalShiftInResource({ required this.appliedStatus, required this.awayFrom, @@ -738,6 +1800,7 @@ class ZonalShiftInResource { required this.resourceIdentifier, required this.startTime, required this.zonalShiftId, + this.practiceRunOutcome, }); factory ZonalShiftInResource.fromJson(Map json) { @@ -749,6 +1812,8 @@ class ZonalShiftInResource { resourceIdentifier: json['resourceIdentifier'] as String, startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), zonalShiftId: json['zonalShiftId'] as String, + practiceRunOutcome: + (json['practiceRunOutcome'] as String?)?.toPracticeRunOutcome(), ); } @@ -760,6 +1825,7 @@ class ZonalShiftInResource { final resourceIdentifier = this.resourceIdentifier; final startTime = this.startTime; final zonalShiftId = this.zonalShiftId; + final practiceRunOutcome = this.practiceRunOutcome; return { 'appliedStatus': appliedStatus.toValue(), 'awayFrom': awayFrom, @@ -768,6 +1834,8 @@ class ZonalShiftInResource { 'resourceIdentifier': resourceIdentifier, 'startTime': unixTimestampToJson(startTime), 'zonalShiftId': zonalShiftId, + if (practiceRunOutcome != null) + 'practiceRunOutcome': practiceRunOutcome.toValue(), }; } } @@ -805,27 +1873,20 @@ extension ZonalShiftStatusFromString on String { } } -/// You start a zonal shift to temporarily move load balancer traffic away from -/// an Availability Zone in a AWS Region. A zonal shift helps your application -/// recover immediately, for example, from a developer's bad code deployment or -/// from an AWS infrastructure failure in a single Availability Zone. You can -/// start a zonal shift in Route 53 ARC only for managed resources in your -/// account in an AWS Region. Supported AWS resources are automatically -/// registered with Route 53 ARC. +/// Lists information about zonal shifts in Amazon Route 53 Application Recovery +/// Controller, including zonal shifts that you start yourself and zonal shifts +/// that Route 53 ARC starts on your behalf for practice runs with zonal +/// autoshift. /// -/// Zonal shifts are temporary. A zonal shift can be active for up to three days -/// (72 hours). -/// -/// When you start a zonal shift, you specify how long you want it to be active, -/// which Amazon Route 53 Application Recovery Controller converts to an expiry -/// time (expiration time). You can cancel a zonal shift, for example, if you're -/// ready to restore traffic to the Availability Zone. Or you can extend the -/// zonal shift by updating the expiration so the zonal shift is active longer. +/// Zonal shifts are temporary, including customer-started zonal shifts and the +/// zonal autoshift practice run zonal shifts that Route 53 ARC starts weekly, +/// on your behalf. A zonal shift that a customer starts can be active for up to +/// three days (72 hours). A practice run zonal shift has a 30 minute duration. class ZonalShiftSummary { /// The Availability Zone that traffic is moved away from for a resource when /// you start a zonal shift. Until the zonal shift expires or you cancel it, /// traffic for the resource is instead moved to other Availability Zones in the - /// AWS Region. + /// Amazon Web Services Region. final String awayFrom; /// A comment that you enter about the zonal shift. Only the latest comment is @@ -833,16 +1894,17 @@ class ZonalShiftSummary { /// overwrites any existing comment string. final String comment; - /// The expiry time (expiration time) for the zonal shift. A zonal shift is - /// temporary and must be set to expire when you start the zonal shift. You can - /// initially set a zonal shift to expire in a maximum of three days (72 hours). - /// However, you can update a zonal shift to set a new expiration at any time. + /// The expiry time (expiration time) for a customer-started zonal shift. A + /// zonal shift is temporary and must be set to expire when you start the zonal + /// shift. You can initially set a zonal shift to expire in a maximum of three + /// days (72 hours). However, you can update a zonal shift to set a new + /// expiration at any time. /// /// When you start a zonal shift, you specify how long you want it to be active, /// which Route 53 ARC converts to an expiry time (expiration time). You can - /// cancel a zonal shift, for example, if you're ready to restore traffic to the - /// Availability Zone. Or you can update the zonal shift to specify another - /// length of time to expire in. + /// cancel a zonal shift when you're ready to restore traffic to the + /// Availability Zone, or just wait for it to expire. Or you can update the + /// zonal shift to specify another length of time to expire in. final DateTime expiryTime; /// The identifier for the resource to include in a zonal shift. The identifier @@ -852,7 +1914,7 @@ class ZonalShiftSummary { /// and Application Load Balancers with cross-zone load balancing turned off. final String resourceIdentifier; - /// The time (UTC) when the zonal shift is started. + /// The time (UTC) when the zonal shift starts. final DateTime startTime; /// A status for a zonal shift. @@ -862,7 +1924,7 @@ class ZonalShiftSummary { /// ///
            ///
          • - /// ACTIVE: The zonal shift is started and active. + /// ACTIVE: The zonal shift has been started and active. ///
          • ///
          • /// EXPIRED: The zonal shift has expired (the expiry time was exceeded). @@ -876,6 +1938,36 @@ class ZonalShiftSummary { /// The identifier of a zonal shift. final String zonalShiftId; + /// The outcome, or end state, of a practice run. The following values can be + /// returned: + /// + ///
              + ///
            • + /// PENDING: Outcome value when the practice run is in progress. + ///
            • + ///
            • + /// SUCCEEDED: Outcome value when the outcome alarm specified for the + /// practice run configuration does not go into an ALARM state + /// during the practice run, and the practice run was not interrupted before it + /// completed. + ///
            • + ///
            • + /// INTERRUPTED: Outcome value when the practice run did not run for the + /// expected 30 minutes or there was another problem with the practice run that + /// created an inconclusive outcome. + ///
            • + ///
            • + /// FAILED: Outcome value when the outcome alarm specified for the + /// practice run configuration goes into an ALARM state during the + /// practice run, and the practice run was not interrupted before it completed. + ///
            • + ///
            + /// For more information about practice run outcomes, see + /// Considerations when you configure zonal autoshift in the Amazon Route 53 + /// Application Recovery Controller Developer Guide. + final PracticeRunOutcome? practiceRunOutcome; + ZonalShiftSummary({ required this.awayFrom, required this.comment, @@ -884,6 +1976,7 @@ class ZonalShiftSummary { required this.startTime, required this.status, required this.zonalShiftId, + this.practiceRunOutcome, }); factory ZonalShiftSummary.fromJson(Map json) { @@ -895,6 +1988,8 @@ class ZonalShiftSummary { startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), status: (json['status'] as String).toZonalShiftStatus(), zonalShiftId: json['zonalShiftId'] as String, + practiceRunOutcome: + (json['practiceRunOutcome'] as String?)?.toPracticeRunOutcome(), ); } @@ -906,6 +2001,7 @@ class ZonalShiftSummary { final startTime = this.startTime; final status = this.status; final zonalShiftId = this.zonalShiftId; + final practiceRunOutcome = this.practiceRunOutcome; return { 'awayFrom': awayFrom, 'comment': comment, @@ -914,6 +2010,8 @@ class ZonalShiftSummary { 'startTime': unixTimestampToJson(startTime), 'status': status.toValue(), 'zonalShiftId': zonalShiftId, + if (practiceRunOutcome != null) + 'practiceRunOutcome': practiceRunOutcome.toValue(), }; } } diff --git a/aws_client/lib/src/generated/artifact/v2018_05_10.dart b/aws_client/lib/src/generated/artifact/v2018_05_10.dart new file mode 100644 index 000000000..83b15a6b1 --- /dev/null +++ b/aws_client/lib/src/generated/artifact/v2018_05_10.dart @@ -0,0 +1,893 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// This reference provides descriptions of the low-level AWS Artifact Service +/// API. +class Artifact { + final _s.RestJsonProtocol _protocol; + Artifact({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'artifact', + signingName: 'artifact', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Get the account settings for Artifact. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + Future getAccountSettings() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/account-settings/get', + exceptionFnMap: _exceptionFns, + ); + return GetAccountSettingsResponse.fromJson(response); + } + + /// Get the content for a single report. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [reportId] : + /// Unique resource ID for the report resource. + /// + /// Parameter [termToken] : + /// Unique download token provided by GetTermForReport API. + /// + /// Parameter [reportVersion] : + /// Version for the report resource. + Future getReport({ + required String reportId, + required String termToken, + int? reportVersion, + }) async { + _s.validateNumRange( + 'reportVersion', + reportVersion, + 1, + 1152921504606846976, + ); + final $query = >{ + 'reportId': [reportId], + 'termToken': [termToken], + if (reportVersion != null) 'reportVersion': [reportVersion.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/report/get', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetReportResponse.fromJson(response); + } + + /// Get the metadata for a single report. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [reportId] : + /// Unique resource ID for the report resource. + /// + /// Parameter [reportVersion] : + /// Version for the report resource. + Future getReportMetadata({ + required String reportId, + int? reportVersion, + }) async { + _s.validateNumRange( + 'reportVersion', + reportVersion, + 1, + 1152921504606846976, + ); + final $query = >{ + 'reportId': [reportId], + if (reportVersion != null) 'reportVersion': [reportVersion.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/report/getMetadata', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetReportMetadataResponse.fromJson(response); + } + + /// Get the Term content associated with a single report. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [reportId] : + /// Unique resource ID for the report resource. + /// + /// Parameter [reportVersion] : + /// Version for the report resource. + Future getTermForReport({ + required String reportId, + int? reportVersion, + }) async { + _s.validateNumRange( + 'reportVersion', + reportVersion, + 1, + 1152921504606846976, + ); + final $query = >{ + 'reportId': [reportId], + if (reportVersion != null) 'reportVersion': [reportVersion.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/report/getTermForReport', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetTermForReportResponse.fromJson(response); + } + + /// List available reports. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [maxResults] : + /// Maximum number of resources to return in the paginated response. + /// + /// Parameter [nextToken] : + /// Pagination token to request the next page of resources. + Future listReports({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 300, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/report/list', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListReportsResponse.fromJson(response); + } + + /// Put the account settings for Artifact. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [notificationSubscriptionStatus] : + /// Desired notification subscription status. + Future putAccountSettings({ + NotificationSubscriptionStatus? notificationSubscriptionStatus, + }) async { + final $payload = { + if (notificationSubscriptionStatus != null) + 'notificationSubscriptionStatus': + notificationSubscriptionStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/v1/account-settings/put', + exceptionFnMap: _exceptionFns, + ); + return PutAccountSettingsResponse.fromJson(response); + } +} + +enum AcceptanceType { + passthrough, + explicit, +} + +extension AcceptanceTypeValueExtension on AcceptanceType { + String toValue() { + switch (this) { + case AcceptanceType.passthrough: + return 'PASSTHROUGH'; + case AcceptanceType.explicit: + return 'EXPLICIT'; + } + } +} + +extension AcceptanceTypeFromString on String { + AcceptanceType toAcceptanceType() { + switch (this) { + case 'PASSTHROUGH': + return AcceptanceType.passthrough; + case 'EXPLICIT': + return AcceptanceType.explicit; + } + throw Exception('$this is not known in enum AcceptanceType'); + } +} + +/// Account settings for the customer. +class AccountSettings { + /// Notification subscription status of the customer. + final NotificationSubscriptionStatus? notificationSubscriptionStatus; + + AccountSettings({ + this.notificationSubscriptionStatus, + }); + + factory AccountSettings.fromJson(Map json) { + return AccountSettings( + notificationSubscriptionStatus: + (json['notificationSubscriptionStatus'] as String?) + ?.toNotificationSubscriptionStatus(), + ); + } + + Map toJson() { + final notificationSubscriptionStatus = this.notificationSubscriptionStatus; + return { + if (notificationSubscriptionStatus != null) + 'notificationSubscriptionStatus': + notificationSubscriptionStatus.toValue(), + }; + } +} + +class GetAccountSettingsResponse { + final AccountSettings? accountSettings; + + GetAccountSettingsResponse({ + this.accountSettings, + }); + + factory GetAccountSettingsResponse.fromJson(Map json) { + return GetAccountSettingsResponse( + accountSettings: json['accountSettings'] != null + ? AccountSettings.fromJson( + json['accountSettings'] as Map) + : null, + ); + } + + Map toJson() { + final accountSettings = this.accountSettings; + return { + if (accountSettings != null) 'accountSettings': accountSettings, + }; + } +} + +class GetReportMetadataResponse { + /// Report resource detail. + final ReportDetail? reportDetails; + + GetReportMetadataResponse({ + this.reportDetails, + }); + + factory GetReportMetadataResponse.fromJson(Map json) { + return GetReportMetadataResponse( + reportDetails: json['reportDetails'] != null + ? ReportDetail.fromJson(json['reportDetails'] as Map) + : null, + ); + } + + Map toJson() { + final reportDetails = this.reportDetails; + return { + if (reportDetails != null) 'reportDetails': reportDetails, + }; + } +} + +class GetReportResponse { + /// Presigned S3 url to access the report content. + final String? documentPresignedUrl; + + GetReportResponse({ + this.documentPresignedUrl, + }); + + factory GetReportResponse.fromJson(Map json) { + return GetReportResponse( + documentPresignedUrl: json['documentPresignedUrl'] as String?, + ); + } + + Map toJson() { + final documentPresignedUrl = this.documentPresignedUrl; + return { + if (documentPresignedUrl != null) + 'documentPresignedUrl': documentPresignedUrl, + }; + } +} + +class GetTermForReportResponse { + /// Presigned S3 url to access the term content. + final String? documentPresignedUrl; + + /// Unique token representing this request event. + final String? termToken; + + GetTermForReportResponse({ + this.documentPresignedUrl, + this.termToken, + }); + + factory GetTermForReportResponse.fromJson(Map json) { + return GetTermForReportResponse( + documentPresignedUrl: json['documentPresignedUrl'] as String?, + termToken: json['termToken'] as String?, + ); + } + + Map toJson() { + final documentPresignedUrl = this.documentPresignedUrl; + final termToken = this.termToken; + return { + if (documentPresignedUrl != null) + 'documentPresignedUrl': documentPresignedUrl, + if (termToken != null) 'termToken': termToken, + }; + } +} + +class ListReportsResponse { + /// Pagination token to request the next page of resources. + final String? nextToken; + + /// List of report resources. + final List? reports; + + ListReportsResponse({ + this.nextToken, + this.reports, + }); + + factory ListReportsResponse.fromJson(Map json) { + return ListReportsResponse( + nextToken: json['nextToken'] as String?, + reports: (json['reports'] as List?) + ?.whereNotNull() + .map((e) => ReportSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final reports = this.reports; + return { + if (nextToken != null) 'nextToken': nextToken, + if (reports != null) 'reports': reports, + }; + } +} + +enum NotificationSubscriptionStatus { + subscribed, + notSubscribed, +} + +extension NotificationSubscriptionStatusValueExtension + on NotificationSubscriptionStatus { + String toValue() { + switch (this) { + case NotificationSubscriptionStatus.subscribed: + return 'SUBSCRIBED'; + case NotificationSubscriptionStatus.notSubscribed: + return 'NOT_SUBSCRIBED'; + } + } +} + +extension NotificationSubscriptionStatusFromString on String { + NotificationSubscriptionStatus toNotificationSubscriptionStatus() { + switch (this) { + case 'SUBSCRIBED': + return NotificationSubscriptionStatus.subscribed; + case 'NOT_SUBSCRIBED': + return NotificationSubscriptionStatus.notSubscribed; + } + throw Exception( + '$this is not known in enum NotificationSubscriptionStatus'); + } +} + +enum PublishedState { + published, + unpublished, +} + +extension PublishedStateValueExtension on PublishedState { + String toValue() { + switch (this) { + case PublishedState.published: + return 'PUBLISHED'; + case PublishedState.unpublished: + return 'UNPUBLISHED'; + } + } +} + +extension PublishedStateFromString on String { + PublishedState toPublishedState() { + switch (this) { + case 'PUBLISHED': + return PublishedState.published; + case 'UNPUBLISHED': + return PublishedState.unpublished; + } + throw Exception('$this is not known in enum PublishedState'); + } +} + +class PutAccountSettingsResponse { + final AccountSettings? accountSettings; + + PutAccountSettingsResponse({ + this.accountSettings, + }); + + factory PutAccountSettingsResponse.fromJson(Map json) { + return PutAccountSettingsResponse( + accountSettings: json['accountSettings'] != null + ? AccountSettings.fromJson( + json['accountSettings'] as Map) + : null, + ); + } + + Map toJson() { + final accountSettings = this.accountSettings; + return { + if (accountSettings != null) 'accountSettings': accountSettings, + }; + } +} + +/// Full detail for report resource metadata. +class ReportDetail { + /// Acceptance type for report. + final AcceptanceType? acceptanceType; + + /// ARN for the report resource. + final String? arn; + + /// Category for the report resource. + final String? category; + + /// Associated company name for the report resource. + final String? companyName; + + /// Timestamp indicating when the report resource was created. + final DateTime? createdAt; + + /// Timestamp indicating when the report resource was deleted. + final DateTime? deletedAt; + + /// Description for the report resource. + final String? description; + + /// Unique resource ID for the report resource. + final String? id; + + /// Timestamp indicating when the report resource was last modified. + final DateTime? lastModifiedAt; + + /// Name for the report resource. + final String? name; + + /// Timestamp indicating the report resource effective end. + final DateTime? periodEnd; + + /// Timestamp indicating the report resource effective start. + final DateTime? periodStart; + + /// Associated product name for the report resource. + final String? productName; + + /// Sequence number to enforce optimistic locking. + final int? sequenceNumber; + + /// Series for the report resource. + final String? series; + + /// Current state of the report resource + final PublishedState? state; + + /// The message associated with the current upload state. + final String? statusMessage; + + /// Unique resource ARN for term resource. + final String? termArn; + + /// The current state of the document upload. + final UploadState? uploadState; + + /// Version for the report resource. + final int? version; + + ReportDetail({ + this.acceptanceType, + this.arn, + this.category, + this.companyName, + this.createdAt, + this.deletedAt, + this.description, + this.id, + this.lastModifiedAt, + this.name, + this.periodEnd, + this.periodStart, + this.productName, + this.sequenceNumber, + this.series, + this.state, + this.statusMessage, + this.termArn, + this.uploadState, + this.version, + }); + + factory ReportDetail.fromJson(Map json) { + return ReportDetail( + acceptanceType: (json['acceptanceType'] as String?)?.toAcceptanceType(), + arn: json['arn'] as String?, + category: json['category'] as String?, + companyName: json['companyName'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + deletedAt: timeStampFromJson(json['deletedAt']), + description: json['description'] as String?, + id: json['id'] as String?, + lastModifiedAt: timeStampFromJson(json['lastModifiedAt']), + name: json['name'] as String?, + periodEnd: timeStampFromJson(json['periodEnd']), + periodStart: timeStampFromJson(json['periodStart']), + productName: json['productName'] as String?, + sequenceNumber: json['sequenceNumber'] as int?, + series: json['series'] as String?, + state: (json['state'] as String?)?.toPublishedState(), + statusMessage: json['statusMessage'] as String?, + termArn: json['termArn'] as String?, + uploadState: (json['uploadState'] as String?)?.toUploadState(), + version: json['version'] as int?, + ); + } + + Map toJson() { + final acceptanceType = this.acceptanceType; + final arn = this.arn; + final category = this.category; + final companyName = this.companyName; + final createdAt = this.createdAt; + final deletedAt = this.deletedAt; + final description = this.description; + final id = this.id; + final lastModifiedAt = this.lastModifiedAt; + final name = this.name; + final periodEnd = this.periodEnd; + final periodStart = this.periodStart; + final productName = this.productName; + final sequenceNumber = this.sequenceNumber; + final series = this.series; + final state = this.state; + final statusMessage = this.statusMessage; + final termArn = this.termArn; + final uploadState = this.uploadState; + final version = this.version; + return { + if (acceptanceType != null) 'acceptanceType': acceptanceType.toValue(), + if (arn != null) 'arn': arn, + if (category != null) 'category': category, + if (companyName != null) 'companyName': companyName, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (deletedAt != null) 'deletedAt': iso8601ToJson(deletedAt), + if (description != null) 'description': description, + if (id != null) 'id': id, + if (lastModifiedAt != null) + 'lastModifiedAt': iso8601ToJson(lastModifiedAt), + if (name != null) 'name': name, + if (periodEnd != null) 'periodEnd': iso8601ToJson(periodEnd), + if (periodStart != null) 'periodStart': iso8601ToJson(periodStart), + if (productName != null) 'productName': productName, + if (sequenceNumber != null) 'sequenceNumber': sequenceNumber, + if (series != null) 'series': series, + if (state != null) 'state': state.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (termArn != null) 'termArn': termArn, + if (uploadState != null) 'uploadState': uploadState.toValue(), + if (version != null) 'version': version, + }; + } +} + +/// Summary for report resource. +class ReportSummary { + /// ARN for the report resource. + final String? arn; + + /// Category for the report resource. + final String? category; + + /// Associated company name for the report resource. + final String? companyName; + + /// Description for the report resource. + final String? description; + + /// Unique resource ID for the report resource. + final String? id; + + /// Name for the report resource. + final String? name; + + /// Timestamp indicating the report resource effective end. + final DateTime? periodEnd; + + /// Timestamp indicating the report resource effective start. + final DateTime? periodStart; + + /// Associated product name for the report resource. + final String? productName; + + /// Series for the report resource. + final String? series; + + /// Current state of the report resource. + final PublishedState? state; + + /// The message associated with the current upload state. + final String? statusMessage; + + /// The current state of the document upload. + final UploadState? uploadState; + + /// Version for the report resource. + final int? version; + + ReportSummary({ + this.arn, + this.category, + this.companyName, + this.description, + this.id, + this.name, + this.periodEnd, + this.periodStart, + this.productName, + this.series, + this.state, + this.statusMessage, + this.uploadState, + this.version, + }); + + factory ReportSummary.fromJson(Map json) { + return ReportSummary( + arn: json['arn'] as String?, + category: json['category'] as String?, + companyName: json['companyName'] as String?, + description: json['description'] as String?, + id: json['id'] as String?, + name: json['name'] as String?, + periodEnd: timeStampFromJson(json['periodEnd']), + periodStart: timeStampFromJson(json['periodStart']), + productName: json['productName'] as String?, + series: json['series'] as String?, + state: (json['state'] as String?)?.toPublishedState(), + statusMessage: json['statusMessage'] as String?, + uploadState: (json['uploadState'] as String?)?.toUploadState(), + version: json['version'] as int?, + ); + } + + Map toJson() { + final arn = this.arn; + final category = this.category; + final companyName = this.companyName; + final description = this.description; + final id = this.id; + final name = this.name; + final periodEnd = this.periodEnd; + final periodStart = this.periodStart; + final productName = this.productName; + final series = this.series; + final state = this.state; + final statusMessage = this.statusMessage; + final uploadState = this.uploadState; + final version = this.version; + return { + if (arn != null) 'arn': arn, + if (category != null) 'category': category, + if (companyName != null) 'companyName': companyName, + if (description != null) 'description': description, + if (id != null) 'id': id, + if (name != null) 'name': name, + if (periodEnd != null) 'periodEnd': iso8601ToJson(periodEnd), + if (periodStart != null) 'periodStart': iso8601ToJson(periodStart), + if (productName != null) 'productName': productName, + if (series != null) 'series': series, + if (state != null) 'state': state.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (uploadState != null) 'uploadState': uploadState.toValue(), + if (version != null) 'version': version, + }; + } +} + +enum UploadState { + processing, + complete, + failed, + fault, +} + +extension UploadStateValueExtension on UploadState { + String toValue() { + switch (this) { + case UploadState.processing: + return 'PROCESSING'; + case UploadState.complete: + return 'COMPLETE'; + case UploadState.failed: + return 'FAILED'; + case UploadState.fault: + return 'FAULT'; + } + } +} + +extension UploadStateFromString on String { + UploadState toUploadState() { + switch (this) { + case 'PROCESSING': + return UploadState.processing; + case 'COMPLETE': + return UploadState.complete; + case 'FAILED': + return UploadState.failed; + case 'FAULT': + return UploadState.fault; + } + throw Exception('$this is not known in enum UploadState'); + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/athena/v2017_05_18.dart b/aws_client/lib/src/generated/athena/v2017_05_18.dart index 0164c9c55..89e2128e5 100644 --- a/aws_client/lib/src/generated/athena/v2017_05_18.dart +++ b/aws_client/lib/src/generated/athena/v2017_05_18.dart @@ -34,10 +34,6 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// support the API. For more information and to download the driver, see Accessing /// Amazon Athena with JDBC. -/// -/// For code samples using the Amazon Web Services SDK for Java, see Examples -/// and Code Samples in the Amazon Athena User Guide. class Athena { final _s.JsonProtocol _protocol; Athena({ @@ -175,7 +171,11 @@ class Athena { return BatchGetQueryExecutionOutput.fromJson(jsonResponse.body); } - /// Cancels the capacity reservation with the specified name. + /// Cancels the capacity reservation with the specified name. Cancelled + /// reservations remain in your account and will be deleted 45 days after + /// cancellation. During the 45 days, you cannot re-purpose or reuse a + /// reservation that has been cancelled, but you can refer to its tags and + /// view it for historical reference. /// /// May throw [InvalidRequestException]. /// May throw [InternalServerException]. @@ -313,14 +313,6 @@ class Athena { /// AwsDataCatalog that already exists in your account, of which /// you can have only one and cannot modify. ///
          • - ///
          • - /// Queries that specify a Glue Data Catalog other than the default - /// AwsDataCatalog must be run on Athena engine version 2. - ///
          • - ///
          • - /// In Regions where Athena engine version 2 is not available, creating new - /// Glue data catalogs results in an INVALID_INPUT error. - ///
          • ///
        • ///
        /// @@ -356,10 +348,6 @@ class Athena { /// Creates a named query in the specified workgroup. Requires that you have /// access to the workgroup. /// - /// For code samples using the Amazon Web Services SDK for Java, see Examples - /// and Code Samples in the Amazon Athena User Guide. - /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. /// @@ -600,6 +588,37 @@ class Athena { ); } + /// Deletes a cancelled capacity reservation. A reservation must be cancelled + /// before it can be deleted. A deleted reservation is immediately removed + /// from your account and can no longer be referenced, including by its ARN. A + /// deleted reservation cannot be called by + /// GetCapacityReservation, and deleted reservations do not + /// appear in the output of ListCapacityReservations. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalServerException]. + /// + /// Parameter [name] : + /// The name of the capacity reservation to delete. + Future deleteCapacityReservation({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonAthena.DeleteCapacityReservation' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + }, + ); + } + /// Deletes a data catalog. /// /// May throw [InternalServerException]. @@ -629,10 +648,6 @@ class Athena { /// Deletes the named query if you have access to the workgroup in which the /// query was saved. /// - /// For code samples using the Amazon Web Services SDK for Java, see Examples - /// and Code Samples in the Amazon Athena User Guide. - /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. /// @@ -934,8 +949,13 @@ class Athena { /// /// Parameter [name] : /// The name of the data catalog to return. + /// + /// Parameter [workGroup] : + /// The name of the workgroup. Required if making an IAM Identity Center + /// request. Future getDataCatalog({ required String name, + String? workGroup, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -949,6 +969,7 @@ class Athena { headers: headers, payload: { 'Name': name, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -966,9 +987,14 @@ class Athena { /// /// Parameter [databaseName] : /// The name of the database to return. + /// + /// Parameter [workGroup] : + /// The name of the workgroup for which the metadata is being fetched. + /// Required if requesting an IAM Identity Center enabled Glue Data Catalog. Future getDatabase({ required String catalogName, required String databaseName, + String? workGroup, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -983,6 +1009,7 @@ class Athena { payload: { 'CatalogName': catalogName, 'DatabaseName': databaseName, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -1179,10 +1206,13 @@ class Athena { /// Returns query execution runtime statistics related to a single execution /// of a query if you have access to the workgroup in which the query ran. - /// Query execution runtime statistics are returned only when - /// QueryExecutionStatus$State is in a SUCCEEDED or FAILED state. - /// Stage-level input and output row count and data size statistics are not - /// shown when a query has row-level filters defined in Lake Formation. + /// Statistics from the Timeline section of the response object + /// are available as soon as QueryExecutionStatus$State is in a + /// SUCCEEDED or FAILED state. The remaining non-timeline statistics in the + /// response (like stage-level input and output row count and data size) are + /// updated asynchronously and may not be available immediately after a query + /// completes. The non-timeline statistics are also not included when a query + /// has row-level filters defined in Lake Formation. /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. @@ -1284,10 +1314,15 @@ class Athena { /// /// Parameter [tableName] : /// The name of the table for which metadata is returned. + /// + /// Parameter [workGroup] : + /// The name of the workgroup for which the metadata is being fetched. + /// Required if requesting an IAM Identity Center enabled Glue Data Catalog. Future getTableMetadata({ required String catalogName, required String databaseName, required String tableName, + String? workGroup, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1303,6 +1338,7 @@ class Athena { 'CatalogName': catalogName, 'DatabaseName': databaseName, 'TableName': tableName, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -1337,8 +1373,11 @@ class Athena { return GetWorkGroupOutput.fromJson(jsonResponse.body); } - /// Imports a single ipynb file to a Spark enabled workgroup. The - /// maximum file size that can be imported is 10 megabytes. If an + /// Imports a single ipynb file to a Spark enabled workgroup. To + /// import the notebook, the request must specify a value for either + /// Payload or NoteBookS3LocationUri. If neither is + /// specified or both are specified, an InvalidRequestException + /// occurs. The maximum file size that can be imported is 10 megabytes. If an /// ipynb file with the same name already exists in the /// workgroup, throws an error. /// @@ -1349,9 +1388,6 @@ class Athena { /// Parameter [name] : /// The name of the notebook to import. /// - /// Parameter [payload] : - /// The notebook content to be imported. - /// /// Parameter [type] : /// The notebook content type. Currently, the only valid type is /// IPYNB. @@ -1368,12 +1404,21 @@ class Athena { /// you. If you are not using the Amazon Web Services SDK or the Amazon Web /// Services CLI, you must provide this token or the action will fail. /// + /// + /// Parameter [notebookS3LocationUri] : + /// A URI that specifies the Amazon S3 location of a notebook file in + /// ipynb format. + /// + /// Parameter [payload] : + /// The notebook content to be imported. The payload must be in + /// ipynb format. Future importNotebook({ required String name, - required String payload, required NotebookType type, required String workGroup, String? clientRequestToken, + String? notebookS3LocationUri, + String? payload, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1387,11 +1432,13 @@ class Athena { headers: headers, payload: { 'Name': name, - 'Payload': payload, 'Type': type.toValue(), 'WorkGroup': workGroup, if (clientRequestToken != null) 'ClientRequestToken': clientRequestToken, + if (notebookS3LocationUri != null) + 'NotebookS3LocationUri': notebookS3LocationUri, + if (payload != null) 'Payload': payload, }, ); @@ -1573,9 +1620,14 @@ class Athena { /// pagination if a previous request was truncated. To obtain the next set of /// pages, pass in the NextToken from the response object of the previous page /// call. + /// + /// Parameter [workGroup] : + /// The name of the workgroup. Required if making an IAM Identity Center + /// request. Future listDataCatalogs({ int? maxResults, String? nextToken, + String? workGroup, }) async { _s.validateNumRange( 'maxResults', @@ -1596,6 +1648,7 @@ class Athena { payload: { if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -1619,10 +1672,15 @@ class Athena { /// pagination if a previous request was truncated. To obtain the next set of /// pages, pass in the NextToken from the response object of the /// previous page call. + /// + /// Parameter [workGroup] : + /// The name of the workgroup for which the metadata is being fetched. + /// Required if requesting an IAM Identity Center enabled Glue Data Catalog. Future listDatabases({ required String catalogName, int? maxResults, String? nextToken, + String? workGroup, }) async { _s.validateNumRange( 'maxResults', @@ -1644,6 +1702,7 @@ class Athena { 'CatalogName': catalogName, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -1769,10 +1828,6 @@ class Athena { /// workgroup. If a workgroup is not specified, lists the saved queries for /// the primary workgroup. /// - /// For code samples using the Amazon Web Services SDK for Java, see Examples - /// and Code Samples in the Amazon Athena User Guide. - /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. /// @@ -1971,13 +2026,10 @@ class Athena { } /// Provides a list of available query execution IDs for the queries in the - /// specified workgroup. If a workgroup is not specified, returns a list of - /// query execution IDs for the primary workgroup. Requires you to have access - /// to the workgroup in which the queries ran. - /// - /// For code samples using the Amazon Web Services SDK for Java, see Examples - /// and Code Samples in the Amazon Athena User Guide. + /// specified workgroup. Athena keeps a query history for 45 days. If a + /// workgroup is not specified, returns a list of query execution IDs for the + /// primary workgroup. Requires you to have access to the workgroup in which + /// the queries ran. /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. @@ -2127,12 +2179,17 @@ class Athena { /// pagination if a previous request was truncated. To obtain the next set of /// pages, pass in the NextToken from the response object of the previous page /// call. + /// + /// Parameter [workGroup] : + /// The name of the workgroup for which the metadata is being fetched. + /// Required if requesting an IAM Identity Center enabled Glue Data Catalog. Future listTableMetadata({ required String catalogName, required String databaseName, String? expression, int? maxResults, String? nextToken, + String? workGroup, }) async { _s.validateNumRange( 'maxResults', @@ -2156,6 +2213,7 @@ class Athena { if (expression != null) 'Expression': expression, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, + if (workGroup != null) 'WorkGroup': workGroup, }, ); @@ -2289,6 +2347,13 @@ class Athena { /// Submits calculations for execution within a session. You can supply the /// code to run as an inline code block within the request. + /// + /// The request syntax requires the + /// StartCalculationExecutionRequest$CodeBlock parameter or the + /// CalculationConfiguration$CodeBlock parameter, but not both. Because + /// CalculationConfiguration$CodeBlock is deprecated, use the + /// StartCalculationExecutionRequest$CodeBlock parameter instead. + /// /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. @@ -2314,7 +2379,8 @@ class Athena { /// /// /// Parameter [codeBlock] : - /// A string that contains the code of the calculation. + /// A string that contains the code of the calculation. Use this parameter + /// instead of CalculationConfiguration$CodeBlock, which is deprecated. /// /// Parameter [description] : /// A description of the calculation. @@ -2368,8 +2434,12 @@ class Athena { /// A unique case-sensitive string used to ensure the request to create the /// query is idempotent (executes only once). If another /// StartQueryExecution request is received, the same response is - /// returned and another query is not created. If a parameter has changed, for - /// example, the QueryString, an error is returned. + /// returned and another query is not created. An error is returned if a + /// parameter, such as QueryString, has changed. A call to + /// StartQueryExecution that uses a previous client request token + /// returns the same QueryExecutionId even if the requester + /// doesn't have permission on the tables specified in + /// QueryString. /// /// This token is listed as not required because Amazon Web Services SDKs (for /// example the Amazon Web Services SDK for Java) auto-generate the token for @@ -2559,10 +2629,6 @@ class Athena { /// Stops a query execution. Requires you to have access to the workgroup in /// which the query ran. /// - /// For code samples using the Amazon Web Services SDK for Java, see Examples - /// and Code Samples in the Amazon Athena User Guide. - /// /// May throw [InternalServerException]. /// May throw [InvalidRequestException]. /// @@ -3177,6 +3243,29 @@ class AthenaError { } } +enum AuthenticationType { + directoryIdentity, +} + +extension AuthenticationTypeValueExtension on AuthenticationType { + String toValue() { + switch (this) { + case AuthenticationType.directoryIdentity: + return 'DIRECTORY_IDENTITY'; + } + } +} + +extension AuthenticationTypeFromString on String { + AuthenticationType toAuthenticationType() { + switch (this) { + case 'DIRECTORY_IDENTITY': + return AuthenticationType.directoryIdentity; + } + throw Exception('$this is not known in enum AuthenticationType'); + } +} + class BatchGetNamedQueryOutput { /// Information about the named query IDs submitted. final List? namedQueries; @@ -3881,7 +3970,7 @@ class ColumnInfo { /// A column label. final String? label; - /// Indicates the column's nullable status. + /// Unsupported constraint. This value always shows as UNKNOWN. final ColumnNullable? nullable; /// For DECIMAL data types, specifies the total number of digits, @@ -4115,10 +4204,12 @@ class CreateWorkGroupOutput { } } -/// Specifies the KMS key that is used to encrypt the user's data stores in -/// Athena. +/// Specifies the customer managed KMS key that is used to encrypt the user's +/// data stores in Athena. When an Amazon Web Services managed key is used, this +/// value is null. This setting does not apply to Athena SQL workgroups. class CustomerContentEncryptionConfiguration { - /// The KMS key that is used to encrypt the user's data stores in Athena. + /// The customer managed KMS key that is used to encrypt the user's data stores + /// in Athena. final String kmsKey; CustomerContentEncryptionConfiguration({ @@ -4206,10 +4297,6 @@ class DataCatalog { /// AwsDataCatalog that already exists in your account, of which /// you can have only one and cannot modify. ///
      • - ///
      • - /// Queries that specify a Glue Data Catalog other than the default - /// AwsDataCatalog must be run on Athena engine version 2. - ///
      • ///
    6. /// final Map? parameters; @@ -4373,6 +4460,18 @@ class Datum { } } +class DeleteCapacityReservationOutput { + DeleteCapacityReservationOutput(); + + factory DeleteCapacityReservationOutput.fromJson(Map _) { + return DeleteCapacityReservationOutput(); + } + + Map toJson() { + return {}; + } +} + class DeleteDataCatalogOutput { DeleteDataCatalogOutput(); @@ -4532,11 +4631,16 @@ class EngineConfiguration { /// is 1. final int? defaultExecutorDpuSize; + /// Specifies custom jar files and Spark properties for use cases like cluster + /// encryption, table formats, and general Spark tuning. + final Map? sparkProperties; + EngineConfiguration({ required this.maxConcurrentDpus, this.additionalConfigs, this.coordinatorDpuSize, this.defaultExecutorDpuSize, + this.sparkProperties, }); factory EngineConfiguration.fromJson(Map json) { @@ -4546,6 +4650,8 @@ class EngineConfiguration { ?.map((k, e) => MapEntry(k, e as String)), coordinatorDpuSize: json['CoordinatorDpuSize'] as int?, defaultExecutorDpuSize: json['DefaultExecutorDpuSize'] as int?, + sparkProperties: (json['SparkProperties'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } @@ -4554,12 +4660,14 @@ class EngineConfiguration { final additionalConfigs = this.additionalConfigs; final coordinatorDpuSize = this.coordinatorDpuSize; final defaultExecutorDpuSize = this.defaultExecutorDpuSize; + final sparkProperties = this.sparkProperties; return { 'MaxConcurrentDpus': maxConcurrentDpus, if (additionalConfigs != null) 'AdditionalConfigs': additionalConfigs, if (coordinatorDpuSize != null) 'CoordinatorDpuSize': coordinatorDpuSize, if (defaultExecutorDpuSize != null) 'DefaultExecutorDpuSize': defaultExecutorDpuSize, + if (sparkProperties != null) 'SparkProperties': sparkProperties, }; } } @@ -5380,6 +5488,38 @@ class GetWorkGroupOutput { } } +/// Specifies whether the workgroup is IAM Identity Center supported. +class IdentityCenterConfiguration { + /// Specifies whether the workgroup is IAM Identity Center supported. + final bool? enableIdentityCenter; + + /// The IAM Identity Center instance ARN that the workgroup associates to. + final String? identityCenterInstanceArn; + + IdentityCenterConfiguration({ + this.enableIdentityCenter, + this.identityCenterInstanceArn, + }); + + factory IdentityCenterConfiguration.fromJson(Map json) { + return IdentityCenterConfiguration( + enableIdentityCenter: json['EnableIdentityCenter'] as bool?, + identityCenterInstanceArn: json['IdentityCenterInstanceArn'] as String?, + ); + } + + Map toJson() { + final enableIdentityCenter = this.enableIdentityCenter; + final identityCenterInstanceArn = this.identityCenterInstanceArn; + return { + if (enableIdentityCenter != null) + 'EnableIdentityCenter': enableIdentityCenter, + if (identityCenterInstanceArn != null) + 'IdentityCenterInstanceArn': identityCenterInstanceArn, + }; + } +} + class ImportNotebookOutput { /// The ID assigned to the imported notebook. final String? notebookId; @@ -6247,7 +6387,7 @@ class QueryExecution { /// A list of values for the parameters in a query. The values are applied /// sequentially to the parameters in the query in the order in which the - /// parameters occur. + /// parameters occur. The list of parameters is not returned in the response. final List? executionParameters; /// The SQL query statements which the query execution ran. @@ -6259,6 +6399,10 @@ class QueryExecution { /// The unique identifier for each query execution. final String? queryExecutionId; + /// Specifies whether Amazon S3 access grants are enabled for query results. + final QueryResultsS3AccessGrantsConfiguration? + queryResultsS3AccessGrantsConfiguration; + /// The location in Amazon S3 where query and calculation results are stored and /// the encryption option, if any, used for query results. These are known as /// "client-side settings". If workgroup settings override client-side settings, @@ -6297,6 +6441,7 @@ class QueryExecution { this.query, this.queryExecutionContext, this.queryExecutionId, + this.queryResultsS3AccessGrantsConfiguration, this.resultConfiguration, this.resultReuseConfiguration, this.statementType, @@ -6322,6 +6467,12 @@ class QueryExecution { json['QueryExecutionContext'] as Map) : null, queryExecutionId: json['QueryExecutionId'] as String?, + queryResultsS3AccessGrantsConfiguration: + json['QueryResultsS3AccessGrantsConfiguration'] != null + ? QueryResultsS3AccessGrantsConfiguration.fromJson( + json['QueryResultsS3AccessGrantsConfiguration'] + as Map) + : null, resultConfiguration: json['ResultConfiguration'] != null ? ResultConfiguration.fromJson( json['ResultConfiguration'] as Map) @@ -6350,6 +6501,8 @@ class QueryExecution { final query = this.query; final queryExecutionContext = this.queryExecutionContext; final queryExecutionId = this.queryExecutionId; + final queryResultsS3AccessGrantsConfiguration = + this.queryResultsS3AccessGrantsConfiguration; final resultConfiguration = this.resultConfiguration; final resultReuseConfiguration = this.resultReuseConfiguration; final statementType = this.statementType; @@ -6365,6 +6518,9 @@ class QueryExecution { if (queryExecutionContext != null) 'QueryExecutionContext': queryExecutionContext, if (queryExecutionId != null) 'QueryExecutionId': queryExecutionId, + if (queryResultsS3AccessGrantsConfiguration != null) + 'QueryResultsS3AccessGrantsConfiguration': + queryResultsS3AccessGrantsConfiguration, if (resultConfiguration != null) 'ResultConfiguration': resultConfiguration, if (resultReuseConfiguration != null) @@ -6487,6 +6643,10 @@ class QueryExecutionStatistics { /// the query. final ResultReuseInformation? resultReuseInformation; + /// The number of milliseconds that Athena took to preprocess the query before + /// submitting the query to the query engine. + final int? servicePreProcessingTimeInMillis; + /// The number of milliseconds that Athena took to finalize and publish the /// query results after the query engine finished running the query. final int? serviceProcessingTimeInMillis; @@ -6501,6 +6661,7 @@ class QueryExecutionStatistics { this.queryPlanningTimeInMillis, this.queryQueueTimeInMillis, this.resultReuseInformation, + this.servicePreProcessingTimeInMillis, this.serviceProcessingTimeInMillis, this.totalExecutionTimeInMillis, }); @@ -6516,6 +6677,8 @@ class QueryExecutionStatistics { ? ResultReuseInformation.fromJson( json['ResultReuseInformation'] as Map) : null, + servicePreProcessingTimeInMillis: + json['ServicePreProcessingTimeInMillis'] as int?, serviceProcessingTimeInMillis: json['ServiceProcessingTimeInMillis'] as int?, totalExecutionTimeInMillis: json['TotalExecutionTimeInMillis'] as int?, @@ -6529,6 +6692,8 @@ class QueryExecutionStatistics { final queryPlanningTimeInMillis = this.queryPlanningTimeInMillis; final queryQueueTimeInMillis = this.queryQueueTimeInMillis; final resultReuseInformation = this.resultReuseInformation; + final servicePreProcessingTimeInMillis = + this.servicePreProcessingTimeInMillis; final serviceProcessingTimeInMillis = this.serviceProcessingTimeInMillis; final totalExecutionTimeInMillis = this.totalExecutionTimeInMillis; return { @@ -6543,6 +6708,8 @@ class QueryExecutionStatistics { 'QueryQueueTimeInMillis': queryQueueTimeInMillis, if (resultReuseInformation != null) 'ResultReuseInformation': resultReuseInformation, + if (servicePreProcessingTimeInMillis != null) + 'ServicePreProcessingTimeInMillis': servicePreProcessingTimeInMillis, if (serviceProcessingTimeInMillis != null) 'ServiceProcessingTimeInMillis': serviceProcessingTimeInMillis, if (totalExecutionTimeInMillis != null) @@ -6618,6 +6785,48 @@ class QueryExecutionStatus { } } +/// Specifies whether Amazon S3 access grants are enabled for query results. +class QueryResultsS3AccessGrantsConfiguration { + /// The authentication type used for Amazon S3 access grants. Currently, only + /// DIRECTORY_IDENTITY is supported. + final AuthenticationType authenticationType; + + /// Specifies whether Amazon S3 access grants are enabled for query results. + final bool enableS3AccessGrants; + + /// When enabled, appends the user ID as an Amazon S3 path prefix to the query + /// result output location. + final bool? createUserLevelPrefix; + + QueryResultsS3AccessGrantsConfiguration({ + required this.authenticationType, + required this.enableS3AccessGrants, + this.createUserLevelPrefix, + }); + + factory QueryResultsS3AccessGrantsConfiguration.fromJson( + Map json) { + return QueryResultsS3AccessGrantsConfiguration( + authenticationType: + (json['AuthenticationType'] as String).toAuthenticationType(), + enableS3AccessGrants: json['EnableS3AccessGrants'] as bool, + createUserLevelPrefix: json['CreateUserLevelPrefix'] as bool?, + ); + } + + Map toJson() { + final authenticationType = this.authenticationType; + final enableS3AccessGrants = this.enableS3AccessGrants; + final createUserLevelPrefix = this.createUserLevelPrefix; + return { + 'AuthenticationType': authenticationType.toValue(), + 'EnableS3AccessGrants': enableS3AccessGrants, + if (createUserLevelPrefix != null) + 'CreateUserLevelPrefix': createUserLevelPrefix, + }; + } +} + /// The query execution timeline, statistics on input and output rows and bytes, /// and the different query stages that form the query execution plan. class QueryRuntimeStatistics { @@ -6724,6 +6933,10 @@ class QueryRuntimeStatisticsTimeline { /// automatically add the query back to the queue. final int? queryQueueTimeInMillis; + /// The number of milliseconds that Athena spends on preprocessing before it + /// submits the query to the engine. + final int? servicePreProcessingTimeInMillis; + /// The number of milliseconds that Athena took to finalize and publish the /// query results after the query engine finished running the query. final int? serviceProcessingTimeInMillis; @@ -6735,6 +6948,7 @@ class QueryRuntimeStatisticsTimeline { this.engineExecutionTimeInMillis, this.queryPlanningTimeInMillis, this.queryQueueTimeInMillis, + this.servicePreProcessingTimeInMillis, this.serviceProcessingTimeInMillis, this.totalExecutionTimeInMillis, }); @@ -6744,6 +6958,8 @@ class QueryRuntimeStatisticsTimeline { engineExecutionTimeInMillis: json['EngineExecutionTimeInMillis'] as int?, queryPlanningTimeInMillis: json['QueryPlanningTimeInMillis'] as int?, queryQueueTimeInMillis: json['QueryQueueTimeInMillis'] as int?, + servicePreProcessingTimeInMillis: + json['ServicePreProcessingTimeInMillis'] as int?, serviceProcessingTimeInMillis: json['ServiceProcessingTimeInMillis'] as int?, totalExecutionTimeInMillis: json['TotalExecutionTimeInMillis'] as int?, @@ -6754,6 +6970,8 @@ class QueryRuntimeStatisticsTimeline { final engineExecutionTimeInMillis = this.engineExecutionTimeInMillis; final queryPlanningTimeInMillis = this.queryPlanningTimeInMillis; final queryQueueTimeInMillis = this.queryQueueTimeInMillis; + final servicePreProcessingTimeInMillis = + this.servicePreProcessingTimeInMillis; final serviceProcessingTimeInMillis = this.serviceProcessingTimeInMillis; final totalExecutionTimeInMillis = this.totalExecutionTimeInMillis; return { @@ -6763,6 +6981,8 @@ class QueryRuntimeStatisticsTimeline { 'QueryPlanningTimeInMillis': queryPlanningTimeInMillis, if (queryQueueTimeInMillis != null) 'QueryQueueTimeInMillis': queryQueueTimeInMillis, + if (servicePreProcessingTimeInMillis != null) + 'ServicePreProcessingTimeInMillis': servicePreProcessingTimeInMillis, if (serviceProcessingTimeInMillis != null) 'ServiceProcessingTimeInMillis': serviceProcessingTimeInMillis, if (totalExecutionTimeInMillis != null) @@ -6962,10 +7182,7 @@ class ResultConfiguration { /// you must specify the query results location using one of the ways: either /// for individual queries using either this setting (client-side), or in the /// workgroup, using WorkGroupConfiguration. If none of them is set, - /// Athena issues an error that no output location is provided. For more - /// information, see Working - /// with query results, recent queries, and output files. If workgroup + /// Athena issues an error that no output location is provided. If workgroup /// settings override client-side settings, then the query uses the settings /// specified for the workgroup. See /// WorkGroupConfiguration$EnforceWorkGroupConfiguration. @@ -7036,10 +7253,7 @@ class ResultConfigurationUpdates { final String? expectedBucketOwner; /// The location in Amazon S3 where your query and calculation results are - /// stored, such as s3://path/to/query/bucket/. For more - /// information, see Working - /// with query results, recent queries, and output files. If workgroup + /// stored, such as s3://path/to/query/bucket/. If workgroup /// settings override client-side settings, then the query uses the location for /// the query results and the encryption configuration that are specified for /// the workgroup. The "workgroup settings override" is specified in @@ -7340,7 +7554,9 @@ extension S3AclOptionFromString on String { class SessionConfiguration { final EncryptionConfiguration? encryptionConfiguration; - /// The ARN of the execution role used for the session. + /// The ARN of the execution role used to access user resources for Spark + /// sessions and Identity Center enabled workgroups. This property applies only + /// to Spark enabled workgroups and Identity Center enabled workgroups. final String? executionRole; /// The idle timeout in seconds for the session. @@ -8238,6 +8454,10 @@ class WorkGroup { /// The workgroup description. final String? description; + /// The ARN of the IAM Identity Center enabled application associated with the + /// workgroup. + final String? identityCenterApplicationArn; + /// The state of the workgroup: ENABLED or DISABLED. final WorkGroupState? state; @@ -8246,6 +8466,7 @@ class WorkGroup { this.configuration, this.creationTime, this.description, + this.identityCenterApplicationArn, this.state, }); @@ -8258,6 +8479,8 @@ class WorkGroup { : null, creationTime: timeStampFromJson(json['CreationTime']), description: json['Description'] as String?, + identityCenterApplicationArn: + json['IdentityCenterApplicationArn'] as String?, state: (json['State'] as String?)?.toWorkGroupState(), ); } @@ -8267,6 +8490,7 @@ class WorkGroup { final configuration = this.configuration; final creationTime = this.creationTime; final description = this.description; + final identityCenterApplicationArn = this.identityCenterApplicationArn; final state = this.state; return { 'Name': name, @@ -8274,6 +8498,8 @@ class WorkGroup { if (creationTime != null) 'CreationTime': unixTimestampToJson(creationTime), if (description != null) 'Description': description, + if (identityCenterApplicationArn != null) + 'IdentityCenterApplicationArn': identityCenterApplicationArn, if (state != null) 'State': state.toValue(), }; } @@ -8297,7 +8523,7 @@ class WorkGroupConfiguration { final int? bytesScannedCutoffPerQuery; /// Specifies the KMS key that is used to encrypt the user's data stores in - /// Athena. + /// Athena. This setting does not apply to Athena SQL workgroups. final CustomerContentEncryptionConfiguration? customerContentEncryptionConfiguration; @@ -8325,12 +8551,22 @@ class WorkGroupConfiguration { /// preview engine regardless of this setting. final EngineVersion? engineVersion; - /// Role used in a session for accessing the user's resources. + /// The ARN of the execution role used to access user resources for Spark + /// sessions and IAM Identity Center enabled workgroups. This property applies + /// only to Spark enabled workgroups and IAM Identity Center enabled workgroups. + /// The property is required for IAM Identity Center enabled workgroups. final String? executionRole; + /// Specifies whether the workgroup is IAM Identity Center supported. + final IdentityCenterConfiguration? identityCenterConfiguration; + /// Indicates that the Amazon CloudWatch metrics are enabled for the workgroup. final bool? publishCloudWatchMetricsEnabled; + /// Specifies whether Amazon S3 access grants are enabled for query results. + final QueryResultsS3AccessGrantsConfiguration? + queryResultsS3AccessGrantsConfiguration; + /// If set to true, allows members assigned to a workgroup to /// reference Amazon S3 Requester Pays buckets in queries. If set to /// false, workgroup members cannot query data from Requester Pays @@ -8348,10 +8584,7 @@ class WorkGroupConfiguration { /// specify the query results location using one of the ways: either in the /// workgroup using this setting, or for individual queries (client-side), using /// ResultConfiguration$OutputLocation. If none of them is set, Athena - /// issues an error that no output location is provided. For more information, - /// see Working - /// with query results, recent queries, and output files. + /// issues an error that no output location is provided. final ResultConfiguration? resultConfiguration; WorkGroupConfiguration({ @@ -8362,7 +8595,9 @@ class WorkGroupConfiguration { this.enforceWorkGroupConfiguration, this.engineVersion, this.executionRole, + this.identityCenterConfiguration, this.publishCloudWatchMetricsEnabled, + this.queryResultsS3AccessGrantsConfiguration, this.requesterPaysEnabled, this.resultConfiguration, }); @@ -8386,8 +8621,18 @@ class WorkGroupConfiguration { json['EngineVersion'] as Map) : null, executionRole: json['ExecutionRole'] as String?, + identityCenterConfiguration: json['IdentityCenterConfiguration'] != null + ? IdentityCenterConfiguration.fromJson( + json['IdentityCenterConfiguration'] as Map) + : null, publishCloudWatchMetricsEnabled: json['PublishCloudWatchMetricsEnabled'] as bool?, + queryResultsS3AccessGrantsConfiguration: + json['QueryResultsS3AccessGrantsConfiguration'] != null + ? QueryResultsS3AccessGrantsConfiguration.fromJson( + json['QueryResultsS3AccessGrantsConfiguration'] + as Map) + : null, requesterPaysEnabled: json['RequesterPaysEnabled'] as bool?, resultConfiguration: json['ResultConfiguration'] != null ? ResultConfiguration.fromJson( @@ -8406,8 +8651,11 @@ class WorkGroupConfiguration { final enforceWorkGroupConfiguration = this.enforceWorkGroupConfiguration; final engineVersion = this.engineVersion; final executionRole = this.executionRole; + final identityCenterConfiguration = this.identityCenterConfiguration; final publishCloudWatchMetricsEnabled = this.publishCloudWatchMetricsEnabled; + final queryResultsS3AccessGrantsConfiguration = + this.queryResultsS3AccessGrantsConfiguration; final requesterPaysEnabled = this.requesterPaysEnabled; final resultConfiguration = this.resultConfiguration; return { @@ -8425,8 +8673,13 @@ class WorkGroupConfiguration { 'EnforceWorkGroupConfiguration': enforceWorkGroupConfiguration, if (engineVersion != null) 'EngineVersion': engineVersion, if (executionRole != null) 'ExecutionRole': executionRole, + if (identityCenterConfiguration != null) + 'IdentityCenterConfiguration': identityCenterConfiguration, if (publishCloudWatchMetricsEnabled != null) 'PublishCloudWatchMetricsEnabled': publishCloudWatchMetricsEnabled, + if (queryResultsS3AccessGrantsConfiguration != null) + 'QueryResultsS3AccessGrantsConfiguration': + queryResultsS3AccessGrantsConfiguration, if (requesterPaysEnabled != null) 'RequesterPaysEnabled': requesterPaysEnabled, if (resultConfiguration != null) @@ -8478,18 +8731,25 @@ class WorkGroupConfigurationUpdates { /// engine regardless of this setting. final EngineVersion? engineVersion; - /// Contains the ARN of the execution role for the workgroup + /// The ARN of the execution role used to access user resources for Spark + /// sessions and Identity Center enabled workgroups. This property applies only + /// to Spark enabled workgroups and Identity Center enabled workgroups. final String? executionRole; /// Indicates whether this workgroup enables publishing metrics to Amazon /// CloudWatch. final bool? publishCloudWatchMetricsEnabled; + /// Specifies whether Amazon S3 access grants are enabled for query results. + final QueryResultsS3AccessGrantsConfiguration? + queryResultsS3AccessGrantsConfiguration; + /// Indicates that the data usage control limit per query is removed. /// WorkGroupConfiguration$BytesScannedCutoffPerQuery final bool? removeBytesScannedCutoffPerQuery; - /// Removes content encryption configuration for a workgroup. + /// Removes content encryption configuration from an Apache Spark-enabled Athena + /// workgroup. final bool? removeCustomerContentEncryptionConfiguration; /// If set to true, allows members assigned to a workgroup to @@ -8517,6 +8777,7 @@ class WorkGroupConfigurationUpdates { this.engineVersion, this.executionRole, this.publishCloudWatchMetricsEnabled, + this.queryResultsS3AccessGrantsConfiguration, this.removeBytesScannedCutoffPerQuery, this.removeCustomerContentEncryptionConfiguration, this.requesterPaysEnabled, @@ -8535,6 +8796,8 @@ class WorkGroupConfigurationUpdates { final executionRole = this.executionRole; final publishCloudWatchMetricsEnabled = this.publishCloudWatchMetricsEnabled; + final queryResultsS3AccessGrantsConfiguration = + this.queryResultsS3AccessGrantsConfiguration; final removeBytesScannedCutoffPerQuery = this.removeBytesScannedCutoffPerQuery; final removeCustomerContentEncryptionConfiguration = @@ -8558,6 +8821,9 @@ class WorkGroupConfigurationUpdates { if (executionRole != null) 'ExecutionRole': executionRole, if (publishCloudWatchMetricsEnabled != null) 'PublishCloudWatchMetricsEnabled': publishCloudWatchMetricsEnabled, + if (queryResultsS3AccessGrantsConfiguration != null) + 'QueryResultsS3AccessGrantsConfiguration': + queryResultsS3AccessGrantsConfiguration, if (removeBytesScannedCutoffPerQuery != null) 'RemoveBytesScannedCutoffPerQuery': removeBytesScannedCutoffPerQuery, if (removeCustomerContentEncryptionConfiguration != null) @@ -8613,6 +8879,10 @@ class WorkGroupSummary { /// engine regardless of this setting. final EngineVersion? engineVersion; + /// The ARN of the IAM Identity Center enabled application associated with the + /// workgroup. + final String? identityCenterApplicationArn; + /// The name of the workgroup. final String? name; @@ -8623,6 +8893,7 @@ class WorkGroupSummary { this.creationTime, this.description, this.engineVersion, + this.identityCenterApplicationArn, this.name, this.state, }); @@ -8635,6 +8906,8 @@ class WorkGroupSummary { ? EngineVersion.fromJson( json['EngineVersion'] as Map) : null, + identityCenterApplicationArn: + json['IdentityCenterApplicationArn'] as String?, name: json['Name'] as String?, state: (json['State'] as String?)?.toWorkGroupState(), ); @@ -8644,6 +8917,7 @@ class WorkGroupSummary { final creationTime = this.creationTime; final description = this.description; final engineVersion = this.engineVersion; + final identityCenterApplicationArn = this.identityCenterApplicationArn; final name = this.name; final state = this.state; return { @@ -8651,6 +8925,8 @@ class WorkGroupSummary { 'CreationTime': unixTimestampToJson(creationTime), if (description != null) 'Description': description, if (engineVersion != null) 'EngineVersion': engineVersion, + if (identityCenterApplicationArn != null) + 'IdentityCenterApplicationArn': identityCenterApplicationArn, if (name != null) 'Name': name, if (state != null) 'State': state.toValue(), }; diff --git a/aws_client/lib/src/generated/audit_manager/v2017_07_25.dart b/aws_client/lib/src/generated/audit_manager/v2017_07_25.dart index 152e95f00..ccc523a96 100644 --- a/aws_client/lib/src/generated/audit_manager/v2017_07_25.dart +++ b/aws_client/lib/src/generated/audit_manager/v2017_07_25.dart @@ -252,21 +252,22 @@ class AuditManager { return BatchDisassociateAssessmentReportEvidenceResponse.fromJson(response); } - /// Uploads one or more pieces of evidence to a control in an Audit Manager - /// assessment. You can upload manual evidence from any Amazon Simple Storage - /// Service (Amazon S3) bucket by specifying the S3 URI of the evidence. + /// Adds one or more pieces of evidence to a control in an Audit Manager + /// assessment. /// - /// You must upload manual evidence to your S3 bucket before you can upload it - /// to your assessment. For instructions, see CreateBucket - /// and PutObject - /// in the Amazon Simple Storage Service API Reference. + /// You can import manual evidence from any S3 bucket by specifying the S3 URI + /// of the object. You can also upload a file from your browser, or enter + /// plain text in response to a risk assessment question. /// /// The following restrictions apply to this action: /// ///
        ///
      • + /// manualEvidence can be only one of the following: + /// evidenceFileName, s3ResourcePath, or + /// textResponse + ///
      • + ///
      • /// Maximum size of an individual evidence file: 100 MB ///
      • ///
      • @@ -286,6 +287,7 @@ class AuditManager { /// May throw [AccessDeniedException]. /// May throw [ValidationException]. /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. /// /// Parameter [assessmentId] : /// The identifier for the assessment. @@ -656,6 +658,13 @@ class AuditManager { } /// Deletes a custom control in Audit Manager. + /// + /// When you invoke this operation, the custom control is deleted from any + /// frameworks or assessments that it’s currently part of. As a result, Audit + /// Manager will stop collecting evidence for that custom control in all of + /// your assessments. This includes assessments that you previously created + /// before you deleted the custom control. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -834,7 +843,7 @@ class AuditManager { ); } - /// Returns the registration status of an account in Audit Manager. + /// Gets the registration status of an account in Audit Manager. /// /// May throw [InternalServerException]. Future getAccountStatus() async { @@ -847,7 +856,7 @@ class AuditManager { return GetAccountStatusResponse.fromJson(response); } - /// Returns an assessment from Audit Manager. + /// Gets information about a specified assessment. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -868,7 +877,7 @@ class AuditManager { return GetAssessmentResponse.fromJson(response); } - /// Returns a framework from Audit Manager. + /// Gets information about a specified framework. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -889,7 +898,7 @@ class AuditManager { return GetAssessmentFrameworkResponse.fromJson(response); } - /// Returns the URL of an assessment report in Audit Manager. + /// Gets the URL of an assessment report in Audit Manager. /// /// May throw [ValidationException]. /// May throw [AccessDeniedException]. @@ -915,7 +924,7 @@ class AuditManager { return GetAssessmentReportUrlResponse.fromJson(response); } - /// Returns a list of changelogs from Audit Manager. + /// Gets a list of changelogs from Audit Manager. /// /// May throw [AccessDeniedException]. /// May throw [ResourceNotFoundException]. @@ -967,7 +976,7 @@ class AuditManager { return GetChangeLogsResponse.fromJson(response); } - /// Returns a control from Audit Manager. + /// Gets information about a specified control. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -988,7 +997,7 @@ class AuditManager { return GetControlResponse.fromJson(response); } - /// Returns a list of delegations from an audit owner to a delegate. + /// Gets a list of delegations from an audit owner to a delegate. /// /// May throw [ValidationException]. /// May throw [AccessDeniedException]. @@ -1024,7 +1033,7 @@ class AuditManager { return GetDelegationsResponse.fromJson(response); } - /// Returns evidence from Audit Manager. + /// Gets information about a specified evidence item. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -1058,7 +1067,7 @@ class AuditManager { return GetEvidenceResponse.fromJson(response); } - /// Returns all evidence from a specified evidence folder in Audit Manager. + /// Gets all evidence from a specified evidence folder in Audit Manager. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -1108,7 +1117,57 @@ class AuditManager { return GetEvidenceByEvidenceFolderResponse.fromJson(response); } - /// Returns an evidence folder from the specified assessment in Audit Manager. + /// Creates a presigned Amazon S3 URL that can be used to upload a file as + /// manual evidence. For instructions on how to use this operation, see Upload + /// a file from your browser in the Audit Manager User Guide. + /// + /// The following restrictions apply to this operation: + /// + ///
          + ///
        • + /// Maximum size of an individual evidence file: 100 MB + ///
        • + ///
        • + /// Number of daily manual evidence uploads per control: 100 + ///
        • + ///
        • + /// Supported file formats: See Supported + /// file types for manual evidence in the Audit Manager User Guide + ///
        • + ///
        + /// For more information about Audit Manager service restrictions, see Quotas + /// and restrictions for Audit Manager. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [fileName] : + /// The file that you want to upload. For a list of supported file formats, + /// see Supported + /// file types for manual evidence in the Audit Manager User Guide. + Future getEvidenceFileUploadUrl({ + required String fileName, + }) async { + final $query = >{ + 'fileName': [fileName], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/evidenceFileUploadUrl', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetEvidenceFileUploadUrlResponse.fromJson(response); + } + + /// Gets an evidence folder from a specified assessment in Audit Manager. /// /// May throw [ResourceNotFoundException]. /// May throw [ValidationException]. @@ -1138,7 +1197,7 @@ class AuditManager { return GetEvidenceFolderResponse.fromJson(response); } - /// Returns the evidence folders from a specified assessment in Audit Manager. + /// Gets the evidence folders from a specified assessment in Audit Manager. /// /// May throw [ResourceNotFoundException]. /// May throw [AccessDeniedException]. @@ -1181,7 +1240,7 @@ class AuditManager { return GetEvidenceFoldersByAssessmentResponse.fromJson(response); } - /// Returns a list of evidence folders that are associated with a specified + /// Gets a list of evidence folders that are associated with a specified /// control in an Audit Manager assessment. /// /// May throw [ResourceNotFoundException]. @@ -1268,8 +1327,8 @@ class AuditManager { return GetInsightsByAssessmentResponse.fromJson(response); } - /// Returns the name of the delegated Amazon Web Services administrator - /// account for the organization. + /// Gets the name of the delegated Amazon Web Services administrator account + /// for a specified organization. /// /// May throw [ValidationException]. /// May throw [AccessDeniedException]. @@ -1286,7 +1345,7 @@ class AuditManager { return GetOrganizationAdminAccountResponse.fromJson(response); } - /// Returns a list of all of the Amazon Web Services that you can choose to + /// Gets a list of all of the Amazon Web Services that you can choose to /// include in your assessment. When you create /// an assessment, specify which of these services you want to include to @@ -1306,7 +1365,7 @@ class AuditManager { return GetServicesInScopeResponse.fromJson(response); } - /// Returns the settings for the specified Amazon Web Services account. + /// Gets the settings for a specified Amazon Web Services account. /// /// May throw [AccessDeniedException]. /// May throw [InternalServerException]. @@ -2327,7 +2386,10 @@ class AuditManager { /// May throw [InternalServerException]. /// /// Parameter [defaultAssessmentReportsDestination] : - /// The default storage destination for assessment reports. + /// The default S3 destination bucket for storing assessment reports. + /// + /// Parameter [defaultExportDestination] : + /// The default S3 destination bucket for storing evidence finder exports. /// /// Parameter [defaultProcessOwners] : /// A list of the default audit owners. @@ -2359,6 +2421,7 @@ class AuditManager { /// Manager sends notifications to. Future updateSettings({ AssessmentReportsDestination? defaultAssessmentReportsDestination, + DefaultExportDestination? defaultExportDestination, List? defaultProcessOwners, DeregistrationPolicy? deregistrationPolicy, bool? evidenceFinderEnabled, @@ -2369,6 +2432,8 @@ class AuditManager { if (defaultAssessmentReportsDestination != null) 'defaultAssessmentReportsDestination': defaultAssessmentReportsDestination, + if (defaultExportDestination != null) + 'defaultExportDestination': defaultExportDestination, if (defaultProcessOwners != null) 'defaultProcessOwners': defaultProcessOwners, if (deregistrationPolicy != null) @@ -3706,7 +3771,7 @@ extension AssessmentReportStatusFromString on String { /// The location where Audit Manager saves assessment reports for the given /// assessment. class AssessmentReportsDestination { - /// The destination of the assessment report. + /// The destination bucket where Audit Manager stores assessment reports. final String? destination; /// The destination type, such as Amazon S3. @@ -4176,7 +4241,7 @@ class Control { /// satisfied. final String? testingInformation; - /// The type of control, such as a custom control or a standard control. + /// Specifies whether the control is a standard control or a custom control. final ControlType? type; Control({ @@ -4486,7 +4551,7 @@ class ControlMappingSource { /// The description of the source. final String? sourceDescription; - /// The frequency of evidence collection for the control mapping source. + /// Specifies how often evidence is collected from the control mapping source. final SourceFrequency? sourceFrequency; /// The unique identifier for the source. @@ -4918,7 +4983,7 @@ class CreateControlMappingSource { /// collects evidence from for the control. final String? sourceDescription; - /// The frequency of evidence collection for the control mapping source. + /// Specifies how often evidence is collected from the control mapping source. final SourceFrequency? sourceFrequency; final SourceKeyword? sourceKeyword; @@ -5046,6 +5111,38 @@ class CreateDelegationRequest { } } +/// The default s3 bucket where Audit Manager saves the files that you export +/// from evidence finder. +class DefaultExportDestination { + /// The destination bucket where Audit Manager stores exported files. + final String? destination; + + /// The destination type, such as Amazon S3. + final ExportDestinationType? destinationType; + + DefaultExportDestination({ + this.destination, + this.destinationType, + }); + + factory DefaultExportDestination.fromJson(Map json) { + return DefaultExportDestination( + destination: json['destination'] as String?, + destinationType: + (json['destinationType'] as String?)?.toExportDestinationType(), + ); + } + + Map toJson() { + final destination = this.destination; + final destinationType = this.destinationType; + return { + if (destination != null) 'destination': destination, + if (destinationType != null) 'destinationType': destinationType.toValue(), + }; + } +} + /// The assignment of a control set to a delegate for review. class Delegation { /// The identifier for the assessment that's associated with the delegation. @@ -5824,20 +5921,42 @@ class EvidenceInsights { } } +enum ExportDestinationType { + s3, +} + +extension ExportDestinationTypeValueExtension on ExportDestinationType { + String toValue() { + switch (this) { + case ExportDestinationType.s3: + return 'S3'; + } + } +} + +extension ExportDestinationTypeFromString on String { + ExportDestinationType toExportDestinationType() { + switch (this) { + case 'S3': + return ExportDestinationType.s3; + } + throw Exception('$this is not known in enum ExportDestinationType'); + } +} + /// The file that's used to structure and automate Audit Manager assessments for /// a given compliance standard. class Framework { /// The Amazon Resource Name (ARN) of the framework. final String? arn; - /// The compliance type that the new custom framework supports, such as CIS or - /// HIPAA. + /// The compliance type that the framework supports, such as CIS or HIPAA. final String? complianceType; /// The control sets that are associated with the framework. final List? controlSets; - /// The sources that Audit Manager collects evidence from for the control. + /// The control data sources where Audit Manager collects evidence from. final String? controlSources; /// The time when the framework was created. @@ -5867,7 +5986,8 @@ class Framework { /// The tags that are associated with the framework. final Map? tags; - /// The framework type, such as a custom framework or a standard framework. + /// Specifies whether the framework is a standard framework or a custom + /// framework. final FrameworkType? type; Framework({ @@ -6150,7 +6270,7 @@ class GetChangeLogsResponse { } class GetControlResponse { - /// The name of the control that the GetControl API returned. + /// The details of the control that the GetControl API returned. final Control? control; GetControlResponse({ @@ -6239,6 +6359,36 @@ class GetEvidenceByEvidenceFolderResponse { } } +class GetEvidenceFileUploadUrlResponse { + /// The name of the uploaded manual evidence file that the presigned URL was + /// generated for. + final String? evidenceFileName; + + /// The presigned URL that was generated. + final String? uploadUrl; + + GetEvidenceFileUploadUrlResponse({ + this.evidenceFileName, + this.uploadUrl, + }); + + factory GetEvidenceFileUploadUrlResponse.fromJson(Map json) { + return GetEvidenceFileUploadUrlResponse( + evidenceFileName: json['evidenceFileName'] as String?, + uploadUrl: json['uploadUrl'] as String?, + ); + } + + Map toJson() { + final evidenceFileName = this.evidenceFileName; + final uploadUrl = this.uploadUrl; + return { + if (evidenceFileName != null) 'evidenceFileName': evidenceFileName, + if (uploadUrl != null) 'uploadUrl': uploadUrl, + }; + } +} + class GetEvidenceFolderResponse { /// The folder that the evidence is stored in. final AssessmentEvidenceFolder? evidenceFolder; @@ -6717,6 +6867,8 @@ class InsightsByAssessment { enum KeywordInputType { selectFromList, + uploadFile, + inputText, } extension KeywordInputTypeValueExtension on KeywordInputType { @@ -6724,6 +6876,10 @@ extension KeywordInputTypeValueExtension on KeywordInputType { switch (this) { case KeywordInputType.selectFromList: return 'SELECT_FROM_LIST'; + case KeywordInputType.uploadFile: + return 'UPLOAD_FILE'; + case KeywordInputType.inputText: + return 'INPUT_TEXT'; } } } @@ -6733,6 +6889,10 @@ extension KeywordInputTypeFromString on String { switch (this) { case 'SELECT_FROM_LIST': return KeywordInputType.selectFromList; + case 'UPLOAD_FILE': + return KeywordInputType.uploadFile; + case 'INPUT_TEXT': + return KeywordInputType.inputText; } throw Exception('$this is not known in enum KeywordInputType'); } @@ -6815,7 +6975,8 @@ class ListAssessmentFrameworkShareRequestsResponse { } class ListAssessmentFrameworksResponse { - /// The list of metadata objects for the framework. + /// A list of metadata that the ListAssessmentFrameworks API + /// returns for each framework. final List? frameworkMetadataList; /// The pagination token that's used to fetch the next set of results. @@ -6883,7 +7044,8 @@ class ListAssessmentReportsResponse { } class ListAssessmentsResponse { - /// The metadata that's associated with the assessment. + /// The metadata that the ListAssessments API returns for each + /// assessment. final List? assessmentMetadata; /// The pagination token that's used to fetch the next set of results. @@ -7022,8 +7184,8 @@ class ListControlInsightsByControlDomainResponse { } class ListControlsResponse { - /// The list of control metadata objects that the ListControls API - /// returned. + /// A list of metadata that the ListControls API returns for each + /// control. final List? controlMetadataList; /// The pagination token that's used to fetch the next set of results. @@ -7143,25 +7305,45 @@ class ListTagsForResourceResponse { } } -/// Evidence that's uploaded to Audit Manager manually. +/// Evidence that's manually added to a control in Audit Manager. +/// manualEvidence can be one of the following: +/// evidenceFileName, s3ResourcePath, or +/// textResponse. class ManualEvidence { - /// The Amazon S3 URL that points to a manual evidence object. + /// The name of the file that's uploaded as manual evidence. This name is + /// populated using the evidenceFileName value from the + /// GetEvidenceFileUploadUrl API response. + final String? evidenceFileName; + + /// The S3 URL of the object that's imported as manual evidence. final String? s3ResourcePath; + /// The plain text response that's entered and saved as manual evidence. + final String? textResponse; + ManualEvidence({ + this.evidenceFileName, this.s3ResourcePath, + this.textResponse, }); factory ManualEvidence.fromJson(Map json) { return ManualEvidence( + evidenceFileName: json['evidenceFileName'] as String?, s3ResourcePath: json['s3ResourcePath'] as String?, + textResponse: json['textResponse'] as String?, ); } Map toJson() { + final evidenceFileName = this.evidenceFileName; final s3ResourcePath = this.s3ResourcePath; + final textResponse = this.textResponse; return { + if (evidenceFileName != null) 'evidenceFileName': evidenceFileName, if (s3ResourcePath != null) 's3ResourcePath': s3ResourcePath, + if (textResponse != null) 'textResponse': textResponse, }; } } @@ -7554,6 +7736,7 @@ enum SettingAttribute { defaultProcessOwners, evidenceFinderEnablement, deregistrationPolicy, + defaultExportDestination, } extension SettingAttributeValueExtension on SettingAttribute { @@ -7573,6 +7756,8 @@ extension SettingAttributeValueExtension on SettingAttribute { return 'EVIDENCE_FINDER_ENABLEMENT'; case SettingAttribute.deregistrationPolicy: return 'DEREGISTRATION_POLICY'; + case SettingAttribute.defaultExportDestination: + return 'DEFAULT_EXPORT_DESTINATION'; } } } @@ -7594,6 +7779,8 @@ extension SettingAttributeFromString on String { return SettingAttribute.evidenceFinderEnablement; case 'DEREGISTRATION_POLICY': return SettingAttribute.deregistrationPolicy; + case 'DEFAULT_EXPORT_DESTINATION': + return SettingAttribute.defaultExportDestination; } throw Exception('$this is not known in enum SettingAttribute'); } @@ -7601,9 +7788,12 @@ extension SettingAttributeFromString on String { /// The settings object that holds all supported Audit Manager settings. class Settings { - /// The default storage destination for assessment reports. + /// The default S3 destination bucket for storing assessment reports. final AssessmentReportsDestination? defaultAssessmentReportsDestination; + /// The default S3 destination bucket for storing evidence finder exports. + final DefaultExportDestination? defaultExportDestination; + /// The designated default audit owners. final List? defaultProcessOwners; @@ -7626,6 +7816,7 @@ class Settings { Settings({ this.defaultAssessmentReportsDestination, + this.defaultExportDestination, this.defaultProcessOwners, this.deregistrationPolicy, this.evidenceFinderEnablement, @@ -7642,6 +7833,10 @@ class Settings { json['defaultAssessmentReportsDestination'] as Map) : null, + defaultExportDestination: json['defaultExportDestination'] != null + ? DefaultExportDestination.fromJson( + json['defaultExportDestination'] as Map) + : null, defaultProcessOwners: (json['defaultProcessOwners'] as List?) ?.whereNotNull() .map((e) => Role.fromJson(e as Map)) @@ -7663,6 +7858,7 @@ class Settings { Map toJson() { final defaultAssessmentReportsDestination = this.defaultAssessmentReportsDestination; + final defaultExportDestination = this.defaultExportDestination; final defaultProcessOwners = this.defaultProcessOwners; final deregistrationPolicy = this.deregistrationPolicy; final evidenceFinderEnablement = this.evidenceFinderEnablement; @@ -7673,6 +7869,8 @@ class Settings { if (defaultAssessmentReportsDestination != null) 'defaultAssessmentReportsDestination': defaultAssessmentReportsDestination, + if (defaultExportDestination != null) + 'defaultExportDestination': defaultExportDestination, if (defaultProcessOwners != null) 'defaultProcessOwners': defaultProcessOwners, if (deregistrationPolicy != null) @@ -7838,8 +8036,13 @@ extension SourceFrequencyFromString on String { } } -/// The keyword to search for in CloudTrail logs, Config rules, Security Hub -/// checks, and Amazon Web Services API names. +/// A keyword that relates to the control data source. +/// +/// For manual evidence, this keyword indicates if the manual evidence is a file +/// or text. +/// +/// For automated evidence, this keyword identifies a specific CloudTrail event, +/// Config rule, Security Hub control, or Amazon Web Services API name. /// /// To learn more about the supported keywords that you can use when mapping a /// control data source, see the following pages in the Audit Manager User @@ -7848,12 +8051,12 @@ extension SourceFrequencyFromString on String { /// class SourceKeyword { /// The input method for the keyword. + /// + ///
          + ///
        • + /// SELECT_FROM_LIST is used when mapping a data source for + /// automated evidence. + /// + ///
            + ///
          • + /// When keywordInputType is SELECT_FROM_LIST, a + /// keyword must be selected to collect automated evidence. For example, this + /// keyword can be a CloudTrail event name, a rule name for Config, a Security + /// Hub control, or the name of an Amazon Web Services API call. + ///
          • + ///
        • + ///
        • + /// UPLOAD_FILE and INPUT_TEXT are only used when + /// mapping a data source for manual evidence. + /// + ///
            + ///
          • + /// When keywordInputType is UPLOAD_FILE, a file must + /// be uploaded as manual evidence. + ///
          • + ///
          • + /// When keywordInputType is INPUT_TEXT, text must be + /// entered as manual evidence. + ///
          • + ///
        • + ///
        final KeywordInputType? keywordInputType; /// The value of the keyword that's used when mapping a control data source. For @@ -7885,7 +8117,13 @@ class SourceKeyword { /// rules, you can use the rule identifier as the keywordValue. /// You can find the rule identifier from the list - /// of Config managed rules. + /// of Config managed rules. For some rules, the rule identifier is + /// different from the rule name. For example, the rule name + /// restricted-ssh has the following rule identifier: + /// INCOMING_SSH_DISABLED. Make sure to use the rule identifier, + /// not the rule name. + /// + /// Keyword example for managed rules: /// ///
          ///
        • @@ -7900,7 +8138,9 @@ class SourceKeyword { /// href="https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html">custom /// rules, you form the keywordValue by adding the /// Custom_ prefix to the rule name. This prefix distinguishes the - /// rule from a managed rule. + /// custom rule from a managed rule. + /// + /// Keyword example for custom rules: /// ///
            ///
          • @@ -7916,6 +8156,8 @@ class SourceKeyword { /// Custom_ prefix to the rule name. In addition, you remove the /// suffix ID that appears at the end of the rule name. /// + /// Keyword examples for service-linked rules: + /// ///
              ///
            • /// Service-linked rule name: CustomRuleForAccount-conformance-pack-szsm1uv0w @@ -7931,7 +8173,58 @@ class SourceKeyword { /// Custom_OrgConfigRule-s3-bucket-versioning-enabled ///
            • ///
          • - ///
          + ///
        + /// The keywordValue is case sensitive. If you enter a value + /// incorrectly, Audit Manager might not recognize the data source mapping. As a + /// result, you might not successfully collect evidence from that data source as + /// intended. + /// + /// Keep in mind the following requirements, depending on the data source type + /// that you're using. + ///
          + ///
        1. + /// For Config: + /// + ///
            + ///
          • + /// For managed rules, make sure that the keywordValue is the rule + /// identifier in ALL_CAPS_WITH_UNDERSCORES. For example, + /// CLOUDWATCH_LOG_GROUP_ENCRYPTED. For accuracy, we recommend that + /// you reference the list of supported + /// Config managed rules. + ///
          • + ///
          • + /// For custom rules, make sure that the keywordValue has the + /// Custom_ prefix followed by the custom rule name. The format of + /// the custom rule name itself may vary. For accuracy, we recommend that you + /// visit the Config + /// console to verify your custom rule name. + ///
          • + ///
        2. + ///
        3. + /// For Security Hub: The format varies for Security Hub control names. For + /// accuracy, we recommend that you reference the list of supported + /// Security Hub controls. + ///
        4. + ///
        5. + /// For Amazon Web Services API calls: Make sure that the + /// keywordValue is written as + /// serviceprefix_ActionName. For example, + /// iam_ListGroups. For accuracy, we recommend that you reference + /// the list of supported + /// API calls. + ///
        6. + ///
        7. + /// For CloudTrail: Make sure that the keywordValue is written as + /// serviceprefix_ActionName. For example, + /// cloudtrail_StartLogging. For accuracy, we recommend that you + /// review the Amazon Web Service prefix and action names in the Service + /// Authorization Reference. + ///
        final String? keywordValue; SourceKeyword({ diff --git a/aws_client/lib/src/generated/auto_scaling/v2011_01_01.dart b/aws_client/lib/src/generated/auto_scaling/v2011_01_01.dart index d46df306f..7ad118a61 100644 --- a/aws_client/lib/src/generated/auto_scaling/v2011_01_01.dart +++ b/aws_client/lib/src/generated/auto_scaling/v2011_01_01.dart @@ -421,9 +421,8 @@ class AutoScaling { /// the CompleteLifecycleAction API call. ///
    /// For more information, see Amazon - /// EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling - /// User Guide. + /// href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/completing-lifecycle-hooks.html">Complete + /// a lifecycle action in the Amazon EC2 Auto Scaling User Guide. /// /// May throw [ResourceContentionFault]. /// @@ -484,14 +483,11 @@ class AutoScaling { /// for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User /// Guide. /// - /// For introductory exercises for creating an Auto Scaling group, see Getting - /// started with Amazon EC2 Auto Scaling and Tutorial: - /// Set up a scaled and load-balanced application in the Amazon EC2 - /// Auto Scaling User Guide. For more information, see Auto - /// Scaling groups in the Amazon EC2 Auto Scaling User Guide. + /// If you're new to Amazon EC2 Auto Scaling, see the introductory tutorials + /// in Get + /// started with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling + /// User Guide. /// /// Every Auto Scaling group has three size properties /// (DesiredCapacity, MaxSize, and @@ -644,6 +640,12 @@ class AutoScaling { /// an Auto Scaling group using an EC2 instance in the Amazon EC2 Auto /// Scaling User Guide. /// + /// Parameter [instanceMaintenancePolicy] : + /// An instance maintenance policy. For more information, see Set + /// instance maintenance policy in the Amazon EC2 Auto Scaling User + /// Guide. + /// /// Parameter [launchConfigurationName] : /// The name of the launch configuration to use to launch instances. /// @@ -781,6 +783,7 @@ class AutoScaling { int? healthCheckGracePeriod, String? healthCheckType, String? instanceId, + InstanceMaintenancePolicy? instanceMaintenancePolicy, String? launchConfigurationName, LaunchTemplateSpecification? launchTemplate, List? lifecycleHookSpecificationList, @@ -812,6 +815,8 @@ class AutoScaling { ?.also((arg) => $request['HealthCheckGracePeriod'] = arg); healthCheckType?.also((arg) => $request['HealthCheckType'] = arg); instanceId?.also((arg) => $request['InstanceId'] = arg); + instanceMaintenancePolicy + ?.also((arg) => $request['InstanceMaintenancePolicy'] = arg); launchConfigurationName ?.also((arg) => $request['LaunchConfigurationName'] = arg); launchTemplate?.also((arg) => $request['LaunchTemplate'] = arg); @@ -1599,7 +1604,7 @@ class AutoScaling { } /// Gets information about the instance refreshes for the specified Auto - /// Scaling group. + /// Scaling group from the previous six weeks. /// /// This operation is part of the instance @@ -2528,10 +2533,10 @@ class AutoScaling { /// Detaches one or more traffic sources from the specified Auto Scaling /// group. /// - /// When you detach a taffic, it enters the Removing state while - /// deregistering the instances in the group. When all instances are - /// deregistered, then you can no longer describe the traffic source using the - /// DescribeTrafficSources API call. The instances continue to run. + /// When you detach a traffic source, it enters the Removing + /// state while deregistering the instances in the group. When all instances + /// are deregistered, then you can no longer describe the traffic source using + /// the DescribeTrafficSources API call. The instances continue to run. /// /// May throw [ResourceContentionFault]. /// @@ -3331,7 +3336,7 @@ class AutoScaling { /// The amount by which to scale, based on the specified adjustment type. A /// positive value adds to the current capacity while a negative number /// removes from the current capacity. For exact capacity, you must specify a - /// positive value. + /// non-negative value. /// /// Required if the policy type is SimpleScaling. (Not used with /// any other policy type.) @@ -3820,10 +3825,10 @@ class AutoScaling { /// Parameter [autoScalingGroupName] : /// The name of the Auto Scaling group. Future rollbackInstanceRefresh({ - String? autoScalingGroupName, + required String autoScalingGroupName, }) async { final $request = {}; - autoScalingGroupName?.also((arg) => $request['AutoScalingGroupName'] = arg); + $request['AutoScalingGroupName'] = autoScalingGroupName; final $result = await _protocol.send( $request, action: 'RollbackInstanceRefresh', @@ -3980,10 +3985,7 @@ class AutoScaling { ); } - /// Starts an instance refresh. During an instance refresh, Amazon EC2 Auto - /// Scaling performs a rolling update of instances in an Auto Scaling group. - /// Instances are terminated first and then replaced, which temporarily - /// reduces the capacity available within your Auto Scaling group. + /// Starts an instance refresh. /// /// This operation is part of the instance @@ -4042,9 +4044,9 @@ class AutoScaling { /// Parameter [preferences] : /// Sets your preferences for the instance refresh so that it performs as /// expected when you start it. Includes the instance warmup time, the minimum - /// healthy percentage, and the behaviors that you want Amazon EC2 Auto - /// Scaling to use if instances that are in Standby state or - /// protected from scale in are found. You can also choose to enable + /// and maximum healthy percentages, and the behaviors that you want Amazon + /// EC2 Auto Scaling to use if instances that are in Standby + /// state or protected from scale in are found. You can also choose to enable /// additional features, such as the following: /// ///
      @@ -4055,6 +4057,9 @@ class AutoScaling { /// Checkpoints /// ///
    • + /// CloudWatch alarms + ///
    • + ///
    • /// Skip matching ///
    • ///
    @@ -4356,6 +4361,12 @@ class AutoScaling { /// Only specify EC2 if you must clear a value that was /// previously set. /// + /// Parameter [instanceMaintenancePolicy] : + /// An instance maintenance policy. For more information, see
    Set + /// instance maintenance policy in the Amazon EC2 Auto Scaling User + /// Guide. + /// /// Parameter [launchConfigurationName] : /// The name of the launch configuration. If you specify /// LaunchConfigurationName in your update request, you can't @@ -4453,6 +4464,7 @@ class AutoScaling { String? desiredCapacityType, int? healthCheckGracePeriod, String? healthCheckType, + InstanceMaintenancePolicy? instanceMaintenancePolicy, String? launchConfigurationName, LaunchTemplateSpecification? launchTemplate, int? maxInstanceLifetime, @@ -4478,6 +4490,8 @@ class AutoScaling { healthCheckGracePeriod ?.also((arg) => $request['HealthCheckGracePeriod'] = arg); healthCheckType?.also((arg) => $request['HealthCheckType'] = arg); + instanceMaintenancePolicy + ?.also((arg) => $request['InstanceMaintenancePolicy'] = arg); launchConfigurationName ?.also((arg) => $request['LaunchConfigurationName'] = arg); launchTemplate?.also((arg) => $request['LaunchTemplate'] = arg); @@ -4909,6 +4923,31 @@ class Alarm { } } +/// Specifies the CloudWatch alarm specification to use in an instance refresh. +class AlarmSpecification { + /// The names of one or more CloudWatch alarms to monitor for the instance + /// refresh. You can specify up to 10 alarms. + final List? alarms; + + AlarmSpecification({ + this.alarms, + }); + factory AlarmSpecification.fromXml(_s.XmlElement elem) { + return AlarmSpecification( + alarms: _s + .extractXmlChild(elem, 'Alarms') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + ); + } + + Map toJson() { + final alarms = this.alarms; + return { + if (alarms != null) 'Alarms': alarms, + }; + } +} + class AttachLoadBalancerTargetGroupsResultType { AttachLoadBalancerTargetGroupsResultType(); factory AttachLoadBalancerTargetGroupsResultType.fromXml( @@ -4997,6 +5036,9 @@ class AutoScalingGroup { /// The duration of the health check grace period, in seconds. final int? healthCheckGracePeriod; + /// An instance maintenance policy. + final InstanceMaintenancePolicy? instanceMaintenancePolicy; + /// The EC2 instances associated with the group. final List? instances; @@ -5075,6 +5117,7 @@ class AutoScalingGroup { this.desiredCapacityType, this.enabledMetrics, this.healthCheckGracePeriod, + this.instanceMaintenancePolicy, this.instances, this.launchConfigurationName, this.launchTemplate, @@ -5119,6 +5162,9 @@ class AutoScalingGroup { elem.findElements('member').map(EnabledMetric.fromXml).toList()), healthCheckGracePeriod: _s.extractXmlIntValue(elem, 'HealthCheckGracePeriod'), + instanceMaintenancePolicy: _s + .extractXmlChild(elem, 'InstanceMaintenancePolicy') + ?.let(InstanceMaintenancePolicy.fromXml), instances: _s.extractXmlChild(elem, 'Instances')?.let( (elem) => elem.findElements('member').map(Instance.fromXml).toList()), launchConfigurationName: @@ -5182,6 +5228,7 @@ class AutoScalingGroup { final desiredCapacityType = this.desiredCapacityType; final enabledMetrics = this.enabledMetrics; final healthCheckGracePeriod = this.healthCheckGracePeriod; + final instanceMaintenancePolicy = this.instanceMaintenancePolicy; final instances = this.instances; final launchConfigurationName = this.launchConfigurationName; final launchTemplate = this.launchTemplate; @@ -5222,6 +5269,8 @@ class AutoScalingGroup { if (enabledMetrics != null) 'EnabledMetrics': enabledMetrics, if (healthCheckGracePeriod != null) 'HealthCheckGracePeriod': healthCheckGracePeriod, + if (instanceMaintenancePolicy != null) + 'InstanceMaintenancePolicy': instanceMaintenancePolicy, if (instances != null) 'Instances': instances, if (launchConfigurationName != null) 'LaunchConfigurationName': launchConfigurationName, @@ -6986,6 +7035,55 @@ extension InstanceGenerationFromString on String { } } +/// Describes an instance maintenance policy. +/// +/// For more information, see Set +/// instance maintenance policy in the Amazon EC2 Auto Scaling User +/// Guide. +class InstanceMaintenancePolicy { + /// Specifies the upper threshold as a percentage of the desired capacity of the + /// Auto Scaling group. It represents the maximum percentage of the group that + /// can be in service and healthy, or pending, to support your workload when + /// replacing instances. Value range is 100 to 200. To clear a previously set + /// value, specify a value of -1. + /// + /// Both MinHealthyPercentage and MaxHealthyPercentage + /// must be specified, and the difference between them cannot be greater than + /// 100. A large range increases the number of instances that can be replaced at + /// the same time. + final int? maxHealthyPercentage; + + /// Specifies the lower threshold as a percentage of the desired capacity of the + /// Auto Scaling group. It represents the minimum percentage of the group to + /// keep in service, healthy, and ready to use to support your workload when + /// replacing instances. Value range is 0 to 100. To clear a previously set + /// value, specify a value of -1. + final int? minHealthyPercentage; + + InstanceMaintenancePolicy({ + this.maxHealthyPercentage, + this.minHealthyPercentage, + }); + factory InstanceMaintenancePolicy.fromXml(_s.XmlElement elem) { + return InstanceMaintenancePolicy( + maxHealthyPercentage: _s.extractXmlIntValue(elem, 'MaxHealthyPercentage'), + minHealthyPercentage: _s.extractXmlIntValue(elem, 'MinHealthyPercentage'), + ); + } + + Map toJson() { + final maxHealthyPercentage = this.maxHealthyPercentage; + final minHealthyPercentage = this.minHealthyPercentage; + return { + if (maxHealthyPercentage != null) + 'MaxHealthyPercentage': maxHealthyPercentage, + if (minHealthyPercentage != null) + 'MinHealthyPercentage': minHealthyPercentage, + }; + } +} + enum InstanceMetadataEndpointState { disabled, enabled, @@ -7711,6 +7809,35 @@ class InstanceRequirements { /// Default: Any local storage type final List? localStorageTypes; + /// [Price protection] The price protection threshold for Spot Instances, as a + /// percentage of an identified On-Demand price. The identified On-Demand price + /// is the price of the lowest priced current generation C, M, or R instance + /// type with your specified attributes. If no current generation C, M, or R + /// instance type matches your attributes, then the identified price is from + /// either the lowest priced current generation instance types or, failing that, + /// the lowest priced previous generation instance types that match your + /// attributes. When Amazon EC2 Auto Scaling selects instance types with your + /// attributes, we will exclude instance types whose price exceeds your + /// specified threshold. + /// + /// The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets + /// as a percentage. + /// + /// If you set DesiredCapacityType to vcpu or + /// memory-mib, the price protection threshold is based on the + /// per-vCPU or per-memory price instead of the per instance price. + /// + /// Only one of SpotMaxPricePercentageOverLowestPrice or + /// MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be + /// specified. If you don't specify either, Amazon EC2 Auto Scaling will + /// automatically apply optimal price protection to consistently select from a + /// wide range of instance types. To indicate no price protection threshold for + /// Spot Instances, meaning you want to consider all instance types that match + /// your attributes, include one of these parameters and specify a high value, + /// such as 999999. + /// + final int? maxSpotPriceAsPercentageOfOptimalOnDemandPrice; + /// The minimum and maximum amount of memory per vCPU for an instance type, in /// GiB. /// @@ -7728,18 +7855,26 @@ class InstanceRequirements { /// Default: No minimum or maximum limits final NetworkInterfaceCountRequest? networkInterfaceCount; - /// The price protection threshold for On-Demand Instances. This is the maximum - /// you’ll pay for an On-Demand Instance, expressed as a percentage higher than - /// the least expensive current generation M, C, or R instance type with your - /// specified attributes. When Amazon EC2 Auto Scaling selects instance types - /// with your attributes, we will exclude instance types whose price is higher - /// than your threshold. The parameter accepts an integer, which Amazon EC2 Auto - /// Scaling interprets as a percentage. To turn off price protection, specify a - /// high value, such as 999999. + /// [Price protection] The price protection threshold for On-Demand Instances, + /// as a percentage higher than an identified On-Demand price. The identified + /// On-Demand price is the price of the lowest priced current generation C, M, + /// or R instance type with your specified attributes. If no current generation + /// C, M, or R instance type matches your attributes, then the identified price + /// is from either the lowest priced current generation instance types or, + /// failing that, the lowest priced previous generation instance types that + /// match your attributes. When Amazon EC2 Auto Scaling selects instance types + /// with your attributes, we will exclude instance types whose price exceeds + /// your specified threshold. + /// + /// The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets + /// as a percentage. + /// + /// To turn off price protection, specify a high value, such as + /// 999999. /// /// If you set DesiredCapacityType to vcpu or /// memory-mib, the price protection threshold is applied based on - /// the per vCPU or per memory price instead of the per instance price. + /// the per-vCPU or per-memory price instead of the per instance price. /// /// Default: 20 final int? onDemandMaxPricePercentageOverLowestPrice; @@ -7750,20 +7885,33 @@ class InstanceRequirements { /// Default: false final bool? requireHibernateSupport; - /// The price protection threshold for Spot Instances. This is the maximum - /// you’ll pay for a Spot Instance, expressed as a percentage higher than the - /// least expensive current generation M, C, or R instance type with your - /// specified attributes. When Amazon EC2 Auto Scaling selects instance types - /// with your attributes, we will exclude instance types whose price is higher - /// than your threshold. The parameter accepts an integer, which Amazon EC2 Auto - /// Scaling interprets as a percentage. To turn off price protection, specify a - /// high value, such as 999999. + /// [Price protection] The price protection threshold for Spot Instances, as a + /// percentage higher than an identified Spot price. The identified Spot price + /// is the price of the lowest priced current generation C, M, or R instance + /// type with your specified attributes. If no current generation C, M, or R + /// instance type matches your attributes, then the identified price is from + /// either the lowest priced current generation instance types or, failing that, + /// the lowest priced previous generation instance types that match your + /// attributes. When Amazon EC2 Auto Scaling selects instance types with your + /// attributes, we will exclude instance types whose price exceeds your + /// specified threshold. /// - /// If you set DesiredCapacityType to vcpu or - /// memory-mib, the price protection threshold is applied based on - /// the per vCPU or per memory price instead of the per instance price. + /// The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets + /// as a percentage. /// - /// Default: 100 + /// If you set DesiredCapacityType to vcpu or + /// memory-mib, the price protection threshold is based on the + /// per-vCPU or per-memory price instead of the per instance price. + /// + /// Only one of SpotMaxPricePercentageOverLowestPrice or + /// MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be + /// specified. If you don't specify either, Amazon EC2 Auto Scaling will + /// automatically apply optimal price protection to consistently select from a + /// wide range of instance types. To indicate no price protection threshold for + /// Spot Instances, meaning you want to consider all instance types that match + /// your attributes, include one of these parameters and specify a high value, + /// such as 999999. + /// final int? spotMaxPricePercentageOverLowestPrice; /// The minimum and maximum total local storage size for an instance type, in @@ -7789,6 +7937,7 @@ class InstanceRequirements { this.instanceGenerations, this.localStorage, this.localStorageTypes, + this.maxSpotPriceAsPercentageOfOptimalOnDemandPrice, this.memoryGiBPerVCpu, this.networkBandwidthGbps, this.networkInterfaceCount, @@ -7855,6 +8004,8 @@ class InstanceRequirements { .extractXmlStringListValues(elem, 'member') .map((s) => s.toLocalStorageType()) .toList()), + maxSpotPriceAsPercentageOfOptimalOnDemandPrice: _s.extractXmlIntValue( + elem, 'MaxSpotPriceAsPercentageOfOptimalOnDemandPrice'), memoryGiBPerVCpu: _s .extractXmlChild(elem, 'MemoryGiBPerVCpu') ?.let(MemoryGiBPerVCpuRequest.fromXml), @@ -7893,6 +8044,8 @@ class InstanceRequirements { final instanceGenerations = this.instanceGenerations; final localStorage = this.localStorage; final localStorageTypes = this.localStorageTypes; + final maxSpotPriceAsPercentageOfOptimalOnDemandPrice = + this.maxSpotPriceAsPercentageOfOptimalOnDemandPrice; final memoryGiBPerVCpu = this.memoryGiBPerVCpu; final networkBandwidthGbps = this.networkBandwidthGbps; final networkInterfaceCount = this.networkInterfaceCount; @@ -7932,6 +8085,9 @@ class InstanceRequirements { if (localStorage != null) 'LocalStorage': localStorage.toValue(), if (localStorageTypes != null) 'LocalStorageTypes': localStorageTypes.map((e) => e.toValue()).toList(), + if (maxSpotPriceAsPercentageOfOptimalOnDemandPrice != null) + 'MaxSpotPriceAsPercentageOfOptimalOnDemandPrice': + maxSpotPriceAsPercentageOfOptimalOnDemandPrice, if (memoryGiBPerVCpu != null) 'MemoryGiBPerVCpu': memoryGiBPerVCpu, if (networkBandwidthGbps != null) 'NetworkBandwidthGbps': networkBandwidthGbps, @@ -9498,7 +9654,7 @@ class MetricGranularityType { } /// This structure defines the CloudWatch metric to return, along with the -/// statistic, period, and unit. +/// statistic and unit. /// /// For more information about the CloudWatch terminology below, see Amazon @@ -10768,9 +10924,13 @@ class RecordLifecycleActionHeartbeatAnswer { /// Describes the preferences for an instance refresh. class RefreshPreferences { + /// (Optional) The CloudWatch alarm specification. CloudWatch alarms can be used + /// to identify any issues and fail the operation if an alarm threshold is met. + final AlarmSpecification? alarmSpecification; + /// (Optional) Indicates whether to roll back the Auto Scaling group to its - /// previous configuration if the instance refresh fails. The default is - /// false. + /// previous configuration if the instance refresh fails or a CloudWatch alarm + /// threshold is met. The default is false. /// /// A rollback is not supported in the following situations: /// @@ -10788,6 +10948,10 @@ class RefreshPreferences { /// $Default version. /// /// + /// For more information, see Undo + /// changes with a rollback in the Amazon EC2 Auto Scaling User + /// Guide. final bool? autoRollback; /// (Optional) The amount of time, in seconds, to wait after a checkpoint before @@ -10824,14 +10988,29 @@ class RefreshPreferences { /// property otherwise. final int? instanceWarmup; - /// The amount of capacity in the Auto Scaling group that must pass your group's - /// health checks to allow the operation to continue. The value is expressed as - /// a percentage of the desired capacity of the Auto Scaling group (rounded up - /// to the nearest integer). The default is 90. - /// - /// Setting the minimum healthy percentage to 100 percent limits the rate of - /// replacement to one instance at a time. In contrast, setting it to 0 percent - /// has the effect of replacing all instances at the same time. + /// Specifies the maximum percentage of the group that can be in service and + /// healthy, or pending, to support your workload when replacing instances. The + /// value is expressed as a percentage of the desired capacity of the Auto + /// Scaling group. Value range is 100 to 200. + /// + /// If you specify MaxHealthyPercentage, you must also specify + /// MinHealthyPercentage, and the difference between them cannot be + /// greater than 100. A larger range increases the number of instances that can + /// be replaced at the same time. + /// + /// If you do not specify this property, the default is 100 percent, or the + /// percentage set in the instance maintenance policy for the Auto Scaling + /// group, if defined. + final int? maxHealthyPercentage; + + /// Specifies the minimum percentage of the group to keep in service, healthy, + /// and ready to use to support your workload to allow the operation to + /// continue. The value is expressed as a percentage of the desired capacity of + /// the Auto Scaling group. Value range is 0 to 100. + /// + /// If you do not specify this property, the default is 90 percent, or the + /// percentage set in the instance maintenance policy for the Auto Scaling + /// group, if defined. final int? minHealthyPercentage; /// Choose the behavior that you want Amazon EC2 Auto Scaling to use if @@ -10880,10 +11059,12 @@ class RefreshPreferences { final StandbyInstances? standbyInstances; RefreshPreferences({ + this.alarmSpecification, this.autoRollback, this.checkpointDelay, this.checkpointPercentages, this.instanceWarmup, + this.maxHealthyPercentage, this.minHealthyPercentage, this.scaleInProtectedInstances, this.skipMatching, @@ -10891,12 +11072,16 @@ class RefreshPreferences { }); factory RefreshPreferences.fromXml(_s.XmlElement elem) { return RefreshPreferences( + alarmSpecification: _s + .extractXmlChild(elem, 'AlarmSpecification') + ?.let(AlarmSpecification.fromXml), autoRollback: _s.extractXmlBoolValue(elem, 'AutoRollback'), checkpointDelay: _s.extractXmlIntValue(elem, 'CheckpointDelay'), checkpointPercentages: _s .extractXmlChild(elem, 'CheckpointPercentages') ?.let((elem) => _s.extractXmlIntListValues(elem, 'member')), instanceWarmup: _s.extractXmlIntValue(elem, 'InstanceWarmup'), + maxHealthyPercentage: _s.extractXmlIntValue(elem, 'MaxHealthyPercentage'), minHealthyPercentage: _s.extractXmlIntValue(elem, 'MinHealthyPercentage'), scaleInProtectedInstances: _s .extractXmlStringValue(elem, 'ScaleInProtectedInstances') @@ -10909,20 +11094,25 @@ class RefreshPreferences { } Map toJson() { + final alarmSpecification = this.alarmSpecification; final autoRollback = this.autoRollback; final checkpointDelay = this.checkpointDelay; final checkpointPercentages = this.checkpointPercentages; final instanceWarmup = this.instanceWarmup; + final maxHealthyPercentage = this.maxHealthyPercentage; final minHealthyPercentage = this.minHealthyPercentage; final scaleInProtectedInstances = this.scaleInProtectedInstances; final skipMatching = this.skipMatching; final standbyInstances = this.standbyInstances; return { + if (alarmSpecification != null) 'AlarmSpecification': alarmSpecification, if (autoRollback != null) 'AutoRollback': autoRollback, if (checkpointDelay != null) 'CheckpointDelay': checkpointDelay, if (checkpointPercentages != null) 'CheckpointPercentages': checkpointPercentages, if (instanceWarmup != null) 'InstanceWarmup': instanceWarmup, + if (maxHealthyPercentage != null) + 'MaxHealthyPercentage': maxHealthyPercentage, if (minHealthyPercentage != null) 'MinHealthyPercentage': minHealthyPercentage, if (scaleInProtectedInstances != null) @@ -11669,12 +11859,8 @@ class StartInstanceRefreshAnswer { class StepAdjustment { /// The amount by which to scale, based on the specified adjustment type. A /// positive value adds to the current capacity while a negative number removes - /// from the current capacity. - /// - /// The amount by which to scale. The adjustment is based on the value that you - /// specified in the AdjustmentType property (either an absolute - /// number or a percentage). A positive value adds to the current capacity and a - /// negative number subtracts from the current capacity. + /// from the current capacity. For exact capacity, you must specify a + /// non-negative value. final int scalingAdjustment; /// The lower bound for the difference between the alarm threshold and the diff --git a/aws_client/lib/src/generated/auto_scaling/v2011_01_01.meta.dart b/aws_client/lib/src/generated/auto_scaling/v2011_01_01.meta.dart index 523625897..b2a170e62 100644 --- a/aws_client/lib/src/generated/auto_scaling/v2011_01_01.meta.dart +++ b/aws_client/lib/src/generated/auto_scaling/v2011_01_01.meta.dart @@ -103,6 +103,18 @@ const Map> shapesJson = { }, "flattened": false }, + "AlarmList": { + "type": "list", + "member": {"shape": "XmlStringMaxLen255"}, + "flattened": false + }, + "AlarmSpecification": { + "type": "structure", + "members": { + "Alarms": {"shape": "AlarmList", "flattened": false} + }, + "flattened": false + }, "Alarms": { "type": "list", "member": {"shape": "Alarm"}, @@ -114,6 +126,7 @@ const Map> shapesJson = { "member": {"shape": "AllowedInstanceType"}, "flattened": false }, + "AnyPrintableAsciiStringMaxLen4000": {"type": "string", "flattened": false}, "AsciiStringMaxLen255": {"type": "string", "flattened": false}, "AssociatePublicIpAddress": {"type": "boolean", "flattened": false}, "AttachInstancesQuery": { @@ -254,7 +267,11 @@ const Map> shapesJson = { "shape": "DefaultInstanceWarmup", "flattened": false }, - "TrafficSources": {"shape": "TrafficSources", "flattened": false} + "TrafficSources": {"shape": "TrafficSources", "flattened": false}, + "InstanceMaintenancePolicy": { + "shape": "InstanceMaintenancePolicy", + "flattened": false + } }, "flattened": false }, @@ -568,7 +585,11 @@ const Map> shapesJson = { "shape": "DefaultInstanceWarmup", "flattened": false }, - "TrafficSources": {"shape": "TrafficSources", "flattened": false} + "TrafficSources": {"shape": "TrafficSources", "flattened": false}, + "InstanceMaintenancePolicy": { + "shape": "InstanceMaintenancePolicy", + "flattened": false + } }, "flattened": false }, @@ -1300,6 +1321,20 @@ const Map> shapesJson = { "member": {"shape": "XmlStringMaxLen19"}, "flattened": false }, + "InstanceMaintenancePolicy": { + "type": "structure", + "members": { + "MinHealthyPercentage": { + "shape": "IntPercentResettable", + "flattened": false + }, + "MaxHealthyPercentage": { + "shape": "IntPercent100To200Resettable", + "flattened": false + } + }, + "flattened": false + }, "InstanceMetadataEndpointState": {"type": "string", "flattened": false}, "InstanceMetadataHttpPutResponseHopLimit": { "type": "integer", @@ -1422,6 +1457,10 @@ const Map> shapesJson = { "shape": "NullablePositiveInteger", "flattened": false }, + "MaxSpotPriceAsPercentageOfOptimalOnDemandPrice": { + "shape": "NullablePositiveInteger", + "flattened": false + }, "OnDemandMaxPricePercentageOverLowestPrice": { "shape": "NullablePositiveInteger", "flattened": false @@ -1506,6 +1545,9 @@ const Map> shapesJson = { }, "InstancesToUpdate": {"type": "integer", "flattened": false}, "IntPercent": {"type": "integer", "flattened": false}, + "IntPercent100To200": {"type": "integer", "flattened": false}, + "IntPercent100To200Resettable": {"type": "integer", "flattened": false}, + "IntPercentResettable": {"type": "integer", "flattened": false}, "LaunchConfiguration": { "type": "structure", "members": { @@ -1653,7 +1695,7 @@ const Map> shapesJson = { }, "RoleARN": {"shape": "XmlStringMaxLen255", "flattened": false}, "NotificationMetadata": { - "shape": "XmlStringMaxLen1023", + "shape": "AnyPrintableAsciiStringMaxLen4000", "flattened": false }, "HeartbeatTimeout": {"shape": "HeartbeatTimeout", "flattened": false}, @@ -1679,7 +1721,7 @@ const Map> shapesJson = { "flattened": false }, "NotificationMetadata": { - "shape": "XmlStringMaxLen1023", + "shape": "AnyPrintableAsciiStringMaxLen4000", "flattened": false }, "HeartbeatTimeout": {"shape": "HeartbeatTimeout", "flattened": false}, @@ -2163,7 +2205,7 @@ const Map> shapesJson = { "flattened": false }, "NotificationMetadata": { - "shape": "XmlStringMaxLen1023", + "shape": "AnyPrintableAsciiStringMaxLen4000", "flattened": false }, "HeartbeatTimeout": {"shape": "HeartbeatTimeout", "flattened": false}, @@ -2308,7 +2350,12 @@ const Map> shapesJson = { "shape": "ScaleInProtectedInstances", "flattened": false }, - "StandbyInstances": {"shape": "StandbyInstances", "flattened": false} + "StandbyInstances": {"shape": "StandbyInstances", "flattened": false}, + "AlarmSpecification": {"shape": "AlarmSpecification", "flattened": false}, + "MaxHealthyPercentage": { + "shape": "IntPercent100To200", + "flattened": false + } }, "flattened": false }, @@ -2792,6 +2839,10 @@ const Map> shapesJson = { "DefaultInstanceWarmup": { "shape": "DefaultInstanceWarmup", "flattened": false + }, + "InstanceMaintenancePolicy": { + "shape": "InstanceMaintenancePolicy", + "flattened": false } }, "flattened": false diff --git a/aws_client/lib/src/generated/b2_bi/v2022_06_23.dart b/aws_client/lib/src/generated/b2_bi/v2022_06_23.dart new file mode 100644 index 000000000..254c4f6b0 --- /dev/null +++ b/aws_client/lib/src/generated/b2_bi/v2022_06_23.dart @@ -0,0 +1,3724 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// This is the Amazon Web Services B2B Data Interchange API Reference. +/// It provides descriptions, API request parameters, and the XML response for +/// each of the B2BI API actions. +/// +/// B2BI enables automated exchange of EDI (electronic data interchange) based +/// business-critical transactions at cloud scale, with elasticity and +/// pay-as-you-go pricing. Businesses use EDI documents to exchange +/// transactional data with trading partners, such as suppliers and end +/// customers, using standardized formats such as X12. +/// +/// Rather than actually running a command, you can use the +/// --generate-cli-skeleton parameter with any API call to generate +/// and display a parameter template. You can then use the generated template to +/// customize and use as input on a later command. For details, see Generate +/// and use a parameter skeleton file. +/// +class B2BI { + final _s.JsonProtocol _protocol; + B2BI({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.JsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'b2bi', + signingName: 'b2bi', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Instantiates a capability based on the specified parameters. A trading + /// capability contains the information required to transform incoming EDI + /// documents into JSON or XML outputs. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [configuration] : + /// Specifies a structure that contains the details for a capability. + /// + /// Parameter [name] : + /// Specifies the name of the capability, used to identify it. + /// + /// Parameter [type] : + /// Specifies the type of the capability. Currently, only edi is + /// supported. + /// + /// Parameter [clientToken] : + /// Reserved for future use. + /// + /// Parameter [instructionsDocuments] : + /// Specifies one or more locations in Amazon S3, each specifying an EDI + /// document that can be used with this capability. Each item contains the + /// name of the bucket and the key, to identify the document's location. + /// + /// Parameter [tags] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future createCapability({ + required CapabilityConfiguration configuration, + required String name, + required CapabilityType type, + String? clientToken, + List? instructionsDocuments, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.CreateCapability' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'configuration': configuration, + 'name': name, + 'type': type.toValue(), + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (instructionsDocuments != null) + 'instructionsDocuments': instructionsDocuments, + if (tags != null) 'tags': tags, + }, + ); + + return CreateCapabilityResponse.fromJson(jsonResponse.body); + } + + /// Creates a partnership between a customer and a trading partner, based on + /// the supplied parameters. A partnership represents the connection between + /// you and your trading partner. It ties together a profile and one or more + /// trading capabilities. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [email] : + /// Specifies the email address associated with this trading partner. + /// + /// Parameter [name] : + /// Specifies a descriptive name for the partnership. + /// + /// Parameter [profileId] : + /// Specifies the unique, system-generated identifier for the profile + /// connected to this partnership. + /// + /// Parameter [capabilities] : + /// Specifies a list of the capabilities associated with this partnership. + /// + /// Parameter [clientToken] : + /// Reserved for future use. + /// + /// Parameter [phone] : + /// Specifies the phone number associated with the partnership. + /// + /// Parameter [tags] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future createPartnership({ + required String email, + required String name, + required String profileId, + List? capabilities, + String? clientToken, + String? phone, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.CreatePartnership' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'email': email, + 'name': name, + 'profileId': profileId, + if (capabilities != null) 'capabilities': capabilities, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (phone != null) 'phone': phone, + if (tags != null) 'tags': tags, + }, + ); + + return CreatePartnershipResponse.fromJson(jsonResponse.body); + } + + /// Creates a customer profile. You can have up to five customer profiles, + /// each representing a distinct private network. A profile is the mechanism + /// used to create the concept of a private network. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [businessName] : + /// Specifies the name for the business associated with this profile. + /// + /// Parameter [logging] : + /// Specifies whether or not logging is enabled for this profile. + /// + /// Parameter [name] : + /// Specifies the name of the profile. + /// + /// Parameter [phone] : + /// Specifies the phone number associated with the profile. + /// + /// Parameter [clientToken] : + /// Reserved for future use. + /// + /// Parameter [email] : + /// Specifies the email address associated with this customer profile. + /// + /// Parameter [tags] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future createProfile({ + required String businessName, + required Logging logging, + required String name, + required String phone, + String? clientToken, + String? email, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.CreateProfile' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'businessName': businessName, + 'logging': logging.toValue(), + 'name': name, + 'phone': phone, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (email != null) 'email': email, + if (tags != null) 'tags': tags, + }, + ); + + return CreateProfileResponse.fromJson(jsonResponse.body); + } + + /// Creates a transformer. A transformer describes how to process the incoming + /// EDI documents and extract the necessary information to the output file. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [ediType] : + /// Specifies the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards + /// and corresponding messages that define specific business documents. + /// + /// Parameter [fileFormat] : + /// Specifies that the currently supported file formats for EDI + /// transformations are JSON and XML. + /// + /// Parameter [mappingTemplate] : + /// Specifies the mapping template for the transformer. This template is used + /// to map the parsed EDI file using JSONata or XSLT. + /// + /// Parameter [name] : + /// Specifies the name of the transformer, used to identify it. + /// + /// Parameter [clientToken] : + /// Reserved for future use. + /// + /// Parameter [sampleDocument] : + /// Specifies a sample EDI document that is used by a transformer as a guide + /// for processing the EDI data. + /// + /// Parameter [tags] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future createTransformer({ + required EdiType ediType, + required FileFormat fileFormat, + required String mappingTemplate, + required String name, + String? clientToken, + String? sampleDocument, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.CreateTransformer' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'mappingTemplate': mappingTemplate, + 'name': name, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (sampleDocument != null) 'sampleDocument': sampleDocument, + if (tags != null) 'tags': tags, + }, + ); + + return CreateTransformerResponse.fromJson(jsonResponse.body); + } + + /// Deletes the specified capability. A trading capability contains the + /// information required to transform incoming EDI documents into JSON or XML + /// outputs. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [capabilityId] : + /// Specifies a system-assigned unique identifier for the capability. + Future deleteCapability({ + required String capabilityId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.DeleteCapability' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'capabilityId': capabilityId, + }, + ); + } + + /// Deletes the specified partnership. A partnership represents the connection + /// between you and your trading partner. It ties together a profile and one + /// or more trading capabilities. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [partnershipId] : + /// Specifies the unique, system-generated identifier for a partnership. + Future deletePartnership({ + required String partnershipId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.DeletePartnership' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'partnershipId': partnershipId, + }, + ); + } + + /// Deletes the specified profile. A profile is the mechanism used to create + /// the concept of a private network. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [profileId] : + /// Specifies the unique, system-generated identifier for the profile. + Future deleteProfile({ + required String profileId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.DeleteProfile' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'profileId': profileId, + }, + ); + } + + /// Deletes the specified transformer. A transformer describes how to process + /// the incoming EDI documents and extract the necessary information to the + /// output file. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [transformerId] : + /// Specifies the system-assigned unique identifier for the transformer. + Future deleteTransformer({ + required String transformerId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.DeleteTransformer' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'transformerId': transformerId, + }, + ); + } + + /// Retrieves the details for the specified capability. A trading capability + /// contains the information required to transform incoming EDI documents into + /// JSON or XML outputs. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [capabilityId] : + /// Specifies a system-assigned unique identifier for the capability. + Future getCapability({ + required String capabilityId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.GetCapability' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'capabilityId': capabilityId, + }, + ); + + return GetCapabilityResponse.fromJson(jsonResponse.body); + } + + /// Retrieves the details for a partnership, based on the partner and profile + /// IDs specified. A partnership represents the connection between you and + /// your trading partner. It ties together a profile and one or more trading + /// capabilities. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [partnershipId] : + /// Specifies the unique, system-generated identifier for a partnership. + Future getPartnership({ + required String partnershipId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.GetPartnership' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'partnershipId': partnershipId, + }, + ); + + return GetPartnershipResponse.fromJson(jsonResponse.body); + } + + /// Retrieves the details for the profile specified by the profile ID. A + /// profile is the mechanism used to create the concept of a private network. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [profileId] : + /// Specifies the unique, system-generated identifier for the profile. + Future getProfile({ + required String profileId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.GetProfile' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'profileId': profileId, + }, + ); + + return GetProfileResponse.fromJson(jsonResponse.body); + } + + /// Retrieves the details for the transformer specified by the transformer ID. + /// A transformer describes how to process the incoming EDI documents and + /// extract the necessary information to the output file. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [transformerId] : + /// Specifies the system-assigned unique identifier for the transformer. + Future getTransformer({ + required String transformerId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.GetTransformer' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'transformerId': transformerId, + }, + ); + + return GetTransformerResponse.fromJson(jsonResponse.body); + } + + /// Returns the details of the transformer run, based on the Transformer job + /// ID. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [transformerId] : + /// Specifies the system-assigned unique identifier for the transformer. + /// + /// Parameter [transformerJobId] : + /// Specifies the unique, system-generated identifier for a transformer run. + Future getTransformerJob({ + required String transformerId, + required String transformerJobId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.GetTransformerJob' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'transformerId': transformerId, + 'transformerJobId': transformerJobId, + }, + ); + + return GetTransformerJobResponse.fromJson(jsonResponse.body); + } + + /// Lists the capabilities associated with your Amazon Web Services account + /// for your current or specified region. A trading capability contains the + /// information required to transform incoming EDI documents into JSON or XML + /// outputs. + /// + /// Parameter [maxResults] : + /// Specifies the maximum number of capabilities to return. + /// + /// Parameter [nextToken] : + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + Future listCapabilities({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.ListCapabilities' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListCapabilitiesResponse.fromJson(jsonResponse.body); + } + + /// Lists the partnerships associated with your Amazon Web Services account + /// for your current or specified region. A partnership represents the + /// connection between you and your trading partner. It ties together a + /// profile and one or more trading capabilities. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [maxResults] : + /// Specifies the maximum number of capabilities to return. + /// + /// Parameter [nextToken] : + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + /// + /// Parameter [profileId] : + /// Specifies the unique, system-generated identifier for the profile + /// connected to this partnership. + Future listPartnerships({ + int? maxResults, + String? nextToken, + String? profileId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.ListPartnerships' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (profileId != null) 'profileId': profileId, + }, + ); + + return ListPartnershipsResponse.fromJson(jsonResponse.body); + } + + /// Lists the profiles associated with your Amazon Web Services account for + /// your current or specified region. A profile is the mechanism used to + /// create the concept of a private network. + /// + /// Parameter [maxResults] : + /// Specifies the maximum number of profiles to return. + /// + /// Parameter [nextToken] : + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + Future listProfiles({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.ListProfiles' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListProfilesResponse.fromJson(jsonResponse.body); + } + + /// Lists all of the tags associated with the Amazon Resource Name (ARN) that + /// you specify. The resource can be a capability, partnership, profile, or + /// transformer. + /// + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [resourceARN] : + /// Requests the tags associated with a particular Amazon Resource Name (ARN). + /// An ARN is an identifier for a specific Amazon Web Services resource, such + /// as a capability, partnership, profile, or transformer. + Future listTagsForResource({ + required String resourceARN, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + }, + ); + + return ListTagsForResourceResponse.fromJson(jsonResponse.body); + } + + /// Lists the available transformers. A transformer describes how to process + /// the incoming EDI documents and extract the necessary information to the + /// output file. + /// + /// Parameter [maxResults] : + /// Specifies the number of items to return for the API response. + /// + /// Parameter [nextToken] : + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + Future listTransformers({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.ListTransformers' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListTransformersResponse.fromJson(jsonResponse.body); + } + + /// Runs a job, using a transformer, to parse input EDI (electronic data + /// interchange) file into the output structures used by Amazon Web Services + /// B2BI Data Interchange. + /// + /// If you only want to transform EDI (electronic data interchange) documents, + /// you don't need to create profiles, partnerships or capabilities. Just + /// create and configure a transformer, and then run the + /// StartTransformerJob API to process your files. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [inputFile] : + /// Specifies the location of the input file for the transformation. The + /// location consists of an Amazon S3 bucket and prefix. + /// + /// Parameter [outputLocation] : + /// Specifies the location of the output file for the transformation. The + /// location consists of an Amazon S3 bucket and prefix. + /// + /// Parameter [transformerId] : + /// Specifies the system-assigned unique identifier for the transformer. + /// + /// Parameter [clientToken] : + /// Reserved for future use. + Future startTransformerJob({ + required S3Location inputFile, + required S3Location outputLocation, + required String transformerId, + String? clientToken, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.StartTransformerJob' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'inputFile': inputFile, + 'outputLocation': outputLocation, + 'transformerId': transformerId, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }, + ); + + return StartTransformerJobResponse.fromJson(jsonResponse.body); + } + + /// Attaches a key-value pair to a resource, as identified by its Amazon + /// Resource Name (ARN). Resources are capability, partnership, profile, + /// transformers and other entities. + /// + /// There is no response returned from this call. + /// + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [resourceARN] : + /// Specifies an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + /// + /// Parameter [tags] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future tagResource({ + required String resourceARN, + required List tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + 'Tags': tags, + }, + ); + } + + /// Maps the input file according to the provided template file. The API call + /// downloads the file contents from the Amazon S3 location, and passes the + /// contents in as a string, to the inputFileContent parameter. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [fileFormat] : + /// Specifies that the currently supported file formats for EDI + /// transformations are JSON and XML. + /// + /// Parameter [inputFileContent] : + /// Specify the contents of the EDI (electronic data interchange) XML or JSON + /// file that is used as input for the transform. + /// + /// Parameter [mappingTemplate] : + /// Specifies the mapping template for the transformer. This template is used + /// to map the parsed EDI file using JSONata or XSLT. + Future testMapping({ + required FileFormat fileFormat, + required String inputFileContent, + required String mappingTemplate, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.TestMapping' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'fileFormat': fileFormat.toValue(), + 'inputFileContent': inputFileContent, + 'mappingTemplate': mappingTemplate, + }, + ); + + return TestMappingResponse.fromJson(jsonResponse.body); + } + + /// Parses the input EDI (electronic data interchange) file. The input file + /// has a file size limit of 250 KB. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [ediType] : + /// Specifies the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards + /// and corresponding messages that define specific business documents. + /// + /// Parameter [fileFormat] : + /// Specifies that the currently supported file formats for EDI + /// transformations are JSON and XML. + /// + /// Parameter [inputFile] : + /// Specifies an S3Location object, which contains the Amazon S3 + /// bucket and prefix for the location of the input file. + Future testParsing({ + required EdiType ediType, + required FileFormat fileFormat, + required S3Location inputFile, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.TestParsing' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'inputFile': inputFile, + }, + ); + + return TestParsingResponse.fromJson(jsonResponse.body); + } + + /// Detaches a key-value pair from the specified resource, as identified by + /// its Amazon Resource Name (ARN). Resources are capability, partnership, + /// profile, transformers and other entities. + /// + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// + /// Parameter [resourceARN] : + /// Specifies an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + /// + /// Parameter [tagKeys] : + /// Specifies the key-value pairs assigned to ARNs that you can use to group + /// and search for resources by type. You can attach this metadata to + /// resources (capabilities, partnerships, and so on) for any purpose. + Future untagResource({ + required String resourceARN, + required List tagKeys, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.UntagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + 'TagKeys': tagKeys, + }, + ); + } + + /// Updates some of the parameters for a capability, based on the specified + /// parameters. A trading capability contains the information required to + /// transform incoming EDI documents into JSON or XML outputs. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [capabilityId] : + /// Specifies a system-assigned unique identifier for the capability. + /// + /// Parameter [configuration] : + /// Specifies a structure that contains the details for a capability. + /// + /// Parameter [instructionsDocuments] : + /// Specifies one or more locations in Amazon S3, each specifying an EDI + /// document that can be used with this capability. Each item contains the + /// name of the bucket and the key, to identify the document's location. + /// + /// Parameter [name] : + /// Specifies a new name for the capability, to replace the existing name. + Future updateCapability({ + required String capabilityId, + CapabilityConfiguration? configuration, + List? instructionsDocuments, + String? name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.UpdateCapability' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'capabilityId': capabilityId, + if (configuration != null) 'configuration': configuration, + if (instructionsDocuments != null) + 'instructionsDocuments': instructionsDocuments, + if (name != null) 'name': name, + }, + ); + + return UpdateCapabilityResponse.fromJson(jsonResponse.body); + } + + /// Updates some of the parameters for a partnership between a customer and + /// trading partner. A partnership represents the connection between you and + /// your trading partner. It ties together a profile and one or more trading + /// capabilities. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [partnershipId] : + /// Specifies the unique, system-generated identifier for a partnership. + /// + /// Parameter [capabilities] : + /// List of the capabilities associated with this partnership. + /// + /// Parameter [name] : + /// The name of the partnership, used to identify it. + Future updatePartnership({ + required String partnershipId, + List? capabilities, + String? name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.UpdatePartnership' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'partnershipId': partnershipId, + if (capabilities != null) 'capabilities': capabilities, + if (name != null) 'name': name, + }, + ); + + return UpdatePartnershipResponse.fromJson(jsonResponse.body); + } + + /// Updates the specified parameters for a profile. A profile is the mechanism + /// used to create the concept of a private network. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [profileId] : + /// Specifies the unique, system-generated identifier for the profile. + /// + /// Parameter [businessName] : + /// Specifies the name for the business associated with this profile. + /// + /// Parameter [email] : + /// Specifies the email address associated with this customer profile. + /// + /// Parameter [name] : + /// The name of the profile, used to identify it. + /// + /// Parameter [phone] : + /// Specifies the phone number associated with the profile. + Future updateProfile({ + required String profileId, + String? businessName, + String? email, + String? name, + String? phone, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.UpdateProfile' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'profileId': profileId, + if (businessName != null) 'businessName': businessName, + if (email != null) 'email': email, + if (name != null) 'name': name, + if (phone != null) 'phone': phone, + }, + ); + + return UpdateProfileResponse.fromJson(jsonResponse.body); + } + + /// Updates the specified parameters for a transformer. A transformer + /// describes how to process the incoming EDI documents and extract the + /// necessary information to the output file. + /// + /// May throw [ConflictException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// + /// Parameter [transformerId] : + /// Specifies the system-assigned unique identifier for the transformer. + /// + /// Parameter [ediType] : + /// Specifies the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards + /// and corresponding messages that define specific business documents. + /// + /// Parameter [fileFormat] : + /// Specifies that the currently supported file formats for EDI + /// transformations are JSON and XML. + /// + /// Parameter [mappingTemplate] : + /// Specifies the mapping template for the transformer. This template is used + /// to map the parsed EDI file using JSONata or XSLT. + /// + /// Parameter [name] : + /// Specify a new name for the transformer, if you want to update it. + /// + /// Parameter [sampleDocument] : + /// Specifies a sample EDI document that is used by a transformer as a guide + /// for processing the EDI data. + /// + /// Parameter [status] : + /// Specifies the transformer's status. You can update the state of the + /// transformer, from active to inactive, or + /// inactive to active. + Future updateTransformer({ + required String transformerId, + EdiType? ediType, + FileFormat? fileFormat, + String? mappingTemplate, + String? name, + String? sampleDocument, + TransformerStatus? status, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'B2BI.UpdateTransformer' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'transformerId': transformerId, + if (ediType != null) 'ediType': ediType, + if (fileFormat != null) 'fileFormat': fileFormat.toValue(), + if (mappingTemplate != null) 'mappingTemplate': mappingTemplate, + if (name != null) 'name': name, + if (sampleDocument != null) 'sampleDocument': sampleDocument, + if (status != null) 'status': status.toValue(), + }, + ); + + return UpdateTransformerResponse.fromJson(jsonResponse.body); + } +} + +/// A capability object. Currently, only EDI (electronic data interchange) +/// capabilities are supported. A trading capability contains the information +/// required to transform incoming EDI documents into JSON or XML outputs. +class CapabilityConfiguration { + /// An EDI (electronic data interchange) configuration object. + final EdiConfiguration? edi; + + CapabilityConfiguration({ + this.edi, + }); + + factory CapabilityConfiguration.fromJson(Map json) { + return CapabilityConfiguration( + edi: json['edi'] != null + ? EdiConfiguration.fromJson(json['edi'] as Map) + : null, + ); + } + + Map toJson() { + final edi = this.edi; + return { + if (edi != null) 'edi': edi, + }; + } +} + +/// Returns the capability summary details. A trading capability contains the +/// information required to transform incoming EDI documents into JSON or XML +/// outputs. +class CapabilitySummary { + /// Returns a system-assigned unique identifier for the capability. + final String capabilityId; + + /// Returns a timestamp for creation date and time of the capability. + final DateTime createdAt; + + /// The display name of the capability. + final String name; + + /// Returns the type of the capability. Currently, only edi is + /// supported. + final CapabilityType type; + + /// Returns a timestamp that identifies the most recent date and time that the + /// capability was modified. + final DateTime? modifiedAt; + + CapabilitySummary({ + required this.capabilityId, + required this.createdAt, + required this.name, + required this.type, + this.modifiedAt, + }); + + factory CapabilitySummary.fromJson(Map json) { + return CapabilitySummary( + capabilityId: json['capabilityId'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + type: (json['type'] as String).toCapabilityType(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final capabilityId = this.capabilityId; + final createdAt = this.createdAt; + final name = this.name; + final type = this.type; + final modifiedAt = this.modifiedAt; + return { + 'capabilityId': capabilityId, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'type': type.toValue(), + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +enum CapabilityType { + edi, +} + +extension CapabilityTypeValueExtension on CapabilityType { + String toValue() { + switch (this) { + case CapabilityType.edi: + return 'edi'; + } + } +} + +extension CapabilityTypeFromString on String { + CapabilityType toCapabilityType() { + switch (this) { + case 'edi': + return CapabilityType.edi; + } + throw Exception('$this is not known in enum CapabilityType'); + } +} + +class CreateCapabilityResponse { + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String capabilityArn; + + /// Returns a system-assigned unique identifier for the capability. + final String capabilityId; + + /// Returns a structure that contains the details for a capability. + final CapabilityConfiguration configuration; + + /// Returns a timestamp for creation date and time of the capability. + final DateTime createdAt; + + /// Returns the name of the capability used to identify it. + final String name; + + /// Returns the type of the capability. Currently, only edi is + /// supported. + final CapabilityType type; + + /// Returns one or more locations in Amazon S3, each specifying an EDI document + /// that can be used with this capability. Each item contains the name of the + /// bucket and the key, to identify the document's location. + final List? instructionsDocuments; + + CreateCapabilityResponse({ + required this.capabilityArn, + required this.capabilityId, + required this.configuration, + required this.createdAt, + required this.name, + required this.type, + this.instructionsDocuments, + }); + + factory CreateCapabilityResponse.fromJson(Map json) { + return CreateCapabilityResponse( + capabilityArn: json['capabilityArn'] as String, + capabilityId: json['capabilityId'] as String, + configuration: CapabilityConfiguration.fromJson( + json['configuration'] as Map), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + type: (json['type'] as String).toCapabilityType(), + instructionsDocuments: (json['instructionsDocuments'] as List?) + ?.whereNotNull() + .map((e) => S3Location.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final capabilityArn = this.capabilityArn; + final capabilityId = this.capabilityId; + final configuration = this.configuration; + final createdAt = this.createdAt; + final name = this.name; + final type = this.type; + final instructionsDocuments = this.instructionsDocuments; + return { + 'capabilityArn': capabilityArn, + 'capabilityId': capabilityId, + 'configuration': configuration, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'type': type.toValue(), + if (instructionsDocuments != null) + 'instructionsDocuments': instructionsDocuments, + }; + } +} + +class CreatePartnershipResponse { + /// Returns a timestamp for creation date and time of the partnership. + final DateTime createdAt; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String partnershipArn; + + /// Returns the unique, system-generated identifier for a partnership. + final String partnershipId; + + /// Returns the unique, system-generated identifier for the profile connected to + /// this partnership. + final String profileId; + + /// Returns one or more capabilities associated with this partnership. + final List? capabilities; + + /// Returns the email address associated with this trading partner. + final String? email; + + /// Returns a descriptive name for the partnership. + final String? name; + + /// Returns the phone number associated with the partnership. + final String? phone; + + /// Returns the unique, system-generated identifier for a trading partner. + final String? tradingPartnerId; + + CreatePartnershipResponse({ + required this.createdAt, + required this.partnershipArn, + required this.partnershipId, + required this.profileId, + this.capabilities, + this.email, + this.name, + this.phone, + this.tradingPartnerId, + }); + + factory CreatePartnershipResponse.fromJson(Map json) { + return CreatePartnershipResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + partnershipArn: json['partnershipArn'] as String, + partnershipId: json['partnershipId'] as String, + profileId: json['profileId'] as String, + capabilities: (json['capabilities'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + email: json['email'] as String?, + name: json['name'] as String?, + phone: json['phone'] as String?, + tradingPartnerId: json['tradingPartnerId'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final partnershipArn = this.partnershipArn; + final partnershipId = this.partnershipId; + final profileId = this.profileId; + final capabilities = this.capabilities; + final email = this.email; + final name = this.name; + final phone = this.phone; + final tradingPartnerId = this.tradingPartnerId; + return { + 'createdAt': iso8601ToJson(createdAt), + 'partnershipArn': partnershipArn, + 'partnershipId': partnershipId, + 'profileId': profileId, + if (capabilities != null) 'capabilities': capabilities, + if (email != null) 'email': email, + if (name != null) 'name': name, + if (phone != null) 'phone': phone, + if (tradingPartnerId != null) 'tradingPartnerId': tradingPartnerId, + }; + } +} + +class CreateProfileResponse { + /// Returns the name for the business associated with this profile. + final String businessName; + + /// Returns a timestamp representing the time the profile was created. + final DateTime createdAt; + + /// Returns the name of the profile, used to identify it. + final String name; + + /// Returns the phone number associated with the profile. + final String phone; + + /// Returns an Amazon Resource Name (ARN) for the profile. + final String profileArn; + + /// Returns the unique, system-generated identifier for the profile. + final String profileId; + + /// Returns the email address associated with this customer profile. + final String? email; + + /// Returns the name of the logging group. + final String? logGroupName; + + /// Returns whether or not logging is turned on for this profile. + final Logging? logging; + + CreateProfileResponse({ + required this.businessName, + required this.createdAt, + required this.name, + required this.phone, + required this.profileArn, + required this.profileId, + this.email, + this.logGroupName, + this.logging, + }); + + factory CreateProfileResponse.fromJson(Map json) { + return CreateProfileResponse( + businessName: json['businessName'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + phone: json['phone'] as String, + profileArn: json['profileArn'] as String, + profileId: json['profileId'] as String, + email: json['email'] as String?, + logGroupName: json['logGroupName'] as String?, + logging: (json['logging'] as String?)?.toLogging(), + ); + } + + Map toJson() { + final businessName = this.businessName; + final createdAt = this.createdAt; + final name = this.name; + final phone = this.phone; + final profileArn = this.profileArn; + final profileId = this.profileId; + final email = this.email; + final logGroupName = this.logGroupName; + final logging = this.logging; + return { + 'businessName': businessName, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'phone': phone, + 'profileArn': profileArn, + 'profileId': profileId, + if (email != null) 'email': email, + if (logGroupName != null) 'logGroupName': logGroupName, + if (logging != null) 'logging': logging.toValue(), + }; + } +} + +class CreateTransformerResponse { + /// Returns a timestamp for creation date and time of the transformer. + final DateTime createdAt; + + /// Returns the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards and + /// corresponding messages that define specific business documents. + final EdiType ediType; + + /// Returns that the currently supported file formats for EDI transformations + /// are JSON and XML. + final FileFormat fileFormat; + + /// Returns the mapping template for the transformer. This template is used to + /// map the parsed EDI file using JSONata or XSLT. + final String mappingTemplate; + + /// Returns the name of the transformer, used to identify it. + final String name; + + /// Returns the state of the newly created transformer. The transformer can be + /// either active or inactive. For the transformer to + /// be used in a capability, its status must active. + final TransformerStatus status; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String transformerArn; + + /// Returns the system-assigned unique identifier for the transformer. + final String transformerId; + + /// Returns a sample EDI document that is used by a transformer as a guide for + /// processing the EDI data. + final String? sampleDocument; + + CreateTransformerResponse({ + required this.createdAt, + required this.ediType, + required this.fileFormat, + required this.mappingTemplate, + required this.name, + required this.status, + required this.transformerArn, + required this.transformerId, + this.sampleDocument, + }); + + factory CreateTransformerResponse.fromJson(Map json) { + return CreateTransformerResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + ediType: EdiType.fromJson(json['ediType'] as Map), + fileFormat: (json['fileFormat'] as String).toFileFormat(), + mappingTemplate: json['mappingTemplate'] as String, + name: json['name'] as String, + status: (json['status'] as String).toTransformerStatus(), + transformerArn: json['transformerArn'] as String, + transformerId: json['transformerId'] as String, + sampleDocument: json['sampleDocument'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final ediType = this.ediType; + final fileFormat = this.fileFormat; + final mappingTemplate = this.mappingTemplate; + final name = this.name; + final status = this.status; + final transformerArn = this.transformerArn; + final transformerId = this.transformerId; + final sampleDocument = this.sampleDocument; + return { + 'createdAt': iso8601ToJson(createdAt), + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'mappingTemplate': mappingTemplate, + 'name': name, + 'status': status.toValue(), + 'transformerArn': transformerArn, + 'transformerId': transformerId, + if (sampleDocument != null) 'sampleDocument': sampleDocument, + }; + } +} + +/// Specifies the details for the EDI (electronic data interchange) +/// transformation. +class EdiConfiguration { + /// Contains the Amazon S3 bucket and prefix for the location of the input file, + /// which is contained in an S3Location object. + final S3Location inputLocation; + + /// Contains the Amazon S3 bucket and prefix for the location of the output + /// file, which is contained in an S3Location object. + final S3Location outputLocation; + + /// Returns the system-assigned unique identifier for the transformer. + final String transformerId; + + /// Returns the type of the capability. Currently, only edi is + /// supported. + final EdiType type; + + EdiConfiguration({ + required this.inputLocation, + required this.outputLocation, + required this.transformerId, + required this.type, + }); + + factory EdiConfiguration.fromJson(Map json) { + return EdiConfiguration( + inputLocation: + S3Location.fromJson(json['inputLocation'] as Map), + outputLocation: + S3Location.fromJson(json['outputLocation'] as Map), + transformerId: json['transformerId'] as String, + type: EdiType.fromJson(json['type'] as Map), + ); + } + + Map toJson() { + final inputLocation = this.inputLocation; + final outputLocation = this.outputLocation; + final transformerId = this.transformerId; + final type = this.type; + return { + 'inputLocation': inputLocation, + 'outputLocation': outputLocation, + 'transformerId': transformerId, + 'type': type, + }; + } +} + +/// Specifies the details for the EDI standard that is being used for the +/// transformer. Currently, only X12 is supported. X12 is a set of standards and +/// corresponding messages that define specific business documents. +class EdiType { + /// Returns the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards and + /// corresponding messages that define specific business documents. + final X12Details? x12Details; + + EdiType({ + this.x12Details, + }); + + factory EdiType.fromJson(Map json) { + return EdiType( + x12Details: json['x12Details'] != null + ? X12Details.fromJson(json['x12Details'] as Map) + : null, + ); + } + + Map toJson() { + final x12Details = this.x12Details; + return { + if (x12Details != null) 'x12Details': x12Details, + }; + } +} + +enum FileFormat { + xml, + json, +} + +extension FileFormatValueExtension on FileFormat { + String toValue() { + switch (this) { + case FileFormat.xml: + return 'XML'; + case FileFormat.json: + return 'JSON'; + } + } +} + +extension FileFormatFromString on String { + FileFormat toFileFormat() { + switch (this) { + case 'XML': + return FileFormat.xml; + case 'JSON': + return FileFormat.json; + } + throw Exception('$this is not known in enum FileFormat'); + } +} + +class GetCapabilityResponse { + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String capabilityArn; + + /// Returns a system-assigned unique identifier for the capability. + final String capabilityId; + + /// Returns a structure that contains the details for a capability. + final CapabilityConfiguration configuration; + + /// Returns a timestamp for creation date and time of the capability. + final DateTime createdAt; + + /// Returns the name of the capability, used to identify it. + final String name; + + /// Returns the type of the capability. Currently, only edi is + /// supported. + final CapabilityType type; + + /// Returns one or more locations in Amazon S3, each specifying an EDI document + /// that can be used with this capability. Each item contains the name of the + /// bucket and the key, to identify the document's location. + final List? instructionsDocuments; + + /// Returns a timestamp for last time the capability was modified. + final DateTime? modifiedAt; + + GetCapabilityResponse({ + required this.capabilityArn, + required this.capabilityId, + required this.configuration, + required this.createdAt, + required this.name, + required this.type, + this.instructionsDocuments, + this.modifiedAt, + }); + + factory GetCapabilityResponse.fromJson(Map json) { + return GetCapabilityResponse( + capabilityArn: json['capabilityArn'] as String, + capabilityId: json['capabilityId'] as String, + configuration: CapabilityConfiguration.fromJson( + json['configuration'] as Map), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + type: (json['type'] as String).toCapabilityType(), + instructionsDocuments: (json['instructionsDocuments'] as List?) + ?.whereNotNull() + .map((e) => S3Location.fromJson(e as Map)) + .toList(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final capabilityArn = this.capabilityArn; + final capabilityId = this.capabilityId; + final configuration = this.configuration; + final createdAt = this.createdAt; + final name = this.name; + final type = this.type; + final instructionsDocuments = this.instructionsDocuments; + final modifiedAt = this.modifiedAt; + return { + 'capabilityArn': capabilityArn, + 'capabilityId': capabilityId, + 'configuration': configuration, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'type': type.toValue(), + if (instructionsDocuments != null) + 'instructionsDocuments': instructionsDocuments, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +class GetPartnershipResponse { + /// Returns a timestamp for creation date and time of the partnership. + final DateTime createdAt; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String partnershipArn; + + /// Returns the unique, system-generated identifier for a partnership. + final String partnershipId; + + /// Returns the unique, system-generated identifier for the profile connected to + /// this partnership. + final String profileId; + + /// Returns one or more capabilities associated with this partnership. + final List? capabilities; + + /// Returns the email address associated with this trading partner. + final String? email; + + /// Returns a timestamp that identifies the most recent date and time that the + /// partnership was modified. + final DateTime? modifiedAt; + + /// Returns the display name of the partnership + final String? name; + + /// Returns the phone number associated with the partnership. + final String? phone; + + /// Returns the unique identifier for the partner for this partnership. + final String? tradingPartnerId; + + GetPartnershipResponse({ + required this.createdAt, + required this.partnershipArn, + required this.partnershipId, + required this.profileId, + this.capabilities, + this.email, + this.modifiedAt, + this.name, + this.phone, + this.tradingPartnerId, + }); + + factory GetPartnershipResponse.fromJson(Map json) { + return GetPartnershipResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + partnershipArn: json['partnershipArn'] as String, + partnershipId: json['partnershipId'] as String, + profileId: json['profileId'] as String, + capabilities: (json['capabilities'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + email: json['email'] as String?, + modifiedAt: timeStampFromJson(json['modifiedAt']), + name: json['name'] as String?, + phone: json['phone'] as String?, + tradingPartnerId: json['tradingPartnerId'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final partnershipArn = this.partnershipArn; + final partnershipId = this.partnershipId; + final profileId = this.profileId; + final capabilities = this.capabilities; + final email = this.email; + final modifiedAt = this.modifiedAt; + final name = this.name; + final phone = this.phone; + final tradingPartnerId = this.tradingPartnerId; + return { + 'createdAt': iso8601ToJson(createdAt), + 'partnershipArn': partnershipArn, + 'partnershipId': partnershipId, + 'profileId': profileId, + if (capabilities != null) 'capabilities': capabilities, + if (email != null) 'email': email, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (name != null) 'name': name, + if (phone != null) 'phone': phone, + if (tradingPartnerId != null) 'tradingPartnerId': tradingPartnerId, + }; + } +} + +class GetProfileResponse { + /// Returns the name for the business associated with this profile. + final String businessName; + + /// Returns a timestamp for creation date and time of the transformer. + final DateTime createdAt; + + /// Returns the name of the profile, used to identify it. + final String name; + + /// Returns the phone number associated with the profile. + final String phone; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String profileArn; + + /// Returns the unique, system-generated identifier for the profile. + final String profileId; + + /// Returns the email address associated with this customer profile. + final String? email; + + /// Returns the name of the logging group. + final String? logGroupName; + + /// Returns whether or not logging is enabled for this profile. + final Logging? logging; + + /// Returns a timestamp for last time the profile was modified. + final DateTime? modifiedAt; + + GetProfileResponse({ + required this.businessName, + required this.createdAt, + required this.name, + required this.phone, + required this.profileArn, + required this.profileId, + this.email, + this.logGroupName, + this.logging, + this.modifiedAt, + }); + + factory GetProfileResponse.fromJson(Map json) { + return GetProfileResponse( + businessName: json['businessName'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + phone: json['phone'] as String, + profileArn: json['profileArn'] as String, + profileId: json['profileId'] as String, + email: json['email'] as String?, + logGroupName: json['logGroupName'] as String?, + logging: (json['logging'] as String?)?.toLogging(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final businessName = this.businessName; + final createdAt = this.createdAt; + final name = this.name; + final phone = this.phone; + final profileArn = this.profileArn; + final profileId = this.profileId; + final email = this.email; + final logGroupName = this.logGroupName; + final logging = this.logging; + final modifiedAt = this.modifiedAt; + return { + 'businessName': businessName, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'phone': phone, + 'profileArn': profileArn, + 'profileId': profileId, + if (email != null) 'email': email, + if (logGroupName != null) 'logGroupName': logGroupName, + if (logging != null) 'logging': logging.toValue(), + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +class GetTransformerJobResponse { + /// Returns the current state of the transformer job, either + /// running, succeeded, or failed. + final TransformerJobStatus status; + + /// Returns an optional error message, which gets populated when the job is not + /// run successfully. + final String? message; + + /// Returns the location for the output files. If the caller specified a + /// directory for the output, then this contains the full path to the output + /// file, including the file name generated by the service. + final List? outputFiles; + + GetTransformerJobResponse({ + required this.status, + this.message, + this.outputFiles, + }); + + factory GetTransformerJobResponse.fromJson(Map json) { + return GetTransformerJobResponse( + status: (json['status'] as String).toTransformerJobStatus(), + message: json['message'] as String?, + outputFiles: (json['outputFiles'] as List?) + ?.whereNotNull() + .map((e) => S3Location.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final status = this.status; + final message = this.message; + final outputFiles = this.outputFiles; + return { + 'status': status.toValue(), + if (message != null) 'message': message, + if (outputFiles != null) 'outputFiles': outputFiles, + }; + } +} + +class GetTransformerResponse { + /// Returns a timestamp for creation date and time of the transformer. + final DateTime createdAt; + + /// Returns the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards and + /// corresponding messages that define specific business documents. + final EdiType ediType; + + /// Returns that the currently supported file formats for EDI transformations + /// are JSON and XML. + final FileFormat fileFormat; + + /// Returns the mapping template for the transformer. This template is used to + /// map the parsed EDI file using JSONata or XSLT. + final String mappingTemplate; + + /// Returns the name of the transformer, used to identify it. + final String name; + + /// Returns the state of the newly created transformer. The transformer can be + /// either active or inactive. For the transformer to + /// be used in a capability, its status must active. + final TransformerStatus status; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String transformerArn; + + /// Returns the system-assigned unique identifier for the transformer. + final String transformerId; + + /// Returns a timestamp for last time the transformer was modified. + final DateTime? modifiedAt; + + /// Returns a sample EDI document that is used by a transformer as a guide for + /// processing the EDI data. + final String? sampleDocument; + + GetTransformerResponse({ + required this.createdAt, + required this.ediType, + required this.fileFormat, + required this.mappingTemplate, + required this.name, + required this.status, + required this.transformerArn, + required this.transformerId, + this.modifiedAt, + this.sampleDocument, + }); + + factory GetTransformerResponse.fromJson(Map json) { + return GetTransformerResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + ediType: EdiType.fromJson(json['ediType'] as Map), + fileFormat: (json['fileFormat'] as String).toFileFormat(), + mappingTemplate: json['mappingTemplate'] as String, + name: json['name'] as String, + status: (json['status'] as String).toTransformerStatus(), + transformerArn: json['transformerArn'] as String, + transformerId: json['transformerId'] as String, + modifiedAt: timeStampFromJson(json['modifiedAt']), + sampleDocument: json['sampleDocument'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final ediType = this.ediType; + final fileFormat = this.fileFormat; + final mappingTemplate = this.mappingTemplate; + final name = this.name; + final status = this.status; + final transformerArn = this.transformerArn; + final transformerId = this.transformerId; + final modifiedAt = this.modifiedAt; + final sampleDocument = this.sampleDocument; + return { + 'createdAt': iso8601ToJson(createdAt), + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'mappingTemplate': mappingTemplate, + 'name': name, + 'status': status.toValue(), + 'transformerArn': transformerArn, + 'transformerId': transformerId, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (sampleDocument != null) 'sampleDocument': sampleDocument, + }; + } +} + +class ListCapabilitiesResponse { + /// Returns one or more capabilities associated with this partnership. + final List capabilities; + + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + final String? nextToken; + + ListCapabilitiesResponse({ + required this.capabilities, + this.nextToken, + }); + + factory ListCapabilitiesResponse.fromJson(Map json) { + return ListCapabilitiesResponse( + capabilities: (json['capabilities'] as List) + .whereNotNull() + .map((e) => CapabilitySummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final capabilities = this.capabilities; + final nextToken = this.nextToken; + return { + 'capabilities': capabilities, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListPartnershipsResponse { + /// Specifies a list of your partnerships. + final List partnerships; + + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + final String? nextToken; + + ListPartnershipsResponse({ + required this.partnerships, + this.nextToken, + }); + + factory ListPartnershipsResponse.fromJson(Map json) { + return ListPartnershipsResponse( + partnerships: (json['partnerships'] as List) + .whereNotNull() + .map((e) => PartnershipSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final partnerships = this.partnerships; + final nextToken = this.nextToken; + return { + 'partnerships': partnerships, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListProfilesResponse { + /// Returns an array of ProfileSummary objects. + final List profiles; + + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + final String? nextToken; + + ListProfilesResponse({ + required this.profiles, + this.nextToken, + }); + + factory ListProfilesResponse.fromJson(Map json) { + return ListProfilesResponse( + profiles: (json['profiles'] as List) + .whereNotNull() + .map((e) => ProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final profiles = this.profiles; + final nextToken = this.nextToken; + return { + 'profiles': profiles, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// Returns the key-value pairs assigned to ARNs that you can use to group and + /// search for resources by type. You can attach this metadata to resources + /// (capabilities, partnerships, and so on) for any purpose. + final List? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'Tags': tags, + }; + } +} + +class ListTransformersResponse { + /// Returns an array of one or more transformer objects. + /// + /// For each transformer, a TransformerSummary object is returned. + /// The TransformerSummary contains all the details for a specific + /// transformer. + final List transformers; + + /// When additional results are obtained from the command, a + /// NextToken parameter is returned in the output. You can then + /// pass the NextToken parameter in a subsequent command to + /// continue listing additional resources. + final String? nextToken; + + ListTransformersResponse({ + required this.transformers, + this.nextToken, + }); + + factory ListTransformersResponse.fromJson(Map json) { + return ListTransformersResponse( + transformers: (json['transformers'] as List) + .whereNotNull() + .map((e) => TransformerSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final transformers = this.transformers; + final nextToken = this.nextToken; + return { + 'transformers': transformers, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +enum Logging { + enabled, + disabled, +} + +extension LoggingValueExtension on Logging { + String toValue() { + switch (this) { + case Logging.enabled: + return 'ENABLED'; + case Logging.disabled: + return 'DISABLED'; + } + } +} + +extension LoggingFromString on String { + Logging toLogging() { + switch (this) { + case 'ENABLED': + return Logging.enabled; + case 'DISABLED': + return Logging.disabled; + } + throw Exception('$this is not known in enum Logging'); + } +} + +/// A structure that contains the details for a partnership. A partnership +/// represents the connection between you and your trading partner. It ties +/// together a profile and one or more trading capabilities. +class PartnershipSummary { + /// Returns a timestamp for creation date and time of the partnership. + final DateTime createdAt; + + /// Returns the unique, system-generated identifier for a partnership. + final String partnershipId; + + /// Returns the unique, system-generated identifier for the profile connected to + /// this partnership. + final String profileId; + + /// Returns one or more capabilities associated with this partnership. + final List? capabilities; + + /// Returns a timestamp that identifies the most recent date and time that the + /// partnership was modified. + final DateTime? modifiedAt; + + /// Returns the name of the partnership. + final String? name; + + /// Returns the unique, system-generated identifier for a trading partner. + final String? tradingPartnerId; + + PartnershipSummary({ + required this.createdAt, + required this.partnershipId, + required this.profileId, + this.capabilities, + this.modifiedAt, + this.name, + this.tradingPartnerId, + }); + + factory PartnershipSummary.fromJson(Map json) { + return PartnershipSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + partnershipId: json['partnershipId'] as String, + profileId: json['profileId'] as String, + capabilities: (json['capabilities'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + name: json['name'] as String?, + tradingPartnerId: json['tradingPartnerId'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final partnershipId = this.partnershipId; + final profileId = this.profileId; + final capabilities = this.capabilities; + final modifiedAt = this.modifiedAt; + final name = this.name; + final tradingPartnerId = this.tradingPartnerId; + return { + 'createdAt': iso8601ToJson(createdAt), + 'partnershipId': partnershipId, + 'profileId': profileId, + if (capabilities != null) 'capabilities': capabilities, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (name != null) 'name': name, + if (tradingPartnerId != null) 'tradingPartnerId': tradingPartnerId, + }; + } +} + +/// Contains the details for a profile. A profile is the mechanism used to +/// create the concept of a private network. +class ProfileSummary { + /// Returns the name for the business associated with this profile. + final String businessName; + + /// Returns the timestamp for creation date and time of the profile. + final DateTime createdAt; + + /// Returns the display name for profile. + final String name; + + /// Returns the unique, system-generated identifier for the profile. + final String profileId; + + /// Returns the name of the logging group. + final String? logGroupName; + + /// Specifies whether or not logging is enabled for this profile. + final Logging? logging; + + /// Returns the timestamp that identifies the most recent date and time that the + /// profile was modified. + final DateTime? modifiedAt; + + ProfileSummary({ + required this.businessName, + required this.createdAt, + required this.name, + required this.profileId, + this.logGroupName, + this.logging, + this.modifiedAt, + }); + + factory ProfileSummary.fromJson(Map json) { + return ProfileSummary( + businessName: json['businessName'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + profileId: json['profileId'] as String, + logGroupName: json['logGroupName'] as String?, + logging: (json['logging'] as String?)?.toLogging(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final businessName = this.businessName; + final createdAt = this.createdAt; + final name = this.name; + final profileId = this.profileId; + final logGroupName = this.logGroupName; + final logging = this.logging; + final modifiedAt = this.modifiedAt; + return { + 'businessName': businessName, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'profileId': profileId, + if (logGroupName != null) 'logGroupName': logGroupName, + if (logging != null) 'logging': logging.toValue(), + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +/// Specifies the details for the Amazon S3 file location that is being used +/// with Amazon Web Services B2BI Data Interchange. File locations in Amazon S3 +/// are identified using a combination of the bucket and key. +class S3Location { + /// Specifies the name of the Amazon S3 bucket. + final String? bucketName; + + /// Specifies the Amazon S3 key for the file location. + final String? key; + + S3Location({ + this.bucketName, + this.key, + }); + + factory S3Location.fromJson(Map json) { + return S3Location( + bucketName: json['bucketName'] as String?, + key: json['key'] as String?, + ); + } + + Map toJson() { + final bucketName = this.bucketName; + final key = this.key; + return { + if (bucketName != null) 'bucketName': bucketName, + if (key != null) 'key': key, + }; + } +} + +class StartTransformerJobResponse { + /// Returns the unique, system-generated identifier for a transformer run. + final String transformerJobId; + + StartTransformerJobResponse({ + required this.transformerJobId, + }); + + factory StartTransformerJobResponse.fromJson(Map json) { + return StartTransformerJobResponse( + transformerJobId: json['transformerJobId'] as String, + ); + } + + Map toJson() { + final transformerJobId = this.transformerJobId; + return { + 'transformerJobId': transformerJobId, + }; + } +} + +/// Creates a key-value pair for a specific resource. Tags are metadata that you +/// can use to search for and group a resource for various purposes. You can +/// apply tags to capabilities, partnerships, profiles and transformers. A tag +/// key can take more than one value. For example, to group capabilities for +/// accounting purposes, you might create a tag called Group and +/// assign the values Research and Accounting to that +/// group. +class Tag { + /// Specifies the name assigned to the tag that you create. + final String key; + + /// Contains one or more values that you assigned to the key name that you + /// create. + final String value; + + Tag({ + required this.key, + required this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +class TestMappingResponse { + /// Returns a string for the mapping that can be used to identify the mapping. + /// Similar to a fingerprint + final String mappedFileContent; + + TestMappingResponse({ + required this.mappedFileContent, + }); + + factory TestMappingResponse.fromJson(Map json) { + return TestMappingResponse( + mappedFileContent: json['mappedFileContent'] as String, + ); + } + + Map toJson() { + final mappedFileContent = this.mappedFileContent; + return { + 'mappedFileContent': mappedFileContent, + }; + } +} + +class TestParsingResponse { + /// Returns the contents of the input file being tested, parsed according to the + /// specified EDI (electronic data interchange) type. + final String parsedFileContent; + + TestParsingResponse({ + required this.parsedFileContent, + }); + + factory TestParsingResponse.fromJson(Map json) { + return TestParsingResponse( + parsedFileContent: json['parsedFileContent'] as String, + ); + } + + Map toJson() { + final parsedFileContent = this.parsedFileContent; + return { + 'parsedFileContent': parsedFileContent, + }; + } +} + +enum TransformerJobStatus { + running, + succeeded, + failed, +} + +extension TransformerJobStatusValueExtension on TransformerJobStatus { + String toValue() { + switch (this) { + case TransformerJobStatus.running: + return 'running'; + case TransformerJobStatus.succeeded: + return 'succeeded'; + case TransformerJobStatus.failed: + return 'failed'; + } + } +} + +extension TransformerJobStatusFromString on String { + TransformerJobStatus toTransformerJobStatus() { + switch (this) { + case 'running': + return TransformerJobStatus.running; + case 'succeeded': + return TransformerJobStatus.succeeded; + case 'failed': + return TransformerJobStatus.failed; + } + throw Exception('$this is not known in enum TransformerJobStatus'); + } +} + +enum TransformerStatus { + active, + inactive, +} + +extension TransformerStatusValueExtension on TransformerStatus { + String toValue() { + switch (this) { + case TransformerStatus.active: + return 'active'; + case TransformerStatus.inactive: + return 'inactive'; + } + } +} + +extension TransformerStatusFromString on String { + TransformerStatus toTransformerStatus() { + switch (this) { + case 'active': + return TransformerStatus.active; + case 'inactive': + return TransformerStatus.inactive; + } + throw Exception('$this is not known in enum TransformerStatus'); + } +} + +/// Contains the details for a transformer object. A transformer describes how +/// to process the incoming EDI documents and extract the necessary information +/// to the output file. +class TransformerSummary { + /// Returns a timestamp indicating when the transformer was created. For + /// example, 2023-07-20T19:58:44.624Z. + final DateTime createdAt; + + /// Returns the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards and + /// corresponding messages that define specific business documents. + final EdiType ediType; + + /// Returns that the currently supported file formats for EDI transformations + /// are JSON and XML. + final FileFormat fileFormat; + + /// Returns the mapping template for the transformer. This template is used to + /// map the parsed EDI file using JSONata or XSLT. + final String mappingTemplate; + + /// Returns the descriptive name for the transformer. + final String name; + + /// Returns the state of the newly created transformer. The transformer can be + /// either active or inactive. For the transformer to + /// be used in a capability, its status must active. + final TransformerStatus status; + + /// Returns the system-assigned unique identifier for the transformer. + final String transformerId; + + /// Returns a timestamp representing the date and time for the most recent + /// change for the transformer object. + final DateTime? modifiedAt; + + /// Returns a sample EDI document that is used by a transformer as a guide for + /// processing the EDI data. + final String? sampleDocument; + + TransformerSummary({ + required this.createdAt, + required this.ediType, + required this.fileFormat, + required this.mappingTemplate, + required this.name, + required this.status, + required this.transformerId, + this.modifiedAt, + this.sampleDocument, + }); + + factory TransformerSummary.fromJson(Map json) { + return TransformerSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + ediType: EdiType.fromJson(json['ediType'] as Map), + fileFormat: (json['fileFormat'] as String).toFileFormat(), + mappingTemplate: json['mappingTemplate'] as String, + name: json['name'] as String, + status: (json['status'] as String).toTransformerStatus(), + transformerId: json['transformerId'] as String, + modifiedAt: timeStampFromJson(json['modifiedAt']), + sampleDocument: json['sampleDocument'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final ediType = this.ediType; + final fileFormat = this.fileFormat; + final mappingTemplate = this.mappingTemplate; + final name = this.name; + final status = this.status; + final transformerId = this.transformerId; + final modifiedAt = this.modifiedAt; + final sampleDocument = this.sampleDocument; + return { + 'createdAt': iso8601ToJson(createdAt), + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'mappingTemplate': mappingTemplate, + 'name': name, + 'status': status.toValue(), + 'transformerId': transformerId, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (sampleDocument != null) 'sampleDocument': sampleDocument, + }; + } +} + +class UpdateCapabilityResponse { + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String capabilityArn; + + /// Returns a system-assigned unique identifier for the capability. + final String capabilityId; + + /// Returns a structure that contains the details for a capability. + final CapabilityConfiguration configuration; + + /// Returns a timestamp for creation date and time of the capability. + final DateTime createdAt; + + /// Returns the name of the capability, used to identify it. + final String name; + + /// Returns the type of the capability. Currently, only edi is + /// supported. + final CapabilityType type; + + /// Returns one or more locations in Amazon S3, each specifying an EDI document + /// that can be used with this capability. Each item contains the name of the + /// bucket and the key, to identify the document's location. + final List? instructionsDocuments; + + /// Returns a timestamp for last time the capability was modified. + final DateTime? modifiedAt; + + UpdateCapabilityResponse({ + required this.capabilityArn, + required this.capabilityId, + required this.configuration, + required this.createdAt, + required this.name, + required this.type, + this.instructionsDocuments, + this.modifiedAt, + }); + + factory UpdateCapabilityResponse.fromJson(Map json) { + return UpdateCapabilityResponse( + capabilityArn: json['capabilityArn'] as String, + capabilityId: json['capabilityId'] as String, + configuration: CapabilityConfiguration.fromJson( + json['configuration'] as Map), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + type: (json['type'] as String).toCapabilityType(), + instructionsDocuments: (json['instructionsDocuments'] as List?) + ?.whereNotNull() + .map((e) => S3Location.fromJson(e as Map)) + .toList(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final capabilityArn = this.capabilityArn; + final capabilityId = this.capabilityId; + final configuration = this.configuration; + final createdAt = this.createdAt; + final name = this.name; + final type = this.type; + final instructionsDocuments = this.instructionsDocuments; + final modifiedAt = this.modifiedAt; + return { + 'capabilityArn': capabilityArn, + 'capabilityId': capabilityId, + 'configuration': configuration, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'type': type.toValue(), + if (instructionsDocuments != null) + 'instructionsDocuments': instructionsDocuments, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +class UpdatePartnershipResponse { + /// Returns a timestamp that identifies the most recent date and time that the + /// partnership was modified. + final DateTime createdAt; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String partnershipArn; + + /// Returns the unique, system-generated identifier for a partnership. + final String partnershipId; + + /// Returns the unique, system-generated identifier for the profile connected to + /// this partnership. + final String profileId; + + /// Returns one or more capabilities associated with this partnership. + final List? capabilities; + + /// Returns the email address associated with this trading partner. + final String? email; + + /// Returns a timestamp that identifies the most recent date and time that the + /// partnership was modified. + final DateTime? modifiedAt; + + /// The name of the partnership, used to identify it. + final String? name; + + /// Returns the phone number associated with the partnership. + final String? phone; + + /// Returns the unique, system-generated identifier for a trading partner. + final String? tradingPartnerId; + + UpdatePartnershipResponse({ + required this.createdAt, + required this.partnershipArn, + required this.partnershipId, + required this.profileId, + this.capabilities, + this.email, + this.modifiedAt, + this.name, + this.phone, + this.tradingPartnerId, + }); + + factory UpdatePartnershipResponse.fromJson(Map json) { + return UpdatePartnershipResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + partnershipArn: json['partnershipArn'] as String, + partnershipId: json['partnershipId'] as String, + profileId: json['profileId'] as String, + capabilities: (json['capabilities'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + email: json['email'] as String?, + modifiedAt: timeStampFromJson(json['modifiedAt']), + name: json['name'] as String?, + phone: json['phone'] as String?, + tradingPartnerId: json['tradingPartnerId'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final partnershipArn = this.partnershipArn; + final partnershipId = this.partnershipId; + final profileId = this.profileId; + final capabilities = this.capabilities; + final email = this.email; + final modifiedAt = this.modifiedAt; + final name = this.name; + final phone = this.phone; + final tradingPartnerId = this.tradingPartnerId; + return { + 'createdAt': iso8601ToJson(createdAt), + 'partnershipArn': partnershipArn, + 'partnershipId': partnershipId, + 'profileId': profileId, + if (capabilities != null) 'capabilities': capabilities, + if (email != null) 'email': email, + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + if (name != null) 'name': name, + if (phone != null) 'phone': phone, + if (tradingPartnerId != null) 'tradingPartnerId': tradingPartnerId, + }; + } +} + +class UpdateProfileResponse { + /// Returns the name for the business associated with this profile. + final String businessName; + + /// Returns a timestamp for creation date and time of the profile. + final DateTime createdAt; + + /// Returns the name of the profile. + final String name; + + /// Returns the phone number associated with the profile. + final String phone; + + /// Returns an Amazon Resource Name (ARN) for the profile. + final String profileArn; + + /// Returns the unique, system-generated identifier for the profile. + final String profileId; + + /// Returns the email address associated with this customer profile. + final String? email; + + /// Returns the name of the logging group. + final String? logGroupName; + + /// Specifies whether or not logging is enabled for this profile. + final Logging? logging; + + /// Returns a timestamp for last time the profile was modified. + final DateTime? modifiedAt; + + UpdateProfileResponse({ + required this.businessName, + required this.createdAt, + required this.name, + required this.phone, + required this.profileArn, + required this.profileId, + this.email, + this.logGroupName, + this.logging, + this.modifiedAt, + }); + + factory UpdateProfileResponse.fromJson(Map json) { + return UpdateProfileResponse( + businessName: json['businessName'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + name: json['name'] as String, + phone: json['phone'] as String, + profileArn: json['profileArn'] as String, + profileId: json['profileId'] as String, + email: json['email'] as String?, + logGroupName: json['logGroupName'] as String?, + logging: (json['logging'] as String?)?.toLogging(), + modifiedAt: timeStampFromJson(json['modifiedAt']), + ); + } + + Map toJson() { + final businessName = this.businessName; + final createdAt = this.createdAt; + final name = this.name; + final phone = this.phone; + final profileArn = this.profileArn; + final profileId = this.profileId; + final email = this.email; + final logGroupName = this.logGroupName; + final logging = this.logging; + final modifiedAt = this.modifiedAt; + return { + 'businessName': businessName, + 'createdAt': iso8601ToJson(createdAt), + 'name': name, + 'phone': phone, + 'profileArn': profileArn, + 'profileId': profileId, + if (email != null) 'email': email, + if (logGroupName != null) 'logGroupName': logGroupName, + if (logging != null) 'logging': logging.toValue(), + if (modifiedAt != null) 'modifiedAt': iso8601ToJson(modifiedAt), + }; + } +} + +class UpdateTransformerResponse { + /// Returns a timestamp for creation date and time of the transformer. + final DateTime createdAt; + + /// Returns the details for the EDI standard that is being used for the + /// transformer. Currently, only X12 is supported. X12 is a set of standards and + /// corresponding messages that define specific business documents. + final EdiType ediType; + + /// Returns that the currently supported file formats for EDI transformations + /// are JSON and XML. + final FileFormat fileFormat; + + /// Returns the mapping template for the transformer. This template is used to + /// map the parsed EDI file using JSONata or XSLT. + final String mappingTemplate; + + /// Returns a timestamp for last time the transformer was modified. + final DateTime modifiedAt; + + /// Returns the name of the transformer. + final String name; + + /// Returns the state of the newly created transformer. The transformer can be + /// either active or inactive. For the transformer to + /// be used in a capability, its status must active. + final TransformerStatus status; + + /// Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services + /// resource, such as a capability, partnership, profile, or transformer. + final String transformerArn; + + /// Returns the system-assigned unique identifier for the transformer. + final String transformerId; + + /// Returns a sample EDI document that is used by a transformer as a guide for + /// processing the EDI data. + final String? sampleDocument; + + UpdateTransformerResponse({ + required this.createdAt, + required this.ediType, + required this.fileFormat, + required this.mappingTemplate, + required this.modifiedAt, + required this.name, + required this.status, + required this.transformerArn, + required this.transformerId, + this.sampleDocument, + }); + + factory UpdateTransformerResponse.fromJson(Map json) { + return UpdateTransformerResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + ediType: EdiType.fromJson(json['ediType'] as Map), + fileFormat: (json['fileFormat'] as String).toFileFormat(), + mappingTemplate: json['mappingTemplate'] as String, + modifiedAt: nonNullableTimeStampFromJson(json['modifiedAt'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toTransformerStatus(), + transformerArn: json['transformerArn'] as String, + transformerId: json['transformerId'] as String, + sampleDocument: json['sampleDocument'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final ediType = this.ediType; + final fileFormat = this.fileFormat; + final mappingTemplate = this.mappingTemplate; + final modifiedAt = this.modifiedAt; + final name = this.name; + final status = this.status; + final transformerArn = this.transformerArn; + final transformerId = this.transformerId; + final sampleDocument = this.sampleDocument; + return { + 'createdAt': iso8601ToJson(createdAt), + 'ediType': ediType, + 'fileFormat': fileFormat.toValue(), + 'mappingTemplate': mappingTemplate, + 'modifiedAt': iso8601ToJson(modifiedAt), + 'name': name, + 'status': status.toValue(), + 'transformerArn': transformerArn, + 'transformerId': transformerId, + if (sampleDocument != null) 'sampleDocument': sampleDocument, + }; + } +} + +/// A structure that contains the X12 transaction set and version. The X12 +/// structure is used when the system transforms an EDI (electronic data +/// interchange) file. +/// +/// If an EDI input file contains more than one transaction, each transaction +/// must have the same transaction set and version, for example 214/4010. If +/// not, the transformer cannot parse the file. +/// +class X12Details { + /// Returns an enumerated type where each value identifies an X12 transaction + /// set. Transaction sets are maintained by the X12 Accredited Standards + /// Committee. + final X12TransactionSet? transactionSet; + + /// Returns the version to use for the specified X12 transaction set. + ///
     </p> 
    + final X12Version? version; + + X12Details({ + this.transactionSet, + this.version, + }); + + factory X12Details.fromJson(Map json) { + return X12Details( + transactionSet: + (json['transactionSet'] as String?)?.toX12TransactionSet(), + version: (json['version'] as String?)?.toX12Version(), + ); + } + + Map toJson() { + final transactionSet = this.transactionSet; + final version = this.version; + return { + if (transactionSet != null) 'transactionSet': transactionSet.toValue(), + if (version != null) 'version': version.toValue(), + }; + } +} + +enum X12TransactionSet { + x12_110, + x12_180, + x12_204, + x12_210, + x12_211, + x12_214, + x12_215, + x12_259, + x12_260, + x12_266, + x12_269, + x12_270, + x12_271, + x12_274, + x12_275, + x12_276, + x12_277, + x12_278, + x12_310, + x12_315, + x12_322, + x12_404, + x12_410, + x12_417, + x12_421, + x12_426, + x12_810, + x12_820, + x12_824, + x12_830, + x12_832, + x12_834, + x12_835, + x12_837, + x12_844, + x12_846, + x12_849, + x12_850, + x12_852, + x12_855, + x12_856, + x12_860, + x12_861, + x12_864, + x12_865, + x12_869, + x12_870, + x12_940, + x12_945, + x12_990, + x12_997, + x12_999, + x12_270x279, + x12_271x279, + x12_275x210, + x12_275x211, + x12_276x212, + x12_277x212, + x12_277x214, + x12_277x364, + x12_278x217, + x12_820x218, + x12_820x306, + x12_824x186, + x12_834x220, + x12_834x307, + x12_834x318, + x12_835x221, + x12_837x222, + x12_837x223, + x12_837x224, + x12_837x291, + x12_837x292, + x12_837x298, + x12_999x231, +} + +extension X12TransactionSetValueExtension on X12TransactionSet { + String toValue() { + switch (this) { + case X12TransactionSet.x12_110: + return 'X12_110'; + case X12TransactionSet.x12_180: + return 'X12_180'; + case X12TransactionSet.x12_204: + return 'X12_204'; + case X12TransactionSet.x12_210: + return 'X12_210'; + case X12TransactionSet.x12_211: + return 'X12_211'; + case X12TransactionSet.x12_214: + return 'X12_214'; + case X12TransactionSet.x12_215: + return 'X12_215'; + case X12TransactionSet.x12_259: + return 'X12_259'; + case X12TransactionSet.x12_260: + return 'X12_260'; + case X12TransactionSet.x12_266: + return 'X12_266'; + case X12TransactionSet.x12_269: + return 'X12_269'; + case X12TransactionSet.x12_270: + return 'X12_270'; + case X12TransactionSet.x12_271: + return 'X12_271'; + case X12TransactionSet.x12_274: + return 'X12_274'; + case X12TransactionSet.x12_275: + return 'X12_275'; + case X12TransactionSet.x12_276: + return 'X12_276'; + case X12TransactionSet.x12_277: + return 'X12_277'; + case X12TransactionSet.x12_278: + return 'X12_278'; + case X12TransactionSet.x12_310: + return 'X12_310'; + case X12TransactionSet.x12_315: + return 'X12_315'; + case X12TransactionSet.x12_322: + return 'X12_322'; + case X12TransactionSet.x12_404: + return 'X12_404'; + case X12TransactionSet.x12_410: + return 'X12_410'; + case X12TransactionSet.x12_417: + return 'X12_417'; + case X12TransactionSet.x12_421: + return 'X12_421'; + case X12TransactionSet.x12_426: + return 'X12_426'; + case X12TransactionSet.x12_810: + return 'X12_810'; + case X12TransactionSet.x12_820: + return 'X12_820'; + case X12TransactionSet.x12_824: + return 'X12_824'; + case X12TransactionSet.x12_830: + return 'X12_830'; + case X12TransactionSet.x12_832: + return 'X12_832'; + case X12TransactionSet.x12_834: + return 'X12_834'; + case X12TransactionSet.x12_835: + return 'X12_835'; + case X12TransactionSet.x12_837: + return 'X12_837'; + case X12TransactionSet.x12_844: + return 'X12_844'; + case X12TransactionSet.x12_846: + return 'X12_846'; + case X12TransactionSet.x12_849: + return 'X12_849'; + case X12TransactionSet.x12_850: + return 'X12_850'; + case X12TransactionSet.x12_852: + return 'X12_852'; + case X12TransactionSet.x12_855: + return 'X12_855'; + case X12TransactionSet.x12_856: + return 'X12_856'; + case X12TransactionSet.x12_860: + return 'X12_860'; + case X12TransactionSet.x12_861: + return 'X12_861'; + case X12TransactionSet.x12_864: + return 'X12_864'; + case X12TransactionSet.x12_865: + return 'X12_865'; + case X12TransactionSet.x12_869: + return 'X12_869'; + case X12TransactionSet.x12_870: + return 'X12_870'; + case X12TransactionSet.x12_940: + return 'X12_940'; + case X12TransactionSet.x12_945: + return 'X12_945'; + case X12TransactionSet.x12_990: + return 'X12_990'; + case X12TransactionSet.x12_997: + return 'X12_997'; + case X12TransactionSet.x12_999: + return 'X12_999'; + case X12TransactionSet.x12_270x279: + return 'X12_270_X279'; + case X12TransactionSet.x12_271x279: + return 'X12_271_X279'; + case X12TransactionSet.x12_275x210: + return 'X12_275_X210'; + case X12TransactionSet.x12_275x211: + return 'X12_275_X211'; + case X12TransactionSet.x12_276x212: + return 'X12_276_X212'; + case X12TransactionSet.x12_277x212: + return 'X12_277_X212'; + case X12TransactionSet.x12_277x214: + return 'X12_277_X214'; + case X12TransactionSet.x12_277x364: + return 'X12_277_X364'; + case X12TransactionSet.x12_278x217: + return 'X12_278_X217'; + case X12TransactionSet.x12_820x218: + return 'X12_820_X218'; + case X12TransactionSet.x12_820x306: + return 'X12_820_X306'; + case X12TransactionSet.x12_824x186: + return 'X12_824_X186'; + case X12TransactionSet.x12_834x220: + return 'X12_834_X220'; + case X12TransactionSet.x12_834x307: + return 'X12_834_X307'; + case X12TransactionSet.x12_834x318: + return 'X12_834_X318'; + case X12TransactionSet.x12_835x221: + return 'X12_835_X221'; + case X12TransactionSet.x12_837x222: + return 'X12_837_X222'; + case X12TransactionSet.x12_837x223: + return 'X12_837_X223'; + case X12TransactionSet.x12_837x224: + return 'X12_837_X224'; + case X12TransactionSet.x12_837x291: + return 'X12_837_X291'; + case X12TransactionSet.x12_837x292: + return 'X12_837_X292'; + case X12TransactionSet.x12_837x298: + return 'X12_837_X298'; + case X12TransactionSet.x12_999x231: + return 'X12_999_X231'; + } + } +} + +extension X12TransactionSetFromString on String { + X12TransactionSet toX12TransactionSet() { + switch (this) { + case 'X12_110': + return X12TransactionSet.x12_110; + case 'X12_180': + return X12TransactionSet.x12_180; + case 'X12_204': + return X12TransactionSet.x12_204; + case 'X12_210': + return X12TransactionSet.x12_210; + case 'X12_211': + return X12TransactionSet.x12_211; + case 'X12_214': + return X12TransactionSet.x12_214; + case 'X12_215': + return X12TransactionSet.x12_215; + case 'X12_259': + return X12TransactionSet.x12_259; + case 'X12_260': + return X12TransactionSet.x12_260; + case 'X12_266': + return X12TransactionSet.x12_266; + case 'X12_269': + return X12TransactionSet.x12_269; + case 'X12_270': + return X12TransactionSet.x12_270; + case 'X12_271': + return X12TransactionSet.x12_271; + case 'X12_274': + return X12TransactionSet.x12_274; + case 'X12_275': + return X12TransactionSet.x12_275; + case 'X12_276': + return X12TransactionSet.x12_276; + case 'X12_277': + return X12TransactionSet.x12_277; + case 'X12_278': + return X12TransactionSet.x12_278; + case 'X12_310': + return X12TransactionSet.x12_310; + case 'X12_315': + return X12TransactionSet.x12_315; + case 'X12_322': + return X12TransactionSet.x12_322; + case 'X12_404': + return X12TransactionSet.x12_404; + case 'X12_410': + return X12TransactionSet.x12_410; + case 'X12_417': + return X12TransactionSet.x12_417; + case 'X12_421': + return X12TransactionSet.x12_421; + case 'X12_426': + return X12TransactionSet.x12_426; + case 'X12_810': + return X12TransactionSet.x12_810; + case 'X12_820': + return X12TransactionSet.x12_820; + case 'X12_824': + return X12TransactionSet.x12_824; + case 'X12_830': + return X12TransactionSet.x12_830; + case 'X12_832': + return X12TransactionSet.x12_832; + case 'X12_834': + return X12TransactionSet.x12_834; + case 'X12_835': + return X12TransactionSet.x12_835; + case 'X12_837': + return X12TransactionSet.x12_837; + case 'X12_844': + return X12TransactionSet.x12_844; + case 'X12_846': + return X12TransactionSet.x12_846; + case 'X12_849': + return X12TransactionSet.x12_849; + case 'X12_850': + return X12TransactionSet.x12_850; + case 'X12_852': + return X12TransactionSet.x12_852; + case 'X12_855': + return X12TransactionSet.x12_855; + case 'X12_856': + return X12TransactionSet.x12_856; + case 'X12_860': + return X12TransactionSet.x12_860; + case 'X12_861': + return X12TransactionSet.x12_861; + case 'X12_864': + return X12TransactionSet.x12_864; + case 'X12_865': + return X12TransactionSet.x12_865; + case 'X12_869': + return X12TransactionSet.x12_869; + case 'X12_870': + return X12TransactionSet.x12_870; + case 'X12_940': + return X12TransactionSet.x12_940; + case 'X12_945': + return X12TransactionSet.x12_945; + case 'X12_990': + return X12TransactionSet.x12_990; + case 'X12_997': + return X12TransactionSet.x12_997; + case 'X12_999': + return X12TransactionSet.x12_999; + case 'X12_270_X279': + return X12TransactionSet.x12_270x279; + case 'X12_271_X279': + return X12TransactionSet.x12_271x279; + case 'X12_275_X210': + return X12TransactionSet.x12_275x210; + case 'X12_275_X211': + return X12TransactionSet.x12_275x211; + case 'X12_276_X212': + return X12TransactionSet.x12_276x212; + case 'X12_277_X212': + return X12TransactionSet.x12_277x212; + case 'X12_277_X214': + return X12TransactionSet.x12_277x214; + case 'X12_277_X364': + return X12TransactionSet.x12_277x364; + case 'X12_278_X217': + return X12TransactionSet.x12_278x217; + case 'X12_820_X218': + return X12TransactionSet.x12_820x218; + case 'X12_820_X306': + return X12TransactionSet.x12_820x306; + case 'X12_824_X186': + return X12TransactionSet.x12_824x186; + case 'X12_834_X220': + return X12TransactionSet.x12_834x220; + case 'X12_834_X307': + return X12TransactionSet.x12_834x307; + case 'X12_834_X318': + return X12TransactionSet.x12_834x318; + case 'X12_835_X221': + return X12TransactionSet.x12_835x221; + case 'X12_837_X222': + return X12TransactionSet.x12_837x222; + case 'X12_837_X223': + return X12TransactionSet.x12_837x223; + case 'X12_837_X224': + return X12TransactionSet.x12_837x224; + case 'X12_837_X291': + return X12TransactionSet.x12_837x291; + case 'X12_837_X292': + return X12TransactionSet.x12_837x292; + case 'X12_837_X298': + return X12TransactionSet.x12_837x298; + case 'X12_999_X231': + return X12TransactionSet.x12_999x231; + } + throw Exception('$this is not known in enum X12TransactionSet'); + } +} + +enum X12Version { + version_4010, + version_4030, + version_5010, + version_5010Hipaa, +} + +extension X12VersionValueExtension on X12Version { + String toValue() { + switch (this) { + case X12Version.version_4010: + return 'VERSION_4010'; + case X12Version.version_4030: + return 'VERSION_4030'; + case X12Version.version_5010: + return 'VERSION_5010'; + case X12Version.version_5010Hipaa: + return 'VERSION_5010_HIPAA'; + } + } +} + +extension X12VersionFromString on String { + X12Version toX12Version() { + switch (this) { + case 'VERSION_4010': + return X12Version.version_4010; + case 'VERSION_4030': + return X12Version.version_4030; + case 'VERSION_5010': + return X12Version.version_5010; + case 'VERSION_5010_HIPAA': + return X12Version.version_5010Hipaa; + } + throw Exception('$this is not known in enum X12Version'); + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/backup/v2018_11_15.dart b/aws_client/lib/src/generated/backup/v2018_11_15.dart index d95fe889d..129f825f9 100644 --- a/aws_client/lib/src/generated/backup/v2018_11_15.dart +++ b/aws_client/lib/src/generated/backup/v2018_11_15.dart @@ -351,6 +351,81 @@ class Backup { return CreateLegalHoldOutput.fromJson(response); } + /// This request creates a logical container to where backups may be copied. + /// + /// This request includes a name, the Region, the maximum number of retention + /// days, the minimum number of retention days, and optionally can include + /// tags and a creator request ID. + /// + /// Do not include sensitive data, such as passport numbers, in the name of a + /// backup vault. + /// + /// + /// May throw [AlreadyExistsException]. + /// May throw [InvalidParameterValueException]. + /// May throw [LimitExceededException]. + /// May throw [MissingParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [backupVaultName] : + /// This is the name of the vault that is being created. + /// + /// Parameter [maxRetentionDays] : + /// This is the setting that specifies the maximum retention period that the + /// vault retains its recovery points. If this parameter is not specified, + /// Backup does not enforce a maximum retention period on the recovery points + /// in the vault (allowing indefinite storage). + /// + /// If specified, any backup or copy job to the vault must have a lifecycle + /// policy with a retention period equal to or shorter than the maximum + /// retention period. If the job retention period is longer than that maximum + /// retention period, then the vault fails the backup or copy job, and you + /// should either modify your lifecycle settings or use a different vault. + /// + /// Parameter [minRetentionDays] : + /// This setting specifies the minimum retention period that the vault retains + /// its recovery points. If this parameter is not specified, no minimum + /// retention period is enforced. + /// + /// If specified, any backup or copy job to the vault must have a lifecycle + /// policy with a retention period equal to or longer than the minimum + /// retention period. If a job retention period is shorter than that minimum + /// retention period, then the vault fails the backup or copy job, and you + /// should either modify your lifecycle settings or use a different vault. + /// + /// Parameter [backupVaultTags] : + /// These are the tags that will be included in the newly-created vault. + /// + /// Parameter [creatorRequestId] : + /// This is the ID of the creation request. + /// + /// This parameter is optional. If used, this parameter must contain 1 to 50 + /// alphanumeric or '-_.' characters. + Future + createLogicallyAirGappedBackupVault({ + required String backupVaultName, + required int maxRetentionDays, + required int minRetentionDays, + Map? backupVaultTags, + String? creatorRequestId, + }) async { + final $payload = { + 'MaxRetentionDays': maxRetentionDays, + 'MinRetentionDays': minRetentionDays, + if (backupVaultTags != null) 'BackupVaultTags': backupVaultTags, + if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/logically-air-gapped-backup-vaults/${Uri.encodeComponent(backupVaultName)}', + exceptionFnMap: _exceptionFns, + ); + return CreateLogicallyAirGappedBackupVaultOutput.fromJson(response); + } + /// Creates a report plan. A report plan is a document that contains /// information about the contents of the report and where Backup will deliver /// it. @@ -424,6 +499,141 @@ class Backup { return CreateReportPlanOutput.fromJson(response); } + /// This is the first of two steps to create a restore testing plan; once this + /// request is successful, finish the procedure with request + /// CreateRestoreTestingSelection. + /// + /// You must include the parameter RestoreTestingPlan. You may optionally + /// include CreatorRequestId and Tags. + /// + /// May throw [AlreadyExistsException]. + /// May throw [ConflictException]. + /// May throw [InvalidParameterValueException]. + /// May throw [LimitExceededException]. + /// May throw [MissingParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlan] : + /// A restore testing plan must contain a unique + /// RestoreTestingPlanName string you create and must contain a + /// ScheduleExpression cron. You may optionally include a + /// StartWindowHours integer and a CreatorRequestId + /// string. + /// + /// The RestoreTestingPlanName is a unique string that is the + /// name of the restore testing plan. This cannot be changed after creation, + /// and it must consist of only alphanumeric characters and underscores. + /// + /// Parameter [creatorRequestId] : + /// This is a unique string that identifies the request and allows failed + /// requests to be retriedwithout the risk of running the operation twice. + /// This parameter is optional. If used, this parameter must contain 1 to 50 + /// alphanumeric or '-_.' characters. + /// + /// Parameter [tags] : + /// Optional tags to include. A tag is a key-value pair you can use to manage, + /// filter, and search for your resources. Allowed characters include UTF-8 + /// letters,numbers, spaces, and the following characters: + - = . _ : /. + Future createRestoreTestingPlan({ + required RestoreTestingPlanForCreate restoreTestingPlan, + String? creatorRequestId, + Map? tags, + }) async { + final $payload = { + 'RestoreTestingPlan': restoreTestingPlan, + if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/restore-testing/plans', + exceptionFnMap: _exceptionFns, + ); + return CreateRestoreTestingPlanOutput.fromJson(response); + } + + /// This request can be sent after CreateRestoreTestingPlan request returns + /// successfully. This is the second part of creating a resource testing plan, + /// and it must be completed sequentially. + /// + /// This consists of RestoreTestingSelectionName, + /// ProtectedResourceType, and one of the following: + /// + ///
      + ///
    • + /// ProtectedResourceArns + ///
    • + ///
    • + /// ProtectedResourceConditions + ///
    • + ///
    + /// Each protected resource type can have one single value. + /// + /// A restore testing selection can include a wildcard value ("*") for + /// ProtectedResourceArns along with + /// ProtectedResourceConditions. Alternatively, you can include + /// up to 30 specific protected resource ARNs in + /// ProtectedResourceArns. + /// + /// Cannot select by both protected resource types AND specific ARNs. Request + /// will fail if both are included. + /// + /// May throw [AlreadyExistsException]. + /// May throw [InvalidParameterValueException]. + /// May throw [LimitExceededException]. + /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlanName] : + /// Input the restore testing plan name that was returned from the related + /// CreateRestoreTestingPlan request. + /// + /// Parameter [restoreTestingSelection] : + /// This consists of RestoreTestingSelectionName, + /// ProtectedResourceType, and one of the following: + /// + ///
      + ///
    • + /// ProtectedResourceArns + ///
    • + ///
    • + /// ProtectedResourceConditions + ///
    • + ///
    + /// Each protected resource type can have one single value. + /// + /// A restore testing selection can include a wildcard value ("*") for + /// ProtectedResourceArns along with + /// ProtectedResourceConditions. Alternatively, you can include + /// up to 30 specific protected resource ARNs in + /// ProtectedResourceArns. + /// + /// Parameter [creatorRequestId] : + /// This is an optional unique string that identifies the request and allows + /// failed requests to be retried without the risk of running the operation + /// twice. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' + /// characters. + Future createRestoreTestingSelection({ + required String restoreTestingPlanName, + required RestoreTestingSelectionForCreate restoreTestingSelection, + String? creatorRequestId, + }) async { + final $payload = { + 'RestoreTestingSelection': restoreTestingSelection, + if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}/selections', + exceptionFnMap: _exceptionFns, + ); + return CreateRestoreTestingSelectionOutput.fromJson(response); + } + /// Deletes a backup plan. A backup plan can only be deleted after all /// associated selections of resources have been deleted. Deleting a backup /// plan deletes the current version of a backup plan. Previous versions, if @@ -672,6 +882,55 @@ class Backup { ); } + /// This request deletes the specified restore testing plan. + /// + /// Deletion can only successfully occur if all associated restore testing + /// selections are deleted first. + /// + /// May throw [InvalidRequestException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlanName] : + /// Required unique name of the restore testing plan you wish to delete. + Future deleteRestoreTestingPlan({ + required String restoreTestingPlanName, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Input the Restore Testing Plan name and Restore Testing Selection name. + /// + /// All testing selections associated with a restore testing plan must be + /// deleted before the restore testing plan can be deleted. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlanName] : + /// Required unique name of the restore testing plan that contains the restore + /// testing selection you wish to delete. + /// + /// Parameter [restoreTestingSelectionName] : + /// Required unique name of the restore testing selection you wish to delete. + Future deleteRestoreTestingSelection({ + required String restoreTestingPlanName, + required String restoreTestingSelectionName, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}/selections/${Uri.encodeComponent(restoreTestingSelectionName)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Returns backup job details for the specified BackupJobId. /// /// May throw [ResourceNotFoundException]. @@ -706,13 +965,22 @@ class Backup { /// are identified by names that are unique to the account used to create them /// and the Amazon Web Services Region where they are created. They consist of /// lowercase letters, numbers, and hyphens. + /// + /// Parameter [backupVaultAccountId] : + /// This is the account ID of the specified backup vault. Future describeBackupVault({ required String backupVaultName, + String? backupVaultAccountId, }) async { + final $query = >{ + if (backupVaultAccountId != null) + 'backupVaultAccountId': [backupVaultAccountId], + }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: '/backup-vaults/${Uri.encodeComponent(backupVaultName)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); return DescribeBackupVaultOutput.fromJson(response); @@ -820,15 +1088,24 @@ class Backup { /// An Amazon Resource Name (ARN) that uniquely identifies a recovery point; /// for example, /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + /// + /// Parameter [backupVaultAccountId] : + /// This is the account ID of the specified backup vault. Future describeRecoveryPoint({ required String backupVaultName, required String recoveryPointArn, + String? backupVaultAccountId, }) async { + final $query = >{ + if (backupVaultAccountId != null) + 'backupVaultAccountId': [backupVaultAccountId], + }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/recovery-points/${Uri.encodeComponent(recoveryPointArn)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); return DescribeRecoveryPointOutput.fromJson(response); @@ -1209,84 +1486,361 @@ class Backup { /// An Amazon Resource Name (ARN) that uniquely identifies a recovery point; /// for example, /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + /// + /// Parameter [backupVaultAccountId] : + /// This is the account ID of the specified backup vault. Future getRecoveryPointRestoreMetadata({ required String backupVaultName, required String recoveryPointArn, + String? backupVaultAccountId, }) async { + final $query = >{ + if (backupVaultAccountId != null) + 'backupVaultAccountId': [backupVaultAccountId], + }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/recovery-points/${Uri.encodeComponent(recoveryPointArn)}/restore-metadata', + queryParams: $query, exceptionFnMap: _exceptionFns, ); return GetRecoveryPointRestoreMetadataOutput.fromJson(response); } - /// Returns the Amazon Web Services resource types supported by Backup. + /// This request returns the metadata for the specified restore job. /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. /// May throw [ServiceUnavailableException]. - Future getSupportedResourceTypes() async { + /// + /// Parameter [restoreJobId] : + /// This is a unique identifier of a restore job within Backup. + Future getRestoreJobMetadata({ + required String restoreJobId, + }) async { final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/supported-resource-types', + requestUri: '/restore-jobs/${Uri.encodeComponent(restoreJobId)}/metadata', exceptionFnMap: _exceptionFns, ); - return GetSupportedResourceTypesOutput.fromJson(response); + return GetRestoreJobMetadataOutput.fromJson(response); } - /// Returns a list of existing backup jobs for an authenticated account for - /// the last 30 days. For a longer period of time, consider using these monitoring - /// tools. + /// This request returns the minimal required set of metadata needed to start + /// a restore job with secure default settings. BackupVaultName + /// and RecoveryPointArn are required parameters. + /// BackupVaultAccountId is an optional parameter. /// /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. /// - /// Parameter [byAccountId] : - /// The account ID to list the jobs from. Returns only backup jobs associated - /// with the specified account ID. - /// - /// If used from an Organizations management account, passing * - /// returns all jobs across the organization. - /// - /// Parameter [byBackupVaultName] : - /// Returns only backup jobs that will be stored in the specified backup - /// vault. Backup vaults are identified by names that are unique to the - /// account used to create them and the Amazon Web Services Region where they - /// are created. They consist of lowercase letters, numbers, and hyphens. + /// Parameter [backupVaultName] : + /// The name of a logical container where backups are stored. Backup vaults + /// are identified by names that are unique to the account used to create them + /// and the Amazon Web ServicesRegion where they are created. They consist of + /// letters, numbers, and hyphens. /// - /// Parameter [byCompleteAfter] : - /// Returns only backup jobs completed after a date expressed in Unix format - /// and Coordinated Universal Time (UTC). + /// Parameter [recoveryPointArn] : + /// An Amazon Resource Name (ARN) that uniquely identifies a recovery point; + /// for example, + /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. /// - /// Parameter [byCompleteBefore] : - /// Returns only backup jobs completed before a date expressed in Unix format - /// and Coordinated Universal Time (UTC). + /// Parameter [backupVaultAccountId] : + /// This is the account ID of the specified backup vault. + Future + getRestoreTestingInferredMetadata({ + required String backupVaultName, + required String recoveryPointArn, + String? backupVaultAccountId, + }) async { + final $query = >{ + 'BackupVaultName': [backupVaultName], + 'RecoveryPointArn': [recoveryPointArn], + if (backupVaultAccountId != null) + 'BackupVaultAccountId': [backupVaultAccountId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/restore-testing/inferred-metadata', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetRestoreTestingInferredMetadataOutput.fromJson(response); + } + + /// Returns RestoreTestingPlan details for the specified + /// RestoreTestingPlanName. The details are the body of a restore + /// testing plan in JSON format, in addition to plan metadata. /// - /// Parameter [byCreatedAfter] : - /// Returns only backup jobs that were created after the specified date. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. /// - /// Parameter [byCreatedBefore] : - /// Returns only backup jobs that were created before the specified date. + /// Parameter [restoreTestingPlanName] : + /// Required unique name of the restore testing plan. + Future getRestoreTestingPlan({ + required String restoreTestingPlanName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}', + exceptionFnMap: _exceptionFns, + ); + return GetRestoreTestingPlanOutput.fromJson(response); + } + + /// Returns RestoreTestingSelection, which displays resources and elements of + /// the restore testing plan. /// - /// Parameter [byParentJobId] : - /// This is a filter to list child (nested) jobs based on parent job ID. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. /// - /// Parameter [byResourceArn] : - /// Returns only backup jobs that match the specified resource Amazon Resource - /// Name (ARN). + /// Parameter [restoreTestingPlanName] : + /// Required unique name of the restore testing plan. /// - /// Parameter [byResourceType] : - /// Returns only backup jobs for the specified resources: + /// Parameter [restoreTestingSelectionName] : + /// Required unique name of the restore testing selection. + Future getRestoreTestingSelection({ + required String restoreTestingPlanName, + required String restoreTestingSelectionName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}/selections/${Uri.encodeComponent(restoreTestingSelectionName)}', + exceptionFnMap: _exceptionFns, + ); + return GetRestoreTestingSelectionOutput.fromJson(response); + } + + /// Returns the Amazon Web Services resource types supported by Backup. /// - ///
      - ///
    • + /// May throw [ServiceUnavailableException]. + Future getSupportedResourceTypes() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/supported-resource-types', + exceptionFnMap: _exceptionFns, + ); + return GetSupportedResourceTypesOutput.fromJson(response); + } + + /// This is a request for a summary of backup jobs created or running within + /// the most recent 30 days. You can include parameters AccountID, State, + /// ResourceType, MessageCategory, AggregationPeriod, MaxResults, or NextToken + /// to filter results. + /// + /// This request returns a summary that contains Region, Account, State, + /// ResourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [accountId] : + /// Returns the job count for the specified account. + /// + /// If the request is sent from a member account or an account not part of + /// Amazon Web Services Organizations, jobs within requestor's account will be + /// returned. + /// + /// Root, admin, and delegated administrator accounts can use the value ANY to + /// return job counts from every account in the organization. + /// + /// AGGREGATE_ALL aggregates job counts from all accounts within + /// the authenticated organization, then returns the sum. + /// + /// Parameter [aggregationPeriod] : + /// This is the period that sets the boundaries for returned results. + /// + /// Acceptable values include + /// + ///
        + ///
      • + /// ONE_DAY for daily job count for the prior 14 days. + ///
      • + ///
      • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
      • + ///
      • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
      • + ///
      + /// + /// Parameter [maxResults] : + /// This parameter sets the maximum number of items to be returned. + /// + /// The value is an integer. Range of accepted values is from 1 to 500. + /// + /// Parameter [messageCategory] : + /// This parameter returns the job count for the specified message category. + /// + /// Example accepted strings include AccessDenied, + /// Success, and InvalidParameters. See Monitoring + /// for a list of accepted MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message + /// categories and returns the sum. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of + /// resources, NextToken allows you to return more items in your + /// list starting at the location pointed to by the next token. + /// + /// Parameter [resourceType] : + /// Returns the job count for the specified resource type. Use request + /// GetSupportedResourceTypes to obtain strings for supported + /// resource types. + /// + /// The the value ANY returns count of all resource types. + /// + /// AGGREGATE_ALL aggregates job counts for all resource types + /// and returns the sum. + /// + /// The type of Amazon Web Services resource to be backed up; for example, an + /// Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational + /// Database Service (Amazon RDS) database. + /// + /// Parameter [state] : + /// This parameter returns the job count for jobs with the specified state. + /// + /// The the value ANY returns count of all states. + /// + /// AGGREGATE_ALL aggregates job counts for all states and + /// returns the sum. + /// + /// Completed with issues is a status found only in the Backup + /// console. For API, this status refers to jobs with a state of + /// COMPLETED and a MessageCategory with a value + /// other than SUCCESS; that is, the status is completed but + /// comes with a status message. To obtain the job count for Completed + /// with issues, run two GET requests, and subtract the second, smaller + /// number: + /// + /// GET + /// /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&State=COMPLETED + /// + /// GET + /// /audit/backup-job-summaries?AggregationPeriod=FOURTEEN_DAYS&MessageCategory=SUCCESS&State=COMPLETED + Future listBackupJobSummaries({ + String? accountId, + AggregationPeriod? aggregationPeriod, + int? maxResults, + String? messageCategory, + String? nextToken, + String? resourceType, + BackupJobStatus? state, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (accountId != null) 'AccountId': [accountId], + if (aggregationPeriod != null) + 'AggregationPeriod': [aggregationPeriod.toValue()], + if (maxResults != null) 'MaxResults': [maxResults.toString()], + if (messageCategory != null) 'MessageCategory': [messageCategory], + if (nextToken != null) 'NextToken': [nextToken], + if (resourceType != null) 'ResourceType': [resourceType], + if (state != null) 'State': [state.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audit/backup-job-summaries', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListBackupJobSummariesOutput.fromJson(response); + } + + /// Returns a list of existing backup jobs for an authenticated account for + /// the last 30 days. For a longer period of time, consider using these monitoring + /// tools. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [byAccountId] : + /// The account ID to list the jobs from. Returns only backup jobs associated + /// with the specified account ID. + /// + /// If used from an Organizations management account, passing * + /// returns all jobs across the organization. + /// + /// Parameter [byBackupVaultName] : + /// Returns only backup jobs that will be stored in the specified backup + /// vault. Backup vaults are identified by names that are unique to the + /// account used to create them and the Amazon Web Services Region where they + /// are created. They consist of lowercase letters, numbers, and hyphens. + /// + /// Parameter [byCompleteAfter] : + /// Returns only backup jobs completed after a date expressed in Unix format + /// and Coordinated Universal Time (UTC). + /// + /// Parameter [byCompleteBefore] : + /// Returns only backup jobs completed before a date expressed in Unix format + /// and Coordinated Universal Time (UTC). + /// + /// Parameter [byCreatedAfter] : + /// Returns only backup jobs that were created after the specified date. + /// + /// Parameter [byCreatedBefore] : + /// Returns only backup jobs that were created before the specified date. + /// + /// Parameter [byMessageCategory] : + /// This is an optional parameter that can be used to filter out jobs with a + /// MessageCategory which matches the value you input. + /// + /// Example strings may include AccessDenied, + /// SUCCESS, AGGREGATE_ALL, and + /// InvalidParameters. + /// + /// View Monitoring + /// + /// The wildcard () returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message + /// categories and returns the sum. + /// + /// Parameter [byParentJobId] : + /// This is a filter to list child (nested) jobs based on parent job ID. + /// + /// Parameter [byResourceArn] : + /// Returns only backup jobs that match the specified resource Amazon Resource + /// Name (ARN). + /// + /// Parameter [byResourceType] : + /// Returns only backup jobs for the specified resources: + /// + ///
        + ///
      • /// Aurora for Amazon Aurora ///
      • ///
      • + /// CloudFormation for CloudFormation + ///
      • + ///
      • /// DocumentDB for Amazon DocumentDB (with MongoDB compatibility) ///
      • ///
      • @@ -1308,15 +1862,24 @@ class Backup { /// Neptune for Amazon Neptune ///
      • ///
      • + /// Redshift for Amazon Redshift + ///
      • + ///
      • /// RDS for Amazon Relational Database Service ///
      • ///
      • + /// SAP HANA on Amazon EC2 for SAP HANA databases + ///
      • + ///
      • /// Storage Gateway for Storage Gateway ///
      • ///
      • /// S3 for Amazon S3 ///
      • ///
      • + /// Timestream for Amazon Timestream + ///
      • + ///
      • /// VirtualMachine for virtual machines ///
      • ///
      @@ -1324,12 +1887,25 @@ class Backup { /// Parameter [byState] : /// Returns only backup jobs that are in the specified state. /// + /// Completed with issues is a status found only in the Backup + /// console. For API, this status refers to jobs with a state of + /// COMPLETED and a MessageCategory with a value + /// other than SUCCESS; that is, the status is completed but + /// comes with a status message. + /// + /// To obtain the job count for Completed with issues, run two + /// GET requests, and subtract the second, smaller number: + /// + /// GET /backup-jobs/?state=COMPLETED + /// + /// GET /backup-jobs/?messageCategory=SUCCESS&state=COMPLETED + /// /// Parameter [maxResults] : /// The maximum number of items to be returned. /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupJobs({ @@ -1339,6 +1915,7 @@ class Backup { DateTime? byCompleteBefore, DateTime? byCreatedAfter, DateTime? byCreatedBefore, + String? byMessageCategory, String? byParentJobId, String? byResourceArn, String? byResourceType, @@ -1363,6 +1940,7 @@ class Backup { 'createdAfter': [_s.iso8601ToJson(byCreatedAfter).toString()], if (byCreatedBefore != null) 'createdBefore': [_s.iso8601ToJson(byCreatedBefore).toString()], + if (byMessageCategory != null) 'messageCategory': [byMessageCategory], if (byParentJobId != null) 'parentJobId': [byParentJobId], if (byResourceArn != null) 'resourceArn': [byResourceArn], if (byResourceType != null) 'resourceType': [byResourceType], @@ -1393,7 +1971,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupPlanTemplates({ @@ -1437,7 +2015,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupPlanVersions({ @@ -1485,7 +2063,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupPlans({ @@ -1530,7 +2108,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupSelections({ @@ -1567,15 +2145,23 @@ class Backup { /// May throw [MissingParameterValueException]. /// May throw [ServiceUnavailableException]. /// + /// Parameter [byShared] : + /// This parameter will sort the list of vaults by shared vaults. + /// + /// Parameter [byVaultType] : + /// This parameter will sort the list of vaults by vault type. + /// /// Parameter [maxResults] : /// The maximum number of items to be returned. /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listBackupVaults({ + bool? byShared, + VaultType? byVaultType, int? maxResults, String? nextToken, }) async { @@ -1586,6 +2172,8 @@ class Backup { 1000, ); final $query = >{ + if (byShared != null) 'shared': [byShared.toString()], + if (byVaultType != null) 'vaultType': [byVaultType.toValue()], if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], }; @@ -1599,6 +2187,126 @@ class Backup { return ListBackupVaultsOutput.fromJson(response); } + /// This request obtains a list of copy jobs created or running within the the + /// most recent 30 days. You can include parameters AccountID, State, + /// ResourceType, MessageCategory, AggregationPeriod, MaxResults, or NextToken + /// to filter results. + /// + /// This request returns a summary that contains Region, Account, State, + /// RestourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [accountId] : + /// Returns the job count for the specified account. + /// + /// If the request is sent from a member account or an account not part of + /// Amazon Web Services Organizations, jobs within requestor's account will be + /// returned. + /// + /// Root, admin, and delegated administrator accounts can use the value ANY to + /// return job counts from every account in the organization. + /// + /// AGGREGATE_ALL aggregates job counts from all accounts within + /// the authenticated organization, then returns the sum. + /// + /// Parameter [aggregationPeriod] : + /// This is the period that sets the boundaries for returned results. + /// + ///
        + ///
      • + /// ONE_DAY for daily job count for the prior 14 days. + ///
      • + ///
      • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
      • + ///
      • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
      • + ///
      + /// + /// Parameter [maxResults] : + /// This parameter sets the maximum number of items to be returned. + /// + /// The value is an integer. Range of accepted values is from 1 to 500. + /// + /// Parameter [messageCategory] : + /// This parameter returns the job count for the specified message category. + /// + /// Example accepted strings include AccessDenied, + /// Success, and InvalidParameters. See Monitoring + /// for a list of accepted MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message + /// categories and returns the sum. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of + /// resources, NextToken allows you to return more items in your + /// list starting at the location pointed to by the next token. + /// + /// Parameter [resourceType] : + /// Returns the job count for the specified resource type. Use request + /// GetSupportedResourceTypes to obtain strings for supported + /// resource types. + /// + /// The the value ANY returns count of all resource types. + /// + /// AGGREGATE_ALL aggregates job counts for all resource types + /// and returns the sum. + /// + /// The type of Amazon Web Services resource to be backed up; for example, an + /// Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational + /// Database Service (Amazon RDS) database. + /// + /// Parameter [state] : + /// This parameter returns the job count for jobs with the specified state. + /// + /// The the value ANY returns count of all states. + /// + /// AGGREGATE_ALL aggregates job counts for all states and + /// returns the sum. + Future listCopyJobSummaries({ + String? accountId, + AggregationPeriod? aggregationPeriod, + int? maxResults, + String? messageCategory, + String? nextToken, + String? resourceType, + CopyJobStatus? state, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (accountId != null) 'AccountId': [accountId], + if (aggregationPeriod != null) + 'AggregationPeriod': [aggregationPeriod.toValue()], + if (maxResults != null) 'MaxResults': [maxResults.toString()], + if (messageCategory != null) 'MessageCategory': [messageCategory], + if (nextToken != null) 'NextToken': [nextToken], + if (resourceType != null) 'ResourceType': [resourceType], + if (state != null) 'State': [state.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audit/copy-job-summaries', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListCopyJobSummariesOutput.fromJson(response); + } + /// Returns metadata about your copy jobs. /// /// May throw [InvalidParameterValueException]. @@ -1627,6 +2335,23 @@ class Backup { /// vault to copy from; for example, /// arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. /// + /// Parameter [byMessageCategory] : + /// This is an optional parameter that can be used to filter out jobs with a + /// MessageCategory which matches the value you input. + /// + /// Example strings may include AccessDenied, + /// SUCCESS, AGGREGATE_ALL, and + /// INVALIDPARAMETERS. + /// + /// View Monitoring + /// for a list of accepted strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message + /// categories and returns the sum. + /// /// Parameter [byParentJobId] : /// This is a filter to list child (nested) jobs based on parent job ID. /// @@ -1642,6 +2367,9 @@ class Backup { /// Aurora for Amazon Aurora ///
    • ///
    • + /// CloudFormation for CloudFormation + ///
    • + ///
    • /// DocumentDB for Amazon DocumentDB (with MongoDB compatibility) ///
    • ///
    • @@ -1663,15 +2391,24 @@ class Backup { /// Neptune for Amazon Neptune ///
    • ///
    • + /// Redshift for Amazon Redshift + ///
    • + ///
    • /// RDS for Amazon Relational Database Service ///
    • ///
    • + /// SAP HANA on Amazon EC2 for SAP HANA databases + ///
    • + ///
    • /// Storage Gateway for Storage Gateway ///
    • ///
    • /// S3 for Amazon S3 ///
    • ///
    • + /// Timestream for Amazon Timestream + ///
    • + ///
    • /// VirtualMachine for virtual machines ///
    • ///
    @@ -1684,7 +2421,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, NextToken allows + /// a request is made to return MaxResults number of items, NextToken allows /// you to return more items in your list starting at the location pointed to /// by the next token. Future listCopyJobs({ @@ -1694,6 +2431,7 @@ class Backup { DateTime? byCreatedAfter, DateTime? byCreatedBefore, String? byDestinationVaultArn, + String? byMessageCategory, String? byParentJobId, String? byResourceArn, String? byResourceType, @@ -1719,6 +2457,7 @@ class Backup { 'createdBefore': [_s.iso8601ToJson(byCreatedBefore).toString()], if (byDestinationVaultArn != null) 'destinationVaultArn': [byDestinationVaultArn], + if (byMessageCategory != null) 'messageCategory': [byMessageCategory], if (byParentJobId != null) 'parentJobId': [byParentJobId], if (byResourceArn != null) 'resourceArn': [byResourceArn], if (byResourceType != null) 'resourceType': [byResourceType], @@ -1783,7 +2522,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned resources. For example, - /// if a request is made to return maxResults number of + /// if a request is made to return MaxResults number of /// resources, NextToken allows you to return more items in your /// list starting at the location pointed to by the next token. Future listLegalHolds({ @@ -1822,7 +2561,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listProtectedResources({ @@ -1849,57 +2588,165 @@ class Backup { return ListProtectedResourcesOutput.fromJson(response); } - /// Returns detailed information about the recovery points stored in a backup + /// This request lists the protected resources corresponding to each backup /// vault. /// - /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterValueException]. - /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. /// /// Parameter [backupVaultName] : - /// The name of a logical container where backups are stored. Backup vaults - /// are identified by names that are unique to the account used to create them - /// and the Amazon Web Services Region where they are created. They consist of - /// lowercase letters, numbers, and hyphens. - /// - /// Backup vault name might not be available when a supported service creates - /// the backup. - /// + /// This is the list of protected resources by backup vault within the + /// vault(s) you specify by name. /// - /// Parameter [byBackupPlanId] : - /// Returns only recovery points that match the specified backup plan ID. - /// - /// Parameter [byCreatedAfter] : - /// Returns only recovery points that were created after the specified - /// timestamp. - /// - /// Parameter [byCreatedBefore] : - /// Returns only recovery points that were created before the specified - /// timestamp. + /// Parameter [backupVaultAccountId] : + /// This is the list of protected resources by backup vault within the + /// vault(s) you specify by account ID. /// - /// Parameter [byParentRecoveryPointArn] : - /// This returns only recovery points that match the specified parent - /// (composite) recovery point Amazon Resource Name (ARN). + /// Parameter [maxResults] : + /// The maximum number of items to be returned. /// - /// Parameter [byResourceArn] : + /// Parameter [nextToken] : + /// The next item following a partial list of returned items. For example, if + /// a request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list + /// starting at the location pointed to by the next token. + Future + listProtectedResourcesByBackupVault({ + required String backupVaultName, + String? backupVaultAccountId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (backupVaultAccountId != null) + 'backupVaultAccountId': [backupVaultAccountId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/resources/', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListProtectedResourcesByBackupVaultOutput.fromJson(response); + } + + /// Returns detailed information about the recovery points stored in a backup + /// vault. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [backupVaultName] : + /// The name of a logical container where backups are stored. Backup vaults + /// are identified by names that are unique to the account used to create them + /// and the Amazon Web Services Region where they are created. They consist of + /// lowercase letters, numbers, and hyphens. + /// + /// Backup vault name might not be available when a supported service creates + /// the backup. + /// + /// + /// Parameter [backupVaultAccountId] : + /// This parameter will sort the list of recovery points by account ID. + /// + /// Parameter [byBackupPlanId] : + /// Returns only recovery points that match the specified backup plan ID. + /// + /// Parameter [byCreatedAfter] : + /// Returns only recovery points that were created after the specified + /// timestamp. + /// + /// Parameter [byCreatedBefore] : + /// Returns only recovery points that were created before the specified + /// timestamp. + /// + /// Parameter [byParentRecoveryPointArn] : + /// This returns only recovery points that match the specified parent + /// (composite) recovery point Amazon Resource Name (ARN). + /// + /// Parameter [byResourceArn] : /// Returns only recovery points that match the specified resource Amazon /// Resource Name (ARN). /// /// Parameter [byResourceType] : - /// Returns only recovery points that match the specified resource type. + /// Returns only recovery points that match the specified resource type(s): + /// + ///
      + ///
    • + /// Aurora for Amazon Aurora + ///
    • + ///
    • + /// CloudFormation for CloudFormation + ///
    • + ///
    • + /// DocumentDB for Amazon DocumentDB (with MongoDB compatibility) + ///
    • + ///
    • + /// DynamoDB for Amazon DynamoDB + ///
    • + ///
    • + /// EBS for Amazon Elastic Block Store + ///
    • + ///
    • + /// EC2 for Amazon Elastic Compute Cloud + ///
    • + ///
    • + /// EFS for Amazon Elastic File System + ///
    • + ///
    • + /// FSx for Amazon FSx + ///
    • + ///
    • + /// Neptune for Amazon Neptune + ///
    • + ///
    • + /// Redshift for Amazon Redshift + ///
    • + ///
    • + /// RDS for Amazon Relational Database Service + ///
    • + ///
    • + /// SAP HANA on Amazon EC2 for SAP HANA databases + ///
    • + ///
    • + /// Storage Gateway for Storage Gateway + ///
    • + ///
    • + /// S3 for Amazon S3 + ///
    • + ///
    • + /// Timestream for Amazon Timestream + ///
    • + ///
    • + /// VirtualMachine for virtual machines + ///
    • + ///
    /// /// Parameter [maxResults] : /// The maximum number of items to be returned. /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listRecoveryPointsByBackupVault({ required String backupVaultName, + String? backupVaultAccountId, String? byBackupPlanId, DateTime? byCreatedAfter, DateTime? byCreatedBefore, @@ -1916,6 +2763,8 @@ class Backup { 1000, ); final $query = >{ + if (backupVaultAccountId != null) + 'backupVaultAccountId': [backupVaultAccountId], if (byBackupPlanId != null) 'backupPlanId': [byBackupPlanId], if (byCreatedAfter != null) 'createdAfter': [_s.iso8601ToJson(byCreatedAfter).toString()], @@ -1954,7 +2803,7 @@ class Backup { /// /// Parameter [nextToken] : /// This is the next item following a partial list of returned resources. For - /// example, if a request is made to return maxResults number of + /// example, if a request is made to return MaxResults number of /// resources, NextToken allows you to return more items in your /// list starting at the location pointed to by the next token. Future listRecoveryPointsByLegalHold({ @@ -1999,6 +2848,17 @@ class Backup { /// An ARN that uniquely identifies a resource. The format of the ARN depends /// on the resource type. /// + /// Parameter [managedByAWSBackupOnly] : + /// This attribute filters recovery points based on ownership. + /// + /// If this is set to TRUE, the response will contain recovery + /// points associated with the selected resources that are managed by Backup. + /// + /// If this is set to FALSE, the response will contain all + /// recovery points associated with the selected resource. + /// + /// Type: Boolean + /// /// Parameter [maxResults] : /// The maximum number of items to be returned. /// @@ -2007,11 +2867,12 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listRecoveryPointsByResource({ required String resourceArn, + bool? managedByAWSBackupOnly, int? maxResults, String? nextToken, }) async { @@ -2022,6 +2883,8 @@ class Backup { 1000, ); final $query = >{ + if (managedByAWSBackupOnly != null) + 'managedByAWSBackupOnly': [managedByAWSBackupOnly.toString()], if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], }; @@ -2141,6 +3004,113 @@ class Backup { return ListReportPlansOutput.fromJson(response); } + /// This request obtains a summary of restore jobs created or running within + /// the the most recent 30 days. You can include parameters AccountID, State, + /// ResourceType, AggregationPeriod, MaxResults, or NextToken to filter + /// results. + /// + /// This request returns a summary that contains Region, Account, State, + /// RestourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [accountId] : + /// Returns the job count for the specified account. + /// + /// If the request is sent from a member account or an account not part of + /// Amazon Web Services Organizations, jobs within requestor's account will be + /// returned. + /// + /// Root, admin, and delegated administrator accounts can use the value ANY to + /// return job counts from every account in the organization. + /// + /// AGGREGATE_ALL aggregates job counts from all accounts within + /// the authenticated organization, then returns the sum. + /// + /// Parameter [aggregationPeriod] : + /// This is the period that sets the boundaries for returned results. + /// + /// Acceptable values include + /// + ///
      + ///
    • + /// ONE_DAY for daily job count for the prior 14 days. + ///
    • + ///
    • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
    • + ///
    • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
    • + ///
    + /// + /// Parameter [maxResults] : + /// This parameter sets the maximum number of items to be returned. + /// + /// The value is an integer. Range of accepted values is from 1 to 500. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of + /// resources, NextToken allows you to return more items in your + /// list starting at the location pointed to by the next token. + /// + /// Parameter [resourceType] : + /// Returns the job count for the specified resource type. Use request + /// GetSupportedResourceTypes to obtain strings for supported + /// resource types. + /// + /// The the value ANY returns count of all resource types. + /// + /// AGGREGATE_ALL aggregates job counts for all resource types + /// and returns the sum. + /// + /// The type of Amazon Web Services resource to be backed up; for example, an + /// Amazon Elastic Block Store (Amazon EBS) volume or an Amazon Relational + /// Database Service (Amazon RDS) database. + /// + /// Parameter [state] : + /// This parameter returns the job count for jobs with the specified state. + /// + /// The the value ANY returns count of all states. + /// + /// AGGREGATE_ALL aggregates job counts for all states and + /// returns the sum. + Future listRestoreJobSummaries({ + String? accountId, + AggregationPeriod? aggregationPeriod, + int? maxResults, + String? nextToken, + String? resourceType, + RestoreJobState? state, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (accountId != null) 'AccountId': [accountId], + if (aggregationPeriod != null) + 'AggregationPeriod': [aggregationPeriod.toValue()], + if (maxResults != null) 'MaxResults': [maxResults.toString()], + if (nextToken != null) 'NextToken': [nextToken], + if (resourceType != null) 'ResourceType': [resourceType], + if (state != null) 'State': [state.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audit/restore-job-summaries', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListRestoreJobSummariesOutput.fromJson(response); + } + /// Returns a list of jobs that Backup initiated to restore a saved resource, /// including details about the recovery process. /// @@ -2167,6 +3137,65 @@ class Backup { /// Parameter [byCreatedBefore] : /// Returns only restore jobs that were created before the specified date. /// + /// Parameter [byResourceType] : + /// Include this parameter to return only restore jobs for the specified + /// resources: + /// + ///
      + ///
    • + /// Aurora for Amazon Aurora + ///
    • + ///
    • + /// CloudFormation for CloudFormation + ///
    • + ///
    • + /// DocumentDB for Amazon DocumentDB (with MongoDB compatibility) + ///
    • + ///
    • + /// DynamoDB for Amazon DynamoDB + ///
    • + ///
    • + /// EBS for Amazon Elastic Block Store + ///
    • + ///
    • + /// EC2 for Amazon Elastic Compute Cloud + ///
    • + ///
    • + /// EFS for Amazon Elastic File System + ///
    • + ///
    • + /// FSx for Amazon FSx + ///
    • + ///
    • + /// Neptune for Amazon Neptune + ///
    • + ///
    • + /// Redshift for Amazon Redshift + ///
    • + ///
    • + /// RDS for Amazon Relational Database Service + ///
    • + ///
    • + /// SAP HANA on Amazon EC2 for SAP HANA databases + ///
    • + ///
    • + /// Storage Gateway for Storage Gateway + ///
    • + ///
    • + /// S3 for Amazon S3 + ///
    • + ///
    • + /// Timestream for Amazon Timestream + ///
    • + ///
    • + /// VirtualMachine for virtual machines + ///
    • + ///
    + /// + /// Parameter [byRestoreTestingPlanArn] : + /// This returns only restore testing jobs that match the specified resource + /// Amazon Resource Name (ARN). + /// /// Parameter [byStatus] : /// Returns only restore jobs associated with the specified job status. /// @@ -2175,7 +3204,7 @@ class Backup { /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. Future listRestoreJobs({ @@ -2184,6 +3213,8 @@ class Backup { DateTime? byCompleteBefore, DateTime? byCreatedAfter, DateTime? byCreatedBefore, + String? byResourceType, + String? byRestoreTestingPlanArn, RestoreJobStatus? byStatus, int? maxResults, String? nextToken, @@ -2204,6 +3235,9 @@ class Backup { 'createdAfter': [_s.iso8601ToJson(byCreatedAfter).toString()], if (byCreatedBefore != null) 'createdBefore': [_s.iso8601ToJson(byCreatedBefore).toString()], + if (byResourceType != null) 'resourceType': [byResourceType], + if (byRestoreTestingPlanArn != null) + 'restoreTestingPlanArn': [byRestoreTestingPlanArn], if (byStatus != null) 'status': [byStatus.toValue()], if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], @@ -2218,14 +3252,12 @@ class Backup { return ListRestoreJobsOutput.fromJson(response); } - /// Returns a list of key-value pairs assigned to a target recovery point, - /// backup plan, or backup vault. + /// This returns restore jobs that contain the specified protected resource. /// - /// ListTags only works for resource types that support full - /// Backup management of their backups. Those resource types are listed in the - /// "Full Backup management" section of the - /// Feature availability by resource table. + /// You must include ResourceArn. You can optionally include + /// NextToken, ByStatus, MaxResults, + /// ByRecoveryPointCreationDateAfter , and + /// ByRecoveryPointCreationDateBefore. /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterValueException]. @@ -2233,21 +3265,34 @@ class Backup { /// May throw [ServiceUnavailableException]. /// /// Parameter [resourceArn] : - /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The - /// format of the ARN depends on the type of resource. Valid targets for - /// ListTags are recovery points, backup plans, and backup - /// vaults. + /// Returns only restore jobs that match the specified resource Amazon + /// Resource Name (ARN). + /// + /// Parameter [byRecoveryPointCreationDateAfter] : + /// Returns only restore jobs of recovery points that were created after the + /// specified date. + /// + /// Parameter [byRecoveryPointCreationDateBefore] : + /// Returns only restore jobs of recovery points that were created before the + /// specified date. + /// + /// Parameter [byStatus] : + /// Returns only restore jobs associated with the specified job status. /// /// Parameter [maxResults] : /// The maximum number of items to be returned. /// /// Parameter [nextToken] : /// The next item following a partial list of returned items. For example, if - /// a request is made to return maxResults number of items, + /// a request ismade to return MaxResults number of items, /// NextToken allows you to return more items in your list /// starting at the location pointed to by the next token. - Future listTags({ + Future + listRestoreJobsByProtectedResource({ required String resourceArn, + DateTime? byRecoveryPointCreationDateAfter, + DateTime? byRecoveryPointCreationDateBefore, + RestoreJobStatus? byStatus, int? maxResults, String? nextToken, }) async { @@ -2258,17 +3303,162 @@ class Backup { 1000, ); final $query = >{ + if (byRecoveryPointCreationDateAfter != null) + 'recoveryPointCreationDateAfter': [ + _s.iso8601ToJson(byRecoveryPointCreationDateAfter).toString() + ], + if (byRecoveryPointCreationDateBefore != null) + 'recoveryPointCreationDateBefore': [ + _s.iso8601ToJson(byRecoveryPointCreationDateBefore).toString() + ], + if (byStatus != null) 'status': [byStatus.toValue()], if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}/', + requestUri: + '/resources/${Uri.encodeComponent(resourceArn)}/restore-jobs/', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListTagsOutput.fromJson(response); + return ListRestoreJobsByProtectedResourceOutput.fromJson(response); + } + + /// Returns a list of restore testing plans. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [maxResults] : + /// The maximum number of items to be returned. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned items. For example, if + /// a request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list + /// starting at the location pointed to by the nexttoken. + Future listRestoreTestingPlans({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'MaxResults': [maxResults.toString()], + if (nextToken != null) 'NextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/restore-testing/plans', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListRestoreTestingPlansOutput.fromJson(response); + } + + /// Returns a list of restore testing selections. Can be filtered by + /// MaxResults and RestoreTestingPlanName. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlanName] : + /// Returns restore testing selections by the specified restore testing plan + /// name. + /// + /// Parameter [maxResults] : + /// The maximum number of items to be returned. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned items. For example, if + /// a request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list + /// starting at the location pointed to by the nexttoken. + Future listRestoreTestingSelections({ + required String restoreTestingPlanName, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'MaxResults': [maxResults.toString()], + if (nextToken != null) 'NextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}/selections', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListRestoreTestingSelectionsOutput.fromJson(response); + } + + /// Returns a list of key-value pairs assigned to a target recovery point, + /// backup plan, or backup vault. + /// + /// ListTags only works for resource types that support full + /// Backup management of their backups. Those resource types are listed in the + /// "Full Backup management" section of the + /// Feature availability by resource table. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [resourceArn] : + /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The + /// format of the ARN depends on the type of resource. Valid targets for + /// ListTags are recovery points, backup plans, and backup + /// vaults. + /// + /// Parameter [maxResults] : + /// The maximum number of items to be returned. + /// + /// Parameter [nextToken] : + /// The next item following a partial list of returned items. For example, if + /// a request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list + /// starting at the location pointed to by the next token. + Future listTags({ + required String resourceArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}/', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTagsOutput.fromJson(response); } /// Sets a resource-based policy that is used to manage access permissions on @@ -2475,6 +3665,45 @@ class Backup { ); } + /// This request allows you to send your independent self-run restore test + /// validation results. RestoreJobId and + /// ValidationStatus are required. Optionally, you can input a + /// ValidationStatusMessage. + /// + /// May throw [InvalidParameterValueException]. + /// May throw [InvalidRequestException]. + /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreJobId] : + /// This is a unique identifier of a restore job within Backup. + /// + /// Parameter [validationStatus] : + /// This is the status of your restore validation. + /// + /// Parameter [validationStatusMessage] : + /// This is an optional message string you can input to describe the + /// validation status for the restore test validation. + Future putRestoreValidationResult({ + required String restoreJobId, + required RestoreValidationStatus validationStatus, + String? validationStatusMessage, + }) async { + final $payload = { + 'ValidationStatus': validationStatus.toValue(), + if (validationStatusMessage != null) + 'ValidationStatusMessage': validationStatusMessage, + }; + await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/restore-jobs/${Uri.encodeComponent(restoreJobId)}/validations', + exceptionFnMap: _exceptionFns, + ); + } + /// Starts an on-demand backup job for the specified resource. /// /// May throw [ResourceNotFoundException]. @@ -2514,6 +3743,9 @@ class Backup { /// add additional time for StartWindowMinutes, or if the backup /// started later than scheduled. /// + /// Like StartWindowMinutes, this parameter has a maximum value + /// of 100 years (52,560,000 minutes). + /// /// Parameter [idempotencyToken] : /// A customer-chosen string that you can use to distinguish between otherwise /// identical calls to StartBackupJob. Retrying a successful @@ -2537,6 +3769,8 @@ class Backup { /// Feature availability by resource table. Backup ignores this expression /// for other resource types. /// + /// This parameter has a maximum value of 100 years (36,500 days). + /// /// Parameter [recoveryPointTags] : /// To help organize your resources, you can assign your own metadata to the /// resources that you create. Each tag is a key-value pair. @@ -2547,6 +3781,8 @@ class Backup { /// default is 8 hours. If this value is included, it must be at least 60 /// minutes to avoid errors. /// + /// This parameter has a maximum value of 100 years (52,560,000 minutes). + /// /// During the start window, the backup job status remains in /// CREATED status until it has successfully begun or until the /// start window time has run out. If within the start window time Backup @@ -2840,9 +4076,9 @@ class Backup { /// Attempts to cancel a job to create a one-time backup of a resource. /// /// This action is not supported for the following services: Amazon FSx for - /// Windows File Server, Amazon FSx for Lustre, FSx for ONTAP , Amazon FSx for - /// OpenZFS, Amazon DocumentDB (with MongoDB compatibility), Amazon RDS, - /// Amazon Aurora, and Amazon Neptune. + /// Windows File Server, Amazon FSx for Lustre, Amazon FSx for NetApp ONTAP , + /// Amazon FSx for OpenZFS, Amazon DocumentDB (with MongoDB compatibility), + /// Amazon RDS, Amazon Aurora, and Amazon Neptune. /// /// May throw [MissingParameterValueException]. /// May throw [ResourceNotFoundException]. @@ -3098,13 +4334,10 @@ class Backup { return UpdateRecoveryPointLifecycleOutput.fromJson(response); } - /// Updates the current service opt-in settings for the Region. If - /// service-opt-in is enabled for a service, Backup tries to protect that - /// service's resources in this Region, when the resource is included in an - /// on-demand backup or scheduled backup plan. Otherwise, Backup does not try - /// to protect that service's resources in this Region. Use the - /// DescribeRegionSettings API to determine the resource types - /// that are supported. + /// Updates the current service opt-in settings for the Region. + /// + /// Use the DescribeRegionSettings API to determine the resource + /// types that are supported. /// /// May throw [ServiceUnavailableException]. /// May throw [MissingParameterValueException]. @@ -3121,6 +4354,15 @@ class Backup { /// Parameter [resourceTypeOptInPreference] : /// Updates the list of services along with the opt-in preferences for the /// Region. + /// + /// If resource assignments are only based on tags, then service opt-in + /// settings are applied. If a resource type is explicitly assigned to a + /// backup plan, such as Amazon S3, Amazon EC2, or Amazon RDS, it will be + /// included in the backup even if the opt-in is not enabled for that + /// particular service. If both a resource type and tags are specified in a + /// resource assignment, the resource type specified in the backup plan takes + /// priority over the tag condition. Service opt-in settings are disregarded + /// in this situation. Future updateRegionSettings({ Map? resourceTypeManagementPreference, Map? resourceTypeOptInPreference, @@ -3201,6 +4443,102 @@ class Backup { ); return UpdateReportPlanOutput.fromJson(response); } + + /// This request will send changes to your specified restore testing plan. + /// RestoreTestingPlanName cannot be updated after it is created. + /// + /// RecoveryPointSelection can contain: + /// + ///
      + ///
    • + /// Algorithm + ///
    • + ///
    • + /// ExcludeVaults + ///
    • + ///
    • + /// IncludeVaults + ///
    • + ///
    • + /// RecoveryPointTypes + ///
    • + ///
    • + /// SelectionWindowDays + ///
    • + ///
    + /// + /// May throw [ConflictException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlan] : + /// Specifies the body of a restore testing plan. + /// + /// Parameter [restoreTestingPlanName] : + /// This is the restore testing plan name you wish to update. + Future updateRestoreTestingPlan({ + required RestoreTestingPlanForUpdate restoreTestingPlan, + required String restoreTestingPlanName, + }) async { + final $payload = { + 'RestoreTestingPlan': restoreTestingPlan, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateRestoreTestingPlanOutput.fromJson(response); + } + + /// Most elements except the RestoreTestingSelectionName can be + /// updated with this request. + /// + /// RestoreTestingSelection can use either protected resource + /// ARNs or conditions, but not both. That is, if your selection has + /// ProtectedResourceArns, requesting an update with the + /// parameter ProtectedResourceConditions will be unsuccessful. + /// + /// May throw [ConflictException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [restoreTestingPlanName] : + /// The restore testing plan name is required to update the indicated testing + /// plan. + /// + /// Parameter [restoreTestingSelection] : + /// To update your restore testing selection, you can use either protected + /// resource ARNs or conditions, but not both. That is, if your selection has + /// ProtectedResourceArns, requesting an update with the + /// parameter ProtectedResourceConditions will be unsuccessful. + /// + /// Parameter [restoreTestingSelectionName] : + /// This is the required restore testing selection name of the restore testing + /// selection you wish to update. + Future updateRestoreTestingSelection({ + required String restoreTestingPlanName, + required RestoreTestingSelectionForUpdate restoreTestingSelection, + required String restoreTestingSelectionName, + }) async { + final $payload = { + 'RestoreTestingSelection': restoreTestingSelection, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/restore-testing/plans/${Uri.encodeComponent(restoreTestingPlanName)}/selections/${Uri.encodeComponent(restoreTestingSelectionName)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateRestoreTestingSelectionOutput.fromJson(response); + } } /// A list of backup options for each resource type. @@ -3257,6 +4595,39 @@ class AdvancedBackupSetting { } } +enum AggregationPeriod { + oneDay, + sevenDays, + fourteenDays, +} + +extension AggregationPeriodValueExtension on AggregationPeriod { + String toValue() { + switch (this) { + case AggregationPeriod.oneDay: + return 'ONE_DAY'; + case AggregationPeriod.sevenDays: + return 'SEVEN_DAYS'; + case AggregationPeriod.fourteenDays: + return 'FOURTEEN_DAYS'; + } + } +} + +extension AggregationPeriodFromString on String { + AggregationPeriod toAggregationPeriod() { + switch (this) { + case 'ONE_DAY': + return AggregationPeriod.oneDay; + case 'SEVEN_DAYS': + return AggregationPeriod.sevenDays; + case 'FOURTEEN_DAYS': + return AggregationPeriod.fourteenDays; + } + throw Exception('$this is not known in enum AggregationPeriod'); + } +} + /// Contains detailed information about a backup job. class BackupJob { /// The account ID that owns the backup job. @@ -3328,9 +4699,25 @@ class BackupJob { /// without those strings lack permissions to perform backup jobs. final String? iamRoleArn; + /// This is the date on which the backup job was initiated. + final DateTime? initiationDate; + /// This is a boolean value indicating this is a parent (composite) backup job. final bool? isParent; + /// This parameter is the job count for the specified message category. + /// + /// Example strings may include AccessDenied, SUCCESS, + /// AGGREGATE_ALL, and INVALIDPARAMETERS. See Monitoring + /// for a list of MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message categories + /// and returns the sum. + final String? messageCategory; + /// This uniquely identifies a request to Backup to back up a resource. The /// return will be the parent (composite) job ID. final String? parentJobId; @@ -3366,7 +4753,7 @@ class BackupJob { /// Friday, January 26, 2018 12:11:30.087 AM. final DateTime? startBy; - /// The current state of a resource recovery point. + /// The current state of a backup job. final BackupJobState? state; /// A detailed message explaining the status of the job to back up a resource. @@ -3386,7 +4773,9 @@ class BackupJob { this.creationDate, this.expectedCompletionDate, this.iamRoleArn, + this.initiationDate, this.isParent, + this.messageCategory, this.parentJobId, this.percentDone, this.recoveryPointArn, @@ -3417,7 +4806,9 @@ class BackupJob { creationDate: timeStampFromJson(json['CreationDate']), expectedCompletionDate: timeStampFromJson(json['ExpectedCompletionDate']), iamRoleArn: json['IamRoleArn'] as String?, + initiationDate: timeStampFromJson(json['InitiationDate']), isParent: json['IsParent'] as bool?, + messageCategory: json['MessageCategory'] as String?, parentJobId: json['ParentJobId'] as String?, percentDone: json['PercentDone'] as String?, recoveryPointArn: json['RecoveryPointArn'] as String?, @@ -3444,7 +4835,9 @@ class BackupJob { final creationDate = this.creationDate; final expectedCompletionDate = this.expectedCompletionDate; final iamRoleArn = this.iamRoleArn; + final initiationDate = this.initiationDate; final isParent = this.isParent; + final messageCategory = this.messageCategory; final parentJobId = this.parentJobId; final percentDone = this.percentDone; final recoveryPointArn = this.recoveryPointArn; @@ -3471,7 +4864,10 @@ class BackupJob { if (expectedCompletionDate != null) 'ExpectedCompletionDate': unixTimestampToJson(expectedCompletionDate), if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (initiationDate != null) + 'InitiationDate': unixTimestampToJson(initiationDate), if (isParent != null) 'IsParent': isParent, + if (messageCategory != null) 'MessageCategory': messageCategory, if (parentJobId != null) 'ParentJobId': parentJobId, if (percentDone != null) 'PercentDone': percentDone, if (recoveryPointArn != null) 'RecoveryPointArn': recoveryPointArn, @@ -3548,23 +4944,192 @@ extension BackupJobStateFromString on String { } } -/// Contains an optional backup plan display name and an array of -/// BackupRule objects, each of which specifies a backup rule. Each -/// rule in a backup plan is a separate scheduled task and can back up a -/// different selection of Amazon Web Services resources. -class BackupPlan { - /// The display name of a backup plan. Must contain 1 to 50 alphanumeric or - /// '-_.' characters. - final String backupPlanName; - - /// An array of BackupRule objects, each of which specifies a - /// scheduled task that is used to back up a selection of resources. - final List rules; +enum BackupJobStatus { + created, + pending, + running, + aborting, + aborted, + completed, + failed, + expired, + partial, + aggregateAll, + any, +} - /// Contains a list of BackupOptions for each resource type. - final List? advancedBackupSettings; +extension BackupJobStatusValueExtension on BackupJobStatus { + String toValue() { + switch (this) { + case BackupJobStatus.created: + return 'CREATED'; + case BackupJobStatus.pending: + return 'PENDING'; + case BackupJobStatus.running: + return 'RUNNING'; + case BackupJobStatus.aborting: + return 'ABORTING'; + case BackupJobStatus.aborted: + return 'ABORTED'; + case BackupJobStatus.completed: + return 'COMPLETED'; + case BackupJobStatus.failed: + return 'FAILED'; + case BackupJobStatus.expired: + return 'EXPIRED'; + case BackupJobStatus.partial: + return 'PARTIAL'; + case BackupJobStatus.aggregateAll: + return 'AGGREGATE_ALL'; + case BackupJobStatus.any: + return 'ANY'; + } + } +} - BackupPlan({ +extension BackupJobStatusFromString on String { + BackupJobStatus toBackupJobStatus() { + switch (this) { + case 'CREATED': + return BackupJobStatus.created; + case 'PENDING': + return BackupJobStatus.pending; + case 'RUNNING': + return BackupJobStatus.running; + case 'ABORTING': + return BackupJobStatus.aborting; + case 'ABORTED': + return BackupJobStatus.aborted; + case 'COMPLETED': + return BackupJobStatus.completed; + case 'FAILED': + return BackupJobStatus.failed; + case 'EXPIRED': + return BackupJobStatus.expired; + case 'PARTIAL': + return BackupJobStatus.partial; + case 'AGGREGATE_ALL': + return BackupJobStatus.aggregateAll; + case 'ANY': + return BackupJobStatus.any; + } + throw Exception('$this is not known in enum BackupJobStatus'); + } +} + +/// This is a summary of jobs created or running within the most recent 30 days. +/// +/// The returned summary may contain the following: Region, Account, State, +/// RestourceType, MessageCategory, StartTime, EndTime, and Count of included +/// jobs. +class BackupJobSummary { + /// The account ID that owns the jobs within the summary. + final String? accountId; + + /// The value as a number of jobs in a job summary. + final int? count; + + /// The value of time in number format of a job end time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? endTime; + + /// This parameter is the job count for the specified message category. + /// + /// Example strings include AccessDenied, Success, and + /// InvalidParameters. See Monitoring + /// for a list of MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message categories + /// and returns the sum. + final String? messageCategory; + + /// The Amazon Web Services Regions within the job summary. + final String? region; + + /// This value is the job count for the specified resource type. The request + /// GetSupportedResourceTypes returns strings for supported + /// resource types. + final String? resourceType; + + /// The value of time in number format of a job start time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? startTime; + + /// This value is job count for jobs with the specified state. + final BackupJobStatus? state; + + BackupJobSummary({ + this.accountId, + this.count, + this.endTime, + this.messageCategory, + this.region, + this.resourceType, + this.startTime, + this.state, + }); + + factory BackupJobSummary.fromJson(Map json) { + return BackupJobSummary( + accountId: json['AccountId'] as String?, + count: json['Count'] as int?, + endTime: timeStampFromJson(json['EndTime']), + messageCategory: json['MessageCategory'] as String?, + region: json['Region'] as String?, + resourceType: json['ResourceType'] as String?, + startTime: timeStampFromJson(json['StartTime']), + state: (json['State'] as String?)?.toBackupJobStatus(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final count = this.count; + final endTime = this.endTime; + final messageCategory = this.messageCategory; + final region = this.region; + final resourceType = this.resourceType; + final startTime = this.startTime; + final state = this.state; + return { + if (accountId != null) 'AccountId': accountId, + if (count != null) 'Count': count, + if (endTime != null) 'EndTime': unixTimestampToJson(endTime), + if (messageCategory != null) 'MessageCategory': messageCategory, + if (region != null) 'Region': region, + if (resourceType != null) 'ResourceType': resourceType, + if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + if (state != null) 'State': state.toValue(), + }; + } +} + +/// Contains an optional backup plan display name and an array of +/// BackupRule objects, each of which specifies a backup rule. Each +/// rule in a backup plan is a separate scheduled task and can back up a +/// different selection of Amazon Web Services resources. +class BackupPlan { + /// The display name of a backup plan. Must contain 1 to 50 alphanumeric or + /// '-_.' characters. + final String backupPlanName; + + /// An array of BackupRule objects, each of which specifies a + /// scheduled task that is used to back up a selection of resources. + final List rules; + + /// Contains a list of BackupOptions for each resource type. + final List? advancedBackupSettings; + + BackupPlan({ required this.backupPlanName, required this.rules, this.advancedBackupSettings, @@ -3828,6 +5393,10 @@ class BackupRule { /// a table of examples, click the preceding link and scroll down the page. final String? scheduleExpression; + /// This is the timezone in which the schedule expression is set. By default, + /// ScheduleExpressions are in UTC. You can modify this to a specified timezone. + final String? scheduleExpressionTimezone; + /// A value in minutes after a backup is scheduled before a job will be canceled /// if it doesn't start successfully. This value is optional. If this value is /// included, it must be at least 60 minutes to avoid errors. @@ -3852,6 +5421,7 @@ class BackupRule { this.recoveryPointTags, this.ruleId, this.scheduleExpression, + this.scheduleExpressionTimezone, this.startWindowMinutes, }); @@ -3872,6 +5442,7 @@ class BackupRule { ?.map((k, e) => MapEntry(k, e as String)), ruleId: json['RuleId'] as String?, scheduleExpression: json['ScheduleExpression'] as String?, + scheduleExpressionTimezone: json['ScheduleExpressionTimezone'] as String?, startWindowMinutes: json['StartWindowMinutes'] as int?, ); } @@ -3886,6 +5457,7 @@ class BackupRule { final recoveryPointTags = this.recoveryPointTags; final ruleId = this.ruleId; final scheduleExpression = this.scheduleExpression; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; final startWindowMinutes = this.startWindowMinutes; return { 'RuleName': ruleName, @@ -3899,6 +5471,8 @@ class BackupRule { if (recoveryPointTags != null) 'RecoveryPointTags': recoveryPointTags, if (ruleId != null) 'RuleId': ruleId, if (scheduleExpression != null) 'ScheduleExpression': scheduleExpression, + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, if (startWindowMinutes != null) 'StartWindowMinutes': startWindowMinutes, }; } @@ -3944,6 +5518,8 @@ class BackupRuleInput { /// href="https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html#features-by-resource"> /// Feature availability by resource table. Backup ignores this expression /// for other resource types. + /// + /// This parameter has a maximum value of 100 years (36,500 days). final Lifecycle? lifecycle; /// To help organize your resources, you can assign your own metadata to the @@ -3953,10 +5529,16 @@ class BackupRuleInput { /// A CRON expression in UTC specifying when Backup initiates a backup job. final String? scheduleExpression; + /// This is the timezone in which the schedule expression is set. By default, + /// ScheduleExpressions are in UTC. You can modify this to a specified timezone. + final String? scheduleExpressionTimezone; + /// A value in minutes after a backup is scheduled before a job will be canceled /// if it doesn't start successfully. This value is optional. If this value is /// included, it must be at least 60 minutes to avoid errors. /// + /// This parameter has a maximum value of 100 years (52,560,000 minutes). + /// /// During the start window, the backup job status remains in /// CREATED status until it has successfully begun or until the /// start window time has run out. If within the start window time Backup @@ -3976,6 +5558,7 @@ class BackupRuleInput { this.lifecycle, this.recoveryPointTags, this.scheduleExpression, + this.scheduleExpressionTimezone, this.startWindowMinutes, }); @@ -3988,6 +5571,7 @@ class BackupRuleInput { final lifecycle = this.lifecycle; final recoveryPointTags = this.recoveryPointTags; final scheduleExpression = this.scheduleExpression; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; final startWindowMinutes = this.startWindowMinutes; return { 'RuleName': ruleName, @@ -4000,6 +5584,8 @@ class BackupRuleInput { if (lifecycle != null) 'Lifecycle': lifecycle, if (recoveryPointTags != null) 'RecoveryPointTags': recoveryPointTags, if (scheduleExpression != null) 'ScheduleExpression': scheduleExpression, + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, if (startWindowMinutes != null) 'StartWindowMinutes': startWindowMinutes, }; } @@ -4022,9 +5608,9 @@ class BackupSelection { final String selectionName; /// A list of conditions that you define to assign resources to your backup - /// plans using tags. For example, "StringEquals": { "ConditionKey": - /// "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" },. - /// Condition operators are case sensitive. + /// plans using tags. For example, "StringEquals": { "Key": + /// "aws:ResourceTag/CreatedByCryo", "Value": "true" },. Condition + /// operators are case sensitive. /// /// Conditions differs from ListOfTags as follows: /// @@ -4043,9 +5629,9 @@ class BackupSelection { final Conditions? conditions; /// A list of conditions that you define to assign resources to your backup - /// plans using tags. For example, "StringEquals": { "ConditionKey": - /// "aws:ResourceTag/CreatedByCryo", "ConditionValue": "true" },. - /// Condition operators are case sensitive. + /// plans using tags. For example, "StringEquals": { "Key": + /// "aws:ResourceTag/CreatedByCryo", "Value": "true" },. Condition + /// operators are case sensitive. /// /// ListOfTags differs from Conditions as follows: /// @@ -4846,6 +6432,19 @@ class CopyJob { /// This is a boolean value indicating this is a parent (composite) copy job. final bool? isParent; + /// This parameter is the job count for the specified message category. + /// + /// Example strings may include AccessDenied, SUCCESS, + /// AGGREGATE_ALL, and InvalidParameters. See Monitoring + /// for a list of MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message categories + /// and returns the sum + final String? messageCategory; + /// This is the number of child (nested) copy jobs. final int? numberOfChildJobs; @@ -4895,6 +6494,7 @@ class CopyJob { this.destinationRecoveryPointArn, this.iamRoleArn, this.isParent, + this.messageCategory, this.numberOfChildJobs, this.parentJobId, this.resourceArn, @@ -4925,6 +6525,7 @@ class CopyJob { json['DestinationRecoveryPointArn'] as String?, iamRoleArn: json['IamRoleArn'] as String?, isParent: json['IsParent'] as bool?, + messageCategory: json['MessageCategory'] as String?, numberOfChildJobs: json['NumberOfChildJobs'] as int?, parentJobId: json['ParentJobId'] as String?, resourceArn: json['ResourceArn'] as String?, @@ -4950,6 +6551,7 @@ class CopyJob { final destinationRecoveryPointArn = this.destinationRecoveryPointArn; final iamRoleArn = this.iamRoleArn; final isParent = this.isParent; + final messageCategory = this.messageCategory; final numberOfChildJobs = this.numberOfChildJobs; final parentJobId = this.parentJobId; final resourceArn = this.resourceArn; @@ -4979,6 +6581,7 @@ class CopyJob { 'DestinationRecoveryPointArn': destinationRecoveryPointArn, if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, if (isParent != null) 'IsParent': isParent, + if (messageCategory != null) 'MessageCategory': messageCategory, if (numberOfChildJobs != null) 'NumberOfChildJobs': numberOfChildJobs, if (parentJobId != null) 'ParentJobId': parentJobId, if (resourceArn != null) 'ResourceArn': resourceArn, @@ -5037,6 +6640,176 @@ extension CopyJobStateFromString on String { } } +enum CopyJobStatus { + created, + running, + aborting, + aborted, + completing, + completed, + failing, + failed, + partial, + aggregateAll, + any, +} + +extension CopyJobStatusValueExtension on CopyJobStatus { + String toValue() { + switch (this) { + case CopyJobStatus.created: + return 'CREATED'; + case CopyJobStatus.running: + return 'RUNNING'; + case CopyJobStatus.aborting: + return 'ABORTING'; + case CopyJobStatus.aborted: + return 'ABORTED'; + case CopyJobStatus.completing: + return 'COMPLETING'; + case CopyJobStatus.completed: + return 'COMPLETED'; + case CopyJobStatus.failing: + return 'FAILING'; + case CopyJobStatus.failed: + return 'FAILED'; + case CopyJobStatus.partial: + return 'PARTIAL'; + case CopyJobStatus.aggregateAll: + return 'AGGREGATE_ALL'; + case CopyJobStatus.any: + return 'ANY'; + } + } +} + +extension CopyJobStatusFromString on String { + CopyJobStatus toCopyJobStatus() { + switch (this) { + case 'CREATED': + return CopyJobStatus.created; + case 'RUNNING': + return CopyJobStatus.running; + case 'ABORTING': + return CopyJobStatus.aborting; + case 'ABORTED': + return CopyJobStatus.aborted; + case 'COMPLETING': + return CopyJobStatus.completing; + case 'COMPLETED': + return CopyJobStatus.completed; + case 'FAILING': + return CopyJobStatus.failing; + case 'FAILED': + return CopyJobStatus.failed; + case 'PARTIAL': + return CopyJobStatus.partial; + case 'AGGREGATE_ALL': + return CopyJobStatus.aggregateAll; + case 'ANY': + return CopyJobStatus.any; + } + throw Exception('$this is not known in enum CopyJobStatus'); + } +} + +/// This is a summary of copy jobs created or running within the most recent 30 +/// days. +/// +/// The returned summary may contain the following: Region, Account, State, +/// RestourceType, MessageCategory, StartTime, EndTime, and Count of included +/// jobs. +class CopyJobSummary { + /// The account ID that owns the jobs within the summary. + final String? accountId; + + /// The value as a number of jobs in a job summary. + final int? count; + + /// The value of time in number format of a job end time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? endTime; + + /// This parameter is the job count for the specified message category. + /// + /// Example strings include AccessDenied, Success, and + /// InvalidParameters. See Monitoring + /// for a list of MessageCategory strings. + /// + /// The the value ANY returns count of all message categories. + /// + /// AGGREGATE_ALL aggregates job counts for all message categories + /// and returns the sum. + final String? messageCategory; + + /// This is the Amazon Web Services Regions within the job summary. + final String? region; + + /// This value is the job count for the specified resource type. The request + /// GetSupportedResourceTypes returns strings for supported + /// resource types + final String? resourceType; + + /// The value of time in number format of a job start time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? startTime; + + /// This value is job count for jobs with the specified state. + final CopyJobStatus? state; + + CopyJobSummary({ + this.accountId, + this.count, + this.endTime, + this.messageCategory, + this.region, + this.resourceType, + this.startTime, + this.state, + }); + + factory CopyJobSummary.fromJson(Map json) { + return CopyJobSummary( + accountId: json['AccountId'] as String?, + count: json['Count'] as int?, + endTime: timeStampFromJson(json['EndTime']), + messageCategory: json['MessageCategory'] as String?, + region: json['Region'] as String?, + resourceType: json['ResourceType'] as String?, + startTime: timeStampFromJson(json['StartTime']), + state: (json['State'] as String?)?.toCopyJobStatus(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final count = this.count; + final endTime = this.endTime; + final messageCategory = this.messageCategory; + final region = this.region; + final resourceType = this.resourceType; + final startTime = this.startTime; + final state = this.state; + return { + if (accountId != null) 'AccountId': accountId, + if (count != null) 'Count': count, + if (endTime != null) 'EndTime': unixTimestampToJson(endTime), + if (messageCategory != null) 'MessageCategory': messageCategory, + if (region != null) 'Region': region, + if (resourceType != null) 'ResourceType': resourceType, + if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + if (state != null) 'State': state.toValue(), + }; + } +} + class CreateBackupPlanOutput { /// A list of BackupOptions settings for a resource type. This /// option is only available for Windows Volume Shadow Copy Service (VSS) backup @@ -5291,6 +7064,58 @@ class CreateLegalHoldOutput { } } +class CreateLogicallyAirGappedBackupVaultOutput { + /// This is the ARN (Amazon Resource Name) of the vault being created. + final String? backupVaultArn; + + /// The name of a logical container where backups are stored. Logically + /// air-gapped backup vaults are identified by names that are unique to the + /// account used to create them and the Region where they are created. They + /// consist of lowercase letters, numbers, and hyphens. + final String? backupVaultName; + + /// The date and time when the vault was created. + /// + /// This value is in Unix format, Coordinated Universal Time (UTC), and accurate + /// to milliseconds. For example, the value 1516925490.087 represents Friday, + /// January 26, 2018 12:11:30.087 AM. + final DateTime? creationDate; + + /// This is the current state of the vault. + final VaultState? vaultState; + + CreateLogicallyAirGappedBackupVaultOutput({ + this.backupVaultArn, + this.backupVaultName, + this.creationDate, + this.vaultState, + }); + + factory CreateLogicallyAirGappedBackupVaultOutput.fromJson( + Map json) { + return CreateLogicallyAirGappedBackupVaultOutput( + backupVaultArn: json['BackupVaultArn'] as String?, + backupVaultName: json['BackupVaultName'] as String?, + creationDate: timeStampFromJson(json['CreationDate']), + vaultState: (json['VaultState'] as String?)?.toVaultState(), + ); + } + + Map toJson() { + final backupVaultArn = this.backupVaultArn; + final backupVaultName = this.backupVaultName; + final creationDate = this.creationDate; + final vaultState = this.vaultState; + return { + if (backupVaultArn != null) 'BackupVaultArn': backupVaultArn, + if (backupVaultName != null) 'BackupVaultName': backupVaultName, + if (creationDate != null) + 'CreationDate': unixTimestampToJson(creationDate), + if (vaultState != null) 'VaultState': vaultState.toValue(), + }; + } +} + class CreateReportPlanOutput { /// The date and time a backup vault is created, in Unix format and Coordinated /// Universal Time (UTC). The value of CreationTime is accurate to @@ -5332,6 +7157,101 @@ class CreateReportPlanOutput { } } +class CreateRestoreTestingPlanOutput { + /// The date and time a restore testing plan was created, in Unix format and + /// Coordinated Universal Time (UTC). The value of CreationTime is + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087AM. + final DateTime creationTime; + + /// An Amazon Resource Name (ARN) that uniquely identifies the created restore + /// testing plan. + final String restoreTestingPlanArn; + + /// This unique string is the name of the restore testing plan. + /// + /// The name cannot be changed after creation. The name consists of only + /// alphanumeric characters and underscores. Maximum length is 50. + final String restoreTestingPlanName; + + CreateRestoreTestingPlanOutput({ + required this.creationTime, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + }); + + factory CreateRestoreTestingPlanOutput.fromJson(Map json) { + return CreateRestoreTestingPlanOutput( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + }; + } +} + +class CreateRestoreTestingSelectionOutput { + /// This is the time the resource testing selection was created successfully. + final DateTime creationTime; + + /// This is the ARN of the restore testing plan with which the restore testing + /// selection is associated. + final String restoreTestingPlanArn; + + /// Unique string that is the name of the restore testing plan. + /// + /// The name cannot be changed after creation. The name consists of only + /// alphanumeric characters and underscores. Maximum length is 50. + final String restoreTestingPlanName; + + /// This is the unique name of the restore testing selection that belongs to the + /// related restore testing plan. + final String restoreTestingSelectionName; + + CreateRestoreTestingSelectionOutput({ + required this.creationTime, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + required this.restoreTestingSelectionName, + }); + + factory CreateRestoreTestingSelectionOutput.fromJson( + Map json) { + return CreateRestoreTestingSelectionOutput( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + restoreTestingSelectionName: + json['RestoreTestingSelectionName'] as String, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + final restoreTestingSelectionName = this.restoreTestingSelectionName; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'RestoreTestingSelectionName': restoreTestingSelectionName, + }; + } +} + /// This is a resource filter containing FromDate: DateTime and ToDate: /// DateTime. Both values are required. Future DateTime values are not /// permitted. @@ -5492,10 +7412,21 @@ class DescribeBackupJobOutput { /// example, arn:aws:iam::123456789012:role/S3Access. final String? iamRoleArn; + /// This is the date a backup job was initiated. + final DateTime? initiationDate; + /// This returns the boolean value that a backup job is a parent (composite) /// job. final bool? isParent; + /// This is the job count for the specified message category. + /// + /// Example strings may include AccessDenied, SUCCESS, + /// AGGREGATE_ALL, and INVALIDPARAMETERS. View Monitoring + /// for a list of accepted MessageCategory strings. + final String? messageCategory; + /// This returns the number of child (nested) backup jobs. final int? numberOfChildJobs; @@ -5532,7 +7463,7 @@ class DescribeBackupJobOutput { /// Friday, January 26, 2018 12:11:30.087 AM. final DateTime? startBy; - /// The current state of a resource recovery point. + /// The current state of a backup job. final BackupJobState? state; /// A detailed message explaining the status of the job to back up a resource. @@ -5553,7 +7484,9 @@ class DescribeBackupJobOutput { this.creationDate, this.expectedCompletionDate, this.iamRoleArn, + this.initiationDate, this.isParent, + this.messageCategory, this.numberOfChildJobs, this.parentJobId, this.percentDone, @@ -5587,7 +7520,9 @@ class DescribeBackupJobOutput { creationDate: timeStampFromJson(json['CreationDate']), expectedCompletionDate: timeStampFromJson(json['ExpectedCompletionDate']), iamRoleArn: json['IamRoleArn'] as String?, + initiationDate: timeStampFromJson(json['InitiationDate']), isParent: json['IsParent'] as bool?, + messageCategory: json['MessageCategory'] as String?, numberOfChildJobs: json['NumberOfChildJobs'] as int?, parentJobId: json['ParentJobId'] as String?, percentDone: json['PercentDone'] as String?, @@ -5616,7 +7551,9 @@ class DescribeBackupJobOutput { final creationDate = this.creationDate; final expectedCompletionDate = this.expectedCompletionDate; final iamRoleArn = this.iamRoleArn; + final initiationDate = this.initiationDate; final isParent = this.isParent; + final messageCategory = this.messageCategory; final numberOfChildJobs = this.numberOfChildJobs; final parentJobId = this.parentJobId; final percentDone = this.percentDone; @@ -5647,7 +7584,10 @@ class DescribeBackupJobOutput { if (expectedCompletionDate != null) 'ExpectedCompletionDate': unixTimestampToJson(expectedCompletionDate), if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (initiationDate != null) + 'InitiationDate': unixTimestampToJson(initiationDate), if (isParent != null) 'IsParent': isParent, + if (messageCategory != null) 'MessageCategory': messageCategory, if (numberOfChildJobs != null) 'NumberOfChildJobs': numberOfChildJobs, if (parentJobId != null) 'ParentJobId': parentJobId, if (percentDone != null) 'PercentDone': percentDone, @@ -5681,7 +7621,9 @@ class DescribeBackupVaultOutput { final DateTime? creationDate; /// A unique string that identifies the request and allows failed requests to be - /// retried without the risk of running the operation twice. + /// retried without the risk of running the operation twice. This parameter is + /// optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' + /// characters. final String? creatorRequestId; /// The server-side encryption key that is used to protect your backups; for @@ -5735,6 +7677,9 @@ class DescribeBackupVaultOutput { /// The number of recovery points that are stored in a backup vault. final int? numberOfRecoveryPoints; + /// This is the type of vault described. + final VaultType? vaultType; + DescribeBackupVaultOutput({ this.backupVaultArn, this.backupVaultName, @@ -5746,6 +7691,7 @@ class DescribeBackupVaultOutput { this.maxRetentionDays, this.minRetentionDays, this.numberOfRecoveryPoints, + this.vaultType, }); factory DescribeBackupVaultOutput.fromJson(Map json) { @@ -5760,6 +7706,7 @@ class DescribeBackupVaultOutput { maxRetentionDays: json['MaxRetentionDays'] as int?, minRetentionDays: json['MinRetentionDays'] as int?, numberOfRecoveryPoints: json['NumberOfRecoveryPoints'] as int?, + vaultType: (json['VaultType'] as String?)?.toVaultType(), ); } @@ -5774,6 +7721,7 @@ class DescribeBackupVaultOutput { final maxRetentionDays = this.maxRetentionDays; final minRetentionDays = this.minRetentionDays; final numberOfRecoveryPoints = this.numberOfRecoveryPoints; + final vaultType = this.vaultType; return { if (backupVaultArn != null) 'BackupVaultArn': backupVaultArn, if (backupVaultName != null) 'BackupVaultName': backupVaultName, @@ -5787,6 +7735,7 @@ class DescribeBackupVaultOutput { if (minRetentionDays != null) 'MinRetentionDays': minRetentionDays, if (numberOfRecoveryPoints != null) 'NumberOfRecoveryPoints': numberOfRecoveryPoints, + if (vaultType != null) 'VaultType': vaultType.toValue(), }; } } @@ -5966,6 +7915,22 @@ class DescribeProtectedResourceOutput { /// represents Friday, January 26, 2018 12:11:30.087 AM. final DateTime? lastBackupTime; + /// This is the ARN (Amazon Resource Name) of the backup vault that contains the + /// most recent backup recovery point. + final String? lastBackupVaultArn; + + /// This is the ARN (Amazon Resource Name) of the most recent recovery point. + final String? lastRecoveryPointArn; + + /// This is the time in minutes the most recent restore job took to complete. + final int? latestRestoreExecutionTimeMinutes; + + /// This is the creation date of the most recent restore job. + final DateTime? latestRestoreJobCreationDate; + + /// This is the date the most recent recovery point was created. + final DateTime? latestRestoreRecoveryPointCreationDate; + /// An ARN that uniquely identifies a resource. The format of the ARN depends on /// the resource type. final String? resourceArn; @@ -5980,6 +7945,11 @@ class DescribeProtectedResourceOutput { DescribeProtectedResourceOutput({ this.lastBackupTime, + this.lastBackupVaultArn, + this.lastRecoveryPointArn, + this.latestRestoreExecutionTimeMinutes, + this.latestRestoreJobCreationDate, + this.latestRestoreRecoveryPointCreationDate, this.resourceArn, this.resourceName, this.resourceType, @@ -5988,6 +7958,14 @@ class DescribeProtectedResourceOutput { factory DescribeProtectedResourceOutput.fromJson(Map json) { return DescribeProtectedResourceOutput( lastBackupTime: timeStampFromJson(json['LastBackupTime']), + lastBackupVaultArn: json['LastBackupVaultArn'] as String?, + lastRecoveryPointArn: json['LastRecoveryPointArn'] as String?, + latestRestoreExecutionTimeMinutes: + json['LatestRestoreExecutionTimeMinutes'] as int?, + latestRestoreJobCreationDate: + timeStampFromJson(json['LatestRestoreJobCreationDate']), + latestRestoreRecoveryPointCreationDate: + timeStampFromJson(json['LatestRestoreRecoveryPointCreationDate']), resourceArn: json['ResourceArn'] as String?, resourceName: json['ResourceName'] as String?, resourceType: json['ResourceType'] as String?, @@ -5996,12 +7974,30 @@ class DescribeProtectedResourceOutput { Map toJson() { final lastBackupTime = this.lastBackupTime; + final lastBackupVaultArn = this.lastBackupVaultArn; + final lastRecoveryPointArn = this.lastRecoveryPointArn; + final latestRestoreExecutionTimeMinutes = + this.latestRestoreExecutionTimeMinutes; + final latestRestoreJobCreationDate = this.latestRestoreJobCreationDate; + final latestRestoreRecoveryPointCreationDate = + this.latestRestoreRecoveryPointCreationDate; final resourceArn = this.resourceArn; final resourceName = this.resourceName; final resourceType = this.resourceType; return { if (lastBackupTime != null) 'LastBackupTime': unixTimestampToJson(lastBackupTime), + if (lastBackupVaultArn != null) 'LastBackupVaultArn': lastBackupVaultArn, + if (lastRecoveryPointArn != null) + 'LastRecoveryPointArn': lastRecoveryPointArn, + if (latestRestoreExecutionTimeMinutes != null) + 'LatestRestoreExecutionTimeMinutes': latestRestoreExecutionTimeMinutes, + if (latestRestoreJobCreationDate != null) + 'LatestRestoreJobCreationDate': + unixTimestampToJson(latestRestoreJobCreationDate), + if (latestRestoreRecoveryPointCreationDate != null) + 'LatestRestoreRecoveryPointCreationDate': + unixTimestampToJson(latestRestoreRecoveryPointCreationDate), if (resourceArn != null) 'ResourceArn': resourceArn, if (resourceName != null) 'ResourceName': resourceName, if (resourceType != null) 'ResourceType': resourceType, @@ -6162,6 +8158,9 @@ class DescribeRecoveryPointOutput { /// WARM or COLD. final StorageClass? storageClass; + /// This is the type of vault in which the described recovery point is stored. + final VaultType? vaultType; + DescribeRecoveryPointOutput({ this.backupSizeInBytes, this.backupVaultArn, @@ -6186,6 +8185,7 @@ class DescribeRecoveryPointOutput { this.status, this.statusMessage, this.storageClass, + this.vaultType, }); factory DescribeRecoveryPointOutput.fromJson(Map json) { @@ -6221,6 +8221,7 @@ class DescribeRecoveryPointOutput { status: (json['Status'] as String?)?.toRecoveryPointStatus(), statusMessage: json['StatusMessage'] as String?, storageClass: (json['StorageClass'] as String?)?.toStorageClass(), + vaultType: (json['VaultType'] as String?)?.toVaultType(), ); } @@ -6248,6 +8249,7 @@ class DescribeRecoveryPointOutput { final status = this.status; final statusMessage = this.statusMessage; final storageClass = this.storageClass; + final vaultType = this.vaultType; return { if (backupSizeInBytes != null) 'BackupSizeInBytes': backupSizeInBytes, if (backupVaultArn != null) 'BackupVaultArn': backupVaultArn, @@ -6279,6 +8281,7 @@ class DescribeRecoveryPointOutput { if (status != null) 'Status': status.toValue(), if (statusMessage != null) 'StatusMessage': statusMessage, if (storageClass != null) 'StorageClass': storageClass.toValue(), + if (vaultType != null) 'VaultType': vaultType.toValue(), }; } } @@ -6400,6 +8403,9 @@ class DescribeRestoreJobOutput { /// value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. final DateTime? completionDate; + /// Contains identifying information about the creation of a restore job. + final RestoreJobCreator? createdBy; + /// An Amazon Resource Name (ARN) that uniquely identifies a resource whose /// recovery point is being restored. The format of the ARN depends on the /// resource type of the backed-up resource. @@ -6411,6 +8417,14 @@ class DescribeRestoreJobOutput { /// Friday, January 26, 2018 12:11:30.087 AM. final DateTime? creationDate; + /// This notes the status of the data generated by the restore test. The status + /// may be Deleting, Failed, or + /// Successful. + final RestoreDeletionStatus? deletionStatus; + + /// This describes the restore job deletion status. + final String? deletionStatusMessage; + /// The amount of time in minutes that a job restoring a recovery point is /// expected to take. final int? expectedCompletionTimeMinutes; @@ -6427,6 +8441,10 @@ class DescribeRestoreJobOutput { /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. final String? recoveryPointArn; + /// This is the creation date of the recovery point made by the specifed restore + /// job. + final DateTime? recoveryPointCreationDate; + /// Returns metadata associated with a restore job listed by resource type. final String? resourceType; @@ -6440,20 +8458,32 @@ class DescribeRestoreJobOutput { /// A message showing the status of a job to restore a recovery point. final String? statusMessage; + /// This is the status of validation run on the indicated restore job. + final RestoreValidationStatus? validationStatus; + + /// This describes the status of validation run on the indicated restore job. + final String? validationStatusMessage; + DescribeRestoreJobOutput({ this.accountId, this.backupSizeInBytes, this.completionDate, + this.createdBy, this.createdResourceArn, this.creationDate, + this.deletionStatus, + this.deletionStatusMessage, this.expectedCompletionTimeMinutes, this.iamRoleArn, this.percentDone, this.recoveryPointArn, + this.recoveryPointCreationDate, this.resourceType, this.restoreJobId, this.status, this.statusMessage, + this.validationStatus, + this.validationStatusMessage, }); factory DescribeRestoreJobOutput.fromJson(Map json) { @@ -6461,17 +8491,29 @@ class DescribeRestoreJobOutput { accountId: json['AccountId'] as String?, backupSizeInBytes: json['BackupSizeInBytes'] as int?, completionDate: timeStampFromJson(json['CompletionDate']), + createdBy: json['CreatedBy'] != null + ? RestoreJobCreator.fromJson( + json['CreatedBy'] as Map) + : null, createdResourceArn: json['CreatedResourceArn'] as String?, creationDate: timeStampFromJson(json['CreationDate']), + deletionStatus: + (json['DeletionStatus'] as String?)?.toRestoreDeletionStatus(), + deletionStatusMessage: json['DeletionStatusMessage'] as String?, expectedCompletionTimeMinutes: json['ExpectedCompletionTimeMinutes'] as int?, iamRoleArn: json['IamRoleArn'] as String?, percentDone: json['PercentDone'] as String?, recoveryPointArn: json['RecoveryPointArn'] as String?, + recoveryPointCreationDate: + timeStampFromJson(json['RecoveryPointCreationDate']), resourceType: json['ResourceType'] as String?, restoreJobId: json['RestoreJobId'] as String?, status: (json['Status'] as String?)?.toRestoreJobStatus(), statusMessage: json['StatusMessage'] as String?, + validationStatus: + (json['ValidationStatus'] as String?)?.toRestoreValidationStatus(), + validationStatusMessage: json['ValidationStatusMessage'] as String?, ); } @@ -6479,33 +8521,50 @@ class DescribeRestoreJobOutput { final accountId = this.accountId; final backupSizeInBytes = this.backupSizeInBytes; final completionDate = this.completionDate; + final createdBy = this.createdBy; final createdResourceArn = this.createdResourceArn; final creationDate = this.creationDate; + final deletionStatus = this.deletionStatus; + final deletionStatusMessage = this.deletionStatusMessage; final expectedCompletionTimeMinutes = this.expectedCompletionTimeMinutes; final iamRoleArn = this.iamRoleArn; final percentDone = this.percentDone; final recoveryPointArn = this.recoveryPointArn; + final recoveryPointCreationDate = this.recoveryPointCreationDate; final resourceType = this.resourceType; final restoreJobId = this.restoreJobId; final status = this.status; final statusMessage = this.statusMessage; + final validationStatus = this.validationStatus; + final validationStatusMessage = this.validationStatusMessage; return { if (accountId != null) 'AccountId': accountId, if (backupSizeInBytes != null) 'BackupSizeInBytes': backupSizeInBytes, if (completionDate != null) 'CompletionDate': unixTimestampToJson(completionDate), + if (createdBy != null) 'CreatedBy': createdBy, if (createdResourceArn != null) 'CreatedResourceArn': createdResourceArn, if (creationDate != null) 'CreationDate': unixTimestampToJson(creationDate), + if (deletionStatus != null) 'DeletionStatus': deletionStatus.toValue(), + if (deletionStatusMessage != null) + 'DeletionStatusMessage': deletionStatusMessage, if (expectedCompletionTimeMinutes != null) 'ExpectedCompletionTimeMinutes': expectedCompletionTimeMinutes, if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, if (percentDone != null) 'PercentDone': percentDone, if (recoveryPointArn != null) 'RecoveryPointArn': recoveryPointArn, + if (recoveryPointCreationDate != null) + 'RecoveryPointCreationDate': + unixTimestampToJson(recoveryPointCreationDate), if (resourceType != null) 'ResourceType': resourceType, if (restoreJobId != null) 'RestoreJobId': restoreJobId, if (status != null) 'Status': status.toValue(), if (statusMessage != null) 'StatusMessage': statusMessage, + if (validationStatus != null) + 'ValidationStatus': validationStatus.toValue(), + if (validationStatusMessage != null) + 'ValidationStatusMessage': validationStatusMessage, }; } } @@ -6619,8 +8678,10 @@ class FrameworkControl { /// The scope of a control. The control scope defines what the control will /// evaluate. Three examples of control scopes are: a specific backup plan, all - /// backup plans with a specific tag, or all backup plans. For more information, - /// see + /// backup plans with a specific tag, or all backup plans. + /// + /// For more information, see /// ControlScope. final ControlScope? controlScope; @@ -7073,6 +9134,9 @@ class GetRecoveryPointRestoreMetadataOutput { /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. final String? recoveryPointArn; + /// This is the resource type associated with the recovery point. + final String? resourceType; + /// The set of metadata key-value pairs that describe the original configuration /// of the backed-up resource. These values vary depending on the service that /// is being restored. @@ -7081,6 +9145,7 @@ class GetRecoveryPointRestoreMetadataOutput { GetRecoveryPointRestoreMetadataOutput({ this.backupVaultArn, this.recoveryPointArn, + this.resourceType, this.restoreMetadata, }); @@ -7089,6 +9154,7 @@ class GetRecoveryPointRestoreMetadataOutput { return GetRecoveryPointRestoreMetadataOutput( backupVaultArn: json['BackupVaultArn'] as String?, recoveryPointArn: json['RecoveryPointArn'] as String?, + resourceType: json['ResourceType'] as String?, restoreMetadata: (json['RestoreMetadata'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -7097,15 +9163,118 @@ class GetRecoveryPointRestoreMetadataOutput { Map toJson() { final backupVaultArn = this.backupVaultArn; final recoveryPointArn = this.recoveryPointArn; + final resourceType = this.resourceType; final restoreMetadata = this.restoreMetadata; return { if (backupVaultArn != null) 'BackupVaultArn': backupVaultArn, if (recoveryPointArn != null) 'RecoveryPointArn': recoveryPointArn, + if (resourceType != null) 'ResourceType': resourceType, if (restoreMetadata != null) 'RestoreMetadata': restoreMetadata, }; } } +class GetRestoreJobMetadataOutput { + /// This contains the metadata of the specified backup job. + final Map? metadata; + + /// This is a unique identifier of a restore job within Backup. + final String? restoreJobId; + + GetRestoreJobMetadataOutput({ + this.metadata, + this.restoreJobId, + }); + + factory GetRestoreJobMetadataOutput.fromJson(Map json) { + return GetRestoreJobMetadataOutput( + metadata: (json['Metadata'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + restoreJobId: json['RestoreJobId'] as String?, + ); + } + + Map toJson() { + final metadata = this.metadata; + final restoreJobId = this.restoreJobId; + return { + if (metadata != null) 'Metadata': metadata, + if (restoreJobId != null) 'RestoreJobId': restoreJobId, + }; + } +} + +class GetRestoreTestingInferredMetadataOutput { + /// This is a string map of the metadata inferred from the request. + final Map inferredMetadata; + + GetRestoreTestingInferredMetadataOutput({ + required this.inferredMetadata, + }); + + factory GetRestoreTestingInferredMetadataOutput.fromJson( + Map json) { + return GetRestoreTestingInferredMetadataOutput( + inferredMetadata: (json['InferredMetadata'] as Map) + .map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final inferredMetadata = this.inferredMetadata; + return { + 'InferredMetadata': inferredMetadata, + }; + } +} + +class GetRestoreTestingPlanOutput { + /// Specifies the body of a restore testing plan. Includes + /// RestoreTestingPlanName. + final RestoreTestingPlanForGet restoreTestingPlan; + + GetRestoreTestingPlanOutput({ + required this.restoreTestingPlan, + }); + + factory GetRestoreTestingPlanOutput.fromJson(Map json) { + return GetRestoreTestingPlanOutput( + restoreTestingPlan: RestoreTestingPlanForGet.fromJson( + json['RestoreTestingPlan'] as Map), + ); + } + + Map toJson() { + final restoreTestingPlan = this.restoreTestingPlan; + return { + 'RestoreTestingPlan': restoreTestingPlan, + }; + } +} + +class GetRestoreTestingSelectionOutput { + /// Unique name of the restore testing selection. + final RestoreTestingSelectionForGet restoreTestingSelection; + + GetRestoreTestingSelectionOutput({ + required this.restoreTestingSelection, + }); + + factory GetRestoreTestingSelectionOutput.fromJson(Map json) { + return GetRestoreTestingSelectionOutput( + restoreTestingSelection: RestoreTestingSelectionForGet.fromJson( + json['RestoreTestingSelection'] as Map), + ); + } + + Map toJson() { + final restoreTestingSelection = this.restoreTestingSelection; + return { + 'RestoreTestingSelection': restoreTestingSelection, + }; + } +} + class GetSupportedResourceTypesOutput { /// Contains a string with the supported Amazon Web Services resource types: /// @@ -7164,6 +9333,47 @@ class GetSupportedResourceTypesOutput { } } +/// Pair of two related strings. Allowed characters are letters, white space, +/// and numbers that can be represented in UTF-8 and the following characters: +/// + - = . _ : / +class KeyValue { + /// The tag key (String). The key can't start with aws:. + /// + /// Length Constraints: Minimum length of 1. Maximum length of 128. + /// + /// Pattern: + /// ^(?![aA]{1}[wW]{1}[sS]{1}:)([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$ + final String key; + + /// The value of the key. + /// + /// Length Constraints: Maximum length of 256. + /// + /// Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$ + final String value; + + KeyValue({ + required this.key, + required this.value, + }); + + factory KeyValue.fromJson(Map json) { + return KeyValue( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + /// A legal hold is an administrative tool that helps prevent backups from being /// deleted while under a hold. While the hold is in place, backups under a hold /// cannot be deleted and lifecycle policies that would alter the backup status @@ -7302,25 +9512,94 @@ class Lifecycle { /// to cold storage. final int? moveToColdStorageAfterDays; + /// Optional Boolean. If this is true, this setting will instruct your backup + /// plan to transition supported resources to archive (cold) storage tier in + /// accordance with your lifecycle settings. + final bool? optInToArchiveForSupportedResources; + Lifecycle({ this.deleteAfterDays, this.moveToColdStorageAfterDays, + this.optInToArchiveForSupportedResources, }); factory Lifecycle.fromJson(Map json) { return Lifecycle( deleteAfterDays: json['DeleteAfterDays'] as int?, moveToColdStorageAfterDays: json['MoveToColdStorageAfterDays'] as int?, + optInToArchiveForSupportedResources: + json['OptInToArchiveForSupportedResources'] as bool?, ); } Map toJson() { final deleteAfterDays = this.deleteAfterDays; final moveToColdStorageAfterDays = this.moveToColdStorageAfterDays; + final optInToArchiveForSupportedResources = + this.optInToArchiveForSupportedResources; return { if (deleteAfterDays != null) 'DeleteAfterDays': deleteAfterDays, if (moveToColdStorageAfterDays != null) 'MoveToColdStorageAfterDays': moveToColdStorageAfterDays, + if (optInToArchiveForSupportedResources != null) + 'OptInToArchiveForSupportedResources': + optInToArchiveForSupportedResources, + }; + } +} + +class ListBackupJobSummariesOutput { + /// This is the period that sets the boundaries for returned results. + /// + ///
      + ///
    • + /// ONE_DAY for daily job count for the prior 14 days. + ///
    • + ///
    • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
    • + ///
    • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
    • + ///
    + final String? aggregationPeriod; + + /// This request returns a summary that contains Region, Account, State, + /// ResourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + final List? backupJobSummaries; + + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of resources, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the next token. + final String? nextToken; + + ListBackupJobSummariesOutput({ + this.aggregationPeriod, + this.backupJobSummaries, + this.nextToken, + }); + + factory ListBackupJobSummariesOutput.fromJson(Map json) { + return ListBackupJobSummariesOutput( + aggregationPeriod: json['AggregationPeriod'] as String?, + backupJobSummaries: (json['BackupJobSummaries'] as List?) + ?.whereNotNull() + .map((e) => BackupJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final aggregationPeriod = this.aggregationPeriod; + final backupJobSummaries = this.backupJobSummaries; + final nextToken = this.nextToken; + return { + if (aggregationPeriod != null) 'AggregationPeriod': aggregationPeriod, + if (backupJobSummaries != null) 'BackupJobSummaries': backupJobSummaries, + if (nextToken != null) 'NextToken': nextToken, }; } } @@ -7331,7 +9610,7 @@ class ListBackupJobsOutput { final List? backupJobs; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7367,7 +9646,7 @@ class ListBackupPlanTemplatesOutput { final List? backupPlanTemplatesList; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7404,7 +9683,7 @@ class ListBackupPlanVersionsOutput { final List? backupPlanVersionsList; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7441,7 +9720,7 @@ class ListBackupPlansOutput { final List? backupPlansList; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7477,7 +9756,7 @@ class ListBackupSelectionsOutput { final List? backupSelectionsList; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7517,7 +9796,7 @@ class ListBackupVaultsOutput { final List? backupVaultList; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7547,13 +9826,69 @@ class ListBackupVaultsOutput { } } +class ListCopyJobSummariesOutput { + /// This is the period that sets the boundaries for returned results. + /// + ///
      + ///
    • + /// ONE_DAY for daily job count for the prior 14 days. + ///
    • + ///
    • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
    • + ///
    • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
    • + ///
    + final String? aggregationPeriod; + + /// This return shows a summary that contains Region, Account, State, + /// ResourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + final List? copyJobSummaries; + + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of resources, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the next token. + final String? nextToken; + + ListCopyJobSummariesOutput({ + this.aggregationPeriod, + this.copyJobSummaries, + this.nextToken, + }); + + factory ListCopyJobSummariesOutput.fromJson(Map json) { + return ListCopyJobSummariesOutput( + aggregationPeriod: json['AggregationPeriod'] as String?, + copyJobSummaries: (json['CopyJobSummaries'] as List?) + ?.whereNotNull() + .map((e) => CopyJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final aggregationPeriod = this.aggregationPeriod; + final copyJobSummaries = this.copyJobSummaries; + final nextToken = this.nextToken; + return { + if (aggregationPeriod != null) 'AggregationPeriod': aggregationPeriod, + if (copyJobSummaries != null) 'CopyJobSummaries': copyJobSummaries, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListCopyJobsOutput { /// An array of structures containing metadata about your copy jobs returned in /// JSON format. final List? copyJobs; /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, NextToken allows you + /// request is made to return MaxResults number of items, NextToken allows you /// to return more items in your list starting at the location pointed to by the /// next token. final String? nextToken; @@ -7623,7 +9958,7 @@ class ListLegalHoldsOutput { final List? legalHolds; /// The next item following a partial list of returned resources. For example, - /// if a request is made to return maxResults number of resources, + /// if a request is made to return MaxResults number of resources, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7653,9 +9988,46 @@ class ListLegalHoldsOutput { } } +class ListProtectedResourcesByBackupVaultOutput { + /// The next item following a partial list of returned items. For example, if a + /// request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the next token. + final String? nextToken; + + /// These are the results returned for the request + /// ListProtectedResourcesByBackupVault. + final List? results; + + ListProtectedResourcesByBackupVaultOutput({ + this.nextToken, + this.results, + }); + + factory ListProtectedResourcesByBackupVaultOutput.fromJson( + Map json) { + return ListProtectedResourcesByBackupVaultOutput( + nextToken: json['NextToken'] as String?, + results: (json['Results'] as List?) + ?.whereNotNull() + .map((e) => ProtectedResource.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final results = this.results; + return { + if (nextToken != null) 'NextToken': nextToken, + if (results != null) 'Results': results, + }; + } +} + class ListProtectedResourcesOutput { /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7692,7 +10064,7 @@ class ListProtectedResourcesOutput { class ListRecoveryPointsByBackupVaultOutput { /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7764,7 +10136,7 @@ class ListRecoveryPointsByLegalHoldOutput { class ListRecoveryPointsByResourceOutput { /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; @@ -7872,24 +10244,82 @@ class ListReportPlansOutput { } } -class ListRestoreJobsOutput { - /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, +class ListRestoreJobSummariesOutput { + /// This is the period that sets the boundaries for returned results. + /// + ///
      + ///
    • + /// ONE_DAY for daily job count for the prior 14 days. + ///
    • + ///
    • + /// SEVEN_DAYS for the aggregated job count for the prior 7 days. + ///
    • + ///
    • + /// FOURTEEN_DAYS for aggregated job count for prior 14 days. + ///
    • + ///
    + final String? aggregationPeriod; + + /// The next item following a partial list of returned resources. For example, + /// if a request is made to return MaxResults number of resources, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; + /// This return contains a summary that contains Region, Account, State, + /// ResourceType, MessageCategory, StartTime, EndTime, and Count of included + /// jobs. + final List? restoreJobSummaries; + + ListRestoreJobSummariesOutput({ + this.aggregationPeriod, + this.nextToken, + this.restoreJobSummaries, + }); + + factory ListRestoreJobSummariesOutput.fromJson(Map json) { + return ListRestoreJobSummariesOutput( + aggregationPeriod: json['AggregationPeriod'] as String?, + nextToken: json['NextToken'] as String?, + restoreJobSummaries: (json['RestoreJobSummaries'] as List?) + ?.whereNotNull() + .map((e) => RestoreJobSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final aggregationPeriod = this.aggregationPeriod; + final nextToken = this.nextToken; + final restoreJobSummaries = this.restoreJobSummaries; + return { + if (aggregationPeriod != null) 'AggregationPeriod': aggregationPeriod, + if (nextToken != null) 'NextToken': nextToken, + if (restoreJobSummaries != null) + 'RestoreJobSummaries': restoreJobSummaries, + }; + } +} + +class ListRestoreJobsByProtectedResourceOutput { + /// The next item following a partial list of returned items. For example, if a + /// request is made to return MaxResults number of items, + /// NextToken allows youto return more items in your list starting + /// at the location pointed to by the next token + final String? nextToken; + /// An array of objects that contain detailed information about jobs to restore - /// saved resources. + /// saved resources.> final List? restoreJobs; - ListRestoreJobsOutput({ + ListRestoreJobsByProtectedResourceOutput({ this.nextToken, this.restoreJobs, }); - factory ListRestoreJobsOutput.fromJson(Map json) { - return ListRestoreJobsOutput( + factory ListRestoreJobsByProtectedResourceOutput.fromJson( + Map json) { + return ListRestoreJobsByProtectedResourceOutput( nextToken: json['NextToken'] as String?, restoreJobs: (json['RestoreJobs'] as List?) ?.whereNotNull() @@ -7908,53 +10338,170 @@ class ListRestoreJobsOutput { } } -class ListTagsOutput { +class ListRestoreJobsOutput { /// The next item following a partial list of returned items. For example, if a - /// request is made to return maxResults number of items, + /// request is made to return MaxResults number of items, /// NextToken allows you to return more items in your list starting /// at the location pointed to by the next token. final String? nextToken; - /// To help organize your resources, you can assign your own metadata to the - /// resources you create. Each tag is a key-value pair. - final Map? tags; + /// An array of objects that contain detailed information about jobs to restore + /// saved resources. + final List? restoreJobs; - ListTagsOutput({ + ListRestoreJobsOutput({ this.nextToken, - this.tags, + this.restoreJobs, }); - factory ListTagsOutput.fromJson(Map json) { - return ListTagsOutput( + factory ListRestoreJobsOutput.fromJson(Map json) { + return ListRestoreJobsOutput( nextToken: json['NextToken'] as String?, - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + restoreJobs: (json['RestoreJobs'] as List?) + ?.whereNotNull() + .map((e) => RestoreJobsListMember.fromJson(e as Map)) + .toList(), ); } Map toJson() { final nextToken = this.nextToken; - final tags = this.tags; + final restoreJobs = this.restoreJobs; return { if (nextToken != null) 'NextToken': nextToken, - if (tags != null) 'Tags': tags, + if (restoreJobs != null) 'RestoreJobs': restoreJobs, }; } } -/// A structure that contains information about a backed-up resource. -class ProtectedResource { - /// The date and time a resource was last backed up, in Unix format and - /// Coordinated Universal Time (UTC). The value of LastBackupTime - /// is accurate to milliseconds. For example, the value 1516925490.087 - /// represents Friday, January 26, 2018 12:11:30.087 AM. - final DateTime? lastBackupTime; - - /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The - /// format of the ARN depends on the resource type. - final String? resourceArn; +class ListRestoreTestingPlansOutput { + /// This is a returned list of restore testing plans. + final List restoreTestingPlans; - /// This is the non-unique name of the resource that belongs to the specified + /// The next item following a partial list of returned items. For example, if a + /// request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the nexttoken. + final String? nextToken; + + ListRestoreTestingPlansOutput({ + required this.restoreTestingPlans, + this.nextToken, + }); + + factory ListRestoreTestingPlansOutput.fromJson(Map json) { + return ListRestoreTestingPlansOutput( + restoreTestingPlans: (json['RestoreTestingPlans'] as List) + .whereNotNull() + .map((e) => + RestoreTestingPlanForList.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final restoreTestingPlans = this.restoreTestingPlans; + final nextToken = this.nextToken; + return { + 'RestoreTestingPlans': restoreTestingPlans, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRestoreTestingSelectionsOutput { + /// The returned restore testing selections associated with the restore testing + /// plan. + final List restoreTestingSelections; + + /// The next item following a partial list of returned items. For example, if a + /// request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the nexttoken. + final String? nextToken; + + ListRestoreTestingSelectionsOutput({ + required this.restoreTestingSelections, + this.nextToken, + }); + + factory ListRestoreTestingSelectionsOutput.fromJson( + Map json) { + return ListRestoreTestingSelectionsOutput( + restoreTestingSelections: (json['RestoreTestingSelections'] as List) + .whereNotNull() + .map((e) => RestoreTestingSelectionForList.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final restoreTestingSelections = this.restoreTestingSelections; + final nextToken = this.nextToken; + return { + 'RestoreTestingSelections': restoreTestingSelections, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListTagsOutput { + /// The next item following a partial list of returned items. For example, if a + /// request is made to return MaxResults number of items, + /// NextToken allows you to return more items in your list starting + /// at the location pointed to by the next token. + final String? nextToken; + + /// To help organize your resources, you can assign your own metadata to the + /// resources you create. Each tag is a key-value pair. + final Map? tags; + + ListTagsOutput({ + this.nextToken, + this.tags, + }); + + factory ListTagsOutput.fromJson(Map json) { + return ListTagsOutput( + nextToken: json['NextToken'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final tags = this.tags; + return { + if (nextToken != null) 'NextToken': nextToken, + if (tags != null) 'Tags': tags, + }; + } +} + +/// A structure that contains information about a backed-up resource. +class ProtectedResource { + /// The date and time a resource was last backed up, in Unix format and + /// Coordinated Universal Time (UTC). The value of LastBackupTime + /// is accurate to milliseconds. For example, the value 1516925490.087 + /// represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? lastBackupTime; + + /// This is the ARN (Amazon Resource Name) of the backup vault that contains the + /// most recent backup recovery point. + final String? lastBackupVaultArn; + + /// This is the ARN (Amazon Resource Name) of the most recent recovery point. + final String? lastRecoveryPointArn; + + /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The + /// format of the ARN depends on the resource type. + final String? resourceArn; + + /// This is the non-unique name of the resource that belongs to the specified /// backup. final String? resourceName; @@ -7966,6 +10513,8 @@ class ProtectedResource { ProtectedResource({ this.lastBackupTime, + this.lastBackupVaultArn, + this.lastRecoveryPointArn, this.resourceArn, this.resourceName, this.resourceType, @@ -7974,6 +10523,8 @@ class ProtectedResource { factory ProtectedResource.fromJson(Map json) { return ProtectedResource( lastBackupTime: timeStampFromJson(json['LastBackupTime']), + lastBackupVaultArn: json['LastBackupVaultArn'] as String?, + lastRecoveryPointArn: json['LastRecoveryPointArn'] as String?, resourceArn: json['ResourceArn'] as String?, resourceName: json['ResourceName'] as String?, resourceType: json['ResourceType'] as String?, @@ -7982,12 +10533,17 @@ class ProtectedResource { Map toJson() { final lastBackupTime = this.lastBackupTime; + final lastBackupVaultArn = this.lastBackupVaultArn; + final lastRecoveryPointArn = this.lastRecoveryPointArn; final resourceArn = this.resourceArn; final resourceName = this.resourceName; final resourceType = this.resourceType; return { if (lastBackupTime != null) 'LastBackupTime': unixTimestampToJson(lastBackupTime), + if (lastBackupVaultArn != null) 'LastBackupVaultArn': lastBackupVaultArn, + if (lastRecoveryPointArn != null) + 'LastRecoveryPointArn': lastRecoveryPointArn, if (resourceArn != null) 'ResourceArn': resourceArn, if (resourceName != null) 'ResourceName': resourceName, if (resourceType != null) 'ResourceType': resourceType, @@ -7995,6 +10551,48 @@ class ProtectedResource { } } +/// A list of conditions that you define for resources in your restore testing +/// plan using tags. +/// +/// For example, "StringEquals": { "Key": "aws:ResourceTag/CreatedByCryo", +/// "Value": "true" },. Condition operators are case sensitive. +class ProtectedResourceConditions { + /// Filters the values of your tagged resources for only those resources that + /// you tagged with the same value. Also called "exact matching." + final List? stringEquals; + + /// Filters the values of your tagged resources for only those resources that + /// you tagged that do not have the same value. Also called "negated matching." + final List? stringNotEquals; + + ProtectedResourceConditions({ + this.stringEquals, + this.stringNotEquals, + }); + + factory ProtectedResourceConditions.fromJson(Map json) { + return ProtectedResourceConditions( + stringEquals: (json['StringEquals'] as List?) + ?.whereNotNull() + .map((e) => KeyValue.fromJson(e as Map)) + .toList(), + stringNotEquals: (json['StringNotEquals'] as List?) + ?.whereNotNull() + .map((e) => KeyValue.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final stringEquals = this.stringEquals; + final stringNotEquals = this.stringNotEquals; + return { + if (stringEquals != null) 'StringEquals': stringEquals, + if (stringNotEquals != null) 'StringNotEquals': stringNotEquals, + }; + } +} + /// Contains detailed information about the recovery points stored in a backup /// vault. class RecoveryPointByBackupVault { @@ -8115,6 +10713,9 @@ class RecoveryPointByBackupVault { /// A message explaining the reason of the recovery point deletion failure. final String? statusMessage; + /// This is the type of vault in which the described recovery point is stored. + final VaultType? vaultType; + RecoveryPointByBackupVault({ this.backupSizeInBytes, this.backupVaultArn, @@ -8138,6 +10739,7 @@ class RecoveryPointByBackupVault { this.sourceBackupVaultArn, this.status, this.statusMessage, + this.vaultType, }); factory RecoveryPointByBackupVault.fromJson(Map json) { @@ -8172,6 +10774,7 @@ class RecoveryPointByBackupVault { sourceBackupVaultArn: json['SourceBackupVaultArn'] as String?, status: (json['Status'] as String?)?.toRecoveryPointStatus(), statusMessage: json['StatusMessage'] as String?, + vaultType: (json['VaultType'] as String?)?.toVaultType(), ); } @@ -8198,6 +10801,7 @@ class RecoveryPointByBackupVault { final sourceBackupVaultArn = this.sourceBackupVaultArn; final status = this.status; final statusMessage = this.statusMessage; + final vaultType = this.vaultType; return { if (backupSizeInBytes != null) 'BackupSizeInBytes': backupSizeInBytes, if (backupVaultArn != null) 'BackupVaultArn': backupVaultArn, @@ -8228,6 +10832,7 @@ class RecoveryPointByBackupVault { 'SourceBackupVaultArn': sourceBackupVaultArn, if (status != null) 'Status': status.toValue(), if (statusMessage != null) 'StatusMessage': statusMessage, + if (vaultType != null) 'VaultType': vaultType.toValue(), }; } } @@ -8277,6 +10882,9 @@ class RecoveryPointByResource { /// A message explaining the reason of the recovery point deletion failure. final String? statusMessage; + /// This is the type of vault in which the described recovery point is stored. + final VaultType? vaultType; + RecoveryPointByResource({ this.backupSizeBytes, this.backupVaultName, @@ -8288,6 +10896,7 @@ class RecoveryPointByResource { this.resourceName, this.status, this.statusMessage, + this.vaultType, }); factory RecoveryPointByResource.fromJson(Map json) { @@ -8302,6 +10911,7 @@ class RecoveryPointByResource { resourceName: json['ResourceName'] as String?, status: (json['Status'] as String?)?.toRecoveryPointStatus(), statusMessage: json['StatusMessage'] as String?, + vaultType: (json['VaultType'] as String?)?.toVaultType(), ); } @@ -8316,6 +10926,7 @@ class RecoveryPointByResource { final resourceName = this.resourceName; final status = this.status; final statusMessage = this.statusMessage; + final vaultType = this.vaultType; return { if (backupSizeBytes != null) 'BackupSizeBytes': backupSizeBytes, if (backupVaultName != null) 'BackupVaultName': backupVaultName, @@ -8329,6 +10940,7 @@ class RecoveryPointByResource { if (resourceName != null) 'ResourceName': resourceName, if (status != null) 'Status': status.toValue(), if (statusMessage != null) 'StatusMessage': statusMessage, + if (vaultType != null) 'VaultType': vaultType.toValue(), }; } } @@ -8891,176 +11503,1308 @@ class ReportSetting { } } -enum RestoreJobStatus { - pending, - running, - completed, - aborted, - failed, -} +enum RestoreDeletionStatus { + deleting, + failed, + successful, +} + +extension RestoreDeletionStatusValueExtension on RestoreDeletionStatus { + String toValue() { + switch (this) { + case RestoreDeletionStatus.deleting: + return 'DELETING'; + case RestoreDeletionStatus.failed: + return 'FAILED'; + case RestoreDeletionStatus.successful: + return 'SUCCESSFUL'; + } + } +} + +extension RestoreDeletionStatusFromString on String { + RestoreDeletionStatus toRestoreDeletionStatus() { + switch (this) { + case 'DELETING': + return RestoreDeletionStatus.deleting; + case 'FAILED': + return RestoreDeletionStatus.failed; + case 'SUCCESSFUL': + return RestoreDeletionStatus.successful; + } + throw Exception('$this is not known in enum RestoreDeletionStatus'); + } +} + +/// Contains information about the restore testing plan that Backup used to +/// initiate the restore job. +class RestoreJobCreator { + /// An Amazon Resource Name (ARN) that uniquely identifies a restore testing + /// plan. + final String? restoreTestingPlanArn; + + RestoreJobCreator({ + this.restoreTestingPlanArn, + }); + + factory RestoreJobCreator.fromJson(Map json) { + return RestoreJobCreator( + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String?, + ); + } + + Map toJson() { + final restoreTestingPlanArn = this.restoreTestingPlanArn; + return { + if (restoreTestingPlanArn != null) + 'RestoreTestingPlanArn': restoreTestingPlanArn, + }; + } +} + +enum RestoreJobState { + created, + pending, + running, + aborted, + completed, + failed, + aggregateAll, + any, +} + +extension RestoreJobStateValueExtension on RestoreJobState { + String toValue() { + switch (this) { + case RestoreJobState.created: + return 'CREATED'; + case RestoreJobState.pending: + return 'PENDING'; + case RestoreJobState.running: + return 'RUNNING'; + case RestoreJobState.aborted: + return 'ABORTED'; + case RestoreJobState.completed: + return 'COMPLETED'; + case RestoreJobState.failed: + return 'FAILED'; + case RestoreJobState.aggregateAll: + return 'AGGREGATE_ALL'; + case RestoreJobState.any: + return 'ANY'; + } + } +} + +extension RestoreJobStateFromString on String { + RestoreJobState toRestoreJobState() { + switch (this) { + case 'CREATED': + return RestoreJobState.created; + case 'PENDING': + return RestoreJobState.pending; + case 'RUNNING': + return RestoreJobState.running; + case 'ABORTED': + return RestoreJobState.aborted; + case 'COMPLETED': + return RestoreJobState.completed; + case 'FAILED': + return RestoreJobState.failed; + case 'AGGREGATE_ALL': + return RestoreJobState.aggregateAll; + case 'ANY': + return RestoreJobState.any; + } + throw Exception('$this is not known in enum RestoreJobState'); + } +} + +enum RestoreJobStatus { + pending, + running, + completed, + aborted, + failed, +} + +extension RestoreJobStatusValueExtension on RestoreJobStatus { + String toValue() { + switch (this) { + case RestoreJobStatus.pending: + return 'PENDING'; + case RestoreJobStatus.running: + return 'RUNNING'; + case RestoreJobStatus.completed: + return 'COMPLETED'; + case RestoreJobStatus.aborted: + return 'ABORTED'; + case RestoreJobStatus.failed: + return 'FAILED'; + } + } +} + +extension RestoreJobStatusFromString on String { + RestoreJobStatus toRestoreJobStatus() { + switch (this) { + case 'PENDING': + return RestoreJobStatus.pending; + case 'RUNNING': + return RestoreJobStatus.running; + case 'COMPLETED': + return RestoreJobStatus.completed; + case 'ABORTED': + return RestoreJobStatus.aborted; + case 'FAILED': + return RestoreJobStatus.failed; + } + throw Exception('$this is not known in enum RestoreJobStatus'); + } +} + +/// This is a summary of restore jobs created or running within the most recent +/// 30 days. +/// +/// The returned summary may contain the following: Region, Account, State, +/// ResourceType, MessageCategory, StartTime, EndTime, and Count of included +/// jobs. +class RestoreJobSummary { + /// The account ID that owns the jobs within the summary. + final String? accountId; + + /// The value as a number of jobs in a job summary. + final int? count; + + /// The value of time in number format of a job end time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? endTime; + + /// The Amazon Web Services Regions within the job summary. + final String? region; + + /// This value is the job count for the specified resource type. The request + /// GetSupportedResourceTypes returns strings for supported + /// resource types. + final String? resourceType; + + /// The value of time in number format of a job start time. + /// + /// This value is the time in Unix format, Coordinated Universal Time (UTC), and + /// accurate to milliseconds. For example, the value 1516925490.087 represents + /// Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? startTime; + + /// This value is job count for jobs with the specified state. + final RestoreJobState? state; + + RestoreJobSummary({ + this.accountId, + this.count, + this.endTime, + this.region, + this.resourceType, + this.startTime, + this.state, + }); + + factory RestoreJobSummary.fromJson(Map json) { + return RestoreJobSummary( + accountId: json['AccountId'] as String?, + count: json['Count'] as int?, + endTime: timeStampFromJson(json['EndTime']), + region: json['Region'] as String?, + resourceType: json['ResourceType'] as String?, + startTime: timeStampFromJson(json['StartTime']), + state: (json['State'] as String?)?.toRestoreJobState(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final count = this.count; + final endTime = this.endTime; + final region = this.region; + final resourceType = this.resourceType; + final startTime = this.startTime; + final state = this.state; + return { + if (accountId != null) 'AccountId': accountId, + if (count != null) 'Count': count, + if (endTime != null) 'EndTime': unixTimestampToJson(endTime), + if (region != null) 'Region': region, + if (resourceType != null) 'ResourceType': resourceType, + if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + if (state != null) 'State': state.toValue(), + }; + } +} + +/// Contains metadata about a restore job. +class RestoreJobsListMember { + /// The account ID that owns the restore job. + final String? accountId; + + /// The size, in bytes, of the restored resource. + final int? backupSizeInBytes; + + /// The date and time a job to restore a recovery point is completed, in Unix + /// format and Coordinated Universal Time (UTC). The value of + /// CompletionDate is accurate to milliseconds. For example, the + /// value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? completionDate; + + /// Contains identifying information about the creation of a restore job. + final RestoreJobCreator? createdBy; + + /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The + /// format of the ARN depends on the resource type. + final String? createdResourceArn; + + /// The date and time a restore job is created, in Unix format and Coordinated + /// Universal Time (UTC). The value of CreationDate is accurate to + /// milliseconds. For example, the value 1516925490.087 represents Friday, + /// January 26, 2018 12:11:30.087 AM. + final DateTime? creationDate; + + /// This notes the status of the data generated by the restore test. The status + /// may be Deleting, Failed, or + /// Successful. + final RestoreDeletionStatus? deletionStatus; + + /// This describes the restore job deletion status. + final String? deletionStatusMessage; + + /// The amount of time in minutes that a job restoring a recovery point is + /// expected to take. + final int? expectedCompletionTimeMinutes; + + /// Specifies the IAM role ARN used to create the target recovery point; for + /// example, arn:aws:iam::123456789012:role/S3Access. + final String? iamRoleArn; + + /// Contains an estimated percentage complete of a job at the time the job + /// status was queried. + final String? percentDone; + + /// An ARN that uniquely identifies a recovery point; for example, + /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + final String? recoveryPointArn; + + /// The date on which a recovery point was created. + final DateTime? recoveryPointCreationDate; + + /// The resource type of the listed restore jobs; for example, an Amazon Elastic + /// Block Store (Amazon EBS) volume or an Amazon Relational Database Service + /// (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, + /// the only supported resource type is Amazon EC2. + final String? resourceType; + + /// Uniquely identifies the job that restores a recovery point. + final String? restoreJobId; + + /// A status code specifying the state of the job initiated by Backup to restore + /// a recovery point. + final RestoreJobStatus? status; + + /// A detailed message explaining the status of the job to restore a recovery + /// point. + final String? statusMessage; + + /// This is the status of validation run on the indicated restore job. + final RestoreValidationStatus? validationStatus; + + /// This describes the status of validation run on the indicated restore job. + final String? validationStatusMessage; + + RestoreJobsListMember({ + this.accountId, + this.backupSizeInBytes, + this.completionDate, + this.createdBy, + this.createdResourceArn, + this.creationDate, + this.deletionStatus, + this.deletionStatusMessage, + this.expectedCompletionTimeMinutes, + this.iamRoleArn, + this.percentDone, + this.recoveryPointArn, + this.recoveryPointCreationDate, + this.resourceType, + this.restoreJobId, + this.status, + this.statusMessage, + this.validationStatus, + this.validationStatusMessage, + }); + + factory RestoreJobsListMember.fromJson(Map json) { + return RestoreJobsListMember( + accountId: json['AccountId'] as String?, + backupSizeInBytes: json['BackupSizeInBytes'] as int?, + completionDate: timeStampFromJson(json['CompletionDate']), + createdBy: json['CreatedBy'] != null + ? RestoreJobCreator.fromJson( + json['CreatedBy'] as Map) + : null, + createdResourceArn: json['CreatedResourceArn'] as String?, + creationDate: timeStampFromJson(json['CreationDate']), + deletionStatus: + (json['DeletionStatus'] as String?)?.toRestoreDeletionStatus(), + deletionStatusMessage: json['DeletionStatusMessage'] as String?, + expectedCompletionTimeMinutes: + json['ExpectedCompletionTimeMinutes'] as int?, + iamRoleArn: json['IamRoleArn'] as String?, + percentDone: json['PercentDone'] as String?, + recoveryPointArn: json['RecoveryPointArn'] as String?, + recoveryPointCreationDate: + timeStampFromJson(json['RecoveryPointCreationDate']), + resourceType: json['ResourceType'] as String?, + restoreJobId: json['RestoreJobId'] as String?, + status: (json['Status'] as String?)?.toRestoreJobStatus(), + statusMessage: json['StatusMessage'] as String?, + validationStatus: + (json['ValidationStatus'] as String?)?.toRestoreValidationStatus(), + validationStatusMessage: json['ValidationStatusMessage'] as String?, + ); + } + + Map toJson() { + final accountId = this.accountId; + final backupSizeInBytes = this.backupSizeInBytes; + final completionDate = this.completionDate; + final createdBy = this.createdBy; + final createdResourceArn = this.createdResourceArn; + final creationDate = this.creationDate; + final deletionStatus = this.deletionStatus; + final deletionStatusMessage = this.deletionStatusMessage; + final expectedCompletionTimeMinutes = this.expectedCompletionTimeMinutes; + final iamRoleArn = this.iamRoleArn; + final percentDone = this.percentDone; + final recoveryPointArn = this.recoveryPointArn; + final recoveryPointCreationDate = this.recoveryPointCreationDate; + final resourceType = this.resourceType; + final restoreJobId = this.restoreJobId; + final status = this.status; + final statusMessage = this.statusMessage; + final validationStatus = this.validationStatus; + final validationStatusMessage = this.validationStatusMessage; + return { + if (accountId != null) 'AccountId': accountId, + if (backupSizeInBytes != null) 'BackupSizeInBytes': backupSizeInBytes, + if (completionDate != null) + 'CompletionDate': unixTimestampToJson(completionDate), + if (createdBy != null) 'CreatedBy': createdBy, + if (createdResourceArn != null) 'CreatedResourceArn': createdResourceArn, + if (creationDate != null) + 'CreationDate': unixTimestampToJson(creationDate), + if (deletionStatus != null) 'DeletionStatus': deletionStatus.toValue(), + if (deletionStatusMessage != null) + 'DeletionStatusMessage': deletionStatusMessage, + if (expectedCompletionTimeMinutes != null) + 'ExpectedCompletionTimeMinutes': expectedCompletionTimeMinutes, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (percentDone != null) 'PercentDone': percentDone, + if (recoveryPointArn != null) 'RecoveryPointArn': recoveryPointArn, + if (recoveryPointCreationDate != null) + 'RecoveryPointCreationDate': + unixTimestampToJson(recoveryPointCreationDate), + if (resourceType != null) 'ResourceType': resourceType, + if (restoreJobId != null) 'RestoreJobId': restoreJobId, + if (status != null) 'Status': status.toValue(), + if (statusMessage != null) 'StatusMessage': statusMessage, + if (validationStatus != null) + 'ValidationStatus': validationStatus.toValue(), + if (validationStatusMessage != null) + 'ValidationStatusMessage': validationStatusMessage, + }; + } +} + +/// This contains metadata about a restore testing plan. +class RestoreTestingPlanForCreate { + /// Required: Algorithm; Required: Recovery point types; IncludeVaults (one or + /// more). Optional: SelectionWindowDays ('30' if not specified); ExcludeVaults + /// (list of selectors), defaults to empty list if not listed. + final RestoreTestingRecoveryPointSelection recoveryPointSelection; + + /// The RestoreTestingPlanName is a unique string that is the name of the + /// restore testing plan. This cannot be changed after creation, and it must + /// consist of only alphanumeric characters and underscores. + final String restoreTestingPlanName; + + /// A CRON expression in specified timezone when a restore testing plan is + /// executed. + final String scheduleExpression; + + /// Optional. This is the timezone in which the schedule expression is set. By + /// default, ScheduleExpressions are in UTC. You can modify this to a specified + /// timezone. + final String? scheduleExpressionTimezone; + + /// Defaults to 24 hours. + /// + /// A value in hours after a restore test is scheduled before a job will be + /// canceled if it doesn't start successfully. This value is optional. If this + /// value is included, this parameter has a maximum value of 168 hours (one + /// week). + final int? startWindowHours; + + RestoreTestingPlanForCreate({ + required this.recoveryPointSelection, + required this.restoreTestingPlanName, + required this.scheduleExpression, + this.scheduleExpressionTimezone, + this.startWindowHours, + }); + + Map toJson() { + final recoveryPointSelection = this.recoveryPointSelection; + final restoreTestingPlanName = this.restoreTestingPlanName; + final scheduleExpression = this.scheduleExpression; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; + final startWindowHours = this.startWindowHours; + return { + 'RecoveryPointSelection': recoveryPointSelection, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'ScheduleExpression': scheduleExpression, + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, + if (startWindowHours != null) 'StartWindowHours': startWindowHours, + }; + } +} + +/// This contains metadata about a restore testing plan. +class RestoreTestingPlanForGet { + /// The date and time that a restore testing plan was created, in Unix format + /// and Coordinated Universal Time (UTC). The value of CreationTime + /// is accurate to milliseconds. For example, the value 1516925490.087 + /// represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime creationTime; + + /// The specified criteria to assign a set of resources, such as recovery point + /// types or backup vaults. + final RestoreTestingRecoveryPointSelection recoveryPointSelection; + + /// An Amazon Resource Name (ARN) that uniquely identifies a restore testing + /// plan. + final String restoreTestingPlanArn; + + /// This is the restore testing plan name. + final String restoreTestingPlanName; + + /// A CRON expression in specified timezone when a restore testing plan is + /// executed. + final String scheduleExpression; + + /// This identifies the request and allows failed requests to be retried without + /// the risk of running the operation twice. If the request includes a + /// CreatorRequestId that matches an existing backup plan, that + /// plan is returned. This parameter is optional. + /// + /// If used, this parameter must contain 1 to 50 alphanumeric or '-_.' + /// characters. + final String? creatorRequestId; + + /// The last time a restore test was run with the specified restore testing + /// plan. A date and time, in Unix format and Coordinated Universal Time (UTC). + /// The value of LastExecutionDate is accurate to milliseconds. For + /// example, the value 1516925490.087 represents Friday, January 26, 2018 + /// 12:11:30.087 AM. + final DateTime? lastExecutionTime; + + /// The date and time that the restore testing plan was updated. This update is + /// in Unix format and Coordinated Universal Time (UTC). The value of + /// LastUpdateTime is accurate to milliseconds. For example, the + /// value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? lastUpdateTime; + + /// Optional. This is the timezone in which the schedule expression is set. By + /// default, ScheduleExpressions are in UTC. You can modify this to a specified + /// timezone. + final String? scheduleExpressionTimezone; + + /// Defaults to 24 hours. + /// + /// A value in hours after a restore test is scheduled before a job will be + /// canceled if it doesn't start successfully. This value is optional. If this + /// value is included, this parameter has a maximum value of 168 hours (one + /// week). + final int? startWindowHours; + + RestoreTestingPlanForGet({ + required this.creationTime, + required this.recoveryPointSelection, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + required this.scheduleExpression, + this.creatorRequestId, + this.lastExecutionTime, + this.lastUpdateTime, + this.scheduleExpressionTimezone, + this.startWindowHours, + }); + + factory RestoreTestingPlanForGet.fromJson(Map json) { + return RestoreTestingPlanForGet( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + recoveryPointSelection: RestoreTestingRecoveryPointSelection.fromJson( + json['RecoveryPointSelection'] as Map), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + scheduleExpression: json['ScheduleExpression'] as String, + creatorRequestId: json['CreatorRequestId'] as String?, + lastExecutionTime: timeStampFromJson(json['LastExecutionTime']), + lastUpdateTime: timeStampFromJson(json['LastUpdateTime']), + scheduleExpressionTimezone: json['ScheduleExpressionTimezone'] as String?, + startWindowHours: json['StartWindowHours'] as int?, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final recoveryPointSelection = this.recoveryPointSelection; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + final scheduleExpression = this.scheduleExpression; + final creatorRequestId = this.creatorRequestId; + final lastExecutionTime = this.lastExecutionTime; + final lastUpdateTime = this.lastUpdateTime; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; + final startWindowHours = this.startWindowHours; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RecoveryPointSelection': recoveryPointSelection, + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'ScheduleExpression': scheduleExpression, + if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId, + if (lastExecutionTime != null) + 'LastExecutionTime': unixTimestampToJson(lastExecutionTime), + if (lastUpdateTime != null) + 'LastUpdateTime': unixTimestampToJson(lastUpdateTime), + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, + if (startWindowHours != null) 'StartWindowHours': startWindowHours, + }; + } +} + +/// This contains metadata about a restore testing plan. +class RestoreTestingPlanForList { + /// The date and time that a restore testing plan was created, in Unix format + /// and Coordinated Universal Time (UTC). The value of CreationTime + /// is accurate to milliseconds. For example, the value 1516925490.087 + /// represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime creationTime; + + /// An Amazon Resource Name (ARN) that uniquely identifiesa restore testing + /// plan. + final String restoreTestingPlanArn; + + /// This is the restore testing plan name. + final String restoreTestingPlanName; + + /// A CRON expression in specified timezone when a restore testing plan is + /// executed. + final String scheduleExpression; + + /// The last time a restore test was run with the specified restore testing + /// plan. A date and time, in Unix format and Coordinated Universal Time (UTC). + /// The value of LastExecutionDate is accurate to milliseconds. For + /// example, the value 1516925490.087 represents Friday, January 26, 2018 + /// 12:11:30.087 AM. + final DateTime? lastExecutionTime; + + /// The date and time that the restore testing plan was updated. This update is + /// in Unix format and Coordinated Universal Time (UTC). The value of + /// LastUpdateTime is accurate to milliseconds. For example, the + /// value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. + final DateTime? lastUpdateTime; + + /// Optional. This is the timezone in which the schedule expression is set. By + /// default, ScheduleExpressions are in UTC. You can modify this to a specified + /// timezone. + final String? scheduleExpressionTimezone; + + /// Defaults to 24 hours. + /// + /// A value in hours after a restore test is scheduled before a job will be + /// canceled if it doesn't start successfully. This value is optional. If this + /// value is included, this parameter has a maximum value of 168 hours (one + /// week). + final int? startWindowHours; + + RestoreTestingPlanForList({ + required this.creationTime, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + required this.scheduleExpression, + this.lastExecutionTime, + this.lastUpdateTime, + this.scheduleExpressionTimezone, + this.startWindowHours, + }); + + factory RestoreTestingPlanForList.fromJson(Map json) { + return RestoreTestingPlanForList( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + scheduleExpression: json['ScheduleExpression'] as String, + lastExecutionTime: timeStampFromJson(json['LastExecutionTime']), + lastUpdateTime: timeStampFromJson(json['LastUpdateTime']), + scheduleExpressionTimezone: json['ScheduleExpressionTimezone'] as String?, + startWindowHours: json['StartWindowHours'] as int?, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + final scheduleExpression = this.scheduleExpression; + final lastExecutionTime = this.lastExecutionTime; + final lastUpdateTime = this.lastUpdateTime; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; + final startWindowHours = this.startWindowHours; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'ScheduleExpression': scheduleExpression, + if (lastExecutionTime != null) + 'LastExecutionTime': unixTimestampToJson(lastExecutionTime), + if (lastUpdateTime != null) + 'LastUpdateTime': unixTimestampToJson(lastUpdateTime), + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, + if (startWindowHours != null) 'StartWindowHours': startWindowHours, + }; + } +} + +/// This contains metadata about a restore testing plan. +class RestoreTestingPlanForUpdate { + /// Required: Algorithm; RecoveryPointTypes; + /// IncludeVaults (one or more). + /// + /// Optional: SelectionWindowDays ('30' if not specified); + /// ExcludeVaults (defaults to empty list if not listed). + final RestoreTestingRecoveryPointSelection? recoveryPointSelection; + + /// A CRON expression in specified timezone when a restore testing plan is + /// executed. + final String? scheduleExpression; + + /// Optional. This is the timezone in which the schedule expression is set. By + /// default, ScheduleExpressions are in UTC. You can modify this to a specified + /// timezone. + final String? scheduleExpressionTimezone; + + /// Defaults to 24 hours. + /// + /// A value in hours after a restore test is scheduled before a job will be + /// canceled if it doesn't start successfully. This value is optional. If this + /// value is included, this parameter has a maximum value of 168 hours (one + /// week). + final int? startWindowHours; + + RestoreTestingPlanForUpdate({ + this.recoveryPointSelection, + this.scheduleExpression, + this.scheduleExpressionTimezone, + this.startWindowHours, + }); + + Map toJson() { + final recoveryPointSelection = this.recoveryPointSelection; + final scheduleExpression = this.scheduleExpression; + final scheduleExpressionTimezone = this.scheduleExpressionTimezone; + final startWindowHours = this.startWindowHours; + return { + if (recoveryPointSelection != null) + 'RecoveryPointSelection': recoveryPointSelection, + if (scheduleExpression != null) 'ScheduleExpression': scheduleExpression, + if (scheduleExpressionTimezone != null) + 'ScheduleExpressionTimezone': scheduleExpressionTimezone, + if (startWindowHours != null) 'StartWindowHours': startWindowHours, + }; + } +} + +/// Required: Algorithm; Required: Recovery point types; IncludeVaults(one or +/// more). Optional: SelectionWindowDays ('30' if not specified);ExcludeVaults +/// (list of selectors), defaults to empty list if not listed. +class RestoreTestingRecoveryPointSelection { + /// Acceptable values include "LATEST_WITHIN_WINDOW" or "RANDOM_WITHIN_WINDOW" + final RestoreTestingRecoveryPointSelectionAlgorithm? algorithm; + + /// Accepted values include specific ARNs or list of selectors. Defaults to + /// empty list if not listed. + final List? excludeVaults; + + /// Accepted values include wildcard ["*"] or by specific ARNs or ARN wilcard + /// replacement ["arn:aws:backup:us-west-2:123456789012:backup-vault:asdf", ...] + /// ["arn:aws:backup:*:*:backup-vault:asdf-*", ...] + final List? includeVaults; + + /// These are the types of recovery points. + final List? recoveryPointTypes; + + /// Accepted values are integers from 1 to 365. + final int? selectionWindowDays; + + RestoreTestingRecoveryPointSelection({ + this.algorithm, + this.excludeVaults, + this.includeVaults, + this.recoveryPointTypes, + this.selectionWindowDays, + }); + + factory RestoreTestingRecoveryPointSelection.fromJson( + Map json) { + return RestoreTestingRecoveryPointSelection( + algorithm: (json['Algorithm'] as String?) + ?.toRestoreTestingRecoveryPointSelectionAlgorithm(), + excludeVaults: (json['ExcludeVaults'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + includeVaults: (json['IncludeVaults'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + recoveryPointTypes: (json['RecoveryPointTypes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toRestoreTestingRecoveryPointType()) + .toList(), + selectionWindowDays: json['SelectionWindowDays'] as int?, + ); + } + + Map toJson() { + final algorithm = this.algorithm; + final excludeVaults = this.excludeVaults; + final includeVaults = this.includeVaults; + final recoveryPointTypes = this.recoveryPointTypes; + final selectionWindowDays = this.selectionWindowDays; + return { + if (algorithm != null) 'Algorithm': algorithm.toValue(), + if (excludeVaults != null) 'ExcludeVaults': excludeVaults, + if (includeVaults != null) 'IncludeVaults': includeVaults, + if (recoveryPointTypes != null) + 'RecoveryPointTypes': + recoveryPointTypes.map((e) => e.toValue()).toList(), + if (selectionWindowDays != null) + 'SelectionWindowDays': selectionWindowDays, + }; + } +} + +enum RestoreTestingRecoveryPointSelectionAlgorithm { + latestWithinWindow, + randomWithinWindow, +} + +extension RestoreTestingRecoveryPointSelectionAlgorithmValueExtension + on RestoreTestingRecoveryPointSelectionAlgorithm { + String toValue() { + switch (this) { + case RestoreTestingRecoveryPointSelectionAlgorithm.latestWithinWindow: + return 'LATEST_WITHIN_WINDOW'; + case RestoreTestingRecoveryPointSelectionAlgorithm.randomWithinWindow: + return 'RANDOM_WITHIN_WINDOW'; + } + } +} + +extension RestoreTestingRecoveryPointSelectionAlgorithmFromString on String { + RestoreTestingRecoveryPointSelectionAlgorithm + toRestoreTestingRecoveryPointSelectionAlgorithm() { + switch (this) { + case 'LATEST_WITHIN_WINDOW': + return RestoreTestingRecoveryPointSelectionAlgorithm.latestWithinWindow; + case 'RANDOM_WITHIN_WINDOW': + return RestoreTestingRecoveryPointSelectionAlgorithm.randomWithinWindow; + } + throw Exception( + '$this is not known in enum RestoreTestingRecoveryPointSelectionAlgorithm'); + } +} + +enum RestoreTestingRecoveryPointType { + continuous, + snapshot, +} + +extension RestoreTestingRecoveryPointTypeValueExtension + on RestoreTestingRecoveryPointType { + String toValue() { + switch (this) { + case RestoreTestingRecoveryPointType.continuous: + return 'CONTINUOUS'; + case RestoreTestingRecoveryPointType.snapshot: + return 'SNAPSHOT'; + } + } +} + +extension RestoreTestingRecoveryPointTypeFromString on String { + RestoreTestingRecoveryPointType toRestoreTestingRecoveryPointType() { + switch (this) { + case 'CONTINUOUS': + return RestoreTestingRecoveryPointType.continuous; + case 'SNAPSHOT': + return RestoreTestingRecoveryPointType.snapshot; + } + throw Exception( + '$this is not known in enum RestoreTestingRecoveryPointType'); + } +} + +/// This contains metadata about a specific restore testing selection. +/// +/// ProtectedResourceType is required, such as Amazon EBS or Amazon EC2. +/// +/// This consists of RestoreTestingSelectionName, +/// ProtectedResourceType, and one of the following: +/// +///
      +///
    • +/// ProtectedResourceArns +///
    • +///
    • +/// ProtectedResourceConditions +///
    • +///
    +/// Each protected resource type can have one single value. +/// +/// A restore testing selection can include a wildcard value ("*") for +/// ProtectedResourceArns along with +/// ProtectedResourceConditions. Alternatively, you can include up +/// to 30 specific protected resource ARNs in +/// ProtectedResourceArns. +/// +/// ProtectedResourceConditions examples include as +/// StringEquals and StringNotEquals. +class RestoreTestingSelectionForCreate { + /// The Amazon Resource Name (ARN) of the IAM role that Backup uses to create + /// the target resource; for example: + /// arn:aws:iam::123456789012:role/S3Access. + final String iamRoleArn; + + /// The type of Amazon Web Services resource included in a restore testing + /// selection; for example, an Amazon EBS volume or an Amazon RDS database. + /// + /// Supported resource types accepted include: + /// + ///
      + ///
    • + /// Aurora for Amazon Aurora + ///
    • + ///
    • + /// DocumentDB for Amazon DocumentDB (with MongoDB compatibility) + ///
    • + ///
    • + /// DynamoDB for Amazon DynamoDB + ///
    • + ///
    • + /// EBS for Amazon Elastic Block Store + ///
    • + ///
    • + /// EC2 for Amazon Elastic Compute Cloud + ///
    • + ///
    • + /// EFS for Amazon Elastic File System + ///
    • + ///
    • + /// FSx for Amazon FSx + ///
    • + ///
    • + /// Neptune for Amazon Neptune + ///
    • + ///
    • + /// RDS for Amazon Relational Database Service + ///
    • + ///
    • + /// S3 for Amazon S3 + ///
    • + ///
    + final String protectedResourceType; + + /// This is the unique name of the restore testing selection that belongs to the + /// related restore testing plan. + final String restoreTestingSelectionName; + + /// Each protected resource can be filtered by its specific ARNs, such as + /// ProtectedResourceArns: ["arn:aws:...", "arn:aws:..."] or by a + /// wildcard: ProtectedResourceArns: ["*"], but not both. + final List? protectedResourceArns; + + /// If you have included the wildcard in ProtectedResourceArns, you can include + /// resource conditions, such as ProtectedResourceConditions: { + /// StringEquals: [{ key: "XXXX", value: "YYYY" }]. + final ProtectedResourceConditions? protectedResourceConditions; + + /// You can override certain restore metadata keys by including the parameter + /// RestoreMetadataOverrides in the body of + /// RestoreTestingSelection. Key values are not case sensitive. + /// + /// See the complete list of restore + /// testing inferred metadata. + final Map? restoreMetadataOverrides; + + /// This is amount of hours (1 to 168) available to run a validation script on + /// the data. The data will be deleted upon the completion of the validation + /// script or the end of the specified retention period, whichever comes first. + final int? validationWindowHours; + + RestoreTestingSelectionForCreate({ + required this.iamRoleArn, + required this.protectedResourceType, + required this.restoreTestingSelectionName, + this.protectedResourceArns, + this.protectedResourceConditions, + this.restoreMetadataOverrides, + this.validationWindowHours, + }); + + Map toJson() { + final iamRoleArn = this.iamRoleArn; + final protectedResourceType = this.protectedResourceType; + final restoreTestingSelectionName = this.restoreTestingSelectionName; + final protectedResourceArns = this.protectedResourceArns; + final protectedResourceConditions = this.protectedResourceConditions; + final restoreMetadataOverrides = this.restoreMetadataOverrides; + final validationWindowHours = this.validationWindowHours; + return { + 'IamRoleArn': iamRoleArn, + 'ProtectedResourceType': protectedResourceType, + 'RestoreTestingSelectionName': restoreTestingSelectionName, + if (protectedResourceArns != null) + 'ProtectedResourceArns': protectedResourceArns, + if (protectedResourceConditions != null) + 'ProtectedResourceConditions': protectedResourceConditions, + if (restoreMetadataOverrides != null) + 'RestoreMetadataOverrides': restoreMetadataOverrides, + if (validationWindowHours != null) + 'ValidationWindowHours': validationWindowHours, + }; + } +} + +/// This contains metadata about a restore testing selection. +class RestoreTestingSelectionForGet { + /// The date and time that a restore testing selection was created, in Unix + /// format and Coordinated Universal Time (UTC). The value of + /// CreationTime is accurate to milliseconds. For example, the + /// value 1516925490.087 represents Friday, January 26, 201812:11:30.087 AM. + final DateTime creationTime; + + /// The Amazon Resource Name (ARN) of the IAM role that Backup uses to create + /// the target resource; for + /// example:arn:aws:iam::123456789012:role/S3Access. + final String iamRoleArn; + + /// The type of Amazon Web Services resource included in a resource testing + /// selection; for example, an Amazon EBS volume or an Amazon RDS database. + final String protectedResourceType; + + /// The RestoreTestingPlanName is a unique string that is the name of the + /// restore testing plan. + final String restoreTestingPlanName; + + /// This is the unique name of the restore testing selection that belongs to the + /// related restore testing plan. + final String restoreTestingSelectionName; + + /// This identifies the request and allows failed requests to be retried without + /// the risk of running the operation twice. If the request includes a + /// CreatorRequestId that matches an existing backup plan, that + /// plan is returned. This parameter is optional. + /// + /// If used, this parameter must contain 1 to 50 alphanumeric or '-_.' + /// characters. + final String? creatorRequestId; + + /// You can include specific ARNs, such as ProtectedResourceArns: + /// ["arn:aws:...", "arn:aws:..."] or you can include a wildcard: + /// ProtectedResourceArns: ["*"], but not both. + final List? protectedResourceArns; + + /// In a resource testing selection, this parameter filters by specific + /// conditions such as StringEquals or + /// StringNotEquals. + final ProtectedResourceConditions? protectedResourceConditions; + + /// You can override certain restore metadata keys by including the parameter + /// RestoreMetadataOverrides in the body of + /// RestoreTestingSelection. Key values are not case sensitive. + /// + /// See the complete list of restore + /// testing inferred metadata. + final Map? restoreMetadataOverrides; + + /// This is amount of hours (1 to 168) available to run a validation script on + /// the data. The data will be deleted upon the completion of the validation + /// script or the end of the specified retention period, whichever comes first. + final int? validationWindowHours; + + RestoreTestingSelectionForGet({ + required this.creationTime, + required this.iamRoleArn, + required this.protectedResourceType, + required this.restoreTestingPlanName, + required this.restoreTestingSelectionName, + this.creatorRequestId, + this.protectedResourceArns, + this.protectedResourceConditions, + this.restoreMetadataOverrides, + this.validationWindowHours, + }); + + factory RestoreTestingSelectionForGet.fromJson(Map json) { + return RestoreTestingSelectionForGet( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + iamRoleArn: json['IamRoleArn'] as String, + protectedResourceType: json['ProtectedResourceType'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + restoreTestingSelectionName: + json['RestoreTestingSelectionName'] as String, + creatorRequestId: json['CreatorRequestId'] as String?, + protectedResourceArns: (json['ProtectedResourceArns'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + protectedResourceConditions: json['ProtectedResourceConditions'] != null + ? ProtectedResourceConditions.fromJson( + json['ProtectedResourceConditions'] as Map) + : null, + restoreMetadataOverrides: + (json['RestoreMetadataOverrides'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + validationWindowHours: json['ValidationWindowHours'] as int?, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final iamRoleArn = this.iamRoleArn; + final protectedResourceType = this.protectedResourceType; + final restoreTestingPlanName = this.restoreTestingPlanName; + final restoreTestingSelectionName = this.restoreTestingSelectionName; + final creatorRequestId = this.creatorRequestId; + final protectedResourceArns = this.protectedResourceArns; + final protectedResourceConditions = this.protectedResourceConditions; + final restoreMetadataOverrides = this.restoreMetadataOverrides; + final validationWindowHours = this.validationWindowHours; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'IamRoleArn': iamRoleArn, + 'ProtectedResourceType': protectedResourceType, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'RestoreTestingSelectionName': restoreTestingSelectionName, + if (creatorRequestId != null) 'CreatorRequestId': creatorRequestId, + if (protectedResourceArns != null) + 'ProtectedResourceArns': protectedResourceArns, + if (protectedResourceConditions != null) + 'ProtectedResourceConditions': protectedResourceConditions, + if (restoreMetadataOverrides != null) + 'RestoreMetadataOverrides': restoreMetadataOverrides, + if (validationWindowHours != null) + 'ValidationWindowHours': validationWindowHours, + }; + } +} + +/// This contains metadata about a restore testing selection. +class RestoreTestingSelectionForList { + /// This is the date and time that a restore testing selection was created, in + /// Unix format and Coordinated Universal Time (UTC). The value of + /// CreationTime is accurate to milliseconds. For example, the + /// value 1516925490.087 represents Friday, January 26,2018 12:11:30.087 AM. + final DateTime creationTime; -extension RestoreJobStatusValueExtension on RestoreJobStatus { - String toValue() { - switch (this) { - case RestoreJobStatus.pending: - return 'PENDING'; - case RestoreJobStatus.running: - return 'RUNNING'; - case RestoreJobStatus.completed: - return 'COMPLETED'; - case RestoreJobStatus.aborted: - return 'ABORTED'; - case RestoreJobStatus.failed: - return 'FAILED'; - } - } -} + /// The Amazon Resource Name (ARN) of the IAM role that Backup uses to create + /// the target resource; for example: + /// arn:aws:iam::123456789012:role/S3Access. + final String iamRoleArn; -extension RestoreJobStatusFromString on String { - RestoreJobStatus toRestoreJobStatus() { - switch (this) { - case 'PENDING': - return RestoreJobStatus.pending; - case 'RUNNING': - return RestoreJobStatus.running; - case 'COMPLETED': - return RestoreJobStatus.completed; - case 'ABORTED': - return RestoreJobStatus.aborted; - case 'FAILED': - return RestoreJobStatus.failed; - } - throw Exception('$this is not known in enum RestoreJobStatus'); - } -} + /// The type of Amazon Web Services resource included in a restore testing + /// selection; for example, an Amazon EBS volume or an Amazon RDS database. + final String protectedResourceType; -/// Contains metadata about a restore job. -class RestoreJobsListMember { - /// The account ID that owns the restore job. - final String? accountId; + /// Unique string that is the name of the restore testing plan. + /// + /// The name cannot be changed after creation. The name must consist of only + /// alphanumeric characters and underscores. Maximum length is 50. + final String restoreTestingPlanName; - /// The size, in bytes, of the restored resource. - final int? backupSizeInBytes; + /// Unique name of a restore testing selection. + final String restoreTestingSelectionName; - /// The date and time a job to restore a recovery point is completed, in Unix - /// format and Coordinated Universal Time (UTC). The value of - /// CompletionDate is accurate to milliseconds. For example, the - /// value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM. - final DateTime? completionDate; + /// This value represents the time, in hours, data is retained after a restore + /// test so that optional validation can be completed. + /// + /// Accepted value is an integer between 0 and 168 (the hourly equivalent of + /// seven days). + final int? validationWindowHours; - /// An Amazon Resource Name (ARN) that uniquely identifies a resource. The - /// format of the ARN depends on the resource type. - final String? createdResourceArn; + RestoreTestingSelectionForList({ + required this.creationTime, + required this.iamRoleArn, + required this.protectedResourceType, + required this.restoreTestingPlanName, + required this.restoreTestingSelectionName, + this.validationWindowHours, + }); - /// The date and time a restore job is created, in Unix format and Coordinated - /// Universal Time (UTC). The value of CreationDate is accurate to - /// milliseconds. For example, the value 1516925490.087 represents Friday, - /// January 26, 2018 12:11:30.087 AM. - final DateTime? creationDate; + factory RestoreTestingSelectionForList.fromJson(Map json) { + return RestoreTestingSelectionForList( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + iamRoleArn: json['IamRoleArn'] as String, + protectedResourceType: json['ProtectedResourceType'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + restoreTestingSelectionName: + json['RestoreTestingSelectionName'] as String, + validationWindowHours: json['ValidationWindowHours'] as int?, + ); + } - /// The amount of time in minutes that a job restoring a recovery point is - /// expected to take. - final int? expectedCompletionTimeMinutes; + Map toJson() { + final creationTime = this.creationTime; + final iamRoleArn = this.iamRoleArn; + final protectedResourceType = this.protectedResourceType; + final restoreTestingPlanName = this.restoreTestingPlanName; + final restoreTestingSelectionName = this.restoreTestingSelectionName; + final validationWindowHours = this.validationWindowHours; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'IamRoleArn': iamRoleArn, + 'ProtectedResourceType': protectedResourceType, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'RestoreTestingSelectionName': restoreTestingSelectionName, + if (validationWindowHours != null) + 'ValidationWindowHours': validationWindowHours, + }; + } +} - /// Specifies the IAM role ARN used to create the target recovery point; for - /// example, arn:aws:iam::123456789012:role/S3Access. +/// This contains metadata about a restore testing selection. +class RestoreTestingSelectionForUpdate { + /// The Amazon Resource Name (ARN) of the IAM role that Backup uses to create + /// the target resource; for example: + /// arn:aws:iam::123456789012:role/S3Access. final String? iamRoleArn; - /// Contains an estimated percentage complete of a job at the time the job - /// status was queried. - final String? percentDone; - - /// An ARN that uniquely identifies a recovery point; for example, - /// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. - final String? recoveryPointArn; - - /// The resource type of the listed restore jobs; for example, an Amazon Elastic - /// Block Store (Amazon EBS) volume or an Amazon Relational Database Service - /// (Amazon RDS) database. For Windows Volume Shadow Copy Service (VSS) backups, - /// the only supported resource type is Amazon EC2. - final String? resourceType; + /// You can include a list of specific ARNs, such as + /// ProtectedResourceArns: ["arn:aws:...", "arn:aws:..."] or you + /// can include a wildcard: ProtectedResourceArns: ["*"], but not + /// both. + final List? protectedResourceArns; - /// Uniquely identifies the job that restores a recovery point. - final String? restoreJobId; + /// A list of conditions that you define for resources in your restore testing + /// plan using tags. + /// + /// For example, "StringEquals": { "Key": "aws:ResourceTag/CreatedByCryo", + /// "Value": "true" },. Condition operators are case sensitive. + final ProtectedResourceConditions? protectedResourceConditions; - /// A status code specifying the state of the job initiated by Backup to restore - /// a recovery point. - final RestoreJobStatus? status; + /// You can override certain restore metadata keys by including the parameter + /// RestoreMetadataOverrides in the body of + /// RestoreTestingSelection. Key values are not case sensitive. + /// + /// See the complete list of restore + /// testing inferred metadata. + final Map? restoreMetadataOverrides; - /// A detailed message explaining the status of the job to restore a recovery - /// point. - final String? statusMessage; + /// This value represents the time, in hours, data is retained after a restore + /// test so that optional validation can be completed. + /// + /// Accepted value is an integer between 0 and 168 (the hourly equivalent of + /// seven days). + final int? validationWindowHours; - RestoreJobsListMember({ - this.accountId, - this.backupSizeInBytes, - this.completionDate, - this.createdResourceArn, - this.creationDate, - this.expectedCompletionTimeMinutes, + RestoreTestingSelectionForUpdate({ this.iamRoleArn, - this.percentDone, - this.recoveryPointArn, - this.resourceType, - this.restoreJobId, - this.status, - this.statusMessage, + this.protectedResourceArns, + this.protectedResourceConditions, + this.restoreMetadataOverrides, + this.validationWindowHours, }); - factory RestoreJobsListMember.fromJson(Map json) { - return RestoreJobsListMember( - accountId: json['AccountId'] as String?, - backupSizeInBytes: json['BackupSizeInBytes'] as int?, - completionDate: timeStampFromJson(json['CompletionDate']), - createdResourceArn: json['CreatedResourceArn'] as String?, - creationDate: timeStampFromJson(json['CreationDate']), - expectedCompletionTimeMinutes: - json['ExpectedCompletionTimeMinutes'] as int?, - iamRoleArn: json['IamRoleArn'] as String?, - percentDone: json['PercentDone'] as String?, - recoveryPointArn: json['RecoveryPointArn'] as String?, - resourceType: json['ResourceType'] as String?, - restoreJobId: json['RestoreJobId'] as String?, - status: (json['Status'] as String?)?.toRestoreJobStatus(), - statusMessage: json['StatusMessage'] as String?, - ); - } - Map toJson() { - final accountId = this.accountId; - final backupSizeInBytes = this.backupSizeInBytes; - final completionDate = this.completionDate; - final createdResourceArn = this.createdResourceArn; - final creationDate = this.creationDate; - final expectedCompletionTimeMinutes = this.expectedCompletionTimeMinutes; final iamRoleArn = this.iamRoleArn; - final percentDone = this.percentDone; - final recoveryPointArn = this.recoveryPointArn; - final resourceType = this.resourceType; - final restoreJobId = this.restoreJobId; - final status = this.status; - final statusMessage = this.statusMessage; + final protectedResourceArns = this.protectedResourceArns; + final protectedResourceConditions = this.protectedResourceConditions; + final restoreMetadataOverrides = this.restoreMetadataOverrides; + final validationWindowHours = this.validationWindowHours; return { - if (accountId != null) 'AccountId': accountId, - if (backupSizeInBytes != null) 'BackupSizeInBytes': backupSizeInBytes, - if (completionDate != null) - 'CompletionDate': unixTimestampToJson(completionDate), - if (createdResourceArn != null) 'CreatedResourceArn': createdResourceArn, - if (creationDate != null) - 'CreationDate': unixTimestampToJson(creationDate), - if (expectedCompletionTimeMinutes != null) - 'ExpectedCompletionTimeMinutes': expectedCompletionTimeMinutes, if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, - if (percentDone != null) 'PercentDone': percentDone, - if (recoveryPointArn != null) 'RecoveryPointArn': recoveryPointArn, - if (resourceType != null) 'ResourceType': resourceType, - if (restoreJobId != null) 'RestoreJobId': restoreJobId, - if (status != null) 'Status': status.toValue(), - if (statusMessage != null) 'StatusMessage': statusMessage, + if (protectedResourceArns != null) + 'ProtectedResourceArns': protectedResourceArns, + if (protectedResourceConditions != null) + 'ProtectedResourceConditions': protectedResourceConditions, + if (restoreMetadataOverrides != null) + 'RestoreMetadataOverrides': restoreMetadataOverrides, + if (validationWindowHours != null) + 'ValidationWindowHours': validationWindowHours, }; } } +enum RestoreValidationStatus { + failed, + successful, + timedOut, + validating, +} + +extension RestoreValidationStatusValueExtension on RestoreValidationStatus { + String toValue() { + switch (this) { + case RestoreValidationStatus.failed: + return 'FAILED'; + case RestoreValidationStatus.successful: + return 'SUCCESSFUL'; + case RestoreValidationStatus.timedOut: + return 'TIMED_OUT'; + case RestoreValidationStatus.validating: + return 'VALIDATING'; + } + } +} + +extension RestoreValidationStatusFromString on String { + RestoreValidationStatus toRestoreValidationStatus() { + switch (this) { + case 'FAILED': + return RestoreValidationStatus.failed; + case 'SUCCESSFUL': + return RestoreValidationStatus.successful; + case 'TIMED_OUT': + return RestoreValidationStatus.timedOut; + case 'VALIDATING': + return RestoreValidationStatus.validating; + } + throw Exception('$this is not known in enum RestoreValidationStatus'); + } +} + class StartBackupJobOutput { /// Uniquely identifies a request to Backup to back up a resource. final String? backupJobId; @@ -9446,6 +13190,166 @@ class UpdateReportPlanOutput { } } +class UpdateRestoreTestingPlanOutput { + /// This is the time the resource testing plan was created. + final DateTime creationTime; + + /// Unique ARN (Amazon Resource Name) of the restore testing plan. + final String restoreTestingPlanArn; + + /// The name cannot be changed after creation. The name consists of only + /// alphanumeric characters and underscores. Maximum length is 50. + final String restoreTestingPlanName; + + /// This is the time the update completed for the restore testing plan. + final DateTime updateTime; + + UpdateRestoreTestingPlanOutput({ + required this.creationTime, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + required this.updateTime, + }); + + factory UpdateRestoreTestingPlanOutput.fromJson(Map json) { + return UpdateRestoreTestingPlanOutput( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + updateTime: nonNullableTimeStampFromJson(json['UpdateTime'] as Object), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + final updateTime = this.updateTime; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'UpdateTime': unixTimestampToJson(updateTime), + }; + } +} + +class UpdateRestoreTestingSelectionOutput { + /// This is the time the resource testing selection was updated successfully. + final DateTime creationTime; + + /// Unique string that is the name of the restore testing plan. + final String restoreTestingPlanArn; + + /// This is the restore testing plan with which the updated restore testing + /// selection is associated. + final String restoreTestingPlanName; + + /// This is the returned restore testing selection name. + final String restoreTestingSelectionName; + + /// This is the time the update completed for the restore testing selection. + final DateTime updateTime; + + UpdateRestoreTestingSelectionOutput({ + required this.creationTime, + required this.restoreTestingPlanArn, + required this.restoreTestingPlanName, + required this.restoreTestingSelectionName, + required this.updateTime, + }); + + factory UpdateRestoreTestingSelectionOutput.fromJson( + Map json) { + return UpdateRestoreTestingSelectionOutput( + creationTime: + nonNullableTimeStampFromJson(json['CreationTime'] as Object), + restoreTestingPlanArn: json['RestoreTestingPlanArn'] as String, + restoreTestingPlanName: json['RestoreTestingPlanName'] as String, + restoreTestingSelectionName: + json['RestoreTestingSelectionName'] as String, + updateTime: nonNullableTimeStampFromJson(json['UpdateTime'] as Object), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final restoreTestingPlanArn = this.restoreTestingPlanArn; + final restoreTestingPlanName = this.restoreTestingPlanName; + final restoreTestingSelectionName = this.restoreTestingSelectionName; + final updateTime = this.updateTime; + return { + 'CreationTime': unixTimestampToJson(creationTime), + 'RestoreTestingPlanArn': restoreTestingPlanArn, + 'RestoreTestingPlanName': restoreTestingPlanName, + 'RestoreTestingSelectionName': restoreTestingSelectionName, + 'UpdateTime': unixTimestampToJson(updateTime), + }; + } +} + +enum VaultState { + creating, + available, + failed, +} + +extension VaultStateValueExtension on VaultState { + String toValue() { + switch (this) { + case VaultState.creating: + return 'CREATING'; + case VaultState.available: + return 'AVAILABLE'; + case VaultState.failed: + return 'FAILED'; + } + } +} + +extension VaultStateFromString on String { + VaultState toVaultState() { + switch (this) { + case 'CREATING': + return VaultState.creating; + case 'AVAILABLE': + return VaultState.available; + case 'FAILED': + return VaultState.failed; + } + throw Exception('$this is not known in enum VaultState'); + } +} + +enum VaultType { + backupVault, + logicallyAirGappedBackupVault, +} + +extension VaultTypeValueExtension on VaultType { + String toValue() { + switch (this) { + case VaultType.backupVault: + return 'BACKUP_VAULT'; + case VaultType.logicallyAirGappedBackupVault: + return 'LOGICALLY_AIR_GAPPED_BACKUP_VAULT'; + } + } +} + +extension VaultTypeFromString on String { + VaultType toVaultType() { + switch (this) { + case 'BACKUP_VAULT': + return VaultType.backupVault; + case 'LOGICALLY_AIR_GAPPED_BACKUP_VAULT': + return VaultType.logicallyAirGappedBackupVault; + } + throw Exception('$this is not known in enum VaultType'); + } +} + class AlreadyExistsException extends _s.GenericAwsException { AlreadyExistsException({String? type, String? message}) : super(type: type, code: 'AlreadyExistsException', message: message); diff --git a/aws_client/lib/src/generated/batch/v2016_08_10.dart b/aws_client/lib/src/generated/batch/v2016_08_10.dart index ef23bef77..6cc7e7ba1 100644 --- a/aws_client/lib/src/generated/batch/v2016_08_10.dart +++ b/aws_client/lib/src/generated/batch/v2016_08_10.dart @@ -25,9 +25,9 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// Batch uses the advantages of the batch computing to remove the /// undifferentiated heavy lifting of configuring and managing required /// infrastructure. At the same time, it also adopts a familiar batch computing -/// software approach. You can use Batch to efficiently provision resources d, -/// and work toward eliminating capacity constraints, reducing your overall -/// compute costs, and delivering results more quickly. +/// software approach. You can use Batch to efficiently provision resources, and +/// work toward eliminating capacity constraints, reducing your overall compute +/// costs, and delivering results more quickly. class Batch { final _s.RestJsonProtocol _protocol; Batch({ @@ -61,7 +61,15 @@ class Batch { /// inRUNNABLE remains in RUNNABLE until it reaches /// the head of the job queue. Then the job status is updated to /// FAILED. + /// + /// A PENDING job is canceled after all dependency jobs are + /// completed. Therefore, it may take longer than expected to cancel a job in + /// PENDING status. /// + /// When you try to cancel an array parent job in PENDING, Batch + /// attempts to cancel all child jobs. The array parent job is canceled when + /// all child jobs are completed. + /// /// Jobs that progressed to the STARTING or RUNNING /// state aren't canceled. However, the API operation still succeeds, even if /// no job is canceled. These jobs must be terminated with the @@ -163,11 +171,15 @@ class Batch { /// ///
  • /// Set the allocation strategy (allocationStrategy) parameter to - /// BEST_FIT_PROGRESSIVE or SPOT_CAPACITY_OPTIMIZED. + /// BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED, + /// or SPOT_PRICE_CAPACITY_OPTIMIZED. ///
  • ///
  • /// Set the update to latest image version /// (updateToLatestImageVersion) parameter to true. + /// The updateToLatestImageVersion parameter is used when you + /// update a compute environment. This parameter is ignored when you create a + /// compute environment. ///
  • ///
  • /// Don't specify an AMI ID in imageId, @@ -380,6 +392,11 @@ class Batch { /// Fargate (FARGATE or FARGATE_SPOT); EC2 and /// Fargate compute environments can't be mixed. /// + /// Parameter [jobStateTimeLimitActions] : + /// The set of actions that Batch performs on jobs that remain at the head of + /// the job queue in the specified state longer than specified times. Batch + /// will perform each action after maxTimeSeconds has passed. + /// /// Parameter [schedulingPolicyArn] : /// The Amazon Resource Name (ARN) of the fair share scheduling policy. If /// this parameter is specified, the job queue uses a fair share scheduling @@ -406,6 +423,7 @@ class Batch { required List computeEnvironmentOrder, required String jobQueueName, required int priority, + List? jobStateTimeLimitActions, String? schedulingPolicyArn, JQState? state, Map? tags, @@ -414,6 +432,8 @@ class Batch { 'computeEnvironmentOrder': computeEnvironmentOrder, 'jobQueueName': jobQueueName, 'priority': priority, + if (jobStateTimeLimitActions != null) + 'jobStateTimeLimitActions': jobStateTimeLimitActions, if (schedulingPolicyArn != null) 'schedulingPolicyArn': schedulingPolicyArn, if (state != null) 'state': state.toValue(), @@ -649,7 +669,8 @@ class Batch { /// an ARN in the format /// arn:aws:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision} /// or a short version using the form - /// ${JobDefinitionName}:${Revision}. + /// ${JobDefinitionName}:${Revision}. This parameter can't be + /// used with other parameters. /// /// Parameter [maxResults] : /// The maximum number of results returned by @@ -794,6 +815,29 @@ class Batch { return DescribeSchedulingPoliciesResponse.fromJson(response); } + /// Provides a list of the first 100 RUNNABLE jobs associated to + /// a single job queue. + /// + /// May throw [ClientException]. + /// May throw [ServerException]. + /// + /// Parameter [jobQueue] : + /// The job queue’s name or full queue Amazon Resource Name (ARN). + Future getJobQueueSnapshot({ + required String jobQueue, + }) async { + final $payload = { + 'jobQueue': jobQueue, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v1/getjobqueuesnapshot', + exceptionFnMap: _exceptionFns, + ); + return GetJobQueueSnapshotResponse.fromJson(response); + } + /// Returns a list of Batch jobs. /// /// You must specify only one of the following items: @@ -873,15 +917,32 @@ class Batch { /// specify a status, only RUNNING jobs are returned. /// /// Parameter [maxResults] : - /// The maximum number of results returned by ListJobs in - /// paginated output. When this parameter is used, ListJobs only - /// returns maxResults results in a single page and a - /// nextToken response element. The remaining results of the - /// initial request can be seen by sending another ListJobs - /// request with the returned nextToken value. This value can be - /// between 1 and 100. If this parameter isn't used, then - /// ListJobs returns up to 100 results and a - /// nextToken value if applicable. + /// The maximum number of results returned by ListJobs in a + /// paginated output. When this parameter is used, ListJobs + /// returns up to maxResults results in a single page and a + /// nextToken response element, if applicable. The remaining + /// results of the initial request can be seen by sending another + /// ListJobs request with the returned nextToken + /// value. + /// + /// The following outlines key parameters and limitations: + /// + ///
      + ///
    • + /// The minimum value is 1. + ///
    • + ///
    • + /// When --job-status is used, Batch returns up to 1000 values. + ///
    • + ///
    • + /// When --filters is used, Batch returns up to 100 values. + ///
    • + ///
    • + /// If neither parameter is used, then ListJobs returns up to + /// 1000 results (jobs that are in the RUNNING status) and a + /// nextToken value, if applicable. + ///
    • + ///
    /// /// Parameter [multiNodeJobId] : /// The job ID for a multi-node parallel job. Specifying a multi-node parallel @@ -1011,35 +1072,47 @@ class Batch { /// jobs, see Creating /// a multi-node parallel job definition in the Batch User Guide. - /// + /// + ///
      + ///
    • + /// If the value is container, then one of the following is + /// required: containerProperties, ecsProperties, or + /// eksProperties. + ///
    • + ///
    • + /// If the value is multinode, then nodeProperties + /// is required. + ///
    • + ///
    /// If the job is run on Fargate resources, then multinode isn't /// supported. /// /// /// Parameter [containerProperties] : - /// An object with various properties specific to Amazon ECS based single-node + /// An object with properties specific to Amazon ECS-based single-node /// container-based jobs. If the job definition's type parameter /// is container, then you must specify either /// containerProperties or nodeProperties. This must - /// not be specified for Amazon EKS based job definitions. + /// not be specified for Amazon EKS-based job definitions. /// /// If the job runs on Fargate resources, then you must not specify /// nodeProperties; use only containerProperties. /// /// + /// Parameter [ecsProperties] : + /// An object with properties that are specific to Amazon ECS-based jobs. This + /// must not be specified for Amazon EKS-based job definitions. + /// /// Parameter [eksProperties] : - /// An object with various properties that are specific to Amazon EKS based - /// jobs. This must not be specified for Amazon ECS based job definitions. + /// An object with properties that are specific to Amazon EKS-based jobs. This + /// must not be specified for Amazon ECS based job definitions. /// /// Parameter [nodeProperties] : - /// An object with various properties specific to multi-node parallel jobs. If - /// you specify node properties for a job, it becomes a multi-node parallel - /// job. For more information, see Multi-node - /// Parallel Jobs in the Batch User Guide. If the job definition's - /// type parameter is container, then you must - /// specify either containerProperties or - /// nodeProperties. + /// Parallel Jobs in the Batch User Guide. /// /// If the job runs on Fargate resources, then you must not specify /// nodeProperties; use containerProperties instead. @@ -1110,6 +1183,7 @@ class Batch { required String jobDefinitionName, required JobDefinitionType type, ContainerProperties? containerProperties, + EcsProperties? ecsProperties, EksProperties? eksProperties, NodeProperties? nodeProperties, Map? parameters, @@ -1125,6 +1199,7 @@ class Batch { 'type': type.toValue(), if (containerProperties != null) 'containerProperties': containerProperties, + if (ecsProperties != null) 'ecsProperties': ecsProperties, if (eksProperties != null) 'eksProperties': eksProperties, if (nodeProperties != null) 'nodeProperties': nodeProperties, if (parameters != null) 'parameters': parameters, @@ -1196,7 +1271,7 @@ class Batch { /// Jobs in the Batch User Guide. /// /// Parameter [containerOverrides] : - /// An object with various properties that override the defaults for the job + /// An object with properties that override the defaults for the job /// definition that specify the name of a container in the specified job /// definition and the overrides it should receive. You can override the /// default command for a container, which is specified in the job definition @@ -1213,10 +1288,13 @@ class Batch { /// case, each index child of this job must wait for the corresponding index /// child of each dependency to complete before it can begin. /// + /// Parameter [ecsPropertiesOverride] : + /// An object, with properties that override defaults for the job definition, + /// can only be specified for jobs that are run on Amazon ECS resources. + /// /// Parameter [eksPropertiesOverride] : - /// An object that can only be specified for jobs that are run on Amazon EKS - /// resources with various properties that override defaults for the job - /// definition. + /// An object, with properties that override defaults for the job definition, + /// can only be specified for jobs that are run on Amazon EKS resources. /// /// Parameter [nodeOverrides] : /// A list of node overrides in JSON format that specify the node range to @@ -1252,14 +1330,18 @@ class Batch { /// The scheduling priority for the job. This only affects jobs in job queues /// with a fair share policy. Jobs with a higher scheduling priority are /// scheduled before jobs with a lower scheduling priority. This overrides any - /// scheduling priority in the job definition. + /// scheduling priority in the job definition and works only within a single + /// share identifier. /// /// The minimum supported value is 0 and the maximum supported value is 9999. /// /// Parameter [shareIdentifier] : - /// The share identifier for the job. If the job queue doesn't have a - /// scheduling policy, then this parameter must not be specified. If the job - /// queue has a scheduling policy, then this parameter must be specified. + /// The share identifier for the job. Don't specify this parameter if the job + /// queue doesn't have a scheduling policy. If the job queue has a scheduling + /// policy, then this parameter must be specified. + /// + /// This string is limited to 255 alphanumeric characters, and can be followed + /// by an asterisk (*). /// /// Parameter [tags] : /// The tags that you apply to the job request to help you categorize and @@ -1287,6 +1369,7 @@ class Batch { ArrayProperties? arrayProperties, ContainerOverrides? containerOverrides, List? dependsOn, + EcsPropertiesOverride? ecsPropertiesOverride, EksPropertiesOverride? eksPropertiesOverride, NodeOverrides? nodeOverrides, Map? parameters, @@ -1304,6 +1387,8 @@ class Batch { if (arrayProperties != null) 'arrayProperties': arrayProperties, if (containerOverrides != null) 'containerOverrides': containerOverrides, if (dependsOn != null) 'dependsOn': dependsOn, + if (ecsPropertiesOverride != null) + 'ecsPropertiesOverride': ecsPropertiesOverride, if (eksPropertiesOverride != null) 'eksPropertiesOverride': eksPropertiesOverride, if (nodeOverrides != null) 'nodeOverrides': nodeOverrides, @@ -1556,6 +1641,11 @@ class Batch { /// architecture types in a single job queue. /// /// + /// Parameter [jobStateTimeLimitActions] : + /// The set of actions that Batch perform on jobs that remain at the head of + /// the job queue in the specified state longer than specified times. Batch + /// will perform each action after maxTimeSeconds has passed. + /// /// Parameter [priority] : /// The priority of the job queue. Job queues with a higher priority (or a /// higher integer value for the priority parameter) are @@ -1583,6 +1673,7 @@ class Batch { Future updateJobQueue({ required String jobQueue, List? computeEnvironmentOrder, + List? jobStateTimeLimitActions, int? priority, String? schedulingPolicyArn, JQState? state, @@ -1591,6 +1682,8 @@ class Batch { 'jobQueue': jobQueue, if (computeEnvironmentOrder != null) 'computeEnvironmentOrder': computeEnvironmentOrder, + if (jobStateTimeLimitActions != null) + 'jobStateTimeLimitActions': jobStateTimeLimitActions, if (priority != null) 'priority': priority, if (schedulingPolicyArn != null) 'schedulingPolicyArn': schedulingPolicyArn, @@ -1866,11 +1959,16 @@ class AttemptDetail { /// state, such as SUCCEEDED or FAILED). final int? stoppedAt; + /// The properties for a task definition that describes the container and volume + /// definitions of an Amazon ECS task. + final List? taskProperties; + AttemptDetail({ this.container, this.startedAt, this.statusReason, this.stoppedAt, + this.taskProperties, }); factory AttemptDetail.fromJson(Map json) { @@ -1882,6 +1980,10 @@ class AttemptDetail { startedAt: json['startedAt'] as int?, statusReason: json['statusReason'] as String?, stoppedAt: json['stoppedAt'] as int?, + taskProperties: (json['taskProperties'] as List?) + ?.whereNotNull() + .map((e) => AttemptEcsTaskDetails.fromJson(e as Map)) + .toList(), ); } @@ -1890,11 +1992,117 @@ class AttemptDetail { final startedAt = this.startedAt; final statusReason = this.statusReason; final stoppedAt = this.stoppedAt; + final taskProperties = this.taskProperties; return { if (container != null) 'container': container, if (startedAt != null) 'startedAt': startedAt, if (statusReason != null) 'statusReason': statusReason, if (stoppedAt != null) 'stoppedAt': stoppedAt, + if (taskProperties != null) 'taskProperties': taskProperties, + }; + } +} + +/// An object that represents the details of a task. +class AttemptEcsTaskDetails { + /// The Amazon Resource Name (ARN) of the container instance that hosts the + /// task. + final String? containerInstanceArn; + + /// A list of containers that are included in the taskProperties + /// list. + final List? containers; + + /// The ARN of the Amazon ECS task. + final String? taskArn; + + AttemptEcsTaskDetails({ + this.containerInstanceArn, + this.containers, + this.taskArn, + }); + + factory AttemptEcsTaskDetails.fromJson(Map json) { + return AttemptEcsTaskDetails( + containerInstanceArn: json['containerInstanceArn'] as String?, + containers: (json['containers'] as List?) + ?.whereNotNull() + .map((e) => + AttemptTaskContainerDetails.fromJson(e as Map)) + .toList(), + taskArn: json['taskArn'] as String?, + ); + } + + Map toJson() { + final containerInstanceArn = this.containerInstanceArn; + final containers = this.containers; + final taskArn = this.taskArn; + return { + if (containerInstanceArn != null) + 'containerInstanceArn': containerInstanceArn, + if (containers != null) 'containers': containers, + if (taskArn != null) 'taskArn': taskArn, + }; + } +} + +/// An object that represents the details of a container that's part of a job +/// attempt. +class AttemptTaskContainerDetails { + /// The exit code for the container’s attempt. A non-zero exit code is + /// considered failed. + final int? exitCode; + + /// The name of the Amazon CloudWatch Logs log stream that's associated with the + /// container. The log group for Batch jobs is /aws/batch/job. Each + /// container attempt receives a log stream name when they reach the + /// RUNNING status. + final String? logStreamName; + + /// The name of a container. + final String? name; + + /// The network interfaces that are associated with the job attempt. + final List? networkInterfaces; + + /// A short (255 max characters) string that's easy to understand and provides + /// additional details for a running or stopped container. + final String? reason; + + AttemptTaskContainerDetails({ + this.exitCode, + this.logStreamName, + this.name, + this.networkInterfaces, + this.reason, + }); + + factory AttemptTaskContainerDetails.fromJson(Map json) { + return AttemptTaskContainerDetails( + exitCode: json['exitCode'] as int?, + logStreamName: json['logStreamName'] as String?, + name: json['name'] as String?, + networkInterfaces: (json['networkInterfaces'] as List?) + ?.whereNotNull() + .map((e) => NetworkInterface.fromJson(e as Map)) + .toList(), + reason: json['reason'] as String?, + ); + } + + Map toJson() { + final exitCode = this.exitCode; + final logStreamName = this.logStreamName; + final name = this.name; + final networkInterfaces = this.networkInterfaces; + final reason = this.reason; + return { + if (exitCode != null) 'exitCode': exitCode, + if (logStreamName != null) 'logStreamName': logStreamName, + if (name != null) 'name': name, + if (networkInterfaces != null) 'networkInterfaces': networkInterfaces, + if (reason != null) 'reason': reason, }; } } @@ -2007,6 +2215,7 @@ enum CRAllocationStrategy { bestFit, bestFitProgressive, spotCapacityOptimized, + spotPriceCapacityOptimized, } extension CRAllocationStrategyValueExtension on CRAllocationStrategy { @@ -2018,6 +2227,8 @@ extension CRAllocationStrategyValueExtension on CRAllocationStrategy { return 'BEST_FIT_PROGRESSIVE'; case CRAllocationStrategy.spotCapacityOptimized: return 'SPOT_CAPACITY_OPTIMIZED'; + case CRAllocationStrategy.spotPriceCapacityOptimized: + return 'SPOT_PRICE_CAPACITY_OPTIMIZED'; } } } @@ -2031,6 +2242,8 @@ extension CRAllocationStrategyFromString on String { return CRAllocationStrategy.bestFitProgressive; case 'SPOT_CAPACITY_OPTIMIZED': return CRAllocationStrategy.spotCapacityOptimized; + case 'SPOT_PRICE_CAPACITY_OPTIMIZED': + return CRAllocationStrategy.spotPriceCapacityOptimized; } throw Exception('$this is not known in enum CRAllocationStrategy'); } @@ -2077,6 +2290,7 @@ extension CRTypeFromString on String { enum CRUpdateAllocationStrategy { bestFitProgressive, spotCapacityOptimized, + spotPriceCapacityOptimized, } extension CRUpdateAllocationStrategyValueExtension @@ -2087,6 +2301,8 @@ extension CRUpdateAllocationStrategyValueExtension return 'BEST_FIT_PROGRESSIVE'; case CRUpdateAllocationStrategy.spotCapacityOptimized: return 'SPOT_CAPACITY_OPTIMIZED'; + case CRUpdateAllocationStrategy.spotPriceCapacityOptimized: + return 'SPOT_PRICE_CAPACITY_OPTIMIZED'; } } } @@ -2098,6 +2314,8 @@ extension CRUpdateAllocationStrategyFromString on String { return CRUpdateAllocationStrategy.bestFitProgressive; case 'SPOT_CAPACITY_OPTIMIZED': return CRUpdateAllocationStrategy.spotCapacityOptimized; + case 'SPOT_PRICE_CAPACITY_OPTIMIZED': + return CRUpdateAllocationStrategy.spotPriceCapacityOptimized; } throw Exception('$this is not known in enum CRUpdateAllocationStrategy'); } @@ -2302,8 +2520,8 @@ class ComputeEnvironmentDetail { /// first. Compute environments must be in the VALID state before /// you can associate them with a job queue. All of the compute environments /// must be either EC2 (EC2 or SPOT) or Fargate -/// (FARGATE or FARGATE_SPOT); EC2 and Fargate compute -/// environments can't be mixed. +/// (FARGATE or FARGATE_SPOT); Amazon EC2 and Fargate +/// compute environments can't be mixed. /// /// All compute environments that are associated with a job queue must share the /// same architecture. Batch doesn't support mixing compute environment @@ -2346,16 +2564,14 @@ class ComputeEnvironmentOrder { /// href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute /// environments in the Batch User Guide. class ComputeResource { - /// The maximum number of Amazon EC2 vCPUs that a compute environment can reach. + /// The maximum number of vCPUs that a compute environment can support. /// - /// With both BEST_FIT_PROGRESSIVE and - /// SPOT_CAPACITY_OPTIMIZED allocation strategies using On-Demand - /// or Spot Instances, and the BEST_FIT strategy using Spot - /// Instances, Batch might need to exceed maxvCpus to meet your - /// capacity requirements. In this event, Batch never exceeds - /// maxvCpus by more than a single instance. For example, no more - /// than a single instance from among those specified in your compute - /// environment is allocated. + /// With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED + /// and SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies + /// using On-Demand or Spot Instances, and the BEST_FIT strategy + /// using Spot Instances, Batch might need to exceed maxvCpus to + /// meet your capacity requirements. In this event, Batch never exceeds + /// maxvCpus by more than a single instance. /// final int maxvCpus; @@ -2428,13 +2644,18 @@ class ComputeResource { /// requirements of the jobs in the queue. Its preference is for instance types /// that are less likely to be interrupted. This allocation strategy is only /// available for Spot Instance compute resources. + ///
  • SPOT_PRICE_CAPACITY_OPTIMIZED
    + /// The price and capacity optimized allocation strategy looks at both price and + /// capacity to select the Spot Instance pools that are the least likely to be + /// interrupted and have the lowest possible price. This allocation strategy is + /// only available for Spot Instance compute resources. ///
    - /// With both BEST_FIT_PROGRESSIVE and - /// SPOT_CAPACITY_OPTIMIZED strategies using On-Demand or Spot - /// Instances, and the BEST_FIT strategy using Spot Instances, - /// Batch might need to exceed maxvCpus to meet your capacity - /// requirements. In this event, Batch never exceeds maxvCpus by - /// more than a single instance. + /// With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED + /// and SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies + /// using On-Demand or Spot Instances, and the BEST_FIT strategy + /// using Spot Instances, Batch might need to exceed maxvCpus to + /// meet your capacity requirements. In this event, Batch never exceeds + /// maxvCpus by more than a single instance. final CRAllocationStrategy? allocationStrategy; /// The maximum percentage that a Spot Instance price can be when compared with @@ -2450,9 +2671,8 @@ class ComputeResource { /// final int? bidPercentage; - /// The desired number of Amazon EC2 vCPUS in the compute environment. Batch - /// modifies this value between the minimum and maximum values based on job - /// queue demand. + /// The desired number of vCPUS in the compute environment. Batch modifies this + /// value between the minimum and maximum values based on job queue demand. /// /// This parameter isn't applicable to jobs that are running on Fargate /// resources. Don't specify it. @@ -2460,8 +2680,9 @@ class ComputeResource { final int? desiredvCpus; /// Provides information that's used to select Amazon Machine Images (AMIs) for - /// EC2 instances in the compute environment. If Ec2Configuration - /// isn't specified, the default is ECS_AL2. + /// Amazon EC2 instances in the compute environment. If + /// Ec2Configuration isn't specified, the default is + /// ECS_AL2. /// /// One or two values can be provided. /// @@ -2499,9 +2720,9 @@ class ComputeResource { final String? imageId; /// The Amazon ECS instance profile applied to Amazon EC2 instances in a compute - /// environment. You can specify the short name or full Amazon Resource Name - /// (ARN) of an instance profile. For example, ecsInstanceRole - /// or + /// environment. This parameter is required for Amazon EC2 instances types. You + /// can specify the short name or full Amazon Resource Name (ARN) of an instance + /// profile. For example, ecsInstanceRole or /// arn:aws:iam::<aws_account_id>:instance-profile/ecsInstanceRole /// . For more information, see Amazon @@ -2534,7 +2755,8 @@ class ComputeResource { final List? instanceTypes; /// The launch template to use for your compute resources. Any other compute - /// resource parameters that you specify in a CreateComputeEnvironment + /// resource parameters that you specify in a CreateComputeEnvironment /// API operation override the same parameters in the launch template. You must /// specify either the launch template ID or launch template name in the /// request, but not both. For more information, see final LaunchTemplateSpecification? launchTemplate; - /// The minimum number of Amazon EC2 vCPUs that an environment should maintain - /// (even if the compute environment is DISABLED). + /// The minimum number of vCPUs that a compute environment should maintain (even + /// if the compute environment is DISABLED). /// /// This parameter isn't applicable to jobs that are running on Fargate /// resources. Don't specify it. @@ -2599,12 +2821,12 @@ class ComputeResource { /// final String? spotIamFleetRole; - /// Key-value pair tags to be applied to EC2 resources that are launched in the - /// compute environment. For Batch, these take the form of "String1": - /// "String2", where String1 is the tag key and - /// String2 is the tag value-for example, { "Name": "Batch - /// Instance - C4OnDemand" }. This is helpful for recognizing your Batch - /// instances in the Amazon EC2 console. Updating these tags requires an + /// Key-value pair tags to be applied to Amazon EC2 resources that are launched + /// in the compute environment. For Batch, these take the form of + /// "String1": "String2", where String1 is the tag key + /// and String2 is the tag value-for example, { "Name": + /// "Batch Instance - C4OnDemand" }. This is helpful for recognizing your + /// Batch instances in the Amazon EC2 console. Updating these tags requires an /// infrastructure update to the compute environment. For more information, see /// Updating @@ -2749,13 +2971,18 @@ class ComputeResourceUpdate { /// requirements of the jobs in the queue. Its preference is for instance types /// that are less likely to be interrupted. This allocation strategy is only /// available for Spot Instance compute resources. + ///
    SPOT_PRICE_CAPACITY_OPTIMIZED
    + /// The price and capacity optimized allocation strategy looks at both price and + /// capacity to select the Spot Instance pools that are the least likely to be + /// interrupted and have the lowest possible price. This allocation strategy is + /// only available for Spot Instance compute resources. ///
    - /// With both BEST_FIT_PROGRESSIVE and - /// SPOT_CAPACITY_OPTIMIZED strategies using On-Demand or Spot - /// Instances, and the BEST_FIT strategy using Spot Instances, - /// Batch might need to exceed maxvCpus to meet your capacity - /// requirements. In this event, Batch never exceeds maxvCpus by - /// more than a single instance. + /// With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED + /// and SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies + /// using On-Demand or Spot Instances, and the BEST_FIT strategy + /// using Spot Instances, Batch might need to exceed maxvCpus to + /// meet your capacity requirements. In this event, Batch never exceeds + /// maxvCpus by more than a single instance. final CRUpdateAllocationStrategy? allocationStrategy; /// The maximum percentage that a Spot Instance price can be when compared with @@ -2776,9 +3003,8 @@ class ComputeResourceUpdate { ///
    final int? bidPercentage; - /// The desired number of Amazon EC2 vCPUS in the compute environment. Batch - /// modifies this value between the minimum and maximum values based on job - /// queue demand. + /// The desired number of vCPUS in the compute environment. Batch modifies this + /// value between the minimum and maximum values based on job queue demand. /// /// This parameter isn't applicable to jobs that are running on Fargate /// resources. Don't specify it. @@ -2798,16 +3024,16 @@ class ComputeResourceUpdate { /// final int? desiredvCpus; - /// Provides information used to select Amazon Machine Images (AMIs) for EC2 - /// instances in the compute environment. If Ec2Configuration isn't - /// specified, the default is ECS_AL2. + /// Provides information used to select Amazon Machine Images (AMIs) for Amazon + /// EC2 instances in the compute environment. If Ec2Configuration + /// isn't specified, the default is ECS_AL2. /// /// When updating a compute environment, changing this setting requires an /// infrastructure update of the compute environment. For more information, see /// Updating - /// compute environments in the Batch User Guide. To remove the EC2 - /// configuration and any custom AMI ID specified in + /// compute environments in the Batch User Guide. To remove the + /// Amazon EC2 configuration and any custom AMI ID specified in /// imageIdOverride, set this value to an empty string. /// /// One or two values can be provided. @@ -2821,9 +3047,9 @@ class ComputeResourceUpdate { /// environment. You can use this key pair to log in to your instances with SSH. /// To remove the Amazon EC2 key pair, set this value to an empty string. /// - /// When updating a compute environment, changing the EC2 key pair requires an - /// infrastructure update of the compute environment. For more information, see - /// Updating /// compute environments in the Batch User Guide. /// @@ -2860,9 +3086,9 @@ class ComputeResourceUpdate { final String? imageId; /// The Amazon ECS instance profile applied to Amazon EC2 instances in a compute - /// environment. You can specify the short name or full Amazon Resource Name - /// (ARN) of an instance profile. For example, ecsInstanceRole - /// or + /// environment. Required for Amazon EC2 instances. You can specify the short + /// name or full Amazon Resource Name (ARN) of an instance profile. For example, + /// ecsInstanceRole or /// arn:aws:iam::<aws_account_id>:instance-profile/ecsInstanceRole /// . For more information, see Amazon @@ -2932,18 +3158,17 @@ class ComputeResourceUpdate { /// The maximum number of Amazon EC2 vCPUs that an environment can reach. /// - /// With both BEST_FIT_PROGRESSIVE and - /// SPOT_CAPACITY_OPTIMIZED allocation strategies using On-Demand - /// or Spot Instances, and the BEST_FIT strategy using Spot - /// Instances, Batch might need to exceed maxvCpus to meet your - /// capacity requirements. In this event, Batch never exceeds - /// maxvCpus by more than a single instance. That is, no more than - /// a single instance from among those specified in your compute environment. + /// With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED + /// and SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies + /// using On-Demand or Spot Instances, and the BEST_FIT strategy + /// using Spot Instances, Batch might need to exceed maxvCpus to + /// meet your capacity requirements. In this event, Batch never exceeds + /// maxvCpus by more than a single instance. /// final int? maxvCpus; - /// The minimum number of Amazon EC2 vCPUs that an environment should maintain - /// (even if the compute environment is DISABLED). + /// The minimum number of vCPUs that an environment should maintain (even if the + /// compute environment is DISABLED). /// /// This parameter isn't applicable to jobs that are running on Fargate /// resources. Don't specify it. @@ -2974,10 +3199,10 @@ class ComputeResourceUpdate { /// in the compute environment. This parameter is required for Fargate compute /// resources, where it can contain up to 5 security groups. For Fargate compute /// resources, providing an empty list is handled as if this parameter wasn't - /// specified and no change is made. For EC2 compute resources, providing an - /// empty list removes the security groups from the compute resource. + /// specified and no change is made. For Amazon EC2 compute resources, providing + /// an empty list removes the security groups from the compute resource. /// - /// When updating a compute environment, changing the EC2 security groups + /// When updating a compute environment, changing the Amazon EC2 security groups /// requires an infrastructure update of the compute environment. For more /// information, see Updating @@ -2987,8 +3212,8 @@ class ComputeResourceUpdate { /// The VPC subnets where the compute resources are launched. Fargate compute /// resources can contain up to 16 subnets. For Fargate compute resources, /// providing an empty list will be handled as if this parameter wasn't - /// specified and no change is made. For EC2 compute resources, providing an - /// empty list removes the VPC subnets from the compute resource. For more + /// specified and no change is made. For Amazon EC2 compute resources, providing + /// an empty list removes the VPC subnets from the compute resource. For more /// information, see VPCs /// and subnets in the Amazon VPC User Guide. @@ -3014,13 +3239,13 @@ class ComputeResourceUpdate { /// final List? subnets; - /// Key-value pair tags to be applied to EC2 resources that are launched in the - /// compute environment. For Batch, these take the form of "String1": - /// "String2", where String1 is the tag key and - /// String2 is the tag value-for example, { "Name": "Batch - /// Instance - C4OnDemand" }. This is helpful for recognizing your Batch - /// instances in the Amazon EC2 console. These tags aren't seen when using the - /// Batch ListTagsForResource API operation. + /// Key-value pair tags to be applied to Amazon EC2 resources that are launched + /// in the compute environment. For Batch, these take the form of + /// "String1": "String2", where String1 is the tag key + /// and String2 is the tag value-for example, { "Name": + /// "Batch Instance - C4OnDemand" }. This is helpful for recognizing your + /// Batch instances in the Amazon EC2 console. These tags aren't seen when using + /// the Batch ListTagsForResource API operation. /// /// When updating a compute environment, changing this setting requires an /// infrastructure update of the compute environment. For more information, see @@ -3161,11 +3386,12 @@ class ContainerDetail { /// execution IAM role in the Batch User Guide. final String? executionRoleArn; - /// The exit code to return upon completion. + /// The exit code returned upon completion. final int? exitCode; /// The platform configuration for jobs that are running on Fargate resources. - /// Jobs that are running on EC2 resources must not specify this parameter. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. final FargatePlatformConfiguration? fargatePlatformConfiguration; /// The image used to start the container. @@ -3206,9 +3432,10 @@ class ContainerDetail { /// logging drivers in the Docker documentation. /// /// Batch currently supports a subset of the logging drivers available to the - /// Docker daemon (shown in the LogConfiguration data type). Additional - /// log drivers might be available in future releases of the Amazon ECS - /// container agent. + /// Docker daemon (shown in the LogConfiguration + /// data type). Additional log drivers might be available in future releases of + /// the Amazon ECS container agent. /// /// This parameter requires version 1.18 of the Docker Remote API or greater on /// your container instance. To check the Docker Remote API version on your @@ -3232,9 +3459,9 @@ class ContainerDetail { /// RUNNING status. final String? logStreamName; - /// For jobs running on EC2 resources that didn't specify memory requirements - /// using resourceRequirements, the number of MiB of memory - /// reserved for the job. For other jobs, including all run on Fargate + /// For jobs running on Amazon EC2 resources that didn't specify memory + /// requirements using resourceRequirements, the number of MiB of + /// memory reserved for the job. For other jobs, including all run on Fargate /// resources, see resourceRequirements. final int? memory; @@ -3242,7 +3469,8 @@ class ContainerDetail { final List? mountPoints; /// The network configuration for jobs that are running on Fargate resources. - /// Jobs that are running on EC2 resources must not specify this parameter. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. final NetworkConfiguration? networkConfiguration; /// The network interfaces that are associated with the job. @@ -3272,11 +3500,18 @@ class ContainerDetail { /// details for a running or stopped container. final String? reason; + /// The private repository authentication credentials to use. + final RepositoryCredentials? repositoryCredentials; + /// The type and amount of resources to assign to a container. The supported /// resources include GPU, MEMORY, and /// VCPU. final List? resourceRequirements; + /// An object that represents the compute environment architecture for Batch + /// jobs on Fargate. + final RuntimePlatform? runtimePlatform; + /// The secrets to pass to the container. For more information, see Specifying /// sensitive data in the Batch User Guide. @@ -3309,8 +3544,8 @@ class ContainerDetail { /// href="https://docs.docker.com/engine/reference/run/">docker run. final String? user; - /// The number of vCPUs reserved for the container. For jobs that run on EC2 - /// resources, you can specify the vCPU requirement for the job using + /// The number of vCPUs reserved for the container. For jobs that run on Amazon + /// EC2 resources, you can specify the vCPU requirement for the job using /// resourceRequirements, but you can't specify the vCPU /// requirements in both the vcpus and /// resourceRequirements object. This parameter maps to @@ -3354,7 +3589,9 @@ class ContainerDetail { this.privileged, this.readonlyRootFilesystem, this.reason, + this.repositoryCredentials, this.resourceRequirements, + this.runtimePlatform, this.secrets, this.taskArn, this.ulimits, @@ -3412,10 +3649,18 @@ class ContainerDetail { privileged: json['privileged'] as bool?, readonlyRootFilesystem: json['readonlyRootFilesystem'] as bool?, reason: json['reason'] as String?, + repositoryCredentials: json['repositoryCredentials'] != null + ? RepositoryCredentials.fromJson( + json['repositoryCredentials'] as Map) + : null, resourceRequirements: (json['resourceRequirements'] as List?) ?.whereNotNull() .map((e) => ResourceRequirement.fromJson(e as Map)) .toList(), + runtimePlatform: json['runtimePlatform'] != null + ? RuntimePlatform.fromJson( + json['runtimePlatform'] as Map) + : null, secrets: (json['secrets'] as List?) ?.whereNotNull() .map((e) => Secret.fromJson(e as Map)) @@ -3455,7 +3700,9 @@ class ContainerDetail { final privileged = this.privileged; final readonlyRootFilesystem = this.readonlyRootFilesystem; final reason = this.reason; + final repositoryCredentials = this.repositoryCredentials; final resourceRequirements = this.resourceRequirements; + final runtimePlatform = this.runtimePlatform; final secrets = this.secrets; final taskArn = this.taskArn; final ulimits = this.ulimits; @@ -3487,8 +3734,11 @@ class ContainerDetail { if (readonlyRootFilesystem != null) 'readonlyRootFilesystem': readonlyRootFilesystem, if (reason != null) 'reason': reason, + if (repositoryCredentials != null) + 'repositoryCredentials': repositoryCredentials, if (resourceRequirements != null) 'resourceRequirements': resourceRequirements, + if (runtimePlatform != null) 'runtimePlatform': runtimePlatform, if (secrets != null) 'secrets': secrets, if (taskArn != null) 'taskArn': taskArn, if (ulimits != null) 'ulimits': ulimits, @@ -3500,9 +3750,16 @@ class ContainerDetail { } /// The overrides that should be sent to a container. +/// +/// For information about using Batch overrides when you connect event sources +/// to targets, see BatchContainerOverrides. class ContainerOverrides { /// The command to send to the container that overrides the default command from /// the Docker image or the job definition. + /// + /// This parameter can't contain an empty string. + /// final List? command; /// The environment variables to send to the container. You can add new @@ -3524,8 +3781,8 @@ class ContainerOverrides { /// This parameter is deprecated, use resourceRequirements to /// override the memory requirements specified in the job definition. It's not - /// supported for jobs running on Fargate resources. For jobs that run on EC2 - /// resources, it overrides the memory parameter set in the job + /// supported for jobs running on Fargate resources. For jobs that run on Amazon + /// EC2 resources, it overrides the memory parameter set in the job /// definition, but doesn't override any memory requirement that's specified in /// the resourceRequirements structure in the job definition. To /// override memory requirements that are specified in the @@ -3547,9 +3804,9 @@ class ContainerOverrides { /// This parameter is deprecated, use resourceRequirements to /// override the vcpus parameter that's set in the job definition. /// It's not supported for jobs running on Fargate resources. For jobs that run - /// on EC2 resources, it overrides the vcpus parameter set in the - /// job definition, but doesn't override any vCPU requirement specified in the - /// resourceRequirements structure in the job definition. To + /// on Amazon EC2 resources, it overrides the vcpus parameter set + /// in the job definition, but doesn't override any vCPU requirement specified + /// in the resourceRequirements structure in the job definition. To /// override vCPU requirements that are specified in the /// resourceRequirements structure in the job definition, /// resourceRequirements must be specified in the @@ -3632,12 +3889,13 @@ class ContainerProperties { final String? executionRoleArn; /// The platform configuration for jobs that are running on Fargate resources. - /// Jobs that are running on EC2 resources must not specify this parameter. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. final FargatePlatformConfiguration? fargatePlatformConfiguration; - /// The image used to start a container. This string is passed directly to the - /// Docker daemon. Images in the Docker Hub registry are available by default. - /// Other repositories are specified with + /// Required. The image used to start a container. This string is passed + /// directly to the Docker daemon. Images in the Docker Hub registry are + /// available by default. Other repositories are specified with /// repository-url/image:tag . It can be 255 /// characters long. It can contain uppercase and lowercase letters, numbers, /// hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), @@ -3718,7 +3976,9 @@ class ContainerProperties { /// logging drivers in the Docker documentation. /// /// Batch currently supports a subset of the logging drivers available to the - /// Docker daemon (shown in the LogConfiguration data type). + /// Docker daemon (shown in the LogConfiguration + /// data type). /// /// This parameter requires version 1.18 of the Docker Remote API or greater on /// your container instance. To check the Docker Remote API version on your @@ -3738,12 +3998,12 @@ class ContainerProperties { /// This parameter is deprecated, use resourceRequirements to /// specify the memory requirements for the job definition. It's not supported - /// for jobs running on Fargate resources. For jobs that run on EC2 resources, - /// it specifies the memory hard limit (in MiB) for a container. If your - /// container attempts to exceed the specified number, it's terminated. You must - /// specify at least 4 MiB of memory for a job using this parameter. The memory - /// hard limit can be specified in several places. It must be specified for each - /// node at least once. + /// for jobs running on Fargate resources. For jobs that run on Amazon EC2 + /// resources, it specifies the memory hard limit (in MiB) for a container. If + /// your container attempts to exceed the specified number, it's terminated. You + /// must specify at least 4 MiB of memory for a job using this parameter. The + /// memory hard limit can be specified in several places. It must be specified + /// for each node at least once. final int? memory; /// The mount points for data volumes in your container. This parameter maps to @@ -3756,7 +4016,8 @@ class ContainerProperties { final List? mountPoints; /// The network configuration for jobs that are running on Fargate resources. - /// Jobs that are running on EC2 resources must not specify this parameter. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. final NetworkConfiguration? networkConfiguration; /// When this parameter is true, the container is given elevated permissions on @@ -3783,11 +4044,18 @@ class ContainerProperties { /// the --read-only option to docker run. final bool? readonlyRootFilesystem; + /// The private repository authentication credentials to use. + final RepositoryCredentials? repositoryCredentials; + /// The type and amount of resources to assign to a container. The supported /// resources include GPU, MEMORY, and /// VCPU. final List? resourceRequirements; + /// An object that represents the compute environment architecture for Batch + /// jobs on Fargate. + final RuntimePlatform? runtimePlatform; + /// The secrets for the container. For more information, see Specifying /// sensitive data in the Batch User Guide. @@ -3817,8 +4085,8 @@ class ContainerProperties { /// This parameter is deprecated, use resourceRequirements to /// specify the vCPU requirements for the job definition. It's not supported for - /// jobs running on Fargate resources. For jobs running on EC2 resources, it - /// specifies the number of vCPUs reserved for the job. + /// jobs running on Fargate resources. For jobs running on Amazon EC2 resources, + /// it specifies the number of vCPUs reserved for the job. /// /// Each vCPU is equivalent to 1,024 CPU shares. This parameter maps to /// CpuShares in the ) + : null, resourceRequirements: (json['resourceRequirements'] as List?) ?.whereNotNull() .map((e) => ResourceRequirement.fromJson(e as Map)) .toList(), + runtimePlatform: json['runtimePlatform'] != null + ? RuntimePlatform.fromJson( + json['runtimePlatform'] as Map) + : null, secrets: (json['secrets'] as List?) ?.whereNotNull() .map((e) => Secret.fromJson(e as Map)) @@ -3936,7 +4214,9 @@ class ContainerProperties { final networkConfiguration = this.networkConfiguration; final privileged = this.privileged; final readonlyRootFilesystem = this.readonlyRootFilesystem; + final repositoryCredentials = this.repositoryCredentials; final resourceRequirements = this.resourceRequirements; + final runtimePlatform = this.runtimePlatform; final secrets = this.secrets; final ulimits = this.ulimits; final user = this.user; @@ -3961,8 +4241,11 @@ class ContainerProperties { if (privileged != null) 'privileged': privileged, if (readonlyRootFilesystem != null) 'readonlyRootFilesystem': readonlyRootFilesystem, + if (repositoryCredentials != null) + 'repositoryCredentials': repositoryCredentials, if (resourceRequirements != null) 'resourceRequirements': resourceRequirements, + if (runtimePlatform != null) 'runtimePlatform': runtimePlatform, if (secrets != null) 'secrets': secrets, if (ulimits != null) 'ulimits': ulimits, if (user != null) 'user': user, @@ -4603,7 +4886,13 @@ class Ec2Configuration { /// Linux 2 (GPU): Default for all GPU instance families (for example /// P4 and G4) and can be used for all non Amazon Web /// Services Graviton-based instance types. - ///
    ECS_AL1
    + ///
    ECS_AL2023
    + /// Amazon + /// Linux 2023: Batch supports Amazon Linux 2023. + /// + /// Amazon Linux 2023 does not support A1 instances. + ///
    ECS_AL1
    /// Amazon /// Linux. Amazon Linux has reached the end-of-life of standard support. For @@ -4677,2032 +4966,2361 @@ class Ec2Configuration { } } -/// An object that represents the details for an attempt for a job attempt that -/// an Amazon EKS container runs. -class EksAttemptContainerDetail { - /// The exit code for the job attempt. A non-zero exit code is considered - /// failed. - final int? exitCode; - - /// A short (255 max characters) human-readable string to provide additional - /// details for a running or stopped container. - final String? reason; +/// An object that contains the properties for the Amazon ECS resources of a +/// job. +class EcsProperties { + /// An object that contains the properties for the Amazon ECS task definition of + /// a job. + /// + /// This object is currently limited to one element. + /// + final List taskProperties; - EksAttemptContainerDetail({ - this.exitCode, - this.reason, + EcsProperties({ + required this.taskProperties, }); - factory EksAttemptContainerDetail.fromJson(Map json) { - return EksAttemptContainerDetail( - exitCode: json['exitCode'] as int?, - reason: json['reason'] as String?, + factory EcsProperties.fromJson(Map json) { + return EcsProperties( + taskProperties: (json['taskProperties'] as List) + .whereNotNull() + .map((e) => EcsTaskProperties.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final exitCode = this.exitCode; - final reason = this.reason; + final taskProperties = this.taskProperties; return { - if (exitCode != null) 'exitCode': exitCode, - if (reason != null) 'reason': reason, + 'taskProperties': taskProperties, }; } } -/// An object that represents the details of a job attempt for a job attempt by -/// an Amazon EKS container. -class EksAttemptDetail { - /// The details for the final status of the containers for this job attempt. - final List? containers; - - /// The name of the node for this job attempt. - final String? nodeName; - - /// The name of the pod for this job attempt. - final String? podName; - - /// The Unix timestamp (in milliseconds) for when the attempt was started (when - /// the attempt transitioned from the STARTING state to the - /// RUNNING state). - final int? startedAt; - - /// A short, human-readable string to provide additional details for the current - /// status of the job attempt. - final String? statusReason; - - /// The Unix timestamp (in milliseconds) for when the attempt was stopped. This - /// happens when the attempt transitioned from the RUNNING state to - /// a terminal state, such as SUCCEEDED or FAILED. - final int? stoppedAt; +/// An object that contains the details for the Amazon ECS resources of a job. +class EcsPropertiesDetail { + /// The properties for the Amazon ECS task definition of a job. + final List? taskProperties; - EksAttemptDetail({ - this.containers, - this.nodeName, - this.podName, - this.startedAt, - this.statusReason, - this.stoppedAt, + EcsPropertiesDetail({ + this.taskProperties, }); - factory EksAttemptDetail.fromJson(Map json) { - return EksAttemptDetail( - containers: (json['containers'] as List?) + factory EcsPropertiesDetail.fromJson(Map json) { + return EcsPropertiesDetail( + taskProperties: (json['taskProperties'] as List?) ?.whereNotNull() - .map((e) => - EksAttemptContainerDetail.fromJson(e as Map)) + .map((e) => EcsTaskDetails.fromJson(e as Map)) .toList(), - nodeName: json['nodeName'] as String?, - podName: json['podName'] as String?, - startedAt: json['startedAt'] as int?, - statusReason: json['statusReason'] as String?, - stoppedAt: json['stoppedAt'] as int?, ); } Map toJson() { - final containers = this.containers; - final nodeName = this.nodeName; - final podName = this.podName; - final startedAt = this.startedAt; - final statusReason = this.statusReason; - final stoppedAt = this.stoppedAt; + final taskProperties = this.taskProperties; return { - if (containers != null) 'containers': containers, - if (nodeName != null) 'nodeName': nodeName, - if (podName != null) 'podName': podName, - if (startedAt != null) 'startedAt': startedAt, - if (statusReason != null) 'statusReason': statusReason, - if (stoppedAt != null) 'stoppedAt': stoppedAt, + if (taskProperties != null) 'taskProperties': taskProperties, }; } } -/// Configuration for the Amazon EKS cluster that supports the Batch compute -/// environment. The cluster must exist before the compute environment can be -/// created. -class EksConfiguration { - /// The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is - /// arn:aws:eks:us-east-1:123456789012:cluster/ClusterForBatch - /// . - final String eksClusterArn; +/// An object that contains overrides for the Amazon ECS task definition of a +/// job. +class EcsPropertiesOverride { + /// The overrides for the Amazon ECS task definition of a job. + /// + /// This object is currently limited to one element. + /// + final List? taskProperties; - /// The namespace of the Amazon EKS cluster. Batch manages pods in this - /// namespace. The value can't left empty or null. It must be fewer than 64 - /// characters long, can't be set to default, can't start with - /// "kube-," and must match this regular expression: - /// ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. For more information, see Namespaces - /// in the Kubernetes documentation. - final String kubernetesNamespace; - - EksConfiguration({ - required this.eksClusterArn, - required this.kubernetesNamespace, + EcsPropertiesOverride({ + this.taskProperties, }); - factory EksConfiguration.fromJson(Map json) { - return EksConfiguration( - eksClusterArn: json['eksClusterArn'] as String, - kubernetesNamespace: json['kubernetesNamespace'] as String, - ); - } - Map toJson() { - final eksClusterArn = this.eksClusterArn; - final kubernetesNamespace = this.kubernetesNamespace; + final taskProperties = this.taskProperties; return { - 'eksClusterArn': eksClusterArn, - 'kubernetesNamespace': kubernetesNamespace, + if (taskProperties != null) 'taskProperties': taskProperties, }; } } -/// EKS container properties are used in job definitions for Amazon EKS based -/// job definitions to describe the properties for a container node in the pod -/// that's launched as part of a job. This can't be specified for Amazon ECS -/// based job definitions. -class EksContainer { - /// The Docker image used to start the container. - final String image; - - /// An array of arguments to the entrypoint. If this isn't specified, the - /// CMD of the container image is used. This corresponds to the - /// args member in the Entrypoint - /// portion of the Pod - /// in Kubernetes. Environment variable references are expanded using the - /// container's environment. - /// - /// If the referenced environment variable doesn't exist, the reference in the - /// command isn't changed. For example, if the reference is to - /// "$(NAME1)" and the NAME1 environment variable - /// doesn't exist, the command string will remain "$(NAME1)." - /// $$ is replaced with $, and the resulting string - /// isn't expanded. For example, $$(VAR_NAME) is passed as - /// $(VAR_NAME) whether or not the VAR_NAME - /// environment variable exists. For more information, see CMD in the - /// Dockerfile reference and Define - /// a command and arguments for a pod in the Kubernetes - /// documentation. - final List? args; +/// The details of a task definition that describes the container and volume +/// definitions of an Amazon ECS task. +class EcsTaskDetails { + /// The Amazon Resource Name (ARN) of the container instance that hosts the + /// task. + final String? containerInstanceArn; - /// The entrypoint for the container. This isn't run within a shell. If this - /// isn't specified, the ENTRYPOINT of the container image is used. - /// Environment variable references are expanded using the container's - /// environment. - /// - /// If the referenced environment variable doesn't exist, the reference in the - /// command isn't changed. For example, if the reference is to - /// "$(NAME1)" and the NAME1 environment variable - /// doesn't exist, the command string will remain "$(NAME1)." - /// $$ is replaced with $ and the resulting string - /// isn't expanded. For example, $$(VAR_NAME) will be passed as - /// $(VAR_NAME) whether or not the VAR_NAME - /// environment variable exists. The entrypoint can't be updated. For more - /// information, see ENTRYPOINT - /// in the Dockerfile reference and Define - /// a command and arguments for a container and Entrypoint - /// in the Kubernetes documentation. - final List? command; + /// A list of containers that are included in the taskProperties + /// list. + final List? containers; - /// The environment variables to pass to a container. - /// - /// Environment variables cannot start with "AWS_BATCH". This - /// naming convention is reserved for variables that Batch sets. - /// - final List? env; + /// The amount of ephemeral storage allocated for the task. + final EphemeralStorage? ephemeralStorage; - /// The image pull policy for the container. Supported values are - /// Always, IfNotPresent, and Never. This - /// parameter defaults to IfNotPresent. However, if the - /// :latest tag is specified, it defaults to Always. + /// The Amazon Resource Name (ARN) of the execution role that Batch can assume. /// For more information, see Updating - /// images in the Kubernetes documentation. - final String? imagePullPolicy; + /// href="https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html">Batch + /// execution IAM role in the Batch User Guide. + final String? executionRoleArn; - /// The name of the container. If the name isn't specified, the default name - /// "Default" is used. Each container in a pod must have a unique - /// name. - final String? name; + /// The IPC resource namespace to use for the containers in the task. + final String? ipcMode; - /// The type and amount of resources to assign to a container. The supported - /// resources include memory, cpu, and - /// nvidia.com/gpu. For more information, see Resource - /// management for pods and containers in the Kubernetes - /// documentation. - final EksContainerResourceRequirements? resources; + /// The network configuration for jobs that are running on Fargate resources. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. + final NetworkConfiguration? networkConfiguration; - /// The security context for a job. For more information, see Configure - /// a security context for a pod or container in the Kubernetes - /// documentation. - final EksContainerSecurityContext? securityContext; + /// The process namespace to use for the containers in the task. + final String? pidMode; - /// The volume mounts for the container. Batch supports emptyDir, - /// hostPath, and secret volume types. For more - /// information about volumes and volume mounts in Kubernetes, see Volumes in - /// the Kubernetes documentation. - final List? volumeMounts; + /// The Fargate platform version where the jobs are running. + final String? platformVersion; - EksContainer({ - required this.image, - this.args, - this.command, - this.env, - this.imagePullPolicy, - this.name, - this.resources, - this.securityContext, - this.volumeMounts, + /// An object that represents the compute environment architecture for Batch + /// jobs on Fargate. + final RuntimePlatform? runtimePlatform; + + /// The ARN of the Amazon ECS task. + final String? taskArn; + + /// The Amazon Resource Name (ARN) of the IAM role that the container can assume + /// for Amazon Web Services permissions. For more information, see IAM + /// roles for tasks in the Amazon Elastic Container Service Developer + /// Guide. + /// + /// This is object is comparable to ContainerProperties:jobRoleArn. + /// + final String? taskRoleArn; + + /// A list of data volumes used in a job. + final List? volumes; + + EcsTaskDetails({ + this.containerInstanceArn, + this.containers, + this.ephemeralStorage, + this.executionRoleArn, + this.ipcMode, + this.networkConfiguration, + this.pidMode, + this.platformVersion, + this.runtimePlatform, + this.taskArn, + this.taskRoleArn, + this.volumes, }); - factory EksContainer.fromJson(Map json) { - return EksContainer( - image: json['image'] as String, - args: (json['args'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - command: (json['command'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - env: (json['env'] as List?) + factory EcsTaskDetails.fromJson(Map json) { + return EcsTaskDetails( + containerInstanceArn: json['containerInstanceArn'] as String?, + containers: (json['containers'] as List?) ?.whereNotNull() - .map((e) => EksContainerEnvironmentVariable.fromJson( - e as Map)) + .map((e) => TaskContainerDetails.fromJson(e as Map)) .toList(), - imagePullPolicy: json['imagePullPolicy'] as String?, - name: json['name'] as String?, - resources: json['resources'] != null - ? EksContainerResourceRequirements.fromJson( - json['resources'] as Map) + ephemeralStorage: json['ephemeralStorage'] != null + ? EphemeralStorage.fromJson( + json['ephemeralStorage'] as Map) : null, - securityContext: json['securityContext'] != null - ? EksContainerSecurityContext.fromJson( - json['securityContext'] as Map) + executionRoleArn: json['executionRoleArn'] as String?, + ipcMode: json['ipcMode'] as String?, + networkConfiguration: json['networkConfiguration'] != null + ? NetworkConfiguration.fromJson( + json['networkConfiguration'] as Map) : null, - volumeMounts: (json['volumeMounts'] as List?) + pidMode: json['pidMode'] as String?, + platformVersion: json['platformVersion'] as String?, + runtimePlatform: json['runtimePlatform'] != null + ? RuntimePlatform.fromJson( + json['runtimePlatform'] as Map) + : null, + taskArn: json['taskArn'] as String?, + taskRoleArn: json['taskRoleArn'] as String?, + volumes: (json['volumes'] as List?) ?.whereNotNull() - .map((e) => - EksContainerVolumeMount.fromJson(e as Map)) + .map((e) => Volume.fromJson(e as Map)) .toList(), ); } Map toJson() { - final image = this.image; - final args = this.args; - final command = this.command; - final env = this.env; - final imagePullPolicy = this.imagePullPolicy; - final name = this.name; - final resources = this.resources; - final securityContext = this.securityContext; - final volumeMounts = this.volumeMounts; + final containerInstanceArn = this.containerInstanceArn; + final containers = this.containers; + final ephemeralStorage = this.ephemeralStorage; + final executionRoleArn = this.executionRoleArn; + final ipcMode = this.ipcMode; + final networkConfiguration = this.networkConfiguration; + final pidMode = this.pidMode; + final platformVersion = this.platformVersion; + final runtimePlatform = this.runtimePlatform; + final taskArn = this.taskArn; + final taskRoleArn = this.taskRoleArn; + final volumes = this.volumes; return { - 'image': image, - if (args != null) 'args': args, - if (command != null) 'command': command, - if (env != null) 'env': env, - if (imagePullPolicy != null) 'imagePullPolicy': imagePullPolicy, - if (name != null) 'name': name, - if (resources != null) 'resources': resources, - if (securityContext != null) 'securityContext': securityContext, - if (volumeMounts != null) 'volumeMounts': volumeMounts, + if (containerInstanceArn != null) + 'containerInstanceArn': containerInstanceArn, + if (containers != null) 'containers': containers, + if (ephemeralStorage != null) 'ephemeralStorage': ephemeralStorage, + if (executionRoleArn != null) 'executionRoleArn': executionRoleArn, + if (ipcMode != null) 'ipcMode': ipcMode, + if (networkConfiguration != null) + 'networkConfiguration': networkConfiguration, + if (pidMode != null) 'pidMode': pidMode, + if (platformVersion != null) 'platformVersion': platformVersion, + if (runtimePlatform != null) 'runtimePlatform': runtimePlatform, + if (taskArn != null) 'taskArn': taskArn, + if (taskRoleArn != null) 'taskRoleArn': taskRoleArn, + if (volumes != null) 'volumes': volumes, }; } } -/// The details for container properties that are returned by -/// DescribeJobs for jobs that use Amazon EKS. -class EksContainerDetail { - /// An array of arguments to the entrypoint. If this isn't specified, the - /// CMD of the container image is used. This corresponds to the - /// args member in the Entrypoint - /// portion of the Pod - /// in Kubernetes. Environment variable references are expanded using the - /// container's environment. - /// - /// If the referenced environment variable doesn't exist, the reference in the - /// command isn't changed. For example, if the reference is to - /// "$(NAME1)" and the NAME1 environment variable - /// doesn't exist, the command string will remain "$(NAME1)". - /// $$ is replaced with $ and the resulting string - /// isn't expanded. For example, $$(VAR_NAME) is passed as - /// $(VAR_NAME) whether or not the VAR_NAME - /// environment variable exists. For more information, see CMD in the - /// Dockerfile reference and Define - /// a command and arguments for a pod in the Kubernetes - /// documentation. - final List? args; +/// The properties for a task definition that describes the container and volume +/// definitions of an Amazon ECS task. You can specify which Docker images to +/// use, the required resources, and other configurations related to launching +/// the task definition through an Amazon ECS service or task. +class EcsTaskProperties { + /// This object is a list of containers. + final List containers; - /// The entrypoint for the container. For more information, see Entrypoint - /// in the Kubernetes documentation. - final List? command; + /// The amount of ephemeral storage to allocate for the task. This parameter is + /// used to expand the total amount of ephemeral storage available, beyond the + /// default amount, for tasks hosted on Fargate. + final EphemeralStorage? ephemeralStorage; - /// The environment variables to pass to a container. - /// - /// Environment variables cannot start with "AWS_BATCH". This - /// naming convention is reserved for variables that Batch sets. - /// - final List? env; - - /// The exit code for the job attempt. A non-zero exit code is considered - /// failed. - final int? exitCode; + /// The Amazon Resource Name (ARN) of the execution role that Batch can assume. + /// For jobs that run on Fargate resources, you must provide an execution role. + /// For more information, see Batch + /// execution IAM role in the Batch User Guide. + final String? executionRoleArn; - /// The Docker image used to start the container. - final String? image; + /// The IPC resource namespace to use for the containers in the task. The valid + /// values are host, task, or none. + /// + /// If host is specified, all containers within the tasks that + /// specified the host IPC mode on the same container instance + /// share the same IPC resources with the host Amazon EC2 instance. + /// + /// If task is specified, all containers within the specified + /// task share the same IPC resources. + /// + /// If none is specified, the IPC resources within the containers + /// of a task are private, and are not shared with other containers in a task or + /// on the container instance. + /// + /// If no value is specified, then the IPC resource namespace sharing depends on + /// the Docker daemon setting on the container instance. For more information, + /// see IPC + /// settings in the Docker run reference. + final String? ipcMode; - /// The image pull policy for the container. Supported values are - /// Always, IfNotPresent, and Never. This - /// parameter defaults to Always if the :latest tag is - /// specified, IfNotPresent otherwise. For more information, see Updating - /// images in the Kubernetes documentation. - final String? imagePullPolicy; + /// The network configuration for jobs that are running on Fargate resources. + /// Jobs that are running on Amazon EC2 resources must not specify this + /// parameter. + final NetworkConfiguration? networkConfiguration; - /// The name of the container. If the name isn't specified, the default name - /// "Default" is used. Each container in a pod must have a unique - /// name. - final String? name; + /// The process namespace to use for the containers in the task. The valid + /// values are host or task. For example, monitoring + /// sidecars might need pidMode to access information about other + /// containers running in the same task. + /// + /// If host is specified, all containers within the tasks that + /// specified the host PID mode on the same container instance + /// share the process namespace with the host Amazon EC2 instance. + /// + /// If task is specified, all containers within the specified task + /// share the same process namespace. + /// + /// If no value is specified, the default is a private namespace for each + /// container. For more information, see PID + /// settings in the Docker run reference. + final String? pidMode; - /// A short human-readable string to provide additional details for a running or - /// stopped container. It can be up to 255 characters long. - final String? reason; + /// The Fargate platform version where the jobs are running. A platform version + /// is specified only for jobs that are running on Fargate resources. If one + /// isn't specified, the LATEST platform version is used by + /// default. This uses a recent, approved version of the Fargate platform for + /// compute resources. For more information, see Fargate + /// platform versions in the Amazon Elastic Container Service Developer + /// Guide. + final String? platformVersion; - /// The type and amount of resources to assign to a container. The supported - /// resources include memory, cpu, and - /// nvidia.com/gpu. For more information, see Resource - /// management for pods and containers in the Kubernetes - /// documentation. - final EksContainerResourceRequirements? resources; + /// An object that represents the compute environment architecture for Batch + /// jobs on Fargate. + final RuntimePlatform? runtimePlatform; - /// The security context for a job. For more information, see Configure - /// a security context for a pod or container in the Kubernetes - /// documentation. - final EksContainerSecurityContext? securityContext; + /// The Amazon Resource Name (ARN) that's associated with the Amazon ECS task. + /// + /// This is object is comparable to ContainerProperties:jobRoleArn. + /// + final String? taskRoleArn; - /// The volume mounts for the container. Batch supports emptyDir, - /// hostPath, and secret volume types. For more - /// information about volumes and volume mounts in Kubernetes, see Volumes in - /// the Kubernetes documentation. - final List? volumeMounts; + /// A list of volumes that are associated with the job. + final List? volumes; - EksContainerDetail({ - this.args, - this.command, - this.env, - this.exitCode, - this.image, - this.imagePullPolicy, - this.name, - this.reason, - this.resources, - this.securityContext, - this.volumeMounts, + EcsTaskProperties({ + required this.containers, + this.ephemeralStorage, + this.executionRoleArn, + this.ipcMode, + this.networkConfiguration, + this.pidMode, + this.platformVersion, + this.runtimePlatform, + this.taskRoleArn, + this.volumes, }); - factory EksContainerDetail.fromJson(Map json) { - return EksContainerDetail( - args: (json['args'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - command: (json['command'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - env: (json['env'] as List?) - ?.whereNotNull() - .map((e) => EksContainerEnvironmentVariable.fromJson( - e as Map)) + factory EcsTaskProperties.fromJson(Map json) { + return EcsTaskProperties( + containers: (json['containers'] as List) + .whereNotNull() + .map((e) => + TaskContainerProperties.fromJson(e as Map)) .toList(), - exitCode: json['exitCode'] as int?, - image: json['image'] as String?, - imagePullPolicy: json['imagePullPolicy'] as String?, - name: json['name'] as String?, - reason: json['reason'] as String?, - resources: json['resources'] != null - ? EksContainerResourceRequirements.fromJson( - json['resources'] as Map) + ephemeralStorage: json['ephemeralStorage'] != null + ? EphemeralStorage.fromJson( + json['ephemeralStorage'] as Map) : null, - securityContext: json['securityContext'] != null - ? EksContainerSecurityContext.fromJson( - json['securityContext'] as Map) + executionRoleArn: json['executionRoleArn'] as String?, + ipcMode: json['ipcMode'] as String?, + networkConfiguration: json['networkConfiguration'] != null + ? NetworkConfiguration.fromJson( + json['networkConfiguration'] as Map) : null, - volumeMounts: (json['volumeMounts'] as List?) + pidMode: json['pidMode'] as String?, + platformVersion: json['platformVersion'] as String?, + runtimePlatform: json['runtimePlatform'] != null + ? RuntimePlatform.fromJson( + json['runtimePlatform'] as Map) + : null, + taskRoleArn: json['taskRoleArn'] as String?, + volumes: (json['volumes'] as List?) ?.whereNotNull() - .map((e) => - EksContainerVolumeMount.fromJson(e as Map)) + .map((e) => Volume.fromJson(e as Map)) .toList(), ); } Map toJson() { - final args = this.args; - final command = this.command; - final env = this.env; - final exitCode = this.exitCode; - final image = this.image; - final imagePullPolicy = this.imagePullPolicy; - final name = this.name; - final reason = this.reason; - final resources = this.resources; - final securityContext = this.securityContext; - final volumeMounts = this.volumeMounts; + final containers = this.containers; + final ephemeralStorage = this.ephemeralStorage; + final executionRoleArn = this.executionRoleArn; + final ipcMode = this.ipcMode; + final networkConfiguration = this.networkConfiguration; + final pidMode = this.pidMode; + final platformVersion = this.platformVersion; + final runtimePlatform = this.runtimePlatform; + final taskRoleArn = this.taskRoleArn; + final volumes = this.volumes; return { - if (args != null) 'args': args, - if (command != null) 'command': command, - if (env != null) 'env': env, - if (exitCode != null) 'exitCode': exitCode, - if (image != null) 'image': image, - if (imagePullPolicy != null) 'imagePullPolicy': imagePullPolicy, - if (name != null) 'name': name, - if (reason != null) 'reason': reason, - if (resources != null) 'resources': resources, - if (securityContext != null) 'securityContext': securityContext, - if (volumeMounts != null) 'volumeMounts': volumeMounts, + 'containers': containers, + if (ephemeralStorage != null) 'ephemeralStorage': ephemeralStorage, + if (executionRoleArn != null) 'executionRoleArn': executionRoleArn, + if (ipcMode != null) 'ipcMode': ipcMode, + if (networkConfiguration != null) + 'networkConfiguration': networkConfiguration, + if (pidMode != null) 'pidMode': pidMode, + if (platformVersion != null) 'platformVersion': platformVersion, + if (runtimePlatform != null) 'runtimePlatform': runtimePlatform, + if (taskRoleArn != null) 'taskRoleArn': taskRoleArn, + if (volumes != null) 'volumes': volumes, }; } } -/// An environment variable. -class EksContainerEnvironmentVariable { - /// The name of the environment variable. - final String name; +/// An object that represents the details for an attempt for a job attempt that +/// an Amazon EKS container runs. +class EksAttemptContainerDetail { + /// The exit code returned for the job attempt. A non-zero exit code is + /// considered failed. + final int? exitCode; - /// The value of the environment variable. - final String? value; + /// The name of a container. + final String? name; - EksContainerEnvironmentVariable({ - required this.name, - this.value, + /// A short (255 max characters) human-readable string to provide additional + /// details for a running or stopped container. + final String? reason; + + EksAttemptContainerDetail({ + this.exitCode, + this.name, + this.reason, }); - factory EksContainerEnvironmentVariable.fromJson(Map json) { - return EksContainerEnvironmentVariable( - name: json['name'] as String, - value: json['value'] as String?, + factory EksAttemptContainerDetail.fromJson(Map json) { + return EksAttemptContainerDetail( + exitCode: json['exitCode'] as int?, + name: json['name'] as String?, + reason: json['reason'] as String?, ); } Map toJson() { + final exitCode = this.exitCode; final name = this.name; - final value = this.value; + final reason = this.reason; return { - 'name': name, - if (value != null) 'value': value, + if (exitCode != null) 'exitCode': exitCode, + if (name != null) 'name': name, + if (reason != null) 'reason': reason, }; } } -/// Object representing any Kubernetes overrides to a job definition that's used -/// in a SubmitJob API operation. -class EksContainerOverride { - /// The arguments to the entrypoint to send to the container that overrides the - /// default arguments from the Docker image or the job definition. For more - /// information, see CMD in the - /// Dockerfile reference and Define - /// a command an arguments for a pod in the Kubernetes documentation. - final List? args; +/// An object that represents the details of a job attempt for a job attempt by +/// an Amazon EKS container. +class EksAttemptDetail { + /// The details for the final status of the containers for this job attempt. + final List? containers; - /// The command to send to the container that overrides the default command from - /// the Docker image or the job definition. - final List? command; + /// The details for the init containers. + final List? initContainers; - /// The environment variables to send to the container. You can add new - /// environment variables, which are added to the container at launch. Or, you - /// can override the existing environment variables from the Docker image or the - /// job definition. - /// - /// Environment variables cannot start with "AWS_BATCH". This - /// naming convention is reserved for variables that Batch sets. - /// - final List? env; + /// The name of the node for this job attempt. + final String? nodeName; - /// The override of the Docker image that's used to start the container. - final String? image; + /// The name of the pod for this job attempt. + final String? podName; - /// The type and amount of resources to assign to a container. These override - /// the settings in the job definition. The supported resources include - /// memory, cpu, and nvidia.com/gpu. For - /// more information, see Resource - /// management for pods and containers in the Kubernetes - /// documentation. - final EksContainerResourceRequirements? resources; + /// The Unix timestamp (in milliseconds) for when the attempt was started (when + /// the attempt transitioned from the STARTING state to the + /// RUNNING state). + final int? startedAt; - EksContainerOverride({ - this.args, - this.command, - this.env, - this.image, - this.resources, - }); + /// A short, human-readable string to provide additional details for the current + /// status of the job attempt. + final String? statusReason; - Map toJson() { - final args = this.args; - final command = this.command; - final env = this.env; - final image = this.image; - final resources = this.resources; - return { - if (args != null) 'args': args, - if (command != null) 'command': command, - if (env != null) 'env': env, - if (image != null) 'image': image, - if (resources != null) 'resources': resources, - }; - } -} - -/// The type and amount of resources to assign to a container. The supported -/// resources include memory, cpu, and -/// nvidia.com/gpu. For more information, see Resource -/// management for pods and containers in the Kubernetes -/// documentation. -class EksContainerResourceRequirements { - /// The type and quantity of the resources to reserve for the container. The - /// values vary based on the name that's specified. Resources can - /// be requested using either the limits or the - /// requests objects. - ///
    memory
    - /// The memory hard limit (in MiB) for the container, using whole integers, with - /// a "Mi" suffix. If your container attempts to exceed the memory specified, - /// the container is terminated. You must specify at least 4 MiB of memory for a - /// job. memory can be specified in limits, - /// requests, or both. If memory is specified in both - /// places, then the value that's specified in limits must be equal - /// to the value that's specified in requests. - /// - /// To maximize your resource utilization, provide your jobs with as much memory - /// as possible for the specific instance type that you are using. To learn how, - /// see Memory - /// management in the Batch User Guide. - ///
    cpu
    - /// The number of CPUs that's reserved for the container. Values must be an even - /// multiple of 0.25. cpu can be specified in - /// limits, requests, or both. If cpu is - /// specified in both places, then the value that's specified in - /// limits must be at least as large as the value that's specified - /// in requests. - ///
    nvidia.com/gpu
    - /// The number of GPUs that's reserved for the container. Values must be a whole - /// integer. memory can be specified in limits, - /// requests, or both. If memory is specified in both - /// places, then the value that's specified in limits must be equal - /// to the value that's specified in requests. - ///
    - final Map? limits; - - /// The type and quantity of the resources to request for the container. The - /// values vary based on the name that's specified. Resources can - /// be requested by using either the limits or the - /// requests objects. - ///
    memory
    - /// The memory hard limit (in MiB) for the container, using whole integers, with - /// a "Mi" suffix. If your container attempts to exceed the memory specified, - /// the container is terminated. You must specify at least 4 MiB of memory for a - /// job. memory can be specified in limits, - /// requests, or both. If memory is specified in both, - /// then the value that's specified in limits must be equal to the - /// value that's specified in requests. - /// - /// If you're trying to maximize your resource utilization by providing your - /// jobs as much memory as possible for a particular instance type, see Memory - /// management in the Batch User Guide. - ///
    cpu
    - /// The number of CPUs that are reserved for the container. Values must be an - /// even multiple of 0.25. cpu can be specified in - /// limits, requests, or both. If cpu is - /// specified in both, then the value that's specified in limits - /// must be at least as large as the value that's specified in - /// requests. - ///
    nvidia.com/gpu
    - /// The number of GPUs that are reserved for the container. Values must be a - /// whole integer. nvidia.com/gpu can be specified in - /// limits, requests, or both. If - /// nvidia.com/gpu is specified in both, then the value that's - /// specified in limits must be equal to the value that's specified - /// in requests. - ///
    - final Map? requests; + /// The Unix timestamp (in milliseconds) for when the attempt was stopped. This + /// happens when the attempt transitioned from the RUNNING state to + /// a terminal state, such as SUCCEEDED or FAILED. + final int? stoppedAt; - EksContainerResourceRequirements({ - this.limits, - this.requests, + EksAttemptDetail({ + this.containers, + this.initContainers, + this.nodeName, + this.podName, + this.startedAt, + this.statusReason, + this.stoppedAt, }); - factory EksContainerResourceRequirements.fromJson(Map json) { - return EksContainerResourceRequirements( - limits: (json['limits'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - requests: (json['requests'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory EksAttemptDetail.fromJson(Map json) { + return EksAttemptDetail( + containers: (json['containers'] as List?) + ?.whereNotNull() + .map((e) => + EksAttemptContainerDetail.fromJson(e as Map)) + .toList(), + initContainers: (json['initContainers'] as List?) + ?.whereNotNull() + .map((e) => + EksAttemptContainerDetail.fromJson(e as Map)) + .toList(), + nodeName: json['nodeName'] as String?, + podName: json['podName'] as String?, + startedAt: json['startedAt'] as int?, + statusReason: json['statusReason'] as String?, + stoppedAt: json['stoppedAt'] as int?, ); } Map toJson() { - final limits = this.limits; - final requests = this.requests; + final containers = this.containers; + final initContainers = this.initContainers; + final nodeName = this.nodeName; + final podName = this.podName; + final startedAt = this.startedAt; + final statusReason = this.statusReason; + final stoppedAt = this.stoppedAt; return { - if (limits != null) 'limits': limits, - if (requests != null) 'requests': requests, + if (containers != null) 'containers': containers, + if (initContainers != null) 'initContainers': initContainers, + if (nodeName != null) 'nodeName': nodeName, + if (podName != null) 'podName': podName, + if (startedAt != null) 'startedAt': startedAt, + if (statusReason != null) 'statusReason': statusReason, + if (stoppedAt != null) 'stoppedAt': stoppedAt, }; } } -/// The security context for a job. For more information, see Configure -/// a security context for a pod or container in the Kubernetes -/// documentation. -class EksContainerSecurityContext { - /// When this parameter is true, the container is given elevated - /// permissions on the host container instance. The level of permissions are - /// similar to the root user permissions. The default value is - /// false. This parameter maps to privileged policy in - /// the Privileged - /// pod security policies in the Kubernetes documentation. - final bool? privileged; - - /// When this parameter is true, the container is given read-only - /// access to its root file system. The default value is false. - /// This parameter maps to ReadOnlyRootFilesystem policy in the Volumes - /// and file systems pod security policies in the Kubernetes - /// documentation. - final bool? readOnlyRootFilesystem; - - /// When this parameter is specified, the container is run as the specified - /// group ID (gid). If this parameter isn't specified, the default - /// is the group that's specified in the image metadata. This parameter maps to - /// RunAsGroup and MustRunAs policy in the Users - /// and groups pod security policies in the Kubernetes documentation. - final int? runAsGroup; - - /// When this parameter is specified, the container is run as a user with a - /// uid other than 0. If this parameter isn't specified, so such - /// rule is enforced. This parameter maps to RunAsUser and - /// MustRunAsNonRoot policy in the Users - /// and groups pod security policies in the Kubernetes documentation. - final bool? runAsNonRoot; +/// Configuration for the Amazon EKS cluster that supports the Batch compute +/// environment. The cluster must exist before the compute environment can be +/// created. +class EksConfiguration { + /// The Amazon Resource Name (ARN) of the Amazon EKS cluster. An example is + /// arn:aws:eks:us-east-1:123456789012:cluster/ClusterForBatch + /// . + final String eksClusterArn; - /// When this parameter is specified, the container is run as the specified user - /// ID (uid). If this parameter isn't specified, the default is the - /// user that's specified in the image metadata. This parameter maps to - /// RunAsUser and MustRanAs policy in the Users - /// and groups pod security policies in the Kubernetes documentation. - final int? runAsUser; + /// The namespace of the Amazon EKS cluster. Batch manages pods in this + /// namespace. The value can't left empty or null. It must be fewer than 64 + /// characters long, can't be set to default, can't start with + /// "kube-," and must match this regular expression: + /// ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. For more information, see Namespaces + /// in the Kubernetes documentation. + final String kubernetesNamespace; - EksContainerSecurityContext({ - this.privileged, - this.readOnlyRootFilesystem, - this.runAsGroup, - this.runAsNonRoot, - this.runAsUser, + EksConfiguration({ + required this.eksClusterArn, + required this.kubernetesNamespace, }); - factory EksContainerSecurityContext.fromJson(Map json) { - return EksContainerSecurityContext( - privileged: json['privileged'] as bool?, - readOnlyRootFilesystem: json['readOnlyRootFilesystem'] as bool?, - runAsGroup: json['runAsGroup'] as int?, - runAsNonRoot: json['runAsNonRoot'] as bool?, - runAsUser: json['runAsUser'] as int?, + factory EksConfiguration.fromJson(Map json) { + return EksConfiguration( + eksClusterArn: json['eksClusterArn'] as String, + kubernetesNamespace: json['kubernetesNamespace'] as String, ); } Map toJson() { - final privileged = this.privileged; - final readOnlyRootFilesystem = this.readOnlyRootFilesystem; - final runAsGroup = this.runAsGroup; - final runAsNonRoot = this.runAsNonRoot; - final runAsUser = this.runAsUser; + final eksClusterArn = this.eksClusterArn; + final kubernetesNamespace = this.kubernetesNamespace; return { - if (privileged != null) 'privileged': privileged, - if (readOnlyRootFilesystem != null) - 'readOnlyRootFilesystem': readOnlyRootFilesystem, - if (runAsGroup != null) 'runAsGroup': runAsGroup, - if (runAsNonRoot != null) 'runAsNonRoot': runAsNonRoot, - if (runAsUser != null) 'runAsUser': runAsUser, + 'eksClusterArn': eksClusterArn, + 'kubernetesNamespace': kubernetesNamespace, }; } } -/// The volume mounts for a container for an Amazon EKS job. For more -/// information about volumes and volume mounts in Kubernetes, see Volumes in -/// the Kubernetes documentation. -class EksContainerVolumeMount { - /// The path on the container where the volume is mounted. - final String? mountPath; - - /// The name the volume mount. This must match the name of one of the volumes in - /// the pod. - final String? name; - - /// If this value is true, the container has read-only access to - /// the volume. Otherwise, the container can write to the volume. The default - /// value is false. - final bool? readOnly; +/// EKS container properties are used in job definitions for Amazon EKS based +/// job definitions to describe the properties for a container node in the pod +/// that's launched as part of a job. This can't be specified for Amazon ECS +/// based job definitions. +class EksContainer { + /// The Docker image used to start the container. + final String image; - EksContainerVolumeMount({ - this.mountPath, + /// An array of arguments to the entrypoint. If this isn't specified, the + /// CMD of the container image is used. This corresponds to the + /// args member in the Entrypoint + /// portion of the Pod + /// in Kubernetes. Environment variable references are expanded using the + /// container's environment. + /// + /// If the referenced environment variable doesn't exist, the reference in the + /// command isn't changed. For example, if the reference is to + /// "$(NAME1)" and the NAME1 environment variable + /// doesn't exist, the command string will remain "$(NAME1)." + /// $$ is replaced with $, and the resulting string + /// isn't expanded. For example, $$(VAR_NAME) is passed as + /// $(VAR_NAME) whether or not the VAR_NAME + /// environment variable exists. For more information, see Dockerfile + /// reference: CMD and Define + /// a command and arguments for a pod in the Kubernetes + /// documentation. + final List? args; + + /// The entrypoint for the container. This isn't run within a shell. If this + /// isn't specified, the ENTRYPOINT of the container image is used. + /// Environment variable references are expanded using the container's + /// environment. + /// + /// If the referenced environment variable doesn't exist, the reference in the + /// command isn't changed. For example, if the reference is to + /// "$(NAME1)" and the NAME1 environment variable + /// doesn't exist, the command string will remain "$(NAME1)." + /// $$ is replaced with $ and the resulting string + /// isn't expanded. For example, $$(VAR_NAME) will be passed as + /// $(VAR_NAME) whether or not the VAR_NAME + /// environment variable exists. The entrypoint can't be updated. For more + /// information, see ENTRYPOINT + /// in the Dockerfile reference and Define + /// a command and arguments for a container and Entrypoint + /// in the Kubernetes documentation. + final List? command; + + /// The environment variables to pass to a container. + /// + /// Environment variables cannot start with "AWS_BATCH". This + /// naming convention is reserved for variables that Batch sets. + /// + final List? env; + + /// The image pull policy for the container. Supported values are + /// Always, IfNotPresent, and Never. This + /// parameter defaults to IfNotPresent. However, if the + /// :latest tag is specified, it defaults to Always. + /// For more information, see Updating + /// images in the Kubernetes documentation. + final String? imagePullPolicy; + + /// The name of the container. If the name isn't specified, the default name + /// "Default" is used. Each container in a pod must have a unique + /// name. + final String? name; + + /// The type and amount of resources to assign to a container. The supported + /// resources include memory, cpu, and + /// nvidia.com/gpu. For more information, see Resource + /// management for pods and containers in the Kubernetes + /// documentation. + final EksContainerResourceRequirements? resources; + + /// The security context for a job. For more information, see Configure + /// a security context for a pod or container in the Kubernetes + /// documentation. + final EksContainerSecurityContext? securityContext; + + /// The volume mounts for the container. Batch supports emptyDir, + /// hostPath, and secret volume types. For more + /// information about volumes and volume mounts in Kubernetes, see Volumes in + /// the Kubernetes documentation. + final List? volumeMounts; + + EksContainer({ + required this.image, + this.args, + this.command, + this.env, + this.imagePullPolicy, this.name, - this.readOnly, + this.resources, + this.securityContext, + this.volumeMounts, }); - factory EksContainerVolumeMount.fromJson(Map json) { - return EksContainerVolumeMount( - mountPath: json['mountPath'] as String?, + factory EksContainer.fromJson(Map json) { + return EksContainer( + image: json['image'] as String, + args: (json['args'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + command: (json['command'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + env: (json['env'] as List?) + ?.whereNotNull() + .map((e) => EksContainerEnvironmentVariable.fromJson( + e as Map)) + .toList(), + imagePullPolicy: json['imagePullPolicy'] as String?, name: json['name'] as String?, - readOnly: json['readOnly'] as bool?, + resources: json['resources'] != null + ? EksContainerResourceRequirements.fromJson( + json['resources'] as Map) + : null, + securityContext: json['securityContext'] != null + ? EksContainerSecurityContext.fromJson( + json['securityContext'] as Map) + : null, + volumeMounts: (json['volumeMounts'] as List?) + ?.whereNotNull() + .map((e) => + EksContainerVolumeMount.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final mountPath = this.mountPath; + final image = this.image; + final args = this.args; + final command = this.command; + final env = this.env; + final imagePullPolicy = this.imagePullPolicy; final name = this.name; - final readOnly = this.readOnly; + final resources = this.resources; + final securityContext = this.securityContext; + final volumeMounts = this.volumeMounts; return { - if (mountPath != null) 'mountPath': mountPath, + 'image': image, + if (args != null) 'args': args, + if (command != null) 'command': command, + if (env != null) 'env': env, + if (imagePullPolicy != null) 'imagePullPolicy': imagePullPolicy, if (name != null) 'name': name, - if (readOnly != null) 'readOnly': readOnly, + if (resources != null) 'resources': resources, + if (securityContext != null) 'securityContext': securityContext, + if (volumeMounts != null) 'volumeMounts': volumeMounts, }; } } -/// Specifies the configuration of a Kubernetes emptyDir volume. An -/// emptyDir volume is first created when a pod is assigned to a -/// node. It exists as long as that pod is running on that node. The -/// emptyDir volume is initially empty. All containers in the pod -/// can read and write the files in the emptyDir volume. However, -/// the emptyDir volume can be mounted at the same or different -/// paths in each container. When a pod is removed from a node for any reason, -/// the data in the emptyDir is deleted permanently. For more -/// information, see emptyDir -/// in the Kubernetes documentation. -class EksEmptyDir { - /// The medium to store the volume. The default value is an empty string, which - /// uses the storage of the node. - ///
    ""
    - /// (Default) Use the disk storage of the node. - ///
    "Memory"
    - /// Use the tmpfs volume that's backed by the RAM of the node. - /// Contents of the volume are lost when the node reboots, and any storage on - /// the volume counts against the container's memory limit. - ///
    - final String? medium; +/// The details for container properties that are returned by +/// DescribeJobs for jobs that use Amazon EKS. +class EksContainerDetail { + /// An array of arguments to the entrypoint. If this isn't specified, the + /// CMD of the container image is used. This corresponds to the + /// args member in the Entrypoint + /// portion of the Pod + /// in Kubernetes. Environment variable references are expanded using the + /// container's environment. + /// + /// If the referenced environment variable doesn't exist, the reference in the + /// command isn't changed. For example, if the reference is to + /// "$(NAME1)" and the NAME1 environment variable + /// doesn't exist, the command string will remain "$(NAME1)". + /// $$ is replaced with $ and the resulting string + /// isn't expanded. For example, $$(VAR_NAME) is passed as + /// $(VAR_NAME) whether or not the VAR_NAME + /// environment variable exists. For more information, see Dockerfile + /// reference: CMD and Define + /// a command and arguments for a pod in the Kubernetes + /// documentation. + final List? args; - /// The maximum size of the volume. By default, there's no maximum size defined. - final String? sizeLimit; + /// The entrypoint for the container. For more information, see Entrypoint + /// in the Kubernetes documentation. + final List? command; - EksEmptyDir({ - this.medium, - this.sizeLimit, - }); + /// The environment variables to pass to a container. + /// + /// Environment variables cannot start with "AWS_BATCH". This + /// naming convention is reserved for variables that Batch sets. + /// + final List? env; - factory EksEmptyDir.fromJson(Map json) { - return EksEmptyDir( - medium: json['medium'] as String?, - sizeLimit: json['sizeLimit'] as String?, - ); - } + /// The exit code returned for the job attempt. A non-zero exit code is + /// considered failed. + final int? exitCode; - Map toJson() { - final medium = this.medium; - final sizeLimit = this.sizeLimit; - return { - if (medium != null) 'medium': medium, - if (sizeLimit != null) 'sizeLimit': sizeLimit, - }; - } -} + /// The Docker image used to start the container. + final String? image; -/// Specifies the configuration of a Kubernetes hostPath volume. A -/// hostPath volume mounts an existing file or directory from the -/// host node's filesystem into your pod. For more information, see hostPath -/// in the Kubernetes documentation. -class EksHostPath { - /// The path of the file or directory on the host to mount into containers on - /// the pod. - final String? path; + /// The image pull policy for the container. Supported values are + /// Always, IfNotPresent, and Never. This + /// parameter defaults to Always if the :latest tag is + /// specified, IfNotPresent otherwise. For more information, see Updating + /// images in the Kubernetes documentation. + final String? imagePullPolicy; - EksHostPath({ - this.path, - }); + /// The name of the container. If the name isn't specified, the default name + /// "Default" is used. Each container in a pod must have a unique + /// name. + final String? name; - factory EksHostPath.fromJson(Map json) { - return EksHostPath( - path: json['path'] as String?, + /// A short human-readable string to provide additional details for a running or + /// stopped container. It can be up to 255 characters long. + final String? reason; + + /// The type and amount of resources to assign to a container. The supported + /// resources include memory, cpu, and + /// nvidia.com/gpu. For more information, see Resource + /// management for pods and containers in the Kubernetes + /// documentation. + final EksContainerResourceRequirements? resources; + + /// The security context for a job. For more information, see Configure + /// a security context for a pod or container in the Kubernetes + /// documentation. + final EksContainerSecurityContext? securityContext; + + /// The volume mounts for the container. Batch supports emptyDir, + /// hostPath, and secret volume types. For more + /// information about volumes and volume mounts in Kubernetes, see Volumes in + /// the Kubernetes documentation. + final List? volumeMounts; + + EksContainerDetail({ + this.args, + this.command, + this.env, + this.exitCode, + this.image, + this.imagePullPolicy, + this.name, + this.reason, + this.resources, + this.securityContext, + this.volumeMounts, + }); + + factory EksContainerDetail.fromJson(Map json) { + return EksContainerDetail( + args: (json['args'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + command: (json['command'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + env: (json['env'] as List?) + ?.whereNotNull() + .map((e) => EksContainerEnvironmentVariable.fromJson( + e as Map)) + .toList(), + exitCode: json['exitCode'] as int?, + image: json['image'] as String?, + imagePullPolicy: json['imagePullPolicy'] as String?, + name: json['name'] as String?, + reason: json['reason'] as String?, + resources: json['resources'] != null + ? EksContainerResourceRequirements.fromJson( + json['resources'] as Map) + : null, + securityContext: json['securityContext'] != null + ? EksContainerSecurityContext.fromJson( + json['securityContext'] as Map) + : null, + volumeMounts: (json['volumeMounts'] as List?) + ?.whereNotNull() + .map((e) => + EksContainerVolumeMount.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final path = this.path; + final args = this.args; + final command = this.command; + final env = this.env; + final exitCode = this.exitCode; + final image = this.image; + final imagePullPolicy = this.imagePullPolicy; + final name = this.name; + final reason = this.reason; + final resources = this.resources; + final securityContext = this.securityContext; + final volumeMounts = this.volumeMounts; return { - if (path != null) 'path': path, + if (args != null) 'args': args, + if (command != null) 'command': command, + if (env != null) 'env': env, + if (exitCode != null) 'exitCode': exitCode, + if (image != null) 'image': image, + if (imagePullPolicy != null) 'imagePullPolicy': imagePullPolicy, + if (name != null) 'name': name, + if (reason != null) 'reason': reason, + if (resources != null) 'resources': resources, + if (securityContext != null) 'securityContext': securityContext, + if (volumeMounts != null) 'volumeMounts': volumeMounts, }; } } -/// Describes and uniquely identifies Kubernetes resources. For example, the -/// compute environment that a pod runs in or the jobID for a job -/// running in the pod. For more information, see Understanding -/// Kubernetes Objects in the Kubernetes documentation. -class EksMetadata { - /// Key-value pairs used to identify, sort, and organize cube resources. Can - /// contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), - /// and underscores (_). Labels can be added or modified at any time. Each - /// resource can have multiple labels, but each key must be unique for a given - /// object. - final Map? labels; +/// An environment variable. +class EksContainerEnvironmentVariable { + /// The name of the environment variable. + final String name; - EksMetadata({ - this.labels, + /// The value of the environment variable. + final String? value; + + EksContainerEnvironmentVariable({ + required this.name, + this.value, }); - factory EksMetadata.fromJson(Map json) { - return EksMetadata( - labels: (json['labels'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory EksContainerEnvironmentVariable.fromJson(Map json) { + return EksContainerEnvironmentVariable( + name: json['name'] as String, + value: json['value'] as String?, ); } Map toJson() { - final labels = this.labels; + final name = this.name; + final value = this.value; return { - if (labels != null) 'labels': labels, + 'name': name, + if (value != null) 'value': value, }; } } -/// The properties for the pod. -class EksPodProperties { - /// The properties of the container that's used on the Amazon EKS pod. - final List? containers; - - /// The DNS policy for the pod. The default value is ClusterFirst. - /// If the hostNetwork parameter is not specified, the default is - /// ClusterFirstWithHostNet. ClusterFirst indicates - /// that any DNS query that does not match the configured cluster domain suffix - /// is forwarded to the upstream nameserver inherited from the node. For more +/// Object representing any Kubernetes overrides to a job definition that's used +/// in a SubmitJob +/// API operation. +class EksContainerOverride { + /// The arguments to the entrypoint to send to the container that overrides the + /// default arguments from the Docker image or the job definition. For more /// information, see Pod's - /// DNS policy in the Kubernetes documentation. - /// - /// Valid values: Default | ClusterFirst | - /// ClusterFirstWithHostNet - final String? dnsPolicy; + /// href="https://docs.docker.com/engine/reference/builder/#cmd">Dockerfile + /// reference: CMD and Define + /// a command an arguments for a pod in the Kubernetes documentation. + final List? args; - /// Indicates if the pod uses the hosts' network IP address. The default value - /// is true. Setting this to false enables the - /// Kubernetes pod networking model. Most Batch workloads are egress-only and - /// don't require the overhead of IP allocation for each pod for incoming - /// connections. For more information, see Host - /// namespaces and Pod - /// networking in the Kubernetes documentation. - final bool? hostNetwork; + /// The command to send to the container that overrides the default command from + /// the Docker image or the job definition. + final List? command; - /// Metadata about the Kubernetes pod. For more information, see Understanding - /// Kubernetes Objects in the Kubernetes documentation. - final EksMetadata? metadata; + /// The environment variables to send to the container. You can add new + /// environment variables, which are added to the container at launch. Or, you + /// can override the existing environment variables from the Docker image or the + /// job definition. + /// + /// Environment variables cannot start with "AWS_BATCH". This + /// naming convention is reserved for variables that Batch sets. + /// + final List? env; - /// The name of the service account that's used to run the pod. For more - /// information, see Kubernetes - /// service accounts and Configure - /// a Kubernetes service account to assume an IAM role in the Amazon EKS - /// User Guide and Configure - /// service accounts for pods in the Kubernetes documentation. - final String? serviceAccountName; + /// The override of the Docker image that's used to start the container. + final String? image; - /// Specifies the volumes for a job definition that uses Amazon EKS resources. - final List? volumes; + /// A pointer to the container that you want to override. The name must match a + /// unique container name that you wish to override. + final String? name; - EksPodProperties({ - this.containers, - this.dnsPolicy, - this.hostNetwork, - this.metadata, - this.serviceAccountName, - this.volumes, - }); + /// The type and amount of resources to assign to a container. These override + /// the settings in the job definition. The supported resources include + /// memory, cpu, and nvidia.com/gpu. For + /// more information, see Resource + /// management for pods and containers in the Kubernetes + /// documentation. + final EksContainerResourceRequirements? resources; - factory EksPodProperties.fromJson(Map json) { - return EksPodProperties( - containers: (json['containers'] as List?) - ?.whereNotNull() - .map((e) => EksContainer.fromJson(e as Map)) - .toList(), - dnsPolicy: json['dnsPolicy'] as String?, - hostNetwork: json['hostNetwork'] as bool?, - metadata: json['metadata'] != null - ? EksMetadata.fromJson(json['metadata'] as Map) - : null, - serviceAccountName: json['serviceAccountName'] as String?, - volumes: (json['volumes'] as List?) - ?.whereNotNull() - .map((e) => EksVolume.fromJson(e as Map)) - .toList(), - ); - } + EksContainerOverride({ + this.args, + this.command, + this.env, + this.image, + this.name, + this.resources, + }); Map toJson() { - final containers = this.containers; - final dnsPolicy = this.dnsPolicy; - final hostNetwork = this.hostNetwork; - final metadata = this.metadata; - final serviceAccountName = this.serviceAccountName; - final volumes = this.volumes; + final args = this.args; + final command = this.command; + final env = this.env; + final image = this.image; + final name = this.name; + final resources = this.resources; return { - if (containers != null) 'containers': containers, - if (dnsPolicy != null) 'dnsPolicy': dnsPolicy, - if (hostNetwork != null) 'hostNetwork': hostNetwork, - if (metadata != null) 'metadata': metadata, - if (serviceAccountName != null) 'serviceAccountName': serviceAccountName, - if (volumes != null) 'volumes': volumes, + if (args != null) 'args': args, + if (command != null) 'command': command, + if (env != null) 'env': env, + if (image != null) 'image': image, + if (name != null) 'name': name, + if (resources != null) 'resources': resources, }; } } -/// The details for the pod. -class EksPodPropertiesDetail { - /// The properties of the container that's used on the Amazon EKS pod. - final List? containers; - - /// The DNS policy for the pod. The default value is ClusterFirst. - /// If the hostNetwork parameter is not specified, the default is - /// ClusterFirstWithHostNet. ClusterFirst indicates - /// that any DNS query that does not match the configured cluster domain suffix - /// is forwarded to the upstream nameserver inherited from the node. If no value - /// was specified for dnsPolicy in the RegisterJobDefinition - /// API operation, then no value will be returned for dnsPolicy by - /// either of DescribeJobDefinitions - /// or DescribeJobs - /// API operations. The pod spec setting will contain either - /// ClusterFirst or ClusterFirstWithHostNet, depending - /// on the value of the hostNetwork parameter. For more - /// information, see Pod's - /// DNS policy in the Kubernetes documentation. - /// - /// Valid values: Default | ClusterFirst | - /// ClusterFirstWithHostNet - final String? dnsPolicy; - - /// Indicates if the pod uses the hosts' network IP address. The default value - /// is true. Setting this to false enables the - /// Kubernetes pod networking model. Most Batch workloads are egress-only and - /// don't require the overhead of IP allocation for each pod for incoming - /// connections. For more information, see Host - /// namespaces and Pod - /// networking in the Kubernetes documentation. - final bool? hostNetwork; - final EksMetadata? metadata; - - /// The name of the node for this job. - final String? nodeName; - - /// The name of the pod for this job. - final String? podName; - - /// The name of the service account that's used to run the pod. For more - /// information, see Kubernetes - /// service accounts and Configure - /// a Kubernetes service account to assume an IAM role in the Amazon EKS - /// User Guide and Configure - /// service accounts for pods in the Kubernetes documentation. - final String? serviceAccountName; +/// The type and amount of resources to assign to a container. The supported +/// resources include memory, cpu, and +/// nvidia.com/gpu. For more information, see Resource +/// management for pods and containers in the Kubernetes +/// documentation. +class EksContainerResourceRequirements { + /// The type and quantity of the resources to reserve for the container. The + /// values vary based on the name that's specified. Resources can + /// be requested using either the limits or the + /// requests objects. + ///
    memory
    + /// The memory hard limit (in MiB) for the container, using whole integers, with + /// a "Mi" suffix. If your container attempts to exceed the memory specified, + /// the container is terminated. You must specify at least 4 MiB of memory for a + /// job. memory can be specified in limits, + /// requests, or both. If memory is specified in both + /// places, then the value that's specified in limits must be equal + /// to the value that's specified in requests. + /// + /// To maximize your resource utilization, provide your jobs with as much memory + /// as possible for the specific instance type that you are using. To learn how, + /// see Memory + /// management in the Batch User Guide. + ///
    cpu
    + /// The number of CPUs that's reserved for the container. Values must be an even + /// multiple of 0.25. cpu can be specified in + /// limits, requests, or both. If cpu is + /// specified in both places, then the value that's specified in + /// limits must be at least as large as the value that's specified + /// in requests. + ///
    nvidia.com/gpu
    + /// The number of GPUs that's reserved for the container. Values must be a whole + /// integer. memory can be specified in limits, + /// requests, or both. If memory is specified in both + /// places, then the value that's specified in limits must be equal + /// to the value that's specified in requests. + ///
    + final Map? limits; - /// Specifies the volumes for a job definition using Amazon EKS resources. - final List? volumes; + /// The type and quantity of the resources to request for the container. The + /// values vary based on the name that's specified. Resources can + /// be requested by using either the limits or the + /// requests objects. + ///
    memory
    + /// The memory hard limit (in MiB) for the container, using whole integers, with + /// a "Mi" suffix. If your container attempts to exceed the memory specified, + /// the container is terminated. You must specify at least 4 MiB of memory for a + /// job. memory can be specified in limits, + /// requests, or both. If memory is specified in both, + /// then the value that's specified in limits must be equal to the + /// value that's specified in requests. + /// + /// If you're trying to maximize your resource utilization by providing your + /// jobs as much memory as possible for a particular instance type, see Memory + /// management in the Batch User Guide. + ///
    cpu
    + /// The number of CPUs that are reserved for the container. Values must be an + /// even multiple of 0.25. cpu can be specified in + /// limits, requests, or both. If cpu is + /// specified in both, then the value that's specified in limits + /// must be at least as large as the value that's specified in + /// requests. + ///
    nvidia.com/gpu
    + /// The number of GPUs that are reserved for the container. Values must be a + /// whole integer. nvidia.com/gpu can be specified in + /// limits, requests, or both. If + /// nvidia.com/gpu is specified in both, then the value that's + /// specified in limits must be equal to the value that's specified + /// in requests. + ///
    + final Map? requests; - EksPodPropertiesDetail({ - this.containers, - this.dnsPolicy, - this.hostNetwork, - this.metadata, - this.nodeName, - this.podName, - this.serviceAccountName, - this.volumes, + EksContainerResourceRequirements({ + this.limits, + this.requests, }); - factory EksPodPropertiesDetail.fromJson(Map json) { - return EksPodPropertiesDetail( - containers: (json['containers'] as List?) - ?.whereNotNull() - .map((e) => EksContainerDetail.fromJson(e as Map)) - .toList(), - dnsPolicy: json['dnsPolicy'] as String?, - hostNetwork: json['hostNetwork'] as bool?, - metadata: json['metadata'] != null - ? EksMetadata.fromJson(json['metadata'] as Map) - : null, - nodeName: json['nodeName'] as String?, - podName: json['podName'] as String?, - serviceAccountName: json['serviceAccountName'] as String?, - volumes: (json['volumes'] as List?) - ?.whereNotNull() - .map((e) => EksVolume.fromJson(e as Map)) - .toList(), + factory EksContainerResourceRequirements.fromJson(Map json) { + return EksContainerResourceRequirements( + limits: (json['limits'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + requests: (json['requests'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final containers = this.containers; - final dnsPolicy = this.dnsPolicy; - final hostNetwork = this.hostNetwork; - final metadata = this.metadata; - final nodeName = this.nodeName; - final podName = this.podName; - final serviceAccountName = this.serviceAccountName; - final volumes = this.volumes; + final limits = this.limits; + final requests = this.requests; return { - if (containers != null) 'containers': containers, - if (dnsPolicy != null) 'dnsPolicy': dnsPolicy, - if (hostNetwork != null) 'hostNetwork': hostNetwork, - if (metadata != null) 'metadata': metadata, - if (nodeName != null) 'nodeName': nodeName, - if (podName != null) 'podName': podName, - if (serviceAccountName != null) 'serviceAccountName': serviceAccountName, - if (volumes != null) 'volumes': volumes, + if (limits != null) 'limits': limits, + if (requests != null) 'requests': requests, }; } } -/// An object that contains overrides for the Kubernetes pod properties of a -/// job. -class EksPodPropertiesOverride { - /// The overrides for the container that's used on the Amazon EKS pod. - final List? containers; - - /// Metadata about the overrides for the container that's used on the Amazon EKS - /// pod. - final EksMetadata? metadata; - - EksPodPropertiesOverride({ - this.containers, - this.metadata, - }); +/// The security context for a job. For more information, see Configure +/// a security context for a pod or container in the Kubernetes +/// documentation. +class EksContainerSecurityContext { + /// Whether or not a container or a Kubernetes pod is allowed to gain more + /// privileges than its parent process. The default value is false. + final bool? allowPrivilegeEscalation; - Map toJson() { - final containers = this.containers; - final metadata = this.metadata; - return { - if (containers != null) 'containers': containers, - if (metadata != null) 'metadata': metadata, - }; - } -} + /// When this parameter is true, the container is given elevated + /// permissions on the host container instance. The level of permissions are + /// similar to the root user permissions. The default value is + /// false. This parameter maps to privileged policy in + /// the Privileged + /// pod security policies in the Kubernetes documentation. + final bool? privileged; -/// An object that contains the properties for the Kubernetes resources of a -/// job. -class EksProperties { - /// The properties for the Kubernetes pod resources of a job. - final EksPodProperties? podProperties; + /// When this parameter is true, the container is given read-only + /// access to its root file system. The default value is false. + /// This parameter maps to ReadOnlyRootFilesystem policy in the Volumes + /// and file systems pod security policies in the Kubernetes + /// documentation. + final bool? readOnlyRootFilesystem; - EksProperties({ - this.podProperties, - }); + /// When this parameter is specified, the container is run as the specified + /// group ID (gid). If this parameter isn't specified, the default + /// is the group that's specified in the image metadata. This parameter maps to + /// RunAsGroup and MustRunAs policy in the Users + /// and groups pod security policies in the Kubernetes documentation. + final int? runAsGroup; - factory EksProperties.fromJson(Map json) { - return EksProperties( - podProperties: json['podProperties'] != null - ? EksPodProperties.fromJson( - json['podProperties'] as Map) - : null, + /// When this parameter is specified, the container is run as a user with a + /// uid other than 0. If this parameter isn't specified, so such + /// rule is enforced. This parameter maps to RunAsUser and + /// MustRunAsNonRoot policy in the Users + /// and groups pod security policies in the Kubernetes documentation. + final bool? runAsNonRoot; + + /// When this parameter is specified, the container is run as the specified user + /// ID (uid). If this parameter isn't specified, the default is the + /// user that's specified in the image metadata. This parameter maps to + /// RunAsUser and MustRanAs policy in the Users + /// and groups pod security policies in the Kubernetes documentation. + final int? runAsUser; + + EksContainerSecurityContext({ + this.allowPrivilegeEscalation, + this.privileged, + this.readOnlyRootFilesystem, + this.runAsGroup, + this.runAsNonRoot, + this.runAsUser, + }); + + factory EksContainerSecurityContext.fromJson(Map json) { + return EksContainerSecurityContext( + allowPrivilegeEscalation: json['allowPrivilegeEscalation'] as bool?, + privileged: json['privileged'] as bool?, + readOnlyRootFilesystem: json['readOnlyRootFilesystem'] as bool?, + runAsGroup: json['runAsGroup'] as int?, + runAsNonRoot: json['runAsNonRoot'] as bool?, + runAsUser: json['runAsUser'] as int?, ); } Map toJson() { - final podProperties = this.podProperties; + final allowPrivilegeEscalation = this.allowPrivilegeEscalation; + final privileged = this.privileged; + final readOnlyRootFilesystem = this.readOnlyRootFilesystem; + final runAsGroup = this.runAsGroup; + final runAsNonRoot = this.runAsNonRoot; + final runAsUser = this.runAsUser; return { - if (podProperties != null) 'podProperties': podProperties, + if (allowPrivilegeEscalation != null) + 'allowPrivilegeEscalation': allowPrivilegeEscalation, + if (privileged != null) 'privileged': privileged, + if (readOnlyRootFilesystem != null) + 'readOnlyRootFilesystem': readOnlyRootFilesystem, + if (runAsGroup != null) 'runAsGroup': runAsGroup, + if (runAsNonRoot != null) 'runAsNonRoot': runAsNonRoot, + if (runAsUser != null) 'runAsUser': runAsUser, }; } } -/// An object that contains the details for the Kubernetes resources of a job. -class EksPropertiesDetail { - /// The properties for the Kubernetes pod resources of a job. - final EksPodPropertiesDetail? podProperties; +/// The volume mounts for a container for an Amazon EKS job. For more +/// information about volumes and volume mounts in Kubernetes, see Volumes in +/// the Kubernetes documentation. +class EksContainerVolumeMount { + /// The path on the container where the volume is mounted. + final String? mountPath; - EksPropertiesDetail({ - this.podProperties, + /// The name the volume mount. This must match the name of one of the volumes in + /// the pod. + final String? name; + + /// If this value is true, the container has read-only access to + /// the volume. Otherwise, the container can write to the volume. The default + /// value is false. + final bool? readOnly; + + EksContainerVolumeMount({ + this.mountPath, + this.name, + this.readOnly, }); - factory EksPropertiesDetail.fromJson(Map json) { - return EksPropertiesDetail( - podProperties: json['podProperties'] != null - ? EksPodPropertiesDetail.fromJson( - json['podProperties'] as Map) - : null, + factory EksContainerVolumeMount.fromJson(Map json) { + return EksContainerVolumeMount( + mountPath: json['mountPath'] as String?, + name: json['name'] as String?, + readOnly: json['readOnly'] as bool?, ); } Map toJson() { - final podProperties = this.podProperties; + final mountPath = this.mountPath; + final name = this.name; + final readOnly = this.readOnly; return { - if (podProperties != null) 'podProperties': podProperties, + if (mountPath != null) 'mountPath': mountPath, + if (name != null) 'name': name, + if (readOnly != null) 'readOnly': readOnly, }; } } -/// An object that contains overrides for the Kubernetes resources of a job. -class EksPropertiesOverride { - /// The overrides for the Kubernetes pod resources of a job. - final EksPodPropertiesOverride? podProperties; +/// Specifies the configuration of a Kubernetes emptyDir volume. An +/// emptyDir volume is first created when a pod is assigned to a +/// node. It exists as long as that pod is running on that node. The +/// emptyDir volume is initially empty. All containers in the pod +/// can read and write the files in the emptyDir volume. However, +/// the emptyDir volume can be mounted at the same or different +/// paths in each container. When a pod is removed from a node for any reason, +/// the data in the emptyDir is deleted permanently. For more +/// information, see emptyDir +/// in the Kubernetes documentation. +class EksEmptyDir { + /// The medium to store the volume. The default value is an empty string, which + /// uses the storage of the node. + ///
    ""
    + /// (Default) Use the disk storage of the node. + ///
    "Memory"
    + /// Use the tmpfs volume that's backed by the RAM of the node. + /// Contents of the volume are lost when the node reboots, and any storage on + /// the volume counts against the container's memory limit. + ///
    + final String? medium; - EksPropertiesOverride({ - this.podProperties, + /// The maximum size of the volume. By default, there's no maximum size defined. + final String? sizeLimit; + + EksEmptyDir({ + this.medium, + this.sizeLimit, }); + factory EksEmptyDir.fromJson(Map json) { + return EksEmptyDir( + medium: json['medium'] as String?, + sizeLimit: json['sizeLimit'] as String?, + ); + } + Map toJson() { - final podProperties = this.podProperties; + final medium = this.medium; + final sizeLimit = this.sizeLimit; return { - if (podProperties != null) 'podProperties': podProperties, + if (medium != null) 'medium': medium, + if (sizeLimit != null) 'sizeLimit': sizeLimit, }; } } -/// Specifies the configuration of a Kubernetes secret volume. For -/// more information, see secret +/// Specifies the configuration of a Kubernetes hostPath volume. A +/// hostPath volume mounts an existing file or directory from the +/// host node's filesystem into your pod. For more information, see hostPath /// in the Kubernetes documentation. -class EksSecret { - /// The name of the secret. The name must be allowed as a DNS subdomain name. - /// For more information, see DNS - /// subdomain names in the Kubernetes documentation. - final String secretName; - - /// Specifies whether the secret or the secret's keys must be defined. - final bool? optional; +class EksHostPath { + /// The path of the file or directory on the host to mount into containers on + /// the pod. + final String? path; - EksSecret({ - required this.secretName, - this.optional, + EksHostPath({ + this.path, }); - factory EksSecret.fromJson(Map json) { - return EksSecret( - secretName: json['secretName'] as String, - optional: json['optional'] as bool?, + factory EksHostPath.fromJson(Map json) { + return EksHostPath( + path: json['path'] as String?, ); } Map toJson() { - final secretName = this.secretName; - final optional = this.optional; + final path = this.path; return { - 'secretName': secretName, - if (optional != null) 'optional': optional, + if (path != null) 'path': path, }; } } -/// Specifies an Amazon EKS volume for a job definition. -class EksVolume { - /// The name of the volume. The name must be allowed as a DNS subdomain name. - /// For more information, see DNS - /// subdomain names in the Kubernetes documentation. - final String name; - - /// Specifies the configuration of a Kubernetes emptyDir volume. - /// For more information, see emptyDir - /// in the Kubernetes documentation. - final EksEmptyDir? emptyDir; - - /// Specifies the configuration of a Kubernetes hostPath volume. - /// For more information, see hostPath - /// in the Kubernetes documentation. - final EksHostPath? hostPath; - - /// Specifies the configuration of a Kubernetes secret volume. For - /// more information, see secret - /// in the Kubernetes documentation. - final EksSecret? secret; +/// Describes and uniquely identifies Kubernetes resources. For example, the +/// compute environment that a pod runs in or the jobID for a job +/// running in the pod. For more information, see Understanding +/// Kubernetes Objects in the Kubernetes documentation. +class EksMetadata { + /// Key-value pairs used to identify, sort, and organize cube resources. Can + /// contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), + /// and underscores (_). Labels can be added or modified at any time. Each + /// resource can have multiple labels, but each key must be unique for a given + /// object. + final Map? labels; - EksVolume({ - required this.name, - this.emptyDir, - this.hostPath, - this.secret, + EksMetadata({ + this.labels, }); - factory EksVolume.fromJson(Map json) { - return EksVolume( - name: json['name'] as String, - emptyDir: json['emptyDir'] != null - ? EksEmptyDir.fromJson(json['emptyDir'] as Map) - : null, - hostPath: json['hostPath'] != null - ? EksHostPath.fromJson(json['hostPath'] as Map) - : null, - secret: json['secret'] != null - ? EksSecret.fromJson(json['secret'] as Map) - : null, + factory EksMetadata.fromJson(Map json) { + return EksMetadata( + labels: (json['labels'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final name = this.name; - final emptyDir = this.emptyDir; - final hostPath = this.hostPath; - final secret = this.secret; + final labels = this.labels; return { - 'name': name, - if (emptyDir != null) 'emptyDir': emptyDir, - if (hostPath != null) 'hostPath': hostPath, - if (secret != null) 'secret': secret, + if (labels != null) 'labels': labels, }; } } -/// The amount of ephemeral storage to allocate for the task. This parameter is -/// used to expand the total amount of ephemeral storage available, beyond the -/// default amount, for tasks hosted on Fargate. -class EphemeralStorage { - /// The total amount, in GiB, of ephemeral storage to set for the task. The - /// minimum supported value is 21 GiB and the maximum supported - /// value is 200 GiB. - final int sizeInGiB; +/// The properties for the pod. +class EksPodProperties { + /// The properties of the container that's used on the Amazon EKS pod. + final List? containers; - EphemeralStorage({ - required this.sizeInGiB, - }); + /// The DNS policy for the pod. The default value is ClusterFirst. + /// If the hostNetwork parameter is not specified, the default is + /// ClusterFirstWithHostNet. ClusterFirst indicates + /// that any DNS query that does not match the configured cluster domain suffix + /// is forwarded to the upstream nameserver inherited from the node. For more + /// information, see Pod's + /// DNS policy in the Kubernetes documentation. + /// + /// Valid values: Default | ClusterFirst | + /// ClusterFirstWithHostNet + final String? dnsPolicy; - factory EphemeralStorage.fromJson(Map json) { - return EphemeralStorage( - sizeInGiB: json['sizeInGiB'] as int, - ); - } + /// Indicates if the pod uses the hosts' network IP address. The default value + /// is true. Setting this to false enables the + /// Kubernetes pod networking model. Most Batch workloads are egress-only and + /// don't require the overhead of IP allocation for each pod for incoming + /// connections. For more information, see Host + /// namespaces and Pod + /// networking in the Kubernetes documentation. + final bool? hostNetwork; - Map toJson() { - final sizeInGiB = this.sizeInGiB; - return { - 'sizeInGiB': sizeInGiB, - }; - } -} + /// References a Kubernetes secret resource. It holds a list of secrets. These + /// secrets help to gain access to pull an images from a private registry. + /// + /// ImagePullSecret$name is required when this object is used. + final List? imagePullSecrets; -/// Specifies an array of up to 5 conditions to be met, and an action to take -/// (RETRY or EXIT) if all conditions are met. If none -/// of the EvaluateOnExit conditions in a -/// RetryStrategy match, then the job is retried. -class EvaluateOnExit { - /// Specifies the action to take if all of the specified conditions - /// (onStatusReason, onReason, and - /// onExitCode) are met. The values aren't case sensitive. - final RetryAction action; + /// These containers run before application containers, always runs to + /// completion, and must complete successfully before the next container starts. + /// These containers are registered with the Amazon EKS Connector agent and + /// persists the registration information in the Kubernetes backend data store. + /// For more information, see Init + /// Containers in the Kubernetes documentation. + /// + /// This object is limited to 10 elements + /// + final List? initContainers; - /// Contains a glob pattern to match against the decimal representation of the - /// ExitCode returned for a job. The pattern can be up to 512 - /// characters long. It can contain only numbers, and can end with an asterisk - /// (*) so that only the start of the string needs to be an exact match. - /// - /// The string can contain up to 512 characters. - final String? onExitCode; + /// Metadata about the Kubernetes pod. For more information, see Understanding + /// Kubernetes Objects in the Kubernetes documentation. + final EksMetadata? metadata; - /// Contains a glob pattern to match against the Reason returned - /// for a job. The pattern can contain up to 512 characters. It can contain - /// letters, numbers, periods (.), colons (:), and white space (including spaces - /// and tabs). It can optionally end with an asterisk (*) so that only the start - /// of the string needs to be an exact match. - final String? onReason; + /// The name of the service account that's used to run the pod. For more + /// information, see Kubernetes + /// service accounts and Configure + /// a Kubernetes service account to assume an IAM role in the Amazon EKS + /// User Guide and Configure + /// service accounts for pods in the Kubernetes documentation. + final String? serviceAccountName; - /// Contains a glob pattern to match against the StatusReason - /// returned for a job. The pattern can contain up to 512 characters. It can - /// contain letters, numbers, periods (.), colons (:), and white spaces - /// (including spaces or tabs). It can optionally end with an asterisk (*) so - /// that only the start of the string needs to be an exact match. - final String? onStatusReason; + /// Indicates if the processes in a container are shared, or visible, to other + /// containers in the same pod. For more information, see Share + /// Process Namespace between Containers in a Pod. + final bool? shareProcessNamespace; - EvaluateOnExit({ - required this.action, - this.onExitCode, - this.onReason, - this.onStatusReason, + /// Specifies the volumes for a job definition that uses Amazon EKS resources. + final List? volumes; + + EksPodProperties({ + this.containers, + this.dnsPolicy, + this.hostNetwork, + this.imagePullSecrets, + this.initContainers, + this.metadata, + this.serviceAccountName, + this.shareProcessNamespace, + this.volumes, }); - factory EvaluateOnExit.fromJson(Map json) { - return EvaluateOnExit( - action: (json['action'] as String).toRetryAction(), - onExitCode: json['onExitCode'] as String?, - onReason: json['onReason'] as String?, - onStatusReason: json['onStatusReason'] as String?, + factory EksPodProperties.fromJson(Map json) { + return EksPodProperties( + containers: (json['containers'] as List?) + ?.whereNotNull() + .map((e) => EksContainer.fromJson(e as Map)) + .toList(), + dnsPolicy: json['dnsPolicy'] as String?, + hostNetwork: json['hostNetwork'] as bool?, + imagePullSecrets: (json['imagePullSecrets'] as List?) + ?.whereNotNull() + .map((e) => ImagePullSecret.fromJson(e as Map)) + .toList(), + initContainers: (json['initContainers'] as List?) + ?.whereNotNull() + .map((e) => EksContainer.fromJson(e as Map)) + .toList(), + metadata: json['metadata'] != null + ? EksMetadata.fromJson(json['metadata'] as Map) + : null, + serviceAccountName: json['serviceAccountName'] as String?, + shareProcessNamespace: json['shareProcessNamespace'] as bool?, + volumes: (json['volumes'] as List?) + ?.whereNotNull() + .map((e) => EksVolume.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final action = this.action; - final onExitCode = this.onExitCode; - final onReason = this.onReason; - final onStatusReason = this.onStatusReason; + final containers = this.containers; + final dnsPolicy = this.dnsPolicy; + final hostNetwork = this.hostNetwork; + final imagePullSecrets = this.imagePullSecrets; + final initContainers = this.initContainers; + final metadata = this.metadata; + final serviceAccountName = this.serviceAccountName; + final shareProcessNamespace = this.shareProcessNamespace; + final volumes = this.volumes; return { - 'action': action.toValue(), - if (onExitCode != null) 'onExitCode': onExitCode, - if (onReason != null) 'onReason': onReason, - if (onStatusReason != null) 'onStatusReason': onStatusReason, + if (containers != null) 'containers': containers, + if (dnsPolicy != null) 'dnsPolicy': dnsPolicy, + if (hostNetwork != null) 'hostNetwork': hostNetwork, + if (imagePullSecrets != null) 'imagePullSecrets': imagePullSecrets, + if (initContainers != null) 'initContainers': initContainers, + if (metadata != null) 'metadata': metadata, + if (serviceAccountName != null) 'serviceAccountName': serviceAccountName, + if (shareProcessNamespace != null) + 'shareProcessNamespace': shareProcessNamespace, + if (volumes != null) 'volumes': volumes, }; } } -/// The fair share policy for a scheduling policy. -class FairsharePolicy { - /// A value used to reserve some of the available maximum vCPU for fair share - /// identifiers that aren't already used. - /// - /// The reserved ratio is - /// (computeReservation/100)^ActiveFairShares where - /// ActiveFairShares is the number of active fair share - /// identifiers. - /// - /// For example, a computeReservation value of 50 indicates that - /// Batchreserves 50% of the maximum available vCPU if there's only one fair - /// share identifier. It reserves 25% if there are two fair share identifiers. - /// It reserves 12.5% if there are three fair share identifiers. A - /// computeReservation value of 25 indicates that Batch should - /// reserve 25% of the maximum available vCPU if there's only one fair share - /// identifier, 6.25% if there are two fair share identifiers, and 1.56% if - /// there are three fair share identifiers. +/// The details for the pod. +class EksPodPropertiesDetail { + /// The properties of the container that's used on the Amazon EKS pod. + final List? containers; + + /// The DNS policy for the pod. The default value is ClusterFirst. + /// If the hostNetwork parameter is not specified, the default is + /// ClusterFirstWithHostNet. ClusterFirst indicates + /// that any DNS query that does not match the configured cluster domain suffix + /// is forwarded to the upstream nameserver inherited from the node. If no value + /// was specified for dnsPolicy in the RegisterJobDefinition + /// API operation, then no value will be returned for dnsPolicy by + /// either of DescribeJobDefinitions + /// or DescribeJobs + /// API operations. The pod spec setting will contain either + /// ClusterFirst or ClusterFirstWithHostNet, depending + /// on the value of the hostNetwork parameter. For more + /// information, see Pod's + /// DNS policy in the Kubernetes documentation. /// - /// The minimum value is 0 and the maximum value is 99. - final int? computeReservation; + /// Valid values: Default | ClusterFirst | + /// ClusterFirstWithHostNet + final String? dnsPolicy; - /// The amount of time (in seconds) to use to calculate a fair share percentage - /// for each fair share identifier in use. A value of zero (0) indicates that - /// only current usage is measured. The decay allows for more recently run jobs - /// to have more weight than jobs that ran earlier. The maximum supported value - /// is 604800 (1 week). - final int? shareDecaySeconds; + /// Indicates if the pod uses the hosts' network IP address. The default value + /// is true. Setting this to false enables the + /// Kubernetes pod networking model. Most Batch workloads are egress-only and + /// don't require the overhead of IP allocation for each pod for incoming + /// connections. For more information, see Host + /// namespaces and Pod + /// networking in the Kubernetes documentation. + final bool? hostNetwork; - /// An array of SharedIdentifier objects that contain the weights - /// for the fair share identifiers for the fair share policy. Fair share - /// identifiers that aren't included have a default weight of 1.0. - final List? shareDistribution; + /// Displays the reference pointer to the Kubernetes secret resource. These + /// secrets help to gain access to pull an images from a private registry. + final List? imagePullSecrets; - FairsharePolicy({ - this.computeReservation, - this.shareDecaySeconds, - this.shareDistribution, - }); + /// The container registered with the Amazon EKS Connector agent and persists + /// the registration information in the Kubernetes backend data store. + final List? initContainers; - factory FairsharePolicy.fromJson(Map json) { - return FairsharePolicy( - computeReservation: json['computeReservation'] as int?, - shareDecaySeconds: json['shareDecaySeconds'] as int?, - shareDistribution: (json['shareDistribution'] as List?) - ?.whereNotNull() - .map((e) => ShareAttributes.fromJson(e as Map)) - .toList(), - ); - } + /// Describes and uniquely identifies Kubernetes resources. For example, the + /// compute environment that a pod runs in or the jobID for a job + /// running in the pod. For more information, see Understanding + /// Kubernetes Objects in the Kubernetes documentation. + final EksMetadata? metadata; - Map toJson() { - final computeReservation = this.computeReservation; - final shareDecaySeconds = this.shareDecaySeconds; - final shareDistribution = this.shareDistribution; - return { - if (computeReservation != null) 'computeReservation': computeReservation, - if (shareDecaySeconds != null) 'shareDecaySeconds': shareDecaySeconds, - if (shareDistribution != null) 'shareDistribution': shareDistribution, - }; - } -} + /// The name of the node for this job. + final String? nodeName; -/// The platform configuration for jobs that are running on Fargate resources. -/// Jobs that run on EC2 resources must not specify this parameter. -class FargatePlatformConfiguration { - /// The Fargate platform version where the jobs are running. A platform version - /// is specified only for jobs that are running on Fargate resources. If one - /// isn't specified, the LATEST platform version is used by - /// default. This uses a recent, approved version of the Fargate platform for - /// compute resources. For more information, see Fargate - /// platform versions in the Amazon Elastic Container Service Developer - /// Guide. - final String? platformVersion; + /// The name of the pod for this job. + final String? podName; - FargatePlatformConfiguration({ - this.platformVersion, + /// The name of the service account that's used to run the pod. For more + /// information, see Kubernetes + /// service accounts and Configure + /// a Kubernetes service account to assume an IAM role in the Amazon EKS + /// User Guide and Configure + /// service accounts for pods in the Kubernetes documentation. + final String? serviceAccountName; + + /// Indicates if the processes in a container are shared, or visible, to other + /// containers in the same pod. For more information, see Share + /// Process Namespace between Containers in a Pod. + final bool? shareProcessNamespace; + + /// Specifies the volumes for a job definition using Amazon EKS resources. + final List? volumes; + + EksPodPropertiesDetail({ + this.containers, + this.dnsPolicy, + this.hostNetwork, + this.imagePullSecrets, + this.initContainers, + this.metadata, + this.nodeName, + this.podName, + this.serviceAccountName, + this.shareProcessNamespace, + this.volumes, }); - factory FargatePlatformConfiguration.fromJson(Map json) { - return FargatePlatformConfiguration( - platformVersion: json['platformVersion'] as String?, + factory EksPodPropertiesDetail.fromJson(Map json) { + return EksPodPropertiesDetail( + containers: (json['containers'] as List?) + ?.whereNotNull() + .map((e) => EksContainerDetail.fromJson(e as Map)) + .toList(), + dnsPolicy: json['dnsPolicy'] as String?, + hostNetwork: json['hostNetwork'] as bool?, + imagePullSecrets: (json['imagePullSecrets'] as List?) + ?.whereNotNull() + .map((e) => ImagePullSecret.fromJson(e as Map)) + .toList(), + initContainers: (json['initContainers'] as List?) + ?.whereNotNull() + .map((e) => EksContainerDetail.fromJson(e as Map)) + .toList(), + metadata: json['metadata'] != null + ? EksMetadata.fromJson(json['metadata'] as Map) + : null, + nodeName: json['nodeName'] as String?, + podName: json['podName'] as String?, + serviceAccountName: json['serviceAccountName'] as String?, + shareProcessNamespace: json['shareProcessNamespace'] as bool?, + volumes: (json['volumes'] as List?) + ?.whereNotNull() + .map((e) => EksVolume.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final platformVersion = this.platformVersion; + final containers = this.containers; + final dnsPolicy = this.dnsPolicy; + final hostNetwork = this.hostNetwork; + final imagePullSecrets = this.imagePullSecrets; + final initContainers = this.initContainers; + final metadata = this.metadata; + final nodeName = this.nodeName; + final podName = this.podName; + final serviceAccountName = this.serviceAccountName; + final shareProcessNamespace = this.shareProcessNamespace; + final volumes = this.volumes; return { - if (platformVersion != null) 'platformVersion': platformVersion, + if (containers != null) 'containers': containers, + if (dnsPolicy != null) 'dnsPolicy': dnsPolicy, + if (hostNetwork != null) 'hostNetwork': hostNetwork, + if (imagePullSecrets != null) 'imagePullSecrets': imagePullSecrets, + if (initContainers != null) 'initContainers': initContainers, + if (metadata != null) 'metadata': metadata, + if (nodeName != null) 'nodeName': nodeName, + if (podName != null) 'podName': podName, + if (serviceAccountName != null) 'serviceAccountName': serviceAccountName, + if (shareProcessNamespace != null) + 'shareProcessNamespace': shareProcessNamespace, + if (volumes != null) 'volumes': volumes, }; } } -/// Determine whether your data volume persists on the host container instance -/// and where it's stored. If this parameter is empty, then the Docker daemon -/// assigns a host path for your data volume. However, the data isn't guaranteed -/// to persist after the containers that are associated with it stop running. -class Host { - /// The path on the host container instance that's presented to the container. - /// If this parameter is empty, then the Docker daemon has assigned a host path - /// for you. If this parameter contains a file location, then the data volume - /// persists at the specified location on the host container instance until you - /// delete it manually. If the source path location doesn't exist on the host - /// container instance, the Docker daemon creates it. If the location does - /// exist, the contents of the source path folder are exported. +/// An object that contains overrides for the Kubernetes pod properties of a +/// job. +class EksPodPropertiesOverride { + /// The overrides for the container that's used on the Amazon EKS pod. + final List? containers; + + /// The overrides for the conatainers defined in the Amazon EKS pod. These + /// containers run before application containers, always runs to completion, and + /// must complete successfully before the next container starts. These + /// containers are registered with the Amazon EKS Connector agent and persists + /// the registration information in the Kubernetes backend data store. For more + /// information, see Init + /// Containers in the Kubernetes documentation. /// - /// This parameter isn't applicable to jobs that run on Fargate resources. Don't - /// provide this for these jobs. + /// This object is limited to 10 elements /// - final String? sourcePath; + final List? initContainers; - Host({ - this.sourcePath, + /// Metadata about the overrides for the container that's used on the Amazon EKS + /// pod. + final EksMetadata? metadata; + + EksPodPropertiesOverride({ + this.containers, + this.initContainers, + this.metadata, }); - factory Host.fromJson(Map json) { - return Host( - sourcePath: json['sourcePath'] as String?, + Map toJson() { + final containers = this.containers; + final initContainers = this.initContainers; + final metadata = this.metadata; + return { + if (containers != null) 'containers': containers, + if (initContainers != null) 'initContainers': initContainers, + if (metadata != null) 'metadata': metadata, + }; + } +} + +/// An object that contains the properties for the Kubernetes resources of a +/// job. +class EksProperties { + /// The properties for the Kubernetes pod resources of a job. + final EksPodProperties? podProperties; + + EksProperties({ + this.podProperties, + }); + + factory EksProperties.fromJson(Map json) { + return EksProperties( + podProperties: json['podProperties'] != null + ? EksPodProperties.fromJson( + json['podProperties'] as Map) + : null, ); } Map toJson() { - final sourcePath = this.sourcePath; + final podProperties = this.podProperties; return { - if (sourcePath != null) 'sourcePath': sourcePath, + if (podProperties != null) 'podProperties': podProperties, }; } } -enum JQState { - enabled, - disabled, -} +/// An object that contains the details for the Kubernetes resources of a job. +class EksPropertiesDetail { + /// The properties for the Kubernetes pod resources of a job. + final EksPodPropertiesDetail? podProperties; -extension JQStateValueExtension on JQState { - String toValue() { - switch (this) { - case JQState.enabled: - return 'ENABLED'; - case JQState.disabled: - return 'DISABLED'; - } + EksPropertiesDetail({ + this.podProperties, + }); + + factory EksPropertiesDetail.fromJson(Map json) { + return EksPropertiesDetail( + podProperties: json['podProperties'] != null + ? EksPodPropertiesDetail.fromJson( + json['podProperties'] as Map) + : null, + ); } -} -extension JQStateFromString on String { - JQState toJQState() { - switch (this) { - case 'ENABLED': - return JQState.enabled; - case 'DISABLED': - return JQState.disabled; - } - throw Exception('$this is not known in enum JQState'); + Map toJson() { + final podProperties = this.podProperties; + return { + if (podProperties != null) 'podProperties': podProperties, + }; } } -enum JQStatus { - creating, - updating, - deleting, - deleted, - valid, - invalid, -} +/// An object that contains overrides for the Kubernetes resources of a job. +class EksPropertiesOverride { + /// The overrides for the Kubernetes pod resources of a job. + final EksPodPropertiesOverride? podProperties; -extension JQStatusValueExtension on JQStatus { - String toValue() { - switch (this) { - case JQStatus.creating: - return 'CREATING'; - case JQStatus.updating: - return 'UPDATING'; - case JQStatus.deleting: - return 'DELETING'; - case JQStatus.deleted: - return 'DELETED'; - case JQStatus.valid: - return 'VALID'; - case JQStatus.invalid: - return 'INVALID'; - } - } -} + EksPropertiesOverride({ + this.podProperties, + }); -extension JQStatusFromString on String { - JQStatus toJQStatus() { - switch (this) { - case 'CREATING': - return JQStatus.creating; - case 'UPDATING': - return JQStatus.updating; - case 'DELETING': - return JQStatus.deleting; - case 'DELETED': - return JQStatus.deleted; - case 'VALID': - return JQStatus.valid; - case 'INVALID': - return JQStatus.invalid; - } - throw Exception('$this is not known in enum JQStatus'); + Map toJson() { + final podProperties = this.podProperties; + return { + if (podProperties != null) 'podProperties': podProperties, + }; } } -/// An object that represents an Batch job definition. -class JobDefinition { - /// The Amazon Resource Name (ARN) for the job definition. - final String jobDefinitionArn; - - /// The name of the job definition. - final String jobDefinitionName; +/// Specifies the configuration of a Kubernetes secret volume. For +/// more information, see secret +/// in the Kubernetes documentation. +class EksSecret { + /// The name of the secret. The name must be allowed as a DNS subdomain name. + /// For more information, see DNS + /// subdomain names in the Kubernetes documentation. + final String secretName; - /// The revision of the job definition. - final int revision; + /// Specifies whether the secret or the secret's keys must be defined. + final bool? optional; - /// The type of job definition. It's either container or - /// multinode. If the job is run on Fargate resources, then - /// multinode isn't supported. For more information about - /// multi-node parallel jobs, see Creating - /// a multi-node parallel job definition in the Batch User Guide. - final String type; - - /// The orchestration type of the compute environment. The valid values are - /// ECS (default) or EKS. - final OrchestrationType? containerOrchestrationType; - - /// An object with various properties specific to Amazon ECS based jobs. Valid - /// values are containerProperties, eksProperties, and - /// nodeProperties. Only one can be specified. - final ContainerProperties? containerProperties; - - /// An object with various properties that are specific to Amazon EKS based - /// jobs. Valid values are containerProperties, - /// eksProperties, and nodeProperties. Only one can be - /// specified. - final EksProperties? eksProperties; - - /// An object with various properties that are specific to multi-node parallel - /// jobs. Valid values are containerProperties, - /// eksProperties, and nodeProperties. Only one can be - /// specified. - /// - /// If the job runs on Fargate resources, don't specify - /// nodeProperties. Use containerProperties instead. - /// - final NodeProperties? nodeProperties; - - /// Default parameters or parameter substitution placeholders that are set in - /// the job definition. Parameters are specified as a key-value pair mapping. - /// Parameters in a SubmitJob request override any corresponding - /// parameter defaults from the job definition. For more information about - /// specifying parameters, see Job - /// definition parameters in the Batch User Guide. - final Map? parameters; - - /// The platform capabilities required by the job definition. If no value is - /// specified, it defaults to EC2. Jobs run on Fargate resources - /// specify FARGATE. - final List? platformCapabilities; + EksSecret({ + required this.secretName, + this.optional, + }); - /// Specifies whether to propagate the tags from the job or job definition to - /// the corresponding Amazon ECS task. If no value is specified, the tags aren't - /// propagated. Tags can only be propagated to the tasks when the tasks are - /// created. For tags with the same name, job tags are given priority over job - /// definitions tags. If the total number of combined tags from the job and job - /// definition is over 50, the job is moved to the FAILED state. - final bool? propagateTags; + factory EksSecret.fromJson(Map json) { + return EksSecret( + secretName: json['secretName'] as String, + optional: json['optional'] as bool?, + ); + } - /// The retry strategy to use for failed jobs that are submitted with this job - /// definition. - final RetryStrategy? retryStrategy; + Map toJson() { + final secretName = this.secretName; + final optional = this.optional; + return { + 'secretName': secretName, + if (optional != null) 'optional': optional, + }; + } +} - /// The scheduling priority of the job definition. This only affects jobs in job - /// queues with a fair share policy. Jobs with a higher scheduling priority are - /// scheduled before jobs with a lower scheduling priority. - final int? schedulingPriority; +/// Specifies an Amazon EKS volume for a job definition. +class EksVolume { + /// The name of the volume. The name must be allowed as a DNS subdomain name. + /// For more information, see DNS + /// subdomain names in the Kubernetes documentation. + final String name; - /// The status of the job definition. - final String? status; + /// Specifies the configuration of a Kubernetes emptyDir volume. + /// For more information, see emptyDir + /// in the Kubernetes documentation. + final EksEmptyDir? emptyDir; - /// The tags that are applied to the job definition. - final Map? tags; + /// Specifies the configuration of a Kubernetes hostPath volume. + /// For more information, see hostPath + /// in the Kubernetes documentation. + final EksHostPath? hostPath; - /// The timeout time for jobs that are submitted with this job definition. After - /// the amount of time you specify passes, Batch terminates your jobs if they - /// aren't finished. - final JobTimeout? timeout; + /// Specifies the configuration of a Kubernetes secret volume. For + /// more information, see secret + /// in the Kubernetes documentation. + final EksSecret? secret; - JobDefinition({ - required this.jobDefinitionArn, - required this.jobDefinitionName, - required this.revision, - required this.type, - this.containerOrchestrationType, - this.containerProperties, - this.eksProperties, - this.nodeProperties, - this.parameters, - this.platformCapabilities, - this.propagateTags, - this.retryStrategy, - this.schedulingPriority, - this.status, - this.tags, - this.timeout, + EksVolume({ + required this.name, + this.emptyDir, + this.hostPath, + this.secret, }); - factory JobDefinition.fromJson(Map json) { - return JobDefinition( - jobDefinitionArn: json['jobDefinitionArn'] as String, - jobDefinitionName: json['jobDefinitionName'] as String, - revision: json['revision'] as int, - type: json['type'] as String, - containerOrchestrationType: - (json['containerOrchestrationType'] as String?) - ?.toOrchestrationType(), - containerProperties: json['containerProperties'] != null - ? ContainerProperties.fromJson( - json['containerProperties'] as Map) - : null, - eksProperties: json['eksProperties'] != null - ? EksProperties.fromJson( - json['eksProperties'] as Map) - : null, - nodeProperties: json['nodeProperties'] != null - ? NodeProperties.fromJson( - json['nodeProperties'] as Map) + factory EksVolume.fromJson(Map json) { + return EksVolume( + name: json['name'] as String, + emptyDir: json['emptyDir'] != null + ? EksEmptyDir.fromJson(json['emptyDir'] as Map) : null, - parameters: (json['parameters'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - platformCapabilities: (json['platformCapabilities'] as List?) - ?.whereNotNull() - .map((e) => (e as String).toPlatformCapability()) - .toList(), - propagateTags: json['propagateTags'] as bool?, - retryStrategy: json['retryStrategy'] != null - ? RetryStrategy.fromJson( - json['retryStrategy'] as Map) + hostPath: json['hostPath'] != null + ? EksHostPath.fromJson(json['hostPath'] as Map) : null, - schedulingPriority: json['schedulingPriority'] as int?, - status: json['status'] as String?, - tags: (json['tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - timeout: json['timeout'] != null - ? JobTimeout.fromJson(json['timeout'] as Map) + secret: json['secret'] != null + ? EksSecret.fromJson(json['secret'] as Map) : null, ); } Map toJson() { - final jobDefinitionArn = this.jobDefinitionArn; - final jobDefinitionName = this.jobDefinitionName; - final revision = this.revision; - final type = this.type; - final containerOrchestrationType = this.containerOrchestrationType; - final containerProperties = this.containerProperties; - final eksProperties = this.eksProperties; - final nodeProperties = this.nodeProperties; - final parameters = this.parameters; - final platformCapabilities = this.platformCapabilities; - final propagateTags = this.propagateTags; - final retryStrategy = this.retryStrategy; - final schedulingPriority = this.schedulingPriority; - final status = this.status; - final tags = this.tags; - final timeout = this.timeout; + final name = this.name; + final emptyDir = this.emptyDir; + final hostPath = this.hostPath; + final secret = this.secret; return { - 'jobDefinitionArn': jobDefinitionArn, - 'jobDefinitionName': jobDefinitionName, - 'revision': revision, - 'type': type, - if (containerOrchestrationType != null) - 'containerOrchestrationType': containerOrchestrationType.toValue(), - if (containerProperties != null) - 'containerProperties': containerProperties, - if (eksProperties != null) 'eksProperties': eksProperties, - if (nodeProperties != null) 'nodeProperties': nodeProperties, - if (parameters != null) 'parameters': parameters, - if (platformCapabilities != null) - 'platformCapabilities': - platformCapabilities.map((e) => e.toValue()).toList(), - if (propagateTags != null) 'propagateTags': propagateTags, - if (retryStrategy != null) 'retryStrategy': retryStrategy, - if (schedulingPriority != null) 'schedulingPriority': schedulingPriority, - if (status != null) 'status': status, - if (tags != null) 'tags': tags, - if (timeout != null) 'timeout': timeout, + 'name': name, + if (emptyDir != null) 'emptyDir': emptyDir, + if (hostPath != null) 'hostPath': hostPath, + if (secret != null) 'secret': secret, }; } } -enum JobDefinitionType { - container, - multinode, -} +/// The amount of ephemeral storage to allocate for the task. This parameter is +/// used to expand the total amount of ephemeral storage available, beyond the +/// default amount, for tasks hosted on Fargate. +class EphemeralStorage { + /// The total amount, in GiB, of ephemeral storage to set for the task. The + /// minimum supported value is 21 GiB and the maximum supported + /// value is 200 GiB. + final int sizeInGiB; -extension JobDefinitionTypeValueExtension on JobDefinitionType { - String toValue() { - switch (this) { - case JobDefinitionType.container: - return 'container'; - case JobDefinitionType.multinode: - return 'multinode'; - } + EphemeralStorage({ + required this.sizeInGiB, + }); + + factory EphemeralStorage.fromJson(Map json) { + return EphemeralStorage( + sizeInGiB: json['sizeInGiB'] as int, + ); } -} -extension JobDefinitionTypeFromString on String { - JobDefinitionType toJobDefinitionType() { - switch (this) { - case 'container': - return JobDefinitionType.container; - case 'multinode': - return JobDefinitionType.multinode; - } - throw Exception('$this is not known in enum JobDefinitionType'); + Map toJson() { + final sizeInGiB = this.sizeInGiB; + return { + 'sizeInGiB': sizeInGiB, + }; } } -/// An object that represents an Batch job dependency. -class JobDependency { - /// The job ID of the Batch job that's associated with this dependency. - final String? jobId; +/// Specifies an array of up to 5 conditions to be met, and an action to take +/// (RETRY or EXIT) if all conditions are met. If none +/// of the EvaluateOnExit conditions in a +/// RetryStrategy match, then the job is retried. +class EvaluateOnExit { + /// Specifies the action to take if all of the specified conditions + /// (onStatusReason, onReason, and + /// onExitCode) are met. The values aren't case sensitive. + final RetryAction action; - /// The type of the job dependency. - final ArrayJobDependency? type; + /// Contains a glob pattern to match against the decimal representation of the + /// ExitCode returned for a job. The pattern can be up to 512 + /// characters long. It can contain only numbers, and can end with an asterisk + /// (*) so that only the start of the string needs to be an exact match. + /// + /// The string can contain up to 512 characters. + final String? onExitCode; - JobDependency({ - this.jobId, - this.type, + /// Contains a glob pattern to match against the Reason returned + /// for a job. The pattern can contain up to 512 characters. It can contain + /// letters, numbers, periods (.), colons (:), and white space (including spaces + /// and tabs). It can optionally end with an asterisk (*) so that only the start + /// of the string needs to be an exact match. + final String? onReason; + + /// Contains a glob pattern to match against the StatusReason + /// returned for a job. The pattern can contain up to 512 characters. It can + /// contain letters, numbers, periods (.), colons (:), and white spaces + /// (including spaces or tabs). It can optionally end with an asterisk (*) so + /// that only the start of the string needs to be an exact match. + final String? onStatusReason; + + EvaluateOnExit({ + required this.action, + this.onExitCode, + this.onReason, + this.onStatusReason, }); - factory JobDependency.fromJson(Map json) { - return JobDependency( - jobId: json['jobId'] as String?, - type: (json['type'] as String?)?.toArrayJobDependency(), + factory EvaluateOnExit.fromJson(Map json) { + return EvaluateOnExit( + action: (json['action'] as String).toRetryAction(), + onExitCode: json['onExitCode'] as String?, + onReason: json['onReason'] as String?, + onStatusReason: json['onStatusReason'] as String?, ); } Map toJson() { - final jobId = this.jobId; - final type = this.type; + final action = this.action; + final onExitCode = this.onExitCode; + final onReason = this.onReason; + final onStatusReason = this.onStatusReason; return { - if (jobId != null) 'jobId': jobId, - if (type != null) 'type': type.toValue(), + 'action': action.toValue(), + if (onExitCode != null) 'onExitCode': onExitCode, + if (onReason != null) 'onReason': onReason, + if (onStatusReason != null) 'onStatusReason': onStatusReason, }; } } -/// An object that represents an Batch job. -class JobDetail { - /// The Amazon Resource Name (ARN) of the job definition that this job uses. - final String jobDefinition; +/// The fair share policy for a scheduling policy. +class FairsharePolicy { + /// A value used to reserve some of the available maximum vCPU for fair share + /// identifiers that aren't already used. + /// + /// The reserved ratio is + /// (computeReservation/100)^ActiveFairShares where + /// ActiveFairShares is the number of active fair share + /// identifiers. + /// + /// For example, a computeReservation value of 50 indicates that + /// Batch reserves 50% of the maximum available vCPU if there's only one fair + /// share identifier. It reserves 25% if there are two fair share identifiers. + /// It reserves 12.5% if there are three fair share identifiers. A + /// computeReservation value of 25 indicates that Batch should + /// reserve 25% of the maximum available vCPU if there's only one fair share + /// identifier, 6.25% if there are two fair share identifiers, and 1.56% if + /// there are three fair share identifiers. + /// + /// The minimum value is 0 and the maximum value is 99. + final int? computeReservation; - /// The job ID. - final String jobId; + /// The amount of time (in seconds) to use to calculate a fair share percentage + /// for each fair share identifier in use. A value of zero (0) indicates that + /// only current usage is measured. The decay allows for more recently run jobs + /// to have more weight than jobs that ran earlier. The maximum supported value + /// is 604800 (1 week). + final int? shareDecaySeconds; - /// The job name. - final String jobName; + /// An array of SharedIdentifier objects that contain the weights + /// for the fair share identifiers for the fair share policy. Fair share + /// identifiers that aren't included have a default weight of 1.0. + final List? shareDistribution; - /// The Amazon Resource Name (ARN) of the job queue that the job is associated - /// with. - final String jobQueue; + FairsharePolicy({ + this.computeReservation, + this.shareDecaySeconds, + this.shareDistribution, + }); - /// The Unix timestamp (in milliseconds) for when the job was started. More - /// specifically, it's when the job transitioned from the STARTING - /// state to the RUNNING state. This parameter isn't provided for - /// child jobs of array jobs or multi-node parallel jobs. - final int startedAt; + factory FairsharePolicy.fromJson(Map json) { + return FairsharePolicy( + computeReservation: json['computeReservation'] as int?, + shareDecaySeconds: json['shareDecaySeconds'] as int?, + shareDistribution: (json['shareDistribution'] as List?) + ?.whereNotNull() + .map((e) => ShareAttributes.fromJson(e as Map)) + .toList(), + ); + } - /// The current status for the job. - /// - /// If your jobs don't progress to STARTING, see Jobs - /// stuck in RUNNABLE status in the troubleshooting section of the Batch - /// User Guide. - /// - final JobStatus status; + Map toJson() { + final computeReservation = this.computeReservation; + final shareDecaySeconds = this.shareDecaySeconds; + final shareDistribution = this.shareDistribution; + return { + if (computeReservation != null) 'computeReservation': computeReservation, + if (shareDecaySeconds != null) 'shareDecaySeconds': shareDecaySeconds, + if (shareDistribution != null) 'shareDistribution': shareDistribution, + }; + } +} - /// The array properties of the job, if it's an array job. - final ArrayPropertiesDetail? arrayProperties; +/// The platform configuration for jobs that are running on Fargate resources. +/// Jobs that run on Amazon EC2 resources must not specify this parameter. +class FargatePlatformConfiguration { + /// The Fargate platform version where the jobs are running. A platform version + /// is specified only for jobs that are running on Fargate resources. If one + /// isn't specified, the LATEST platform version is used by + /// default. This uses a recent, approved version of the Fargate platform for + /// compute resources. For more information, see Fargate + /// platform versions in the Amazon Elastic Container Service Developer + /// Guide. + final String? platformVersion; - /// A list of job attempts that are associated with this job. - final List? attempts; + FargatePlatformConfiguration({ + this.platformVersion, + }); - /// An object that represents the details for the container that's associated - /// with the job. - final ContainerDetail? container; + factory FargatePlatformConfiguration.fromJson(Map json) { + return FargatePlatformConfiguration( + platformVersion: json['platformVersion'] as String?, + ); + } - /// The Unix timestamp (in milliseconds) for when the job was created. For - /// non-array jobs and parent array jobs, this is when the job entered the - /// SUBMITTED state. This is specifically at the time - /// SubmitJob was called. For array child jobs, this is when the child - /// job was spawned by its parent and entered the PENDING state. - final int? createdAt; + Map toJson() { + final platformVersion = this.platformVersion; + return { + if (platformVersion != null) 'platformVersion': platformVersion, + }; + } +} - /// A list of job IDs that this job depends on. - final List? dependsOn; +/// Contains a list of the first 100 RUNNABLE jobs associated to a +/// single job queue. +class FrontOfQueueDetail { + /// The Amazon Resource Names (ARNs) of the first 100 RUNNABLE jobs + /// in a named job queue. For first-in-first-out (FIFO) job queues, jobs are + /// ordered based on their submission time. For fair share scheduling (FSS) job + /// queues, jobs are ordered based on their job priority and share usage. + final List? jobs; - /// A list of job attempts that are associated with this job. - final List? eksAttempts; + /// The Unix timestamp (in milliseconds) for when each of the first 100 + /// RUNNABLE jobs were last updated. + final int? lastUpdatedAt; - /// An object with various properties that are specific to Amazon EKS based - /// jobs. Only one of container, eksProperties, or - /// nodeDetails is specified. - final EksPropertiesDetail? eksProperties; + FrontOfQueueDetail({ + this.jobs, + this.lastUpdatedAt, + }); - /// Indicates whether the job is canceled. - final bool? isCancelled; + factory FrontOfQueueDetail.fromJson(Map json) { + return FrontOfQueueDetail( + jobs: (json['jobs'] as List?) + ?.whereNotNull() + .map( + (e) => FrontOfQueueJobSummary.fromJson(e as Map)) + .toList(), + lastUpdatedAt: json['lastUpdatedAt'] as int?, + ); + } - /// Indicates whether the job is terminated. - final bool? isTerminated; + Map toJson() { + final jobs = this.jobs; + final lastUpdatedAt = this.lastUpdatedAt; + return { + if (jobs != null) 'jobs': jobs, + if (lastUpdatedAt != null) 'lastUpdatedAt': lastUpdatedAt, + }; + } +} - /// The Amazon Resource Name (ARN) of the job. - final String? jobArn; +/// An object that represents summary details for the first 100 +/// RUNNABLE jobs in a job queue. +class FrontOfQueueJobSummary { + /// The Unix timestamp (in milliseconds) for when the job transitioned to its + /// current position in the job queue. + final int? earliestTimeAtPosition; - /// An object that represents the details of a node that's associated with a - /// multi-node parallel job. - final NodeDetails? nodeDetails; + /// The ARN for a job in a named job queue. + final String? jobArn; - /// An object that represents the node properties of a multi-node parallel job. - /// - /// This isn't applicable to jobs that are running on Fargate resources. - /// - final NodeProperties? nodeProperties; + FrontOfQueueJobSummary({ + this.earliestTimeAtPosition, + this.jobArn, + }); - /// Additional parameters that are passed to the job that replace parameter - /// substitution placeholders or override any corresponding parameter defaults - /// from the job definition. - final Map? parameters; + factory FrontOfQueueJobSummary.fromJson(Map json) { + return FrontOfQueueJobSummary( + earliestTimeAtPosition: json['earliestTimeAtPosition'] as int?, + jobArn: json['jobArn'] as String?, + ); + } - /// The platform capabilities required by the job definition. If no value is - /// specified, it defaults to EC2. Jobs run on Fargate resources - /// specify FARGATE. - final List? platformCapabilities; + Map toJson() { + final earliestTimeAtPosition = this.earliestTimeAtPosition; + final jobArn = this.jobArn; + return { + if (earliestTimeAtPosition != null) + 'earliestTimeAtPosition': earliestTimeAtPosition, + if (jobArn != null) 'jobArn': jobArn, + }; + } +} - /// Specifies whether to propagate the tags from the job or job definition to - /// the corresponding Amazon ECS task. If no value is specified, the tags aren't - /// propagated. Tags can only be propagated to the tasks when the tasks are - /// created. For tags with the same name, job tags are given priority over job - /// definitions tags. If the total number of combined tags from the job and job - /// definition is over 50, the job is moved to the FAILED state. - final bool? propagateTags; +class GetJobQueueSnapshotResponse { + /// The list of the first 100 RUNNABLE jobs in each job queue. For + /// first-in-first-out (FIFO) job queues, jobs are ordered based on their + /// submission time. For fair share scheduling (FSS) job queues, jobs are + /// ordered based on their job priority and share usage. + final FrontOfQueueDetail? frontOfQueue; - /// The retry strategy to use for this job if an attempt fails. - final RetryStrategy? retryStrategy; + GetJobQueueSnapshotResponse({ + this.frontOfQueue, + }); - /// The scheduling policy of the job definition. This only affects jobs in job - /// queues with a fair share policy. Jobs with a higher scheduling priority are - /// scheduled before jobs with a lower scheduling priority. - final int? schedulingPriority; + factory GetJobQueueSnapshotResponse.fromJson(Map json) { + return GetJobQueueSnapshotResponse( + frontOfQueue: json['frontOfQueue'] != null + ? FrontOfQueueDetail.fromJson( + json['frontOfQueue'] as Map) + : null, + ); + } - /// The share identifier for the job. - final String? shareIdentifier; + Map toJson() { + final frontOfQueue = this.frontOfQueue; + return { + if (frontOfQueue != null) 'frontOfQueue': frontOfQueue, + }; + } +} - /// A short, human-readable string to provide more details for the current - /// status of the job. - final String? statusReason; +/// Determine whether your data volume persists on the host container instance +/// and where it's stored. If this parameter is empty, then the Docker daemon +/// assigns a host path for your data volume. However, the data isn't guaranteed +/// to persist after the containers that are associated with it stop running. +class Host { + /// The path on the host container instance that's presented to the container. + /// If this parameter is empty, then the Docker daemon has assigned a host path + /// for you. If this parameter contains a file location, then the data volume + /// persists at the specified location on the host container instance until you + /// delete it manually. If the source path location doesn't exist on the host + /// container instance, the Docker daemon creates it. If the location does + /// exist, the contents of the source path folder are exported. + /// + /// This parameter isn't applicable to jobs that run on Fargate resources. Don't + /// provide this for these jobs. + /// + final String? sourcePath; - /// The Unix timestamp (in milliseconds) for when the job was stopped. More - /// specifically, it's when the job transitioned from the RUNNING - /// state to a terminal state, such as SUCCEEDED or - /// FAILED. - final int? stoppedAt; + Host({ + this.sourcePath, + }); - /// The tags that are applied to the job. + factory Host.fromJson(Map json) { + return Host( + sourcePath: json['sourcePath'] as String?, + ); + } + + Map toJson() { + final sourcePath = this.sourcePath; + return { + if (sourcePath != null) 'sourcePath': sourcePath, + }; + } +} + +/// References a Kubernetes secret resource. This name of the secret must start +/// and end with an alphanumeric character, is required to be lowercase, can +/// include periods (.) and hyphens (-), and can't contain more than 253 +/// characters. +class ImagePullSecret { + /// Provides a unique identifier for the ImagePullSecret. This + /// object is required when EksPodProperties$imagePullSecrets is + /// used. + final String name; + + ImagePullSecret({ + required this.name, + }); + + factory ImagePullSecret.fromJson(Map json) { + return ImagePullSecret( + name: json['name'] as String, + ); + } + + Map toJson() { + final name = this.name; + return { + 'name': name, + }; + } +} + +enum JQState { + enabled, + disabled, +} + +extension JQStateValueExtension on JQState { + String toValue() { + switch (this) { + case JQState.enabled: + return 'ENABLED'; + case JQState.disabled: + return 'DISABLED'; + } + } +} + +extension JQStateFromString on String { + JQState toJQState() { + switch (this) { + case 'ENABLED': + return JQState.enabled; + case 'DISABLED': + return JQState.disabled; + } + throw Exception('$this is not known in enum JQState'); + } +} + +enum JQStatus { + creating, + updating, + deleting, + deleted, + valid, + invalid, +} + +extension JQStatusValueExtension on JQStatus { + String toValue() { + switch (this) { + case JQStatus.creating: + return 'CREATING'; + case JQStatus.updating: + return 'UPDATING'; + case JQStatus.deleting: + return 'DELETING'; + case JQStatus.deleted: + return 'DELETED'; + case JQStatus.valid: + return 'VALID'; + case JQStatus.invalid: + return 'INVALID'; + } + } +} + +extension JQStatusFromString on String { + JQStatus toJQStatus() { + switch (this) { + case 'CREATING': + return JQStatus.creating; + case 'UPDATING': + return JQStatus.updating; + case 'DELETING': + return JQStatus.deleting; + case 'DELETED': + return JQStatus.deleted; + case 'VALID': + return JQStatus.valid; + case 'INVALID': + return JQStatus.invalid; + } + throw Exception('$this is not known in enum JQStatus'); + } +} + +/// An object that represents an Batch job definition. +class JobDefinition { + /// The Amazon Resource Name (ARN) for the job definition. + final String jobDefinitionArn; + + /// The name of the job definition. + final String jobDefinitionName; + + /// The revision of the job definition. + final int revision; + + /// The type of job definition. It's either container or + /// multinode. If the job is run on Fargate resources, then + /// multinode isn't supported. For more information about + /// multi-node parallel jobs, see Creating + /// a multi-node parallel job definition in the Batch User Guide. + final String type; + + /// The orchestration type of the compute environment. The valid values are + /// ECS (default) or EKS. + final OrchestrationType? containerOrchestrationType; + + /// An object with properties specific to Amazon ECS-based jobs. When + /// containerProperties is used in the job definition, it can't be + /// used in addition to eksProperties, ecsProperties, + /// or nodeProperties. + final ContainerProperties? containerProperties; + + /// An object that contains the properties for the Amazon ECS resources of a + /// job.When ecsProperties is used in the job definition, it can't + /// be used in addition to containerProperties, + /// eksProperties, or nodeProperties. + final EcsProperties? ecsProperties; + + /// An object with properties that are specific to Amazon EKS-based jobs. When + /// eksProperties is used in the job definition, it can't be used + /// in addition to containerProperties, ecsProperties, + /// or nodeProperties. + final EksProperties? eksProperties; + + /// An object with properties that are specific to multi-node parallel jobs. + /// When nodeProperties is used in the job definition, it can't be + /// used in addition to containerProperties, + /// ecsProperties, or eksProperties. + /// + /// If the job runs on Fargate resources, don't specify + /// nodeProperties. Use containerProperties instead. + /// + final NodeProperties? nodeProperties; + + /// Default parameters or parameter substitution placeholders that are set in + /// the job definition. Parameters are specified as a key-value pair mapping. + /// Parameters in a SubmitJob request override any corresponding + /// parameter defaults from the job definition. For more information about + /// specifying parameters, see Job + /// definition parameters in the Batch User Guide. + final Map? parameters; + + /// The platform capabilities required by the job definition. If no value is + /// specified, it defaults to EC2. Jobs run on Fargate resources + /// specify FARGATE. + final List? platformCapabilities; + + /// Specifies whether to propagate the tags from the job or job definition to + /// the corresponding Amazon ECS task. If no value is specified, the tags aren't + /// propagated. Tags can only be propagated to the tasks when the tasks are + /// created. For tags with the same name, job tags are given priority over job + /// definitions tags. If the total number of combined tags from the job and job + /// definition is over 50, the job is moved to the FAILED state. + final bool? propagateTags; + + /// The retry strategy to use for failed jobs that are submitted with this job + /// definition. + final RetryStrategy? retryStrategy; + + /// The scheduling priority of the job definition. This only affects jobs in job + /// queues with a fair share policy. Jobs with a higher scheduling priority are + /// scheduled before jobs with a lower scheduling priority. + final int? schedulingPriority; + + /// The status of the job definition. + final String? status; + + /// The tags that are applied to the job definition. final Map? tags; - /// The timeout configuration for the job. + /// The timeout time for jobs that are submitted with this job definition. After + /// the amount of time you specify passes, Batch terminates your jobs if they + /// aren't finished. final JobTimeout? timeout; - JobDetail({ - required this.jobDefinition, - required this.jobId, - required this.jobName, - required this.jobQueue, - required this.startedAt, - required this.status, - this.arrayProperties, - this.attempts, - this.container, - this.createdAt, - this.dependsOn, - this.eksAttempts, + JobDefinition({ + required this.jobDefinitionArn, + required this.jobDefinitionName, + required this.revision, + required this.type, + this.containerOrchestrationType, + this.containerProperties, + this.ecsProperties, this.eksProperties, - this.isCancelled, - this.isTerminated, - this.jobArn, - this.nodeDetails, this.nodeProperties, this.parameters, this.platformCapabilities, this.propagateTags, this.retryStrategy, this.schedulingPriority, - this.shareIdentifier, - this.statusReason, - this.stoppedAt, + this.status, this.tags, this.timeout, }); - factory JobDetail.fromJson(Map json) { - return JobDetail( - jobDefinition: json['jobDefinition'] as String, - jobId: json['jobId'] as String, - jobName: json['jobName'] as String, - jobQueue: json['jobQueue'] as String, - startedAt: json['startedAt'] as int, - status: (json['status'] as String).toJobStatus(), - arrayProperties: json['arrayProperties'] != null - ? ArrayPropertiesDetail.fromJson( - json['arrayProperties'] as Map) - : null, - attempts: (json['attempts'] as List?) - ?.whereNotNull() - .map((e) => AttemptDetail.fromJson(e as Map)) - .toList(), - container: json['container'] != null - ? ContainerDetail.fromJson(json['container'] as Map) + factory JobDefinition.fromJson(Map json) { + return JobDefinition( + jobDefinitionArn: json['jobDefinitionArn'] as String, + jobDefinitionName: json['jobDefinitionName'] as String, + revision: json['revision'] as int, + type: json['type'] as String, + containerOrchestrationType: + (json['containerOrchestrationType'] as String?) + ?.toOrchestrationType(), + containerProperties: json['containerProperties'] != null + ? ContainerProperties.fromJson( + json['containerProperties'] as Map) + : null, + ecsProperties: json['ecsProperties'] != null + ? EcsProperties.fromJson( + json['ecsProperties'] as Map) : null, - createdAt: json['createdAt'] as int?, - dependsOn: (json['dependsOn'] as List?) - ?.whereNotNull() - .map((e) => JobDependency.fromJson(e as Map)) - .toList(), - eksAttempts: (json['eksAttempts'] as List?) - ?.whereNotNull() - .map((e) => EksAttemptDetail.fromJson(e as Map)) - .toList(), eksProperties: json['eksProperties'] != null - ? EksPropertiesDetail.fromJson( + ? EksProperties.fromJson( json['eksProperties'] as Map) : null, - isCancelled: json['isCancelled'] as bool?, - isTerminated: json['isTerminated'] as bool?, - jobArn: json['jobArn'] as String?, - nodeDetails: json['nodeDetails'] != null - ? NodeDetails.fromJson(json['nodeDetails'] as Map) - : null, nodeProperties: json['nodeProperties'] != null ? NodeProperties.fromJson( json['nodeProperties'] as Map) @@ -6711,1852 +7329,3301 @@ class JobDetail { ?.map((k, e) => MapEntry(k, e as String)), platformCapabilities: (json['platformCapabilities'] as List?) ?.whereNotNull() - .map((e) => (e as String).toPlatformCapability()) + .map((e) => (e as String).toPlatformCapability()) + .toList(), + propagateTags: json['propagateTags'] as bool?, + retryStrategy: json['retryStrategy'] != null + ? RetryStrategy.fromJson( + json['retryStrategy'] as Map) + : null, + schedulingPriority: json['schedulingPriority'] as int?, + status: json['status'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + timeout: json['timeout'] != null + ? JobTimeout.fromJson(json['timeout'] as Map) + : null, + ); + } + + Map toJson() { + final jobDefinitionArn = this.jobDefinitionArn; + final jobDefinitionName = this.jobDefinitionName; + final revision = this.revision; + final type = this.type; + final containerOrchestrationType = this.containerOrchestrationType; + final containerProperties = this.containerProperties; + final ecsProperties = this.ecsProperties; + final eksProperties = this.eksProperties; + final nodeProperties = this.nodeProperties; + final parameters = this.parameters; + final platformCapabilities = this.platformCapabilities; + final propagateTags = this.propagateTags; + final retryStrategy = this.retryStrategy; + final schedulingPriority = this.schedulingPriority; + final status = this.status; + final tags = this.tags; + final timeout = this.timeout; + return { + 'jobDefinitionArn': jobDefinitionArn, + 'jobDefinitionName': jobDefinitionName, + 'revision': revision, + 'type': type, + if (containerOrchestrationType != null) + 'containerOrchestrationType': containerOrchestrationType.toValue(), + if (containerProperties != null) + 'containerProperties': containerProperties, + if (ecsProperties != null) 'ecsProperties': ecsProperties, + if (eksProperties != null) 'eksProperties': eksProperties, + if (nodeProperties != null) 'nodeProperties': nodeProperties, + if (parameters != null) 'parameters': parameters, + if (platformCapabilities != null) + 'platformCapabilities': + platformCapabilities.map((e) => e.toValue()).toList(), + if (propagateTags != null) 'propagateTags': propagateTags, + if (retryStrategy != null) 'retryStrategy': retryStrategy, + if (schedulingPriority != null) 'schedulingPriority': schedulingPriority, + if (status != null) 'status': status, + if (tags != null) 'tags': tags, + if (timeout != null) 'timeout': timeout, + }; + } +} + +enum JobDefinitionType { + container, + multinode, +} + +extension JobDefinitionTypeValueExtension on JobDefinitionType { + String toValue() { + switch (this) { + case JobDefinitionType.container: + return 'container'; + case JobDefinitionType.multinode: + return 'multinode'; + } + } +} + +extension JobDefinitionTypeFromString on String { + JobDefinitionType toJobDefinitionType() { + switch (this) { + case 'container': + return JobDefinitionType.container; + case 'multinode': + return JobDefinitionType.multinode; + } + throw Exception('$this is not known in enum JobDefinitionType'); + } +} + +/// An object that represents an Batch job dependency. +class JobDependency { + /// The job ID of the Batch job that's associated with this dependency. + final String? jobId; + + /// The type of the job dependency. + final ArrayJobDependency? type; + + JobDependency({ + this.jobId, + this.type, + }); + + factory JobDependency.fromJson(Map json) { + return JobDependency( + jobId: json['jobId'] as String?, + type: (json['type'] as String?)?.toArrayJobDependency(), + ); + } + + Map toJson() { + final jobId = this.jobId; + final type = this.type; + return { + if (jobId != null) 'jobId': jobId, + if (type != null) 'type': type.toValue(), + }; + } +} + +/// An object that represents an Batch job. +class JobDetail { + /// The Amazon Resource Name (ARN) of the job definition that this job uses. + final String jobDefinition; + + /// The job ID. + final String jobId; + + /// The job name. + final String jobName; + + /// The Amazon Resource Name (ARN) of the job queue that the job is associated + /// with. + final String jobQueue; + + /// The Unix timestamp (in milliseconds) for when the job was started. More + /// specifically, it's when the job transitioned from the STARTING + /// state to the RUNNING state. + final int startedAt; + + /// The current status for the job. + /// + /// If your jobs don't progress to STARTING, see Jobs + /// stuck in RUNNABLE status in the troubleshooting section of the Batch + /// User Guide. + /// + final JobStatus status; + + /// The array properties of the job, if it's an array job. + final ArrayPropertiesDetail? arrayProperties; + + /// A list of job attempts that are associated with this job. + final List? attempts; + + /// An object that represents the details for the container that's associated + /// with the job. If the details are for a multiple-container job, this object + /// will be empty. + final ContainerDetail? container; + + /// The Unix timestamp (in milliseconds) for when the job was created. For + /// non-array jobs and parent array jobs, this is when the job entered the + /// SUBMITTED state. This is specifically at the time SubmitJob + /// was called. For array child jobs, this is when the child job was spawned by + /// its parent and entered the PENDING state. + final int? createdAt; + + /// A list of job IDs that this job depends on. + final List? dependsOn; + + /// An object with properties that are specific to Amazon ECS-based jobs. + final EcsPropertiesDetail? ecsProperties; + + /// A list of job attempts that are associated with this job. + final List? eksAttempts; + + /// An object with various properties that are specific to Amazon EKS based + /// jobs. + final EksPropertiesDetail? eksProperties; + + /// Indicates whether the job is canceled. + final bool? isCancelled; + + /// Indicates whether the job is terminated. + final bool? isTerminated; + + /// The Amazon Resource Name (ARN) of the job. + final String? jobArn; + + /// An object that represents the details of a node that's associated with a + /// multi-node parallel job. + final NodeDetails? nodeDetails; + + /// An object that represents the node properties of a multi-node parallel job. + /// + /// This isn't applicable to jobs that are running on Fargate resources. + /// + final NodeProperties? nodeProperties; + + /// Additional parameters that are passed to the job that replace parameter + /// substitution placeholders or override any corresponding parameter defaults + /// from the job definition. + final Map? parameters; + + /// The platform capabilities required by the job definition. If no value is + /// specified, it defaults to EC2. Jobs run on Fargate resources + /// specify FARGATE. + final List? platformCapabilities; + + /// Specifies whether to propagate the tags from the job or job definition to + /// the corresponding Amazon ECS task. If no value is specified, the tags aren't + /// propagated. Tags can only be propagated to the tasks when the tasks are + /// created. For tags with the same name, job tags are given priority over job + /// definitions tags. If the total number of combined tags from the job and job + /// definition is over 50, the job is moved to the FAILED state. + final bool? propagateTags; + + /// The retry strategy to use for this job if an attempt fails. + final RetryStrategy? retryStrategy; + + /// The scheduling policy of the job definition. This only affects jobs in job + /// queues with a fair share policy. Jobs with a higher scheduling priority are + /// scheduled before jobs with a lower scheduling priority. + final int? schedulingPriority; + + /// The share identifier for the job. + final String? shareIdentifier; + + /// A short, human-readable string to provide more details for the current + /// status of the job. + /// + ///
      + ///
    • + /// CAPACITY:INSUFFICIENT_INSTANCE_CAPACITY - All compute + /// environments have insufficient capacity to service the job. + ///
    • + ///
    • + /// MISCONFIGURATION:COMPUTE_ENVIRONMENT_MAX_RESOURCE - All compute + /// environments have a maxVcpu setting that is smaller than the + /// job requirements. + ///
    • + ///
    • + /// MISCONFIGURATION:JOB_RESOURCE_REQUIREMENT - All compute + /// environments have no connected instances that meet the job requirements. + ///
    • + ///
    • + /// MISCONFIGURATION:SERVICE_ROLE_PERMISSIONS - All compute + /// environments have problems with the service role permissions. + ///
    • + ///
    + final String? statusReason; + + /// The Unix timestamp (in milliseconds) for when the job was stopped. More + /// specifically, it's when the job transitioned from the RUNNING + /// state to a terminal state, such as SUCCEEDED or + /// FAILED. + final int? stoppedAt; + + /// The tags that are applied to the job. + final Map? tags; + + /// The timeout configuration for the job. + final JobTimeout? timeout; + + JobDetail({ + required this.jobDefinition, + required this.jobId, + required this.jobName, + required this.jobQueue, + required this.startedAt, + required this.status, + this.arrayProperties, + this.attempts, + this.container, + this.createdAt, + this.dependsOn, + this.ecsProperties, + this.eksAttempts, + this.eksProperties, + this.isCancelled, + this.isTerminated, + this.jobArn, + this.nodeDetails, + this.nodeProperties, + this.parameters, + this.platformCapabilities, + this.propagateTags, + this.retryStrategy, + this.schedulingPriority, + this.shareIdentifier, + this.statusReason, + this.stoppedAt, + this.tags, + this.timeout, + }); + + factory JobDetail.fromJson(Map json) { + return JobDetail( + jobDefinition: json['jobDefinition'] as String, + jobId: json['jobId'] as String, + jobName: json['jobName'] as String, + jobQueue: json['jobQueue'] as String, + startedAt: json['startedAt'] as int, + status: (json['status'] as String).toJobStatus(), + arrayProperties: json['arrayProperties'] != null + ? ArrayPropertiesDetail.fromJson( + json['arrayProperties'] as Map) + : null, + attempts: (json['attempts'] as List?) + ?.whereNotNull() + .map((e) => AttemptDetail.fromJson(e as Map)) + .toList(), + container: json['container'] != null + ? ContainerDetail.fromJson(json['container'] as Map) + : null, + createdAt: json['createdAt'] as int?, + dependsOn: (json['dependsOn'] as List?) + ?.whereNotNull() + .map((e) => JobDependency.fromJson(e as Map)) + .toList(), + ecsProperties: json['ecsProperties'] != null + ? EcsPropertiesDetail.fromJson( + json['ecsProperties'] as Map) + : null, + eksAttempts: (json['eksAttempts'] as List?) + ?.whereNotNull() + .map((e) => EksAttemptDetail.fromJson(e as Map)) + .toList(), + eksProperties: json['eksProperties'] != null + ? EksPropertiesDetail.fromJson( + json['eksProperties'] as Map) + : null, + isCancelled: json['isCancelled'] as bool?, + isTerminated: json['isTerminated'] as bool?, + jobArn: json['jobArn'] as String?, + nodeDetails: json['nodeDetails'] != null + ? NodeDetails.fromJson(json['nodeDetails'] as Map) + : null, + nodeProperties: json['nodeProperties'] != null + ? NodeProperties.fromJson( + json['nodeProperties'] as Map) + : null, + parameters: (json['parameters'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + platformCapabilities: (json['platformCapabilities'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toPlatformCapability()) + .toList(), + propagateTags: json['propagateTags'] as bool?, + retryStrategy: json['retryStrategy'] != null + ? RetryStrategy.fromJson( + json['retryStrategy'] as Map) + : null, + schedulingPriority: json['schedulingPriority'] as int?, + shareIdentifier: json['shareIdentifier'] as String?, + statusReason: json['statusReason'] as String?, + stoppedAt: json['stoppedAt'] as int?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + timeout: json['timeout'] != null + ? JobTimeout.fromJson(json['timeout'] as Map) + : null, + ); + } + + Map toJson() { + final jobDefinition = this.jobDefinition; + final jobId = this.jobId; + final jobName = this.jobName; + final jobQueue = this.jobQueue; + final startedAt = this.startedAt; + final status = this.status; + final arrayProperties = this.arrayProperties; + final attempts = this.attempts; + final container = this.container; + final createdAt = this.createdAt; + final dependsOn = this.dependsOn; + final ecsProperties = this.ecsProperties; + final eksAttempts = this.eksAttempts; + final eksProperties = this.eksProperties; + final isCancelled = this.isCancelled; + final isTerminated = this.isTerminated; + final jobArn = this.jobArn; + final nodeDetails = this.nodeDetails; + final nodeProperties = this.nodeProperties; + final parameters = this.parameters; + final platformCapabilities = this.platformCapabilities; + final propagateTags = this.propagateTags; + final retryStrategy = this.retryStrategy; + final schedulingPriority = this.schedulingPriority; + final shareIdentifier = this.shareIdentifier; + final statusReason = this.statusReason; + final stoppedAt = this.stoppedAt; + final tags = this.tags; + final timeout = this.timeout; + return { + 'jobDefinition': jobDefinition, + 'jobId': jobId, + 'jobName': jobName, + 'jobQueue': jobQueue, + 'startedAt': startedAt, + 'status': status.toValue(), + if (arrayProperties != null) 'arrayProperties': arrayProperties, + if (attempts != null) 'attempts': attempts, + if (container != null) 'container': container, + if (createdAt != null) 'createdAt': createdAt, + if (dependsOn != null) 'dependsOn': dependsOn, + if (ecsProperties != null) 'ecsProperties': ecsProperties, + if (eksAttempts != null) 'eksAttempts': eksAttempts, + if (eksProperties != null) 'eksProperties': eksProperties, + if (isCancelled != null) 'isCancelled': isCancelled, + if (isTerminated != null) 'isTerminated': isTerminated, + if (jobArn != null) 'jobArn': jobArn, + if (nodeDetails != null) 'nodeDetails': nodeDetails, + if (nodeProperties != null) 'nodeProperties': nodeProperties, + if (parameters != null) 'parameters': parameters, + if (platformCapabilities != null) + 'platformCapabilities': + platformCapabilities.map((e) => e.toValue()).toList(), + if (propagateTags != null) 'propagateTags': propagateTags, + if (retryStrategy != null) 'retryStrategy': retryStrategy, + if (schedulingPriority != null) 'schedulingPriority': schedulingPriority, + if (shareIdentifier != null) 'shareIdentifier': shareIdentifier, + if (statusReason != null) 'statusReason': statusReason, + if (stoppedAt != null) 'stoppedAt': stoppedAt, + if (tags != null) 'tags': tags, + if (timeout != null) 'timeout': timeout, + }; + } +} + +/// An object that represents the details for an Batch job queue. +class JobQueueDetail { + /// The compute environments that are attached to the job queue and the order + /// that job placement is preferred. Compute environments are selected for job + /// placement in ascending order. + final List computeEnvironmentOrder; + + /// The Amazon Resource Name (ARN) of the job queue. + final String jobQueueArn; + + /// The job queue name. + final String jobQueueName; + + /// The priority of the job queue. Job queues with a higher priority (or a + /// higher integer value for the priority parameter) are evaluated + /// first when associated with the same compute environment. Priority is + /// determined in descending order. For example, a job queue with a priority + /// value of 10 is given scheduling preference over a job queue + /// with a priority value of 1. All of the compute environments + /// must be either Amazon EC2 (EC2 or SPOT) or Fargate + /// (FARGATE or FARGATE_SPOT). Amazon EC2 and Fargate + /// compute environments can't be mixed. + final int priority; + + /// Describes the ability of the queue to accept new jobs. If the job queue + /// state is ENABLED, it can accept jobs. If the job queue state is + /// DISABLED, new jobs can't be added to the queue, but jobs + /// already in the queue can finish. + final JQState state; + + /// The set of actions that Batch perform on jobs that remain at the head of the + /// job queue in the specified state longer than specified times. Batch will + /// perform each action after maxTimeSeconds has passed. + final List? jobStateTimeLimitActions; + + /// The Amazon Resource Name (ARN) of the scheduling policy. The format is + /// aws:Partition:batch:Region:Account:scheduling-policy/Name + /// . For example, + /// aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy. + final String? schedulingPolicyArn; + + /// The status of the job queue (for example, CREATING or + /// VALID). + final JQStatus? status; + + /// A short, human-readable string to provide additional details for the current + /// status of the job queue. + final String? statusReason; + + /// The tags that are applied to the job queue. For more information, see Tagging + /// your Batch resources in Batch User Guide. + final Map? tags; + + JobQueueDetail({ + required this.computeEnvironmentOrder, + required this.jobQueueArn, + required this.jobQueueName, + required this.priority, + required this.state, + this.jobStateTimeLimitActions, + this.schedulingPolicyArn, + this.status, + this.statusReason, + this.tags, + }); + + factory JobQueueDetail.fromJson(Map json) { + return JobQueueDetail( + computeEnvironmentOrder: (json['computeEnvironmentOrder'] as List) + .whereNotNull() + .map((e) => + ComputeEnvironmentOrder.fromJson(e as Map)) + .toList(), + jobQueueArn: json['jobQueueArn'] as String, + jobQueueName: json['jobQueueName'] as String, + priority: json['priority'] as int, + state: (json['state'] as String).toJQState(), + jobStateTimeLimitActions: (json['jobStateTimeLimitActions'] as List?) + ?.whereNotNull() + .map((e) => + JobStateTimeLimitAction.fromJson(e as Map)) + .toList(), + schedulingPolicyArn: json['schedulingPolicyArn'] as String?, + status: (json['status'] as String?)?.toJQStatus(), + statusReason: json['statusReason'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final computeEnvironmentOrder = this.computeEnvironmentOrder; + final jobQueueArn = this.jobQueueArn; + final jobQueueName = this.jobQueueName; + final priority = this.priority; + final state = this.state; + final jobStateTimeLimitActions = this.jobStateTimeLimitActions; + final schedulingPolicyArn = this.schedulingPolicyArn; + final status = this.status; + final statusReason = this.statusReason; + final tags = this.tags; + return { + 'computeEnvironmentOrder': computeEnvironmentOrder, + 'jobQueueArn': jobQueueArn, + 'jobQueueName': jobQueueName, + 'priority': priority, + 'state': state.toValue(), + if (jobStateTimeLimitActions != null) + 'jobStateTimeLimitActions': jobStateTimeLimitActions, + if (schedulingPolicyArn != null) + 'schedulingPolicyArn': schedulingPolicyArn, + if (status != null) 'status': status.toValue(), + if (statusReason != null) 'statusReason': statusReason, + if (tags != null) 'tags': tags, + }; + } +} + +/// Specifies an action that Batch will take after the job has remained at the +/// head of the queue in the specified state for longer than the specified time. +class JobStateTimeLimitAction { + /// The action to take when a job is at the head of the job queue in the + /// specified state for the specified period of time. The only supported value + /// is CANCEL, which will cancel the job. + final JobStateTimeLimitActionsAction action; + + /// The approximate amount of time, in seconds, that must pass with the job in + /// the specified state before the action is taken. The minimum value is 600 (10 + /// minutes) and the maximum value is 86,400 (24 hours). + final int maxTimeSeconds; + + /// The reason to log for the action being taken. + final String reason; + + /// The state of the job needed to trigger the action. The only supported value + /// is RUNNABLE. + final JobStateTimeLimitActionsState state; + + JobStateTimeLimitAction({ + required this.action, + required this.maxTimeSeconds, + required this.reason, + required this.state, + }); + + factory JobStateTimeLimitAction.fromJson(Map json) { + return JobStateTimeLimitAction( + action: (json['action'] as String).toJobStateTimeLimitActionsAction(), + maxTimeSeconds: json['maxTimeSeconds'] as int, + reason: json['reason'] as String, + state: (json['state'] as String).toJobStateTimeLimitActionsState(), + ); + } + + Map toJson() { + final action = this.action; + final maxTimeSeconds = this.maxTimeSeconds; + final reason = this.reason; + final state = this.state; + return { + 'action': action.toValue(), + 'maxTimeSeconds': maxTimeSeconds, + 'reason': reason, + 'state': state.toValue(), + }; + } +} + +enum JobStateTimeLimitActionsAction { + cancel, +} + +extension JobStateTimeLimitActionsActionValueExtension + on JobStateTimeLimitActionsAction { + String toValue() { + switch (this) { + case JobStateTimeLimitActionsAction.cancel: + return 'CANCEL'; + } + } +} + +extension JobStateTimeLimitActionsActionFromString on String { + JobStateTimeLimitActionsAction toJobStateTimeLimitActionsAction() { + switch (this) { + case 'CANCEL': + return JobStateTimeLimitActionsAction.cancel; + } + throw Exception( + '$this is not known in enum JobStateTimeLimitActionsAction'); + } +} + +enum JobStateTimeLimitActionsState { + runnable, +} + +extension JobStateTimeLimitActionsStateValueExtension + on JobStateTimeLimitActionsState { + String toValue() { + switch (this) { + case JobStateTimeLimitActionsState.runnable: + return 'RUNNABLE'; + } + } +} + +extension JobStateTimeLimitActionsStateFromString on String { + JobStateTimeLimitActionsState toJobStateTimeLimitActionsState() { + switch (this) { + case 'RUNNABLE': + return JobStateTimeLimitActionsState.runnable; + } + throw Exception('$this is not known in enum JobStateTimeLimitActionsState'); + } +} + +enum JobStatus { + submitted, + pending, + runnable, + starting, + running, + succeeded, + failed, +} + +extension JobStatusValueExtension on JobStatus { + String toValue() { + switch (this) { + case JobStatus.submitted: + return 'SUBMITTED'; + case JobStatus.pending: + return 'PENDING'; + case JobStatus.runnable: + return 'RUNNABLE'; + case JobStatus.starting: + return 'STARTING'; + case JobStatus.running: + return 'RUNNING'; + case JobStatus.succeeded: + return 'SUCCEEDED'; + case JobStatus.failed: + return 'FAILED'; + } + } +} + +extension JobStatusFromString on String { + JobStatus toJobStatus() { + switch (this) { + case 'SUBMITTED': + return JobStatus.submitted; + case 'PENDING': + return JobStatus.pending; + case 'RUNNABLE': + return JobStatus.runnable; + case 'STARTING': + return JobStatus.starting; + case 'RUNNING': + return JobStatus.running; + case 'SUCCEEDED': + return JobStatus.succeeded; + case 'FAILED': + return JobStatus.failed; + } + throw Exception('$this is not known in enum JobStatus'); + } +} + +/// An object that represents summary details of a job. +class JobSummary { + /// The job ID. + final String jobId; + + /// The job name. + final String jobName; + + /// The array properties of the job, if it's an array job. + final ArrayPropertiesSummary? arrayProperties; + + /// An object that represents the details of the container that's associated + /// with the job. + final ContainerSummary? container; + + /// The Unix timestamp (in milliseconds) for when the job was created. For + /// non-array jobs and parent array jobs, this is when the job entered the + /// SUBMITTED state (at the time SubmitJob + /// was called). For array child jobs, this is when the child job was spawned by + /// its parent and entered the PENDING state. + final int? createdAt; + + /// The Amazon Resource Name (ARN) of the job. + final String? jobArn; + + /// The Amazon Resource Name (ARN) of the job definition. + final String? jobDefinition; + + /// The node properties for a single node in a job summary list. + /// + /// This isn't applicable to jobs that are running on Fargate resources. + /// + final NodePropertiesSummary? nodeProperties; + + /// The Unix timestamp for when the job was started. More specifically, it's + /// when the job transitioned from the STARTING state to the + /// RUNNING state. + final int? startedAt; + + /// The current status for the job. + final JobStatus? status; + + /// A short, human-readable string to provide more details for the current + /// status of the job. + final String? statusReason; + + /// The Unix timestamp for when the job was stopped. More specifically, it's + /// when the job transitioned from the RUNNING state to a terminal + /// state, such as SUCCEEDED or FAILED. + final int? stoppedAt; + + JobSummary({ + required this.jobId, + required this.jobName, + this.arrayProperties, + this.container, + this.createdAt, + this.jobArn, + this.jobDefinition, + this.nodeProperties, + this.startedAt, + this.status, + this.statusReason, + this.stoppedAt, + }); + + factory JobSummary.fromJson(Map json) { + return JobSummary( + jobId: json['jobId'] as String, + jobName: json['jobName'] as String, + arrayProperties: json['arrayProperties'] != null + ? ArrayPropertiesSummary.fromJson( + json['arrayProperties'] as Map) + : null, + container: json['container'] != null + ? ContainerSummary.fromJson(json['container'] as Map) + : null, + createdAt: json['createdAt'] as int?, + jobArn: json['jobArn'] as String?, + jobDefinition: json['jobDefinition'] as String?, + nodeProperties: json['nodeProperties'] != null + ? NodePropertiesSummary.fromJson( + json['nodeProperties'] as Map) + : null, + startedAt: json['startedAt'] as int?, + status: (json['status'] as String?)?.toJobStatus(), + statusReason: json['statusReason'] as String?, + stoppedAt: json['stoppedAt'] as int?, + ); + } + + Map toJson() { + final jobId = this.jobId; + final jobName = this.jobName; + final arrayProperties = this.arrayProperties; + final container = this.container; + final createdAt = this.createdAt; + final jobArn = this.jobArn; + final jobDefinition = this.jobDefinition; + final nodeProperties = this.nodeProperties; + final startedAt = this.startedAt; + final status = this.status; + final statusReason = this.statusReason; + final stoppedAt = this.stoppedAt; + return { + 'jobId': jobId, + 'jobName': jobName, + if (arrayProperties != null) 'arrayProperties': arrayProperties, + if (container != null) 'container': container, + if (createdAt != null) 'createdAt': createdAt, + if (jobArn != null) 'jobArn': jobArn, + if (jobDefinition != null) 'jobDefinition': jobDefinition, + if (nodeProperties != null) 'nodeProperties': nodeProperties, + if (startedAt != null) 'startedAt': startedAt, + if (status != null) 'status': status.toValue(), + if (statusReason != null) 'statusReason': statusReason, + if (stoppedAt != null) 'stoppedAt': stoppedAt, + }; + } +} + +/// An object that represents a job timeout configuration. +class JobTimeout { + /// The job timeout time (in seconds) that's measured from the job attempt's + /// startedAt timestamp. After this time passes, Batch terminates + /// your jobs if they aren't finished. The minimum value for the timeout is 60 + /// seconds. + /// + /// For array jobs, the timeout applies to the child jobs, not to the parent + /// array job. + /// + /// For multi-node parallel (MNP) jobs, the timeout applies to the whole job, + /// not to the individual nodes. + final int? attemptDurationSeconds; + + JobTimeout({ + this.attemptDurationSeconds, + }); + + factory JobTimeout.fromJson(Map json) { + return JobTimeout( + attemptDurationSeconds: json['attemptDurationSeconds'] as int?, + ); + } + + Map toJson() { + final attemptDurationSeconds = this.attemptDurationSeconds; + return { + if (attemptDurationSeconds != null) + 'attemptDurationSeconds': attemptDurationSeconds, + }; + } +} + +/// A key-value pair object. +class KeyValuePair { + /// The name of the key-value pair. For environment variables, this is the name + /// of the environment variable. + final String? name; + + /// The value of the key-value pair. For environment variables, this is the + /// value of the environment variable. + final String? value; + + KeyValuePair({ + this.name, + this.value, + }); + + factory KeyValuePair.fromJson(Map json) { + return KeyValuePair( + name: json['name'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final value = this.value; + return { + if (name != null) 'name': name, + if (value != null) 'value': value, + }; + } +} + +/// A filter name and value pair that's used to return a more specific list of +/// results from a ListJobs API operation. +class KeyValuesPair { + /// The name of the filter. Filter names are case sensitive. + final String? name; + + /// The filter values. + final List? values; + + KeyValuesPair({ + this.name, + this.values, + }); + + Map toJson() { + final name = this.name; + final values = this.values; + return { + if (name != null) 'name': name, + if (values != null) 'values': values, + }; + } +} + +/// An object that represents a launch template that's associated with a compute +/// resource. You must specify either the launch template ID or launch template +/// name in the request, but not both. +/// +/// If security groups are specified using both the +/// securityGroupIds parameter of +/// CreateComputeEnvironment and the launch template, the values in +/// the securityGroupIds parameter of +/// CreateComputeEnvironment will be used. +/// +/// This object isn't applicable to jobs that are running on Fargate resources. +/// +class LaunchTemplateSpecification { + /// The ID of the launch template. + final String? launchTemplateId; + + /// The name of the launch template. + final String? launchTemplateName; + + /// The version number of the launch template, $Latest, or + /// $Default. + /// + /// If the value is $Latest, the latest version of the launch + /// template is used. If the value is $Default, the default version + /// of the launch template is used. + /// + /// If the AMI ID that's used in a compute environment is from the launch + /// template, the AMI isn't changed when the compute environment is updated. + /// It's only changed if the updateToLatestImageVersion parameter + /// for the compute environment is set to true. During an + /// infrastructure update, if either $Latest or + /// $Default is specified, Batch re-evaluates the launch template + /// version, and it might use a different version of the launch template. This + /// is the case even if the launch template isn't specified in the update. When + /// updating a compute environment, changing the launch template requires an + /// infrastructure update of the compute environment. For more information, see + /// Updating + /// compute environments in the Batch User Guide. + /// + /// Default: $Default. + final String? version; + + LaunchTemplateSpecification({ + this.launchTemplateId, + this.launchTemplateName, + this.version, + }); + + factory LaunchTemplateSpecification.fromJson(Map json) { + return LaunchTemplateSpecification( + launchTemplateId: json['launchTemplateId'] as String?, + launchTemplateName: json['launchTemplateName'] as String?, + version: json['version'] as String?, + ); + } + + Map toJson() { + final launchTemplateId = this.launchTemplateId; + final launchTemplateName = this.launchTemplateName; + final version = this.version; + return { + if (launchTemplateId != null) 'launchTemplateId': launchTemplateId, + if (launchTemplateName != null) 'launchTemplateName': launchTemplateName, + if (version != null) 'version': version, + }; + } +} + +/// Linux-specific modifications that are applied to the container, such as +/// details for device mappings. +class LinuxParameters { + /// Any of the host devices to expose to the container. This parameter maps to + /// Devices in the Create a + /// container section of the Docker Remote API and + /// the --device option to docker run. + /// + /// This parameter isn't applicable to jobs that are running on Fargate + /// resources. Don't provide it for these jobs. + /// + final List? devices; + + /// If true, run an init process inside the container that forwards + /// signals and reaps processes. This parameter maps to the --init + /// option to docker + /// run. This parameter requires version 1.25 of the Docker Remote API or + /// greater on your container instance. To check the Docker Remote API version + /// on your container instance, log in to your container instance and run the + /// following command: sudo docker version | grep "Server API + /// version" + final bool? initProcessEnabled; + + /// The total amount of swap memory (in MiB) a container can use. This parameter + /// is translated to the --memory-swap option to docker run where + /// the value is the sum of the container memory plus the maxSwap + /// value. For more information, see + /// --memory-swap details in the Docker documentation. + /// + /// If a maxSwap value of 0 is specified, the + /// container doesn't use swap. Accepted values are 0 or any + /// positive integer. If the maxSwap parameter is omitted, the + /// container doesn't use the swap configuration for the container instance that + /// it's running on. A maxSwap value must be set for the + /// swappiness parameter to be used. + /// + /// This parameter isn't applicable to jobs that are running on Fargate + /// resources. Don't provide it for these jobs. + /// + final int? maxSwap; + + /// The value for the size (in MiB) of the /dev/shm volume. This + /// parameter maps to the --shm-size option to docker run. + /// + /// This parameter isn't applicable to jobs that are running on Fargate + /// resources. Don't provide it for these jobs. + /// + final int? sharedMemorySize; + + /// You can use this parameter to tune a container's memory swappiness behavior. + /// A swappiness value of 0 causes swapping to not + /// occur unless absolutely necessary. A swappiness value of + /// 100 causes pages to be swapped aggressively. Valid values are + /// whole numbers between 0 and 100. If the + /// swappiness parameter isn't specified, a default value of + /// 60 is used. If a value isn't specified for + /// maxSwap, then this parameter is ignored. If + /// maxSwap is set to 0, the container doesn't use swap. This + /// parameter maps to the --memory-swappiness option to docker run. + /// + /// Consider the following when you use a per-container swap configuration. + /// + ///
      + ///
    • + /// Swap space must be enabled and allocated on the container instance for the + /// containers to use. + /// + /// By default, the Amazon ECS optimized AMIs don't have swap enabled. You must + /// enable swap on the instance to use this feature. For more information, see + /// Instance + /// store swap volumes in the Amazon EC2 User Guide for Linux + /// Instances or How + /// do I allocate memory to work as swap space in an Amazon EC2 instance by + /// using a swap file? + ///
    • + ///
    • + /// The swap space parameters are only supported for job definitions using EC2 + /// resources. + ///
    • + ///
    • + /// If the maxSwap and swappiness parameters are + /// omitted from a job definition, each container has a default + /// swappiness value of 60. Moreover, the total swap usage is + /// limited to two times the memory reservation of the container. + ///
    • + ///
    + /// This parameter isn't applicable to jobs that are running on Fargate + /// resources. Don't provide it for these jobs. + /// + final int? swappiness; + + /// The container path, mount options, and size (in MiB) of the + /// tmpfs mount. This parameter maps to the --tmpfs + /// option to docker + /// run. + /// + /// This parameter isn't applicable to jobs that are running on Fargate + /// resources. Don't provide this parameter for this resource type. + /// + final List? tmpfs; + + LinuxParameters({ + this.devices, + this.initProcessEnabled, + this.maxSwap, + this.sharedMemorySize, + this.swappiness, + this.tmpfs, + }); + + factory LinuxParameters.fromJson(Map json) { + return LinuxParameters( + devices: (json['devices'] as List?) + ?.whereNotNull() + .map((e) => Device.fromJson(e as Map)) + .toList(), + initProcessEnabled: json['initProcessEnabled'] as bool?, + maxSwap: json['maxSwap'] as int?, + sharedMemorySize: json['sharedMemorySize'] as int?, + swappiness: json['swappiness'] as int?, + tmpfs: (json['tmpfs'] as List?) + ?.whereNotNull() + .map((e) => Tmpfs.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final devices = this.devices; + final initProcessEnabled = this.initProcessEnabled; + final maxSwap = this.maxSwap; + final sharedMemorySize = this.sharedMemorySize; + final swappiness = this.swappiness; + final tmpfs = this.tmpfs; + return { + if (devices != null) 'devices': devices, + if (initProcessEnabled != null) 'initProcessEnabled': initProcessEnabled, + if (maxSwap != null) 'maxSwap': maxSwap, + if (sharedMemorySize != null) 'sharedMemorySize': sharedMemorySize, + if (swappiness != null) 'swappiness': swappiness, + if (tmpfs != null) 'tmpfs': tmpfs, + }; + } +} + +class ListJobsResponse { + /// A list of job summaries that match the request. + final List jobSummaryList; + + /// The nextToken value to include in a future + /// ListJobs request. When the results of a ListJobs + /// request exceed maxResults, this value can be used to retrieve + /// the next page of results. This value is null when there are no + /// more results to return. + final String? nextToken; + + ListJobsResponse({ + required this.jobSummaryList, + this.nextToken, + }); + + factory ListJobsResponse.fromJson(Map json) { + return ListJobsResponse( + jobSummaryList: (json['jobSummaryList'] as List) + .whereNotNull() + .map((e) => JobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final jobSummaryList = this.jobSummaryList; + final nextToken = this.nextToken; + return { + 'jobSummaryList': jobSummaryList, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSchedulingPoliciesResponse { + /// The nextToken value to include in a future + /// ListSchedulingPolicies request. When the results of a + /// ListSchedulingPolicies request exceed maxResults, + /// this value can be used to retrieve the next page of results. This value is + /// null when there are no more results to return. + final String? nextToken; + + /// A list of scheduling policies that match the request. + final List? schedulingPolicies; + + ListSchedulingPoliciesResponse({ + this.nextToken, + this.schedulingPolicies, + }); + + factory ListSchedulingPoliciesResponse.fromJson(Map json) { + return ListSchedulingPoliciesResponse( + nextToken: json['nextToken'] as String?, + schedulingPolicies: (json['schedulingPolicies'] as List?) + ?.whereNotNull() + .map((e) => + SchedulingPolicyListingDetail.fromJson(e as Map)) .toList(), - propagateTags: json['propagateTags'] as bool?, - retryStrategy: json['retryStrategy'] != null - ? RetryStrategy.fromJson( - json['retryStrategy'] as Map) - : null, - schedulingPriority: json['schedulingPriority'] as int?, - shareIdentifier: json['shareIdentifier'] as String?, - statusReason: json['statusReason'] as String?, - stoppedAt: json['stoppedAt'] as int?, - tags: (json['tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - timeout: json['timeout'] != null - ? JobTimeout.fromJson(json['timeout'] as Map) - : null, ); } Map toJson() { - final jobDefinition = this.jobDefinition; - final jobId = this.jobId; - final jobName = this.jobName; - final jobQueue = this.jobQueue; - final startedAt = this.startedAt; - final status = this.status; - final arrayProperties = this.arrayProperties; - final attempts = this.attempts; - final container = this.container; - final createdAt = this.createdAt; - final dependsOn = this.dependsOn; - final eksAttempts = this.eksAttempts; - final eksProperties = this.eksProperties; - final isCancelled = this.isCancelled; - final isTerminated = this.isTerminated; - final jobArn = this.jobArn; - final nodeDetails = this.nodeDetails; - final nodeProperties = this.nodeProperties; - final parameters = this.parameters; - final platformCapabilities = this.platformCapabilities; - final propagateTags = this.propagateTags; - final retryStrategy = this.retryStrategy; - final schedulingPriority = this.schedulingPriority; - final shareIdentifier = this.shareIdentifier; - final statusReason = this.statusReason; - final stoppedAt = this.stoppedAt; - final tags = this.tags; - final timeout = this.timeout; + final nextToken = this.nextToken; + final schedulingPolicies = this.schedulingPolicies; return { - 'jobDefinition': jobDefinition, - 'jobId': jobId, - 'jobName': jobName, - 'jobQueue': jobQueue, - 'startedAt': startedAt, - 'status': status.toValue(), - if (arrayProperties != null) 'arrayProperties': arrayProperties, - if (attempts != null) 'attempts': attempts, - if (container != null) 'container': container, - if (createdAt != null) 'createdAt': createdAt, - if (dependsOn != null) 'dependsOn': dependsOn, - if (eksAttempts != null) 'eksAttempts': eksAttempts, - if (eksProperties != null) 'eksProperties': eksProperties, - if (isCancelled != null) 'isCancelled': isCancelled, - if (isTerminated != null) 'isTerminated': isTerminated, - if (jobArn != null) 'jobArn': jobArn, - if (nodeDetails != null) 'nodeDetails': nodeDetails, - if (nodeProperties != null) 'nodeProperties': nodeProperties, - if (parameters != null) 'parameters': parameters, - if (platformCapabilities != null) - 'platformCapabilities': - platformCapabilities.map((e) => e.toValue()).toList(), - if (propagateTags != null) 'propagateTags': propagateTags, - if (retryStrategy != null) 'retryStrategy': retryStrategy, - if (schedulingPriority != null) 'schedulingPriority': schedulingPriority, - if (shareIdentifier != null) 'shareIdentifier': shareIdentifier, - if (statusReason != null) 'statusReason': statusReason, - if (stoppedAt != null) 'stoppedAt': stoppedAt, - if (tags != null) 'tags': tags, - if (timeout != null) 'timeout': timeout, + if (nextToken != null) 'nextToken': nextToken, + if (schedulingPolicies != null) 'schedulingPolicies': schedulingPolicies, }; } } -/// An object that represents the details for an Batch job queue. -class JobQueueDetail { - /// The compute environments that are attached to the job queue and the order - /// that job placement is preferred. Compute environments are selected for job - /// placement in ascending order. - final List computeEnvironmentOrder; - - /// The Amazon Resource Name (ARN) of the job queue. - final String jobQueueArn; - - /// The job queue name. - final String jobQueueName; +class ListTagsForResourceResponse { + /// The tags for the resource. + final Map? tags; - /// The priority of the job queue. Job queues with a higher priority (or a - /// higher integer value for the priority parameter) are evaluated - /// first when associated with the same compute environment. Priority is - /// determined in descending order. For example, a job queue with a priority - /// value of 10 is given scheduling preference over a job queue - /// with a priority value of 1. All of the compute environments - /// must be either EC2 (EC2 or SPOT) or Fargate - /// (FARGATE or FARGATE_SPOT). EC2 and Fargate compute - /// environments can't be mixed. - final int priority; + ListTagsForResourceResponse({ + this.tags, + }); - /// Describes the ability of the queue to accept new jobs. If the job queue - /// state is ENABLED, it can accept jobs. If the job queue state is - /// DISABLED, new jobs can't be added to the queue, but jobs - /// already in the queue can finish. - final JQState state; + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } - /// The Amazon Resource Name (ARN) of the scheduling policy. The format is - /// aws:Partition:batch:Region:Account:scheduling-policy/Name - /// . For example, - /// aws:aws:batch:us-west-2:123456789012:scheduling-policy/MySchedulingPolicy. - final String? schedulingPolicyArn; + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} - /// The status of the job queue (for example, CREATING or - /// VALID). - final JQStatus? status; +/// Log configuration options to send to a custom log driver for the container. +class LogConfiguration { + /// The log driver to use for the container. The valid values that are listed + /// for this parameter are log drivers that the Amazon ECS container agent can + /// communicate with by default. + /// + /// The supported log drivers are awslogs, fluentd, + /// gelf, json-file, journald, + /// logentries, syslog, and splunk. + /// + /// Jobs that are running on Fargate resources are restricted to the + /// awslogs and splunk log drivers. + ///
    awslogs
    + /// Specifies the Amazon CloudWatch Logs logging driver. For more information, + /// see Using + /// the awslogs log driver in the Batch User Guide and Amazon + /// CloudWatch Logs logging driver in the Docker documentation. + ///
    fluentd
    + /// Specifies the Fluentd logging driver. For more information including usage + /// and options, see Fluentd + /// logging driver in the Docker documentation. + ///
    gelf
    + /// Specifies the Graylog Extended Format (GELF) logging driver. For more + /// information including usage and options, see Graylog + /// Extended Format logging driver in the Docker documentation. + ///
    journald
    + /// Specifies the journald logging driver. For more information including usage + /// and options, see Journald + /// logging driver in the Docker documentation. + ///
    json-file
    + /// Specifies the JSON file logging driver. For more information including usage + /// and options, see JSON + /// File logging driver in the Docker documentation. + ///
    splunk
    + /// Specifies the Splunk logging driver. For more information including usage + /// and options, see Splunk + /// logging driver in the Docker documentation. + ///
    syslog
    + /// Specifies the syslog logging driver. For more information including usage + /// and options, see Syslog + /// logging driver in the Docker documentation. + ///
    + /// If you have a custom driver that's not listed earlier that you want to work + /// with the Amazon ECS container agent, you can fork the Amazon ECS container + /// agent project that's available on GitHub and + /// customize it to work with that driver. We encourage you to submit pull + /// requests for changes that you want to have included. However, Amazon Web + /// Services doesn't currently support running modified copies of this software. + /// + /// This parameter requires version 1.18 of the Docker Remote API or greater on + /// your container instance. To check the Docker Remote API version on your + /// container instance, log in to your container instance and run the following + /// command: sudo docker version | grep "Server API version" + final LogDriver logDriver; - /// A short, human-readable string to provide additional details for the current - /// status of the job queue. - final String? statusReason; + /// The configuration options to send to the log driver. This parameter requires + /// version 1.19 of the Docker Remote API or greater on your container instance. + /// To check the Docker Remote API version on your container instance, log in to + /// your container instance and run the following command: sudo docker + /// version | grep "Server API version" + final Map? options; - /// The tags that are applied to the job queue. For more information, see Tagging - /// your Batch resources in Batch User Guide. - final Map? tags; + /// The secrets to pass to the log configuration. For more information, see Specifying + /// sensitive data in the Batch User Guide. + final List? secretOptions; - JobQueueDetail({ - required this.computeEnvironmentOrder, - required this.jobQueueArn, - required this.jobQueueName, - required this.priority, - required this.state, - this.schedulingPolicyArn, - this.status, - this.statusReason, - this.tags, + LogConfiguration({ + required this.logDriver, + this.options, + this.secretOptions, }); - factory JobQueueDetail.fromJson(Map json) { - return JobQueueDetail( - computeEnvironmentOrder: (json['computeEnvironmentOrder'] as List) - .whereNotNull() - .map((e) => - ComputeEnvironmentOrder.fromJson(e as Map)) - .toList(), - jobQueueArn: json['jobQueueArn'] as String, - jobQueueName: json['jobQueueName'] as String, - priority: json['priority'] as int, - state: (json['state'] as String).toJQState(), - schedulingPolicyArn: json['schedulingPolicyArn'] as String?, - status: (json['status'] as String?)?.toJQStatus(), - statusReason: json['statusReason'] as String?, - tags: (json['tags'] as Map?) + factory LogConfiguration.fromJson(Map json) { + return LogConfiguration( + logDriver: (json['logDriver'] as String).toLogDriver(), + options: (json['options'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), + secretOptions: (json['secretOptions'] as List?) + ?.whereNotNull() + .map((e) => Secret.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final computeEnvironmentOrder = this.computeEnvironmentOrder; - final jobQueueArn = this.jobQueueArn; - final jobQueueName = this.jobQueueName; - final priority = this.priority; - final state = this.state; - final schedulingPolicyArn = this.schedulingPolicyArn; - final status = this.status; - final statusReason = this.statusReason; - final tags = this.tags; + final logDriver = this.logDriver; + final options = this.options; + final secretOptions = this.secretOptions; return { - 'computeEnvironmentOrder': computeEnvironmentOrder, - 'jobQueueArn': jobQueueArn, - 'jobQueueName': jobQueueName, - 'priority': priority, - 'state': state.toValue(), - if (schedulingPolicyArn != null) - 'schedulingPolicyArn': schedulingPolicyArn, - if (status != null) 'status': status.toValue(), - if (statusReason != null) 'statusReason': statusReason, - if (tags != null) 'tags': tags, + 'logDriver': logDriver.toValue(), + if (options != null) 'options': options, + if (secretOptions != null) 'secretOptions': secretOptions, }; } } -enum JobStatus { - submitted, - pending, - runnable, - starting, - running, - succeeded, - failed, +enum LogDriver { + jsonFile, + syslog, + journald, + gelf, + fluentd, + awslogs, + splunk, } -extension JobStatusValueExtension on JobStatus { +extension LogDriverValueExtension on LogDriver { String toValue() { switch (this) { - case JobStatus.submitted: - return 'SUBMITTED'; - case JobStatus.pending: - return 'PENDING'; - case JobStatus.runnable: - return 'RUNNABLE'; - case JobStatus.starting: - return 'STARTING'; - case JobStatus.running: - return 'RUNNING'; - case JobStatus.succeeded: - return 'SUCCEEDED'; - case JobStatus.failed: - return 'FAILED'; + case LogDriver.jsonFile: + return 'json-file'; + case LogDriver.syslog: + return 'syslog'; + case LogDriver.journald: + return 'journald'; + case LogDriver.gelf: + return 'gelf'; + case LogDriver.fluentd: + return 'fluentd'; + case LogDriver.awslogs: + return 'awslogs'; + case LogDriver.splunk: + return 'splunk'; } } } -extension JobStatusFromString on String { - JobStatus toJobStatus() { +extension LogDriverFromString on String { + LogDriver toLogDriver() { switch (this) { - case 'SUBMITTED': - return JobStatus.submitted; - case 'PENDING': - return JobStatus.pending; - case 'RUNNABLE': - return JobStatus.runnable; - case 'STARTING': - return JobStatus.starting; - case 'RUNNING': - return JobStatus.running; - case 'SUCCEEDED': - return JobStatus.succeeded; - case 'FAILED': - return JobStatus.failed; + case 'json-file': + return LogDriver.jsonFile; + case 'syslog': + return LogDriver.syslog; + case 'journald': + return LogDriver.journald; + case 'gelf': + return LogDriver.gelf; + case 'fluentd': + return LogDriver.fluentd; + case 'awslogs': + return LogDriver.awslogs; + case 'splunk': + return LogDriver.splunk; } - throw Exception('$this is not known in enum JobStatus'); + throw Exception('$this is not known in enum LogDriver'); } } -/// An object that represents summary details of a job. -class JobSummary { - /// The job ID. - final String jobId; +/// Details for a Docker volume mount point that's used in a job's container +/// properties. This parameter maps to Volumes in the Create +/// a container section of the Docker Remote API and the +/// --volume option to docker run. +class MountPoint { + /// The path on the container where the host volume is mounted. + final String? containerPath; - /// The job name. - final String jobName; + /// If this value is true, the container has read-only access to + /// the volume. Otherwise, the container can write to the volume. The default + /// value is false. + final bool? readOnly; - /// The array properties of the job, if it's an array job. - final ArrayPropertiesSummary? arrayProperties; + /// The name of the volume to mount. + final String? sourceVolume; - /// An object that represents the details of the container that's associated - /// with the job. - final ContainerSummary? container; + MountPoint({ + this.containerPath, + this.readOnly, + this.sourceVolume, + }); - /// The Unix timestamp (in milliseconds) for when the job was created. For - /// non-array jobs and parent array jobs, this is when the job entered the - /// SUBMITTED state (at the time SubmitJob was called). For - /// array child jobs, this is when the child job was spawned by its parent and - /// entered the PENDING state. - final int? createdAt; + factory MountPoint.fromJson(Map json) { + return MountPoint( + containerPath: json['containerPath'] as String?, + readOnly: json['readOnly'] as bool?, + sourceVolume: json['sourceVolume'] as String?, + ); + } - /// The Amazon Resource Name (ARN) of the job. - final String? jobArn; + Map toJson() { + final containerPath = this.containerPath; + final readOnly = this.readOnly; + final sourceVolume = this.sourceVolume; + return { + if (containerPath != null) 'containerPath': containerPath, + if (readOnly != null) 'readOnly': readOnly, + if (sourceVolume != null) 'sourceVolume': sourceVolume, + }; + } +} - /// The Amazon Resource Name (ARN) of the job definition. - final String? jobDefinition; +/// The network configuration for jobs that are running on Fargate resources. +/// Jobs that are running on Amazon EC2 resources must not specify this +/// parameter. +class NetworkConfiguration { + /// Indicates whether the job has a public IP address. For a job that's running + /// on Fargate resources in a private subnet to send outbound traffic to the + /// internet (for example, to pull container images), the private subnet + /// requires a NAT gateway be attached to route requests to the internet. For + /// more information, see Amazon + /// ECS task networking in the Amazon Elastic Container Service Developer + /// Guide. The default value is "DISABLED". + final AssignPublicIp? assignPublicIp; - /// The node properties for a single node in a job summary list. - /// - /// This isn't applicable to jobs that are running on Fargate resources. - /// - final NodePropertiesSummary? nodeProperties; + NetworkConfiguration({ + this.assignPublicIp, + }); - /// The Unix timestamp for when the job was started. More specifically, it's - /// when the job transitioned from the STARTING state to the - /// RUNNING state. - final int? startedAt; + factory NetworkConfiguration.fromJson(Map json) { + return NetworkConfiguration( + assignPublicIp: (json['assignPublicIp'] as String?)?.toAssignPublicIp(), + ); + } - /// The current status for the job. - final JobStatus? status; + Map toJson() { + final assignPublicIp = this.assignPublicIp; + return { + if (assignPublicIp != null) 'assignPublicIp': assignPublicIp.toValue(), + }; + } +} - /// A short, human-readable string to provide more details for the current - /// status of the job. - final String? statusReason; +/// An object that represents the elastic network interface for a multi-node +/// parallel job node. +class NetworkInterface { + /// The attachment ID for the network interface. + final String? attachmentId; - /// The Unix timestamp for when the job was stopped. More specifically, it's - /// when the job transitioned from the RUNNING state to a terminal - /// state, such as SUCCEEDED or FAILED. - final int? stoppedAt; + /// The private IPv6 address for the network interface. + final String? ipv6Address; - JobSummary({ - required this.jobId, - required this.jobName, - this.arrayProperties, - this.container, - this.createdAt, - this.jobArn, - this.jobDefinition, - this.nodeProperties, - this.startedAt, - this.status, - this.statusReason, - this.stoppedAt, + /// The private IPv4 address for the network interface. + final String? privateIpv4Address; + + NetworkInterface({ + this.attachmentId, + this.ipv6Address, + this.privateIpv4Address, + }); + + factory NetworkInterface.fromJson(Map json) { + return NetworkInterface( + attachmentId: json['attachmentId'] as String?, + ipv6Address: json['ipv6Address'] as String?, + privateIpv4Address: json['privateIpv4Address'] as String?, + ); + } + + Map toJson() { + final attachmentId = this.attachmentId; + final ipv6Address = this.ipv6Address; + final privateIpv4Address = this.privateIpv4Address; + return { + if (attachmentId != null) 'attachmentId': attachmentId, + if (ipv6Address != null) 'ipv6Address': ipv6Address, + if (privateIpv4Address != null) 'privateIpv4Address': privateIpv4Address, + }; + } +} + +/// An object that represents the details of a multi-node parallel job node. +class NodeDetails { + /// Specifies whether the current node is the main node for a multi-node + /// parallel job. + final bool? isMainNode; + + /// The node index for the node. Node index numbering starts at zero. This index + /// is also available on the node with the AWS_BATCH_JOB_NODE_INDEX + /// environment variable. + final int? nodeIndex; + + NodeDetails({ + this.isMainNode, + this.nodeIndex, }); - factory JobSummary.fromJson(Map json) { - return JobSummary( - jobId: json['jobId'] as String, - jobName: json['jobName'] as String, - arrayProperties: json['arrayProperties'] != null - ? ArrayPropertiesSummary.fromJson( - json['arrayProperties'] as Map) - : null, - container: json['container'] != null - ? ContainerSummary.fromJson(json['container'] as Map) - : null, - createdAt: json['createdAt'] as int?, - jobArn: json['jobArn'] as String?, - jobDefinition: json['jobDefinition'] as String?, - nodeProperties: json['nodeProperties'] != null - ? NodePropertiesSummary.fromJson( - json['nodeProperties'] as Map) - : null, - startedAt: json['startedAt'] as int?, - status: (json['status'] as String?)?.toJobStatus(), - statusReason: json['statusReason'] as String?, - stoppedAt: json['stoppedAt'] as int?, + factory NodeDetails.fromJson(Map json) { + return NodeDetails( + isMainNode: json['isMainNode'] as bool?, + nodeIndex: json['nodeIndex'] as int?, ); } Map toJson() { - final jobId = this.jobId; - final jobName = this.jobName; - final arrayProperties = this.arrayProperties; - final container = this.container; - final createdAt = this.createdAt; - final jobArn = this.jobArn; - final jobDefinition = this.jobDefinition; - final nodeProperties = this.nodeProperties; - final startedAt = this.startedAt; - final status = this.status; - final statusReason = this.statusReason; - final stoppedAt = this.stoppedAt; + final isMainNode = this.isMainNode; + final nodeIndex = this.nodeIndex; return { - 'jobId': jobId, - 'jobName': jobName, - if (arrayProperties != null) 'arrayProperties': arrayProperties, - if (container != null) 'container': container, - if (createdAt != null) 'createdAt': createdAt, - if (jobArn != null) 'jobArn': jobArn, - if (jobDefinition != null) 'jobDefinition': jobDefinition, - if (nodeProperties != null) 'nodeProperties': nodeProperties, - if (startedAt != null) 'startedAt': startedAt, - if (status != null) 'status': status.toValue(), - if (statusReason != null) 'statusReason': statusReason, - if (stoppedAt != null) 'stoppedAt': stoppedAt, + if (isMainNode != null) 'isMainNode': isMainNode, + if (nodeIndex != null) 'nodeIndex': nodeIndex, }; } } -/// An object that represents a job timeout configuration. -class JobTimeout { - /// The job timeout time (in seconds) that's measured from the job attempt's - /// startedAt timestamp. After this time passes, Batch terminates - /// your jobs if they aren't finished. The minimum value for the timeout is 60 - /// seconds. - /// - /// For array jobs, the timeout applies to the child jobs, not to the parent - /// array job. +/// An object that represents any node overrides to a job definition that's used +/// in a SubmitJob +/// API operation. +/// +/// This parameter isn't applicable to jobs that are running on Fargate +/// resources. Don't provide it for these jobs. Rather, use +/// containerOverrides instead. +/// +class NodeOverrides { + /// The node property overrides for the job. + final List? nodePropertyOverrides; + + /// The number of nodes to use with a multi-node parallel job. This value + /// overrides the number of nodes that are specified in the job definition. To + /// use this override, you must meet the following conditions: /// - /// For multi-node parallel (MNP) jobs, the timeout applies to the whole job, - /// not to the individual nodes. - final int? attemptDurationSeconds; + ///
      + ///
    • + /// There must be at least one node range in your job definition that has an + /// open upper boundary, such as : or n:. + ///
    • + ///
    • + /// The lower boundary of the node range that's specified in the job definition + /// must be fewer than the number of nodes specified in the override. + ///
    • + ///
    • + /// The main node index that's specified in the job definition must be fewer + /// than the number of nodes specified in the override. + ///
    • + ///
    + final int? numNodes; - JobTimeout({ - this.attemptDurationSeconds, + NodeOverrides({ + this.nodePropertyOverrides, + this.numNodes, }); - factory JobTimeout.fromJson(Map json) { - return JobTimeout( - attemptDurationSeconds: json['attemptDurationSeconds'] as int?, - ); - } - Map toJson() { - final attemptDurationSeconds = this.attemptDurationSeconds; + final nodePropertyOverrides = this.nodePropertyOverrides; + final numNodes = this.numNodes; return { - if (attemptDurationSeconds != null) - 'attemptDurationSeconds': attemptDurationSeconds, + if (nodePropertyOverrides != null) + 'nodePropertyOverrides': nodePropertyOverrides, + if (numNodes != null) 'numNodes': numNodes, }; } } -/// A key-value pair object. -class KeyValuePair { - /// The name of the key-value pair. For environment variables, this is the name - /// of the environment variable. - final String? name; +/// An object that represents the node properties of a multi-node parallel job. +/// +/// Node properties can't be specified for Amazon EKS based job definitions. +/// +class NodeProperties { + /// Specifies the node index for the main node of a multi-node parallel job. + /// This node index value must be fewer than the number of nodes. + final int mainNode; - /// The value of the key-value pair. For environment variables, this is the - /// value of the environment variable. - final String? value; + /// A list of node ranges and their properties that are associated with a + /// multi-node parallel job. + final List nodeRangeProperties; - KeyValuePair({ - this.name, - this.value, + /// The number of nodes that are associated with a multi-node parallel job. + final int numNodes; + + NodeProperties({ + required this.mainNode, + required this.nodeRangeProperties, + required this.numNodes, }); - factory KeyValuePair.fromJson(Map json) { - return KeyValuePair( - name: json['name'] as String?, - value: json['value'] as String?, + factory NodeProperties.fromJson(Map json) { + return NodeProperties( + mainNode: json['mainNode'] as int, + nodeRangeProperties: (json['nodeRangeProperties'] as List) + .whereNotNull() + .map((e) => NodeRangeProperty.fromJson(e as Map)) + .toList(), + numNodes: json['numNodes'] as int, ); } Map toJson() { - final name = this.name; - final value = this.value; + final mainNode = this.mainNode; + final nodeRangeProperties = this.nodeRangeProperties; + final numNodes = this.numNodes; return { - if (name != null) 'name': name, - if (value != null) 'value': value, + 'mainNode': mainNode, + 'nodeRangeProperties': nodeRangeProperties, + 'numNodes': numNodes, }; } } -/// A filter name and value pair that's used to return a more specific list of -/// results from a ListJobs API operation. -class KeyValuesPair { - /// The name of the filter. Filter names are case sensitive. - final String? name; +/// An object that represents the properties of a node that's associated with a +/// multi-node parallel job. +class NodePropertiesSummary { + /// Specifies whether the current node is the main node for a multi-node + /// parallel job. + final bool? isMainNode; - /// The filter values. - final List? values; + /// The node index for the node. Node index numbering begins at zero. This index + /// is also available on the node with the AWS_BATCH_JOB_NODE_INDEX + /// environment variable. + final int? nodeIndex; - KeyValuesPair({ - this.name, - this.values, + /// The number of nodes that are associated with a multi-node parallel job. + final int? numNodes; + + NodePropertiesSummary({ + this.isMainNode, + this.nodeIndex, + this.numNodes, }); + factory NodePropertiesSummary.fromJson(Map json) { + return NodePropertiesSummary( + isMainNode: json['isMainNode'] as bool?, + nodeIndex: json['nodeIndex'] as int?, + numNodes: json['numNodes'] as int?, + ); + } + Map toJson() { - final name = this.name; - final values = this.values; + final isMainNode = this.isMainNode; + final nodeIndex = this.nodeIndex; + final numNodes = this.numNodes; return { - if (name != null) 'name': name, - if (values != null) 'values': values, + if (isMainNode != null) 'isMainNode': isMainNode, + if (nodeIndex != null) 'nodeIndex': nodeIndex, + if (numNodes != null) 'numNodes': numNodes, }; } } -/// An object that represents a launch template that's associated with a compute -/// resource. You must specify either the launch template ID or launch template -/// name in the request, but not both. -/// -/// If security groups are specified using both the -/// securityGroupIds parameter of -/// CreateComputeEnvironment and the launch template, the values in -/// the securityGroupIds parameter of -/// CreateComputeEnvironment will be used. -/// -/// This object isn't applicable to jobs that are running on Fargate resources. -/// -class LaunchTemplateSpecification { - /// The ID of the launch template. - final String? launchTemplateId; - - /// The name of the launch template. - final String? launchTemplateName; - - /// The version number of the launch template, $Latest, or - /// $Default. - /// - /// If the value is $Latest, the latest version of the launch - /// template is used. If the value is $Default, the default version - /// of the launch template is used. - /// - /// If the AMI ID that's used in a compute environment is from the launch - /// template, the AMI isn't changed when the compute environment is updated. - /// It's only changed if the updateToLatestImageVersion parameter - /// for the compute environment is set to true. During an - /// infrastructure update, if either $Latest or - /// $Default is specified, Batch re-evaluates the launch template - /// version, and it might use a different version of the launch template. This - /// is the case even if the launch template isn't specified in the update. When - /// updating a compute environment, changing the launch template requires an - /// infrastructure update of the compute environment. For more information, see - /// Updating - /// compute environments in the Batch User Guide. - /// - /// Default: $Default. - final String? version; +/// The object that represents any node overrides to a job definition that's +/// used in a SubmitJob +/// API operation. +class NodePropertyOverride { + /// The range of nodes, using node index values, that's used to override. A + /// range of 0:3 indicates nodes with index values of + /// 0 through 3. If the starting range value is + /// omitted (:n), then 0 is used to start the range. + /// If the ending range value is omitted (n:), then the highest + /// possible node index is used to end the range. + final String targetNodes; - LaunchTemplateSpecification({ - this.launchTemplateId, - this.launchTemplateName, - this.version, - }); + /// The overrides that are sent to a node range. + final ContainerOverrides? containerOverrides; - factory LaunchTemplateSpecification.fromJson(Map json) { - return LaunchTemplateSpecification( - launchTemplateId: json['launchTemplateId'] as String?, - launchTemplateName: json['launchTemplateName'] as String?, - version: json['version'] as String?, - ); - } + /// An object that contains the properties that you want to replace for the + /// existing Amazon ECS resources of a job. + final EcsPropertiesOverride? ecsPropertiesOverride; + + /// An object that contains the instance types that you want to replace for the + /// existing resources of a job. + final List? instanceTypes; + + NodePropertyOverride({ + required this.targetNodes, + this.containerOverrides, + this.ecsPropertiesOverride, + this.instanceTypes, + }); Map toJson() { - final launchTemplateId = this.launchTemplateId; - final launchTemplateName = this.launchTemplateName; - final version = this.version; + final targetNodes = this.targetNodes; + final containerOverrides = this.containerOverrides; + final ecsPropertiesOverride = this.ecsPropertiesOverride; + final instanceTypes = this.instanceTypes; return { - if (launchTemplateId != null) 'launchTemplateId': launchTemplateId, - if (launchTemplateName != null) 'launchTemplateName': launchTemplateName, - if (version != null) 'version': version, + 'targetNodes': targetNodes, + if (containerOverrides != null) 'containerOverrides': containerOverrides, + if (ecsPropertiesOverride != null) + 'ecsPropertiesOverride': ecsPropertiesOverride, + if (instanceTypes != null) 'instanceTypes': instanceTypes, }; } } -/// Linux-specific modifications that are applied to the container, such as -/// details for device mappings. -class LinuxParameters { - /// Any of the host devices to expose to the container. This parameter maps to - /// Devices in the Create a - /// container section of the Docker Remote API and - /// the --device option to docker run. - /// - /// This parameter isn't applicable to jobs that are running on Fargate - /// resources. Don't provide it for these jobs. - /// - final List? devices; +/// This is an object that represents the properties of the node range for a +/// multi-node parallel job. +class NodeRangeProperty { + /// The range of nodes, using node index values. A range of 0:3 + /// indicates nodes with index values of 0 through 3. + /// If the starting range value is omitted (:n), then + /// 0 is used to start the range. If the ending range value is + /// omitted (n:), then the highest possible node index is used to + /// end the range. Your accumulative node ranges must account for all nodes + /// (0:n). You can nest node ranges (for example, 0:10 + /// and 4:5). In this case, the 4:5 range properties + /// override the 0:10 properties. + final String targetNodes; - /// If true, run an init process inside the container that forwards - /// signals and reaps processes. This parameter maps to the --init - /// option to docker - /// run. This parameter requires version 1.25 of the Docker Remote API or - /// greater on your container instance. To check the Docker Remote API version - /// on your container instance, log in to your container instance and run the - /// following command: sudo docker version | grep "Server API - /// version" - final bool? initProcessEnabled; + /// The container details for the node range. + final ContainerProperties? container; - /// The total amount of swap memory (in MiB) a container can use. This parameter - /// is translated to the --memory-swap option to docker run where - /// the value is the sum of the container memory plus the maxSwap - /// value. For more information, see - /// --memory-swap details in the Docker documentation. - /// - /// If a maxSwap value of 0 is specified, the - /// container doesn't use swap. Accepted values are 0 or any - /// positive integer. If the maxSwap parameter is omitted, the - /// container doesn't use the swap configuration for the container instance that - /// it's running on. A maxSwap value must be set for the - /// swappiness parameter to be used. - /// - /// This parameter isn't applicable to jobs that are running on Fargate - /// resources. Don't provide it for these jobs. - /// - final int? maxSwap; + /// This is an object that represents the properties of the node range for a + /// multi-node parallel job. + final EcsProperties? ecsProperties; - /// The value for the size (in MiB) of the /dev/shm volume. This - /// parameter maps to the --shm-size option to docker run. + /// The instance types of the underlying host infrastructure of a multi-node + /// parallel job. /// /// This parameter isn't applicable to jobs that are running on Fargate - /// resources. Don't provide it for these jobs. - /// - final int? sharedMemorySize; - - /// You can use this parameter to tune a container's memory swappiness behavior. - /// A swappiness value of 0 causes swapping to not - /// occur unless absolutely necessary. A swappiness value of - /// 100 causes pages to be swapped aggressively. Valid values are - /// whole numbers between 0 and 100. If the - /// swappiness parameter isn't specified, a default value of - /// 60 is used. If a value isn't specified for - /// maxSwap, then this parameter is ignored. If - /// maxSwap is set to 0, the container doesn't use swap. This - /// parameter maps to the --memory-swappiness option to docker run. - /// - /// Consider the following when you use a per-container swap configuration. - /// - ///
      - ///
    • - /// Swap space must be enabled and allocated on the container instance for the - /// containers to use. - /// - /// By default, the Amazon ECS optimized AMIs don't have swap enabled. You must - /// enable swap on the instance to use this feature. For more information, see - /// Instance - /// store swap volumes in the Amazon EC2 User Guide for Linux - /// Instances or How - /// do I allocate memory to work as swap space in an Amazon EC2 instance by - /// using a swap file? - ///
    • - ///
    • - /// The swap space parameters are only supported for job definitions using EC2 /// resources. - ///
    • - ///
    • - /// If the maxSwap and swappiness parameters are - /// omitted from a job definition, each container has a default - /// swappiness value of 60. Moreover, the total swap usage is - /// limited to two times the memory reservation of the container. - ///
    • - ///
    - /// This parameter isn't applicable to jobs that are running on Fargate - /// resources. Don't provide it for these jobs. - /// - final int? swappiness; - - /// The container path, mount options, and size (in MiB) of the - /// tmpfs mount. This parameter maps to the --tmpfs - /// option to docker - /// run. - /// - /// This parameter isn't applicable to jobs that are running on Fargate - /// resources. Don't provide this parameter for this resource type. + /// + /// In addition, this list object is currently limited to one element. /// - final List? tmpfs; + final List? instanceTypes; - LinuxParameters({ - this.devices, - this.initProcessEnabled, - this.maxSwap, - this.sharedMemorySize, - this.swappiness, - this.tmpfs, + NodeRangeProperty({ + required this.targetNodes, + this.container, + this.ecsProperties, + this.instanceTypes, }); - factory LinuxParameters.fromJson(Map json) { - return LinuxParameters( - devices: (json['devices'] as List?) - ?.whereNotNull() - .map((e) => Device.fromJson(e as Map)) - .toList(), - initProcessEnabled: json['initProcessEnabled'] as bool?, - maxSwap: json['maxSwap'] as int?, - sharedMemorySize: json['sharedMemorySize'] as int?, - swappiness: json['swappiness'] as int?, - tmpfs: (json['tmpfs'] as List?) + factory NodeRangeProperty.fromJson(Map json) { + return NodeRangeProperty( + targetNodes: json['targetNodes'] as String, + container: json['container'] != null + ? ContainerProperties.fromJson( + json['container'] as Map) + : null, + ecsProperties: json['ecsProperties'] != null + ? EcsProperties.fromJson( + json['ecsProperties'] as Map) + : null, + instanceTypes: (json['instanceTypes'] as List?) ?.whereNotNull() - .map((e) => Tmpfs.fromJson(e as Map)) + .map((e) => e as String) .toList(), ); } Map toJson() { - final devices = this.devices; - final initProcessEnabled = this.initProcessEnabled; - final maxSwap = this.maxSwap; - final sharedMemorySize = this.sharedMemorySize; - final swappiness = this.swappiness; - final tmpfs = this.tmpfs; + final targetNodes = this.targetNodes; + final container = this.container; + final ecsProperties = this.ecsProperties; + final instanceTypes = this.instanceTypes; return { - if (devices != null) 'devices': devices, - if (initProcessEnabled != null) 'initProcessEnabled': initProcessEnabled, - if (maxSwap != null) 'maxSwap': maxSwap, - if (sharedMemorySize != null) 'sharedMemorySize': sharedMemorySize, - if (swappiness != null) 'swappiness': swappiness, - if (tmpfs != null) 'tmpfs': tmpfs, + 'targetNodes': targetNodes, + if (container != null) 'container': container, + if (ecsProperties != null) 'ecsProperties': ecsProperties, + if (instanceTypes != null) 'instanceTypes': instanceTypes, }; } } -class ListJobsResponse { - /// A list of job summaries that match the request. - final List jobSummaryList; +enum OrchestrationType { + ecs, + eks, +} - /// The nextToken value to include in a future - /// ListJobs request. When the results of a ListJobs - /// request exceed maxResults, this value can be used to retrieve - /// the next page of results. This value is null when there are no - /// more results to return. - final String? nextToken; +extension OrchestrationTypeValueExtension on OrchestrationType { + String toValue() { + switch (this) { + case OrchestrationType.ecs: + return 'ECS'; + case OrchestrationType.eks: + return 'EKS'; + } + } +} - ListJobsResponse({ - required this.jobSummaryList, - this.nextToken, - }); +extension OrchestrationTypeFromString on String { + OrchestrationType toOrchestrationType() { + switch (this) { + case 'ECS': + return OrchestrationType.ecs; + case 'EKS': + return OrchestrationType.eks; + } + throw Exception('$this is not known in enum OrchestrationType'); + } +} - factory ListJobsResponse.fromJson(Map json) { - return ListJobsResponse( - jobSummaryList: (json['jobSummaryList'] as List) - .whereNotNull() - .map((e) => JobSummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, - ); +enum PlatformCapability { + ec2, + fargate, +} + +extension PlatformCapabilityValueExtension on PlatformCapability { + String toValue() { + switch (this) { + case PlatformCapability.ec2: + return 'EC2'; + case PlatformCapability.fargate: + return 'FARGATE'; + } } +} - Map toJson() { - final jobSummaryList = this.jobSummaryList; - final nextToken = this.nextToken; - return { - 'jobSummaryList': jobSummaryList, - if (nextToken != null) 'nextToken': nextToken, - }; +extension PlatformCapabilityFromString on String { + PlatformCapability toPlatformCapability() { + switch (this) { + case 'EC2': + return PlatformCapability.ec2; + case 'FARGATE': + return PlatformCapability.fargate; + } + throw Exception('$this is not known in enum PlatformCapability'); } } -class ListSchedulingPoliciesResponse { - /// The nextToken value to include in a future - /// ListSchedulingPolicies request. When the results of a - /// ListSchedulingPolicies request exceed maxResults, - /// this value can be used to retrieve the next page of results. This value is - /// null when there are no more results to return. - final String? nextToken; +class RegisterJobDefinitionResponse { + /// The Amazon Resource Name (ARN) of the job definition. + final String jobDefinitionArn; - /// A list of scheduling policies that match the request. - final List? schedulingPolicies; + /// The name of the job definition. + final String jobDefinitionName; - ListSchedulingPoliciesResponse({ - this.nextToken, - this.schedulingPolicies, + /// The revision of the job definition. + final int revision; + + RegisterJobDefinitionResponse({ + required this.jobDefinitionArn, + required this.jobDefinitionName, + required this.revision, }); - factory ListSchedulingPoliciesResponse.fromJson(Map json) { - return ListSchedulingPoliciesResponse( - nextToken: json['nextToken'] as String?, - schedulingPolicies: (json['schedulingPolicies'] as List?) - ?.whereNotNull() - .map((e) => - SchedulingPolicyListingDetail.fromJson(e as Map)) - .toList(), + factory RegisterJobDefinitionResponse.fromJson(Map json) { + return RegisterJobDefinitionResponse( + jobDefinitionArn: json['jobDefinitionArn'] as String, + jobDefinitionName: json['jobDefinitionName'] as String, + revision: json['revision'] as int, ); } Map toJson() { - final nextToken = this.nextToken; - final schedulingPolicies = this.schedulingPolicies; + final jobDefinitionArn = this.jobDefinitionArn; + final jobDefinitionName = this.jobDefinitionName; + final revision = this.revision; return { - if (nextToken != null) 'nextToken': nextToken, - if (schedulingPolicies != null) 'schedulingPolicies': schedulingPolicies, + 'jobDefinitionArn': jobDefinitionArn, + 'jobDefinitionName': jobDefinitionName, + 'revision': revision, }; } } -class ListTagsForResourceResponse { - /// The tags for the resource. - final Map? tags; +/// The repository credentials for private registry authentication. +class RepositoryCredentials { + /// The Amazon Resource Name (ARN) of the secret containing the private + /// repository credentials. + final String credentialsParameter; - ListTagsForResourceResponse({ - this.tags, + RepositoryCredentials({ + required this.credentialsParameter, }); - factory ListTagsForResourceResponse.fromJson(Map json) { - return ListTagsForResourceResponse( - tags: (json['tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory RepositoryCredentials.fromJson(Map json) { + return RepositoryCredentials( + credentialsParameter: json['credentialsParameter'] as String, ); } Map toJson() { - final tags = this.tags; + final credentialsParameter = this.credentialsParameter; return { - if (tags != null) 'tags': tags, + 'credentialsParameter': credentialsParameter, }; } } -/// Log configuration options to send to a custom log driver for the container. -class LogConfiguration { - /// The log driver to use for the container. The valid values that are listed - /// for this parameter are log drivers that the Amazon ECS container agent can - /// communicate with by default. - /// - /// The supported log drivers are awslogs, fluentd, - /// gelf, json-file, journald, - /// logentries, syslog, and splunk. +/// The type and amount of a resource to assign to a container. The supported +/// resources include GPU, MEMORY, and +/// VCPU. +class ResourceRequirement { + /// The type of resource to assign to a container. The supported resources + /// include GPU, MEMORY, and VCPU. + final ResourceType type; + + /// The quantity of the specified resource to reserve for the container. The + /// values vary based on the type specified. + ///
    type="GPU"
    + /// The number of physical GPUs to reserve for the container. Make sure that the + /// number of GPUs reserved for all containers in a job doesn't exceed the + /// number of available GPUs on the compute resource that the job is launched + /// on. /// - /// Jobs that are running on Fargate resources are restricted to the - /// awslogs and splunk log drivers. - ///
    awslogs
    - /// Specifies the Amazon CloudWatch Logs logging driver. For more information, - /// see Using - /// the awslogs log driver in the Batch User Guide and Amazon - /// CloudWatch Logs logging driver in the Docker documentation. - ///
    fluentd
    - /// Specifies the Fluentd logging driver. For more information including usage - /// and options, see Fluentd - /// logging driver in the Docker documentation. - ///
    gelf
    - /// Specifies the Graylog Extended Format (GELF) logging driver. For more - /// information including usage and options, see Graylog - /// Extended Format logging driver in the Docker documentation. - ///
    journald
    - /// Specifies the journald logging driver. For more information including usage - /// and options, see Journald - /// logging driver in the Docker documentation. - ///
    json-file
    - /// Specifies the JSON file logging driver. For more information including usage - /// and options, see JSON - /// File logging driver in the Docker documentation. - ///
    splunk
    - /// Specifies the Splunk logging driver. For more information including usage - /// and options, see Splunk - /// logging driver in the Docker documentation. - ///
    syslog
    - /// Specifies the syslog logging driver. For more information including usage - /// and options, see Syslog - /// logging driver in the Docker documentation. - ///
    - /// If you have a custom driver that's not listed earlier that you want to work - /// with the Amazon ECS container agent, you can fork the Amazon ECS container - /// agent project that's available on GitHub and - /// customize it to work with that driver. We encourage you to submit pull - /// requests for changes that you want to have included. However, Amazon Web - /// Services doesn't currently support running modified copies of this software. + /// GPUs aren't available for jobs that are running on Fargate resources. + ///
    type="MEMORY"
    + /// The memory hard limit (in MiB) present to the container. This parameter is + /// supported for jobs that are running on Amazon EC2 resources. If your + /// container attempts to exceed the memory specified, the container is + /// terminated. This parameter maps to Memory in the Create a + /// container section of the Docker Remote API and + /// the --memory option to docker run. You + /// must specify at least 4 MiB of memory for a job. This is required but can be + /// specified in several places for multi-node parallel (MNP) jobs. It must be + /// specified for each node at least once. This parameter maps to + /// Memory in the Create a + /// container section of the Docker Remote API and + /// the --memory option to docker run. + /// + /// If you're trying to maximize your resource utilization by providing your + /// jobs as much memory as possible for a particular instance type, see Memory + /// management in the Batch User Guide. /// - /// This parameter requires version 1.18 of the Docker Remote API or greater on - /// your container instance. To check the Docker Remote API version on your - /// container instance, log in to your container instance and run the following - /// command: sudo docker version | grep "Server API version" - final LogDriver logDriver; - - /// The configuration options to send to the log driver. This parameter requires - /// version 1.19 of the Docker Remote API or greater on your container instance. - /// To check the Docker Remote API version on your container instance, log in to - /// your container instance and run the following command: sudo docker - /// version | grep "Server API version" - final Map? options; - - /// The secrets to pass to the log configuration. For more information, see Specifying - /// sensitive data in the Batch User Guide. - final List? secretOptions; + /// For jobs that are running on Fargate resources, then value is + /// the hard limit (in MiB), and must match one of the supported values and the + /// VCPU values must be one of the values supported for that memory + /// value. + ///
    value = 512
    + /// VCPU = 0.25 + ///
    value = 1024
    + /// VCPU = 0.25 or 0.5 + ///
    value = 2048
    + /// VCPU = 0.25, 0.5, or 1 + ///
    value = 3072
    + /// VCPU = 0.5, or 1 + ///
    value = 4096
    + /// VCPU = 0.5, 1, or 2 + ///
    value = 5120, 6144, or 7168
    + /// VCPU = 1 or 2 + ///
    value = 8192
    + /// VCPU = 1, 2, or 4 + ///
    value = 9216, 10240, 11264, 12288, 13312, 14336, or 15360
    + ///
    + /// VCPU = 2 or 4 + ///
    value = 16384
    + /// VCPU = 2, 4, or 8 + ///
    value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, + /// 27648, 29696, or 30720
    + /// VCPU = 4 + ///
    value = 20480, 24576, or 28672
    + /// VCPU = 4 or 8 + ///
    value = 36864, 45056, 53248, or 61440
    + /// VCPU = 8 + ///
    value = 32768, 40960, 49152, or 57344
    + /// VCPU = 8 or 16 + ///
    value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or + /// 122880
    + /// VCPU = 16 + ///
    type="VCPU"
    + /// The number of vCPUs reserved for the container. This parameter maps to + /// CpuShares in the Create a + /// container section of the Docker Remote API and + /// the --cpu-shares option to docker run. Each + /// vCPU is equivalent to 1,024 CPU shares. For Amazon EC2 resources, you must + /// specify at least one vCPU. This is required but can be specified in several + /// places; it must be specified for each node at least once. + /// + /// The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. + /// For more information about Fargate quotas, see Fargate + /// quotas in the Amazon Web Services General Reference. + /// + /// For jobs that are running on Fargate resources, then value must + /// match one of the supported values and the MEMORY values must be + /// one of the values supported for that VCPU value. The supported + /// values are 0.25, 0.5, 1, 2, 4, 8, and 16 + ///
    value = 0.25
    + /// MEMORY = 512, 1024, or 2048 + ///
    value = 0.5
    + /// MEMORY = 1024, 2048, 3072, or 4096 + ///
    value = 1
    + /// MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192 + ///
    value = 2
    + /// MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, + /// 12288, 13312, 14336, 15360, or 16384 + ///
    value = 4
    + /// MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, + /// 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, + /// 27648, 28672, 29696, or 30720 + ///
    value = 8
    + /// MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, 40960, + /// 45056, 49152, 53248, 57344, or 61440 + ///
    value = 16
    + /// MEMORY = 32768, 40960, 49152, 57344, 65536, 73728, 81920, + /// 90112, 98304, 106496, 114688, or 122880 + ///
    + final String value; - LogConfiguration({ - required this.logDriver, - this.options, - this.secretOptions, + ResourceRequirement({ + required this.type, + required this.value, }); - factory LogConfiguration.fromJson(Map json) { - return LogConfiguration( - logDriver: (json['logDriver'] as String).toLogDriver(), - options: (json['options'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - secretOptions: (json['secretOptions'] as List?) - ?.whereNotNull() - .map((e) => Secret.fromJson(e as Map)) - .toList(), + factory ResourceRequirement.fromJson(Map json) { + return ResourceRequirement( + type: (json['type'] as String).toResourceType(), + value: json['value'] as String, ); } Map toJson() { - final logDriver = this.logDriver; - final options = this.options; - final secretOptions = this.secretOptions; + final type = this.type; + final value = this.value; return { - 'logDriver': logDriver.toValue(), - if (options != null) 'options': options, - if (secretOptions != null) 'secretOptions': secretOptions, + 'type': type.toValue(), + 'value': value, }; } } -enum LogDriver { - jsonFile, - syslog, - journald, - gelf, - fluentd, - awslogs, - splunk, +enum ResourceType { + gpu, + vcpu, + memory, } -extension LogDriverValueExtension on LogDriver { +extension ResourceTypeValueExtension on ResourceType { String toValue() { switch (this) { - case LogDriver.jsonFile: - return 'json-file'; - case LogDriver.syslog: - return 'syslog'; - case LogDriver.journald: - return 'journald'; - case LogDriver.gelf: - return 'gelf'; - case LogDriver.fluentd: - return 'fluentd'; - case LogDriver.awslogs: - return 'awslogs'; - case LogDriver.splunk: - return 'splunk'; + case ResourceType.gpu: + return 'GPU'; + case ResourceType.vcpu: + return 'VCPU'; + case ResourceType.memory: + return 'MEMORY'; } } } -extension LogDriverFromString on String { - LogDriver toLogDriver() { +extension ResourceTypeFromString on String { + ResourceType toResourceType() { switch (this) { - case 'json-file': - return LogDriver.jsonFile; - case 'syslog': - return LogDriver.syslog; - case 'journald': - return LogDriver.journald; - case 'gelf': - return LogDriver.gelf; - case 'fluentd': - return LogDriver.fluentd; - case 'awslogs': - return LogDriver.awslogs; - case 'splunk': - return LogDriver.splunk; + case 'GPU': + return ResourceType.gpu; + case 'VCPU': + return ResourceType.vcpu; + case 'MEMORY': + return ResourceType.memory; } - throw Exception('$this is not known in enum LogDriver'); + throw Exception('$this is not known in enum ResourceType'); } } -/// Details for a Docker volume mount point that's used in a job's container -/// properties. This parameter maps to Volumes in the Create -/// a container section of the Docker Remote API and the -/// --volume option to docker run. -class MountPoint { - /// The path on the container where the host volume is mounted. - final String? containerPath; - - /// If this value is true, the container has read-only access to - /// the volume. Otherwise, the container can write to the volume. The default - /// value is false. - final bool? readOnly; - - /// The name of the volume to mount. - final String? sourceVolume; - - MountPoint({ - this.containerPath, - this.readOnly, - this.sourceVolume, - }); - - factory MountPoint.fromJson(Map json) { - return MountPoint( - containerPath: json['containerPath'] as String?, - readOnly: json['readOnly'] as bool?, - sourceVolume: json['sourceVolume'] as String?, - ); - } - - Map toJson() { - final containerPath = this.containerPath; - final readOnly = this.readOnly; - final sourceVolume = this.sourceVolume; - return { - if (containerPath != null) 'containerPath': containerPath, - if (readOnly != null) 'readOnly': readOnly, - if (sourceVolume != null) 'sourceVolume': sourceVolume, - }; - } +enum RetryAction { + retry, + exit, } -/// The network configuration for jobs that are running on Fargate resources. -/// Jobs that are running on EC2 resources must not specify this parameter. -class NetworkConfiguration { - /// Indicates whether the job has a public IP address. For a job that's running - /// on Fargate resources in a private subnet to send outbound traffic to the - /// internet (for example, to pull container images), the private subnet - /// requires a NAT gateway be attached to route requests to the internet. For - /// more information, see Amazon - /// ECS task networking in the Amazon Elastic Container Service Developer - /// Guide. The default value is "DISABLED". - final AssignPublicIp? assignPublicIp; - - NetworkConfiguration({ - this.assignPublicIp, - }); - - factory NetworkConfiguration.fromJson(Map json) { - return NetworkConfiguration( - assignPublicIp: (json['assignPublicIp'] as String?)?.toAssignPublicIp(), - ); - } - - Map toJson() { - final assignPublicIp = this.assignPublicIp; - return { - if (assignPublicIp != null) 'assignPublicIp': assignPublicIp.toValue(), - }; +extension RetryActionValueExtension on RetryAction { + String toValue() { + switch (this) { + case RetryAction.retry: + return 'RETRY'; + case RetryAction.exit: + return 'EXIT'; + } } } -/// An object that represents the elastic network interface for a multi-node -/// parallel job node. -class NetworkInterface { - /// The attachment ID for the network interface. - final String? attachmentId; - - /// The private IPv6 address for the network interface. - final String? ipv6Address; - - /// The private IPv4 address for the network interface. - final String? privateIpv4Address; - - NetworkInterface({ - this.attachmentId, - this.ipv6Address, - this.privateIpv4Address, - }); - - factory NetworkInterface.fromJson(Map json) { - return NetworkInterface( - attachmentId: json['attachmentId'] as String?, - ipv6Address: json['ipv6Address'] as String?, - privateIpv4Address: json['privateIpv4Address'] as String?, - ); - } - - Map toJson() { - final attachmentId = this.attachmentId; - final ipv6Address = this.ipv6Address; - final privateIpv4Address = this.privateIpv4Address; - return { - if (attachmentId != null) 'attachmentId': attachmentId, - if (ipv6Address != null) 'ipv6Address': ipv6Address, - if (privateIpv4Address != null) 'privateIpv4Address': privateIpv4Address, - }; +extension RetryActionFromString on String { + RetryAction toRetryAction() { + switch (this) { + case 'RETRY': + return RetryAction.retry; + case 'EXIT': + return RetryAction.exit; + } + throw Exception('$this is not known in enum RetryAction'); } } -/// An object that represents the details of a multi-node parallel job node. -class NodeDetails { - /// Specifies whether the current node is the main node for a multi-node - /// parallel job. - final bool? isMainNode; +/// The retry strategy that's associated with a job. For more information, see +/// Automated +/// job retries in the Batch User Guide. +class RetryStrategy { + /// The number of times to move a job to the RUNNABLE status. You + /// can specify between 1 and 10 attempts. If the value of attempts + /// is greater than one, the job is retried on failure the same number of + /// attempts as the value. + final int? attempts; - /// The node index for the node. Node index numbering starts at zero. This index - /// is also available on the node with the AWS_BATCH_JOB_NODE_INDEX - /// environment variable. - final int? nodeIndex; + /// Array of up to 5 objects that specify the conditions where jobs are retried + /// or failed. If this parameter is specified, then the attempts + /// parameter must also be specified. If none of the listed conditions match, + /// then the job is retried. + final List? evaluateOnExit; - NodeDetails({ - this.isMainNode, - this.nodeIndex, + RetryStrategy({ + this.attempts, + this.evaluateOnExit, }); - factory NodeDetails.fromJson(Map json) { - return NodeDetails( - isMainNode: json['isMainNode'] as bool?, - nodeIndex: json['nodeIndex'] as int?, + factory RetryStrategy.fromJson(Map json) { + return RetryStrategy( + attempts: json['attempts'] as int?, + evaluateOnExit: (json['evaluateOnExit'] as List?) + ?.whereNotNull() + .map((e) => EvaluateOnExit.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final isMainNode = this.isMainNode; - final nodeIndex = this.nodeIndex; - return { - if (isMainNode != null) 'isMainNode': isMainNode, - if (nodeIndex != null) 'nodeIndex': nodeIndex, - }; - } -} - -/// An object that represents any node overrides to a job definition that's used -/// in a SubmitJob API operation. -/// -/// This parameter isn't applicable to jobs that are running on Fargate -/// resources. Don't provide it for these jobs. Rather, use -/// containerOverrides instead. -/// -class NodeOverrides { - /// The node property overrides for the job. - final List? nodePropertyOverrides; - - /// The number of nodes to use with a multi-node parallel job. This value - /// overrides the number of nodes that are specified in the job definition. To - /// use this override, you must meet the following conditions: - /// - ///
      - ///
    • - /// There must be at least one node range in your job definition that has an - /// open upper boundary, such as : or n:. - ///
    • - ///
    • - /// The lower boundary of the node range that's specified in the job definition - /// must be fewer than the number of nodes specified in the override. - ///
    • - ///
    • - /// The main node index that's specified in the job definition must be fewer - /// than the number of nodes specified in the override. - ///
    • - ///
    - final int? numNodes; - - NodeOverrides({ - this.nodePropertyOverrides, - this.numNodes, - }); - - Map toJson() { - final nodePropertyOverrides = this.nodePropertyOverrides; - final numNodes = this.numNodes; + final attempts = this.attempts; + final evaluateOnExit = this.evaluateOnExit; return { - if (nodePropertyOverrides != null) - 'nodePropertyOverrides': nodePropertyOverrides, - if (numNodes != null) 'numNodes': numNodes, + if (attempts != null) 'attempts': attempts, + if (evaluateOnExit != null) 'evaluateOnExit': evaluateOnExit, }; } } -/// An object that represents the node properties of a multi-node parallel job. -/// -/// Node properties can't be specified for Amazon EKS based job definitions. -/// -class NodeProperties { - /// Specifies the node index for the main node of a multi-node parallel job. - /// This node index value must be fewer than the number of nodes. - final int mainNode; - - /// A list of node ranges and their properties that are associated with a - /// multi-node parallel job. - final List nodeRangeProperties; +/// An object that represents the compute environment architecture for Batch +/// jobs on Fargate. +class RuntimePlatform { + /// The vCPU architecture. The default value is X86_64. Valid + /// values are X86_64 and ARM64. + /// + /// This parameter must be set to X86_64 for Windows containers. + /// + /// Fargate Spot is not supported for ARM64 and Windows-based + /// containers on Fargate. A job queue will be blocked if a Fargate + /// ARM64 or Windows job is submitted to a job queue with only + /// Fargate Spot compute environments. However, you can attach both + /// FARGATE and FARGATE_SPOT compute environments to + /// the same job queue. + /// + final String? cpuArchitecture; - /// The number of nodes that are associated with a multi-node parallel job. - final int numNodes; + /// The operating system for the compute environment. Valid values are: + /// LINUX (default), WINDOWS_SERVER_2019_CORE, + /// WINDOWS_SERVER_2019_FULL, + /// WINDOWS_SERVER_2022_CORE, and + /// WINDOWS_SERVER_2022_FULL. + /// + /// The following parameters can’t be set for Windows containers: + /// linuxParameters, privileged, user, + /// ulimits, readonlyRootFilesystem, and + /// efsVolumeConfiguration. + /// + /// The Batch Scheduler checks the compute environments that are attached to the + /// job queue before registering a task definition with Fargate. In this + /// scenario, the job queue is where the job is submitted. If the job requires a + /// Windows container and the first compute environment is LINUX, + /// the compute environment is skipped and the next compute environment is + /// checked until a Windows-based compute environment is found. + /// + /// Fargate Spot is not supported for ARM64 and Windows-based + /// containers on Fargate. A job queue will be blocked if a Fargate + /// ARM64 or Windows job is submitted to a job queue with only + /// Fargate Spot compute environments. However, you can attach both + /// FARGATE and FARGATE_SPOT compute environments to + /// the same job queue. + /// + final String? operatingSystemFamily; - NodeProperties({ - required this.mainNode, - required this.nodeRangeProperties, - required this.numNodes, + RuntimePlatform({ + this.cpuArchitecture, + this.operatingSystemFamily, }); - factory NodeProperties.fromJson(Map json) { - return NodeProperties( - mainNode: json['mainNode'] as int, - nodeRangeProperties: (json['nodeRangeProperties'] as List) - .whereNotNull() - .map((e) => NodeRangeProperty.fromJson(e as Map)) - .toList(), - numNodes: json['numNodes'] as int, + factory RuntimePlatform.fromJson(Map json) { + return RuntimePlatform( + cpuArchitecture: json['cpuArchitecture'] as String?, + operatingSystemFamily: json['operatingSystemFamily'] as String?, ); } Map toJson() { - final mainNode = this.mainNode; - final nodeRangeProperties = this.nodeRangeProperties; - final numNodes = this.numNodes; + final cpuArchitecture = this.cpuArchitecture; + final operatingSystemFamily = this.operatingSystemFamily; return { - 'mainNode': mainNode, - 'nodeRangeProperties': nodeRangeProperties, - 'numNodes': numNodes, + if (cpuArchitecture != null) 'cpuArchitecture': cpuArchitecture, + if (operatingSystemFamily != null) + 'operatingSystemFamily': operatingSystemFamily, }; } } -/// An object that represents the properties of a node that's associated with a -/// multi-node parallel job. -class NodePropertiesSummary { - /// Specifies whether the current node is the main node for a multi-node - /// parallel job. - final bool? isMainNode; +/// An object that represents a scheduling policy. +class SchedulingPolicyDetail { + /// The Amazon Resource Name (ARN) of the scheduling policy. An example is + /// arn:aws:batch:us-east-1:123456789012:scheduling-policy/HighPriority + /// . + final String arn; - /// The node index for the node. Node index numbering begins at zero. This index - /// is also available on the node with the AWS_BATCH_JOB_NODE_INDEX - /// environment variable. - final int? nodeIndex; + /// The name of the scheduling policy. + final String name; - /// The number of nodes that are associated with a multi-node parallel job. - final int? numNodes; + /// The fair share policy for the scheduling policy. + final FairsharePolicy? fairsharePolicy; - NodePropertiesSummary({ - this.isMainNode, - this.nodeIndex, - this.numNodes, + /// The tags that you apply to the scheduling policy to categorize and organize + /// your resources. Each tag consists of a key and an optional value. For more + /// information, see Tagging + /// Amazon Web Services resources in Amazon Web Services General + /// Reference. + final Map? tags; + + SchedulingPolicyDetail({ + required this.arn, + required this.name, + this.fairsharePolicy, + this.tags, }); - factory NodePropertiesSummary.fromJson(Map json) { - return NodePropertiesSummary( - isMainNode: json['isMainNode'] as bool?, - nodeIndex: json['nodeIndex'] as int?, - numNodes: json['numNodes'] as int?, + factory SchedulingPolicyDetail.fromJson(Map json) { + return SchedulingPolicyDetail( + arn: json['arn'] as String, + name: json['name'] as String, + fairsharePolicy: json['fairsharePolicy'] != null + ? FairsharePolicy.fromJson( + json['fairsharePolicy'] as Map) + : null, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final isMainNode = this.isMainNode; - final nodeIndex = this.nodeIndex; - final numNodes = this.numNodes; + final arn = this.arn; + final name = this.name; + final fairsharePolicy = this.fairsharePolicy; + final tags = this.tags; return { - if (isMainNode != null) 'isMainNode': isMainNode, - if (nodeIndex != null) 'nodeIndex': nodeIndex, - if (numNodes != null) 'numNodes': numNodes, + 'arn': arn, + 'name': name, + if (fairsharePolicy != null) 'fairsharePolicy': fairsharePolicy, + if (tags != null) 'tags': tags, }; } } -/// The object that represents any node overrides to a job definition that's -/// used in a SubmitJob API operation. -class NodePropertyOverride { - /// The range of nodes, using node index values, that's used to override. A - /// range of 0:3 indicates nodes with index values of - /// 0 through 3. If the starting range value is - /// omitted (:n), then 0 is used to start the range. - /// If the ending range value is omitted (n:), then the highest - /// possible node index is used to end the range. - final String targetNodes; - - /// The overrides that are sent to a node range. - final ContainerOverrides? containerOverrides; +/// An object that contains the details of a scheduling policy that's returned +/// in a ListSchedulingPolicy action. +class SchedulingPolicyListingDetail { + /// Amazon Resource Name (ARN) of the scheduling policy. + final String arn; - NodePropertyOverride({ - required this.targetNodes, - this.containerOverrides, + SchedulingPolicyListingDetail({ + required this.arn, }); + factory SchedulingPolicyListingDetail.fromJson(Map json) { + return SchedulingPolicyListingDetail( + arn: json['arn'] as String, + ); + } + Map toJson() { - final targetNodes = this.targetNodes; - final containerOverrides = this.containerOverrides; + final arn = this.arn; return { - 'targetNodes': targetNodes, - if (containerOverrides != null) 'containerOverrides': containerOverrides, + 'arn': arn, }; } } -/// An object that represents the properties of the node range for a multi-node -/// parallel job. -class NodeRangeProperty { - /// The range of nodes, using node index values. A range of 0:3 - /// indicates nodes with index values of 0 through 3. - /// If the starting range value is omitted (:n), then - /// 0 is used to start the range. If the ending range value is - /// omitted (n:), then the highest possible node index is used to - /// end the range. Your accumulative node ranges must account for all nodes - /// (0:n). You can nest node ranges (for example, 0:10 - /// and 4:5). In this case, the 4:5 range properties - /// override the 0:10 properties. - final String targetNodes; +/// An object that represents the secret to expose to your container. Secrets +/// can be exposed to a container in the following ways: +/// +///
      +///
    • +/// To inject sensitive data into your containers as environment variables, use +/// the secrets container definition parameter. +///
    • +///
    • +/// To reference sensitive information in the log configuration of a container, +/// use the secretOptions container definition parameter. +///
    • +///
    +/// For more information, see Specifying +/// sensitive data in the Batch User Guide. +class Secret { + /// The name of the secret. + final String name; - /// The container details for the node range. - final ContainerProperties? container; + /// The secret to expose to the container. The supported values are either the + /// full Amazon Resource Name (ARN) of the Secrets Manager secret or the full + /// ARN of the parameter in the Amazon Web Services Systems Manager Parameter + /// Store. + /// + /// If the Amazon Web Services Systems Manager Parameter Store parameter exists + /// in the same Region as the job you're launching, then you can use either the + /// full Amazon Resource Name (ARN) or name of the parameter. If the parameter + /// exists in a different Region, then the full ARN must be specified. + /// + final String valueFrom; - NodeRangeProperty({ - required this.targetNodes, - this.container, + Secret({ + required this.name, + required this.valueFrom, }); - factory NodeRangeProperty.fromJson(Map json) { - return NodeRangeProperty( - targetNodes: json['targetNodes'] as String, - container: json['container'] != null - ? ContainerProperties.fromJson( - json['container'] as Map) - : null, + factory Secret.fromJson(Map json) { + return Secret( + name: json['name'] as String, + valueFrom: json['valueFrom'] as String, ); } Map toJson() { - final targetNodes = this.targetNodes; - final container = this.container; + final name = this.name; + final valueFrom = this.valueFrom; return { - 'targetNodes': targetNodes, - if (container != null) 'container': container, + 'name': name, + 'valueFrom': valueFrom, }; } } -enum OrchestrationType { - ecs, - eks, -} - -extension OrchestrationTypeValueExtension on OrchestrationType { - String toValue() { - switch (this) { - case OrchestrationType.ecs: - return 'ECS'; - case OrchestrationType.eks: - return 'EKS'; - } - } -} - -extension OrchestrationTypeFromString on String { - OrchestrationType toOrchestrationType() { - switch (this) { - case 'ECS': - return OrchestrationType.ecs; - case 'EKS': - return OrchestrationType.eks; - } - throw Exception('$this is not known in enum OrchestrationType'); - } -} - -enum PlatformCapability { - ec2, - fargate, -} - -extension PlatformCapabilityValueExtension on PlatformCapability { - String toValue() { - switch (this) { - case PlatformCapability.ec2: - return 'EC2'; - case PlatformCapability.fargate: - return 'FARGATE'; - } - } -} - -extension PlatformCapabilityFromString on String { - PlatformCapability toPlatformCapability() { - switch (this) { - case 'EC2': - return PlatformCapability.ec2; - case 'FARGATE': - return PlatformCapability.fargate; - } - throw Exception('$this is not known in enum PlatformCapability'); - } -} - -class RegisterJobDefinitionResponse { - /// The Amazon Resource Name (ARN) of the job definition. - final String jobDefinitionArn; - - /// The name of the job definition. - final String jobDefinitionName; +/// Specifies the weights for the fair share identifiers for the fair share +/// policy. Fair share identifiers that aren't included have a default weight of +/// 1.0. +class ShareAttributes { + /// A fair share identifier or fair share identifier prefix. If the string ends + /// with an asterisk (*), this entry specifies the weight factor to use for fair + /// share identifiers that start with that prefix. The list of fair share + /// identifiers in a fair share policy can't overlap. For example, you can't + /// have one that specifies a shareIdentifier of + /// UserA* and another that specifies a + /// shareIdentifier of UserA-1. + /// + /// There can be no more than 500 fair share identifiers active in a job queue. + /// + /// The string is limited to 255 alphanumeric characters, and can be followed by + /// an asterisk (*). + final String shareIdentifier; - /// The revision of the job definition. - final int revision; + /// The weight factor for the fair share identifier. The default value is 1.0. A + /// lower value has a higher priority for compute resources. For example, jobs + /// that use a share identifier with a weight factor of 0.125 (1/8) get 8 times + /// the compute resources of jobs that use a share identifier with a weight + /// factor of 1. + /// + /// The smallest supported value is 0.0001, and the largest supported value is + /// 999.9999. + final double? weightFactor; - RegisterJobDefinitionResponse({ - required this.jobDefinitionArn, - required this.jobDefinitionName, - required this.revision, + ShareAttributes({ + required this.shareIdentifier, + this.weightFactor, }); - factory RegisterJobDefinitionResponse.fromJson(Map json) { - return RegisterJobDefinitionResponse( - jobDefinitionArn: json['jobDefinitionArn'] as String, - jobDefinitionName: json['jobDefinitionName'] as String, - revision: json['revision'] as int, + factory ShareAttributes.fromJson(Map json) { + return ShareAttributes( + shareIdentifier: json['shareIdentifier'] as String, + weightFactor: json['weightFactor'] as double?, ); } Map toJson() { - final jobDefinitionArn = this.jobDefinitionArn; - final jobDefinitionName = this.jobDefinitionName; - final revision = this.revision; + final shareIdentifier = this.shareIdentifier; + final weightFactor = this.weightFactor; return { - 'jobDefinitionArn': jobDefinitionArn, - 'jobDefinitionName': jobDefinitionName, - 'revision': revision, + 'shareIdentifier': shareIdentifier, + if (weightFactor != null) 'weightFactor': weightFactor, }; } } -/// The type and amount of a resource to assign to a container. The supported -/// resources include GPU, MEMORY, and -/// VCPU. -class ResourceRequirement { - /// The type of resource to assign to a container. The supported resources - /// include GPU, MEMORY, and VCPU. - final ResourceType type; +class SubmitJobResponse { + /// The unique identifier for the job. + final String jobId; - /// The quantity of the specified resource to reserve for the container. The - /// values vary based on the type specified. - ///
    type="GPU"
    - /// The number of physical GPUs to reserve for the container. Make sure that the - /// number of GPUs reserved for all containers in a job doesn't exceed the - /// number of available GPUs on the compute resource that the job is launched - /// on. - /// - /// GPUs aren't available for jobs that are running on Fargate resources. - ///
    type="MEMORY"
    - /// The memory hard limit (in MiB) present to the container. This parameter is - /// supported for jobs that are running on EC2 resources. If your container - /// attempts to exceed the memory specified, the container is terminated. This - /// parameter maps to Memory in the Create a - /// container section of the Docker Remote API and - /// the --memory option to docker run. You - /// must specify at least 4 MiB of memory for a job. This is required but can be - /// specified in several places for multi-node parallel (MNP) jobs. It must be - /// specified for each node at least once. This parameter maps to - /// Memory in the Create a - /// container section of the Docker Remote API and - /// the --memory option to docker run. - /// - /// If you're trying to maximize your resource utilization by providing your - /// jobs as much memory as possible for a particular instance type, see Memory - /// management in the Batch User Guide. - /// - /// For jobs that are running on Fargate resources, then value is - /// the hard limit (in MiB), and must match one of the supported values and the - /// VCPU values must be one of the values supported for that memory - /// value. - ///
    value = 512
    - /// VCPU = 0.25 - ///
    value = 1024
    - /// VCPU = 0.25 or 0.5 - ///
    value = 2048
    - /// VCPU = 0.25, 0.5, or 1 - ///
    value = 3072
    - /// VCPU = 0.5, or 1 - ///
    value = 4096
    - /// VCPU = 0.5, 1, or 2 - ///
    value = 5120, 6144, or 7168
    - /// VCPU = 1 or 2 - ///
    value = 8192
    - /// VCPU = 1, 2, or 4 - ///
    value = 9216, 10240, 11264, 12288, 13312, 14336, or 15360
    - ///
    - /// VCPU = 2 or 4 - ///
    value = 16384
    - /// VCPU = 2, 4, or 8 - ///
    value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, - /// 27648, 29696, or 30720
    - /// VCPU = 4 - ///
    value = 20480, 24576, or 28672
    - /// VCPU = 4 or 8 - ///
    value = 36864, 45056, 53248, or 61440
    - /// VCPU = 8 - ///
    value = 32768, 40960, 49152, or 57344
    - /// VCPU = 8 or 16 - ///
    value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or - /// 122880
    - /// VCPU = 16 - ///
    type="VCPU"
    - /// The number of vCPUs reserved for the container. This parameter maps to - /// CpuShares in the Create a - /// container section of the Docker Remote API and - /// the --cpu-shares option to docker run. Each - /// vCPU is equivalent to 1,024 CPU shares. For EC2 resources, you must specify - /// at least one vCPU. This is required but can be specified in several places; - /// it must be specified for each node at least once. - /// - /// The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. - /// For more information about Fargate quotas, see Fargate - /// quotas in the Amazon Web Services General Reference. - /// - /// For jobs that are running on Fargate resources, then value must - /// match one of the supported values and the MEMORY values must be - /// one of the values supported for that VCPU value. The supported - /// values are 0.25, 0.5, 1, 2, 4, 8, and 16 - ///
    value = 0.25
    - /// MEMORY = 512, 1024, or 2048 - ///
    value = 0.5
    - /// MEMORY = 1024, 2048, 3072, or 4096 - ///
    value = 1
    - /// MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192 - ///
    value = 2
    - /// MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, - /// 12288, 13312, 14336, 15360, or 16384 - ///
    value = 4
    - /// MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, - /// 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, - /// 27648, 28672, 29696, or 30720 - ///
    value = 8
    - /// MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, 40960, - /// 45056, 49152, 53248, 57344, or 61440 - ///
    value = 16
    - /// MEMORY = 32768, 40960, 49152, 57344, 65536, 73728, 81920, - /// 90112, 98304, 106496, 114688, or 122880 - ///
    - final String value; + /// The name of the job. + final String jobName; + + /// The Amazon Resource Name (ARN) for the job. + final String? jobArn; - ResourceRequirement({ - required this.type, - required this.value, + SubmitJobResponse({ + required this.jobId, + required this.jobName, + this.jobArn, }); - factory ResourceRequirement.fromJson(Map json) { - return ResourceRequirement( - type: (json['type'] as String).toResourceType(), - value: json['value'] as String, + factory SubmitJobResponse.fromJson(Map json) { + return SubmitJobResponse( + jobId: json['jobId'] as String, + jobName: json['jobName'] as String, + jobArn: json['jobArn'] as String?, ); } Map toJson() { - final type = this.type; - final value = this.value; + final jobId = this.jobId; + final jobName = this.jobName; + final jobArn = this.jobArn; return { - 'type': type.toValue(), - 'value': value, + 'jobId': jobId, + 'jobName': jobName, + if (jobArn != null) 'jobArn': jobArn, }; } } -enum ResourceType { - gpu, - vcpu, - memory, -} +class TagResourceResponse { + TagResourceResponse(); -extension ResourceTypeValueExtension on ResourceType { - String toValue() { - switch (this) { - case ResourceType.gpu: - return 'GPU'; - case ResourceType.vcpu: - return 'VCPU'; - case ResourceType.memory: - return 'MEMORY'; - } + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); } -} -extension ResourceTypeFromString on String { - ResourceType toResourceType() { - switch (this) { - case 'GPU': - return ResourceType.gpu; - case 'VCPU': - return ResourceType.vcpu; - case 'MEMORY': - return ResourceType.memory; - } - throw Exception('$this is not known in enum ResourceType'); + Map toJson() { + return {}; } } -enum RetryAction { - retry, - exit, -} +/// A list of containers that this task depends on. +class TaskContainerDependency { + /// The dependency condition of the container. The following are the available + /// conditions and their behavior: + /// + ///
      + ///
    • + /// START - This condition emulates the behavior of links and + /// volumes today. It validates that a dependent container is started before + /// permitting other containers to start. + ///
    • + ///
    • + /// COMPLETE - This condition validates that a dependent container + /// runs to completion (exits) before permitting other containers to start. This + /// can be useful for nonessential containers that run a script and then exit. + /// This condition can't be set on an essential container. + ///
    • + ///
    • + /// SUCCESS - This condition is the same as COMPLETE, + /// but it also requires that the container exits with a zero status. This + /// condition can't be set on an essential container. + ///
    • + ///
    + final String? condition; -extension RetryActionValueExtension on RetryAction { - String toValue() { - switch (this) { - case RetryAction.retry: - return 'RETRY'; - case RetryAction.exit: - return 'EXIT'; - } + /// A unique identifier for the container. + final String? containerName; + + TaskContainerDependency({ + this.condition, + this.containerName, + }); + + factory TaskContainerDependency.fromJson(Map json) { + return TaskContainerDependency( + condition: json['condition'] as String?, + containerName: json['containerName'] as String?, + ); } -} -extension RetryActionFromString on String { - RetryAction toRetryAction() { - switch (this) { - case 'RETRY': - return RetryAction.retry; - case 'EXIT': - return RetryAction.exit; - } - throw Exception('$this is not known in enum RetryAction'); + Map toJson() { + final condition = this.condition; + final containerName = this.containerName; + return { + if (condition != null) 'condition': condition, + if (containerName != null) 'containerName': containerName, + }; } } -/// The retry strategy that's associated with a job. For more information, see -/// Automated -/// job retries in the Batch User Guide. -class RetryStrategy { - /// The number of times to move a job to the RUNNABLE status. You - /// can specify between 1 and 10 attempts. If the value of attempts - /// is greater than one, the job is retried on failure the same number of - /// attempts as the value. - final int? attempts; +/// The details for the container in this task attempt. +class TaskContainerDetails { + /// The command that's passed to the container. This parameter maps to + /// Cmd in the Create a + /// container section of the Docker Remote API and + /// the COMMAND parameter to docker run. For + /// more information, see https://docs.docker.com/engine/reference/builder/#cmd. + final List? command; - /// Array of up to 5 objects that specify the conditions where jobs are retried - /// or failed. If this parameter is specified, then the attempts - /// parameter must also be specified. If none of the listed conditions match, - /// then the job is retried. - final List? evaluateOnExit; + /// A list of containers that this container depends on. + final List? dependsOn; - RetryStrategy({ - this.attempts, - this.evaluateOnExit, + /// The environment variables to pass to a container. This parameter maps to + /// Env in the Create a + /// container section of the Docker Remote API and + /// the --env option to docker run. + /// + /// We don't recommend using plaintext environment variables for sensitive + /// information, such as credential data. + /// + final List? environment; + + /// If the essential parameter of a container is marked as true, + /// and that container fails or stops for any reason, all other containers that + /// are part of the task are stopped. If the essential parameter of + /// a container is marked as false, its failure doesn't affect the rest of the + /// containers in a task. If this parameter is omitted, a container is assumed + /// to be essential. + /// + /// All jobs must have at least one essential container. If you have an + /// application that's composed of multiple containers, group containers that + /// are used for a common purpose into components, and separate the different + /// components into multiple task definitions. For more information, see Application + /// Architecture in the Amazon Elastic Container Service Developer + /// Guide. + final bool? essential; + + /// The exit code returned upon completion. + final int? exitCode; + + /// The image used to start a container. This string is passed directly to the + /// Docker daemon. By default, images in the Docker Hub registry are available. + /// Other repositories are specified with either + /// repository-url/image:tag or + /// repository-url/image@digest. Up to 255 letters (uppercase and + /// lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, + /// and number signs are allowed. This parameter maps to Image in + /// the Create + /// a container section of the Docker Remote API and + /// the IMAGE parameter of the + /// docker run . + final String? image; + + /// Linux-specific modifications that are applied to the container, such as + /// Linux kernel capabilities. For more information, see KernelCapabilities. + /// + /// This parameter is not supported for Windows containers. + /// + final LinuxParameters? linuxParameters; + + /// The log configuration specification for the container. + /// + /// This parameter maps to LogConfig in the Create + /// a container section of the Docker Remote API and + /// the --log-driver option to docker + /// run. + /// + /// By default, containers use the same logging driver that the Docker daemon + /// uses. However the container can use a different logging driver than the + /// Docker daemon by specifying a log driver with this parameter in the + /// container definition. To use a different logging driver for a container, the + /// log system must be configured properly on the container instance (or on a + /// different log server for remote logging options). For more information about + /// the options for different supported log drivers, see Configure + /// logging drivers in the Docker documentation. + /// + /// Amazon ECS currently supports a subset of the logging drivers available to + /// the Docker daemon (shown in the LogConfiguration data type). + /// Additional log drivers may be available in future releases of the Amazon ECS + /// container agent. + /// + /// This parameter requires version 1.18 of the Docker Remote API or greater on + /// your container instance. To check the Docker Remote API version on your + /// container instance, log in to your container instance and run the following + /// command: sudo docker version --format '{{.Server.APIVersion}}' + /// + /// The Amazon ECS container agent running on a container instance must register + /// the logging drivers available on that instance with the + /// ECS_AVAILABLE_LOGGING_DRIVERS environment variable before + /// containers placed on that instance can use these log configuration options. + /// For more information, see Amazon + /// ECS container agent configuration in the Amazon Elastic Container + /// Service Developer Guide. + /// + final LogConfiguration? logConfiguration; + + /// The name of the CloudWatch Logs log stream that's associated with the + /// container. The log group for Batch jobs is /aws/batch/job. Each container + /// attempt receives a log stream name when they reach the RUNNING + /// status. + final String? logStreamName; + + /// The mount points for data volumes in your container. + /// + /// This parameter maps to Volumes in the Create + /// a container section of the Docker Remote API and + /// the --volume option to docker + /// run. + /// + /// Windows containers can mount whole directories on the same drive as + /// $env:ProgramData. Windows containers can't mount directories on + /// a different drive, and mount point can't be across drives. + final List? mountPoints; + + /// The name of a container. + final String? name; + + /// The network interfaces that are associated with the job. + final List? networkInterfaces; + + /// When this parameter is true, the container is given elevated + /// privileges on the host container instance (similar to the root + /// user). This parameter maps to Privileged in the Create + /// a container section of the Docker Remote API and + /// the --privileged option to docker + /// run. + /// + /// This parameter is not supported for Windows containers or tasks run on + /// Fargate. + /// + final bool? privileged; + + /// When this parameter is true, the container is given read-only access to its + /// root file system. This parameter maps to ReadonlyRootfs in the + /// Create + /// a container section of the Docker Remote API and + /// the --read-only option to docker + /// run. + /// + /// This parameter is not supported for Windows containers. + /// + final bool? readonlyRootFilesystem; + + /// A short (255 max characters) human-readable string to provide additional + /// details for a running or stopped container. + final String? reason; + + /// The private repository authentication credentials to use. + final RepositoryCredentials? repositoryCredentials; + + /// The type and amount of a resource to assign to a container. The only + /// supported resource is a GPU. + final List? resourceRequirements; + + /// The secrets to pass to the container. For more information, see Specifying + /// Sensitive Data in the Amazon Elastic Container Service Developer Guide. + final List? secrets; + + /// A list of ulimits to set in the container. If a + /// ulimit value is specified in a task definition, it overrides + /// the default values set by Docker. This parameter maps to + /// Ulimits in the Create + /// a container section of the Docker Remote API and + /// the --ulimit option to docker + /// run. + /// + /// Amazon ECS tasks hosted on Fargate use the default resource limit values set + /// by the operating system with the exception of the nofile resource limit + /// parameter which Fargate overrides. The nofile resource limit + /// sets a restriction on the number of open files that a container can use. The + /// default nofile soft limit is 1024 and the default + /// hard limit is 65535. + /// + /// This parameter requires version 1.18 of the Docker Remote API or greater on + /// your container instance. To check the Docker Remote API version on your + /// container instance, log in to your container instance and run the following + /// command: sudo docker version --format '{{.Server.APIVersion}}' + /// + /// This parameter is not supported for Windows containers. + /// + final List? ulimits; + + /// The user to use inside the container. This parameter maps to User in the + /// Create a container section of the Docker Remote API and the --user option to + /// docker run. + /// + /// When running tasks using the host network mode, don't run + /// containers using the root user (UID 0). We recommend using a + /// non-root user for better security. + /// + /// You can specify the user using the following formats. If + /// specifying a UID or GID, you must specify it as a positive integer. + /// + ///
      + ///
    • + /// user + ///
    • + ///
    • + /// user:group + ///
    • + ///
    • + /// uid + ///
    • + ///
    • + /// uid:gid + ///
    • + ///
    • + /// user:gi + ///
    • + ///
    • + /// uid:group + ///
    • + ///
    • + /// + ///
    • + ///
    + /// This parameter is not supported for Windows containers. + /// + final String? user; + + TaskContainerDetails({ + this.command, + this.dependsOn, + this.environment, + this.essential, + this.exitCode, + this.image, + this.linuxParameters, + this.logConfiguration, + this.logStreamName, + this.mountPoints, + this.name, + this.networkInterfaces, + this.privileged, + this.readonlyRootFilesystem, + this.reason, + this.repositoryCredentials, + this.resourceRequirements, + this.secrets, + this.ulimits, + this.user, }); - factory RetryStrategy.fromJson(Map json) { - return RetryStrategy( - attempts: json['attempts'] as int?, - evaluateOnExit: (json['evaluateOnExit'] as List?) + factory TaskContainerDetails.fromJson(Map json) { + return TaskContainerDetails( + command: (json['command'] as List?) ?.whereNotNull() - .map((e) => EvaluateOnExit.fromJson(e as Map)) + .map((e) => e as String) + .toList(), + dependsOn: (json['dependsOn'] as List?) + ?.whereNotNull() + .map((e) => + TaskContainerDependency.fromJson(e as Map)) + .toList(), + environment: (json['environment'] as List?) + ?.whereNotNull() + .map((e) => KeyValuePair.fromJson(e as Map)) + .toList(), + essential: json['essential'] as bool?, + exitCode: json['exitCode'] as int?, + image: json['image'] as String?, + linuxParameters: json['linuxParameters'] != null + ? LinuxParameters.fromJson( + json['linuxParameters'] as Map) + : null, + logConfiguration: json['logConfiguration'] != null + ? LogConfiguration.fromJson( + json['logConfiguration'] as Map) + : null, + logStreamName: json['logStreamName'] as String?, + mountPoints: (json['mountPoints'] as List?) + ?.whereNotNull() + .map((e) => MountPoint.fromJson(e as Map)) + .toList(), + name: json['name'] as String?, + networkInterfaces: (json['networkInterfaces'] as List?) + ?.whereNotNull() + .map((e) => NetworkInterface.fromJson(e as Map)) + .toList(), + privileged: json['privileged'] as bool?, + readonlyRootFilesystem: json['readonlyRootFilesystem'] as bool?, + reason: json['reason'] as String?, + repositoryCredentials: json['repositoryCredentials'] != null + ? RepositoryCredentials.fromJson( + json['repositoryCredentials'] as Map) + : null, + resourceRequirements: (json['resourceRequirements'] as List?) + ?.whereNotNull() + .map((e) => ResourceRequirement.fromJson(e as Map)) + .toList(), + secrets: (json['secrets'] as List?) + ?.whereNotNull() + .map((e) => Secret.fromJson(e as Map)) + .toList(), + ulimits: (json['ulimits'] as List?) + ?.whereNotNull() + .map((e) => Ulimit.fromJson(e as Map)) .toList(), + user: json['user'] as String?, ); } Map toJson() { - final attempts = this.attempts; - final evaluateOnExit = this.evaluateOnExit; + final command = this.command; + final dependsOn = this.dependsOn; + final environment = this.environment; + final essential = this.essential; + final exitCode = this.exitCode; + final image = this.image; + final linuxParameters = this.linuxParameters; + final logConfiguration = this.logConfiguration; + final logStreamName = this.logStreamName; + final mountPoints = this.mountPoints; + final name = this.name; + final networkInterfaces = this.networkInterfaces; + final privileged = this.privileged; + final readonlyRootFilesystem = this.readonlyRootFilesystem; + final reason = this.reason; + final repositoryCredentials = this.repositoryCredentials; + final resourceRequirements = this.resourceRequirements; + final secrets = this.secrets; + final ulimits = this.ulimits; + final user = this.user; return { - if (attempts != null) 'attempts': attempts, - if (evaluateOnExit != null) 'evaluateOnExit': evaluateOnExit, + if (command != null) 'command': command, + if (dependsOn != null) 'dependsOn': dependsOn, + if (environment != null) 'environment': environment, + if (essential != null) 'essential': essential, + if (exitCode != null) 'exitCode': exitCode, + if (image != null) 'image': image, + if (linuxParameters != null) 'linuxParameters': linuxParameters, + if (logConfiguration != null) 'logConfiguration': logConfiguration, + if (logStreamName != null) 'logStreamName': logStreamName, + if (mountPoints != null) 'mountPoints': mountPoints, + if (name != null) 'name': name, + if (networkInterfaces != null) 'networkInterfaces': networkInterfaces, + if (privileged != null) 'privileged': privileged, + if (readonlyRootFilesystem != null) + 'readonlyRootFilesystem': readonlyRootFilesystem, + if (reason != null) 'reason': reason, + if (repositoryCredentials != null) + 'repositoryCredentials': repositoryCredentials, + if (resourceRequirements != null) + 'resourceRequirements': resourceRequirements, + if (secrets != null) 'secrets': secrets, + if (ulimits != null) 'ulimits': ulimits, + if (user != null) 'user': user, }; } } -/// An object that represents a scheduling policy. -class SchedulingPolicyDetail { - /// The Amazon Resource Name (ARN) of the scheduling policy. An example is - /// arn:aws:batch:us-east-1:123456789012:scheduling-policy/HighPriority - /// . - final String arn; +/// The overrides that should be sent to a container. +/// +/// For information about using Batch overrides when you connect event sources +/// to targets, see BatchContainerOverrides. +class TaskContainerOverrides { + /// The command to send to the container that overrides the default command from + /// the Docker image or the job definition. + /// + /// This parameter can't contain an empty string. + /// + final List? command; - /// The name of the scheduling policy. - final String name; + /// The environment variables to send to the container. You can add new + /// environment variables, which are added to the container at launch, or you + /// can override the existing environment variables from the Docker image or the + /// job definition. + /// + /// Environment variables cannot start with AWS_BATCH. This naming + /// convention is reserved for variables that Batch sets. + /// + final List? environment; - /// The fair share policy for the scheduling policy. - final FairsharePolicy? fairsharePolicy; + /// A pointer to the container that you want to override. The container's name + /// provides a unique identifier for the container being used. + final String? name; - /// The tags that you apply to the scheduling policy to categorize and organize - /// your resources. Each tag consists of a key and an optional value. For more - /// information, see Tagging - /// Amazon Web Services resources in Amazon Web Services General - /// Reference. - final Map? tags; + /// The type and amount of resources to assign to a container. This overrides + /// the settings in the job definition. The supported resources include + /// GPU, MEMORY, and VCPU. + final List? resourceRequirements; - SchedulingPolicyDetail({ - required this.arn, - required this.name, - this.fairsharePolicy, - this.tags, + TaskContainerOverrides({ + this.command, + this.environment, + this.name, + this.resourceRequirements, }); - factory SchedulingPolicyDetail.fromJson(Map json) { - return SchedulingPolicyDetail( - arn: json['arn'] as String, - name: json['name'] as String, - fairsharePolicy: json['fairsharePolicy'] != null - ? FairsharePolicy.fromJson( - json['fairsharePolicy'] as Map) - : null, - tags: (json['tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - ); - } - Map toJson() { - final arn = this.arn; + final command = this.command; + final environment = this.environment; final name = this.name; - final fairsharePolicy = this.fairsharePolicy; - final tags = this.tags; + final resourceRequirements = this.resourceRequirements; return { - 'arn': arn, - 'name': name, - if (fairsharePolicy != null) 'fairsharePolicy': fairsharePolicy, - if (tags != null) 'tags': tags, + if (command != null) 'command': command, + if (environment != null) 'environment': environment, + if (name != null) 'name': name, + if (resourceRequirements != null) + 'resourceRequirements': resourceRequirements, }; } } -/// An object that contains the details of a scheduling policy that's returned -/// in a ListSchedulingPolicy action. -class SchedulingPolicyListingDetail { - /// Amazon Resource Name (ARN) of the scheduling policy. - final String arn; +/// Container properties are used for Amazon ECS-based job definitions. These +/// properties to describe the container that's launched as part of a job. +class TaskContainerProperties { + /// The image used to start a container. This string is passed directly to the + /// Docker daemon. By default, images in the Docker Hub registry are available. + /// Other repositories are specified with either + /// repository-url/image:tag or + /// repository-url/image@digest. Up to 255 letters (uppercase and + /// lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, + /// and number signs are allowed. This parameter maps to Image in + /// the Create + /// a container section of the Docker Remote API and + /// the IMAGE parameter of the + /// docker run . + final String image; - SchedulingPolicyListingDetail({ - required this.arn, - }); + /// The command that's passed to the container. This parameter maps to + /// Cmd in the Create a + /// container section of the Docker Remote API and + /// the COMMAND parameter to docker run. For + /// more information, see Dockerfile + /// reference: CMD. + final List? command; - factory SchedulingPolicyListingDetail.fromJson(Map json) { - return SchedulingPolicyListingDetail( - arn: json['arn'] as String, - ); - } + /// A list of containers that this container depends on. + final List? dependsOn; - Map toJson() { - final arn = this.arn; - return { - 'arn': arn, - }; - } -} + /// The environment variables to pass to a container. This parameter maps to Env + /// inthe Create a + /// container section of the Docker Remote API and + /// the --env parameter to docker run. + /// + /// We don't recommend using plaintext environment variables for sensitive + /// information, such as credential data. + /// + /// Environment variables cannot start with AWS_BATCH. This naming + /// convention is reserved for variables that Batch sets. + /// + final List? environment; + + /// If the essential parameter of a container is marked as true, + /// and that container fails or stops for any reason, all other containers that + /// are part of the task are stopped. If the essential parameter of + /// a container is marked as false, its failure doesn't affect the rest of the + /// containers in a task. If this parameter is omitted, a container is assumed + /// to be essential. + /// + /// All jobs must have at least one essential container. If you have an + /// application that's composed of multiple containers, group containers that + /// are used for a common purpose into components, and separate the different + /// components into multiple task definitions. For more information, see Application + /// Architecture in the Amazon Elastic Container Service Developer + /// Guide. + final bool? essential; + + /// Linux-specific modifications that are applied to the container, such as + /// Linux kernel capabilities. For more information, see KernelCapabilities. + final LinuxParameters? linuxParameters; + + /// The log configuration specification for the container. + /// + /// This parameter maps to LogConfig in the Create + /// a container section of the Docker Remote API and + /// the --log-driver option to docker + /// run. + /// + /// By default, containers use the same logging driver that the Docker daemon + /// uses. However the container can use a different logging driver than the + /// Docker daemon by specifying a log driver with this parameter in the + /// container definition. To use a different logging driver for a container, the + /// log system must be configured properly on the container instance (or on a + /// different log server for remote logging options). For more information about + /// the options for different supported log drivers, see Configure + /// logging drivers in the Docker documentation. + /// + /// Amazon ECS currently supports a subset of the logging drivers available to + /// the Docker daemon (shown in the LogConfiguration data type). + /// Additional log drivers may be available in future releases of the Amazon ECS + /// container agent. + /// + /// This parameter requires version 1.18 of the Docker Remote API or greater on + /// your container instance. To check the Docker Remote API version on your + /// container instance, log in to your container instance and run the following + /// command: sudo docker version --format '{{.Server.APIVersion}}' + /// + /// The Amazon ECS container agent running on a container instance must register + /// the logging drivers available on that instance with the + /// ECS_AVAILABLE_LOGGING_DRIVERS environment variable before + /// containers placed on that instance can use these log configuration options. + /// For more information, see Amazon + /// ECS container agent configuration in the Amazon Elastic Container + /// Service Developer Guide. + /// + final LogConfiguration? logConfiguration; + + /// The mount points for data volumes in your container. + /// + /// This parameter maps to Volumes in the Create + /// a container section of the Docker Remote API and + /// the --volume option to docker + /// run. + /// + /// Windows containers can mount whole directories on the same drive as + /// $env:ProgramData. Windows containers can't mount directories on + /// a different drive, and mount point can't be across drives. + final List? mountPoints; -/// An object that represents the secret to expose to your container. Secrets -/// can be exposed to a container in the following ways: -/// -///
      -///
    • -/// To inject sensitive data into your containers as environment variables, use -/// the secrets container definition parameter. -///
    • -///
    • -/// To reference sensitive information in the log configuration of a container, -/// use the secretOptions container definition parameter. -///
    • -///
    -/// For more information, see Specifying -/// sensitive data in the Batch User Guide. -class Secret { - /// The name of the secret. - final String name; + /// The name of a container. The name can be used as a unique identifier to + /// target your dependsOn and Overrides objects. + final String? name; - /// The secret to expose to the container. The supported values are either the - /// full Amazon Resource Name (ARN) of the Secrets Manager secret or the full - /// ARN of the parameter in the Amazon Web Services Systems Manager Parameter - /// Store. + /// When this parameter is true, the container is given elevated + /// privileges on the host container instance (similar to the root + /// user). This parameter maps to Privileged in the Create + /// a container section of the Docker Remote API and + /// the --privileged option to docker + /// run. /// - /// If the Amazon Web Services Systems Manager Parameter Store parameter exists - /// in the same Region as the job you're launching, then you can use either the - /// full Amazon Resource Name (ARN) or name of the parameter. If the parameter - /// exists in a different Region, then the full ARN must be specified. + /// This parameter is not supported for Windows containers or tasks run on + /// Fargate. /// - final String valueFrom; + final bool? privileged; - Secret({ - required this.name, - required this.valueFrom, - }); + /// When this parameter is true, the container is given read-only access to its + /// root file system. This parameter maps to ReadonlyRootfs in the + /// Create + /// a container section of the Docker Remote API and + /// the --read-only option to docker + /// run. + /// + /// This parameter is not supported for Windows containers. + /// + final bool? readonlyRootFilesystem; - factory Secret.fromJson(Map json) { - return Secret( - name: json['name'] as String, - valueFrom: json['valueFrom'] as String, - ); - } + /// The private repository authentication credentials to use. + final RepositoryCredentials? repositoryCredentials; - Map toJson() { - final name = this.name; - final valueFrom = this.valueFrom; - return { - 'name': name, - 'valueFrom': valueFrom, - }; - } -} + /// The type and amount of a resource to assign to a container. The only + /// supported resource is a GPU. + final List? resourceRequirements; -/// Specifies the weights for the fair share identifiers for the fair share -/// policy. Fair share identifiers that aren't included have a default weight of -/// 1.0. -class ShareAttributes { - /// A fair share identifier or fair share identifier prefix. If the string ends - /// with an asterisk (*), this entry specifies the weight factor to use for fair - /// share identifiers that start with that prefix. The list of fair share - /// identifiers in a fair share policy can't overlap. For example, you can't - /// have one that specifies a shareIdentifier of - /// UserA* and another that specifies a - /// shareIdentifier of UserA-1. + /// The secrets to pass to the container. For more information, see Specifying + /// Sensitive Data in the Amazon Elastic Container Service Developer Guide. + final List? secrets; + + /// A list of ulimits to set in the container. If a + /// ulimit value is specified in a task definition, it overrides + /// the default values set by Docker. This parameter maps to + /// Ulimits in the Create + /// a container section of the Docker Remote API and + /// the --ulimit option to docker + /// run. /// - /// There can be no more than 500 fair share identifiers active in a job queue. + /// Amazon ECS tasks hosted on Fargate use the default resource limit values set + /// by the operating system with the exception of the nofile resource limit + /// parameter which Fargate overrides. The nofile resource limit + /// sets a restriction on the number of open files that a container can use. The + /// default nofile soft limit is 1024 and the default + /// hard limit is 65535. /// - /// The string is limited to 255 alphanumeric characters, and can be followed by - /// an asterisk (*). - final String shareIdentifier; + /// This parameter requires version 1.18 of the Docker Remote API or greater on + /// your container instance. To check the Docker Remote API version on your + /// container instance, log in to your container instance and run the following + /// command: sudo docker version --format '{{.Server.APIVersion}}' + /// + /// This parameter is not supported for Windows containers. + /// + final List? ulimits; - /// The weight factor for the fair share identifier. The default value is 1.0. A - /// lower value has a higher priority for compute resources. For example, jobs - /// that use a share identifier with a weight factor of 0.125 (1/8) get 8 times - /// the compute resources of jobs that use a share identifier with a weight - /// factor of 1. + /// The user to use inside the container. This parameter maps to User in the + /// Create a container section of the Docker Remote API and the --user option to + /// docker run. + /// + /// When running tasks using the host network mode, don't run + /// containers using the root user (UID 0). We recommend using a + /// non-root user for better security. + /// + /// You can specify the user using the following formats. If + /// specifying a UID or GID, you must specify it as a positive integer. /// - /// The smallest supported value is 0.0001, and the largest supported value is - /// 999.9999. - final double? weightFactor; + ///
      + ///
    • + /// user + ///
    • + ///
    • + /// user:group + ///
    • + ///
    • + /// uid + ///
    • + ///
    • + /// uid:gid + ///
    • + ///
    • + /// user:gi + ///
    • + ///
    • + /// uid:group + ///
    • + ///
    + /// This parameter is not supported for Windows containers. + /// + final String? user; - ShareAttributes({ - required this.shareIdentifier, - this.weightFactor, + TaskContainerProperties({ + required this.image, + this.command, + this.dependsOn, + this.environment, + this.essential, + this.linuxParameters, + this.logConfiguration, + this.mountPoints, + this.name, + this.privileged, + this.readonlyRootFilesystem, + this.repositoryCredentials, + this.resourceRequirements, + this.secrets, + this.ulimits, + this.user, }); - factory ShareAttributes.fromJson(Map json) { - return ShareAttributes( - shareIdentifier: json['shareIdentifier'] as String, - weightFactor: json['weightFactor'] as double?, + factory TaskContainerProperties.fromJson(Map json) { + return TaskContainerProperties( + image: json['image'] as String, + command: (json['command'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + dependsOn: (json['dependsOn'] as List?) + ?.whereNotNull() + .map((e) => + TaskContainerDependency.fromJson(e as Map)) + .toList(), + environment: (json['environment'] as List?) + ?.whereNotNull() + .map((e) => KeyValuePair.fromJson(e as Map)) + .toList(), + essential: json['essential'] as bool?, + linuxParameters: json['linuxParameters'] != null + ? LinuxParameters.fromJson( + json['linuxParameters'] as Map) + : null, + logConfiguration: json['logConfiguration'] != null + ? LogConfiguration.fromJson( + json['logConfiguration'] as Map) + : null, + mountPoints: (json['mountPoints'] as List?) + ?.whereNotNull() + .map((e) => MountPoint.fromJson(e as Map)) + .toList(), + name: json['name'] as String?, + privileged: json['privileged'] as bool?, + readonlyRootFilesystem: json['readonlyRootFilesystem'] as bool?, + repositoryCredentials: json['repositoryCredentials'] != null + ? RepositoryCredentials.fromJson( + json['repositoryCredentials'] as Map) + : null, + resourceRequirements: (json['resourceRequirements'] as List?) + ?.whereNotNull() + .map((e) => ResourceRequirement.fromJson(e as Map)) + .toList(), + secrets: (json['secrets'] as List?) + ?.whereNotNull() + .map((e) => Secret.fromJson(e as Map)) + .toList(), + ulimits: (json['ulimits'] as List?) + ?.whereNotNull() + .map((e) => Ulimit.fromJson(e as Map)) + .toList(), + user: json['user'] as String?, ); } Map toJson() { - final shareIdentifier = this.shareIdentifier; - final weightFactor = this.weightFactor; + final image = this.image; + final command = this.command; + final dependsOn = this.dependsOn; + final environment = this.environment; + final essential = this.essential; + final linuxParameters = this.linuxParameters; + final logConfiguration = this.logConfiguration; + final mountPoints = this.mountPoints; + final name = this.name; + final privileged = this.privileged; + final readonlyRootFilesystem = this.readonlyRootFilesystem; + final repositoryCredentials = this.repositoryCredentials; + final resourceRequirements = this.resourceRequirements; + final secrets = this.secrets; + final ulimits = this.ulimits; + final user = this.user; return { - 'shareIdentifier': shareIdentifier, - if (weightFactor != null) 'weightFactor': weightFactor, + 'image': image, + if (command != null) 'command': command, + if (dependsOn != null) 'dependsOn': dependsOn, + if (environment != null) 'environment': environment, + if (essential != null) 'essential': essential, + if (linuxParameters != null) 'linuxParameters': linuxParameters, + if (logConfiguration != null) 'logConfiguration': logConfiguration, + if (mountPoints != null) 'mountPoints': mountPoints, + if (name != null) 'name': name, + if (privileged != null) 'privileged': privileged, + if (readonlyRootFilesystem != null) + 'readonlyRootFilesystem': readonlyRootFilesystem, + if (repositoryCredentials != null) + 'repositoryCredentials': repositoryCredentials, + if (resourceRequirements != null) + 'resourceRequirements': resourceRequirements, + if (secrets != null) 'secrets': secrets, + if (ulimits != null) 'ulimits': ulimits, + if (user != null) 'user': user, }; } } -class SubmitJobResponse { - /// The unique identifier for the job. - final String jobId; - - /// The name of the job. - final String jobName; - - /// The Amazon Resource Name (ARN) for the job. - final String? jobArn; +/// An object that contains overrides for the task definition of a job. +class TaskPropertiesOverride { + /// The overrides for the container definition of a job. + final List? containers; - SubmitJobResponse({ - required this.jobId, - required this.jobName, - this.jobArn, + TaskPropertiesOverride({ + this.containers, }); - factory SubmitJobResponse.fromJson(Map json) { - return SubmitJobResponse( - jobId: json['jobId'] as String, - jobName: json['jobName'] as String, - jobArn: json['jobArn'] as String?, - ); - } - Map toJson() { - final jobId = this.jobId; - final jobName = this.jobName; - final jobArn = this.jobArn; + final containers = this.containers; return { - 'jobId': jobId, - 'jobName': jobName, - if (jobArn != null) 'jobArn': jobArn, + if (containers != null) 'containers': containers, }; } } -class TagResourceResponse { - TagResourceResponse(); - - factory TagResourceResponse.fromJson(Map _) { - return TagResourceResponse(); - } - - Map toJson() { - return {}; - } -} - class TerminateJobResponse { TerminateJobResponse(); @@ -8627,7 +10694,9 @@ class Tmpfs { } } -/// The ulimit settings to pass to the container. +/// The ulimit settings to pass to the container. For more +/// information, see Ulimit. /// /// This object isn't applicable to jobs that are running on Fargate resources. /// @@ -8635,7 +10704,12 @@ class Ulimit { /// The hard limit for the ulimit type. final int hardLimit; - /// The type of the ulimit. + /// The type of the ulimit. Valid values are: + /// core | cpu | data | + /// fsize | locks | memlock | + /// msgqueue | nice | nofile | + /// nproc | rss | rtprio | + /// rttime | sigpending | stack. final String name; /// The soft limit for the ulimit type. diff --git a/aws_client/lib/src/generated/bcm_data_exports/v2023_11_26.dart b/aws_client/lib/src/generated/bcm_data_exports/v2023_11_26.dart new file mode 100644 index 000000000..c08218e82 --- /dev/null +++ b/aws_client/lib/src/generated/bcm_data_exports/v2023_11_26.dart @@ -0,0 +1,1740 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// You can use the Data Exports API to create customized exports from multiple +/// Amazon Web Services cost management and billing datasets, such as cost and +/// usage data and cost optimization recommendations. +/// +/// The Data Exports API provides the following endpoint: +/// +///
      +///
    • +/// https://bcm-data-exports.us-east-1.api.aws +///
    • +///
    +class BillingAndCostManagementDataExports { + final _s.JsonProtocol _protocol; + BillingAndCostManagementDataExports({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.JsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'bcm-data-exports', + signingName: 'bcm-data-exports', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Creates a data export and specifies the data query, the delivery + /// preference, and any optional resource tags. + /// + /// A DataQuery consists of both a QueryStatement + /// and TableConfigurations. + /// + /// The QueryStatement is an SQL statement. Data Exports only + /// supports a limited subset of the SQL syntax. For more information on the + /// SQL syntax that is supported, see Data + /// query. To view the available tables and columns, see the Data + /// Exports table dictionary. + /// + /// The TableConfigurations is a collection of specified + /// TableProperties for the table being queried in the + /// QueryStatement. TableProperties are additional configurations + /// you can provide to change the data and schema of a table. Each table can + /// have different TableProperties. However, tables are not required to have + /// any TableProperties. Each table property has a default value that it + /// assumes if not specified. For more information on table configurations, + /// see Data + /// query. To view the table properties available for each table, see the + /// Data + /// Exports table dictionary or use the ListTables API to get + /// a response of all tables and their available properties. + /// + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [export] : + /// The details of the export, including data query, name, description, and + /// destination configuration. + /// + /// Parameter [resourceTags] : + /// An optional list of tags to associate with the specified export. Each tag + /// consists of a key and a value, and each key must be unique for the + /// resource. + Future createExport({ + required Export export, + List? resourceTags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.CreateExport' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Export': export, + if (resourceTags != null) 'ResourceTags': resourceTags, + }, + ); + + return CreateExportResponse.fromJson(jsonResponse.body); + } + + /// Deletes an existing data export. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [exportArn] : + /// The Amazon Resource Name (ARN) for this export. + Future deleteExport({ + required String exportArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.DeleteExport' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ExportArn': exportArn, + }, + ); + + return DeleteExportResponse.fromJson(jsonResponse.body); + } + + /// Exports data based on the source data update. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [executionId] : + /// The ID for this specific execution. + /// + /// Parameter [exportArn] : + /// The Amazon Resource Name (ARN) of the Export object that generated this + /// specific execution. + Future getExecution({ + required String executionId, + required String exportArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.GetExecution' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ExecutionId': executionId, + 'ExportArn': exportArn, + }, + ); + + return GetExecutionResponse.fromJson(jsonResponse.body); + } + + /// Views the definition of an existing data export. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [exportArn] : + /// The Amazon Resource Name (ARN) for this export. + Future getExport({ + required String exportArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.GetExport' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ExportArn': exportArn, + }, + ); + + return GetExportResponse.fromJson(jsonResponse.body); + } + + /// Returns the metadata for the specified table and table properties. This + /// includes the list of columns in the table schema, their data types, and + /// column descriptions. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [tableName] : + /// The name of the table. + /// + /// Parameter [tableProperties] : + /// TableProperties are additional configurations you can provide to change + /// the data and schema of a table. Each table can have different + /// TableProperties. Tables are not required to have any TableProperties. Each + /// table property has a default value that it assumes if not specified. + Future getTable({ + required String tableName, + Map? tableProperties, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.GetTable' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'TableName': tableName, + if (tableProperties != null) 'TableProperties': tableProperties, + }, + ); + + return GetTableResponse.fromJson(jsonResponse.body); + } + + /// Lists the historical executions for the export. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [exportArn] : + /// The Amazon Resource Name (ARN) for this export. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listExecutions({ + required String exportArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.ListExecutions' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ExportArn': exportArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListExecutionsResponse.fromJson(jsonResponse.body); + } + + /// Lists all data export definitions. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listExports({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.ListExports' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListExportsResponse.fromJson(jsonResponse.body); + } + + /// Lists all available tables in data exports. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listTables({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.ListTables' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListTablesResponse.fromJson(jsonResponse.body); + } + + /// List tags associated with an existing data export. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The unique identifier for the resource. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listTagsForResource({ + required String resourceArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSBillingAndCostManagementDataExports.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListTagsForResourceResponse.fromJson(jsonResponse.body); + } + + /// Adds tags for an existing data export definition. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The unique identifier for the resource. + /// + /// Parameter [resourceTags] : + /// The tags to associate with the resource. Each tag consists of a key and a + /// value, and each key must be unique for the resource. + Future tagResource({ + required String resourceArn, + required List resourceTags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'ResourceTags': resourceTags, + }, + ); + } + + /// Deletes tags associated with an existing data export definition. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The unique identifier for the resource. + /// + /// Parameter [resourceTagKeys] : + /// The tag keys that are associated with the resource ARN. + Future untagResource({ + required String resourceArn, + required List resourceTagKeys, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.UntagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'ResourceTagKeys': resourceTagKeys, + }, + ); + } + + /// Updates an existing data export by overwriting all export parameters. All + /// export parameters must be provided in the UpdateExport request. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [export] : + /// The name and query details for the export. + /// + /// Parameter [exportArn] : + /// The Amazon Resource Name (ARN) for this export. + Future updateExport({ + required Export export, + required String exportArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.UpdateExport' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Export': export, + 'ExportArn': exportArn, + }, + ); + + return UpdateExportResponse.fromJson(jsonResponse.body); + } +} + +/// Includes basic information for a data column such as its description, name, +/// and type. +class Column { + /// The description for a column. + final String? description; + + /// The column name. + final String? name; + + /// The kind of data a column stores. + final String? type; + + Column({ + this.description, + this.name, + this.type, + }); + + factory Column.fromJson(Map json) { + return Column( + description: json['Description'] as String?, + name: json['Name'] as String?, + type: json['Type'] as String?, + ); + } + + Map toJson() { + final description = this.description; + final name = this.name; + final type = this.type; + return { + if (description != null) 'Description': description, + if (name != null) 'Name': name, + if (type != null) 'Type': type, + }; + } +} + +enum CompressionOption { + gzip, + parquet, +} + +extension CompressionOptionValueExtension on CompressionOption { + String toValue() { + switch (this) { + case CompressionOption.gzip: + return 'GZIP'; + case CompressionOption.parquet: + return 'PARQUET'; + } + } +} + +extension CompressionOptionFromString on String { + CompressionOption toCompressionOption() { + switch (this) { + case 'GZIP': + return CompressionOption.gzip; + case 'PARQUET': + return CompressionOption.parquet; + } + throw Exception('$this is not known in enum CompressionOption'); + } +} + +class CreateExportResponse { + /// The Amazon Resource Name (ARN) for this export. + final String? exportArn; + + CreateExportResponse({ + this.exportArn, + }); + + factory CreateExportResponse.fromJson(Map json) { + return CreateExportResponse( + exportArn: json['ExportArn'] as String?, + ); + } + + Map toJson() { + final exportArn = this.exportArn; + return { + if (exportArn != null) 'ExportArn': exportArn, + }; + } +} + +/// The SQL query of column selections and row filters from the data table you +/// want. +class DataQuery { + /// The query statement. + final String queryStatement; + + /// The table configuration. + final Map>? tableConfigurations; + + DataQuery({ + required this.queryStatement, + this.tableConfigurations, + }); + + factory DataQuery.fromJson(Map json) { + return DataQuery( + queryStatement: json['QueryStatement'] as String, + tableConfigurations: + (json['TableConfigurations'] as Map?)?.map((k, e) => + MapEntry( + k, + (e as Map) + .map((k, e) => MapEntry(k, e as String)))), + ); + } + + Map toJson() { + final queryStatement = this.queryStatement; + final tableConfigurations = this.tableConfigurations; + return { + 'QueryStatement': queryStatement, + if (tableConfigurations != null) + 'TableConfigurations': tableConfigurations, + }; + } +} + +class DeleteExportResponse { + /// The Amazon Resource Name (ARN) for this export. + final String? exportArn; + + DeleteExportResponse({ + this.exportArn, + }); + + factory DeleteExportResponse.fromJson(Map json) { + return DeleteExportResponse( + exportArn: json['ExportArn'] as String?, + ); + } + + Map toJson() { + final exportArn = this.exportArn; + return { + if (exportArn != null) 'ExportArn': exportArn, + }; + } +} + +/// The destinations used for data exports. +class DestinationConfigurations { + /// An object that describes the destination of the data exports file. + final S3Destination s3Destination; + + DestinationConfigurations({ + required this.s3Destination, + }); + + factory DestinationConfigurations.fromJson(Map json) { + return DestinationConfigurations( + s3Destination: + S3Destination.fromJson(json['S3Destination'] as Map), + ); + } + + Map toJson() { + final s3Destination = this.s3Destination; + return { + 'S3Destination': s3Destination, + }; + } +} + +/// The reference for the data export update. +class ExecutionReference { + /// The ID for this specific execution. + final String executionId; + + /// The status of this specific execution. + final ExecutionStatus executionStatus; + + ExecutionReference({ + required this.executionId, + required this.executionStatus, + }); + + factory ExecutionReference.fromJson(Map json) { + return ExecutionReference( + executionId: json['ExecutionId'] as String, + executionStatus: ExecutionStatus.fromJson( + json['ExecutionStatus'] as Map), + ); + } + + Map toJson() { + final executionId = this.executionId; + final executionStatus = this.executionStatus; + return { + 'ExecutionId': executionId, + 'ExecutionStatus': executionStatus, + }; + } +} + +/// The status of the execution. +class ExecutionStatus { + /// The time when the execution was completed. + final DateTime? completedAt; + + /// The time when the execution was created. + final DateTime? createdAt; + + /// The time when the execution was last updated. + final DateTime? lastUpdatedAt; + + /// The code for the status of the execution. + final ExecutionStatusCode? statusCode; + + /// The reason for the failed status. + final ExecutionStatusReason? statusReason; + + ExecutionStatus({ + this.completedAt, + this.createdAt, + this.lastUpdatedAt, + this.statusCode, + this.statusReason, + }); + + factory ExecutionStatus.fromJson(Map json) { + return ExecutionStatus( + completedAt: timeStampFromJson(json['CompletedAt']), + createdAt: timeStampFromJson(json['CreatedAt']), + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + statusCode: (json['StatusCode'] as String?)?.toExecutionStatusCode(), + statusReason: + (json['StatusReason'] as String?)?.toExecutionStatusReason(), + ); + } + + Map toJson() { + final completedAt = this.completedAt; + final createdAt = this.createdAt; + final lastUpdatedAt = this.lastUpdatedAt; + final statusCode = this.statusCode; + final statusReason = this.statusReason; + return { + if (completedAt != null) 'CompletedAt': iso8601ToJson(completedAt), + if (createdAt != null) 'CreatedAt': iso8601ToJson(createdAt), + if (lastUpdatedAt != null) 'LastUpdatedAt': iso8601ToJson(lastUpdatedAt), + if (statusCode != null) 'StatusCode': statusCode.toValue(), + if (statusReason != null) 'StatusReason': statusReason.toValue(), + }; + } +} + +enum ExecutionStatusCode { + initiationInProcess, + queryQueued, + queryInProcess, + queryFailure, + deliveryInProcess, + deliverySuccess, + deliveryFailure, +} + +extension ExecutionStatusCodeValueExtension on ExecutionStatusCode { + String toValue() { + switch (this) { + case ExecutionStatusCode.initiationInProcess: + return 'INITIATION_IN_PROCESS'; + case ExecutionStatusCode.queryQueued: + return 'QUERY_QUEUED'; + case ExecutionStatusCode.queryInProcess: + return 'QUERY_IN_PROCESS'; + case ExecutionStatusCode.queryFailure: + return 'QUERY_FAILURE'; + case ExecutionStatusCode.deliveryInProcess: + return 'DELIVERY_IN_PROCESS'; + case ExecutionStatusCode.deliverySuccess: + return 'DELIVERY_SUCCESS'; + case ExecutionStatusCode.deliveryFailure: + return 'DELIVERY_FAILURE'; + } + } +} + +extension ExecutionStatusCodeFromString on String { + ExecutionStatusCode toExecutionStatusCode() { + switch (this) { + case 'INITIATION_IN_PROCESS': + return ExecutionStatusCode.initiationInProcess; + case 'QUERY_QUEUED': + return ExecutionStatusCode.queryQueued; + case 'QUERY_IN_PROCESS': + return ExecutionStatusCode.queryInProcess; + case 'QUERY_FAILURE': + return ExecutionStatusCode.queryFailure; + case 'DELIVERY_IN_PROCESS': + return ExecutionStatusCode.deliveryInProcess; + case 'DELIVERY_SUCCESS': + return ExecutionStatusCode.deliverySuccess; + case 'DELIVERY_FAILURE': + return ExecutionStatusCode.deliveryFailure; + } + throw Exception('$this is not known in enum ExecutionStatusCode'); + } +} + +enum ExecutionStatusReason { + insufficientPermission, + billOwnerChanged, + internalFailure, +} + +extension ExecutionStatusReasonValueExtension on ExecutionStatusReason { + String toValue() { + switch (this) { + case ExecutionStatusReason.insufficientPermission: + return 'INSUFFICIENT_PERMISSION'; + case ExecutionStatusReason.billOwnerChanged: + return 'BILL_OWNER_CHANGED'; + case ExecutionStatusReason.internalFailure: + return 'INTERNAL_FAILURE'; + } + } +} + +extension ExecutionStatusReasonFromString on String { + ExecutionStatusReason toExecutionStatusReason() { + switch (this) { + case 'INSUFFICIENT_PERMISSION': + return ExecutionStatusReason.insufficientPermission; + case 'BILL_OWNER_CHANGED': + return ExecutionStatusReason.billOwnerChanged; + case 'INTERNAL_FAILURE': + return ExecutionStatusReason.internalFailure; + } + throw Exception('$this is not known in enum ExecutionStatusReason'); + } +} + +/// The details that are available for an export. +class Export { + /// The data query for this specific data export. + final DataQuery dataQuery; + + /// The destination configuration for this specific data export. + final DestinationConfigurations destinationConfigurations; + + /// The name of this specific data export. + final String name; + + /// The cadence for Amazon Web Services to update the export in your S3 bucket. + final RefreshCadence refreshCadence; + + /// The description for this specific data export. + final String? description; + + /// The Amazon Resource Name (ARN) for this export. + final String? exportArn; + + Export({ + required this.dataQuery, + required this.destinationConfigurations, + required this.name, + required this.refreshCadence, + this.description, + this.exportArn, + }); + + factory Export.fromJson(Map json) { + return Export( + dataQuery: DataQuery.fromJson(json['DataQuery'] as Map), + destinationConfigurations: DestinationConfigurations.fromJson( + json['DestinationConfigurations'] as Map), + name: json['Name'] as String, + refreshCadence: RefreshCadence.fromJson( + json['RefreshCadence'] as Map), + description: json['Description'] as String?, + exportArn: json['ExportArn'] as String?, + ); + } + + Map toJson() { + final dataQuery = this.dataQuery; + final destinationConfigurations = this.destinationConfigurations; + final name = this.name; + final refreshCadence = this.refreshCadence; + final description = this.description; + final exportArn = this.exportArn; + return { + 'DataQuery': dataQuery, + 'DestinationConfigurations': destinationConfigurations, + 'Name': name, + 'RefreshCadence': refreshCadence, + if (description != null) 'Description': description, + if (exportArn != null) 'ExportArn': exportArn, + }; + } +} + +/// The reference details for a given export. +class ExportReference { + /// The Amazon Resource Name (ARN) for this export. + final String exportArn; + + /// The name of this specific data export. + final String exportName; + + /// The status of this specific data export. + final ExportStatus exportStatus; + + ExportReference({ + required this.exportArn, + required this.exportName, + required this.exportStatus, + }); + + factory ExportReference.fromJson(Map json) { + return ExportReference( + exportArn: json['ExportArn'] as String, + exportName: json['ExportName'] as String, + exportStatus: + ExportStatus.fromJson(json['ExportStatus'] as Map), + ); + } + + Map toJson() { + final exportArn = this.exportArn; + final exportName = this.exportName; + final exportStatus = this.exportStatus; + return { + 'ExportArn': exportArn, + 'ExportName': exportName, + 'ExportStatus': exportStatus, + }; + } +} + +/// The status of the data export. +class ExportStatus { + /// The timestamp of when the export was created. + final DateTime? createdAt; + + /// The timestamp of when the export was last generated. + final DateTime? lastRefreshedAt; + + /// The timestamp of when the export was updated. + final DateTime? lastUpdatedAt; + + /// The status code for the request. + final ExportStatusCode? statusCode; + + /// The description for the status code. + final ExecutionStatusReason? statusReason; + + ExportStatus({ + this.createdAt, + this.lastRefreshedAt, + this.lastUpdatedAt, + this.statusCode, + this.statusReason, + }); + + factory ExportStatus.fromJson(Map json) { + return ExportStatus( + createdAt: timeStampFromJson(json['CreatedAt']), + lastRefreshedAt: timeStampFromJson(json['LastRefreshedAt']), + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + statusCode: (json['StatusCode'] as String?)?.toExportStatusCode(), + statusReason: + (json['StatusReason'] as String?)?.toExecutionStatusReason(), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final lastRefreshedAt = this.lastRefreshedAt; + final lastUpdatedAt = this.lastUpdatedAt; + final statusCode = this.statusCode; + final statusReason = this.statusReason; + return { + if (createdAt != null) 'CreatedAt': iso8601ToJson(createdAt), + if (lastRefreshedAt != null) + 'LastRefreshedAt': iso8601ToJson(lastRefreshedAt), + if (lastUpdatedAt != null) 'LastUpdatedAt': iso8601ToJson(lastUpdatedAt), + if (statusCode != null) 'StatusCode': statusCode.toValue(), + if (statusReason != null) 'StatusReason': statusReason.toValue(), + }; + } +} + +enum ExportStatusCode { + healthy, + unhealthy, +} + +extension ExportStatusCodeValueExtension on ExportStatusCode { + String toValue() { + switch (this) { + case ExportStatusCode.healthy: + return 'HEALTHY'; + case ExportStatusCode.unhealthy: + return 'UNHEALTHY'; + } + } +} + +extension ExportStatusCodeFromString on String { + ExportStatusCode toExportStatusCode() { + switch (this) { + case 'HEALTHY': + return ExportStatusCode.healthy; + case 'UNHEALTHY': + return ExportStatusCode.unhealthy; + } + throw Exception('$this is not known in enum ExportStatusCode'); + } +} + +enum FormatOption { + textOrCsv, + parquet, +} + +extension FormatOptionValueExtension on FormatOption { + String toValue() { + switch (this) { + case FormatOption.textOrCsv: + return 'TEXT_OR_CSV'; + case FormatOption.parquet: + return 'PARQUET'; + } + } +} + +extension FormatOptionFromString on String { + FormatOption toFormatOption() { + switch (this) { + case 'TEXT_OR_CSV': + return FormatOption.textOrCsv; + case 'PARQUET': + return FormatOption.parquet; + } + throw Exception('$this is not known in enum FormatOption'); + } +} + +enum FrequencyOption { + synchronous, +} + +extension FrequencyOptionValueExtension on FrequencyOption { + String toValue() { + switch (this) { + case FrequencyOption.synchronous: + return 'SYNCHRONOUS'; + } + } +} + +extension FrequencyOptionFromString on String { + FrequencyOption toFrequencyOption() { + switch (this) { + case 'SYNCHRONOUS': + return FrequencyOption.synchronous; + } + throw Exception('$this is not known in enum FrequencyOption'); + } +} + +class GetExecutionResponse { + /// The ID for this specific execution. + final String? executionId; + + /// The status of this specific execution. + final ExecutionStatus? executionStatus; + + /// The export data for this specific execution. This export data is a snapshot + /// from when the execution was generated. The data could be different from the + /// current export data if the export was updated since the execution was + /// generated. + final Export? export; + + GetExecutionResponse({ + this.executionId, + this.executionStatus, + this.export, + }); + + factory GetExecutionResponse.fromJson(Map json) { + return GetExecutionResponse( + executionId: json['ExecutionId'] as String?, + executionStatus: json['ExecutionStatus'] != null + ? ExecutionStatus.fromJson( + json['ExecutionStatus'] as Map) + : null, + export: json['Export'] != null + ? Export.fromJson(json['Export'] as Map) + : null, + ); + } + + Map toJson() { + final executionId = this.executionId; + final executionStatus = this.executionStatus; + final export = this.export; + return { + if (executionId != null) 'ExecutionId': executionId, + if (executionStatus != null) 'ExecutionStatus': executionStatus, + if (export != null) 'Export': export, + }; + } +} + +class GetExportResponse { + /// The data for this specific export. + final Export? export; + + /// The status of this specific export. + final ExportStatus? exportStatus; + + GetExportResponse({ + this.export, + this.exportStatus, + }); + + factory GetExportResponse.fromJson(Map json) { + return GetExportResponse( + export: json['Export'] != null + ? Export.fromJson(json['Export'] as Map) + : null, + exportStatus: json['ExportStatus'] != null + ? ExportStatus.fromJson(json['ExportStatus'] as Map) + : null, + ); + } + + Map toJson() { + final export = this.export; + final exportStatus = this.exportStatus; + return { + if (export != null) 'Export': export, + if (exportStatus != null) 'ExportStatus': exportStatus, + }; + } +} + +class GetTableResponse { + /// The table description. + final String? description; + + /// The schema of the table. + final List? schema; + + /// The name of the table. + final String? tableName; + + /// TableProperties are additional configurations you can provide to change the + /// data and schema of a table. Each table can have different TableProperties. + /// Tables are not required to have any TableProperties. Each table property has + /// a default value that it assumes if not specified. + final Map? tableProperties; + + GetTableResponse({ + this.description, + this.schema, + this.tableName, + this.tableProperties, + }); + + factory GetTableResponse.fromJson(Map json) { + return GetTableResponse( + description: json['Description'] as String?, + schema: (json['Schema'] as List?) + ?.whereNotNull() + .map((e) => Column.fromJson(e as Map)) + .toList(), + tableName: json['TableName'] as String?, + tableProperties: (json['TableProperties'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final description = this.description; + final schema = this.schema; + final tableName = this.tableName; + final tableProperties = this.tableProperties; + return { + if (description != null) 'Description': description, + if (schema != null) 'Schema': schema, + if (tableName != null) 'TableName': tableName, + if (tableProperties != null) 'TableProperties': tableProperties, + }; + } +} + +class ListExecutionsResponse { + /// The list of executions. + final List? executions; + + /// The token to retrieve the next set of results. + final String? nextToken; + + ListExecutionsResponse({ + this.executions, + this.nextToken, + }); + + factory ListExecutionsResponse.fromJson(Map json) { + return ListExecutionsResponse( + executions: (json['Executions'] as List?) + ?.whereNotNull() + .map((e) => ExecutionReference.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final executions = this.executions; + final nextToken = this.nextToken; + return { + if (executions != null) 'Executions': executions, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListExportsResponse { + /// The details of the exports, including name and export status. + final List? exports; + + /// The token to retrieve the next set of results. + final String? nextToken; + + ListExportsResponse({ + this.exports, + this.nextToken, + }); + + factory ListExportsResponse.fromJson(Map json) { + return ListExportsResponse( + exports: (json['Exports'] as List?) + ?.whereNotNull() + .map((e) => ExportReference.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final exports = this.exports; + final nextToken = this.nextToken; + return { + if (exports != null) 'Exports': exports, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListTablesResponse { + /// The token to retrieve the next set of results. + final String? nextToken; + + /// The list of tables. + final List? tables; + + ListTablesResponse({ + this.nextToken, + this.tables, + }); + + factory ListTablesResponse.fromJson(Map json) { + return ListTablesResponse( + nextToken: json['NextToken'] as String?, + tables: (json['Tables'] as List?) + ?.whereNotNull() + .map((e) => Table.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final tables = this.tables; + return { + if (nextToken != null) 'NextToken': nextToken, + if (tables != null) 'Tables': tables, + }; + } +} + +class ListTagsForResourceResponse { + /// The token to retrieve the next set of results. + final String? nextToken; + + /// An optional list of tags to associate with the specified export. Each tag + /// consists of a key and a value, and each key must be unique for the resource. + final List? resourceTags; + + ListTagsForResourceResponse({ + this.nextToken, + this.resourceTags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + nextToken: json['NextToken'] as String?, + resourceTags: (json['ResourceTags'] as List?) + ?.whereNotNull() + .map((e) => ResourceTag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final resourceTags = this.resourceTags; + return { + if (nextToken != null) 'NextToken': nextToken, + if (resourceTags != null) 'ResourceTags': resourceTags, + }; + } +} + +enum OverwriteOption { + createNewReport, + overwriteReport, +} + +extension OverwriteOptionValueExtension on OverwriteOption { + String toValue() { + switch (this) { + case OverwriteOption.createNewReport: + return 'CREATE_NEW_REPORT'; + case OverwriteOption.overwriteReport: + return 'OVERWRITE_REPORT'; + } + } +} + +extension OverwriteOptionFromString on String { + OverwriteOption toOverwriteOption() { + switch (this) { + case 'CREATE_NEW_REPORT': + return OverwriteOption.createNewReport; + case 'OVERWRITE_REPORT': + return OverwriteOption.overwriteReport; + } + throw Exception('$this is not known in enum OverwriteOption'); + } +} + +/// The cadence for Amazon Web Services to update the data export in your S3 +/// bucket. +class RefreshCadence { + /// The frequency that data exports are updated. The export refreshes each time + /// the source data updates, up to three times daily. + final FrequencyOption frequency; + + RefreshCadence({ + required this.frequency, + }); + + factory RefreshCadence.fromJson(Map json) { + return RefreshCadence( + frequency: (json['Frequency'] as String).toFrequencyOption(), + ); + } + + Map toJson() { + final frequency = this.frequency; + return { + 'Frequency': frequency.toValue(), + }; + } +} + +/// The tag structure that contains a tag key and value. +class ResourceTag { + /// The key that's associated with the tag. + final String key; + + /// The value that's associated with the tag. + final String value; + + ResourceTag({ + required this.key, + required this.value, + }); + + factory ResourceTag.fromJson(Map json) { + return ResourceTag( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +/// Describes the destination Amazon Simple Storage Service (Amazon S3) bucket +/// name and object keys of a data exports file. +class S3Destination { + /// The name of the Amazon S3 bucket used as the destination of a data export + /// file. + final String s3Bucket; + + /// The output configuration for the data export. + final S3OutputConfigurations s3OutputConfigurations; + + /// The S3 path prefix you want prepended to the name of your data export. + final String s3Prefix; + + /// The S3 bucket Region. + final String s3Region; + + S3Destination({ + required this.s3Bucket, + required this.s3OutputConfigurations, + required this.s3Prefix, + required this.s3Region, + }); + + factory S3Destination.fromJson(Map json) { + return S3Destination( + s3Bucket: json['S3Bucket'] as String, + s3OutputConfigurations: S3OutputConfigurations.fromJson( + json['S3OutputConfigurations'] as Map), + s3Prefix: json['S3Prefix'] as String, + s3Region: json['S3Region'] as String, + ); + } + + Map toJson() { + final s3Bucket = this.s3Bucket; + final s3OutputConfigurations = this.s3OutputConfigurations; + final s3Prefix = this.s3Prefix; + final s3Region = this.s3Region; + return { + 'S3Bucket': s3Bucket, + 'S3OutputConfigurations': s3OutputConfigurations, + 'S3Prefix': s3Prefix, + 'S3Region': s3Region, + }; + } +} + +/// The compression type, file format, and overwrite preference for the data +/// export. +class S3OutputConfigurations { + /// The compression type for the data export. + final CompressionOption compression; + + /// The file format for the data export. + final FormatOption format; + + /// The output type for the data export. + final S3OutputType outputType; + + /// The rule to follow when generating a version of the data export file. You + /// have the choice to overwrite the previous version or to be delivered in + /// addition to the previous versions. Overwriting exports can save on Amazon S3 + /// storage costs. Creating new export versions allows you to track the changes + /// in cost and usage data over time. + final OverwriteOption overwrite; + + S3OutputConfigurations({ + required this.compression, + required this.format, + required this.outputType, + required this.overwrite, + }); + + factory S3OutputConfigurations.fromJson(Map json) { + return S3OutputConfigurations( + compression: (json['Compression'] as String).toCompressionOption(), + format: (json['Format'] as String).toFormatOption(), + outputType: (json['OutputType'] as String).toS3OutputType(), + overwrite: (json['Overwrite'] as String).toOverwriteOption(), + ); + } + + Map toJson() { + final compression = this.compression; + final format = this.format; + final outputType = this.outputType; + final overwrite = this.overwrite; + return { + 'Compression': compression.toValue(), + 'Format': format.toValue(), + 'OutputType': outputType.toValue(), + 'Overwrite': overwrite.toValue(), + }; + } +} + +enum S3OutputType { + custom, +} + +extension S3OutputTypeValueExtension on S3OutputType { + String toValue() { + switch (this) { + case S3OutputType.custom: + return 'CUSTOM'; + } + } +} + +extension S3OutputTypeFromString on String { + S3OutputType toS3OutputType() { + switch (this) { + case 'CUSTOM': + return S3OutputType.custom; + } + throw Exception('$this is not known in enum S3OutputType'); + } +} + +/// The details for the data export table. +class Table { + /// The description for the table. + final String? description; + + /// The name of the table. + final String? tableName; + + /// The properties for the table. + final List? tableProperties; + + Table({ + this.description, + this.tableName, + this.tableProperties, + }); + + factory Table.fromJson(Map json) { + return Table( + description: json['Description'] as String?, + tableName: json['TableName'] as String?, + tableProperties: (json['TableProperties'] as List?) + ?.whereNotNull() + .map((e) => + TablePropertyDescription.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final description = this.description; + final tableName = this.tableName; + final tableProperties = this.tableProperties; + return { + if (description != null) 'Description': description, + if (tableName != null) 'TableName': tableName, + if (tableProperties != null) 'TableProperties': tableProperties, + }; + } +} + +/// The properties for the data export table. +class TablePropertyDescription { + /// The default value for the table. + final String? defaultValue; + + /// The description for the table. + final String? description; + + /// The name of the table. + final String? name; + + /// The valid values for the table. + final List? validValues; + + TablePropertyDescription({ + this.defaultValue, + this.description, + this.name, + this.validValues, + }); + + factory TablePropertyDescription.fromJson(Map json) { + return TablePropertyDescription( + defaultValue: json['DefaultValue'] as String?, + description: json['Description'] as String?, + name: json['Name'] as String?, + validValues: (json['ValidValues'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final defaultValue = this.defaultValue; + final description = this.description; + final name = this.name; + final validValues = this.validValues; + return { + if (defaultValue != null) 'DefaultValue': defaultValue, + if (description != null) 'Description': description, + if (name != null) 'Name': name, + if (validValues != null) 'ValidValues': validValues, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateExportResponse { + /// The Amazon Resource Name (ARN) for this export. + final String? exportArn; + + UpdateExportResponse({ + this.exportArn, + }); + + factory UpdateExportResponse.fromJson(Map json) { + return UpdateExportResponse( + exportArn: json['ExportArn'] as String?, + ); + } + + Map toJson() { + final exportArn = this.exportArn; + return { + if (exportArn != null) 'ExportArn': exportArn, + }; + } +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/bedrock/v2023_04_20.dart b/aws_client/lib/src/generated/bedrock/v2023_04_20.dart new file mode 100644 index 000000000..c76359ab7 --- /dev/null +++ b/aws_client/lib/src/generated/bedrock/v2023_04_20.dart @@ -0,0 +1,6095 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Describes the API operations for creating, managing, fine-turning, and +/// evaluating Amazon Bedrock models. +class Bedrock { + final _s.RestJsonProtocol _protocol; + Bedrock({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'bedrock', + signingName: 'bedrock', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// API operation for creating and managing Amazon Bedrock automatic model + /// evaluation jobs and model evaluation jobs that use human workers. To learn + /// more about the requirements for creating a model evaluation job see, Model + /// evaluations. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [evaluationConfig] : + /// Specifies whether the model evaluation job is automatic or uses human + /// worker. + /// + /// Parameter [inferenceConfig] : + /// Specify the models you want to use in your model evaluation job. Automatic + /// model evaluation jobs support a single model, and model evaluation job + /// that use human workers support two models. + /// + /// Parameter [jobName] : + /// The name of the model evaluation job. Model evaluation job names must + /// unique with your AWS account, and your account's AWS region. + /// + /// Parameter [outputDataConfig] : + /// An object that defines where the results of model evaluation job will be + /// saved in Amazon S3. + /// + /// Parameter [roleArn] : + /// The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock + /// can assume to perform tasks on your behalf. The service role must have + /// Amazon Bedrock as the service principal, and provide access to any Amazon + /// S3 buckets specified in the EvaluationConfig object. To pass + /// this role to Amazon Bedrock, the caller of this API must have the + /// iam:PassRole permission. To learn more about the required + /// permissions, see Required + /// permissions. + /// + /// Parameter [clientRequestToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [customerEncryptionKeyId] : + /// Specify your customer managed key ARN that will be used to encrypt your + /// model evaluation job. + /// + /// Parameter [jobDescription] : + /// A description of the model evaluation job. + /// + /// Parameter [jobTags] : + /// Tags to attach to the model evaluation job. + Future createEvaluationJob({ + required EvaluationConfig evaluationConfig, + required EvaluationInferenceConfig inferenceConfig, + required String jobName, + required EvaluationOutputDataConfig outputDataConfig, + required String roleArn, + String? clientRequestToken, + String? customerEncryptionKeyId, + String? jobDescription, + List? jobTags, + }) async { + final $payload = { + 'evaluationConfig': evaluationConfig, + 'inferenceConfig': inferenceConfig, + 'jobName': jobName, + 'outputDataConfig': outputDataConfig, + 'roleArn': roleArn, + 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (customerEncryptionKeyId != null) + 'customerEncryptionKeyId': customerEncryptionKeyId, + if (jobDescription != null) 'jobDescription': jobDescription, + if (jobTags != null) 'jobTags': jobTags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/evaluation-jobs', + exceptionFnMap: _exceptionFns, + ); + return CreateEvaluationJobResponse.fromJson(response); + } + + /// Creates a guardrail to block topics and to filter out harmful content. + /// + ///
      + ///
    • + /// Specify a name and optional description. + ///
    • + ///
    • + /// Specify messages for when the guardrail successfully blocks a prompt or a + /// model response in the blockedInputMessaging and + /// blockedOutputsMessaging fields. + ///
    • + ///
    • + /// Specify topics for the guardrail to deny in the + /// topicPolicyConfig object. Each GuardrailTopicConfig + /// object in the topicsConfig list pertains to one topic. + /// + ///
        + ///
      • + /// Give a name and description so that the + /// guardrail can properly identify the topic. + ///
      • + ///
      • + /// Specify DENY in the type field. + ///
      • + ///
      • + /// (Optional) Provide up to five prompts that you would categorize as + /// belonging to the topic in the examples list. + ///
      • + ///
    • + ///
    • + /// Specify filter strengths for the harmful categories defined in Amazon + /// Bedrock in the contentPolicyConfig object. Each GuardrailContentFilterConfig + /// object in the filtersConfig list pertains to a harmful + /// category. For more information, see Content + /// filters. For more information about the fields in a content filter, + /// see GuardrailContentFilterConfig. + /// + ///
        + ///
      • + /// Specify the category in the type field. + ///
      • + ///
      • + /// Specify the strength of the filter for prompts in the + /// inputStrength field and for model responses in the + /// strength field of the GuardrailContentFilterConfig. + ///
      • + ///
    • + ///
    • + /// (Optional) For security, include the ARN of a KMS key in the + /// kmsKeyId field. + ///
    • + ///
    • + /// (Optional) Attach any tags to the guardrail in the tags + /// object. For more information, see Tag + /// resources. + ///
    • + ///
    + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [TooManyTagsException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [blockedInputMessaging] : + /// The message to return when the guardrail blocks a prompt. + /// + /// Parameter [blockedOutputsMessaging] : + /// The message to return when the guardrail blocks a model response. + /// + /// Parameter [name] : + /// The name to give the guardrail. + /// + /// Parameter [clientRequestToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than once. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency in the Amazon S3 User Guide. + /// + /// Parameter [contentPolicyConfig] : + /// The content filter policies to configure for the guardrail. + /// + /// Parameter [description] : + /// A description of the guardrail. + /// + /// Parameter [kmsKeyId] : + /// The ARN of the KMS key that you use to encrypt the guardrail. + /// + /// Parameter [sensitiveInformationPolicyConfig] : + /// The sensitive information policy to configure for the guardrail. + /// + /// Parameter [tags] : + /// The tags that you want to attach to the guardrail. + /// + /// Parameter [topicPolicyConfig] : + /// The topic policies to configure for the guardrail. + /// + /// Parameter [wordPolicyConfig] : + /// The word policy you configure for the guardrail. + Future createGuardrail({ + required String blockedInputMessaging, + required String blockedOutputsMessaging, + required String name, + String? clientRequestToken, + GuardrailContentPolicyConfig? contentPolicyConfig, + String? description, + String? kmsKeyId, + GuardrailSensitiveInformationPolicyConfig? sensitiveInformationPolicyConfig, + List? tags, + GuardrailTopicPolicyConfig? topicPolicyConfig, + GuardrailWordPolicyConfig? wordPolicyConfig, + }) async { + final $payload = { + 'blockedInputMessaging': blockedInputMessaging, + 'blockedOutputsMessaging': blockedOutputsMessaging, + 'name': name, + 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (contentPolicyConfig != null) + 'contentPolicyConfig': contentPolicyConfig, + if (description != null) 'description': description, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (sensitiveInformationPolicyConfig != null) + 'sensitiveInformationPolicyConfig': sensitiveInformationPolicyConfig, + if (tags != null) 'tags': tags, + if (topicPolicyConfig != null) 'topicPolicyConfig': topicPolicyConfig, + if (wordPolicyConfig != null) 'wordPolicyConfig': wordPolicyConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/guardrails', + exceptionFnMap: _exceptionFns, + ); + return CreateGuardrailResponse.fromJson(response); + } + + /// Creates a version of the guardrail. Use this API to create a snapshot of + /// the guardrail when you are satisfied with a configuration, or to compare + /// the configuration with another version. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail. + /// + /// Parameter [clientRequestToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than once. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency in the Amazon S3 User Guide. + /// + /// Parameter [description] : + /// A description of the guardrail version. + Future createGuardrailVersion({ + required String guardrailIdentifier, + String? clientRequestToken, + String? description, + }) async { + final $payload = { + 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/guardrails/${Uri.encodeComponent(guardrailIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return CreateGuardrailVersionResponse.fromJson(response); + } + + /// Creates a fine-tuning job to customize a base model. + /// + /// You specify the base foundation model and the location of the training + /// data. After the model-customization job completes successfully, your + /// custom model resource will be ready to use. Amazon Bedrock returns + /// validation loss metrics and output generations after the job completes. + /// + /// For information on the format of training and validation data, see Prepare + /// the datasets. + /// + /// Model-customization jobs are asynchronous and the completion time depends + /// on the base model and the training/validation data size. To monitor a job, + /// use the GetModelCustomizationJob operation to retrieve the + /// job status. + /// + /// For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [TooManyTagsException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [baseModelIdentifier] : + /// Name of the base model. + /// + /// Parameter [customModelName] : + /// A name for the resulting custom model. + /// + /// Parameter [hyperParameters] : + /// Parameters related to tuning the model. For details on the format for + /// different models, see Custom + /// model hyperparameters. + /// + /// Parameter [jobName] : + /// A name for the fine-tuning job. + /// + /// Parameter [outputDataConfig] : + /// S3 location for the output data. + /// + /// Parameter [roleArn] : + /// The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock + /// can assume to perform tasks on your behalf. For example, during model + /// training, Amazon Bedrock needs your permission to read input data from an + /// S3 bucket, write model artifacts to an S3 bucket. To pass this role to + /// Amazon Bedrock, the caller of this API must have the + /// iam:PassRole permission. + /// + /// Parameter [trainingDataConfig] : + /// Information about the training dataset. + /// + /// Parameter [clientRequestToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [customModelKmsKeyId] : + /// The custom model is encrypted at rest using this key. + /// + /// Parameter [customModelTags] : + /// Tags to attach to the resulting custom model. + /// + /// Parameter [customizationType] : + /// The customization type. + /// + /// Parameter [jobTags] : + /// Tags to attach to the job. + /// + /// Parameter [validationDataConfig] : + /// Information about the validation dataset. + /// + /// Parameter [vpcConfig] : + /// VPC configuration (optional). Configuration parameters for the private + /// Virtual Private Cloud (VPC) that contains the resources you are using for + /// this job. + Future createModelCustomizationJob({ + required String baseModelIdentifier, + required String customModelName, + required Map hyperParameters, + required String jobName, + required OutputDataConfig outputDataConfig, + required String roleArn, + required TrainingDataConfig trainingDataConfig, + String? clientRequestToken, + String? customModelKmsKeyId, + List? customModelTags, + CustomizationType? customizationType, + List? jobTags, + ValidationDataConfig? validationDataConfig, + VpcConfig? vpcConfig, + }) async { + final $payload = { + 'baseModelIdentifier': baseModelIdentifier, + 'customModelName': customModelName, + 'hyperParameters': hyperParameters, + 'jobName': jobName, + 'outputDataConfig': outputDataConfig, + 'roleArn': roleArn, + 'trainingDataConfig': trainingDataConfig, + 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (customModelKmsKeyId != null) + 'customModelKmsKeyId': customModelKmsKeyId, + if (customModelTags != null) 'customModelTags': customModelTags, + if (customizationType != null) + 'customizationType': customizationType.toValue(), + if (jobTags != null) 'jobTags': jobTags, + if (validationDataConfig != null) + 'validationDataConfig': validationDataConfig, + if (vpcConfig != null) 'vpcConfig': vpcConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/model-customization-jobs', + exceptionFnMap: _exceptionFns, + ); + return CreateModelCustomizationJobResponse.fromJson(response); + } + + /// Creates dedicated throughput for a base or custom model with the model + /// units and for the duration that you specify. For pricing details, see Amazon Bedrock Pricing. + /// For more information, see Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [TooManyTagsException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [modelId] : + /// The Amazon Resource Name (ARN) or name of the model to associate with this + /// Provisioned Throughput. For a list of models for which you can purchase + /// Provisioned Throughput, see Amazon + /// Bedrock model IDs for purchasing Provisioned Throughput in the Amazon + /// Bedrock User Guide. + /// + /// Parameter [modelUnits] : + /// Number of model units to allocate. A model unit delivers a specific + /// throughput level for the specified model. The throughput level of a model + /// unit specifies the total number of input and output tokens that it can + /// process and generate within a span of one minute. By default, your account + /// has no model units for purchasing Provisioned Throughputs with commitment. + /// You must first visit the Amazon + /// Web Services support center to request MUs. + /// + /// For model unit quotas, see Provisioned + /// Throughput quotas in the Amazon Bedrock User Guide. + /// + /// For more information about what an MU specifies, contact your Amazon Web + /// Services account manager. + /// + /// Parameter [provisionedModelName] : + /// The name for this Provisioned Throughput. + /// + /// Parameter [clientRequestToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency in the Amazon S3 User Guide. + /// + /// Parameter [commitmentDuration] : + /// The commitment duration requested for the Provisioned Throughput. Billing + /// occurs hourly and is discounted for longer commitment terms. To request a + /// no-commit Provisioned Throughput, omit this field. + /// + /// Custom models support all levels of commitment. To see which base models + /// support no commitment, see Supported + /// regions and models for Provisioned Throughput in the Amazon Bedrock + /// User Guide + /// + /// Parameter [tags] : + /// Tags to associate with this Provisioned Throughput. + Future + createProvisionedModelThroughput({ + required String modelId, + required int modelUnits, + required String provisionedModelName, + String? clientRequestToken, + CommitmentDuration? commitmentDuration, + List? tags, + }) async { + _s.validateNumRange( + 'modelUnits', + modelUnits, + 1, + 1152921504606846976, + isRequired: true, + ); + final $payload = { + 'modelId': modelId, + 'modelUnits': modelUnits, + 'provisionedModelName': provisionedModelName, + 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (commitmentDuration != null) + 'commitmentDuration': commitmentDuration.toValue(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/provisioned-model-throughput', + exceptionFnMap: _exceptionFns, + ); + return CreateProvisionedModelThroughputResponse.fromJson(response); + } + + /// Deletes a custom model that you created earlier. For more information, see + /// Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [modelIdentifier] : + /// Name of the model to delete. + Future deleteCustomModel({ + required String modelIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/custom-models/${Uri.encodeComponent(modelIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a guardrail. + /// + ///
      + ///
    • + /// To delete a guardrail, only specify the ARN of the guardrail in the + /// guardrailIdentifier field. If you delete a guardrail, all of + /// its versions will be deleted. + ///
    • + ///
    • + /// To delete a version of a guardrail, specify the ARN of the guardrail in + /// the guardrailIdentifier field and the version in the + /// guardrailVersion field. + ///
    • + ///
    + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail. + /// + /// Parameter [guardrailVersion] : + /// The version of the guardrail. + Future deleteGuardrail({ + required String guardrailIdentifier, + String? guardrailVersion, + }) async { + final $query = >{ + if (guardrailVersion != null) 'guardrailVersion': [guardrailVersion], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/guardrails/${Uri.encodeComponent(guardrailIdentifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Delete the invocation logging. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + Future deleteModelInvocationLoggingConfiguration() async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/logging/modelinvocations', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a Provisioned Throughput. You can't delete a Provisioned + /// Throughput before the commitment term is over. For more information, see + /// Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [provisionedModelId] : + /// The Amazon Resource Name (ARN) or name of the Provisioned Throughput. + Future deleteProvisionedModelThroughput({ + required String provisionedModelId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/provisioned-model-throughput/${Uri.encodeComponent(provisionedModelId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Get the properties associated with a Amazon Bedrock custom model that you + /// have created.For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [modelIdentifier] : + /// Name or Amazon Resource Name (ARN) of the custom model. + Future getCustomModel({ + required String modelIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/custom-models/${Uri.encodeComponent(modelIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetCustomModelResponse.fromJson(response); + } + + /// Retrieves the properties associated with a model evaluation job, including + /// the status of the job. For more information, see Model + /// evaluations. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [jobIdentifier] : + /// The Amazon Resource Name (ARN) of the model evaluation job. + Future getEvaluationJob({ + required String jobIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/evaluation-jobs/${Uri.encodeComponent(jobIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetEvaluationJobResponse.fromJson(response); + } + + /// Get details about a Amazon Bedrock foundation model. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [modelIdentifier] : + /// The model identifier. + Future getFoundationModel({ + required String modelIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/foundation-models/${Uri.encodeComponent(modelIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetFoundationModelResponse.fromJson(response); + } + + /// Gets details about a guardrail. If you don't specify a version, the + /// response returns details for the DRAFT version. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail for which to get details. + /// + /// Parameter [guardrailVersion] : + /// The version of the guardrail for which to get details. If you don't + /// specify a version, the response returns details for the DRAFT + /// version. + Future getGuardrail({ + required String guardrailIdentifier, + String? guardrailVersion, + }) async { + final $query = >{ + if (guardrailVersion != null) 'guardrailVersion': [guardrailVersion], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/guardrails/${Uri.encodeComponent(guardrailIdentifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetGuardrailResponse.fromJson(response); + } + + /// Retrieves the properties associated with a model-customization job, + /// including the status of the job. For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [jobIdentifier] : + /// Identifier for the customization job. + Future getModelCustomizationJob({ + required String jobIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/model-customization-jobs/${Uri.encodeComponent(jobIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetModelCustomizationJobResponse.fromJson(response); + } + + /// Get the current configuration values for model invocation logging. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + Future + getModelInvocationLoggingConfiguration() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/logging/modelinvocations', + exceptionFnMap: _exceptionFns, + ); + return GetModelInvocationLoggingConfigurationResponse.fromJson(response); + } + + /// Returns details for a Provisioned Throughput. For more information, see Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [provisionedModelId] : + /// The Amazon Resource Name (ARN) or name of the Provisioned Throughput. + Future getProvisionedModelThroughput({ + required String provisionedModelId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/provisioned-model-throughput/${Uri.encodeComponent(provisionedModelId)}', + exceptionFnMap: _exceptionFns, + ); + return GetProvisionedModelThroughputResponse.fromJson(response); + } + + /// Returns a list of the custom models that you have created with the + /// CreateModelCustomizationJob operation. + /// + /// For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [baseModelArnEquals] : + /// Return custom models only if the base model Amazon Resource Name (ARN) + /// matches this parameter. + /// + /// Parameter [creationTimeAfter] : + /// Return custom models created after the specified time. + /// + /// Parameter [creationTimeBefore] : + /// Return custom models created before the specified time. + /// + /// Parameter [foundationModelArnEquals] : + /// Return custom models only if the foundation model Amazon Resource Name + /// (ARN) matches this parameter. + /// + /// Parameter [maxResults] : + /// Maximum number of results to return in the response. + /// + /// Parameter [nameContains] : + /// Return custom models only if the job name contains these characters. + /// + /// Parameter [nextToken] : + /// Continuation token from the previous response, for Amazon Bedrock to list + /// the next set of results. + /// + /// Parameter [sortBy] : + /// The field to sort by in the returned list of models. + /// + /// Parameter [sortOrder] : + /// The sort order of the results. + Future listCustomModels({ + String? baseModelArnEquals, + DateTime? creationTimeAfter, + DateTime? creationTimeBefore, + String? foundationModelArnEquals, + int? maxResults, + String? nameContains, + String? nextToken, + SortModelsBy? sortBy, + SortOrder? sortOrder, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (baseModelArnEquals != null) + 'baseModelArnEquals': [baseModelArnEquals], + if (creationTimeAfter != null) + 'creationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()], + if (creationTimeBefore != null) + 'creationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()], + if (foundationModelArnEquals != null) + 'foundationModelArnEquals': [foundationModelArnEquals], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nameContains != null) 'nameContains': [nameContains], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/custom-models', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListCustomModelsResponse.fromJson(response); + } + + /// Lists model evaluation jobs. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [creationTimeAfter] : + /// A filter that includes model evaluation jobs created after the time + /// specified. + /// + /// Parameter [creationTimeBefore] : + /// A filter that includes model evaluation jobs created prior to the time + /// specified. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. + /// + /// Parameter [nameContains] : + /// Query parameter string for model evaluation job names. + /// + /// Parameter [nextToken] : + /// Continuation token from the previous response, for Amazon Bedrock to list + /// the next set of results. + /// + /// Parameter [sortBy] : + /// Allows you to sort model evaluation jobs by when they were created. + /// + /// Parameter [sortOrder] : + /// How you want the order of jobs sorted. + /// + /// Parameter [statusEquals] : + /// Only return jobs where the status condition is met. + Future listEvaluationJobs({ + DateTime? creationTimeAfter, + DateTime? creationTimeBefore, + int? maxResults, + String? nameContains, + String? nextToken, + SortJobsBy? sortBy, + SortOrder? sortOrder, + EvaluationJobStatus? statusEquals, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (creationTimeAfter != null) + 'creationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()], + if (creationTimeBefore != null) + 'creationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nameContains != null) 'nameContains': [nameContains], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (statusEquals != null) 'statusEquals': [statusEquals.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/evaluation-jobs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEvaluationJobsResponse.fromJson(response); + } + + /// Lists Amazon Bedrock foundation models that you can use. You can filter + /// the results with the request parameters. For more information, see Foundation + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [byCustomizationType] : + /// Return models that support the customization type that you specify. For + /// more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// Parameter [byInferenceType] : + /// Return models that support the inference type that you specify. For more + /// information, see Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// Parameter [byOutputModality] : + /// Return models that support the output modality that you specify. + /// + /// Parameter [byProvider] : + /// Return models belonging to the model provider that you specify. + Future listFoundationModels({ + ModelCustomization? byCustomizationType, + InferenceType? byInferenceType, + ModelModality? byOutputModality, + String? byProvider, + }) async { + final $query = >{ + if (byCustomizationType != null) + 'byCustomizationType': [byCustomizationType.toValue()], + if (byInferenceType != null) + 'byInferenceType': [byInferenceType.toValue()], + if (byOutputModality != null) + 'byOutputModality': [byOutputModality.toValue()], + if (byProvider != null) 'byProvider': [byProvider], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/foundation-models', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFoundationModelsResponse.fromJson(response); + } + + /// Lists details about all the guardrails in an account. To list the + /// DRAFT version of all your guardrails, don't specify the + /// guardrailIdentifier field. To list all versions of a + /// guardrail, specify the ARN of the guardrail in the + /// guardrailIdentifier field. + /// + /// You can set the maximum number of results to return in a response in the + /// maxResults field. If there are more results than the number + /// you set, the response returns a nextToken that you can send + /// in another ListGuardrails request to see the next batch of + /// results. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. + /// + /// Parameter [nextToken] : + /// If there are more results than were returned in the response, the response + /// returns a nextToken that you can send in another + /// ListGuardrails request to see the next batch of results. + Future listGuardrails({ + String? guardrailIdentifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (guardrailIdentifier != null) + 'guardrailIdentifier': [guardrailIdentifier], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/guardrails', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListGuardrailsResponse.fromJson(response); + } + + /// Returns a list of model customization jobs that you have submitted. You + /// can filter the jobs to return based on one or more criteria. + /// + /// For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [creationTimeAfter] : + /// Return customization jobs created after the specified time. + /// + /// Parameter [creationTimeBefore] : + /// Return customization jobs created before the specified time. + /// + /// Parameter [maxResults] : + /// Maximum number of results to return in the response. + /// + /// Parameter [nameContains] : + /// Return customization jobs only if the job name contains these characters. + /// + /// Parameter [nextToken] : + /// Continuation token from the previous response, for Amazon Bedrock to list + /// the next set of results. + /// + /// Parameter [sortBy] : + /// The field to sort by in the returned list of jobs. + /// + /// Parameter [sortOrder] : + /// The sort order of the results. + /// + /// Parameter [statusEquals] : + /// Return customization jobs with the specified status. + Future listModelCustomizationJobs({ + DateTime? creationTimeAfter, + DateTime? creationTimeBefore, + int? maxResults, + String? nameContains, + String? nextToken, + SortJobsBy? sortBy, + SortOrder? sortOrder, + FineTuningJobStatus? statusEquals, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (creationTimeAfter != null) + 'creationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()], + if (creationTimeBefore != null) + 'creationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nameContains != null) 'nameContains': [nameContains], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (statusEquals != null) 'statusEquals': [statusEquals.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/model-customization-jobs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListModelCustomizationJobsResponse.fromJson(response); + } + + /// Lists the Provisioned Throughputs in the account. For more information, + /// see Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [creationTimeAfter] : + /// A filter that returns Provisioned Throughputs created after the specified + /// time. + /// + /// Parameter [creationTimeBefore] : + /// A filter that returns Provisioned Throughputs created before the specified + /// time. + /// + /// Parameter [maxResults] : + /// THe maximum number of results to return in the response. If there are more + /// results than the number you specified, the response returns a + /// nextToken value. To see the next batch of results, send the + /// nextToken value in another list request. + /// + /// Parameter [modelArnEquals] : + /// A filter that returns Provisioned Throughputs whose model Amazon Resource + /// Name (ARN) is equal to the value that you specify. + /// + /// Parameter [nameContains] : + /// A filter that returns Provisioned Throughputs if their name contains the + /// expression that you specify. + /// + /// Parameter [nextToken] : + /// If there are more results than the number you specified in the + /// maxResults field, the response returns a + /// nextToken value. To see the next batch of results, specify + /// the nextToken value in this field. + /// + /// Parameter [sortBy] : + /// The field by which to sort the returned list of Provisioned Throughputs. + /// + /// Parameter [sortOrder] : + /// The sort order of the results. + /// + /// Parameter [statusEquals] : + /// A filter that returns Provisioned Throughputs if their statuses matches + /// the value that you specify. + Future + listProvisionedModelThroughputs({ + DateTime? creationTimeAfter, + DateTime? creationTimeBefore, + int? maxResults, + String? modelArnEquals, + String? nameContains, + String? nextToken, + SortByProvisionedModels? sortBy, + SortOrder? sortOrder, + ProvisionedModelStatus? statusEquals, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (creationTimeAfter != null) + 'creationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()], + if (creationTimeBefore != null) + 'creationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (modelArnEquals != null) 'modelArnEquals': [modelArnEquals], + if (nameContains != null) 'nameContains': [nameContains], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (statusEquals != null) 'statusEquals': [statusEquals.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/provisioned-model-throughputs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListProvisionedModelThroughputsResponse.fromJson(response); + } + + /// List the tags associated with the specified resource. + /// + /// For more information, see Tagging + /// resources in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceARN] : + /// The Amazon Resource Name (ARN) of the resource. + Future listTagsForResource({ + required String resourceARN, + }) async { + final $payload = { + 'resourceARN': resourceARN, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/listTagsForResource', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Set the configuration values for model invocation logging. + /// + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [loggingConfig] : + /// The logging configuration values to set. + Future putModelInvocationLoggingConfiguration({ + required LoggingConfig loggingConfig, + }) async { + final $payload = { + 'loggingConfig': loggingConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/logging/modelinvocations', + exceptionFnMap: _exceptionFns, + ); + } + + /// Stops an in progress model evaluation job. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [jobIdentifier] : + /// The ARN of the model evaluation job you want to stop. + Future stopEvaluationJob({ + required String jobIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/evaluation-job/${Uri.encodeComponent(jobIdentifier)}/stop', + exceptionFnMap: _exceptionFns, + ); + } + + /// Stops an active model customization job. For more information, see Custom + /// models in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [jobIdentifier] : + /// Job identifier of the job to stop. + Future stopModelCustomizationJob({ + required String jobIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/model-customization-jobs/${Uri.encodeComponent(jobIdentifier)}/stop', + exceptionFnMap: _exceptionFns, + ); + } + + /// Associate tags with a resource. For more information, see Tagging + /// resources in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [TooManyTagsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceARN] : + /// The Amazon Resource Name (ARN) of the resource to tag. + /// + /// Parameter [tags] : + /// Tags to associate with the resource. + Future tagResource({ + required String resourceARN, + required List tags, + }) async { + final $payload = { + 'resourceARN': resourceARN, + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tagResource', + exceptionFnMap: _exceptionFns, + ); + } + + /// Remove one or more tags from a resource. For more information, see Tagging + /// resources in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceARN] : + /// The Amazon Resource Name (ARN) of the resource to untag. + /// + /// Parameter [tagKeys] : + /// Tag keys of the tags to remove from the resource. + Future untagResource({ + required String resourceARN, + required List tagKeys, + }) async { + final $payload = { + 'resourceARN': resourceARN, + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/untagResource', + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a guardrail with the values you specify. + /// + ///
      + ///
    • + /// Specify a name and optional description. + ///
    • + ///
    • + /// Specify messages for when the guardrail successfully blocks a prompt or a + /// model response in the blockedInputMessaging and + /// blockedOutputsMessaging fields. + ///
    • + ///
    • + /// Specify topics for the guardrail to deny in the + /// topicPolicyConfig object. Each GuardrailTopicConfig + /// object in the topicsConfig list pertains to one topic. + /// + ///
        + ///
      • + /// Give a name and description so that the + /// guardrail can properly identify the topic. + ///
      • + ///
      • + /// Specify DENY in the type field. + ///
      • + ///
      • + /// (Optional) Provide up to five prompts that you would categorize as + /// belonging to the topic in the examples list. + ///
      • + ///
    • + ///
    • + /// Specify filter strengths for the harmful categories defined in Amazon + /// Bedrock in the contentPolicyConfig object. Each GuardrailContentFilterConfig + /// object in the filtersConfig list pertains to a harmful + /// category. For more information, see Content + /// filters. For more information about the fields in a content filter, + /// see GuardrailContentFilterConfig. + /// + ///
        + ///
      • + /// Specify the category in the type field. + ///
      • + ///
      • + /// Specify the strength of the filter for prompts in the + /// inputStrength field and for model responses in the + /// strength field of the GuardrailContentFilterConfig. + ///
      • + ///
    • + ///
    • + /// (Optional) For security, include the ARN of a KMS key in the + /// kmsKeyId field. + ///
    • + ///
    • + /// (Optional) Attach any tags to the guardrail in the tags + /// object. For more information, see Tag + /// resources. + ///
    • + ///
    + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [blockedInputMessaging] : + /// The message to return when the guardrail blocks a prompt. + /// + /// Parameter [blockedOutputsMessaging] : + /// The message to return when the guardrail blocks a model response. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail + /// + /// Parameter [name] : + /// A name for the guardrail. + /// + /// Parameter [contentPolicyConfig] : + /// The content policy to configure for the guardrail. + /// + /// Parameter [description] : + /// A description of the guardrail. + /// + /// Parameter [kmsKeyId] : + /// The ARN of the KMS key with which to encrypt the guardrail. + /// + /// Parameter [sensitiveInformationPolicyConfig] : + /// The sensitive information policy to configure for the guardrail. + /// + /// Parameter [topicPolicyConfig] : + /// The topic policy to configure for the guardrail. + /// + /// Parameter [wordPolicyConfig] : + /// The word policy to configure for the guardrail. + Future updateGuardrail({ + required String blockedInputMessaging, + required String blockedOutputsMessaging, + required String guardrailIdentifier, + required String name, + GuardrailContentPolicyConfig? contentPolicyConfig, + String? description, + String? kmsKeyId, + GuardrailSensitiveInformationPolicyConfig? sensitiveInformationPolicyConfig, + GuardrailTopicPolicyConfig? topicPolicyConfig, + GuardrailWordPolicyConfig? wordPolicyConfig, + }) async { + final $payload = { + 'blockedInputMessaging': blockedInputMessaging, + 'blockedOutputsMessaging': blockedOutputsMessaging, + 'name': name, + if (contentPolicyConfig != null) + 'contentPolicyConfig': contentPolicyConfig, + if (description != null) 'description': description, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (sensitiveInformationPolicyConfig != null) + 'sensitiveInformationPolicyConfig': sensitiveInformationPolicyConfig, + if (topicPolicyConfig != null) 'topicPolicyConfig': topicPolicyConfig, + if (wordPolicyConfig != null) 'wordPolicyConfig': wordPolicyConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/guardrails/${Uri.encodeComponent(guardrailIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateGuardrailResponse.fromJson(response); + } + + /// Updates the name or associated model for a Provisioned Throughput. For + /// more information, see Provisioned + /// Throughput in the Amazon Bedrock User Guide. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [provisionedModelId] : + /// The Amazon Resource Name (ARN) or name of the Provisioned Throughput to + /// update. + /// + /// Parameter [desiredModelId] : + /// The Amazon Resource Name (ARN) of the new model to associate with this + /// Provisioned Throughput. You can't specify this field if this Provisioned + /// Throughput is associated with a base model. + /// + /// If this Provisioned Throughput is associated with a custom model, you can + /// specify one of the following options: + /// + ///
      + ///
    • + /// The base model from which the custom model was customized. + ///
    • + ///
    • + /// Another custom model that was customized from the same base model as the + /// custom model. + ///
    • + ///
    + /// + /// Parameter [desiredProvisionedModelName] : + /// The new name for this Provisioned Throughput. + Future updateProvisionedModelThroughput({ + required String provisionedModelId, + String? desiredModelId, + String? desiredProvisionedModelName, + }) async { + final $payload = { + if (desiredModelId != null) 'desiredModelId': desiredModelId, + if (desiredProvisionedModelName != null) + 'desiredProvisionedModelName': desiredProvisionedModelName, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/provisioned-model-throughput/${Uri.encodeComponent(provisionedModelId)}', + exceptionFnMap: _exceptionFns, + ); + } +} + +/// Use to specify a automatic model evaluation job. The +/// EvaluationDatasetMetricConfig object is used to specify the +/// prompt datasets, task type, and metric names. +class AutomatedEvaluationConfig { + /// Specifies the required elements for an automatic model evaluation job. + final List datasetMetricConfigs; + + AutomatedEvaluationConfig({ + required this.datasetMetricConfigs, + }); + + factory AutomatedEvaluationConfig.fromJson(Map json) { + return AutomatedEvaluationConfig( + datasetMetricConfigs: (json['datasetMetricConfigs'] as List) + .whereNotNull() + .map((e) => + EvaluationDatasetMetricConfig.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final datasetMetricConfigs = this.datasetMetricConfigs; + return { + 'datasetMetricConfigs': datasetMetricConfigs, + }; + } +} + +/// CloudWatch logging configuration. +class CloudWatchConfig { + /// The log group name. + final String logGroupName; + + /// The role Amazon Resource Name (ARN). + final String roleArn; + + /// S3 configuration for delivering a large amount of data. + final S3Config? largeDataDeliveryS3Config; + + CloudWatchConfig({ + required this.logGroupName, + required this.roleArn, + this.largeDataDeliveryS3Config, + }); + + factory CloudWatchConfig.fromJson(Map json) { + return CloudWatchConfig( + logGroupName: json['logGroupName'] as String, + roleArn: json['roleArn'] as String, + largeDataDeliveryS3Config: json['largeDataDeliveryS3Config'] != null + ? S3Config.fromJson( + json['largeDataDeliveryS3Config'] as Map) + : null, + ); + } + + Map toJson() { + final logGroupName = this.logGroupName; + final roleArn = this.roleArn; + final largeDataDeliveryS3Config = this.largeDataDeliveryS3Config; + return { + 'logGroupName': logGroupName, + 'roleArn': roleArn, + if (largeDataDeliveryS3Config != null) + 'largeDataDeliveryS3Config': largeDataDeliveryS3Config, + }; + } +} + +enum CommitmentDuration { + oneMonth, + sixMonths, +} + +extension CommitmentDurationValueExtension on CommitmentDuration { + String toValue() { + switch (this) { + case CommitmentDuration.oneMonth: + return 'OneMonth'; + case CommitmentDuration.sixMonths: + return 'SixMonths'; + } + } +} + +extension CommitmentDurationFromString on String { + CommitmentDuration toCommitmentDuration() { + switch (this) { + case 'OneMonth': + return CommitmentDuration.oneMonth; + case 'SixMonths': + return CommitmentDuration.sixMonths; + } + throw Exception('$this is not known in enum CommitmentDuration'); + } +} + +class CreateEvaluationJobResponse { + /// The ARN of the model evaluation job. + final String jobArn; + + CreateEvaluationJobResponse({ + required this.jobArn, + }); + + factory CreateEvaluationJobResponse.fromJson(Map json) { + return CreateEvaluationJobResponse( + jobArn: json['jobArn'] as String, + ); + } + + Map toJson() { + final jobArn = this.jobArn; + return { + 'jobArn': jobArn, + }; + } +} + +class CreateGuardrailResponse { + /// The time at which the guardrail was created. + final DateTime createdAt; + + /// The ARN of the guardrail that was created. + final String guardrailArn; + + /// The unique identifier of the guardrail that was created. + final String guardrailId; + + /// The version of the guardrail that was created. This value should be 1. + final String version; + + CreateGuardrailResponse({ + required this.createdAt, + required this.guardrailArn, + required this.guardrailId, + required this.version, + }); + + factory CreateGuardrailResponse.fromJson(Map json) { + return CreateGuardrailResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + guardrailArn: json['guardrailArn'] as String, + guardrailId: json['guardrailId'] as String, + version: json['version'] as String, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final guardrailArn = this.guardrailArn; + final guardrailId = this.guardrailId; + final version = this.version; + return { + 'createdAt': iso8601ToJson(createdAt), + 'guardrailArn': guardrailArn, + 'guardrailId': guardrailId, + 'version': version, + }; + } +} + +class CreateGuardrailVersionResponse { + /// The unique identifier of the guardrail. + final String guardrailId; + + /// The number of the version of the guardrail. + final String version; + + CreateGuardrailVersionResponse({ + required this.guardrailId, + required this.version, + }); + + factory CreateGuardrailVersionResponse.fromJson(Map json) { + return CreateGuardrailVersionResponse( + guardrailId: json['guardrailId'] as String, + version: json['version'] as String, + ); + } + + Map toJson() { + final guardrailId = this.guardrailId; + final version = this.version; + return { + 'guardrailId': guardrailId, + 'version': version, + }; + } +} + +class CreateModelCustomizationJobResponse { + /// Amazon Resource Name (ARN) of the fine tuning job + final String jobArn; + + CreateModelCustomizationJobResponse({ + required this.jobArn, + }); + + factory CreateModelCustomizationJobResponse.fromJson( + Map json) { + return CreateModelCustomizationJobResponse( + jobArn: json['jobArn'] as String, + ); + } + + Map toJson() { + final jobArn = this.jobArn; + return { + 'jobArn': jobArn, + }; + } +} + +class CreateProvisionedModelThroughputResponse { + /// The Amazon Resource Name (ARN) for this Provisioned Throughput. + final String provisionedModelArn; + + CreateProvisionedModelThroughputResponse({ + required this.provisionedModelArn, + }); + + factory CreateProvisionedModelThroughputResponse.fromJson( + Map json) { + return CreateProvisionedModelThroughputResponse( + provisionedModelArn: json['provisionedModelArn'] as String, + ); + } + + Map toJson() { + final provisionedModelArn = this.provisionedModelArn; + return { + 'provisionedModelArn': provisionedModelArn, + }; + } +} + +/// Summary information for a custom model. +class CustomModelSummary { + /// The base model Amazon Resource Name (ARN). + final String baseModelArn; + + /// The base model name. + final String baseModelName; + + /// Creation time of the model. + final DateTime creationTime; + + /// The Amazon Resource Name (ARN) of the custom model. + final String modelArn; + + /// The name of the custom model. + final String modelName; + + /// Specifies whether to carry out continued pre-training of a model or whether + /// to fine-tune it. For more information, see Custom + /// models. + final CustomizationType? customizationType; + + CustomModelSummary({ + required this.baseModelArn, + required this.baseModelName, + required this.creationTime, + required this.modelArn, + required this.modelName, + this.customizationType, + }); + + factory CustomModelSummary.fromJson(Map json) { + return CustomModelSummary( + baseModelArn: json['baseModelArn'] as String, + baseModelName: json['baseModelName'] as String, + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + modelArn: json['modelArn'] as String, + modelName: json['modelName'] as String, + customizationType: + (json['customizationType'] as String?)?.toCustomizationType(), + ); + } + + Map toJson() { + final baseModelArn = this.baseModelArn; + final baseModelName = this.baseModelName; + final creationTime = this.creationTime; + final modelArn = this.modelArn; + final modelName = this.modelName; + final customizationType = this.customizationType; + return { + 'baseModelArn': baseModelArn, + 'baseModelName': baseModelName, + 'creationTime': iso8601ToJson(creationTime), + 'modelArn': modelArn, + 'modelName': modelName, + if (customizationType != null) + 'customizationType': customizationType.toValue(), + }; + } +} + +enum CustomizationType { + fineTuning, + continuedPreTraining, +} + +extension CustomizationTypeValueExtension on CustomizationType { + String toValue() { + switch (this) { + case CustomizationType.fineTuning: + return 'FINE_TUNING'; + case CustomizationType.continuedPreTraining: + return 'CONTINUED_PRE_TRAINING'; + } + } +} + +extension CustomizationTypeFromString on String { + CustomizationType toCustomizationType() { + switch (this) { + case 'FINE_TUNING': + return CustomizationType.fineTuning; + case 'CONTINUED_PRE_TRAINING': + return CustomizationType.continuedPreTraining; + } + throw Exception('$this is not known in enum CustomizationType'); + } +} + +class DeleteCustomModelResponse { + DeleteCustomModelResponse(); + + factory DeleteCustomModelResponse.fromJson(Map _) { + return DeleteCustomModelResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteGuardrailResponse { + DeleteGuardrailResponse(); + + factory DeleteGuardrailResponse.fromJson(Map _) { + return DeleteGuardrailResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteModelInvocationLoggingConfigurationResponse { + DeleteModelInvocationLoggingConfigurationResponse(); + + factory DeleteModelInvocationLoggingConfigurationResponse.fromJson( + Map _) { + return DeleteModelInvocationLoggingConfigurationResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteProvisionedModelThroughputResponse { + DeleteProvisionedModelThroughputResponse(); + + factory DeleteProvisionedModelThroughputResponse.fromJson( + Map _) { + return DeleteProvisionedModelThroughputResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Contains the ARN of the Amazon Bedrock models specified in your model +/// evaluation job. Each Amazon Bedrock model supports different +/// inferenceParams. To learn more about supported inference +/// parameters for Amazon Bedrock models, see Inference +/// parameters for foundation models. +/// +/// The inferenceParams are specified using JSON. To successfully +/// insert JSON as string make sure that all quotations are properly escaped. +/// For example, "temperature":"0.25" key value pair would need to +/// be formatted as \"temperature\":\"0.25\" to successfully +/// accepted in the request. +class EvaluationBedrockModel { + /// Each Amazon Bedrock support different inference parameters that change how + /// the model behaves during inference. + final String inferenceParams; + + /// The ARN of the Amazon Bedrock model specified. + final String modelIdentifier; + + EvaluationBedrockModel({ + required this.inferenceParams, + required this.modelIdentifier, + }); + + factory EvaluationBedrockModel.fromJson(Map json) { + return EvaluationBedrockModel( + inferenceParams: json['inferenceParams'] as String, + modelIdentifier: json['modelIdentifier'] as String, + ); + } + + Map toJson() { + final inferenceParams = this.inferenceParams; + final modelIdentifier = this.modelIdentifier; + return { + 'inferenceParams': inferenceParams, + 'modelIdentifier': modelIdentifier, + }; + } +} + +/// Used to specify either a AutomatedEvaluationConfig or +/// HumanEvaluationConfig object. +class EvaluationConfig { + /// Used to specify an automated model evaluation job. See + /// AutomatedEvaluationConfig to view the required parameters. + final AutomatedEvaluationConfig? automated; + + /// Used to specify a model evaluation job that uses human workers.See + /// HumanEvaluationConfig to view the required parameters. + final HumanEvaluationConfig? human; + + EvaluationConfig({ + this.automated, + this.human, + }); + + factory EvaluationConfig.fromJson(Map json) { + return EvaluationConfig( + automated: json['automated'] != null + ? AutomatedEvaluationConfig.fromJson( + json['automated'] as Map) + : null, + human: json['human'] != null + ? HumanEvaluationConfig.fromJson( + json['human'] as Map) + : null, + ); + } + + Map toJson() { + final automated = this.automated; + final human = this.human; + return { + if (automated != null) 'automated': automated, + if (human != null) 'human': human, + }; + } +} + +/// Used to specify the name of a built-in prompt dataset and optionally, the +/// Amazon S3 bucket where a custom prompt dataset is saved. +class EvaluationDataset { + /// Used to specify supported built-in prompt datasets. Valid values are + /// Builtin.Bold, Builtin.BoolQ, + /// Builtin.NaturalQuestions, Builtin.Gigaword, + /// Builtin.RealToxicityPrompts, Builtin.TriviaQa, + /// Builtin.T-Rex, + /// Builtin.WomensEcommerceClothingReviews and + /// Builtin.Wikitext2. + final String name; + + /// For custom prompt datasets, you must specify the location in Amazon S3 where + /// the prompt dataset is saved. + final EvaluationDatasetLocation? datasetLocation; + + EvaluationDataset({ + required this.name, + this.datasetLocation, + }); + + factory EvaluationDataset.fromJson(Map json) { + return EvaluationDataset( + name: json['name'] as String, + datasetLocation: json['datasetLocation'] != null + ? EvaluationDatasetLocation.fromJson( + json['datasetLocation'] as Map) + : null, + ); + } + + Map toJson() { + final name = this.name; + final datasetLocation = this.datasetLocation; + return { + 'name': name, + if (datasetLocation != null) 'datasetLocation': datasetLocation, + }; + } +} + +/// The location in Amazon S3 where your prompt dataset is stored. +class EvaluationDatasetLocation { + /// The S3 URI of the S3 bucket specified in the job. + final String? s3Uri; + + EvaluationDatasetLocation({ + this.s3Uri, + }); + + factory EvaluationDatasetLocation.fromJson(Map json) { + return EvaluationDatasetLocation( + s3Uri: json['s3Uri'] as String?, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + if (s3Uri != null) 's3Uri': s3Uri, + }; + } +} + +/// Defines the built-in prompt datasets, built-in metric names and custom +/// metric names, and the task type. +class EvaluationDatasetMetricConfig { + /// Specifies the prompt dataset. + final EvaluationDataset dataset; + + /// The names of the metrics used. For automated model evaluation jobs valid + /// values are "Builtin.Accuracy", + /// "Builtin.Robustness", and "Builtin.Toxicity". In + /// human-based model evaluation jobs the array of strings must match the + /// name parameter specified in + /// HumanEvaluationCustomMetric. + final List metricNames; + + /// The task type you want the model to carry out. + final EvaluationTaskType taskType; + + EvaluationDatasetMetricConfig({ + required this.dataset, + required this.metricNames, + required this.taskType, + }); + + factory EvaluationDatasetMetricConfig.fromJson(Map json) { + return EvaluationDatasetMetricConfig( + dataset: + EvaluationDataset.fromJson(json['dataset'] as Map), + metricNames: (json['metricNames'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + taskType: (json['taskType'] as String).toEvaluationTaskType(), + ); + } + + Map toJson() { + final dataset = this.dataset; + final metricNames = this.metricNames; + final taskType = this.taskType; + return { + 'dataset': dataset, + 'metricNames': metricNames, + 'taskType': taskType.toValue(), + }; + } +} + +/// Used to define the models you want used in your model evaluation job. +/// Automated model evaluation jobs support only a single model. In a +/// human-based model evaluation job, your annotator can compare the responses +/// for up to two different models. +class EvaluationInferenceConfig { + /// Used to specify the models. + final List? models; + + EvaluationInferenceConfig({ + this.models, + }); + + factory EvaluationInferenceConfig.fromJson(Map json) { + return EvaluationInferenceConfig( + models: (json['models'] as List?) + ?.whereNotNull() + .map((e) => EvaluationModelConfig.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final models = this.models; + return { + if (models != null) 'models': models, + }; + } +} + +enum EvaluationJobStatus { + inProgress, + completed, + failed, + stopping, + stopped, +} + +extension EvaluationJobStatusValueExtension on EvaluationJobStatus { + String toValue() { + switch (this) { + case EvaluationJobStatus.inProgress: + return 'InProgress'; + case EvaluationJobStatus.completed: + return 'Completed'; + case EvaluationJobStatus.failed: + return 'Failed'; + case EvaluationJobStatus.stopping: + return 'Stopping'; + case EvaluationJobStatus.stopped: + return 'Stopped'; + } + } +} + +extension EvaluationJobStatusFromString on String { + EvaluationJobStatus toEvaluationJobStatus() { + switch (this) { + case 'InProgress': + return EvaluationJobStatus.inProgress; + case 'Completed': + return EvaluationJobStatus.completed; + case 'Failed': + return EvaluationJobStatus.failed; + case 'Stopping': + return EvaluationJobStatus.stopping; + case 'Stopped': + return EvaluationJobStatus.stopped; + } + throw Exception('$this is not known in enum EvaluationJobStatus'); + } +} + +enum EvaluationJobType { + human, + automated, +} + +extension EvaluationJobTypeValueExtension on EvaluationJobType { + String toValue() { + switch (this) { + case EvaluationJobType.human: + return 'Human'; + case EvaluationJobType.automated: + return 'Automated'; + } + } +} + +extension EvaluationJobTypeFromString on String { + EvaluationJobType toEvaluationJobType() { + switch (this) { + case 'Human': + return EvaluationJobType.human; + case 'Automated': + return EvaluationJobType.automated; + } + throw Exception('$this is not known in enum EvaluationJobType'); + } +} + +/// Defines the models used in the model evaluation job. +class EvaluationModelConfig { + /// Defines the Amazon Bedrock model and inference parameters you want used. + final EvaluationBedrockModel? bedrockModel; + + EvaluationModelConfig({ + this.bedrockModel, + }); + + factory EvaluationModelConfig.fromJson(Map json) { + return EvaluationModelConfig( + bedrockModel: json['bedrockModel'] != null + ? EvaluationBedrockModel.fromJson( + json['bedrockModel'] as Map) + : null, + ); + } + + Map toJson() { + final bedrockModel = this.bedrockModel; + return { + if (bedrockModel != null) 'bedrockModel': bedrockModel, + }; + } +} + +/// The Amazon S3 location where the results of your model evaluation job are +/// saved. +class EvaluationOutputDataConfig { + /// The Amazon S3 URI where the results of model evaluation job are saved. + final String s3Uri; + + EvaluationOutputDataConfig({ + required this.s3Uri, + }); + + factory EvaluationOutputDataConfig.fromJson(Map json) { + return EvaluationOutputDataConfig( + s3Uri: json['s3Uri'] as String, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + 's3Uri': s3Uri, + }; + } +} + +/// A summary of the model evaluation job. +class EvaluationSummary { + /// When the model evaluation job was created. + final DateTime creationTime; + + /// What task type was used in the model evaluation job. + final List evaluationTaskTypes; + + /// The Amazon Resource Name (ARN) of the model evaluation job. + final String jobArn; + + /// The name of the model evaluation job. + final String jobName; + + /// The type, either human or automatic, of model evaluation job. + final EvaluationJobType jobType; + + /// The Amazon Resource Names (ARNs) of the model(s) used in the model + /// evaluation job. + final List modelIdentifiers; + + /// The current status of the model evaluation job. + final EvaluationJobStatus status; + + EvaluationSummary({ + required this.creationTime, + required this.evaluationTaskTypes, + required this.jobArn, + required this.jobName, + required this.jobType, + required this.modelIdentifiers, + required this.status, + }); + + factory EvaluationSummary.fromJson(Map json) { + return EvaluationSummary( + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + evaluationTaskTypes: (json['evaluationTaskTypes'] as List) + .whereNotNull() + .map((e) => (e as String).toEvaluationTaskType()) + .toList(), + jobArn: json['jobArn'] as String, + jobName: json['jobName'] as String, + jobType: (json['jobType'] as String).toEvaluationJobType(), + modelIdentifiers: (json['modelIdentifiers'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + status: (json['status'] as String).toEvaluationJobStatus(), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final evaluationTaskTypes = this.evaluationTaskTypes; + final jobArn = this.jobArn; + final jobName = this.jobName; + final jobType = this.jobType; + final modelIdentifiers = this.modelIdentifiers; + final status = this.status; + return { + 'creationTime': iso8601ToJson(creationTime), + 'evaluationTaskTypes': + evaluationTaskTypes.map((e) => e.toValue()).toList(), + 'jobArn': jobArn, + 'jobName': jobName, + 'jobType': jobType.toValue(), + 'modelIdentifiers': modelIdentifiers, + 'status': status.toValue(), + }; + } +} + +enum EvaluationTaskType { + summarization, + classification, + questionAndAnswer, + generation, + custom, +} + +extension EvaluationTaskTypeValueExtension on EvaluationTaskType { + String toValue() { + switch (this) { + case EvaluationTaskType.summarization: + return 'Summarization'; + case EvaluationTaskType.classification: + return 'Classification'; + case EvaluationTaskType.questionAndAnswer: + return 'QuestionAndAnswer'; + case EvaluationTaskType.generation: + return 'Generation'; + case EvaluationTaskType.custom: + return 'Custom'; + } + } +} + +extension EvaluationTaskTypeFromString on String { + EvaluationTaskType toEvaluationTaskType() { + switch (this) { + case 'Summarization': + return EvaluationTaskType.summarization; + case 'Classification': + return EvaluationTaskType.classification; + case 'QuestionAndAnswer': + return EvaluationTaskType.questionAndAnswer; + case 'Generation': + return EvaluationTaskType.generation; + case 'Custom': + return EvaluationTaskType.custom; + } + throw Exception('$this is not known in enum EvaluationTaskType'); + } +} + +enum FineTuningJobStatus { + inProgress, + completed, + failed, + stopping, + stopped, +} + +extension FineTuningJobStatusValueExtension on FineTuningJobStatus { + String toValue() { + switch (this) { + case FineTuningJobStatus.inProgress: + return 'InProgress'; + case FineTuningJobStatus.completed: + return 'Completed'; + case FineTuningJobStatus.failed: + return 'Failed'; + case FineTuningJobStatus.stopping: + return 'Stopping'; + case FineTuningJobStatus.stopped: + return 'Stopped'; + } + } +} + +extension FineTuningJobStatusFromString on String { + FineTuningJobStatus toFineTuningJobStatus() { + switch (this) { + case 'InProgress': + return FineTuningJobStatus.inProgress; + case 'Completed': + return FineTuningJobStatus.completed; + case 'Failed': + return FineTuningJobStatus.failed; + case 'Stopping': + return FineTuningJobStatus.stopping; + case 'Stopped': + return FineTuningJobStatus.stopped; + } + throw Exception('$this is not known in enum FineTuningJobStatus'); + } +} + +/// Information about a foundation model. +class FoundationModelDetails { + /// The model Amazon Resource Name (ARN). + final String modelArn; + + /// The model identifier. + final String modelId; + + /// The customization that the model supports. + final List? customizationsSupported; + + /// The inference types that the model supports. + final List? inferenceTypesSupported; + + /// The input modalities that the model supports. + final List? inputModalities; + + /// Contains details about whether a model version is available or deprecated + final FoundationModelLifecycle? modelLifecycle; + + /// The model name. + final String? modelName; + + /// The output modalities that the model supports. + final List? outputModalities; + + /// The model's provider name. + final String? providerName; + + /// Indicates whether the model supports streaming. + final bool? responseStreamingSupported; + + FoundationModelDetails({ + required this.modelArn, + required this.modelId, + this.customizationsSupported, + this.inferenceTypesSupported, + this.inputModalities, + this.modelLifecycle, + this.modelName, + this.outputModalities, + this.providerName, + this.responseStreamingSupported, + }); + + factory FoundationModelDetails.fromJson(Map json) { + return FoundationModelDetails( + modelArn: json['modelArn'] as String, + modelId: json['modelId'] as String, + customizationsSupported: (json['customizationsSupported'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelCustomization()) + .toList(), + inferenceTypesSupported: (json['inferenceTypesSupported'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toInferenceType()) + .toList(), + inputModalities: (json['inputModalities'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelModality()) + .toList(), + modelLifecycle: json['modelLifecycle'] != null + ? FoundationModelLifecycle.fromJson( + json['modelLifecycle'] as Map) + : null, + modelName: json['modelName'] as String?, + outputModalities: (json['outputModalities'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelModality()) + .toList(), + providerName: json['providerName'] as String?, + responseStreamingSupported: json['responseStreamingSupported'] as bool?, + ); + } + + Map toJson() { + final modelArn = this.modelArn; + final modelId = this.modelId; + final customizationsSupported = this.customizationsSupported; + final inferenceTypesSupported = this.inferenceTypesSupported; + final inputModalities = this.inputModalities; + final modelLifecycle = this.modelLifecycle; + final modelName = this.modelName; + final outputModalities = this.outputModalities; + final providerName = this.providerName; + final responseStreamingSupported = this.responseStreamingSupported; + return { + 'modelArn': modelArn, + 'modelId': modelId, + if (customizationsSupported != null) + 'customizationsSupported': + customizationsSupported.map((e) => e.toValue()).toList(), + if (inferenceTypesSupported != null) + 'inferenceTypesSupported': + inferenceTypesSupported.map((e) => e.toValue()).toList(), + if (inputModalities != null) + 'inputModalities': inputModalities.map((e) => e.toValue()).toList(), + if (modelLifecycle != null) 'modelLifecycle': modelLifecycle, + if (modelName != null) 'modelName': modelName, + if (outputModalities != null) + 'outputModalities': outputModalities.map((e) => e.toValue()).toList(), + if (providerName != null) 'providerName': providerName, + if (responseStreamingSupported != null) + 'responseStreamingSupported': responseStreamingSupported, + }; + } +} + +/// Details about whether a model version is available or deprecated. +class FoundationModelLifecycle { + /// Specifies whether a model version is available (ACTIVE) or + /// deprecated (LEGACY. + final FoundationModelLifecycleStatus status; + + FoundationModelLifecycle({ + required this.status, + }); + + factory FoundationModelLifecycle.fromJson(Map json) { + return FoundationModelLifecycle( + status: (json['status'] as String).toFoundationModelLifecycleStatus(), + ); + } + + Map toJson() { + final status = this.status; + return { + 'status': status.toValue(), + }; + } +} + +enum FoundationModelLifecycleStatus { + active, + legacy, +} + +extension FoundationModelLifecycleStatusValueExtension + on FoundationModelLifecycleStatus { + String toValue() { + switch (this) { + case FoundationModelLifecycleStatus.active: + return 'ACTIVE'; + case FoundationModelLifecycleStatus.legacy: + return 'LEGACY'; + } + } +} + +extension FoundationModelLifecycleStatusFromString on String { + FoundationModelLifecycleStatus toFoundationModelLifecycleStatus() { + switch (this) { + case 'ACTIVE': + return FoundationModelLifecycleStatus.active; + case 'LEGACY': + return FoundationModelLifecycleStatus.legacy; + } + throw Exception( + '$this is not known in enum FoundationModelLifecycleStatus'); + } +} + +/// Summary information for a foundation model. +class FoundationModelSummary { + /// The Amazon Resource Name (ARN) of the foundation model. + final String modelArn; + + /// The model ID of the foundation model. + final String modelId; + + /// Whether the model supports fine-tuning or continual pre-training. + final List? customizationsSupported; + + /// The inference types that the model supports. + final List? inferenceTypesSupported; + + /// The input modalities that the model supports. + final List? inputModalities; + + /// Contains details about whether a model version is available or deprecated. + final FoundationModelLifecycle? modelLifecycle; + + /// The name of the model. + final String? modelName; + + /// The output modalities that the model supports. + final List? outputModalities; + + /// The model's provider name. + final String? providerName; + + /// Indicates whether the model supports streaming. + final bool? responseStreamingSupported; + + FoundationModelSummary({ + required this.modelArn, + required this.modelId, + this.customizationsSupported, + this.inferenceTypesSupported, + this.inputModalities, + this.modelLifecycle, + this.modelName, + this.outputModalities, + this.providerName, + this.responseStreamingSupported, + }); + + factory FoundationModelSummary.fromJson(Map json) { + return FoundationModelSummary( + modelArn: json['modelArn'] as String, + modelId: json['modelId'] as String, + customizationsSupported: (json['customizationsSupported'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelCustomization()) + .toList(), + inferenceTypesSupported: (json['inferenceTypesSupported'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toInferenceType()) + .toList(), + inputModalities: (json['inputModalities'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelModality()) + .toList(), + modelLifecycle: json['modelLifecycle'] != null + ? FoundationModelLifecycle.fromJson( + json['modelLifecycle'] as Map) + : null, + modelName: json['modelName'] as String?, + outputModalities: (json['outputModalities'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toModelModality()) + .toList(), + providerName: json['providerName'] as String?, + responseStreamingSupported: json['responseStreamingSupported'] as bool?, + ); + } + + Map toJson() { + final modelArn = this.modelArn; + final modelId = this.modelId; + final customizationsSupported = this.customizationsSupported; + final inferenceTypesSupported = this.inferenceTypesSupported; + final inputModalities = this.inputModalities; + final modelLifecycle = this.modelLifecycle; + final modelName = this.modelName; + final outputModalities = this.outputModalities; + final providerName = this.providerName; + final responseStreamingSupported = this.responseStreamingSupported; + return { + 'modelArn': modelArn, + 'modelId': modelId, + if (customizationsSupported != null) + 'customizationsSupported': + customizationsSupported.map((e) => e.toValue()).toList(), + if (inferenceTypesSupported != null) + 'inferenceTypesSupported': + inferenceTypesSupported.map((e) => e.toValue()).toList(), + if (inputModalities != null) + 'inputModalities': inputModalities.map((e) => e.toValue()).toList(), + if (modelLifecycle != null) 'modelLifecycle': modelLifecycle, + if (modelName != null) 'modelName': modelName, + if (outputModalities != null) + 'outputModalities': outputModalities.map((e) => e.toValue()).toList(), + if (providerName != null) 'providerName': providerName, + if (responseStreamingSupported != null) + 'responseStreamingSupported': responseStreamingSupported, + }; + } +} + +class GetCustomModelResponse { + /// Amazon Resource Name (ARN) of the base model. + final String baseModelArn; + + /// Creation time of the model. + final DateTime creationTime; + + /// Job Amazon Resource Name (ARN) associated with this model. + final String jobArn; + + /// Amazon Resource Name (ARN) associated with this model. + final String modelArn; + + /// Model name associated with this model. + final String modelName; + + /// Output data configuration associated with this custom model. + final OutputDataConfig outputDataConfig; + + /// Contains information about the training dataset. + final TrainingDataConfig trainingDataConfig; + + /// The type of model customization. + final CustomizationType? customizationType; + + /// Hyperparameter values associated with this model. For details on the format + /// for different models, see Custom + /// model hyperparameters. + final Map? hyperParameters; + + /// Job name associated with this model. + final String? jobName; + + /// The custom model is encrypted at rest using this key. + final String? modelKmsKeyArn; + + /// Contains training metrics from the job creation. + final TrainingMetrics? trainingMetrics; + + /// Contains information about the validation dataset. + final ValidationDataConfig? validationDataConfig; + + /// The validation metrics from the job creation. + final List? validationMetrics; + + GetCustomModelResponse({ + required this.baseModelArn, + required this.creationTime, + required this.jobArn, + required this.modelArn, + required this.modelName, + required this.outputDataConfig, + required this.trainingDataConfig, + this.customizationType, + this.hyperParameters, + this.jobName, + this.modelKmsKeyArn, + this.trainingMetrics, + this.validationDataConfig, + this.validationMetrics, + }); + + factory GetCustomModelResponse.fromJson(Map json) { + return GetCustomModelResponse( + baseModelArn: json['baseModelArn'] as String, + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + jobArn: json['jobArn'] as String, + modelArn: json['modelArn'] as String, + modelName: json['modelName'] as String, + outputDataConfig: OutputDataConfig.fromJson( + json['outputDataConfig'] as Map), + trainingDataConfig: TrainingDataConfig.fromJson( + json['trainingDataConfig'] as Map), + customizationType: + (json['customizationType'] as String?)?.toCustomizationType(), + hyperParameters: (json['hyperParameters'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + jobName: json['jobName'] as String?, + modelKmsKeyArn: json['modelKmsKeyArn'] as String?, + trainingMetrics: json['trainingMetrics'] != null + ? TrainingMetrics.fromJson( + json['trainingMetrics'] as Map) + : null, + validationDataConfig: json['validationDataConfig'] != null + ? ValidationDataConfig.fromJson( + json['validationDataConfig'] as Map) + : null, + validationMetrics: (json['validationMetrics'] as List?) + ?.whereNotNull() + .map((e) => ValidatorMetric.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final baseModelArn = this.baseModelArn; + final creationTime = this.creationTime; + final jobArn = this.jobArn; + final modelArn = this.modelArn; + final modelName = this.modelName; + final outputDataConfig = this.outputDataConfig; + final trainingDataConfig = this.trainingDataConfig; + final customizationType = this.customizationType; + final hyperParameters = this.hyperParameters; + final jobName = this.jobName; + final modelKmsKeyArn = this.modelKmsKeyArn; + final trainingMetrics = this.trainingMetrics; + final validationDataConfig = this.validationDataConfig; + final validationMetrics = this.validationMetrics; + return { + 'baseModelArn': baseModelArn, + 'creationTime': iso8601ToJson(creationTime), + 'jobArn': jobArn, + 'modelArn': modelArn, + 'modelName': modelName, + 'outputDataConfig': outputDataConfig, + 'trainingDataConfig': trainingDataConfig, + if (customizationType != null) + 'customizationType': customizationType.toValue(), + if (hyperParameters != null) 'hyperParameters': hyperParameters, + if (jobName != null) 'jobName': jobName, + if (modelKmsKeyArn != null) 'modelKmsKeyArn': modelKmsKeyArn, + if (trainingMetrics != null) 'trainingMetrics': trainingMetrics, + if (validationDataConfig != null) + 'validationDataConfig': validationDataConfig, + if (validationMetrics != null) 'validationMetrics': validationMetrics, + }; + } +} + +class GetEvaluationJobResponse { + /// When the model evaluation job was created. + final DateTime creationTime; + + /// Contains details about the type of model evaluation job, the metrics used, + /// the task type selected, the datasets used, and any custom metrics you + /// defined. + final EvaluationConfig evaluationConfig; + + /// Details about the models you specified in your model evaluation job. + final EvaluationInferenceConfig inferenceConfig; + + /// The Amazon Resource Name (ARN) of the model evaluation job. + final String jobArn; + + /// The name of the model evaluation job. + final String jobName; + + /// The type of model evaluation job. + final EvaluationJobType jobType; + + /// Amazon S3 location for where output data is saved. + final EvaluationOutputDataConfig outputDataConfig; + + /// The Amazon Resource Name (ARN) of the IAM service role used in the model + /// evaluation job. + final String roleArn; + + /// The status of the model evaluation job. + final EvaluationJobStatus status; + + /// The Amazon Resource Name (ARN) of the customer managed key specified when + /// the model evaluation job was created. + final String? customerEncryptionKeyId; + + /// An array of strings the specify why the model evaluation job has failed. + final List? failureMessages; + + /// The description of the model evaluation job. + final String? jobDescription; + + /// When the model evaluation job was last modified. + final DateTime? lastModifiedTime; + + GetEvaluationJobResponse({ + required this.creationTime, + required this.evaluationConfig, + required this.inferenceConfig, + required this.jobArn, + required this.jobName, + required this.jobType, + required this.outputDataConfig, + required this.roleArn, + required this.status, + this.customerEncryptionKeyId, + this.failureMessages, + this.jobDescription, + this.lastModifiedTime, + }); + + factory GetEvaluationJobResponse.fromJson(Map json) { + return GetEvaluationJobResponse( + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + evaluationConfig: EvaluationConfig.fromJson( + json['evaluationConfig'] as Map), + inferenceConfig: EvaluationInferenceConfig.fromJson( + json['inferenceConfig'] as Map), + jobArn: json['jobArn'] as String, + jobName: json['jobName'] as String, + jobType: (json['jobType'] as String).toEvaluationJobType(), + outputDataConfig: EvaluationOutputDataConfig.fromJson( + json['outputDataConfig'] as Map), + roleArn: json['roleArn'] as String, + status: (json['status'] as String).toEvaluationJobStatus(), + customerEncryptionKeyId: json['customerEncryptionKeyId'] as String?, + failureMessages: (json['failureMessages'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + jobDescription: json['jobDescription'] as String?, + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final evaluationConfig = this.evaluationConfig; + final inferenceConfig = this.inferenceConfig; + final jobArn = this.jobArn; + final jobName = this.jobName; + final jobType = this.jobType; + final outputDataConfig = this.outputDataConfig; + final roleArn = this.roleArn; + final status = this.status; + final customerEncryptionKeyId = this.customerEncryptionKeyId; + final failureMessages = this.failureMessages; + final jobDescription = this.jobDescription; + final lastModifiedTime = this.lastModifiedTime; + return { + 'creationTime': iso8601ToJson(creationTime), + 'evaluationConfig': evaluationConfig, + 'inferenceConfig': inferenceConfig, + 'jobArn': jobArn, + 'jobName': jobName, + 'jobType': jobType.toValue(), + 'outputDataConfig': outputDataConfig, + 'roleArn': roleArn, + 'status': status.toValue(), + if (customerEncryptionKeyId != null) + 'customerEncryptionKeyId': customerEncryptionKeyId, + if (failureMessages != null) 'failureMessages': failureMessages, + if (jobDescription != null) 'jobDescription': jobDescription, + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), + }; + } +} + +class GetFoundationModelResponse { + /// Information about the foundation model. + final FoundationModelDetails? modelDetails; + + GetFoundationModelResponse({ + this.modelDetails, + }); + + factory GetFoundationModelResponse.fromJson(Map json) { + return GetFoundationModelResponse( + modelDetails: json['modelDetails'] != null + ? FoundationModelDetails.fromJson( + json['modelDetails'] as Map) + : null, + ); + } + + Map toJson() { + final modelDetails = this.modelDetails; + return { + if (modelDetails != null) 'modelDetails': modelDetails, + }; + } +} + +class GetGuardrailResponse { + /// The message that the guardrail returns when it blocks a prompt. + final String blockedInputMessaging; + + /// The message that the guardrail returns when it blocks a model response. + final String blockedOutputsMessaging; + + /// The date and time at which the guardrail was created. + final DateTime createdAt; + + /// The ARN of the guardrail that was created. + final String guardrailArn; + + /// The unique identifier of the guardrail. + final String guardrailId; + + /// The name of the guardrail. + final String name; + + /// The status of the guardrail. + final GuardrailStatus status; + + /// The date and time at which the guardrail was updated. + final DateTime updatedAt; + + /// The version of the guardrail. + final String version; + + /// The content policy that was configured for the guardrail. + final GuardrailContentPolicy? contentPolicy; + + /// The description of the guardrail. + final String? description; + + /// Appears if the status of the guardrail is FAILED. + /// A list of recommendations to carry out before retrying the request. + final List? failureRecommendations; + + /// The ARN of the KMS key that encrypts the guardrail. + final String? kmsKeyArn; + + /// The sensitive information policy that was configured for the guardrail. + final GuardrailSensitiveInformationPolicy? sensitiveInformationPolicy; + + /// Appears if the status is FAILED. A list of reasons + /// for why the guardrail failed to be created, updated, versioned, or deleted. + final List? statusReasons; + + /// The topic policy that was configured for the guardrail. + final GuardrailTopicPolicy? topicPolicy; + + /// The word policy that was configured for the guardrail. + final GuardrailWordPolicy? wordPolicy; + + GetGuardrailResponse({ + required this.blockedInputMessaging, + required this.blockedOutputsMessaging, + required this.createdAt, + required this.guardrailArn, + required this.guardrailId, + required this.name, + required this.status, + required this.updatedAt, + required this.version, + this.contentPolicy, + this.description, + this.failureRecommendations, + this.kmsKeyArn, + this.sensitiveInformationPolicy, + this.statusReasons, + this.topicPolicy, + this.wordPolicy, + }); + + factory GetGuardrailResponse.fromJson(Map json) { + return GetGuardrailResponse( + blockedInputMessaging: json['blockedInputMessaging'] as String, + blockedOutputsMessaging: json['blockedOutputsMessaging'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + guardrailArn: json['guardrailArn'] as String, + guardrailId: json['guardrailId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGuardrailStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + version: json['version'] as String, + contentPolicy: json['contentPolicy'] != null + ? GuardrailContentPolicy.fromJson( + json['contentPolicy'] as Map) + : null, + description: json['description'] as String?, + failureRecommendations: (json['failureRecommendations'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + kmsKeyArn: json['kmsKeyArn'] as String?, + sensitiveInformationPolicy: json['sensitiveInformationPolicy'] != null + ? GuardrailSensitiveInformationPolicy.fromJson( + json['sensitiveInformationPolicy'] as Map) + : null, + statusReasons: (json['statusReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + topicPolicy: json['topicPolicy'] != null + ? GuardrailTopicPolicy.fromJson( + json['topicPolicy'] as Map) + : null, + wordPolicy: json['wordPolicy'] != null + ? GuardrailWordPolicy.fromJson( + json['wordPolicy'] as Map) + : null, + ); + } + + Map toJson() { + final blockedInputMessaging = this.blockedInputMessaging; + final blockedOutputsMessaging = this.blockedOutputsMessaging; + final createdAt = this.createdAt; + final guardrailArn = this.guardrailArn; + final guardrailId = this.guardrailId; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final version = this.version; + final contentPolicy = this.contentPolicy; + final description = this.description; + final failureRecommendations = this.failureRecommendations; + final kmsKeyArn = this.kmsKeyArn; + final sensitiveInformationPolicy = this.sensitiveInformationPolicy; + final statusReasons = this.statusReasons; + final topicPolicy = this.topicPolicy; + final wordPolicy = this.wordPolicy; + return { + 'blockedInputMessaging': blockedInputMessaging, + 'blockedOutputsMessaging': blockedOutputsMessaging, + 'createdAt': iso8601ToJson(createdAt), + 'guardrailArn': guardrailArn, + 'guardrailId': guardrailId, + 'name': name, + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + 'version': version, + if (contentPolicy != null) 'contentPolicy': contentPolicy, + if (description != null) 'description': description, + if (failureRecommendations != null) + 'failureRecommendations': failureRecommendations, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + if (sensitiveInformationPolicy != null) + 'sensitiveInformationPolicy': sensitiveInformationPolicy, + if (statusReasons != null) 'statusReasons': statusReasons, + if (topicPolicy != null) 'topicPolicy': topicPolicy, + if (wordPolicy != null) 'wordPolicy': wordPolicy, + }; + } +} + +class GetModelCustomizationJobResponse { + /// Amazon Resource Name (ARN) of the base model. + final String baseModelArn; + + /// Time that the resource was created. + final DateTime creationTime; + + /// The hyperparameter values for the job. For details on the format for + /// different models, see Custom + /// model hyperparameters. + final Map hyperParameters; + + /// The Amazon Resource Name (ARN) of the customization job. + final String jobArn; + + /// The name of the customization job. + final String jobName; + + /// Output data configuration + final OutputDataConfig outputDataConfig; + + /// The name of the output model. + final String outputModelName; + + /// The Amazon Resource Name (ARN) of the IAM role. + final String roleArn; + + /// Contains information about the training dataset. + final TrainingDataConfig trainingDataConfig; + + /// Contains information about the validation dataset. + final ValidationDataConfig validationDataConfig; + + /// The token that you specified in the CreateCustomizationJob + /// request. + final String? clientRequestToken; + + /// The type of model customization. + final CustomizationType? customizationType; + + /// Time that the resource transitioned to terminal state. + final DateTime? endTime; + + /// Information about why the job failed. + final String? failureMessage; + + /// Time that the resource was last modified. + final DateTime? lastModifiedTime; + + /// The Amazon Resource Name (ARN) of the output model. + final String? outputModelArn; + + /// The custom model is encrypted at rest using this key. + final String? outputModelKmsKeyArn; + + /// The status of the job. A successful job transitions from in-progress to + /// completed when the output model is ready to use. If the job failed, the + /// failure message contains information about why the job failed. + final ModelCustomizationJobStatus? status; + + /// Contains training metrics from the job creation. + final TrainingMetrics? trainingMetrics; + + /// The loss metric for each validator that you provided in the createjob + /// request. + final List? validationMetrics; + + /// VPC configuration for the custom model job. + final VpcConfig? vpcConfig; + + GetModelCustomizationJobResponse({ + required this.baseModelArn, + required this.creationTime, + required this.hyperParameters, + required this.jobArn, + required this.jobName, + required this.outputDataConfig, + required this.outputModelName, + required this.roleArn, + required this.trainingDataConfig, + required this.validationDataConfig, + this.clientRequestToken, + this.customizationType, + this.endTime, + this.failureMessage, + this.lastModifiedTime, + this.outputModelArn, + this.outputModelKmsKeyArn, + this.status, + this.trainingMetrics, + this.validationMetrics, + this.vpcConfig, + }); + + factory GetModelCustomizationJobResponse.fromJson(Map json) { + return GetModelCustomizationJobResponse( + baseModelArn: json['baseModelArn'] as String, + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + hyperParameters: (json['hyperParameters'] as Map) + .map((k, e) => MapEntry(k, e as String)), + jobArn: json['jobArn'] as String, + jobName: json['jobName'] as String, + outputDataConfig: OutputDataConfig.fromJson( + json['outputDataConfig'] as Map), + outputModelName: json['outputModelName'] as String, + roleArn: json['roleArn'] as String, + trainingDataConfig: TrainingDataConfig.fromJson( + json['trainingDataConfig'] as Map), + validationDataConfig: ValidationDataConfig.fromJson( + json['validationDataConfig'] as Map), + clientRequestToken: json['clientRequestToken'] as String?, + customizationType: + (json['customizationType'] as String?)?.toCustomizationType(), + endTime: timeStampFromJson(json['endTime']), + failureMessage: json['failureMessage'] as String?, + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), + outputModelArn: json['outputModelArn'] as String?, + outputModelKmsKeyArn: json['outputModelKmsKeyArn'] as String?, + status: (json['status'] as String?)?.toModelCustomizationJobStatus(), + trainingMetrics: json['trainingMetrics'] != null + ? TrainingMetrics.fromJson( + json['trainingMetrics'] as Map) + : null, + validationMetrics: (json['validationMetrics'] as List?) + ?.whereNotNull() + .map((e) => ValidatorMetric.fromJson(e as Map)) + .toList(), + vpcConfig: json['vpcConfig'] != null + ? VpcConfig.fromJson(json['vpcConfig'] as Map) + : null, + ); + } + + Map toJson() { + final baseModelArn = this.baseModelArn; + final creationTime = this.creationTime; + final hyperParameters = this.hyperParameters; + final jobArn = this.jobArn; + final jobName = this.jobName; + final outputDataConfig = this.outputDataConfig; + final outputModelName = this.outputModelName; + final roleArn = this.roleArn; + final trainingDataConfig = this.trainingDataConfig; + final validationDataConfig = this.validationDataConfig; + final clientRequestToken = this.clientRequestToken; + final customizationType = this.customizationType; + final endTime = this.endTime; + final failureMessage = this.failureMessage; + final lastModifiedTime = this.lastModifiedTime; + final outputModelArn = this.outputModelArn; + final outputModelKmsKeyArn = this.outputModelKmsKeyArn; + final status = this.status; + final trainingMetrics = this.trainingMetrics; + final validationMetrics = this.validationMetrics; + final vpcConfig = this.vpcConfig; + return { + 'baseModelArn': baseModelArn, + 'creationTime': iso8601ToJson(creationTime), + 'hyperParameters': hyperParameters, + 'jobArn': jobArn, + 'jobName': jobName, + 'outputDataConfig': outputDataConfig, + 'outputModelName': outputModelName, + 'roleArn': roleArn, + 'trainingDataConfig': trainingDataConfig, + 'validationDataConfig': validationDataConfig, + if (clientRequestToken != null) 'clientRequestToken': clientRequestToken, + if (customizationType != null) + 'customizationType': customizationType.toValue(), + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (failureMessage != null) 'failureMessage': failureMessage, + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), + if (outputModelArn != null) 'outputModelArn': outputModelArn, + if (outputModelKmsKeyArn != null) + 'outputModelKmsKeyArn': outputModelKmsKeyArn, + if (status != null) 'status': status.toValue(), + if (trainingMetrics != null) 'trainingMetrics': trainingMetrics, + if (validationMetrics != null) 'validationMetrics': validationMetrics, + if (vpcConfig != null) 'vpcConfig': vpcConfig, + }; + } +} + +class GetModelInvocationLoggingConfigurationResponse { + /// The current configuration values. + final LoggingConfig? loggingConfig; + + GetModelInvocationLoggingConfigurationResponse({ + this.loggingConfig, + }); + + factory GetModelInvocationLoggingConfigurationResponse.fromJson( + Map json) { + return GetModelInvocationLoggingConfigurationResponse( + loggingConfig: json['loggingConfig'] != null + ? LoggingConfig.fromJson( + json['loggingConfig'] as Map) + : null, + ); + } + + Map toJson() { + final loggingConfig = this.loggingConfig; + return { + if (loggingConfig != null) 'loggingConfig': loggingConfig, + }; + } +} + +class GetProvisionedModelThroughputResponse { + /// The timestamp of the creation time for this Provisioned Throughput. + final DateTime creationTime; + + /// The Amazon Resource Name (ARN) of the model requested to be associated to + /// this Provisioned Throughput. This value differs from the + /// modelArn if updating hasn't completed. + final String desiredModelArn; + + /// The number of model units that was requested for this Provisioned + /// Throughput. + final int desiredModelUnits; + + /// The Amazon Resource Name (ARN) of the base model for which the Provisioned + /// Throughput was created, or of the base model that the custom model for which + /// the Provisioned Throughput was created was customized. + final String foundationModelArn; + + /// The timestamp of the last time that this Provisioned Throughput was + /// modified. + final DateTime lastModifiedTime; + + /// The Amazon Resource Name (ARN) of the model associated with this Provisioned + /// Throughput. + final String modelArn; + + /// The number of model units allocated to this Provisioned Throughput. + final int modelUnits; + + /// The Amazon Resource Name (ARN) of the Provisioned Throughput. + final String provisionedModelArn; + + /// The name of the Provisioned Throughput. + final String provisionedModelName; + + /// The status of the Provisioned Throughput. + final ProvisionedModelStatus status; + + /// Commitment duration of the Provisioned Throughput. + final CommitmentDuration? commitmentDuration; + + /// The timestamp for when the commitment term for the Provisioned Throughput + /// expires. + final DateTime? commitmentExpirationTime; + + /// A failure message for any issues that occurred during creation, updating, or + /// deletion of the Provisioned Throughput. + final String? failureMessage; + + GetProvisionedModelThroughputResponse({ + required this.creationTime, + required this.desiredModelArn, + required this.desiredModelUnits, + required this.foundationModelArn, + required this.lastModifiedTime, + required this.modelArn, + required this.modelUnits, + required this.provisionedModelArn, + required this.provisionedModelName, + required this.status, + this.commitmentDuration, + this.commitmentExpirationTime, + this.failureMessage, + }); + + factory GetProvisionedModelThroughputResponse.fromJson( + Map json) { + return GetProvisionedModelThroughputResponse( + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + desiredModelArn: json['desiredModelArn'] as String, + desiredModelUnits: json['desiredModelUnits'] as int, + foundationModelArn: json['foundationModelArn'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['lastModifiedTime'] as Object), + modelArn: json['modelArn'] as String, + modelUnits: json['modelUnits'] as int, + provisionedModelArn: json['provisionedModelArn'] as String, + provisionedModelName: json['provisionedModelName'] as String, + status: (json['status'] as String).toProvisionedModelStatus(), + commitmentDuration: + (json['commitmentDuration'] as String?)?.toCommitmentDuration(), + commitmentExpirationTime: + timeStampFromJson(json['commitmentExpirationTime']), + failureMessage: json['failureMessage'] as String?, + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final desiredModelArn = this.desiredModelArn; + final desiredModelUnits = this.desiredModelUnits; + final foundationModelArn = this.foundationModelArn; + final lastModifiedTime = this.lastModifiedTime; + final modelArn = this.modelArn; + final modelUnits = this.modelUnits; + final provisionedModelArn = this.provisionedModelArn; + final provisionedModelName = this.provisionedModelName; + final status = this.status; + final commitmentDuration = this.commitmentDuration; + final commitmentExpirationTime = this.commitmentExpirationTime; + final failureMessage = this.failureMessage; + return { + 'creationTime': iso8601ToJson(creationTime), + 'desiredModelArn': desiredModelArn, + 'desiredModelUnits': desiredModelUnits, + 'foundationModelArn': foundationModelArn, + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), + 'modelArn': modelArn, + 'modelUnits': modelUnits, + 'provisionedModelArn': provisionedModelArn, + 'provisionedModelName': provisionedModelName, + 'status': status.toValue(), + if (commitmentDuration != null) + 'commitmentDuration': commitmentDuration.toValue(), + if (commitmentExpirationTime != null) + 'commitmentExpirationTime': iso8601ToJson(commitmentExpirationTime), + if (failureMessage != null) 'failureMessage': failureMessage, + }; + } +} + +/// Contains filter strengths for harmful content. Guardrails support the +/// following content filters to detect and filter harmful user inputs and +/// FM-generated outputs. +/// +///
      +///
    • +/// Hate – Describes language or a statement that discriminates, +/// criticizes, insults, denounces, or dehumanizes a person or group on the +/// basis of an identity (such as race, ethnicity, gender, religion, sexual +/// orientation, ability, and national origin). +///
    • +///
    • +/// Insults – Describes language or a statement that includes demeaning, +/// humiliating, mocking, insulting, or belittling language. This type of +/// language is also labeled as bullying. +///
    • +///
    • +/// Sexual – Describes language or a statement that indicates sexual +/// interest, activity, or arousal using direct or indirect references to body +/// parts, physical traits, or sex. +///
    • +///
    • +/// Violence – Describes language or a statement that includes +/// glorification of or threats to inflict physical pain, hurt, or injury toward +/// a person, group or thing. +///
    • +///
    +/// Content filtering depends on the confidence classification of user inputs +/// and FM responses across each of the four harmful categories. All input and +/// output statements are classified into one of four confidence levels (NONE, +/// LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is +/// classified as Hate with HIGH confidence, the likelihood of the +/// statement representing hateful content is high. A single statement can be +/// classified across multiple categories with varying confidence levels. For +/// example, a single statement can be classified as Hate with HIGH +/// confidence, Insults with LOW confidence, Sexual with NONE +/// confidence, and Violence with MEDIUM confidence. +/// +/// For more information, see Guardrails +/// content filters. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailContentFilter { + /// The strength of the content filter to apply to prompts. As you increase the + /// filter strength, the likelihood of filtering harmful content increases and + /// the probability of seeing harmful content in your application reduces. + final GuardrailFilterStrength inputStrength; + + /// The strength of the content filter to apply to model responses. As you + /// increase the filter strength, the likelihood of filtering harmful content + /// increases and the probability of seeing harmful content in your application + /// reduces. + final GuardrailFilterStrength outputStrength; + + /// The harmful category that the content filter is applied to. + final GuardrailContentFilterType type; + + GuardrailContentFilter({ + required this.inputStrength, + required this.outputStrength, + required this.type, + }); + + factory GuardrailContentFilter.fromJson(Map json) { + return GuardrailContentFilter( + inputStrength: + (json['inputStrength'] as String).toGuardrailFilterStrength(), + outputStrength: + (json['outputStrength'] as String).toGuardrailFilterStrength(), + type: (json['type'] as String).toGuardrailContentFilterType(), + ); + } + + Map toJson() { + final inputStrength = this.inputStrength; + final outputStrength = this.outputStrength; + final type = this.type; + return { + 'inputStrength': inputStrength.toValue(), + 'outputStrength': outputStrength.toValue(), + 'type': type.toValue(), + }; + } +} + +/// Contains filter strengths for harmful content. Guardrails support the +/// following content filters to detect and filter harmful user inputs and +/// FM-generated outputs. +/// +///
      +///
    • +/// Hate – Describes language or a statement that discriminates, +/// criticizes, insults, denounces, or dehumanizes a person or group on the +/// basis of an identity (such as race, ethnicity, gender, religion, sexual +/// orientation, ability, and national origin). +///
    • +///
    • +/// Insults – Describes language or a statement that includes demeaning, +/// humiliating, mocking, insulting, or belittling language. This type of +/// language is also labeled as bullying. +///
    • +///
    • +/// Sexual – Describes language or a statement that indicates sexual +/// interest, activity, or arousal using direct or indirect references to body +/// parts, physical traits, or sex. +///
    • +///
    • +/// Violence – Describes language or a statement that includes +/// glorification of or threats to inflict physical pain, hurt, or injury toward +/// a person, group or thing. +///
    • +///
    +/// Content filtering depends on the confidence classification of user inputs +/// and FM responses across each of the four harmful categories. All input and +/// output statements are classified into one of four confidence levels (NONE, +/// LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is +/// classified as Hate with HIGH confidence, the likelihood of the +/// statement representing hateful content is high. A single statement can be +/// classified across multiple categories with varying confidence levels. For +/// example, a single statement can be classified as Hate with HIGH +/// confidence, Insults with LOW confidence, Sexual with NONE +/// confidence, and Violence with MEDIUM confidence. +/// +/// For more information, see Guardrails +/// content filters. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailContentFilterConfig { + /// The strength of the content filter to apply to prompts. As you increase the + /// filter strength, the likelihood of filtering harmful content increases and + /// the probability of seeing harmful content in your application reduces. + final GuardrailFilterStrength inputStrength; + + /// The strength of the content filter to apply to model responses. As you + /// increase the filter strength, the likelihood of filtering harmful content + /// increases and the probability of seeing harmful content in your application + /// reduces. + final GuardrailFilterStrength outputStrength; + + /// The harmful category that the content filter is applied to. + final GuardrailContentFilterType type; + + GuardrailContentFilterConfig({ + required this.inputStrength, + required this.outputStrength, + required this.type, + }); + + Map toJson() { + final inputStrength = this.inputStrength; + final outputStrength = this.outputStrength; + final type = this.type; + return { + 'inputStrength': inputStrength.toValue(), + 'outputStrength': outputStrength.toValue(), + 'type': type.toValue(), + }; + } +} + +enum GuardrailContentFilterType { + sexual, + violence, + hate, + insults, + misconduct, + promptAttack, +} + +extension GuardrailContentFilterTypeValueExtension + on GuardrailContentFilterType { + String toValue() { + switch (this) { + case GuardrailContentFilterType.sexual: + return 'SEXUAL'; + case GuardrailContentFilterType.violence: + return 'VIOLENCE'; + case GuardrailContentFilterType.hate: + return 'HATE'; + case GuardrailContentFilterType.insults: + return 'INSULTS'; + case GuardrailContentFilterType.misconduct: + return 'MISCONDUCT'; + case GuardrailContentFilterType.promptAttack: + return 'PROMPT_ATTACK'; + } + } +} + +extension GuardrailContentFilterTypeFromString on String { + GuardrailContentFilterType toGuardrailContentFilterType() { + switch (this) { + case 'SEXUAL': + return GuardrailContentFilterType.sexual; + case 'VIOLENCE': + return GuardrailContentFilterType.violence; + case 'HATE': + return GuardrailContentFilterType.hate; + case 'INSULTS': + return GuardrailContentFilterType.insults; + case 'MISCONDUCT': + return GuardrailContentFilterType.misconduct; + case 'PROMPT_ATTACK': + return GuardrailContentFilterType.promptAttack; + } + throw Exception('$this is not known in enum GuardrailContentFilterType'); + } +} + +/// Contains details about how to handle harmful content. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailContentPolicy { + /// Contains the type of the content filter and how strongly it should apply to + /// prompts and model responses. + final List? filters; + + GuardrailContentPolicy({ + this.filters, + }); + + factory GuardrailContentPolicy.fromJson(Map json) { + return GuardrailContentPolicy( + filters: (json['filters'] as List?) + ?.whereNotNull() + .map( + (e) => GuardrailContentFilter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final filters = this.filters; + return { + if (filters != null) 'filters': filters, + }; + } +} + +/// Contains details about how to handle harmful content. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailContentPolicyConfig { + /// Contains the type of the content filter and how strongly it should apply to + /// prompts and model responses. + final List filtersConfig; + + GuardrailContentPolicyConfig({ + required this.filtersConfig, + }); + + Map toJson() { + final filtersConfig = this.filtersConfig; + return { + 'filtersConfig': filtersConfig, + }; + } +} + +enum GuardrailFilterStrength { + none, + low, + medium, + high, +} + +extension GuardrailFilterStrengthValueExtension on GuardrailFilterStrength { + String toValue() { + switch (this) { + case GuardrailFilterStrength.none: + return 'NONE'; + case GuardrailFilterStrength.low: + return 'LOW'; + case GuardrailFilterStrength.medium: + return 'MEDIUM'; + case GuardrailFilterStrength.high: + return 'HIGH'; + } + } +} + +extension GuardrailFilterStrengthFromString on String { + GuardrailFilterStrength toGuardrailFilterStrength() { + switch (this) { + case 'NONE': + return GuardrailFilterStrength.none; + case 'LOW': + return GuardrailFilterStrength.low; + case 'MEDIUM': + return GuardrailFilterStrength.medium; + case 'HIGH': + return GuardrailFilterStrength.high; + } + throw Exception('$this is not known in enum GuardrailFilterStrength'); + } +} + +/// The managed word list that was configured for the guardrail. (This is a list +/// of words that are pre-defined and managed by Guardrails only.) +class GuardrailManagedWords { + /// ManagedWords$type The managed word type that was configured for the + /// guardrail. (For now, we only offer profanity word list) + final GuardrailManagedWordsType type; + + GuardrailManagedWords({ + required this.type, + }); + + factory GuardrailManagedWords.fromJson(Map json) { + return GuardrailManagedWords( + type: (json['type'] as String).toGuardrailManagedWordsType(), + ); + } + + Map toJson() { + final type = this.type; + return { + 'type': type.toValue(), + }; + } +} + +/// The managed word list to configure for the guardrail. +class GuardrailManagedWordsConfig { + /// The managed word type to configure for the guardrail. + final GuardrailManagedWordsType type; + + GuardrailManagedWordsConfig({ + required this.type, + }); + + Map toJson() { + final type = this.type; + return { + 'type': type.toValue(), + }; + } +} + +enum GuardrailManagedWordsType { + profanity, +} + +extension GuardrailManagedWordsTypeValueExtension on GuardrailManagedWordsType { + String toValue() { + switch (this) { + case GuardrailManagedWordsType.profanity: + return 'PROFANITY'; + } + } +} + +extension GuardrailManagedWordsTypeFromString on String { + GuardrailManagedWordsType toGuardrailManagedWordsType() { + switch (this) { + case 'PROFANITY': + return GuardrailManagedWordsType.profanity; + } + throw Exception('$this is not known in enum GuardrailManagedWordsType'); + } +} + +/// The PII entity configured for the guardrail. +class GuardrailPiiEntity { + /// The configured guardrail action when PII entity is detected. + final GuardrailSensitiveInformationAction action; + + /// The type of PII entity. For example, Social Security Number. + final GuardrailPiiEntityType type; + + GuardrailPiiEntity({ + required this.action, + required this.type, + }); + + factory GuardrailPiiEntity.fromJson(Map json) { + return GuardrailPiiEntity( + action: + (json['action'] as String).toGuardrailSensitiveInformationAction(), + type: (json['type'] as String).toGuardrailPiiEntityType(), + ); + } + + Map toJson() { + final action = this.action; + final type = this.type; + return { + 'action': action.toValue(), + 'type': type.toValue(), + }; + } +} + +/// The PII entity to configure for the guardrail. +class GuardrailPiiEntityConfig { + /// Configure guardrail action when the PII entity is detected. + final GuardrailSensitiveInformationAction action; + + /// Configure guardrail type when the PII entity is detected. + final GuardrailPiiEntityType type; + + GuardrailPiiEntityConfig({ + required this.action, + required this.type, + }); + + Map toJson() { + final action = this.action; + final type = this.type; + return { + 'action': action.toValue(), + 'type': type.toValue(), + }; + } +} + +enum GuardrailPiiEntityType { + address, + age, + awsAccessKey, + awsSecretKey, + caHealthNumber, + caSocialInsuranceNumber, + creditDebitCardCvv, + creditDebitCardExpiry, + creditDebitCardNumber, + driverId, + email, + internationalBankAccountNumber, + ipAddress, + licensePlate, + macAddress, + name, + password, + phone, + pin, + swiftCode, + ukNationalHealthServiceNumber, + ukNationalInsuranceNumber, + ukUniqueTaxpayerReferenceNumber, + url, + username, + usBankAccountNumber, + usBankRoutingNumber, + usIndividualTaxIdentificationNumber, + usPassportNumber, + usSocialSecurityNumber, + vehicleIdentificationNumber, +} + +extension GuardrailPiiEntityTypeValueExtension on GuardrailPiiEntityType { + String toValue() { + switch (this) { + case GuardrailPiiEntityType.address: + return 'ADDRESS'; + case GuardrailPiiEntityType.age: + return 'AGE'; + case GuardrailPiiEntityType.awsAccessKey: + return 'AWS_ACCESS_KEY'; + case GuardrailPiiEntityType.awsSecretKey: + return 'AWS_SECRET_KEY'; + case GuardrailPiiEntityType.caHealthNumber: + return 'CA_HEALTH_NUMBER'; + case GuardrailPiiEntityType.caSocialInsuranceNumber: + return 'CA_SOCIAL_INSURANCE_NUMBER'; + case GuardrailPiiEntityType.creditDebitCardCvv: + return 'CREDIT_DEBIT_CARD_CVV'; + case GuardrailPiiEntityType.creditDebitCardExpiry: + return 'CREDIT_DEBIT_CARD_EXPIRY'; + case GuardrailPiiEntityType.creditDebitCardNumber: + return 'CREDIT_DEBIT_CARD_NUMBER'; + case GuardrailPiiEntityType.driverId: + return 'DRIVER_ID'; + case GuardrailPiiEntityType.email: + return 'EMAIL'; + case GuardrailPiiEntityType.internationalBankAccountNumber: + return 'INTERNATIONAL_BANK_ACCOUNT_NUMBER'; + case GuardrailPiiEntityType.ipAddress: + return 'IP_ADDRESS'; + case GuardrailPiiEntityType.licensePlate: + return 'LICENSE_PLATE'; + case GuardrailPiiEntityType.macAddress: + return 'MAC_ADDRESS'; + case GuardrailPiiEntityType.name: + return 'NAME'; + case GuardrailPiiEntityType.password: + return 'PASSWORD'; + case GuardrailPiiEntityType.phone: + return 'PHONE'; + case GuardrailPiiEntityType.pin: + return 'PIN'; + case GuardrailPiiEntityType.swiftCode: + return 'SWIFT_CODE'; + case GuardrailPiiEntityType.ukNationalHealthServiceNumber: + return 'UK_NATIONAL_HEALTH_SERVICE_NUMBER'; + case GuardrailPiiEntityType.ukNationalInsuranceNumber: + return 'UK_NATIONAL_INSURANCE_NUMBER'; + case GuardrailPiiEntityType.ukUniqueTaxpayerReferenceNumber: + return 'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER'; + case GuardrailPiiEntityType.url: + return 'URL'; + case GuardrailPiiEntityType.username: + return 'USERNAME'; + case GuardrailPiiEntityType.usBankAccountNumber: + return 'US_BANK_ACCOUNT_NUMBER'; + case GuardrailPiiEntityType.usBankRoutingNumber: + return 'US_BANK_ROUTING_NUMBER'; + case GuardrailPiiEntityType.usIndividualTaxIdentificationNumber: + return 'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'; + case GuardrailPiiEntityType.usPassportNumber: + return 'US_PASSPORT_NUMBER'; + case GuardrailPiiEntityType.usSocialSecurityNumber: + return 'US_SOCIAL_SECURITY_NUMBER'; + case GuardrailPiiEntityType.vehicleIdentificationNumber: + return 'VEHICLE_IDENTIFICATION_NUMBER'; + } + } +} + +extension GuardrailPiiEntityTypeFromString on String { + GuardrailPiiEntityType toGuardrailPiiEntityType() { + switch (this) { + case 'ADDRESS': + return GuardrailPiiEntityType.address; + case 'AGE': + return GuardrailPiiEntityType.age; + case 'AWS_ACCESS_KEY': + return GuardrailPiiEntityType.awsAccessKey; + case 'AWS_SECRET_KEY': + return GuardrailPiiEntityType.awsSecretKey; + case 'CA_HEALTH_NUMBER': + return GuardrailPiiEntityType.caHealthNumber; + case 'CA_SOCIAL_INSURANCE_NUMBER': + return GuardrailPiiEntityType.caSocialInsuranceNumber; + case 'CREDIT_DEBIT_CARD_CVV': + return GuardrailPiiEntityType.creditDebitCardCvv; + case 'CREDIT_DEBIT_CARD_EXPIRY': + return GuardrailPiiEntityType.creditDebitCardExpiry; + case 'CREDIT_DEBIT_CARD_NUMBER': + return GuardrailPiiEntityType.creditDebitCardNumber; + case 'DRIVER_ID': + return GuardrailPiiEntityType.driverId; + case 'EMAIL': + return GuardrailPiiEntityType.email; + case 'INTERNATIONAL_BANK_ACCOUNT_NUMBER': + return GuardrailPiiEntityType.internationalBankAccountNumber; + case 'IP_ADDRESS': + return GuardrailPiiEntityType.ipAddress; + case 'LICENSE_PLATE': + return GuardrailPiiEntityType.licensePlate; + case 'MAC_ADDRESS': + return GuardrailPiiEntityType.macAddress; + case 'NAME': + return GuardrailPiiEntityType.name; + case 'PASSWORD': + return GuardrailPiiEntityType.password; + case 'PHONE': + return GuardrailPiiEntityType.phone; + case 'PIN': + return GuardrailPiiEntityType.pin; + case 'SWIFT_CODE': + return GuardrailPiiEntityType.swiftCode; + case 'UK_NATIONAL_HEALTH_SERVICE_NUMBER': + return GuardrailPiiEntityType.ukNationalHealthServiceNumber; + case 'UK_NATIONAL_INSURANCE_NUMBER': + return GuardrailPiiEntityType.ukNationalInsuranceNumber; + case 'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER': + return GuardrailPiiEntityType.ukUniqueTaxpayerReferenceNumber; + case 'URL': + return GuardrailPiiEntityType.url; + case 'USERNAME': + return GuardrailPiiEntityType.username; + case 'US_BANK_ACCOUNT_NUMBER': + return GuardrailPiiEntityType.usBankAccountNumber; + case 'US_BANK_ROUTING_NUMBER': + return GuardrailPiiEntityType.usBankRoutingNumber; + case 'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER': + return GuardrailPiiEntityType.usIndividualTaxIdentificationNumber; + case 'US_PASSPORT_NUMBER': + return GuardrailPiiEntityType.usPassportNumber; + case 'US_SOCIAL_SECURITY_NUMBER': + return GuardrailPiiEntityType.usSocialSecurityNumber; + case 'VEHICLE_IDENTIFICATION_NUMBER': + return GuardrailPiiEntityType.vehicleIdentificationNumber; + } + throw Exception('$this is not known in enum GuardrailPiiEntityType'); + } +} + +/// The regular expression configured for the guardrail. +class GuardrailRegex { + /// The action taken when a match to the regular expression is detected. + final GuardrailSensitiveInformationAction action; + + /// The name of the regular expression for the guardrail. + final String name; + + /// The pattern of the regular expression configured for the guardrail. + final String pattern; + + /// The description of the regular expression for the guardrail. + final String? description; + + GuardrailRegex({ + required this.action, + required this.name, + required this.pattern, + this.description, + }); + + factory GuardrailRegex.fromJson(Map json) { + return GuardrailRegex( + action: + (json['action'] as String).toGuardrailSensitiveInformationAction(), + name: json['name'] as String, + pattern: json['pattern'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final action = this.action; + final name = this.name; + final pattern = this.pattern; + final description = this.description; + return { + 'action': action.toValue(), + 'name': name, + 'pattern': pattern, + if (description != null) 'description': description, + }; + } +} + +/// The regular expression to configure for the guardrail. +class GuardrailRegexConfig { + /// The guardrail action to configure when matching regular expression is + /// detected. + final GuardrailSensitiveInformationAction action; + + /// The name of the regular expression to configure for the guardrail. + final String name; + + /// The regular expression pattern to configure for the guardrail. + final String pattern; + + /// The description of the regular expression to configure for the guardrail. + final String? description; + + GuardrailRegexConfig({ + required this.action, + required this.name, + required this.pattern, + this.description, + }); + + Map toJson() { + final action = this.action; + final name = this.name; + final pattern = this.pattern; + final description = this.description; + return { + 'action': action.toValue(), + 'name': name, + 'pattern': pattern, + if (description != null) 'description': description, + }; + } +} + +enum GuardrailSensitiveInformationAction { + block, + anonymize, +} + +extension GuardrailSensitiveInformationActionValueExtension + on GuardrailSensitiveInformationAction { + String toValue() { + switch (this) { + case GuardrailSensitiveInformationAction.block: + return 'BLOCK'; + case GuardrailSensitiveInformationAction.anonymize: + return 'ANONYMIZE'; + } + } +} + +extension GuardrailSensitiveInformationActionFromString on String { + GuardrailSensitiveInformationAction toGuardrailSensitiveInformationAction() { + switch (this) { + case 'BLOCK': + return GuardrailSensitiveInformationAction.block; + case 'ANONYMIZE': + return GuardrailSensitiveInformationAction.anonymize; + } + throw Exception( + '$this is not known in enum GuardrailSensitiveInformationAction'); + } +} + +/// Contains details about PII entities and regular expressions configured for +/// the guardrail. +class GuardrailSensitiveInformationPolicy { + /// The list of PII entities configured for the guardrail. + final List? piiEntities; + + /// The list of regular expressions configured for the guardrail. + final List? regexes; + + GuardrailSensitiveInformationPolicy({ + this.piiEntities, + this.regexes, + }); + + factory GuardrailSensitiveInformationPolicy.fromJson( + Map json) { + return GuardrailSensitiveInformationPolicy( + piiEntities: (json['piiEntities'] as List?) + ?.whereNotNull() + .map((e) => GuardrailPiiEntity.fromJson(e as Map)) + .toList(), + regexes: (json['regexes'] as List?) + ?.whereNotNull() + .map((e) => GuardrailRegex.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final piiEntities = this.piiEntities; + final regexes = this.regexes; + return { + if (piiEntities != null) 'piiEntities': piiEntities, + if (regexes != null) 'regexes': regexes, + }; + } +} + +/// Contains details about PII entities and regular expressions to configure for +/// the guardrail. +class GuardrailSensitiveInformationPolicyConfig { + /// A list of PII entities to configure to the guardrail. + final List? piiEntitiesConfig; + + /// A list of regular expressions to configure to the guardrail. + final List? regexesConfig; + + GuardrailSensitiveInformationPolicyConfig({ + this.piiEntitiesConfig, + this.regexesConfig, + }); + + Map toJson() { + final piiEntitiesConfig = this.piiEntitiesConfig; + final regexesConfig = this.regexesConfig; + return { + if (piiEntitiesConfig != null) 'piiEntitiesConfig': piiEntitiesConfig, + if (regexesConfig != null) 'regexesConfig': regexesConfig, + }; + } +} + +enum GuardrailStatus { + creating, + updating, + versioning, + ready, + failed, + deleting, +} + +extension GuardrailStatusValueExtension on GuardrailStatus { + String toValue() { + switch (this) { + case GuardrailStatus.creating: + return 'CREATING'; + case GuardrailStatus.updating: + return 'UPDATING'; + case GuardrailStatus.versioning: + return 'VERSIONING'; + case GuardrailStatus.ready: + return 'READY'; + case GuardrailStatus.failed: + return 'FAILED'; + case GuardrailStatus.deleting: + return 'DELETING'; + } + } +} + +extension GuardrailStatusFromString on String { + GuardrailStatus toGuardrailStatus() { + switch (this) { + case 'CREATING': + return GuardrailStatus.creating; + case 'UPDATING': + return GuardrailStatus.updating; + case 'VERSIONING': + return GuardrailStatus.versioning; + case 'READY': + return GuardrailStatus.ready; + case 'FAILED': + return GuardrailStatus.failed; + case 'DELETING': + return GuardrailStatus.deleting; + } + throw Exception('$this is not known in enum GuardrailStatus'); + } +} + +/// Contains details about a guardrail. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailSummary { + /// The ARN of the guardrail. + final String arn; + + /// The date and time at which the guardrail was created. + final DateTime createdAt; + + /// The unique identifier of the guardrail. + final String id; + + /// The name of the guardrail. + final String name; + + /// The status of the guardrail. + final GuardrailStatus status; + + /// The date and time at which the guardrail was last updated. + final DateTime updatedAt; + + /// The version of the guardrail. + final String version; + + /// A description of the guardrail. + final String? description; + + GuardrailSummary({ + required this.arn, + required this.createdAt, + required this.id, + required this.name, + required this.status, + required this.updatedAt, + required this.version, + this.description, + }); + + factory GuardrailSummary.fromJson(Map json) { + return GuardrailSummary( + arn: json['arn'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + id: json['id'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGuardrailStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + version: json['version'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createdAt = this.createdAt; + final id = this.id; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final version = this.version; + final description = this.description; + return { + 'arn': arn, + 'createdAt': iso8601ToJson(createdAt), + 'id': id, + 'name': name, + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + 'version': version, + if (description != null) 'description': description, + }; + } +} + +/// Details about topics for the guardrail to identify and deny. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailTopic { + /// A definition of the topic to deny. + final String definition; + + /// The name of the topic to deny. + final String name; + + /// A list of prompts, each of which is an example of a prompt that can be + /// categorized as belonging to the topic. + final List? examples; + + /// Specifies to deny the topic. + final GuardrailTopicType? type; + + GuardrailTopic({ + required this.definition, + required this.name, + this.examples, + this.type, + }); + + factory GuardrailTopic.fromJson(Map json) { + return GuardrailTopic( + definition: json['definition'] as String, + name: json['name'] as String, + examples: (json['examples'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + type: (json['type'] as String?)?.toGuardrailTopicType(), + ); + } + + Map toJson() { + final definition = this.definition; + final name = this.name; + final examples = this.examples; + final type = this.type; + return { + 'definition': definition, + 'name': name, + if (examples != null) 'examples': examples, + if (type != null) 'type': type.toValue(), + }; + } +} + +/// Details about topics for the guardrail to identify and deny. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailTopicConfig { + /// A definition of the topic to deny. + final String definition; + + /// The name of the topic to deny. + final String name; + + /// Specifies to deny the topic. + final GuardrailTopicType type; + + /// A list of prompts, each of which is an example of a prompt that can be + /// categorized as belonging to the topic. + final List? examples; + + GuardrailTopicConfig({ + required this.definition, + required this.name, + required this.type, + this.examples, + }); + + Map toJson() { + final definition = this.definition; + final name = this.name; + final type = this.type; + final examples = this.examples; + return { + 'definition': definition, + 'name': name, + 'type': type.toValue(), + if (examples != null) 'examples': examples, + }; + } +} + +/// Contains details about topics that the guardrail should identify and deny. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailTopicPolicy { + /// A list of policies related to topics that the guardrail should deny. + final List topics; + + GuardrailTopicPolicy({ + required this.topics, + }); + + factory GuardrailTopicPolicy.fromJson(Map json) { + return GuardrailTopicPolicy( + topics: (json['topics'] as List) + .whereNotNull() + .map((e) => GuardrailTopic.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final topics = this.topics; + return { + 'topics': topics, + }; + } +} + +/// Contains details about topics that the guardrail should identify and deny. +/// +/// This data type is used in the following API operations: +/// +/// +class GuardrailTopicPolicyConfig { + /// A list of policies related to topics that the guardrail should deny. + final List topicsConfig; + + GuardrailTopicPolicyConfig({ + required this.topicsConfig, + }); + + Map toJson() { + final topicsConfig = this.topicsConfig; + return { + 'topicsConfig': topicsConfig, + }; + } +} + +enum GuardrailTopicType { + deny, +} + +extension GuardrailTopicTypeValueExtension on GuardrailTopicType { + String toValue() { + switch (this) { + case GuardrailTopicType.deny: + return 'DENY'; + } + } +} + +extension GuardrailTopicTypeFromString on String { + GuardrailTopicType toGuardrailTopicType() { + switch (this) { + case 'DENY': + return GuardrailTopicType.deny; + } + throw Exception('$this is not known in enum GuardrailTopicType'); + } +} + +/// A word configured for the guardrail. +class GuardrailWord { + /// Text of the word configured for the guardrail to block. + final String text; + + GuardrailWord({ + required this.text, + }); + + factory GuardrailWord.fromJson(Map json) { + return GuardrailWord( + text: json['text'] as String, + ); + } + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +/// A word to configure for the guardrail. +class GuardrailWordConfig { + /// Text of the word configured for the guardrail to block. + final String text; + + GuardrailWordConfig({ + required this.text, + }); + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +/// Contains details about the word policy configured for the guardrail. +class GuardrailWordPolicy { + /// A list of managed words configured for the guardrail. + final List? managedWordLists; + + /// A list of words configured for the guardrail. + final List? words; + + GuardrailWordPolicy({ + this.managedWordLists, + this.words, + }); + + factory GuardrailWordPolicy.fromJson(Map json) { + return GuardrailWordPolicy( + managedWordLists: (json['managedWordLists'] as List?) + ?.whereNotNull() + .map((e) => GuardrailManagedWords.fromJson(e as Map)) + .toList(), + words: (json['words'] as List?) + ?.whereNotNull() + .map((e) => GuardrailWord.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final managedWordLists = this.managedWordLists; + final words = this.words; + return { + if (managedWordLists != null) 'managedWordLists': managedWordLists, + if (words != null) 'words': words, + }; + } +} + +/// Contains details about the word policy to configured for the guardrail. +class GuardrailWordPolicyConfig { + /// A list of managed words to configure for the guardrail. + final List? managedWordListsConfig; + + /// A list of words to configure for the guardrail. + final List? wordsConfig; + + GuardrailWordPolicyConfig({ + this.managedWordListsConfig, + this.wordsConfig, + }); + + Map toJson() { + final managedWordListsConfig = this.managedWordListsConfig; + final wordsConfig = this.wordsConfig; + return { + if (managedWordListsConfig != null) + 'managedWordListsConfig': managedWordListsConfig, + if (wordsConfig != null) 'wordsConfig': wordsConfig, + }; + } +} + +/// Specifies the custom metrics, how tasks will be rated, the flow definition +/// ARN, and your custom prompt datasets. Model evaluation jobs use human +/// workers only support the use of custom prompt datasets. To learn more +/// about custom prompt datasets and the required format, see Custom +/// prompt datasets. +/// +/// When you create custom metrics in HumanEvaluationCustomMetric +/// you must specify the metric's name. The list of +/// names specified in the HumanEvaluationCustomMetric +/// array, must match the metricNames array of strings specified in +/// EvaluationDatasetMetricConfig. For example, if in the +/// HumanEvaluationCustomMetric array your specified the names +/// "accuracy", "toxicity", "readability" as custom metrics +/// then the metricNames array would need to look like the +/// following ["accuracy", "toxicity", "readability"] in +/// EvaluationDatasetMetricConfig. +class HumanEvaluationConfig { + /// Use to specify the metrics, task, and prompt dataset to be used in your + /// model evaluation job. + final List datasetMetricConfigs; + + /// A HumanEvaluationCustomMetric object. It contains the names the + /// metrics, how the metrics are to be evaluated, an optional description. + final List? customMetrics; + + /// The parameters of the human workflow. + final HumanWorkflowConfig? humanWorkflowConfig; + + HumanEvaluationConfig({ + required this.datasetMetricConfigs, + this.customMetrics, + this.humanWorkflowConfig, + }); + + factory HumanEvaluationConfig.fromJson(Map json) { + return HumanEvaluationConfig( + datasetMetricConfigs: (json['datasetMetricConfigs'] as List) + .whereNotNull() + .map((e) => + EvaluationDatasetMetricConfig.fromJson(e as Map)) + .toList(), + customMetrics: (json['customMetrics'] as List?) + ?.whereNotNull() + .map((e) => + HumanEvaluationCustomMetric.fromJson(e as Map)) + .toList(), + humanWorkflowConfig: json['humanWorkflowConfig'] != null + ? HumanWorkflowConfig.fromJson( + json['humanWorkflowConfig'] as Map) + : null, + ); + } + + Map toJson() { + final datasetMetricConfigs = this.datasetMetricConfigs; + final customMetrics = this.customMetrics; + final humanWorkflowConfig = this.humanWorkflowConfig; + return { + 'datasetMetricConfigs': datasetMetricConfigs, + if (customMetrics != null) 'customMetrics': customMetrics, + if (humanWorkflowConfig != null) + 'humanWorkflowConfig': humanWorkflowConfig, + }; + } +} + +/// In a model evaluation job that uses human workers you must define the name +/// of the metric, and how you want that metric rated ratingMethod, +/// and an optional description of the metric. +class HumanEvaluationCustomMetric { + /// The name of the metric. Your human evaluators will see this name in the + /// evaluation UI. + final String name; + + /// Choose how you want your human workers to evaluation your model. Valid + /// values for rating methods are ThumbsUpDown, + /// IndividualLikertScale,ComparisonLikertScale, + /// ComparisonChoice, and ComparisonRank + final String ratingMethod; + + /// An optional description of the metric. Use this parameter to provide more + /// details about the metric. + final String? description; + + HumanEvaluationCustomMetric({ + required this.name, + required this.ratingMethod, + this.description, + }); + + factory HumanEvaluationCustomMetric.fromJson(Map json) { + return HumanEvaluationCustomMetric( + name: json['name'] as String, + ratingMethod: json['ratingMethod'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final ratingMethod = this.ratingMethod; + final description = this.description; + return { + 'name': name, + 'ratingMethod': ratingMethod, + if (description != null) 'description': description, + }; + } +} + +/// Contains SageMakerFlowDefinition object. The object is used to +/// specify the prompt dataset, task type, rating method and metric names. +class HumanWorkflowConfig { + /// The Amazon Resource Number (ARN) for the flow definition + final String flowDefinitionArn; + + /// Instructions for the flow definition + final String? instructions; + + HumanWorkflowConfig({ + required this.flowDefinitionArn, + this.instructions, + }); + + factory HumanWorkflowConfig.fromJson(Map json) { + return HumanWorkflowConfig( + flowDefinitionArn: json['flowDefinitionArn'] as String, + instructions: json['instructions'] as String?, + ); + } + + Map toJson() { + final flowDefinitionArn = this.flowDefinitionArn; + final instructions = this.instructions; + return { + 'flowDefinitionArn': flowDefinitionArn, + if (instructions != null) 'instructions': instructions, + }; + } +} + +enum InferenceType { + onDemand, + provisioned, +} + +extension InferenceTypeValueExtension on InferenceType { + String toValue() { + switch (this) { + case InferenceType.onDemand: + return 'ON_DEMAND'; + case InferenceType.provisioned: + return 'PROVISIONED'; + } + } +} + +extension InferenceTypeFromString on String { + InferenceType toInferenceType() { + switch (this) { + case 'ON_DEMAND': + return InferenceType.onDemand; + case 'PROVISIONED': + return InferenceType.provisioned; + } + throw Exception('$this is not known in enum InferenceType'); + } +} + +class ListCustomModelsResponse { + /// Model summaries. + final List? modelSummaries; + + /// Continuation token for the next request to list the next set of results. + final String? nextToken; + + ListCustomModelsResponse({ + this.modelSummaries, + this.nextToken, + }); + + factory ListCustomModelsResponse.fromJson(Map json) { + return ListCustomModelsResponse( + modelSummaries: (json['modelSummaries'] as List?) + ?.whereNotNull() + .map((e) => CustomModelSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final modelSummaries = this.modelSummaries; + final nextToken = this.nextToken; + return { + if (modelSummaries != null) 'modelSummaries': modelSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListEvaluationJobsResponse { + /// A summary of the model evaluation jobs. + final List? jobSummaries; + + /// Continuation token from the previous response, for Amazon Bedrock to list + /// the next set of results. + final String? nextToken; + + ListEvaluationJobsResponse({ + this.jobSummaries, + this.nextToken, + }); + + factory ListEvaluationJobsResponse.fromJson(Map json) { + return ListEvaluationJobsResponse( + jobSummaries: (json['jobSummaries'] as List?) + ?.whereNotNull() + .map((e) => EvaluationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final jobSummaries = this.jobSummaries; + final nextToken = this.nextToken; + return { + if (jobSummaries != null) 'jobSummaries': jobSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListFoundationModelsResponse { + /// A list of Amazon Bedrock foundation models. + final List? modelSummaries; + + ListFoundationModelsResponse({ + this.modelSummaries, + }); + + factory ListFoundationModelsResponse.fromJson(Map json) { + return ListFoundationModelsResponse( + modelSummaries: (json['modelSummaries'] as List?) + ?.whereNotNull() + .map( + (e) => FoundationModelSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final modelSummaries = this.modelSummaries; + return { + if (modelSummaries != null) 'modelSummaries': modelSummaries, + }; + } +} + +class ListGuardrailsResponse { + /// A list of objects, each of which contains details about a guardrail. + final List guardrails; + + /// If there are more results than were returned in the response, the response + /// returns a nextToken that you can send in another + /// ListGuardrails request to see the next batch of results. + final String? nextToken; + + ListGuardrailsResponse({ + required this.guardrails, + this.nextToken, + }); + + factory ListGuardrailsResponse.fromJson(Map json) { + return ListGuardrailsResponse( + guardrails: (json['guardrails'] as List) + .whereNotNull() + .map((e) => GuardrailSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final guardrails = this.guardrails; + final nextToken = this.nextToken; + return { + 'guardrails': guardrails, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListModelCustomizationJobsResponse { + /// Job summaries. + final List? modelCustomizationJobSummaries; + + /// Page continuation token to use in the next request. + final String? nextToken; + + ListModelCustomizationJobsResponse({ + this.modelCustomizationJobSummaries, + this.nextToken, + }); + + factory ListModelCustomizationJobsResponse.fromJson( + Map json) { + return ListModelCustomizationJobsResponse( + modelCustomizationJobSummaries: (json['modelCustomizationJobSummaries'] + as List?) + ?.whereNotNull() + .map((e) => + ModelCustomizationJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final modelCustomizationJobSummaries = this.modelCustomizationJobSummaries; + final nextToken = this.nextToken; + return { + if (modelCustomizationJobSummaries != null) + 'modelCustomizationJobSummaries': modelCustomizationJobSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListProvisionedModelThroughputsResponse { + /// If there are more results than the number you specified in the + /// maxResults field, this value is returned. To see the next batch + /// of results, include this value in the nextToken field in + /// another list request. + final String? nextToken; + + /// A list of summaries, one for each Provisioned Throughput in the response. + final List? provisionedModelSummaries; + + ListProvisionedModelThroughputsResponse({ + this.nextToken, + this.provisionedModelSummaries, + }); + + factory ListProvisionedModelThroughputsResponse.fromJson( + Map json) { + return ListProvisionedModelThroughputsResponse( + nextToken: json['nextToken'] as String?, + provisionedModelSummaries: (json['provisionedModelSummaries'] as List?) + ?.whereNotNull() + .map((e) => + ProvisionedModelSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final provisionedModelSummaries = this.provisionedModelSummaries; + return { + if (nextToken != null) 'nextToken': nextToken, + if (provisionedModelSummaries != null) + 'provisionedModelSummaries': provisionedModelSummaries, + }; + } +} + +class ListTagsForResourceResponse { + /// An array of the tags associated with this resource. + final List? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +/// Configuration fields for invocation logging. +class LoggingConfig { + /// CloudWatch logging configuration. + final CloudWatchConfig? cloudWatchConfig; + + /// Set to include embeddings data in the log delivery. + final bool? embeddingDataDeliveryEnabled; + + /// Set to include image data in the log delivery. + final bool? imageDataDeliveryEnabled; + + /// S3 configuration for storing log data. + final S3Config? s3Config; + + /// Set to include text data in the log delivery. + final bool? textDataDeliveryEnabled; + + LoggingConfig({ + this.cloudWatchConfig, + this.embeddingDataDeliveryEnabled, + this.imageDataDeliveryEnabled, + this.s3Config, + this.textDataDeliveryEnabled, + }); + + factory LoggingConfig.fromJson(Map json) { + return LoggingConfig( + cloudWatchConfig: json['cloudWatchConfig'] != null + ? CloudWatchConfig.fromJson( + json['cloudWatchConfig'] as Map) + : null, + embeddingDataDeliveryEnabled: + json['embeddingDataDeliveryEnabled'] as bool?, + imageDataDeliveryEnabled: json['imageDataDeliveryEnabled'] as bool?, + s3Config: json['s3Config'] != null + ? S3Config.fromJson(json['s3Config'] as Map) + : null, + textDataDeliveryEnabled: json['textDataDeliveryEnabled'] as bool?, + ); + } + + Map toJson() { + final cloudWatchConfig = this.cloudWatchConfig; + final embeddingDataDeliveryEnabled = this.embeddingDataDeliveryEnabled; + final imageDataDeliveryEnabled = this.imageDataDeliveryEnabled; + final s3Config = this.s3Config; + final textDataDeliveryEnabled = this.textDataDeliveryEnabled; + return { + if (cloudWatchConfig != null) 'cloudWatchConfig': cloudWatchConfig, + if (embeddingDataDeliveryEnabled != null) + 'embeddingDataDeliveryEnabled': embeddingDataDeliveryEnabled, + if (imageDataDeliveryEnabled != null) + 'imageDataDeliveryEnabled': imageDataDeliveryEnabled, + if (s3Config != null) 's3Config': s3Config, + if (textDataDeliveryEnabled != null) + 'textDataDeliveryEnabled': textDataDeliveryEnabled, + }; + } +} + +enum ModelCustomization { + fineTuning, + continuedPreTraining, +} + +extension ModelCustomizationValueExtension on ModelCustomization { + String toValue() { + switch (this) { + case ModelCustomization.fineTuning: + return 'FINE_TUNING'; + case ModelCustomization.continuedPreTraining: + return 'CONTINUED_PRE_TRAINING'; + } + } +} + +extension ModelCustomizationFromString on String { + ModelCustomization toModelCustomization() { + switch (this) { + case 'FINE_TUNING': + return ModelCustomization.fineTuning; + case 'CONTINUED_PRE_TRAINING': + return ModelCustomization.continuedPreTraining; + } + throw Exception('$this is not known in enum ModelCustomization'); + } +} + +enum ModelCustomizationJobStatus { + inProgress, + completed, + failed, + stopping, + stopped, +} + +extension ModelCustomizationJobStatusValueExtension + on ModelCustomizationJobStatus { + String toValue() { + switch (this) { + case ModelCustomizationJobStatus.inProgress: + return 'InProgress'; + case ModelCustomizationJobStatus.completed: + return 'Completed'; + case ModelCustomizationJobStatus.failed: + return 'Failed'; + case ModelCustomizationJobStatus.stopping: + return 'Stopping'; + case ModelCustomizationJobStatus.stopped: + return 'Stopped'; + } + } +} + +extension ModelCustomizationJobStatusFromString on String { + ModelCustomizationJobStatus toModelCustomizationJobStatus() { + switch (this) { + case 'InProgress': + return ModelCustomizationJobStatus.inProgress; + case 'Completed': + return ModelCustomizationJobStatus.completed; + case 'Failed': + return ModelCustomizationJobStatus.failed; + case 'Stopping': + return ModelCustomizationJobStatus.stopping; + case 'Stopped': + return ModelCustomizationJobStatus.stopped; + } + throw Exception('$this is not known in enum ModelCustomizationJobStatus'); + } +} + +/// Information about one customization job +class ModelCustomizationJobSummary { + /// Amazon Resource Name (ARN) of the base model. + final String baseModelArn; + + /// Creation time of the custom model. + final DateTime creationTime; + + /// Amazon Resource Name (ARN) of the customization job. + final String jobArn; + + /// Name of the customization job. + final String jobName; + + /// Status of the customization job. + final ModelCustomizationJobStatus status; + + /// Amazon Resource Name (ARN) of the custom model. + final String? customModelArn; + + /// Name of the custom model. + final String? customModelName; + + /// Specifies whether to carry out continued pre-training of a model or whether + /// to fine-tune it. For more information, see Custom + /// models. + final CustomizationType? customizationType; + + /// Time that the customization job ended. + final DateTime? endTime; + + /// Time that the customization job was last modified. + final DateTime? lastModifiedTime; + + ModelCustomizationJobSummary({ + required this.baseModelArn, + required this.creationTime, + required this.jobArn, + required this.jobName, + required this.status, + this.customModelArn, + this.customModelName, + this.customizationType, + this.endTime, + this.lastModifiedTime, + }); + + factory ModelCustomizationJobSummary.fromJson(Map json) { + return ModelCustomizationJobSummary( + baseModelArn: json['baseModelArn'] as String, + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + jobArn: json['jobArn'] as String, + jobName: json['jobName'] as String, + status: (json['status'] as String).toModelCustomizationJobStatus(), + customModelArn: json['customModelArn'] as String?, + customModelName: json['customModelName'] as String?, + customizationType: + (json['customizationType'] as String?)?.toCustomizationType(), + endTime: timeStampFromJson(json['endTime']), + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), + ); + } + + Map toJson() { + final baseModelArn = this.baseModelArn; + final creationTime = this.creationTime; + final jobArn = this.jobArn; + final jobName = this.jobName; + final status = this.status; + final customModelArn = this.customModelArn; + final customModelName = this.customModelName; + final customizationType = this.customizationType; + final endTime = this.endTime; + final lastModifiedTime = this.lastModifiedTime; + return { + 'baseModelArn': baseModelArn, + 'creationTime': iso8601ToJson(creationTime), + 'jobArn': jobArn, + 'jobName': jobName, + 'status': status.toValue(), + if (customModelArn != null) 'customModelArn': customModelArn, + if (customModelName != null) 'customModelName': customModelName, + if (customizationType != null) + 'customizationType': customizationType.toValue(), + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), + }; + } +} + +enum ModelModality { + text, + image, + embedding, +} + +extension ModelModalityValueExtension on ModelModality { + String toValue() { + switch (this) { + case ModelModality.text: + return 'TEXT'; + case ModelModality.image: + return 'IMAGE'; + case ModelModality.embedding: + return 'EMBEDDING'; + } + } +} + +extension ModelModalityFromString on String { + ModelModality toModelModality() { + switch (this) { + case 'TEXT': + return ModelModality.text; + case 'IMAGE': + return ModelModality.image; + case 'EMBEDDING': + return ModelModality.embedding; + } + throw Exception('$this is not known in enum ModelModality'); + } +} + +/// S3 Location of the output data. +class OutputDataConfig { + /// The S3 URI where the output data is stored. + final String s3Uri; + + OutputDataConfig({ + required this.s3Uri, + }); + + factory OutputDataConfig.fromJson(Map json) { + return OutputDataConfig( + s3Uri: json['s3Uri'] as String, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + 's3Uri': s3Uri, + }; + } +} + +enum ProvisionedModelStatus { + creating, + inService, + updating, + failed, +} + +extension ProvisionedModelStatusValueExtension on ProvisionedModelStatus { + String toValue() { + switch (this) { + case ProvisionedModelStatus.creating: + return 'Creating'; + case ProvisionedModelStatus.inService: + return 'InService'; + case ProvisionedModelStatus.updating: + return 'Updating'; + case ProvisionedModelStatus.failed: + return 'Failed'; + } + } +} + +extension ProvisionedModelStatusFromString on String { + ProvisionedModelStatus toProvisionedModelStatus() { + switch (this) { + case 'Creating': + return ProvisionedModelStatus.creating; + case 'InService': + return ProvisionedModelStatus.inService; + case 'Updating': + return ProvisionedModelStatus.updating; + case 'Failed': + return ProvisionedModelStatus.failed; + } + throw Exception('$this is not known in enum ProvisionedModelStatus'); + } +} + +/// A summary of information about a Provisioned Throughput. +/// +/// This data type is used in the following API operations: +/// +/// +class ProvisionedModelSummary { + /// The time that the Provisioned Throughput was created. + final DateTime creationTime; + + /// The Amazon Resource Name (ARN) of the model requested to be associated to + /// this Provisioned Throughput. This value differs from the + /// modelArn if updating hasn't completed. + final String desiredModelArn; + + /// The number of model units that was requested to be allocated to the + /// Provisioned Throughput. + final int desiredModelUnits; + + /// The Amazon Resource Name (ARN) of the base model for which the Provisioned + /// Throughput was created, or of the base model that the custom model for which + /// the Provisioned Throughput was created was customized. + final String foundationModelArn; + + /// The time that the Provisioned Throughput was last modified. + final DateTime lastModifiedTime; + + /// The Amazon Resource Name (ARN) of the model associated with the Provisioned + /// Throughput. + final String modelArn; + + /// The number of model units allocated to the Provisioned Throughput. + final int modelUnits; + + /// The Amazon Resource Name (ARN) of the Provisioned Throughput. + final String provisionedModelArn; + + /// The name of the Provisioned Throughput. + final String provisionedModelName; + + /// The status of the Provisioned Throughput. + final ProvisionedModelStatus status; + + /// The duration for which the Provisioned Throughput was committed. + final CommitmentDuration? commitmentDuration; + + /// The timestamp for when the commitment term of the Provisioned Throughput + /// expires. + final DateTime? commitmentExpirationTime; + + ProvisionedModelSummary({ + required this.creationTime, + required this.desiredModelArn, + required this.desiredModelUnits, + required this.foundationModelArn, + required this.lastModifiedTime, + required this.modelArn, + required this.modelUnits, + required this.provisionedModelArn, + required this.provisionedModelName, + required this.status, + this.commitmentDuration, + this.commitmentExpirationTime, + }); + + factory ProvisionedModelSummary.fromJson(Map json) { + return ProvisionedModelSummary( + creationTime: + nonNullableTimeStampFromJson(json['creationTime'] as Object), + desiredModelArn: json['desiredModelArn'] as String, + desiredModelUnits: json['desiredModelUnits'] as int, + foundationModelArn: json['foundationModelArn'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['lastModifiedTime'] as Object), + modelArn: json['modelArn'] as String, + modelUnits: json['modelUnits'] as int, + provisionedModelArn: json['provisionedModelArn'] as String, + provisionedModelName: json['provisionedModelName'] as String, + status: (json['status'] as String).toProvisionedModelStatus(), + commitmentDuration: + (json['commitmentDuration'] as String?)?.toCommitmentDuration(), + commitmentExpirationTime: + timeStampFromJson(json['commitmentExpirationTime']), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final desiredModelArn = this.desiredModelArn; + final desiredModelUnits = this.desiredModelUnits; + final foundationModelArn = this.foundationModelArn; + final lastModifiedTime = this.lastModifiedTime; + final modelArn = this.modelArn; + final modelUnits = this.modelUnits; + final provisionedModelArn = this.provisionedModelArn; + final provisionedModelName = this.provisionedModelName; + final status = this.status; + final commitmentDuration = this.commitmentDuration; + final commitmentExpirationTime = this.commitmentExpirationTime; + return { + 'creationTime': iso8601ToJson(creationTime), + 'desiredModelArn': desiredModelArn, + 'desiredModelUnits': desiredModelUnits, + 'foundationModelArn': foundationModelArn, + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), + 'modelArn': modelArn, + 'modelUnits': modelUnits, + 'provisionedModelArn': provisionedModelArn, + 'provisionedModelName': provisionedModelName, + 'status': status.toValue(), + if (commitmentDuration != null) + 'commitmentDuration': commitmentDuration.toValue(), + if (commitmentExpirationTime != null) + 'commitmentExpirationTime': iso8601ToJson(commitmentExpirationTime), + }; + } +} + +class PutModelInvocationLoggingConfigurationResponse { + PutModelInvocationLoggingConfigurationResponse(); + + factory PutModelInvocationLoggingConfigurationResponse.fromJson( + Map _) { + return PutModelInvocationLoggingConfigurationResponse(); + } + + Map toJson() { + return {}; + } +} + +/// S3 configuration for storing log data. +class S3Config { + /// S3 bucket name. + final String bucketName; + + /// S3 prefix. + final String? keyPrefix; + + S3Config({ + required this.bucketName, + this.keyPrefix, + }); + + factory S3Config.fromJson(Map json) { + return S3Config( + bucketName: json['bucketName'] as String, + keyPrefix: json['keyPrefix'] as String?, + ); + } + + Map toJson() { + final bucketName = this.bucketName; + final keyPrefix = this.keyPrefix; + return { + 'bucketName': bucketName, + if (keyPrefix != null) 'keyPrefix': keyPrefix, + }; + } +} + +enum SortByProvisionedModels { + creationTime, +} + +extension SortByProvisionedModelsValueExtension on SortByProvisionedModels { + String toValue() { + switch (this) { + case SortByProvisionedModels.creationTime: + return 'CreationTime'; + } + } +} + +extension SortByProvisionedModelsFromString on String { + SortByProvisionedModels toSortByProvisionedModels() { + switch (this) { + case 'CreationTime': + return SortByProvisionedModels.creationTime; + } + throw Exception('$this is not known in enum SortByProvisionedModels'); + } +} + +enum SortJobsBy { + creationTime, +} + +extension SortJobsByValueExtension on SortJobsBy { + String toValue() { + switch (this) { + case SortJobsBy.creationTime: + return 'CreationTime'; + } + } +} + +extension SortJobsByFromString on String { + SortJobsBy toSortJobsBy() { + switch (this) { + case 'CreationTime': + return SortJobsBy.creationTime; + } + throw Exception('$this is not known in enum SortJobsBy'); + } +} + +enum SortModelsBy { + creationTime, +} + +extension SortModelsByValueExtension on SortModelsBy { + String toValue() { + switch (this) { + case SortModelsBy.creationTime: + return 'CreationTime'; + } + } +} + +extension SortModelsByFromString on String { + SortModelsBy toSortModelsBy() { + switch (this) { + case 'CreationTime': + return SortModelsBy.creationTime; + } + throw Exception('$this is not known in enum SortModelsBy'); + } +} + +enum SortOrder { + ascending, + descending, +} + +extension SortOrderValueExtension on SortOrder { + String toValue() { + switch (this) { + case SortOrder.ascending: + return 'Ascending'; + case SortOrder.descending: + return 'Descending'; + } + } +} + +extension SortOrderFromString on String { + SortOrder toSortOrder() { + switch (this) { + case 'Ascending': + return SortOrder.ascending; + case 'Descending': + return SortOrder.descending; + } + throw Exception('$this is not known in enum SortOrder'); + } +} + +class StopEvaluationJobResponse { + StopEvaluationJobResponse(); + + factory StopEvaluationJobResponse.fromJson(Map _) { + return StopEvaluationJobResponse(); + } + + Map toJson() { + return {}; + } +} + +class StopModelCustomizationJobResponse { + StopModelCustomizationJobResponse(); + + factory StopModelCustomizationJobResponse.fromJson(Map _) { + return StopModelCustomizationJobResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Definition of the key/value pair for a tag. +class Tag { + /// Key for the tag. + final String key; + + /// Value for the tag. + final String value; + + Tag({ + required this.key, + required this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['key'] as String, + value: json['value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +/// S3 Location of the training data. +class TrainingDataConfig { + /// The S3 URI where the training data is stored. + final String s3Uri; + + TrainingDataConfig({ + required this.s3Uri, + }); + + factory TrainingDataConfig.fromJson(Map json) { + return TrainingDataConfig( + s3Uri: json['s3Uri'] as String, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + 's3Uri': s3Uri, + }; + } +} + +/// Metrics associated with the custom job. +class TrainingMetrics { + /// Loss metric associated with the custom job. + final double? trainingLoss; + + TrainingMetrics({ + this.trainingLoss, + }); + + factory TrainingMetrics.fromJson(Map json) { + return TrainingMetrics( + trainingLoss: json['trainingLoss'] as double?, + ); + } + + Map toJson() { + final trainingLoss = this.trainingLoss; + return { + if (trainingLoss != null) 'trainingLoss': trainingLoss, + }; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateGuardrailResponse { + /// The ARN of the guardrail that was created. + final String guardrailArn; + + /// The unique identifier of the guardrail + final String guardrailId; + + /// The date and time at which the guardrail was updated. + final DateTime updatedAt; + + /// The version of the guardrail. + final String version; + + UpdateGuardrailResponse({ + required this.guardrailArn, + required this.guardrailId, + required this.updatedAt, + required this.version, + }); + + factory UpdateGuardrailResponse.fromJson(Map json) { + return UpdateGuardrailResponse( + guardrailArn: json['guardrailArn'] as String, + guardrailId: json['guardrailId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + version: json['version'] as String, + ); + } + + Map toJson() { + final guardrailArn = this.guardrailArn; + final guardrailId = this.guardrailId; + final updatedAt = this.updatedAt; + final version = this.version; + return { + 'guardrailArn': guardrailArn, + 'guardrailId': guardrailId, + 'updatedAt': iso8601ToJson(updatedAt), + 'version': version, + }; + } +} + +class UpdateProvisionedModelThroughputResponse { + UpdateProvisionedModelThroughputResponse(); + + factory UpdateProvisionedModelThroughputResponse.fromJson( + Map _) { + return UpdateProvisionedModelThroughputResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Array of up to 10 validators. +class ValidationDataConfig { + /// Information about the validators. + final List validators; + + ValidationDataConfig({ + required this.validators, + }); + + factory ValidationDataConfig.fromJson(Map json) { + return ValidationDataConfig( + validators: (json['validators'] as List) + .whereNotNull() + .map((e) => Validator.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final validators = this.validators; + return { + 'validators': validators, + }; + } +} + +/// Information about a validator. +class Validator { + /// The S3 URI where the validation data is stored. + final String s3Uri; + + Validator({ + required this.s3Uri, + }); + + factory Validator.fromJson(Map json) { + return Validator( + s3Uri: json['s3Uri'] as String, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + 's3Uri': s3Uri, + }; + } +} + +/// The metric for the validator. +class ValidatorMetric { + /// The validation loss associated with this validator. + final double? validationLoss; + + ValidatorMetric({ + this.validationLoss, + }); + + factory ValidatorMetric.fromJson(Map json) { + return ValidatorMetric( + validationLoss: json['validationLoss'] as double?, + ); + } + + Map toJson() { + final validationLoss = this.validationLoss; + return { + if (validationLoss != null) 'validationLoss': validationLoss, + }; + } +} + +/// VPC configuration. +class VpcConfig { + /// VPC configuration security group Ids. + final List securityGroupIds; + + /// VPC configuration subnets. + final List subnetIds; + + VpcConfig({ + required this.securityGroupIds, + required this.subnetIds, + }); + + factory VpcConfig.fromJson(Map json) { + return VpcConfig( + securityGroupIds: (json['securityGroupIds'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + subnetIds: (json['subnetIds'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final securityGroupIds = this.securityGroupIds; + final subnetIds = this.subnetIds; + return { + 'securityGroupIds': securityGroupIds, + 'subnetIds': subnetIds, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class TooManyTagsException extends _s.GenericAwsException { + TooManyTagsException({String? type, String? message}) + : super(type: type, code: 'TooManyTagsException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'TooManyTagsException': (type, message) => + TooManyTagsException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/bedrock_agent/v2023_06_05.dart b/aws_client/lib/src/generated/bedrock_agent/v2023_06_05.dart new file mode 100644 index 000000000..77cd643f0 --- /dev/null +++ b/aws_client/lib/src/generated/bedrock_agent/v2023_06_05.dart @@ -0,0 +1,7108 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Describes the API operations for creating and managing Amazon Bedrock +/// agents. +class AgentsForAmazonBedrock { + final _s.RestJsonProtocol _protocol; + AgentsForAmazonBedrock({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'bedrock-agent', + signingName: 'bedrock', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Associates a knowledge base with an agent. If a knowledge base is + /// associated and its indexState is set to Enabled, + /// the agent queries the knowledge base for information to augment its + /// response to the user. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent with which you want to associate the + /// knowledge base. + /// + /// Parameter [agentVersion] : + /// The version of the agent with which you want to associate the knowledge + /// base. + /// + /// Parameter [description] : + /// A description of what the agent should use the knowledge base for. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to associate with the agent. + /// + /// Parameter [knowledgeBaseState] : + /// Specifies whether to use the knowledge base or not when sending an InvokeAgent + /// request. + Future associateAgentKnowledgeBase({ + required String agentId, + required String agentVersion, + required String description, + required String knowledgeBaseId, + KnowledgeBaseState? knowledgeBaseState, + }) async { + final $payload = { + 'description': description, + 'knowledgeBaseId': knowledgeBaseId, + if (knowledgeBaseState != null) + 'knowledgeBaseState': knowledgeBaseState.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/knowledgebases/', + exceptionFnMap: _exceptionFns, + ); + return AssociateAgentKnowledgeBaseResponse.fromJson(response); + } + + /// Creates an agent that orchestrates interactions between foundation models, + /// data sources, software applications, user conversations, and APIs to carry + /// out tasks to help customers. + /// + ///
      + ///
    • + /// Specify the following fields for security purposes. + /// + ///
        + ///
      • + /// agentResourceRoleArn – The Amazon Resource Name (ARN) of the + /// role with permissions to invoke API operations on an agent. + ///
      • + ///
      • + /// (Optional) customerEncryptionKeyArn – The Amazon Resource + /// Name (ARN) of a KMS key to encrypt the creation of the agent. + ///
      • + ///
      • + /// (Optional) idleSessionTTLinSeconds – Specify the number of + /// seconds for which the agent should maintain session information. After + /// this time expires, the subsequent InvokeAgent request begins + /// a new session. + ///
      • + ///
    • + ///
    • + /// To override the default prompt behavior for agent orchestration and to use + /// advanced prompts, include a promptOverrideConfiguration + /// object. For more information, see Advanced + /// prompts. + ///
    • + ///
    • + /// If you agent fails to be created, the response returns a list of + /// failureReasons alongside a list of + /// recommendedActions for you to troubleshoot. + ///
    • + ///
    + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentName] : + /// A name for the agent that you create. + /// + /// Parameter [agentResourceRoleArn] : + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the agent. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [customerEncryptionKeyArn] : + /// The Amazon Resource Name (ARN) of the KMS key with which to encrypt the + /// agent. + /// + /// Parameter [description] : + /// A description of the agent. + /// + /// Parameter [foundationModel] : + /// The foundation model to be used for orchestration by the agent you create. + /// + /// Parameter [guardrailConfiguration] : + /// The unique Guardrail configuration assigned to the agent when it is + /// created. + /// + /// Parameter [idleSessionTTLInSeconds] : + /// The number of seconds for which Amazon Bedrock keeps information about a + /// user's conversation with the agent. + /// + /// A user interaction remains active for the amount of time specified. If no + /// conversation occurs during this time, the session expires and Amazon + /// Bedrock deletes any data provided before the timeout. + /// + /// Parameter [instruction] : + /// Instructions that tell the agent what it should do and how it should + /// interact with users. + /// + /// Parameter [promptOverrideConfiguration] : + /// Contains configurations to override prompts in different parts of an agent + /// sequence. For more information, see Advanced + /// prompts. + /// + /// Parameter [tags] : + /// Any tags that you want to attach to the agent. + Future createAgent({ + required String agentName, + String? agentResourceRoleArn, + String? clientToken, + String? customerEncryptionKeyArn, + String? description, + String? foundationModel, + GuardrailConfiguration? guardrailConfiguration, + int? idleSessionTTLInSeconds, + String? instruction, + PromptOverrideConfiguration? promptOverrideConfiguration, + Map? tags, + }) async { + _s.validateNumRange( + 'idleSessionTTLInSeconds', + idleSessionTTLInSeconds, + 60, + 3600, + ); + final $payload = { + 'agentName': agentName, + if (agentResourceRoleArn != null) + 'agentResourceRoleArn': agentResourceRoleArn, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (customerEncryptionKeyArn != null) + 'customerEncryptionKeyArn': customerEncryptionKeyArn, + if (description != null) 'description': description, + if (foundationModel != null) 'foundationModel': foundationModel, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (idleSessionTTLInSeconds != null) + 'idleSessionTTLInSeconds': idleSessionTTLInSeconds, + if (instruction != null) 'instruction': instruction, + if (promptOverrideConfiguration != null) + 'promptOverrideConfiguration': promptOverrideConfiguration, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/agents/', + exceptionFnMap: _exceptionFns, + ); + return CreateAgentResponse.fromJson(response); + } + + /// Creates an action group for an agent. An action group represents the + /// actions that an agent can carry out for the customer by defining the APIs + /// that an agent can call and the logic for calling them. + /// + /// To allow your agent to request the user for additional information when + /// trying to complete a task, add an action group with the + /// parentActionGroupSignature field set to + /// AMAZON.UserInput. You must leave the + /// description, apiSchema, and + /// actionGroupExecutor fields blank for this action group. + /// During orchestration, if your agent determines that it needs to invoke an + /// API in an action group, but doesn't have enough information to complete + /// the API request, it will invoke this action group instead and return an Observation + /// reprompting the user for more information. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [actionGroupName] : + /// The name to give the action group. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent for which to create the action group. + /// + /// Parameter [agentVersion] : + /// The version of the agent for which to create the action group. + /// + /// Parameter [actionGroupExecutor] : + /// The Amazon Resource Name (ARN) of the Lambda function containing the + /// business logic that is carried out upon invoking the action or the custom + /// control method for handling the information elicited from the user. + /// + /// Parameter [actionGroupState] : + /// Specifies whether the action group is available for the agent to invoke or + /// not when sending an InvokeAgent + /// request. + /// + /// Parameter [apiSchema] : + /// 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. For more information, see Action + /// group OpenAPI schemas. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [description] : + /// A description of the action group. + /// + /// Parameter [functionSchema] : + /// Contains details about the function schema for the action group or the + /// JSON or YAML-formatted payload defining the schema. + /// + /// Parameter [parentActionGroupSignature] : + /// To allow your agent to request the user for additional information when + /// trying to complete a task, set this field to + /// AMAZON.UserInput. You must leave the + /// description, apiSchema, and + /// actionGroupExecutor fields blank for this action group. + /// + /// During orchestration, if your agent determines that it needs to invoke an + /// API in an action group, but doesn't have enough information to complete + /// the API request, it will invoke this action group instead and return an Observation + /// reprompting the user for more information. + Future createAgentActionGroup({ + required String actionGroupName, + required String agentId, + required String agentVersion, + ActionGroupExecutor? actionGroupExecutor, + ActionGroupState? actionGroupState, + APISchema? apiSchema, + String? clientToken, + String? description, + FunctionSchema? functionSchema, + ActionGroupSignature? parentActionGroupSignature, + }) async { + final $payload = { + 'actionGroupName': actionGroupName, + if (actionGroupExecutor != null) + 'actionGroupExecutor': actionGroupExecutor, + if (actionGroupState != null) + 'actionGroupState': actionGroupState.toValue(), + if (apiSchema != null) 'apiSchema': apiSchema, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (functionSchema != null) 'functionSchema': functionSchema, + if (parentActionGroupSignature != null) + 'parentActionGroupSignature': parentActionGroupSignature.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/', + exceptionFnMap: _exceptionFns, + ); + return CreateAgentActionGroupResponse.fromJson(response); + } + + /// Creates an alias of an agent that can be used to deploy the agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentAliasName] : + /// The name of the alias. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [description] : + /// A description of the alias of the agent. + /// + /// Parameter [routingConfiguration] : + /// Contains details about the routing configuration of the alias. + /// + /// Parameter [tags] : + /// Any tags that you want to attach to the alias of the agent. + Future createAgentAlias({ + required String agentAliasName, + required String agentId, + String? clientToken, + String? description, + List? routingConfiguration, + Map? tags, + }) async { + final $payload = { + 'agentAliasName': agentAliasName, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (routingConfiguration != null) + 'routingConfiguration': routingConfiguration, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/agentaliases/', + exceptionFnMap: _exceptionFns, + ); + return CreateAgentAliasResponse.fromJson(response); + } + + /// Sets up a data source to be added to a knowledge base. + /// + /// You can't change the chunkingConfiguration after you create + /// the data source. + /// + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [dataSourceConfiguration] : + /// Contains metadata about where the data source is stored. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to which to add the data + /// source. + /// + /// Parameter [name] : + /// The name of the data source. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [dataDeletionPolicy] : + /// The data deletion policy assigned to the data source. + /// + /// Parameter [description] : + /// A description of the data source. + /// + /// Parameter [serverSideEncryptionConfiguration] : + /// Contains details about the server-side encryption for the data source. + /// + /// Parameter [vectorIngestionConfiguration] : + /// Contains details about how to ingest the documents in the data source. + Future createDataSource({ + required DataSourceConfiguration dataSourceConfiguration, + required String knowledgeBaseId, + required String name, + String? clientToken, + DataDeletionPolicy? dataDeletionPolicy, + String? description, + ServerSideEncryptionConfiguration? serverSideEncryptionConfiguration, + VectorIngestionConfiguration? vectorIngestionConfiguration, + }) async { + final $payload = { + 'dataSourceConfiguration': dataSourceConfiguration, + 'name': name, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (dataDeletionPolicy != null) + 'dataDeletionPolicy': dataDeletionPolicy.toValue(), + if (description != null) 'description': description, + if (serverSideEncryptionConfiguration != null) + 'serverSideEncryptionConfiguration': serverSideEncryptionConfiguration, + if (vectorIngestionConfiguration != null) + 'vectorIngestionConfiguration': vectorIngestionConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/', + exceptionFnMap: _exceptionFns, + ); + return CreateDataSourceResponse.fromJson(response); + } + + /// Creates a knowledge base that contains data sources from which information + /// can be queried and used by LLMs. To create a knowledge base, you must + /// first set up your data sources and configure a supported vector store. For + /// more information, see Set + /// up your data for ingestion. + /// + /// If you prefer to let Amazon Bedrock create and manage a vector store for + /// you in Amazon OpenSearch Service, use the console. For more information, + /// see Create + /// a knowledge base. + /// + ///
      + ///
    • + /// Provide the name and an optional description. + ///
    • + ///
    • + /// Provide the Amazon Resource Name (ARN) with permissions to create a + /// knowledge base in the roleArn field. + ///
    • + ///
    • + /// Provide the embedding model to use in the embeddingModelArn + /// field in the knowledgeBaseConfiguration object. + ///
    • + ///
    • + /// Provide the configuration for your vector store in the + /// storageConfiguration object. + /// + ///
    • + ///
    + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [knowledgeBaseConfiguration] : + /// Contains details about the embeddings model used for the knowledge base. + /// + /// Parameter [name] : + /// A name for the knowledge base. + /// + /// Parameter [roleArn] : + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the knowledge base. + /// + /// Parameter [storageConfiguration] : + /// Contains details about the configuration of the vector database used for + /// the knowledge base. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [description] : + /// A description of the knowledge base. + /// + /// Parameter [tags] : + /// Specify the key-value pairs for the tags that you want to attach to your + /// knowledge base in this object. + Future createKnowledgeBase({ + required KnowledgeBaseConfiguration knowledgeBaseConfiguration, + required String name, + required String roleArn, + required StorageConfiguration storageConfiguration, + String? clientToken, + String? description, + Map? tags, + }) async { + final $payload = { + 'knowledgeBaseConfiguration': knowledgeBaseConfiguration, + 'name': name, + 'roleArn': roleArn, + 'storageConfiguration': storageConfiguration, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/knowledgebases/', + exceptionFnMap: _exceptionFns, + ); + return CreateKnowledgeBaseResponse.fromJson(response); + } + + /// Deletes an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent to delete. + /// + /// Parameter [skipResourceInUseCheck] : + /// By default, this value is false and deletion is stopped if + /// the resource is in use. If you set it to true, the resource + /// will be deleted even if the resource is in use. + Future deleteAgent({ + required String agentId, + bool? skipResourceInUseCheck, + }) async { + final $query = >{ + if (skipResourceInUseCheck != null) + 'skipResourceInUseCheck': [skipResourceInUseCheck.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeleteAgentResponse.fromJson(response); + } + + /// Deletes an action group in an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [actionGroupId] : + /// The unique identifier of the action group to delete. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent that the action group belongs to. + /// + /// Parameter [agentVersion] : + /// The version of the agent that the action group belongs to. + /// + /// Parameter [skipResourceInUseCheck] : + /// By default, this value is false and deletion is stopped if + /// the resource is in use. If you set it to true, the resource + /// will be deleted even if the resource is in use. + Future deleteAgentActionGroup({ + required String actionGroupId, + required String agentId, + required String agentVersion, + bool? skipResourceInUseCheck, + }) async { + final $query = >{ + if (skipResourceInUseCheck != null) + 'skipResourceInUseCheck': [skipResourceInUseCheck.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/${Uri.encodeComponent(actionGroupId)}/', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an alias of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentAliasId] : + /// The unique identifier of the alias to delete. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent that the alias belongs to. + Future deleteAgentAlias({ + required String agentAliasId, + required String agentId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentaliases/${Uri.encodeComponent(agentAliasId)}/', + exceptionFnMap: _exceptionFns, + ); + return DeleteAgentAliasResponse.fromJson(response); + } + + /// Deletes a version of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent that the version belongs to. + /// + /// Parameter [agentVersion] : + /// The version of the agent to delete. + /// + /// Parameter [skipResourceInUseCheck] : + /// By default, this value is false and deletion is stopped if + /// the resource is in use. If you set it to true, the resource + /// will be deleted even if the resource is in use. + Future deleteAgentVersion({ + required String agentId, + required String agentVersion, + bool? skipResourceInUseCheck, + }) async { + final $query = >{ + if (skipResourceInUseCheck != null) + 'skipResourceInUseCheck': [skipResourceInUseCheck.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeleteAgentVersionResponse.fromJson(response); + } + + /// Deletes a data source from a knowledge base. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source to delete. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base from which to delete the data + /// source. + Future deleteDataSource({ + required String dataSourceId, + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteDataSourceResponse.fromJson(response); + } + + /// Deletes a knowledge base. Before deleting a knowledge base, you should + /// disassociate the knowledge base from any agents that it is associated with + /// by making a DisassociateAgentKnowledgeBase + /// request. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to delete. + Future deleteKnowledgeBase({ + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteKnowledgeBaseResponse.fromJson(response); + } + + /// Disassociates a knowledge base from an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent from which to disassociate the + /// knowledge base. + /// + /// Parameter [agentVersion] : + /// The version of the agent from which to disassociate the knowledge base. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to disassociate. + Future disassociateAgentKnowledgeBase({ + required String agentId, + required String agentVersion, + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/', + exceptionFnMap: _exceptionFns, + ); + } + + /// Gets information about an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + Future getAgent({ + required String agentId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/', + exceptionFnMap: _exceptionFns, + ); + return GetAgentResponse.fromJson(response); + } + + /// Gets information about an action group for an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [actionGroupId] : + /// The unique identifier of the action group for which to get information. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent that the action group belongs to. + /// + /// Parameter [agentVersion] : + /// The version of the agent that the action group belongs to. + Future getAgentActionGroup({ + required String actionGroupId, + required String agentId, + required String agentVersion, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/${Uri.encodeComponent(actionGroupId)}/', + exceptionFnMap: _exceptionFns, + ); + return GetAgentActionGroupResponse.fromJson(response); + } + + /// Gets information about an alias of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentAliasId] : + /// The unique identifier of the alias for which to get information. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent to which the alias to get information + /// belongs. + Future getAgentAlias({ + required String agentAliasId, + required String agentId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentaliases/${Uri.encodeComponent(agentAliasId)}/', + exceptionFnMap: _exceptionFns, + ); + return GetAgentAliasResponse.fromJson(response); + } + + /// Gets information about a knowledge base associated with an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent with which the knowledge base is + /// associated. + /// + /// Parameter [agentVersion] : + /// The version of the agent with which the knowledge base is associated. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base associated with the agent. + Future getAgentKnowledgeBase({ + required String agentId, + required String agentVersion, + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/', + exceptionFnMap: _exceptionFns, + ); + return GetAgentKnowledgeBaseResponse.fromJson(response); + } + + /// Gets details about a version of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [agentVersion] : + /// The version of the agent. + Future getAgentVersion({ + required String agentId, + required String agentVersion, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/', + exceptionFnMap: _exceptionFns, + ); + return GetAgentVersionResponse.fromJson(response); + } + + /// Gets information about a data source. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base that the data source was added + /// to. + Future getDataSource({ + required String dataSourceId, + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}', + exceptionFnMap: _exceptionFns, + ); + return GetDataSourceResponse.fromJson(response); + } + + /// Gets information about a ingestion job, in which a data source is added to + /// a knowledge base. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source in the ingestion job. + /// + /// Parameter [ingestionJobId] : + /// The unique identifier of the ingestion job. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base for which the ingestion job + /// applies. + Future getIngestionJob({ + required String dataSourceId, + required String ingestionJobId, + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}/ingestionjobs/${Uri.encodeComponent(ingestionJobId)}', + exceptionFnMap: _exceptionFns, + ); + return GetIngestionJobResponse.fromJson(response); + } + + /// Gets information about a knoweldge base. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base for which to get information. + Future getKnowledgeBase({ + required String knowledgeBaseId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}', + exceptionFnMap: _exceptionFns, + ); + return GetKnowledgeBaseResponse.fromJson(response); + } + + /// Lists the action groups for an agent and information about each one. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [agentVersion] : + /// The version of the agent. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listAgentActionGroups({ + required String agentId, + required String agentVersion, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/', + exceptionFnMap: _exceptionFns, + ); + return ListAgentActionGroupsResponse.fromJson(response); + } + + /// Lists the aliases of an agent and information about each one. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listAgentAliases({ + required String agentId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/agentaliases/', + exceptionFnMap: _exceptionFns, + ); + return ListAgentAliasesResponse.fromJson(response); + } + + /// Lists knowledge bases associated with an agent and information about each + /// one. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent for which to return information about + /// knowledge bases associated with it. + /// + /// Parameter [agentVersion] : + /// The version of the agent for which to return information about knowledge + /// bases associated with it. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listAgentKnowledgeBases({ + required String agentId, + required String agentVersion, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/knowledgebases/', + exceptionFnMap: _exceptionFns, + ); + return ListAgentKnowledgeBasesResponse.fromJson(response); + } + + /// Lists the versions of an agent and information about each version. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listAgentVersions({ + required String agentId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/agentversions/', + exceptionFnMap: _exceptionFns, + ); + return ListAgentVersionsResponse.fromJson(response); + } + + /// Lists the agents belonging to an account and information about each agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listAgents({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/agents/', + exceptionFnMap: _exceptionFns, + ); + return ListAgentsResponse.fromJson(response); + } + + /// Lists the data sources in a knowledge base and information about each one. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base for which to return a list of + /// information. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listDataSources({ + required String knowledgeBaseId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/', + exceptionFnMap: _exceptionFns, + ); + return ListDataSourcesResponse.fromJson(response); + } + + /// Lists the ingestion jobs for a data source and information about each of + /// them. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source for which to return ingestion + /// jobs. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base for which to return ingestion + /// jobs. + /// + /// Parameter [filters] : + /// Contains a definition of a filter for which to filter the results. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + /// + /// Parameter [sortBy] : + /// Contains details about how to sort the results. + Future listIngestionJobs({ + required String dataSourceId, + required String knowledgeBaseId, + List? filters, + int? maxResults, + String? nextToken, + IngestionJobSortBy? sortBy, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (filters != null) 'filters': filters, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (sortBy != null) 'sortBy': sortBy, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}/ingestionjobs/', + exceptionFnMap: _exceptionFns, + ); + return ListIngestionJobsResponse.fromJson(response); + } + + /// Lists the knowledge bases in an account and information about each of + /// them. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. If the total + /// number of results is greater than this value, use the token returned in + /// the response in the nextToken field when making another + /// request to return the next batch of results. + /// + /// Parameter [nextToken] : + /// If the total number of results is greater than the maxResults + /// value provided in the request, enter the token returned in the + /// nextToken field in the response in this field to return the + /// next batch of results. + Future listKnowledgeBases({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/knowledgebases/', + exceptionFnMap: _exceptionFns, + ); + return ListKnowledgeBasesResponse.fromJson(response); + } + + /// List all the tags for the resource you specify. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource for which to list tags. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Creates a DRAFT version of the agent that can be used for + /// internal testing. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent for which to create a + /// DRAFT version. + Future prepareAgent({ + required String agentId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/', + exceptionFnMap: _exceptionFns, + ); + return PrepareAgentResponse.fromJson(response); + } + + /// Begins an ingestion job, in which a data source is added to a knowledge + /// base. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source to ingest. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to which to add the data + /// source. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure that the API request + /// completes no more than one time. If this token matches a previous request, + /// Amazon Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + /// + /// Parameter [description] : + /// A description of the ingestion job. + Future startIngestionJob({ + required String dataSourceId, + required String knowledgeBaseId, + String? clientToken, + String? description, + }) async { + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}/ingestionjobs/', + exceptionFnMap: _exceptionFns, + ); + return StartIngestionJobResponse.fromJson(response); + } + + /// Associate tags with a resource. For more information, see Tagging + /// resources in the Amazon Bedrock User Guide. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to tag. + /// + /// Parameter [tags] : + /// An object containing key-value pairs that define the tags to attach to the + /// resource. + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Remove tags from a resource. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource from which to remove tags. + /// + /// Parameter [tagKeys] : + /// A list of keys of the tags to remove from the resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates the configuration of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [agentName] : + /// Specifies a new name for the agent. + /// + /// Parameter [agentResourceRoleArn] : + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the agent. + /// + /// Parameter [foundationModel] : + /// Specifies a new foundation model to be used for orchestration by the + /// agent. + /// + /// Parameter [customerEncryptionKeyArn] : + /// The Amazon Resource Name (ARN) of the KMS key with which to encrypt the + /// agent. + /// + /// Parameter [description] : + /// Specifies a new description of the agent. + /// + /// Parameter [guardrailConfiguration] : + /// The unique Guardrail configuration assigned to the agent when it is + /// updated. + /// + /// Parameter [idleSessionTTLInSeconds] : + /// The number of seconds for which Amazon Bedrock keeps information about a + /// user's conversation with the agent. + /// + /// A user interaction remains active for the amount of time specified. If no + /// conversation occurs during this time, the session expires and Amazon + /// Bedrock deletes any data provided before the timeout. + /// + /// Parameter [instruction] : + /// Specifies new instructions that tell the agent what it should do and how + /// it should interact with users. + /// + /// Parameter [promptOverrideConfiguration] : + /// Contains configurations to override prompts in different parts of an agent + /// sequence. For more information, see Advanced + /// prompts. + Future updateAgent({ + required String agentId, + required String agentName, + required String agentResourceRoleArn, + required String foundationModel, + String? customerEncryptionKeyArn, + String? description, + GuardrailConfiguration? guardrailConfiguration, + int? idleSessionTTLInSeconds, + String? instruction, + PromptOverrideConfiguration? promptOverrideConfiguration, + }) async { + _s.validateNumRange( + 'idleSessionTTLInSeconds', + idleSessionTTLInSeconds, + 60, + 3600, + ); + final $payload = { + 'agentName': agentName, + 'agentResourceRoleArn': agentResourceRoleArn, + 'foundationModel': foundationModel, + if (customerEncryptionKeyArn != null) + 'customerEncryptionKeyArn': customerEncryptionKeyArn, + if (description != null) 'description': description, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (idleSessionTTLInSeconds != null) + 'idleSessionTTLInSeconds': idleSessionTTLInSeconds, + if (instruction != null) 'instruction': instruction, + if (promptOverrideConfiguration != null) + 'promptOverrideConfiguration': promptOverrideConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/agents/${Uri.encodeComponent(agentId)}/', + exceptionFnMap: _exceptionFns, + ); + return UpdateAgentResponse.fromJson(response); + } + + /// Updates the configuration for an action group for an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [actionGroupId] : + /// The unique identifier of the action group. + /// + /// Parameter [actionGroupName] : + /// Specifies a new name for the action group. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent for which to update the action group. + /// + /// Parameter [agentVersion] : + /// The unique identifier of the agent version for which to update the action + /// group. + /// + /// Parameter [actionGroupExecutor] : + /// The Amazon Resource Name (ARN) of the Lambda function containing the + /// business logic that is carried out upon invoking the action. + /// + /// Parameter [actionGroupState] : + /// Specifies whether the action group is available for the agent to invoke or + /// not when sending an InvokeAgent + /// request. + /// + /// Parameter [apiSchema] : + /// 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. For more information, see Action + /// group OpenAPI schemas. + /// + /// Parameter [description] : + /// Specifies a new name for the action group. + /// + /// Parameter [functionSchema] : + /// Contains details about the function schema for the action group or the + /// JSON or YAML-formatted payload defining the schema. + /// + /// Parameter [parentActionGroupSignature] : + /// To allow your agent to request the user for additional information when + /// trying to complete a task, set this field to + /// AMAZON.UserInput. You must leave the + /// description, apiSchema, and + /// actionGroupExecutor fields blank for this action group. + /// + /// During orchestration, if your agent determines that it needs to invoke an + /// API in an action group, but doesn't have enough information to complete + /// the API request, it will invoke this action group instead and return an Observation + /// reprompting the user for more information. + Future updateAgentActionGroup({ + required String actionGroupId, + required String actionGroupName, + required String agentId, + required String agentVersion, + ActionGroupExecutor? actionGroupExecutor, + ActionGroupState? actionGroupState, + APISchema? apiSchema, + String? description, + FunctionSchema? functionSchema, + ActionGroupSignature? parentActionGroupSignature, + }) async { + final $payload = { + 'actionGroupName': actionGroupName, + if (actionGroupExecutor != null) + 'actionGroupExecutor': actionGroupExecutor, + if (actionGroupState != null) + 'actionGroupState': actionGroupState.toValue(), + if (apiSchema != null) 'apiSchema': apiSchema, + if (description != null) 'description': description, + if (functionSchema != null) 'functionSchema': functionSchema, + if (parentActionGroupSignature != null) + 'parentActionGroupSignature': parentActionGroupSignature.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/actiongroups/${Uri.encodeComponent(actionGroupId)}/', + exceptionFnMap: _exceptionFns, + ); + return UpdateAgentActionGroupResponse.fromJson(response); + } + + /// Updates configurations for an alias of an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentAliasId] : + /// The unique identifier of the alias. + /// + /// Parameter [agentAliasName] : + /// Specifies a new name for the alias. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent. + /// + /// Parameter [description] : + /// Specifies a new description for the alias. + /// + /// Parameter [routingConfiguration] : + /// Contains details about the routing configuration of the alias. + Future updateAgentAlias({ + required String agentAliasId, + required String agentAliasName, + required String agentId, + String? description, + List? routingConfiguration, + }) async { + final $payload = { + 'agentAliasName': agentAliasName, + if (description != null) 'description': description, + if (routingConfiguration != null) + 'routingConfiguration': routingConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentaliases/${Uri.encodeComponent(agentAliasId)}/', + exceptionFnMap: _exceptionFns, + ); + return UpdateAgentAliasResponse.fromJson(response); + } + + /// Updates the configuration for a knowledge base that has been associated + /// with an agent. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent associated with the knowledge base that + /// you want to update. + /// + /// Parameter [agentVersion] : + /// The version of the agent associated with the knowledge base that you want + /// to update. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base that has been associated with + /// an agent. + /// + /// Parameter [description] : + /// Specifies a new description for the knowledge base associated with an + /// agent. + /// + /// Parameter [knowledgeBaseState] : + /// Specifies whether the agent uses the knowledge base or not when sending an + /// InvokeAgent + /// request. + Future updateAgentKnowledgeBase({ + required String agentId, + required String agentVersion, + required String knowledgeBaseId, + String? description, + KnowledgeBaseState? knowledgeBaseState, + }) async { + final $payload = { + if (description != null) 'description': description, + if (knowledgeBaseState != null) + 'knowledgeBaseState': knowledgeBaseState.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentversions/${Uri.encodeComponent(agentVersion)}/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/', + exceptionFnMap: _exceptionFns, + ); + return UpdateAgentKnowledgeBaseResponse.fromJson(response); + } + + /// Updates configurations for a data source. + /// + /// You can't change the chunkingConfiguration after you create + /// the data source. Specify the existing chunkingConfiguration. + /// + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [dataSourceConfiguration] : + /// Contains details about the storage configuration of the data source. + /// + /// Parameter [dataSourceId] : + /// The unique identifier of the data source. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to which the data source + /// belongs. + /// + /// Parameter [name] : + /// Specifies a new name for the data source. + /// + /// Parameter [dataDeletionPolicy] : + /// The data deletion policy of the updated data source. + /// + /// Parameter [description] : + /// Specifies a new description for the data source. + /// + /// Parameter [serverSideEncryptionConfiguration] : + /// Contains details about server-side encryption of the data source. + /// + /// Parameter [vectorIngestionConfiguration] : + /// Contains details about how to ingest the documents in the data source. + Future updateDataSource({ + required DataSourceConfiguration dataSourceConfiguration, + required String dataSourceId, + required String knowledgeBaseId, + required String name, + DataDeletionPolicy? dataDeletionPolicy, + String? description, + ServerSideEncryptionConfiguration? serverSideEncryptionConfiguration, + VectorIngestionConfiguration? vectorIngestionConfiguration, + }) async { + final $payload = { + 'dataSourceConfiguration': dataSourceConfiguration, + 'name': name, + if (dataDeletionPolicy != null) + 'dataDeletionPolicy': dataDeletionPolicy.toValue(), + if (description != null) 'description': description, + if (serverSideEncryptionConfiguration != null) + 'serverSideEncryptionConfiguration': serverSideEncryptionConfiguration, + if (vectorIngestionConfiguration != null) + 'vectorIngestionConfiguration': vectorIngestionConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/datasources/${Uri.encodeComponent(dataSourceId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateDataSourceResponse.fromJson(response); + } + + /// Updates the configuration of a knowledge base with the fields that you + /// specify. Because all fields will be overwritten, you must include the same + /// values for fields that you want to keep the same. + /// + /// You can change the following fields: + /// + ///
      + ///
    • + /// name + ///
    • + ///
    • + /// description + ///
    • + ///
    • + /// roleArn + ///
    • + ///
    + /// You can't change the knowledgeBaseConfiguration or + /// storageConfiguration fields, so you must specify the same + /// configurations as when you created the knowledge base. You can send a GetKnowledgeBase + /// request and copy the same configurations. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [knowledgeBaseConfiguration] : + /// Specifies the configuration for the embeddings model used for the + /// knowledge base. You must use the same configuration as when the knowledge + /// base was created. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to update. + /// + /// Parameter [name] : + /// Specifies a new name for the knowledge base. + /// + /// Parameter [roleArn] : + /// Specifies a different Amazon Resource Name (ARN) of the IAM role with + /// permissions to invoke API operations on the knowledge base. + /// + /// Parameter [storageConfiguration] : + /// Specifies the configuration for the vector store used for the knowledge + /// base. You must use the same configuration as when the knowledge base was + /// created. + /// + /// Parameter [description] : + /// Specifies a new description for the knowledge base. + Future updateKnowledgeBase({ + required KnowledgeBaseConfiguration knowledgeBaseConfiguration, + required String knowledgeBaseId, + required String name, + required String roleArn, + required StorageConfiguration storageConfiguration, + String? description, + }) async { + final $payload = { + 'knowledgeBaseConfiguration': knowledgeBaseConfiguration, + 'name': name, + 'roleArn': roleArn, + 'storageConfiguration': storageConfiguration, + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateKnowledgeBaseResponse.fromJson(response); + } +} + +/// Contains details about the OpenAPI schema for the action group. For more +/// information, see Action +/// group 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. +class APISchema { + /// The JSON or YAML-formatted payload defining the OpenAPI schema for the + /// action group. For more information, see Action + /// group OpenAPI schemas. + final String? payload; + + /// Contains details about the S3 object containing the OpenAPI schema for the + /// action group. For more information, see Action + /// group OpenAPI schemas. + final S3Identifier? s3; + + APISchema({ + this.payload, + this.s3, + }); + + factory APISchema.fromJson(Map json) { + return APISchema( + payload: json['payload'] as String?, + s3: json['s3'] != null + ? S3Identifier.fromJson(json['s3'] as Map) + : null, + ); + } + + Map toJson() { + final payload = this.payload; + final s3 = this.s3; + return { + if (payload != null) 'payload': payload, + if (s3 != null) 's3': s3, + }; + } +} + +/// Contains details about the Lambda function containing the business logic +/// that is carried out upon invoking the action or the custom control method +/// for handling the information elicited from the user. +class ActionGroupExecutor { + /// To return the action group invocation results directly in the + /// InvokeAgent response, specify RETURN_CONTROL. + final CustomControlMethod? customControl; + + /// The Amazon Resource Name (ARN) of the Lambda function containing the + /// business logic that is carried out upon invoking the action. + final String? lambda; + + ActionGroupExecutor({ + this.customControl, + this.lambda, + }); + + factory ActionGroupExecutor.fromJson(Map json) { + return ActionGroupExecutor( + customControl: + (json['customControl'] as String?)?.toCustomControlMethod(), + lambda: json['lambda'] as String?, + ); + } + + Map toJson() { + final customControl = this.customControl; + final lambda = this.lambda; + return { + if (customControl != null) 'customControl': customControl.toValue(), + if (lambda != null) 'lambda': lambda, + }; + } +} + +enum ActionGroupSignature { + amazonUserInput, +} + +extension ActionGroupSignatureValueExtension on ActionGroupSignature { + String toValue() { + switch (this) { + case ActionGroupSignature.amazonUserInput: + return 'AMAZON.UserInput'; + } + } +} + +extension ActionGroupSignatureFromString on String { + ActionGroupSignature toActionGroupSignature() { + switch (this) { + case 'AMAZON.UserInput': + return ActionGroupSignature.amazonUserInput; + } + throw Exception('$this is not known in enum ActionGroupSignature'); + } +} + +enum ActionGroupState { + enabled, + disabled, +} + +extension ActionGroupStateValueExtension on ActionGroupState { + String toValue() { + switch (this) { + case ActionGroupState.enabled: + return 'ENABLED'; + case ActionGroupState.disabled: + return 'DISABLED'; + } + } +} + +extension ActionGroupStateFromString on String { + ActionGroupState toActionGroupState() { + switch (this) { + case 'ENABLED': + return ActionGroupState.enabled; + case 'DISABLED': + return ActionGroupState.disabled; + } + throw Exception('$this is not known in enum ActionGroupState'); + } +} + +/// Contains details about an action group. +class ActionGroupSummary { + /// The unique identifier of the action group. + final String actionGroupId; + + /// The name of the action group. + final String actionGroupName; + + /// Specifies whether the action group is available for the agent to invoke or + /// not when sending an InvokeAgent + /// request. + final ActionGroupState actionGroupState; + + /// The time at which the action group was last updated. + final DateTime updatedAt; + + /// The description of the action group. + final String? description; + + ActionGroupSummary({ + required this.actionGroupId, + required this.actionGroupName, + required this.actionGroupState, + required this.updatedAt, + this.description, + }); + + factory ActionGroupSummary.fromJson(Map json) { + return ActionGroupSummary( + actionGroupId: json['actionGroupId'] as String, + actionGroupName: json['actionGroupName'] as String, + actionGroupState: + (json['actionGroupState'] as String).toActionGroupState(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final actionGroupId = this.actionGroupId; + final actionGroupName = this.actionGroupName; + final actionGroupState = this.actionGroupState; + final updatedAt = this.updatedAt; + final description = this.description; + return { + 'actionGroupId': actionGroupId, + 'actionGroupName': actionGroupName, + 'actionGroupState': actionGroupState.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + }; + } +} + +/// Contains details about an agent. +class Agent { + /// The Amazon Resource Name (ARN) of the agent. + final String agentArn; + + /// The unique identifier of the agent. + final String agentId; + + /// The name of the agent. + final String agentName; + + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the agent. + final String agentResourceRoleArn; + + /// The status of the agent and whether it is ready for use. The following + /// statuses are possible: + /// + ///
      + ///
    • + /// CREATING – The agent is being created. + ///
    • + ///
    • + /// PREPARING – The agent is being prepared. + ///
    • + ///
    • + /// PREPARED – The agent is prepared and ready to be invoked. + ///
    • + ///
    • + /// NOT_PREPARED – The agent has been created but not yet prepared. + ///
    • + ///
    • + /// FAILED – The agent API operation failed. + ///
    • + ///
    • + /// UPDATING – The agent is being updated. + ///
    • + ///
    • + /// DELETING – The agent is being deleted. + ///
    • + ///
    + final AgentStatus agentStatus; + + /// The version of the agent. + final String agentVersion; + + /// The time at which the agent was created. + final DateTime createdAt; + + /// The number of seconds for which Amazon Bedrock keeps information about a + /// user's conversation with the agent. + /// + /// A user interaction remains active for the amount of time specified. If no + /// conversation occurs during this time, the session expires and Amazon Bedrock + /// deletes any data provided before the timeout. + final int idleSessionTTLInSeconds; + + /// The time at which the agent was last updated. + final DateTime updatedAt; + + /// A unique, case-sensitive identifier to ensure that the API request completes + /// no more than one time. If this token matches a previous request, Amazon + /// Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + final String? clientToken; + + /// The Amazon Resource Name (ARN) of the KMS key that encrypts the agent. + final String? customerEncryptionKeyArn; + + /// The description of the agent. + final String? description; + + /// Contains reasons that the agent-related API that you invoked failed. + final List? failureReasons; + + /// The foundation model used for orchestration by the agent. + final String? foundationModel; + + /// The guardrails configuration assigned to the agent. + final GuardrailConfiguration? guardrailConfiguration; + + /// Instructions that tell the agent what it should do and how it should + /// interact with users. + final String? instruction; + + /// The time at which the agent was last prepared. + final DateTime? preparedAt; + + /// Contains configurations to override prompt templates in different parts of + /// an agent sequence. For more information, see Advanced + /// prompts. + final PromptOverrideConfiguration? promptOverrideConfiguration; + + /// Contains recommended actions to take for the agent-related API that you + /// invoked to succeed. + final List? recommendedActions; + + Agent({ + required this.agentArn, + required this.agentId, + required this.agentName, + required this.agentResourceRoleArn, + required this.agentStatus, + required this.agentVersion, + required this.createdAt, + required this.idleSessionTTLInSeconds, + required this.updatedAt, + this.clientToken, + this.customerEncryptionKeyArn, + this.description, + this.failureReasons, + this.foundationModel, + this.guardrailConfiguration, + this.instruction, + this.preparedAt, + this.promptOverrideConfiguration, + this.recommendedActions, + }); + + factory Agent.fromJson(Map json) { + return Agent( + agentArn: json['agentArn'] as String, + agentId: json['agentId'] as String, + agentName: json['agentName'] as String, + agentResourceRoleArn: json['agentResourceRoleArn'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + agentVersion: json['agentVersion'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + idleSessionTTLInSeconds: json['idleSessionTTLInSeconds'] as int, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + clientToken: json['clientToken'] as String?, + customerEncryptionKeyArn: json['customerEncryptionKeyArn'] as String?, + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + foundationModel: json['foundationModel'] as String?, + guardrailConfiguration: json['guardrailConfiguration'] != null + ? GuardrailConfiguration.fromJson( + json['guardrailConfiguration'] as Map) + : null, + instruction: json['instruction'] as String?, + preparedAt: timeStampFromJson(json['preparedAt']), + promptOverrideConfiguration: json['promptOverrideConfiguration'] != null + ? PromptOverrideConfiguration.fromJson( + json['promptOverrideConfiguration'] as Map) + : null, + recommendedActions: (json['recommendedActions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final agentArn = this.agentArn; + final agentId = this.agentId; + final agentName = this.agentName; + final agentResourceRoleArn = this.agentResourceRoleArn; + final agentStatus = this.agentStatus; + final agentVersion = this.agentVersion; + final createdAt = this.createdAt; + final idleSessionTTLInSeconds = this.idleSessionTTLInSeconds; + final updatedAt = this.updatedAt; + final clientToken = this.clientToken; + final customerEncryptionKeyArn = this.customerEncryptionKeyArn; + final description = this.description; + final failureReasons = this.failureReasons; + final foundationModel = this.foundationModel; + final guardrailConfiguration = this.guardrailConfiguration; + final instruction = this.instruction; + final preparedAt = this.preparedAt; + final promptOverrideConfiguration = this.promptOverrideConfiguration; + final recommendedActions = this.recommendedActions; + return { + 'agentArn': agentArn, + 'agentId': agentId, + 'agentName': agentName, + 'agentResourceRoleArn': agentResourceRoleArn, + 'agentStatus': agentStatus.toValue(), + 'agentVersion': agentVersion, + 'createdAt': iso8601ToJson(createdAt), + 'idleSessionTTLInSeconds': idleSessionTTLInSeconds, + 'updatedAt': iso8601ToJson(updatedAt), + if (clientToken != null) 'clientToken': clientToken, + if (customerEncryptionKeyArn != null) + 'customerEncryptionKeyArn': customerEncryptionKeyArn, + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (foundationModel != null) 'foundationModel': foundationModel, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (instruction != null) 'instruction': instruction, + if (preparedAt != null) 'preparedAt': iso8601ToJson(preparedAt), + if (promptOverrideConfiguration != null) + 'promptOverrideConfiguration': promptOverrideConfiguration, + if (recommendedActions != null) 'recommendedActions': recommendedActions, + }; + } +} + +/// Contains details about an action group. +class AgentActionGroup { + /// The unique identifier of the action group. + final String actionGroupId; + + /// The name of the action group. + final String actionGroupName; + + /// Specifies whether the action group is available for the agent to invoke or + /// not when sending an InvokeAgent + /// request. + final ActionGroupState actionGroupState; + + /// The unique identifier of the agent to which the action group belongs. + final String agentId; + + /// The version of the agent to which the action group belongs. + final String agentVersion; + + /// The time at which the action group was created. + final DateTime createdAt; + + /// The time at which the action group was last updated. + final DateTime updatedAt; + + /// The Amazon Resource Name (ARN) of the Lambda function containing the + /// business logic that is carried out upon invoking the action or the custom + /// control method for handling the information elicited from the user. + final ActionGroupExecutor? actionGroupExecutor; + + /// 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. For more information, see Action + /// group OpenAPI schemas. + final APISchema? apiSchema; + + /// A unique, case-sensitive identifier to ensure that the API request completes + /// no more than one time. If this token matches a previous request, Amazon + /// Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + final String? clientToken; + + /// The description of the action group. + final String? description; + + /// Defines functions that each define parameters that the agent needs to invoke + /// from the user. Each function represents an action in an action group. + final FunctionSchema? functionSchema; + + /// If this field is set as AMAZON.UserInput, the agent can request + /// the user for additional information when trying to complete a task. The + /// description, apiSchema, and + /// actionGroupExecutor fields must be blank for this action group. + /// + /// During orchestration, if the agent determines that it needs to invoke an API + /// in an action group, but doesn't have enough information to complete the API + /// request, it will invoke this action group instead and return an Observation + /// reprompting the user for more information. + final ActionGroupSignature? parentActionSignature; + + AgentActionGroup({ + required this.actionGroupId, + required this.actionGroupName, + required this.actionGroupState, + required this.agentId, + required this.agentVersion, + required this.createdAt, + required this.updatedAt, + this.actionGroupExecutor, + this.apiSchema, + this.clientToken, + this.description, + this.functionSchema, + this.parentActionSignature, + }); + + factory AgentActionGroup.fromJson(Map json) { + return AgentActionGroup( + actionGroupId: json['actionGroupId'] as String, + actionGroupName: json['actionGroupName'] as String, + actionGroupState: + (json['actionGroupState'] as String).toActionGroupState(), + agentId: json['agentId'] as String, + agentVersion: json['agentVersion'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + actionGroupExecutor: json['actionGroupExecutor'] != null + ? ActionGroupExecutor.fromJson( + json['actionGroupExecutor'] as Map) + : null, + apiSchema: json['apiSchema'] != null + ? APISchema.fromJson(json['apiSchema'] as Map) + : null, + clientToken: json['clientToken'] as String?, + description: json['description'] as String?, + functionSchema: json['functionSchema'] != null + ? FunctionSchema.fromJson( + json['functionSchema'] as Map) + : null, + parentActionSignature: + (json['parentActionSignature'] as String?)?.toActionGroupSignature(), + ); + } + + Map toJson() { + final actionGroupId = this.actionGroupId; + final actionGroupName = this.actionGroupName; + final actionGroupState = this.actionGroupState; + final agentId = this.agentId; + final agentVersion = this.agentVersion; + final createdAt = this.createdAt; + final updatedAt = this.updatedAt; + final actionGroupExecutor = this.actionGroupExecutor; + final apiSchema = this.apiSchema; + final clientToken = this.clientToken; + final description = this.description; + final functionSchema = this.functionSchema; + final parentActionSignature = this.parentActionSignature; + return { + 'actionGroupId': actionGroupId, + 'actionGroupName': actionGroupName, + 'actionGroupState': actionGroupState.toValue(), + 'agentId': agentId, + 'agentVersion': agentVersion, + 'createdAt': iso8601ToJson(createdAt), + 'updatedAt': iso8601ToJson(updatedAt), + if (actionGroupExecutor != null) + 'actionGroupExecutor': actionGroupExecutor, + if (apiSchema != null) 'apiSchema': apiSchema, + if (clientToken != null) 'clientToken': clientToken, + if (description != null) 'description': description, + if (functionSchema != null) 'functionSchema': functionSchema, + if (parentActionSignature != null) + 'parentActionSignature': parentActionSignature.toValue(), + }; + } +} + +/// Contains details about an alias of an agent. +class AgentAlias { + /// The Amazon Resource Name (ARN) of the alias of the agent. + final String agentAliasArn; + + /// The unique identifier of the alias of the agent. + final String agentAliasId; + + /// The name of the alias of the agent. + final String agentAliasName; + + /// The status of the alias of the agent and whether it is ready for use. The + /// following statuses are possible: + /// + ///
      + ///
    • + /// CREATING – The agent alias is being created. + ///
    • + ///
    • + /// PREPARED – The agent alias is finished being created or updated and is ready + /// to be invoked. + ///
    • + ///
    • + /// FAILED – The agent alias API operation failed. + ///
    • + ///
    • + /// UPDATING – The agent alias is being updated. + ///
    • + ///
    • + /// DELETING – The agent alias is being deleted. + ///
    • + ///
    + final AgentAliasStatus agentAliasStatus; + + /// The unique identifier of the agent. + final String agentId; + + /// The time at which the alias of the agent was created. + final DateTime createdAt; + + /// Contains details about the routing configuration of the alias. + final List routingConfiguration; + + /// The time at which the alias was last updated. + final DateTime updatedAt; + + /// Contains details about the history of the alias. + final List? agentAliasHistoryEvents; + + /// A unique, case-sensitive identifier to ensure that the API request completes + /// no more than one time. If this token matches a previous request, Amazon + /// Bedrock ignores the request, but does not return an error. For more + /// information, see Ensuring + /// idempotency. + final String? clientToken; + + /// The description of the alias of the agent. + final String? description; + + /// Information on the failure of Provisioned Throughput assigned to an agent + /// alias. + final List? failureReasons; + + AgentAlias({ + required this.agentAliasArn, + required this.agentAliasId, + required this.agentAliasName, + required this.agentAliasStatus, + required this.agentId, + required this.createdAt, + required this.routingConfiguration, + required this.updatedAt, + this.agentAliasHistoryEvents, + this.clientToken, + this.description, + this.failureReasons, + }); + + factory AgentAlias.fromJson(Map json) { + return AgentAlias( + agentAliasArn: json['agentAliasArn'] as String, + agentAliasId: json['agentAliasId'] as String, + agentAliasName: json['agentAliasName'] as String, + agentAliasStatus: + (json['agentAliasStatus'] as String).toAgentAliasStatus(), + agentId: json['agentId'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + routingConfiguration: (json['routingConfiguration'] as List) + .whereNotNull() + .map((e) => AgentAliasRoutingConfigurationListItem.fromJson( + e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + agentAliasHistoryEvents: (json['agentAliasHistoryEvents'] as List?) + ?.whereNotNull() + .map( + (e) => AgentAliasHistoryEvent.fromJson(e as Map)) + .toList(), + clientToken: json['clientToken'] as String?, + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final agentAliasArn = this.agentAliasArn; + final agentAliasId = this.agentAliasId; + final agentAliasName = this.agentAliasName; + final agentAliasStatus = this.agentAliasStatus; + final agentId = this.agentId; + final createdAt = this.createdAt; + final routingConfiguration = this.routingConfiguration; + final updatedAt = this.updatedAt; + final agentAliasHistoryEvents = this.agentAliasHistoryEvents; + final clientToken = this.clientToken; + final description = this.description; + final failureReasons = this.failureReasons; + return { + 'agentAliasArn': agentAliasArn, + 'agentAliasId': agentAliasId, + 'agentAliasName': agentAliasName, + 'agentAliasStatus': agentAliasStatus.toValue(), + 'agentId': agentId, + 'createdAt': iso8601ToJson(createdAt), + 'routingConfiguration': routingConfiguration, + 'updatedAt': iso8601ToJson(updatedAt), + if (agentAliasHistoryEvents != null) + 'agentAliasHistoryEvents': agentAliasHistoryEvents, + if (clientToken != null) 'clientToken': clientToken, + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + }; + } +} + +/// Contains details about the history of the alias. +class AgentAliasHistoryEvent { + /// The date that the alias stopped being associated to the version in the + /// routingConfiguration object + final DateTime? endDate; + + /// Contains details about the version of the agent with which the alias is + /// associated. + final List? routingConfiguration; + + /// The date that the alias began being associated to the version in the + /// routingConfiguration object. + final DateTime? startDate; + + AgentAliasHistoryEvent({ + this.endDate, + this.routingConfiguration, + this.startDate, + }); + + factory AgentAliasHistoryEvent.fromJson(Map json) { + return AgentAliasHistoryEvent( + endDate: timeStampFromJson(json['endDate']), + routingConfiguration: (json['routingConfiguration'] as List?) + ?.whereNotNull() + .map((e) => AgentAliasRoutingConfigurationListItem.fromJson( + e as Map)) + .toList(), + startDate: timeStampFromJson(json['startDate']), + ); + } + + Map toJson() { + final endDate = this.endDate; + final routingConfiguration = this.routingConfiguration; + final startDate = this.startDate; + return { + if (endDate != null) 'endDate': iso8601ToJson(endDate), + if (routingConfiguration != null) + 'routingConfiguration': routingConfiguration, + if (startDate != null) 'startDate': iso8601ToJson(startDate), + }; + } +} + +/// Contains details about the routing configuration of the alias. +class AgentAliasRoutingConfigurationListItem { + /// The version of the agent with which the alias is associated. + final String? agentVersion; + + /// Information on the Provisioned Throughput assigned to an agent alias. + final String? provisionedThroughput; + + AgentAliasRoutingConfigurationListItem({ + this.agentVersion, + this.provisionedThroughput, + }); + + factory AgentAliasRoutingConfigurationListItem.fromJson( + Map json) { + return AgentAliasRoutingConfigurationListItem( + agentVersion: json['agentVersion'] as String?, + provisionedThroughput: json['provisionedThroughput'] as String?, + ); + } + + Map toJson() { + final agentVersion = this.agentVersion; + final provisionedThroughput = this.provisionedThroughput; + return { + if (agentVersion != null) 'agentVersion': agentVersion, + if (provisionedThroughput != null) + 'provisionedThroughput': provisionedThroughput, + }; + } +} + +enum AgentAliasStatus { + creating, + prepared, + failed, + updating, + deleting, +} + +extension AgentAliasStatusValueExtension on AgentAliasStatus { + String toValue() { + switch (this) { + case AgentAliasStatus.creating: + return 'CREATING'; + case AgentAliasStatus.prepared: + return 'PREPARED'; + case AgentAliasStatus.failed: + return 'FAILED'; + case AgentAliasStatus.updating: + return 'UPDATING'; + case AgentAliasStatus.deleting: + return 'DELETING'; + } + } +} + +extension AgentAliasStatusFromString on String { + AgentAliasStatus toAgentAliasStatus() { + switch (this) { + case 'CREATING': + return AgentAliasStatus.creating; + case 'PREPARED': + return AgentAliasStatus.prepared; + case 'FAILED': + return AgentAliasStatus.failed; + case 'UPDATING': + return AgentAliasStatus.updating; + case 'DELETING': + return AgentAliasStatus.deleting; + } + throw Exception('$this is not known in enum AgentAliasStatus'); + } +} + +/// Contains details about an alias of an agent. +class AgentAliasSummary { + /// Contains details about + final String agentAliasId; + + /// The name of the alias. + final String agentAliasName; + + /// The status of the alias. + final AgentAliasStatus agentAliasStatus; + + /// The time at which the alias of the agent was created. + final DateTime createdAt; + + /// The time at which the alias was last updated. + final DateTime updatedAt; + + /// The description of the alias. + final String? description; + + /// Contains details about the version of the agent with which the alias is + /// associated. + final List? routingConfiguration; + + AgentAliasSummary({ + required this.agentAliasId, + required this.agentAliasName, + required this.agentAliasStatus, + required this.createdAt, + required this.updatedAt, + this.description, + this.routingConfiguration, + }); + + factory AgentAliasSummary.fromJson(Map json) { + return AgentAliasSummary( + agentAliasId: json['agentAliasId'] as String, + agentAliasName: json['agentAliasName'] as String, + agentAliasStatus: + (json['agentAliasStatus'] as String).toAgentAliasStatus(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + routingConfiguration: (json['routingConfiguration'] as List?) + ?.whereNotNull() + .map((e) => AgentAliasRoutingConfigurationListItem.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final agentAliasId = this.agentAliasId; + final agentAliasName = this.agentAliasName; + final agentAliasStatus = this.agentAliasStatus; + final createdAt = this.createdAt; + final updatedAt = this.updatedAt; + final description = this.description; + final routingConfiguration = this.routingConfiguration; + return { + 'agentAliasId': agentAliasId, + 'agentAliasName': agentAliasName, + 'agentAliasStatus': agentAliasStatus.toValue(), + 'createdAt': iso8601ToJson(createdAt), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (routingConfiguration != null) + 'routingConfiguration': routingConfiguration, + }; + } +} + +/// Contains details about a knowledge base that is associated with an agent. +class AgentKnowledgeBase { + /// The unique identifier of the agent with which the knowledge base is + /// associated. + final String agentId; + + /// The version of the agent with which the knowledge base is associated. + final String agentVersion; + + /// The time at which the association between the agent and the knowledge base + /// was created. + final DateTime createdAt; + + /// The description of the association between the agent and the knowledge base. + final String description; + + /// The unique identifier of the association between the agent and the knowledge + /// base. + final String knowledgeBaseId; + + /// Specifies whether to use the knowledge base or not when sending an InvokeAgent + /// request. + final KnowledgeBaseState knowledgeBaseState; + + /// The time at which the association between the agent and the knowledge base + /// was last updated. + final DateTime updatedAt; + + AgentKnowledgeBase({ + required this.agentId, + required this.agentVersion, + required this.createdAt, + required this.description, + required this.knowledgeBaseId, + required this.knowledgeBaseState, + required this.updatedAt, + }); + + factory AgentKnowledgeBase.fromJson(Map json) { + return AgentKnowledgeBase( + agentId: json['agentId'] as String, + agentVersion: json['agentVersion'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + description: json['description'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + knowledgeBaseState: + (json['knowledgeBaseState'] as String).toKnowledgeBaseState(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + ); + } + + Map toJson() { + final agentId = this.agentId; + final agentVersion = this.agentVersion; + final createdAt = this.createdAt; + final description = this.description; + final knowledgeBaseId = this.knowledgeBaseId; + final knowledgeBaseState = this.knowledgeBaseState; + final updatedAt = this.updatedAt; + return { + 'agentId': agentId, + 'agentVersion': agentVersion, + 'createdAt': iso8601ToJson(createdAt), + 'description': description, + 'knowledgeBaseId': knowledgeBaseId, + 'knowledgeBaseState': knowledgeBaseState.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// Contains details about a knowledge base associated with an agent. +class AgentKnowledgeBaseSummary { + /// The unique identifier of the knowledge base associated with an agent. + final String knowledgeBaseId; + + /// Specifies whether the agent uses the knowledge base or not when sending an + /// InvokeAgent + /// request. + final KnowledgeBaseState knowledgeBaseState; + + /// The time at which the knowledge base associated with an agent was last + /// updated. + final DateTime updatedAt; + + /// The description of the knowledge base associated with an agent. + final String? description; + + AgentKnowledgeBaseSummary({ + required this.knowledgeBaseId, + required this.knowledgeBaseState, + required this.updatedAt, + this.description, + }); + + factory AgentKnowledgeBaseSummary.fromJson(Map json) { + return AgentKnowledgeBaseSummary( + knowledgeBaseId: json['knowledgeBaseId'] as String, + knowledgeBaseState: + (json['knowledgeBaseState'] as String).toKnowledgeBaseState(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final knowledgeBaseId = this.knowledgeBaseId; + final knowledgeBaseState = this.knowledgeBaseState; + final updatedAt = this.updatedAt; + final description = this.description; + return { + 'knowledgeBaseId': knowledgeBaseId, + 'knowledgeBaseState': knowledgeBaseState.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + }; + } +} + +enum AgentStatus { + creating, + preparing, + prepared, + notPrepared, + deleting, + failed, + versioning, + updating, +} + +extension AgentStatusValueExtension on AgentStatus { + String toValue() { + switch (this) { + case AgentStatus.creating: + return 'CREATING'; + case AgentStatus.preparing: + return 'PREPARING'; + case AgentStatus.prepared: + return 'PREPARED'; + case AgentStatus.notPrepared: + return 'NOT_PREPARED'; + case AgentStatus.deleting: + return 'DELETING'; + case AgentStatus.failed: + return 'FAILED'; + case AgentStatus.versioning: + return 'VERSIONING'; + case AgentStatus.updating: + return 'UPDATING'; + } + } +} + +extension AgentStatusFromString on String { + AgentStatus toAgentStatus() { + switch (this) { + case 'CREATING': + return AgentStatus.creating; + case 'PREPARING': + return AgentStatus.preparing; + case 'PREPARED': + return AgentStatus.prepared; + case 'NOT_PREPARED': + return AgentStatus.notPrepared; + case 'DELETING': + return AgentStatus.deleting; + case 'FAILED': + return AgentStatus.failed; + case 'VERSIONING': + return AgentStatus.versioning; + case 'UPDATING': + return AgentStatus.updating; + } + throw Exception('$this is not known in enum AgentStatus'); + } +} + +/// Contains details about an agent. +class AgentSummary { + /// The unique identifier of the agent. + final String agentId; + + /// The name of the agent. + final String agentName; + + /// The status of the agent. + final AgentStatus agentStatus; + + /// The time at which the agent was last updated. + final DateTime updatedAt; + + /// The description of the agent. + final String? description; + + /// The details of the guardrails configuration in the agent summary. + final GuardrailConfiguration? guardrailConfiguration; + + /// The latest version of the agent. + final String? latestAgentVersion; + + AgentSummary({ + required this.agentId, + required this.agentName, + required this.agentStatus, + required this.updatedAt, + this.description, + this.guardrailConfiguration, + this.latestAgentVersion, + }); + + factory AgentSummary.fromJson(Map json) { + return AgentSummary( + agentId: json['agentId'] as String, + agentName: json['agentName'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + guardrailConfiguration: json['guardrailConfiguration'] != null + ? GuardrailConfiguration.fromJson( + json['guardrailConfiguration'] as Map) + : null, + latestAgentVersion: json['latestAgentVersion'] as String?, + ); + } + + Map toJson() { + final agentId = this.agentId; + final agentName = this.agentName; + final agentStatus = this.agentStatus; + final updatedAt = this.updatedAt; + final description = this.description; + final guardrailConfiguration = this.guardrailConfiguration; + final latestAgentVersion = this.latestAgentVersion; + return { + 'agentId': agentId, + 'agentName': agentName, + 'agentStatus': agentStatus.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (latestAgentVersion != null) 'latestAgentVersion': latestAgentVersion, + }; + } +} + +/// Contains details about a version of an agent. +class AgentVersion { + /// The Amazon Resource Name (ARN) of the agent that the version belongs to. + final String agentArn; + + /// The unique identifier of the agent that the version belongs to. + final String agentId; + + /// The name of the agent that the version belongs to. + final String agentName; + + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the agent. + final String agentResourceRoleArn; + + /// The status of the agent that the version belongs to. + final AgentStatus agentStatus; + + /// The time at which the version was created. + final DateTime createdAt; + + /// The number of seconds for which Amazon Bedrock keeps information about a + /// user's conversation with the agent. + /// + /// A user interaction remains active for the amount of time specified. If no + /// conversation occurs during this time, the session expires and Amazon Bedrock + /// deletes any data provided before the timeout. + final int idleSessionTTLInSeconds; + + /// The time at which the version was last updated. + final DateTime updatedAt; + + /// The version number. + final String version; + + /// The Amazon Resource Name (ARN) of the KMS key that encrypts the agent. + final String? customerEncryptionKeyArn; + + /// The description of the version. + final String? description; + + /// A list of reasons that the API operation on the version failed. + final List? failureReasons; + + /// The foundation model that the version invokes. + final String? foundationModel; + + /// The guardrails configuration assigned to the agent version. + final GuardrailConfiguration? guardrailConfiguration; + + /// The instructions provided to the agent. + final String? instruction; + + /// Contains configurations to override prompt templates in different parts of + /// an agent sequence. For more information, see Advanced + /// prompts. + final PromptOverrideConfiguration? promptOverrideConfiguration; + + /// A list of recommended actions to take for the failed API operation on the + /// version to succeed. + final List? recommendedActions; + + AgentVersion({ + required this.agentArn, + required this.agentId, + required this.agentName, + required this.agentResourceRoleArn, + required this.agentStatus, + required this.createdAt, + required this.idleSessionTTLInSeconds, + required this.updatedAt, + required this.version, + this.customerEncryptionKeyArn, + this.description, + this.failureReasons, + this.foundationModel, + this.guardrailConfiguration, + this.instruction, + this.promptOverrideConfiguration, + this.recommendedActions, + }); + + factory AgentVersion.fromJson(Map json) { + return AgentVersion( + agentArn: json['agentArn'] as String, + agentId: json['agentId'] as String, + agentName: json['agentName'] as String, + agentResourceRoleArn: json['agentResourceRoleArn'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + idleSessionTTLInSeconds: json['idleSessionTTLInSeconds'] as int, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + version: json['version'] as String, + customerEncryptionKeyArn: json['customerEncryptionKeyArn'] as String?, + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + foundationModel: json['foundationModel'] as String?, + guardrailConfiguration: json['guardrailConfiguration'] != null + ? GuardrailConfiguration.fromJson( + json['guardrailConfiguration'] as Map) + : null, + instruction: json['instruction'] as String?, + promptOverrideConfiguration: json['promptOverrideConfiguration'] != null + ? PromptOverrideConfiguration.fromJson( + json['promptOverrideConfiguration'] as Map) + : null, + recommendedActions: (json['recommendedActions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final agentArn = this.agentArn; + final agentId = this.agentId; + final agentName = this.agentName; + final agentResourceRoleArn = this.agentResourceRoleArn; + final agentStatus = this.agentStatus; + final createdAt = this.createdAt; + final idleSessionTTLInSeconds = this.idleSessionTTLInSeconds; + final updatedAt = this.updatedAt; + final version = this.version; + final customerEncryptionKeyArn = this.customerEncryptionKeyArn; + final description = this.description; + final failureReasons = this.failureReasons; + final foundationModel = this.foundationModel; + final guardrailConfiguration = this.guardrailConfiguration; + final instruction = this.instruction; + final promptOverrideConfiguration = this.promptOverrideConfiguration; + final recommendedActions = this.recommendedActions; + return { + 'agentArn': agentArn, + 'agentId': agentId, + 'agentName': agentName, + 'agentResourceRoleArn': agentResourceRoleArn, + 'agentStatus': agentStatus.toValue(), + 'createdAt': iso8601ToJson(createdAt), + 'idleSessionTTLInSeconds': idleSessionTTLInSeconds, + 'updatedAt': iso8601ToJson(updatedAt), + 'version': version, + if (customerEncryptionKeyArn != null) + 'customerEncryptionKeyArn': customerEncryptionKeyArn, + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (foundationModel != null) 'foundationModel': foundationModel, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (instruction != null) 'instruction': instruction, + if (promptOverrideConfiguration != null) + 'promptOverrideConfiguration': promptOverrideConfiguration, + if (recommendedActions != null) 'recommendedActions': recommendedActions, + }; + } +} + +/// Contains details about a version of an agent. +class AgentVersionSummary { + /// The name of the agent to which the version belongs. + final String agentName; + + /// The status of the agent to which the version belongs. + final AgentStatus agentStatus; + + /// The version of the agent. + final String agentVersion; + + /// The time at which the version was created. + final DateTime createdAt; + + /// The time at which the version was last updated. + final DateTime updatedAt; + + /// The description of the version of the agent. + final String? description; + + /// The details of the guardrails configuration in the agent version summary. + final GuardrailConfiguration? guardrailConfiguration; + + AgentVersionSummary({ + required this.agentName, + required this.agentStatus, + required this.agentVersion, + required this.createdAt, + required this.updatedAt, + this.description, + this.guardrailConfiguration, + }); + + factory AgentVersionSummary.fromJson(Map json) { + return AgentVersionSummary( + agentName: json['agentName'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + agentVersion: json['agentVersion'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + guardrailConfiguration: json['guardrailConfiguration'] != null + ? GuardrailConfiguration.fromJson( + json['guardrailConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final agentName = this.agentName; + final agentStatus = this.agentStatus; + final agentVersion = this.agentVersion; + final createdAt = this.createdAt; + final updatedAt = this.updatedAt; + final description = this.description; + final guardrailConfiguration = this.guardrailConfiguration; + return { + 'agentName': agentName, + 'agentStatus': agentStatus.toValue(), + 'agentVersion': agentVersion, + 'createdAt': iso8601ToJson(createdAt), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + }; + } +} + +class AssociateAgentKnowledgeBaseResponse { + /// Contains details about the knowledge base that has been associated with the + /// agent. + final AgentKnowledgeBase agentKnowledgeBase; + + AssociateAgentKnowledgeBaseResponse({ + required this.agentKnowledgeBase, + }); + + factory AssociateAgentKnowledgeBaseResponse.fromJson( + Map json) { + return AssociateAgentKnowledgeBaseResponse( + agentKnowledgeBase: AgentKnowledgeBase.fromJson( + json['agentKnowledgeBase'] as Map), + ); + } + + Map toJson() { + final agentKnowledgeBase = this.agentKnowledgeBase; + return { + 'agentKnowledgeBase': agentKnowledgeBase, + }; + } +} + +/// The vector configuration details for the Bedrock embeddings model. +class BedrockEmbeddingModelConfiguration { + /// The dimensions details for the vector configuration used on the Bedrock + /// embeddings model. + final int? dimensions; + + BedrockEmbeddingModelConfiguration({ + this.dimensions, + }); + + factory BedrockEmbeddingModelConfiguration.fromJson( + Map json) { + return BedrockEmbeddingModelConfiguration( + dimensions: json['dimensions'] as int?, + ); + } + + Map toJson() { + final dimensions = this.dimensions; + return { + if (dimensions != null) 'dimensions': dimensions, + }; + } +} + +/// Details about how to chunk the documents in the data source. A chunk +/// refers to an excerpt from a data source that is returned when the knowledge +/// base that it belongs to is queried. +class ChunkingConfiguration { + /// Knowledge base can split your source data into chunks. A chunk refers + /// to an excerpt from a data source that is returned when the knowledge base + /// that it belongs to is queried. You have the following options for chunking + /// your data. If you opt for NONE, then you may want to + /// pre-process your files by splitting them up such that each file corresponds + /// to a chunk. + /// + ///
      + ///
    • + /// FIXED_SIZE – Amazon Bedrock splits your source data into chunks + /// of the approximate size that you set in the + /// fixedSizeChunkingConfiguration. + ///
    • + ///
    • + /// NONE – Amazon Bedrock treats each file as one chunk. If you + /// choose this option, you may want to pre-process your documents by splitting + /// them into separate files. + ///
    • + ///
    + final ChunkingStrategy chunkingStrategy; + + /// Configurations for when you choose fixed-size chunking. If you set the + /// chunkingStrategy as NONE, exclude this field. + final FixedSizeChunkingConfiguration? fixedSizeChunkingConfiguration; + + ChunkingConfiguration({ + required this.chunkingStrategy, + this.fixedSizeChunkingConfiguration, + }); + + factory ChunkingConfiguration.fromJson(Map json) { + return ChunkingConfiguration( + chunkingStrategy: + (json['chunkingStrategy'] as String).toChunkingStrategy(), + fixedSizeChunkingConfiguration: json['fixedSizeChunkingConfiguration'] != + null + ? FixedSizeChunkingConfiguration.fromJson( + json['fixedSizeChunkingConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final chunkingStrategy = this.chunkingStrategy; + final fixedSizeChunkingConfiguration = this.fixedSizeChunkingConfiguration; + return { + 'chunkingStrategy': chunkingStrategy.toValue(), + if (fixedSizeChunkingConfiguration != null) + 'fixedSizeChunkingConfiguration': fixedSizeChunkingConfiguration, + }; + } +} + +enum ChunkingStrategy { + fixedSize, + none, +} + +extension ChunkingStrategyValueExtension on ChunkingStrategy { + String toValue() { + switch (this) { + case ChunkingStrategy.fixedSize: + return 'FIXED_SIZE'; + case ChunkingStrategy.none: + return 'NONE'; + } + } +} + +extension ChunkingStrategyFromString on String { + ChunkingStrategy toChunkingStrategy() { + switch (this) { + case 'FIXED_SIZE': + return ChunkingStrategy.fixedSize; + case 'NONE': + return ChunkingStrategy.none; + } + throw Exception('$this is not known in enum ChunkingStrategy'); + } +} + +class CreateAgentActionGroupResponse { + /// Contains details about the action group that was created. + final AgentActionGroup agentActionGroup; + + CreateAgentActionGroupResponse({ + required this.agentActionGroup, + }); + + factory CreateAgentActionGroupResponse.fromJson(Map json) { + return CreateAgentActionGroupResponse( + agentActionGroup: AgentActionGroup.fromJson( + json['agentActionGroup'] as Map), + ); + } + + Map toJson() { + final agentActionGroup = this.agentActionGroup; + return { + 'agentActionGroup': agentActionGroup, + }; + } +} + +class CreateAgentAliasResponse { + /// Contains details about the alias that was created. + final AgentAlias agentAlias; + + CreateAgentAliasResponse({ + required this.agentAlias, + }); + + factory CreateAgentAliasResponse.fromJson(Map json) { + return CreateAgentAliasResponse( + agentAlias: + AgentAlias.fromJson(json['agentAlias'] as Map), + ); + } + + Map toJson() { + final agentAlias = this.agentAlias; + return { + 'agentAlias': agentAlias, + }; + } +} + +class CreateAgentResponse { + /// Contains details about the agent created. + final Agent agent; + + CreateAgentResponse({ + required this.agent, + }); + + factory CreateAgentResponse.fromJson(Map json) { + return CreateAgentResponse( + agent: Agent.fromJson(json['agent'] as Map), + ); + } + + Map toJson() { + final agent = this.agent; + return { + 'agent': agent, + }; + } +} + +class CreateDataSourceResponse { + /// Contains details about the data source. + final DataSource dataSource; + + CreateDataSourceResponse({ + required this.dataSource, + }); + + factory CreateDataSourceResponse.fromJson(Map json) { + return CreateDataSourceResponse( + dataSource: + DataSource.fromJson(json['dataSource'] as Map), + ); + } + + Map toJson() { + final dataSource = this.dataSource; + return { + 'dataSource': dataSource, + }; + } +} + +class CreateKnowledgeBaseResponse { + /// Contains details about the knowledge base. + final KnowledgeBase knowledgeBase; + + CreateKnowledgeBaseResponse({ + required this.knowledgeBase, + }); + + factory CreateKnowledgeBaseResponse.fromJson(Map json) { + return CreateKnowledgeBaseResponse( + knowledgeBase: + KnowledgeBase.fromJson(json['knowledgeBase'] as Map), + ); + } + + Map toJson() { + final knowledgeBase = this.knowledgeBase; + return { + 'knowledgeBase': knowledgeBase, + }; + } +} + +enum CreationMode { + $default, + overridden, +} + +extension CreationModeValueExtension on CreationMode { + String toValue() { + switch (this) { + case CreationMode.$default: + return 'DEFAULT'; + case CreationMode.overridden: + return 'OVERRIDDEN'; + } + } +} + +extension CreationModeFromString on String { + CreationMode toCreationMode() { + switch (this) { + case 'DEFAULT': + return CreationMode.$default; + case 'OVERRIDDEN': + return CreationMode.overridden; + } + throw Exception('$this is not known in enum CreationMode'); + } +} + +enum CustomControlMethod { + returnControl, +} + +extension CustomControlMethodValueExtension on CustomControlMethod { + String toValue() { + switch (this) { + case CustomControlMethod.returnControl: + return 'RETURN_CONTROL'; + } + } +} + +extension CustomControlMethodFromString on String { + CustomControlMethod toCustomControlMethod() { + switch (this) { + case 'RETURN_CONTROL': + return CustomControlMethod.returnControl; + } + throw Exception('$this is not known in enum CustomControlMethod'); + } +} + +enum DataDeletionPolicy { + retain, + delete, +} + +extension DataDeletionPolicyValueExtension on DataDeletionPolicy { + String toValue() { + switch (this) { + case DataDeletionPolicy.retain: + return 'RETAIN'; + case DataDeletionPolicy.delete: + return 'DELETE'; + } + } +} + +extension DataDeletionPolicyFromString on String { + DataDeletionPolicy toDataDeletionPolicy() { + switch (this) { + case 'RETAIN': + return DataDeletionPolicy.retain; + case 'DELETE': + return DataDeletionPolicy.delete; + } + throw Exception('$this is not known in enum DataDeletionPolicy'); + } +} + +/// Contains details about a data source. +class DataSource { + /// The time at which the data source was created. + final DateTime createdAt; + + /// Contains details about how the data source is stored. + final DataSourceConfiguration dataSourceConfiguration; + + /// The unique identifier of the data source. + final String dataSourceId; + + /// The unique identifier of the knowledge base to which the data source + /// belongs. + final String knowledgeBaseId; + + /// The name of the data source. + final String name; + + /// The status of the data source. The following statuses are possible: + /// + ///
      + ///
    • + /// Available – The data source has been created and is ready for ingestion into + /// the knowledge base. + ///
    • + ///
    • + /// Deleting – The data source is being deleted. + ///
    • + ///
    + final DataSourceStatus status; + + /// The time at which the data source was last updated. + final DateTime updatedAt; + + /// The data deletion policy for a data source. + final DataDeletionPolicy? dataDeletionPolicy; + + /// The description of the data source. + final String? description; + + /// The detailed reasons on the failure to delete a data source. + final List? failureReasons; + + /// Contains details about the configuration of the server-side encryption. + final ServerSideEncryptionConfiguration? serverSideEncryptionConfiguration; + + /// Contains details about how to ingest the documents in the data source. + final VectorIngestionConfiguration? vectorIngestionConfiguration; + + DataSource({ + required this.createdAt, + required this.dataSourceConfiguration, + required this.dataSourceId, + required this.knowledgeBaseId, + required this.name, + required this.status, + required this.updatedAt, + this.dataDeletionPolicy, + this.description, + this.failureReasons, + this.serverSideEncryptionConfiguration, + this.vectorIngestionConfiguration, + }); + + factory DataSource.fromJson(Map json) { + return DataSource( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + dataSourceConfiguration: DataSourceConfiguration.fromJson( + json['dataSourceConfiguration'] as Map), + dataSourceId: json['dataSourceId'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toDataSourceStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + dataDeletionPolicy: + (json['dataDeletionPolicy'] as String?)?.toDataDeletionPolicy(), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + serverSideEncryptionConfiguration: + json['serverSideEncryptionConfiguration'] != null + ? ServerSideEncryptionConfiguration.fromJson( + json['serverSideEncryptionConfiguration'] + as Map) + : null, + vectorIngestionConfiguration: json['vectorIngestionConfiguration'] != null + ? VectorIngestionConfiguration.fromJson( + json['vectorIngestionConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final dataSourceConfiguration = this.dataSourceConfiguration; + final dataSourceId = this.dataSourceId; + final knowledgeBaseId = this.knowledgeBaseId; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final dataDeletionPolicy = this.dataDeletionPolicy; + final description = this.description; + final failureReasons = this.failureReasons; + final serverSideEncryptionConfiguration = + this.serverSideEncryptionConfiguration; + final vectorIngestionConfiguration = this.vectorIngestionConfiguration; + return { + 'createdAt': iso8601ToJson(createdAt), + 'dataSourceConfiguration': dataSourceConfiguration, + 'dataSourceId': dataSourceId, + 'knowledgeBaseId': knowledgeBaseId, + 'name': name, + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (dataDeletionPolicy != null) + 'dataDeletionPolicy': dataDeletionPolicy.toValue(), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (serverSideEncryptionConfiguration != null) + 'serverSideEncryptionConfiguration': serverSideEncryptionConfiguration, + if (vectorIngestionConfiguration != null) + 'vectorIngestionConfiguration': vectorIngestionConfiguration, + }; + } +} + +/// Contains details about how a data source is stored. +class DataSourceConfiguration { + /// The type of storage for the data source. + final DataSourceType type; + + /// Contains details about the configuration of the S3 object containing the + /// data source. + final S3DataSourceConfiguration? s3Configuration; + + DataSourceConfiguration({ + required this.type, + this.s3Configuration, + }); + + factory DataSourceConfiguration.fromJson(Map json) { + return DataSourceConfiguration( + type: (json['type'] as String).toDataSourceType(), + s3Configuration: json['s3Configuration'] != null + ? S3DataSourceConfiguration.fromJson( + json['s3Configuration'] as Map) + : null, + ); + } + + Map toJson() { + final type = this.type; + final s3Configuration = this.s3Configuration; + return { + 'type': type.toValue(), + if (s3Configuration != null) 's3Configuration': s3Configuration, + }; + } +} + +enum DataSourceStatus { + available, + deleting, + deleteUnsuccessful, +} + +extension DataSourceStatusValueExtension on DataSourceStatus { + String toValue() { + switch (this) { + case DataSourceStatus.available: + return 'AVAILABLE'; + case DataSourceStatus.deleting: + return 'DELETING'; + case DataSourceStatus.deleteUnsuccessful: + return 'DELETE_UNSUCCESSFUL'; + } + } +} + +extension DataSourceStatusFromString on String { + DataSourceStatus toDataSourceStatus() { + switch (this) { + case 'AVAILABLE': + return DataSourceStatus.available; + case 'DELETING': + return DataSourceStatus.deleting; + case 'DELETE_UNSUCCESSFUL': + return DataSourceStatus.deleteUnsuccessful; + } + throw Exception('$this is not known in enum DataSourceStatus'); + } +} + +/// Contains details about a data source. +class DataSourceSummary { + /// The unique identifier of the data source. + final String dataSourceId; + + /// The unique identifier of the knowledge base to which the data source + /// belongs. + final String knowledgeBaseId; + + /// The name of the data source. + final String name; + + /// The status of the data source. + final DataSourceStatus status; + + /// The time at which the data source was last updated. + final DateTime updatedAt; + + /// The description of the data source. + final String? description; + + DataSourceSummary({ + required this.dataSourceId, + required this.knowledgeBaseId, + required this.name, + required this.status, + required this.updatedAt, + this.description, + }); + + factory DataSourceSummary.fromJson(Map json) { + return DataSourceSummary( + dataSourceId: json['dataSourceId'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toDataSourceStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final dataSourceId = this.dataSourceId; + final knowledgeBaseId = this.knowledgeBaseId; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final description = this.description; + return { + 'dataSourceId': dataSourceId, + 'knowledgeBaseId': knowledgeBaseId, + 'name': name, + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + }; + } +} + +enum DataSourceType { + s3, +} + +extension DataSourceTypeValueExtension on DataSourceType { + String toValue() { + switch (this) { + case DataSourceType.s3: + return 'S3'; + } + } +} + +extension DataSourceTypeFromString on String { + DataSourceType toDataSourceType() { + switch (this) { + case 'S3': + return DataSourceType.s3; + } + throw Exception('$this is not known in enum DataSourceType'); + } +} + +class DeleteAgentActionGroupResponse { + DeleteAgentActionGroupResponse(); + + factory DeleteAgentActionGroupResponse.fromJson(Map _) { + return DeleteAgentActionGroupResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteAgentAliasResponse { + /// The unique identifier of the alias that was deleted. + final String agentAliasId; + + /// The status of the alias. + final AgentAliasStatus agentAliasStatus; + + /// The unique identifier of the agent that the alias belongs to. + final String agentId; + + DeleteAgentAliasResponse({ + required this.agentAliasId, + required this.agentAliasStatus, + required this.agentId, + }); + + factory DeleteAgentAliasResponse.fromJson(Map json) { + return DeleteAgentAliasResponse( + agentAliasId: json['agentAliasId'] as String, + agentAliasStatus: + (json['agentAliasStatus'] as String).toAgentAliasStatus(), + agentId: json['agentId'] as String, + ); + } + + Map toJson() { + final agentAliasId = this.agentAliasId; + final agentAliasStatus = this.agentAliasStatus; + final agentId = this.agentId; + return { + 'agentAliasId': agentAliasId, + 'agentAliasStatus': agentAliasStatus.toValue(), + 'agentId': agentId, + }; + } +} + +class DeleteAgentResponse { + /// The unique identifier of the agent that was deleted. + final String agentId; + + /// The status of the agent. + final AgentStatus agentStatus; + + DeleteAgentResponse({ + required this.agentId, + required this.agentStatus, + }); + + factory DeleteAgentResponse.fromJson(Map json) { + return DeleteAgentResponse( + agentId: json['agentId'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + ); + } + + Map toJson() { + final agentId = this.agentId; + final agentStatus = this.agentStatus; + return { + 'agentId': agentId, + 'agentStatus': agentStatus.toValue(), + }; + } +} + +class DeleteAgentVersionResponse { + /// The unique identifier of the agent that the version belongs to. + final String agentId; + + /// The status of the agent version. + final AgentStatus agentStatus; + + /// The version that was deleted. + final String agentVersion; + + DeleteAgentVersionResponse({ + required this.agentId, + required this.agentStatus, + required this.agentVersion, + }); + + factory DeleteAgentVersionResponse.fromJson(Map json) { + return DeleteAgentVersionResponse( + agentId: json['agentId'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + agentVersion: json['agentVersion'] as String, + ); + } + + Map toJson() { + final agentId = this.agentId; + final agentStatus = this.agentStatus; + final agentVersion = this.agentVersion; + return { + 'agentId': agentId, + 'agentStatus': agentStatus.toValue(), + 'agentVersion': agentVersion, + }; + } +} + +class DeleteDataSourceResponse { + /// The unique identifier of the data source that was deleted. + final String dataSourceId; + + /// The unique identifier of the knowledge base to which the data source that + /// was deleted belonged. + final String knowledgeBaseId; + + /// The status of the data source. + final DataSourceStatus status; + + DeleteDataSourceResponse({ + required this.dataSourceId, + required this.knowledgeBaseId, + required this.status, + }); + + factory DeleteDataSourceResponse.fromJson(Map json) { + return DeleteDataSourceResponse( + dataSourceId: json['dataSourceId'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + status: (json['status'] as String).toDataSourceStatus(), + ); + } + + Map toJson() { + final dataSourceId = this.dataSourceId; + final knowledgeBaseId = this.knowledgeBaseId; + final status = this.status; + return { + 'dataSourceId': dataSourceId, + 'knowledgeBaseId': knowledgeBaseId, + 'status': status.toValue(), + }; + } +} + +class DeleteKnowledgeBaseResponse { + /// The unique identifier of the knowledge base that was deleted. + final String knowledgeBaseId; + + /// The status of the knowledge base and whether it has been successfully + /// deleted. + final KnowledgeBaseStatus status; + + DeleteKnowledgeBaseResponse({ + required this.knowledgeBaseId, + required this.status, + }); + + factory DeleteKnowledgeBaseResponse.fromJson(Map json) { + return DeleteKnowledgeBaseResponse( + knowledgeBaseId: json['knowledgeBaseId'] as String, + status: (json['status'] as String).toKnowledgeBaseStatus(), + ); + } + + Map toJson() { + final knowledgeBaseId = this.knowledgeBaseId; + final status = this.status; + return { + 'knowledgeBaseId': knowledgeBaseId, + 'status': status.toValue(), + }; + } +} + +class DisassociateAgentKnowledgeBaseResponse { + DisassociateAgentKnowledgeBaseResponse(); + + factory DisassociateAgentKnowledgeBaseResponse.fromJson( + Map _) { + return DisassociateAgentKnowledgeBaseResponse(); + } + + Map toJson() { + return {}; + } +} + +/// The configuration details for the embeddings model. +class EmbeddingModelConfiguration { + /// The vector configuration details on the Bedrock embeddings model. + final BedrockEmbeddingModelConfiguration? bedrockEmbeddingModelConfiguration; + + EmbeddingModelConfiguration({ + this.bedrockEmbeddingModelConfiguration, + }); + + factory EmbeddingModelConfiguration.fromJson(Map json) { + return EmbeddingModelConfiguration( + bedrockEmbeddingModelConfiguration: + json['bedrockEmbeddingModelConfiguration'] != null + ? BedrockEmbeddingModelConfiguration.fromJson( + json['bedrockEmbeddingModelConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final bedrockEmbeddingModelConfiguration = + this.bedrockEmbeddingModelConfiguration; + return { + if (bedrockEmbeddingModelConfiguration != null) + 'bedrockEmbeddingModelConfiguration': + bedrockEmbeddingModelConfiguration, + }; + } +} + +/// Configurations for when you choose fixed-size chunking. If you set the +/// chunkingStrategy as NONE, exclude this field. +class FixedSizeChunkingConfiguration { + /// The maximum number of tokens to include in a chunk. + final int maxTokens; + + /// The percentage of overlap between adjacent chunks of a data source. + final int overlapPercentage; + + FixedSizeChunkingConfiguration({ + required this.maxTokens, + required this.overlapPercentage, + }); + + factory FixedSizeChunkingConfiguration.fromJson(Map json) { + return FixedSizeChunkingConfiguration( + maxTokens: json['maxTokens'] as int, + overlapPercentage: json['overlapPercentage'] as int, + ); + } + + Map toJson() { + final maxTokens = this.maxTokens; + final overlapPercentage = this.overlapPercentage; + return { + 'maxTokens': maxTokens, + 'overlapPercentage': overlapPercentage, + }; + } +} + +/// Defines parameters that the agent needs to invoke from the user to complete +/// the function. Corresponds to an action in an action group. +/// +/// This data type is used in the following API operations: +/// +/// +class $Function { + /// A name for the function. + final String name; + + /// A description of the function and its purpose. + final String? description; + + /// The parameters that the agent elicits from the user to fulfill the function. + final Map? parameters; + + $Function({ + required this.name, + this.description, + this.parameters, + }); + + factory $Function.fromJson(Map json) { + return $Function( + name: json['name'] as String, + description: json['description'] as String?, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, ParameterDetail.fromJson(e as Map))), + ); + } + + Map toJson() { + final name = this.name; + final description = this.description; + final parameters = this.parameters; + return { + 'name': name, + if (description != null) 'description': description, + if (parameters != null) 'parameters': parameters, + }; + } +} + +/// Defines functions that each define parameters that the agent needs to invoke +/// from the user. Each function represents an action in an action group. +/// +/// This data type is used in the following API operations: +/// +/// +class FunctionSchema { + /// A list of functions that each define an action in the action group. + final List<$Function>? functions; + + FunctionSchema({ + this.functions, + }); + + factory FunctionSchema.fromJson(Map json) { + return FunctionSchema( + functions: (json['functions'] as List?) + ?.whereNotNull() + .map((e) => $Function.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final functions = this.functions; + return { + if (functions != null) 'functions': functions, + }; + } +} + +class GetAgentActionGroupResponse { + /// Contains details about the action group. + final AgentActionGroup agentActionGroup; + + GetAgentActionGroupResponse({ + required this.agentActionGroup, + }); + + factory GetAgentActionGroupResponse.fromJson(Map json) { + return GetAgentActionGroupResponse( + agentActionGroup: AgentActionGroup.fromJson( + json['agentActionGroup'] as Map), + ); + } + + Map toJson() { + final agentActionGroup = this.agentActionGroup; + return { + 'agentActionGroup': agentActionGroup, + }; + } +} + +class GetAgentAliasResponse { + /// Contains information about the alias. + final AgentAlias agentAlias; + + GetAgentAliasResponse({ + required this.agentAlias, + }); + + factory GetAgentAliasResponse.fromJson(Map json) { + return GetAgentAliasResponse( + agentAlias: + AgentAlias.fromJson(json['agentAlias'] as Map), + ); + } + + Map toJson() { + final agentAlias = this.agentAlias; + return { + 'agentAlias': agentAlias, + }; + } +} + +class GetAgentKnowledgeBaseResponse { + /// Contains details about a knowledge base attached to an agent. + final AgentKnowledgeBase agentKnowledgeBase; + + GetAgentKnowledgeBaseResponse({ + required this.agentKnowledgeBase, + }); + + factory GetAgentKnowledgeBaseResponse.fromJson(Map json) { + return GetAgentKnowledgeBaseResponse( + agentKnowledgeBase: AgentKnowledgeBase.fromJson( + json['agentKnowledgeBase'] as Map), + ); + } + + Map toJson() { + final agentKnowledgeBase = this.agentKnowledgeBase; + return { + 'agentKnowledgeBase': agentKnowledgeBase, + }; + } +} + +class GetAgentResponse { + /// Contains details about the agent. + final Agent agent; + + GetAgentResponse({ + required this.agent, + }); + + factory GetAgentResponse.fromJson(Map json) { + return GetAgentResponse( + agent: Agent.fromJson(json['agent'] as Map), + ); + } + + Map toJson() { + final agent = this.agent; + return { + 'agent': agent, + }; + } +} + +class GetAgentVersionResponse { + /// Contains details about the version of the agent. + final AgentVersion agentVersion; + + GetAgentVersionResponse({ + required this.agentVersion, + }); + + factory GetAgentVersionResponse.fromJson(Map json) { + return GetAgentVersionResponse( + agentVersion: + AgentVersion.fromJson(json['agentVersion'] as Map), + ); + } + + Map toJson() { + final agentVersion = this.agentVersion; + return { + 'agentVersion': agentVersion, + }; + } +} + +class GetDataSourceResponse { + /// Contains details about the data source. + final DataSource dataSource; + + GetDataSourceResponse({ + required this.dataSource, + }); + + factory GetDataSourceResponse.fromJson(Map json) { + return GetDataSourceResponse( + dataSource: + DataSource.fromJson(json['dataSource'] as Map), + ); + } + + Map toJson() { + final dataSource = this.dataSource; + return { + 'dataSource': dataSource, + }; + } +} + +class GetIngestionJobResponse { + /// Contains details about the ingestion job. + final IngestionJob ingestionJob; + + GetIngestionJobResponse({ + required this.ingestionJob, + }); + + factory GetIngestionJobResponse.fromJson(Map json) { + return GetIngestionJobResponse( + ingestionJob: + IngestionJob.fromJson(json['ingestionJob'] as Map), + ); + } + + Map toJson() { + final ingestionJob = this.ingestionJob; + return { + 'ingestionJob': ingestionJob, + }; + } +} + +class GetKnowledgeBaseResponse { + /// Contains details about the knowledge base. + final KnowledgeBase knowledgeBase; + + GetKnowledgeBaseResponse({ + required this.knowledgeBase, + }); + + factory GetKnowledgeBaseResponse.fromJson(Map json) { + return GetKnowledgeBaseResponse( + knowledgeBase: + KnowledgeBase.fromJson(json['knowledgeBase'] as Map), + ); + } + + Map toJson() { + final knowledgeBase = this.knowledgeBase; + return { + 'knowledgeBase': knowledgeBase, + }; + } +} + +/// The details of the guardrails configuration. +class GuardrailConfiguration { + /// The guardrails identifier assigned to the guardrails configuration. + final String? guardrailIdentifier; + + /// The guardrails version assigned to the guardrails configuration. + final String? guardrailVersion; + + GuardrailConfiguration({ + this.guardrailIdentifier, + this.guardrailVersion, + }); + + factory GuardrailConfiguration.fromJson(Map json) { + return GuardrailConfiguration( + guardrailIdentifier: json['guardrailIdentifier'] as String?, + guardrailVersion: json['guardrailVersion'] as String?, + ); + } + + Map toJson() { + final guardrailIdentifier = this.guardrailIdentifier; + final guardrailVersion = this.guardrailVersion; + return { + if (guardrailIdentifier != null) + 'guardrailIdentifier': guardrailIdentifier, + if (guardrailVersion != null) 'guardrailVersion': guardrailVersion, + }; + } +} + +/// Contains inference parameters to use when the agent invokes a foundation +/// model in the part of the agent sequence defined by the +/// promptType. For more information, see Inference +/// parameters for foundation models. +class InferenceConfiguration { + /// The maximum number of tokens to allow in the generated response. + final int? maximumLength; + + /// A list of stop sequences. A stop sequence is a sequence of characters that + /// causes the model to stop generating the response. + final List? stopSequences; + + /// The likelihood of the model selecting higher-probability options while + /// generating a response. A lower value makes the model more likely to choose + /// higher-probability options, while a higher value makes the model more likely + /// to choose lower-probability options. + final double? temperature; + + /// While generating a response, the model determines the probability of the + /// following token at each point of generation. The value that you set for + /// topK is the number of most-likely candidates from which the + /// model chooses the next token in the sequence. For example, if you set + /// topK to 50, the model selects the next token from among the top + /// 50 most likely choices. + final int? topK; + + /// While generating a response, the model determines the probability of the + /// following token at each point of generation. The value that you set for + /// Top P determines the number of most-likely candidates from + /// which the model chooses the next token in the sequence. For example, if you + /// set topP to 80, the model only selects the next token from the + /// top 80% of the probability distribution of next tokens. + final double? topP; + + InferenceConfiguration({ + this.maximumLength, + this.stopSequences, + this.temperature, + this.topK, + this.topP, + }); + + factory InferenceConfiguration.fromJson(Map json) { + return InferenceConfiguration( + maximumLength: json['maximumLength'] as int?, + stopSequences: (json['stopSequences'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + temperature: json['temperature'] as double?, + topK: json['topK'] as int?, + topP: json['topP'] as double?, + ); + } + + Map toJson() { + final maximumLength = this.maximumLength; + final stopSequences = this.stopSequences; + final temperature = this.temperature; + final topK = this.topK; + final topP = this.topP; + return { + if (maximumLength != null) 'maximumLength': maximumLength, + if (stopSequences != null) 'stopSequences': stopSequences, + if (temperature != null) 'temperature': temperature, + if (topK != null) 'topK': topK, + if (topP != null) 'topP': topP, + }; + } +} + +/// Contains details about an ingestion job, which converts a data source to +/// embeddings for a vector store in knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class IngestionJob { + /// The unique identifier of the ingested data source. + final String dataSourceId; + + /// The unique identifier of the ingestion job. + final String ingestionJobId; + + /// The unique identifier of the knowledge base to which the data source is + /// being added. + final String knowledgeBaseId; + + /// The time at which the ingestion job started. + final DateTime startedAt; + + /// The status of the ingestion job. + final IngestionJobStatus status; + + /// The time at which the ingestion job was last updated. + final DateTime updatedAt; + + /// The description of the ingestion job. + final String? description; + + /// A list of reasons that the ingestion job failed. + final List? failureReasons; + + /// Contains statistics about the ingestion job. + final IngestionJobStatistics? statistics; + + IngestionJob({ + required this.dataSourceId, + required this.ingestionJobId, + required this.knowledgeBaseId, + required this.startedAt, + required this.status, + required this.updatedAt, + this.description, + this.failureReasons, + this.statistics, + }); + + factory IngestionJob.fromJson(Map json) { + return IngestionJob( + dataSourceId: json['dataSourceId'] as String, + ingestionJobId: json['ingestionJobId'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + startedAt: nonNullableTimeStampFromJson(json['startedAt'] as Object), + status: (json['status'] as String).toIngestionJobStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + statistics: json['statistics'] != null + ? IngestionJobStatistics.fromJson( + json['statistics'] as Map) + : null, + ); + } + + Map toJson() { + final dataSourceId = this.dataSourceId; + final ingestionJobId = this.ingestionJobId; + final knowledgeBaseId = this.knowledgeBaseId; + final startedAt = this.startedAt; + final status = this.status; + final updatedAt = this.updatedAt; + final description = this.description; + final failureReasons = this.failureReasons; + final statistics = this.statistics; + return { + 'dataSourceId': dataSourceId, + 'ingestionJobId': ingestionJobId, + 'knowledgeBaseId': knowledgeBaseId, + 'startedAt': iso8601ToJson(startedAt), + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (statistics != null) 'statistics': statistics, + }; + } +} + +/// Defines a filter by which to filter the results. +class IngestionJobFilter { + /// The attribute by which to filter the results. + final IngestionJobFilterAttribute attribute; + + /// The operation to carry out between the attribute and the values. + final IngestionJobFilterOperator operator; + + /// A list of values for the attribute. + final List values; + + IngestionJobFilter({ + required this.attribute, + required this.operator, + required this.values, + }); + + Map toJson() { + final attribute = this.attribute; + final operator = this.operator; + final values = this.values; + return { + 'attribute': attribute.toValue(), + 'operator': operator.toValue(), + 'values': values, + }; + } +} + +enum IngestionJobFilterAttribute { + status, +} + +extension IngestionJobFilterAttributeValueExtension + on IngestionJobFilterAttribute { + String toValue() { + switch (this) { + case IngestionJobFilterAttribute.status: + return 'STATUS'; + } + } +} + +extension IngestionJobFilterAttributeFromString on String { + IngestionJobFilterAttribute toIngestionJobFilterAttribute() { + switch (this) { + case 'STATUS': + return IngestionJobFilterAttribute.status; + } + throw Exception('$this is not known in enum IngestionJobFilterAttribute'); + } +} + +enum IngestionJobFilterOperator { + eq, +} + +extension IngestionJobFilterOperatorValueExtension + on IngestionJobFilterOperator { + String toValue() { + switch (this) { + case IngestionJobFilterOperator.eq: + return 'EQ'; + } + } +} + +extension IngestionJobFilterOperatorFromString on String { + IngestionJobFilterOperator toIngestionJobFilterOperator() { + switch (this) { + case 'EQ': + return IngestionJobFilterOperator.eq; + } + throw Exception('$this is not known in enum IngestionJobFilterOperator'); + } +} + +/// Parameters by which to sort the results. +class IngestionJobSortBy { + /// The attribute by which to sort the results. + final IngestionJobSortByAttribute attribute; + + /// The order by which to sort the results. + final SortOrder order; + + IngestionJobSortBy({ + required this.attribute, + required this.order, + }); + + Map toJson() { + final attribute = this.attribute; + final order = this.order; + return { + 'attribute': attribute.toValue(), + 'order': order.toValue(), + }; + } +} + +enum IngestionJobSortByAttribute { + status, + startedAt, +} + +extension IngestionJobSortByAttributeValueExtension + on IngestionJobSortByAttribute { + String toValue() { + switch (this) { + case IngestionJobSortByAttribute.status: + return 'STATUS'; + case IngestionJobSortByAttribute.startedAt: + return 'STARTED_AT'; + } + } +} + +extension IngestionJobSortByAttributeFromString on String { + IngestionJobSortByAttribute toIngestionJobSortByAttribute() { + switch (this) { + case 'STATUS': + return IngestionJobSortByAttribute.status; + case 'STARTED_AT': + return IngestionJobSortByAttribute.startedAt; + } + throw Exception('$this is not known in enum IngestionJobSortByAttribute'); + } +} + +/// Contains the statistics for the ingestion job. +class IngestionJobStatistics { + /// The number of source documents that was deleted. + final int? numberOfDocumentsDeleted; + + /// The number of source documents that failed to be ingested. + final int? numberOfDocumentsFailed; + + /// The total number of source documents that were scanned. Includes new, + /// updated, and unchanged documents. + final int? numberOfDocumentsScanned; + + /// The number of metadata files that were updated or deleted. + final int? numberOfMetadataDocumentsModified; + + /// The total number of metadata files that were scanned. Includes new, updated, + /// and unchanged files. + final int? numberOfMetadataDocumentsScanned; + + /// The number of modified source documents in the data source that were + /// successfully indexed. + final int? numberOfModifiedDocumentsIndexed; + + /// The number of new source documents in the data source that were successfully + /// indexed. + final int? numberOfNewDocumentsIndexed; + + IngestionJobStatistics({ + this.numberOfDocumentsDeleted, + this.numberOfDocumentsFailed, + this.numberOfDocumentsScanned, + this.numberOfMetadataDocumentsModified, + this.numberOfMetadataDocumentsScanned, + this.numberOfModifiedDocumentsIndexed, + this.numberOfNewDocumentsIndexed, + }); + + factory IngestionJobStatistics.fromJson(Map json) { + return IngestionJobStatistics( + numberOfDocumentsDeleted: json['numberOfDocumentsDeleted'] as int?, + numberOfDocumentsFailed: json['numberOfDocumentsFailed'] as int?, + numberOfDocumentsScanned: json['numberOfDocumentsScanned'] as int?, + numberOfMetadataDocumentsModified: + json['numberOfMetadataDocumentsModified'] as int?, + numberOfMetadataDocumentsScanned: + json['numberOfMetadataDocumentsScanned'] as int?, + numberOfModifiedDocumentsIndexed: + json['numberOfModifiedDocumentsIndexed'] as int?, + numberOfNewDocumentsIndexed: json['numberOfNewDocumentsIndexed'] as int?, + ); + } + + Map toJson() { + final numberOfDocumentsDeleted = this.numberOfDocumentsDeleted; + final numberOfDocumentsFailed = this.numberOfDocumentsFailed; + final numberOfDocumentsScanned = this.numberOfDocumentsScanned; + final numberOfMetadataDocumentsModified = + this.numberOfMetadataDocumentsModified; + final numberOfMetadataDocumentsScanned = + this.numberOfMetadataDocumentsScanned; + final numberOfModifiedDocumentsIndexed = + this.numberOfModifiedDocumentsIndexed; + final numberOfNewDocumentsIndexed = this.numberOfNewDocumentsIndexed; + return { + if (numberOfDocumentsDeleted != null) + 'numberOfDocumentsDeleted': numberOfDocumentsDeleted, + if (numberOfDocumentsFailed != null) + 'numberOfDocumentsFailed': numberOfDocumentsFailed, + if (numberOfDocumentsScanned != null) + 'numberOfDocumentsScanned': numberOfDocumentsScanned, + if (numberOfMetadataDocumentsModified != null) + 'numberOfMetadataDocumentsModified': numberOfMetadataDocumentsModified, + if (numberOfMetadataDocumentsScanned != null) + 'numberOfMetadataDocumentsScanned': numberOfMetadataDocumentsScanned, + if (numberOfModifiedDocumentsIndexed != null) + 'numberOfModifiedDocumentsIndexed': numberOfModifiedDocumentsIndexed, + if (numberOfNewDocumentsIndexed != null) + 'numberOfNewDocumentsIndexed': numberOfNewDocumentsIndexed, + }; + } +} + +enum IngestionJobStatus { + starting, + inProgress, + complete, + failed, +} + +extension IngestionJobStatusValueExtension on IngestionJobStatus { + String toValue() { + switch (this) { + case IngestionJobStatus.starting: + return 'STARTING'; + case IngestionJobStatus.inProgress: + return 'IN_PROGRESS'; + case IngestionJobStatus.complete: + return 'COMPLETE'; + case IngestionJobStatus.failed: + return 'FAILED'; + } + } +} + +extension IngestionJobStatusFromString on String { + IngestionJobStatus toIngestionJobStatus() { + switch (this) { + case 'STARTING': + return IngestionJobStatus.starting; + case 'IN_PROGRESS': + return IngestionJobStatus.inProgress; + case 'COMPLETE': + return IngestionJobStatus.complete; + case 'FAILED': + return IngestionJobStatus.failed; + } + throw Exception('$this is not known in enum IngestionJobStatus'); + } +} + +/// Contains details about an ingestion job. +class IngestionJobSummary { + /// The unique identifier of the data source in the ingestion job. + final String dataSourceId; + + /// The unique identifier of the ingestion job. + final String ingestionJobId; + + /// The unique identifier of the knowledge base to which the data source is + /// added. + final String knowledgeBaseId; + + /// The time at which the ingestion job was started. + final DateTime startedAt; + + /// The status of the ingestion job. + final IngestionJobStatus status; + + /// The time at which the ingestion job was last updated. + final DateTime updatedAt; + + /// The description of the ingestion job. + final String? description; + + /// Contains statistics for the ingestion job. + final IngestionJobStatistics? statistics; + + IngestionJobSummary({ + required this.dataSourceId, + required this.ingestionJobId, + required this.knowledgeBaseId, + required this.startedAt, + required this.status, + required this.updatedAt, + this.description, + this.statistics, + }); + + factory IngestionJobSummary.fromJson(Map json) { + return IngestionJobSummary( + dataSourceId: json['dataSourceId'] as String, + ingestionJobId: json['ingestionJobId'] as String, + knowledgeBaseId: json['knowledgeBaseId'] as String, + startedAt: nonNullableTimeStampFromJson(json['startedAt'] as Object), + status: (json['status'] as String).toIngestionJobStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + statistics: json['statistics'] != null + ? IngestionJobStatistics.fromJson( + json['statistics'] as Map) + : null, + ); + } + + Map toJson() { + final dataSourceId = this.dataSourceId; + final ingestionJobId = this.ingestionJobId; + final knowledgeBaseId = this.knowledgeBaseId; + final startedAt = this.startedAt; + final status = this.status; + final updatedAt = this.updatedAt; + final description = this.description; + final statistics = this.statistics; + return { + 'dataSourceId': dataSourceId, + 'ingestionJobId': ingestionJobId, + 'knowledgeBaseId': knowledgeBaseId, + 'startedAt': iso8601ToJson(startedAt), + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (statistics != null) 'statistics': statistics, + }; + } +} + +/// Contains information about a knowledge base. +class KnowledgeBase { + /// The time at which the knowledge base was created. + final DateTime createdAt; + + /// The Amazon Resource Name (ARN) of the knowledge base. + final String knowledgeBaseArn; + + /// Contains details about the embeddings configuration of the knowledge base. + final KnowledgeBaseConfiguration knowledgeBaseConfiguration; + + /// The unique identifier of the knowledge base. + final String knowledgeBaseId; + + /// The name of the knowledge base. + final String name; + + /// The Amazon Resource Name (ARN) of the IAM role with permissions to invoke + /// API operations on the knowledge base. + final String roleArn; + + /// The status of the knowledge base. The following statuses are possible: + /// + ///
      + ///
    • + /// CREATING – The knowledge base is being created. + ///
    • + ///
    • + /// ACTIVE – The knowledge base is ready to be queried. + ///
    • + ///
    • + /// DELETING – The knowledge base is being deleted. + ///
    • + ///
    • + /// UPDATING – The knowledge base is being updated. + ///
    • + ///
    • + /// FAILED – The knowledge base API operation failed. + ///
    • + ///
    + final KnowledgeBaseStatus status; + + /// Contains details about the storage configuration of the knowledge base. + final StorageConfiguration storageConfiguration; + + /// The time at which the knowledge base was last updated. + final DateTime updatedAt; + + /// The description of the knowledge base. + final String? description; + + /// A list of reasons that the API operation on the knowledge base failed. + final List? failureReasons; + + KnowledgeBase({ + required this.createdAt, + required this.knowledgeBaseArn, + required this.knowledgeBaseConfiguration, + required this.knowledgeBaseId, + required this.name, + required this.roleArn, + required this.status, + required this.storageConfiguration, + required this.updatedAt, + this.description, + this.failureReasons, + }); + + factory KnowledgeBase.fromJson(Map json) { + return KnowledgeBase( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + knowledgeBaseArn: json['knowledgeBaseArn'] as String, + knowledgeBaseConfiguration: KnowledgeBaseConfiguration.fromJson( + json['knowledgeBaseConfiguration'] as Map), + knowledgeBaseId: json['knowledgeBaseId'] as String, + name: json['name'] as String, + roleArn: json['roleArn'] as String, + status: (json['status'] as String).toKnowledgeBaseStatus(), + storageConfiguration: StorageConfiguration.fromJson( + json['storageConfiguration'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final knowledgeBaseArn = this.knowledgeBaseArn; + final knowledgeBaseConfiguration = this.knowledgeBaseConfiguration; + final knowledgeBaseId = this.knowledgeBaseId; + final name = this.name; + final roleArn = this.roleArn; + final status = this.status; + final storageConfiguration = this.storageConfiguration; + final updatedAt = this.updatedAt; + final description = this.description; + final failureReasons = this.failureReasons; + return { + 'createdAt': iso8601ToJson(createdAt), + 'knowledgeBaseArn': knowledgeBaseArn, + 'knowledgeBaseConfiguration': knowledgeBaseConfiguration, + 'knowledgeBaseId': knowledgeBaseId, + 'name': name, + 'roleArn': roleArn, + 'status': status.toValue(), + 'storageConfiguration': storageConfiguration, + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + }; + } +} + +/// Contains details about the embeddings configuration of the knowledge base. +class KnowledgeBaseConfiguration { + /// The type of data that the data source is converted into for the knowledge + /// base. + final KnowledgeBaseType type; + + /// Contains details about the embeddings model that'sused to convert the data + /// source. + final VectorKnowledgeBaseConfiguration? vectorKnowledgeBaseConfiguration; + + KnowledgeBaseConfiguration({ + required this.type, + this.vectorKnowledgeBaseConfiguration, + }); + + factory KnowledgeBaseConfiguration.fromJson(Map json) { + return KnowledgeBaseConfiguration( + type: (json['type'] as String).toKnowledgeBaseType(), + vectorKnowledgeBaseConfiguration: + json['vectorKnowledgeBaseConfiguration'] != null + ? VectorKnowledgeBaseConfiguration.fromJson( + json['vectorKnowledgeBaseConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final type = this.type; + final vectorKnowledgeBaseConfiguration = + this.vectorKnowledgeBaseConfiguration; + return { + 'type': type.toValue(), + if (vectorKnowledgeBaseConfiguration != null) + 'vectorKnowledgeBaseConfiguration': vectorKnowledgeBaseConfiguration, + }; + } +} + +enum KnowledgeBaseState { + enabled, + disabled, +} + +extension KnowledgeBaseStateValueExtension on KnowledgeBaseState { + String toValue() { + switch (this) { + case KnowledgeBaseState.enabled: + return 'ENABLED'; + case KnowledgeBaseState.disabled: + return 'DISABLED'; + } + } +} + +extension KnowledgeBaseStateFromString on String { + KnowledgeBaseState toKnowledgeBaseState() { + switch (this) { + case 'ENABLED': + return KnowledgeBaseState.enabled; + case 'DISABLED': + return KnowledgeBaseState.disabled; + } + throw Exception('$this is not known in enum KnowledgeBaseState'); + } +} + +enum KnowledgeBaseStatus { + creating, + active, + deleting, + updating, + failed, + deleteUnsuccessful, +} + +extension KnowledgeBaseStatusValueExtension on KnowledgeBaseStatus { + String toValue() { + switch (this) { + case KnowledgeBaseStatus.creating: + return 'CREATING'; + case KnowledgeBaseStatus.active: + return 'ACTIVE'; + case KnowledgeBaseStatus.deleting: + return 'DELETING'; + case KnowledgeBaseStatus.updating: + return 'UPDATING'; + case KnowledgeBaseStatus.failed: + return 'FAILED'; + case KnowledgeBaseStatus.deleteUnsuccessful: + return 'DELETE_UNSUCCESSFUL'; + } + } +} + +extension KnowledgeBaseStatusFromString on String { + KnowledgeBaseStatus toKnowledgeBaseStatus() { + switch (this) { + case 'CREATING': + return KnowledgeBaseStatus.creating; + case 'ACTIVE': + return KnowledgeBaseStatus.active; + case 'DELETING': + return KnowledgeBaseStatus.deleting; + case 'UPDATING': + return KnowledgeBaseStatus.updating; + case 'FAILED': + return KnowledgeBaseStatus.failed; + case 'DELETE_UNSUCCESSFUL': + return KnowledgeBaseStatus.deleteUnsuccessful; + } + throw Exception('$this is not known in enum KnowledgeBaseStatus'); + } +} + +enum KnowledgeBaseStorageType { + opensearchServerless, + pinecone, + redisEnterpriseCloud, + rds, + mongoDbAtlas, +} + +extension KnowledgeBaseStorageTypeValueExtension on KnowledgeBaseStorageType { + String toValue() { + switch (this) { + case KnowledgeBaseStorageType.opensearchServerless: + return 'OPENSEARCH_SERVERLESS'; + case KnowledgeBaseStorageType.pinecone: + return 'PINECONE'; + case KnowledgeBaseStorageType.redisEnterpriseCloud: + return 'REDIS_ENTERPRISE_CLOUD'; + case KnowledgeBaseStorageType.rds: + return 'RDS'; + case KnowledgeBaseStorageType.mongoDbAtlas: + return 'MONGO_DB_ATLAS'; + } + } +} + +extension KnowledgeBaseStorageTypeFromString on String { + KnowledgeBaseStorageType toKnowledgeBaseStorageType() { + switch (this) { + case 'OPENSEARCH_SERVERLESS': + return KnowledgeBaseStorageType.opensearchServerless; + case 'PINECONE': + return KnowledgeBaseStorageType.pinecone; + case 'REDIS_ENTERPRISE_CLOUD': + return KnowledgeBaseStorageType.redisEnterpriseCloud; + case 'RDS': + return KnowledgeBaseStorageType.rds; + case 'MONGO_DB_ATLAS': + return KnowledgeBaseStorageType.mongoDbAtlas; + } + throw Exception('$this is not known in enum KnowledgeBaseStorageType'); + } +} + +/// Contains details about a knowledge base. +class KnowledgeBaseSummary { + /// The unique identifier of the knowledge base. + final String knowledgeBaseId; + + /// The name of the knowledge base. + final String name; + + /// The status of the knowledge base. + final KnowledgeBaseStatus status; + + /// The time at which the knowledge base was last updated. + final DateTime updatedAt; + + /// The description of the knowledge base. + final String? description; + + KnowledgeBaseSummary({ + required this.knowledgeBaseId, + required this.name, + required this.status, + required this.updatedAt, + this.description, + }); + + factory KnowledgeBaseSummary.fromJson(Map json) { + return KnowledgeBaseSummary( + knowledgeBaseId: json['knowledgeBaseId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toKnowledgeBaseStatus(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final knowledgeBaseId = this.knowledgeBaseId; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final description = this.description; + return { + 'knowledgeBaseId': knowledgeBaseId, + 'name': name, + 'status': status.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (description != null) 'description': description, + }; + } +} + +enum KnowledgeBaseType { + vector, +} + +extension KnowledgeBaseTypeValueExtension on KnowledgeBaseType { + String toValue() { + switch (this) { + case KnowledgeBaseType.vector: + return 'VECTOR'; + } + } +} + +extension KnowledgeBaseTypeFromString on String { + KnowledgeBaseType toKnowledgeBaseType() { + switch (this) { + case 'VECTOR': + return KnowledgeBaseType.vector; + } + throw Exception('$this is not known in enum KnowledgeBaseType'); + } +} + +class ListAgentActionGroupsResponse { + /// A list of objects, each of which contains information about an action group. + final List actionGroupSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListAgentActionGroupsResponse({ + required this.actionGroupSummaries, + this.nextToken, + }); + + factory ListAgentActionGroupsResponse.fromJson(Map json) { + return ListAgentActionGroupsResponse( + actionGroupSummaries: (json['actionGroupSummaries'] as List) + .whereNotNull() + .map((e) => ActionGroupSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final actionGroupSummaries = this.actionGroupSummaries; + final nextToken = this.nextToken; + return { + 'actionGroupSummaries': actionGroupSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAgentAliasesResponse { + /// A list of objects, each of which contains information about an alias of the + /// agent. + final List agentAliasSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListAgentAliasesResponse({ + required this.agentAliasSummaries, + this.nextToken, + }); + + factory ListAgentAliasesResponse.fromJson(Map json) { + return ListAgentAliasesResponse( + agentAliasSummaries: (json['agentAliasSummaries'] as List) + .whereNotNull() + .map((e) => AgentAliasSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final agentAliasSummaries = this.agentAliasSummaries; + final nextToken = this.nextToken; + return { + 'agentAliasSummaries': agentAliasSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAgentKnowledgeBasesResponse { + /// A list of objects, each of which contains information about a knowledge base + /// associated with the agent. + final List agentKnowledgeBaseSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListAgentKnowledgeBasesResponse({ + required this.agentKnowledgeBaseSummaries, + this.nextToken, + }); + + factory ListAgentKnowledgeBasesResponse.fromJson(Map json) { + return ListAgentKnowledgeBasesResponse( + agentKnowledgeBaseSummaries: (json['agentKnowledgeBaseSummaries'] as List) + .whereNotNull() + .map((e) => + AgentKnowledgeBaseSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final agentKnowledgeBaseSummaries = this.agentKnowledgeBaseSummaries; + final nextToken = this.nextToken; + return { + 'agentKnowledgeBaseSummaries': agentKnowledgeBaseSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAgentVersionsResponse { + /// A list of objects, each of which contains information about a version of the + /// agent. + final List agentVersionSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListAgentVersionsResponse({ + required this.agentVersionSummaries, + this.nextToken, + }); + + factory ListAgentVersionsResponse.fromJson(Map json) { + return ListAgentVersionsResponse( + agentVersionSummaries: (json['agentVersionSummaries'] as List) + .whereNotNull() + .map((e) => AgentVersionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final agentVersionSummaries = this.agentVersionSummaries; + final nextToken = this.nextToken; + return { + 'agentVersionSummaries': agentVersionSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAgentsResponse { + /// A list of objects, each of which contains information about an agent. + final List agentSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListAgentsResponse({ + required this.agentSummaries, + this.nextToken, + }); + + factory ListAgentsResponse.fromJson(Map json) { + return ListAgentsResponse( + agentSummaries: (json['agentSummaries'] as List) + .whereNotNull() + .map((e) => AgentSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final agentSummaries = this.agentSummaries; + final nextToken = this.nextToken; + return { + 'agentSummaries': agentSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListDataSourcesResponse { + /// A list of objects, each of which contains information about a data source. + final List dataSourceSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListDataSourcesResponse({ + required this.dataSourceSummaries, + this.nextToken, + }); + + factory ListDataSourcesResponse.fromJson(Map json) { + return ListDataSourcesResponse( + dataSourceSummaries: (json['dataSourceSummaries'] as List) + .whereNotNull() + .map((e) => DataSourceSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final dataSourceSummaries = this.dataSourceSummaries; + final nextToken = this.nextToken; + return { + 'dataSourceSummaries': dataSourceSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListIngestionJobsResponse { + /// A list of objects, each of which contains information about an ingestion + /// job. + final List ingestionJobSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListIngestionJobsResponse({ + required this.ingestionJobSummaries, + this.nextToken, + }); + + factory ListIngestionJobsResponse.fromJson(Map json) { + return ListIngestionJobsResponse( + ingestionJobSummaries: (json['ingestionJobSummaries'] as List) + .whereNotNull() + .map((e) => IngestionJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final ingestionJobSummaries = this.ingestionJobSummaries; + final nextToken = this.nextToken; + return { + 'ingestionJobSummaries': ingestionJobSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListKnowledgeBasesResponse { + /// A list of objects, each of which contains information about a knowledge + /// base. + final List knowledgeBaseSummaries; + + /// If the total number of results is greater than the maxResults + /// value provided in the request, use this token when making another request in + /// the nextToken field to return the next batch of results. + final String? nextToken; + + ListKnowledgeBasesResponse({ + required this.knowledgeBaseSummaries, + this.nextToken, + }); + + factory ListKnowledgeBasesResponse.fromJson(Map json) { + return ListKnowledgeBasesResponse( + knowledgeBaseSummaries: (json['knowledgeBaseSummaries'] as List) + .whereNotNull() + .map((e) => KnowledgeBaseSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final knowledgeBaseSummaries = this.knowledgeBaseSummaries; + final nextToken = this.nextToken; + return { + 'knowledgeBaseSummaries': knowledgeBaseSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// The key-value pairs for the tags associated with the resource. + final Map? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +/// Contains details about the storage configuration of the knowledge base in +/// MongoDB Atlas. +class MongoDbAtlasConfiguration { + /// The collection name of the knowledge base in MongoDB Atlas. + final String collectionName; + + /// The Amazon Resource Name (ARN) of the secret that you created in Secrets + /// Manager that contains user credentials for your MongoDB Atlas cluster. + final String credentialsSecretArn; + + /// The database name in your MongoDB Atlas cluster for your knowledge base. + final String databaseName; + + /// The endpoint URL of your MongoDB Atlas cluster for your knowledge base. + final String endpoint; + + /// Contains the names of the fields to which to map information about the + /// vector store. + final MongoDbAtlasFieldMapping fieldMapping; + + /// The name of the MongoDB Atlas vector search index. + final String vectorIndexName; + + /// The name of the VPC endpoint service in your account that is connected to + /// your MongoDB Atlas cluster. + final String? endpointServiceName; + + MongoDbAtlasConfiguration({ + required this.collectionName, + required this.credentialsSecretArn, + required this.databaseName, + required this.endpoint, + required this.fieldMapping, + required this.vectorIndexName, + this.endpointServiceName, + }); + + factory MongoDbAtlasConfiguration.fromJson(Map json) { + return MongoDbAtlasConfiguration( + collectionName: json['collectionName'] as String, + credentialsSecretArn: json['credentialsSecretArn'] as String, + databaseName: json['databaseName'] as String, + endpoint: json['endpoint'] as String, + fieldMapping: MongoDbAtlasFieldMapping.fromJson( + json['fieldMapping'] as Map), + vectorIndexName: json['vectorIndexName'] as String, + endpointServiceName: json['endpointServiceName'] as String?, + ); + } + + Map toJson() { + final collectionName = this.collectionName; + final credentialsSecretArn = this.credentialsSecretArn; + final databaseName = this.databaseName; + final endpoint = this.endpoint; + final fieldMapping = this.fieldMapping; + final vectorIndexName = this.vectorIndexName; + final endpointServiceName = this.endpointServiceName; + return { + 'collectionName': collectionName, + 'credentialsSecretArn': credentialsSecretArn, + 'databaseName': databaseName, + 'endpoint': endpoint, + 'fieldMapping': fieldMapping, + 'vectorIndexName': vectorIndexName, + if (endpointServiceName != null) + 'endpointServiceName': endpointServiceName, + }; + } +} + +/// Contains the names of the fields to which to map information about the +/// vector store. +class MongoDbAtlasFieldMapping { + /// The name of the field in which Amazon Bedrock stores metadata about the + /// vector store. + final String metadataField; + + /// The name of the field in which Amazon Bedrock stores the raw text from your + /// data. The text is split according to the chunking strategy you choose. + final String textField; + + /// The name of the field in which Amazon Bedrock stores the vector embeddings + /// for your data sources. + final String vectorField; + + MongoDbAtlasFieldMapping({ + required this.metadataField, + required this.textField, + required this.vectorField, + }); + + factory MongoDbAtlasFieldMapping.fromJson(Map json) { + return MongoDbAtlasFieldMapping( + metadataField: json['metadataField'] as String, + textField: json['textField'] as String, + vectorField: json['vectorField'] as String, + ); + } + + Map toJson() { + final metadataField = this.metadataField; + final textField = this.textField; + final vectorField = this.vectorField; + return { + 'metadataField': metadataField, + 'textField': textField, + 'vectorField': vectorField, + }; + } +} + +/// Contains details about the storage configuration of the knowledge base in +/// Amazon OpenSearch Service. For more information, see Create +/// a vector index in Amazon OpenSearch Service. +class OpenSearchServerlessConfiguration { + /// The Amazon Resource Name (ARN) of the OpenSearch Service vector store. + final String collectionArn; + + /// Contains the names of the fields to which to map information about the + /// vector store. + final OpenSearchServerlessFieldMapping fieldMapping; + + /// The name of the vector store. + final String vectorIndexName; + + OpenSearchServerlessConfiguration({ + required this.collectionArn, + required this.fieldMapping, + required this.vectorIndexName, + }); + + factory OpenSearchServerlessConfiguration.fromJson( + Map json) { + return OpenSearchServerlessConfiguration( + collectionArn: json['collectionArn'] as String, + fieldMapping: OpenSearchServerlessFieldMapping.fromJson( + json['fieldMapping'] as Map), + vectorIndexName: json['vectorIndexName'] as String, + ); + } + + Map toJson() { + final collectionArn = this.collectionArn; + final fieldMapping = this.fieldMapping; + final vectorIndexName = this.vectorIndexName; + return { + 'collectionArn': collectionArn, + 'fieldMapping': fieldMapping, + 'vectorIndexName': vectorIndexName, + }; + } +} + +/// Contains the names of the fields to which to map information about the +/// vector store. +class OpenSearchServerlessFieldMapping { + /// The name of the field in which Amazon Bedrock stores metadata about the + /// vector store. + final String metadataField; + + /// The name of the field in which Amazon Bedrock stores the raw text from your + /// data. The text is split according to the chunking strategy you choose. + final String textField; + + /// The name of the field in which Amazon Bedrock stores the vector embeddings + /// for your data sources. + final String vectorField; + + OpenSearchServerlessFieldMapping({ + required this.metadataField, + required this.textField, + required this.vectorField, + }); + + factory OpenSearchServerlessFieldMapping.fromJson(Map json) { + return OpenSearchServerlessFieldMapping( + metadataField: json['metadataField'] as String, + textField: json['textField'] as String, + vectorField: json['vectorField'] as String, + ); + } + + Map toJson() { + final metadataField = this.metadataField; + final textField = this.textField; + final vectorField = this.vectorField; + return { + 'metadataField': metadataField, + 'textField': textField, + 'vectorField': vectorField, + }; + } +} + +/// Contains details about a parameter in a function for an action group. +/// +/// This data type is used in the following API operations: +/// +/// +class ParameterDetail { + /// The data type of the parameter. + final Type type; + + /// A description of the parameter. Helps the foundation model determine how to + /// elicit the parameters from the user. + final String? description; + + /// Whether the parameter is required for the agent to complete the function for + /// action group invocation. + final bool? required; + + ParameterDetail({ + required this.type, + this.description, + this.required, + }); + + factory ParameterDetail.fromJson(Map json) { + return ParameterDetail( + type: (json['type'] as String).toType(), + description: json['description'] as String?, + required: json['required'] as bool?, + ); + } + + Map toJson() { + final type = this.type; + final description = this.description; + final required = this.required; + return { + 'type': type.toValue(), + if (description != null) 'description': description, + if (required != null) 'required': required, + }; + } +} + +/// Contains details about the storage configuration of the knowledge base in +/// Pinecone. For more information, see Create +/// a vector index in Pinecone. +class PineconeConfiguration { + /// The endpoint URL for your index management page. + final String connectionString; + + /// The Amazon Resource Name (ARN) of the secret that you created in Secrets + /// Manager that is linked to your Pinecone API key. + final String credentialsSecretArn; + + /// Contains the names of the fields to which to map information about the + /// vector store. + final PineconeFieldMapping fieldMapping; + + /// The namespace to be used to write new data to your database. + final String? namespace; + + PineconeConfiguration({ + required this.connectionString, + required this.credentialsSecretArn, + required this.fieldMapping, + this.namespace, + }); + + factory PineconeConfiguration.fromJson(Map json) { + return PineconeConfiguration( + connectionString: json['connectionString'] as String, + credentialsSecretArn: json['credentialsSecretArn'] as String, + fieldMapping: PineconeFieldMapping.fromJson( + json['fieldMapping'] as Map), + namespace: json['namespace'] as String?, + ); + } + + Map toJson() { + final connectionString = this.connectionString; + final credentialsSecretArn = this.credentialsSecretArn; + final fieldMapping = this.fieldMapping; + final namespace = this.namespace; + return { + 'connectionString': connectionString, + 'credentialsSecretArn': credentialsSecretArn, + 'fieldMapping': fieldMapping, + if (namespace != null) 'namespace': namespace, + }; + } +} + +/// Contains the names of the fields to which to map information about the +/// vector store. +class PineconeFieldMapping { + /// The name of the field in which Amazon Bedrock stores metadata about the + /// vector store. + final String metadataField; + + /// The name of the field in which Amazon Bedrock stores the raw text from your + /// data. The text is split according to the chunking strategy you choose. + final String textField; + + PineconeFieldMapping({ + required this.metadataField, + required this.textField, + }); + + factory PineconeFieldMapping.fromJson(Map json) { + return PineconeFieldMapping( + metadataField: json['metadataField'] as String, + textField: json['textField'] as String, + ); + } + + Map toJson() { + final metadataField = this.metadataField; + final textField = this.textField; + return { + 'metadataField': metadataField, + 'textField': textField, + }; + } +} + +class PrepareAgentResponse { + /// The unique identifier of the agent for which the DRAFT version + /// was created. + final String agentId; + + /// The status of the DRAFT version and whether it is ready for + /// use. + final AgentStatus agentStatus; + + /// The version of the agent. + final String agentVersion; + + /// The time at which the DRAFT version of the agent was last + /// prepared. + final DateTime preparedAt; + + PrepareAgentResponse({ + required this.agentId, + required this.agentStatus, + required this.agentVersion, + required this.preparedAt, + }); + + factory PrepareAgentResponse.fromJson(Map json) { + return PrepareAgentResponse( + agentId: json['agentId'] as String, + agentStatus: (json['agentStatus'] as String).toAgentStatus(), + agentVersion: json['agentVersion'] as String, + preparedAt: nonNullableTimeStampFromJson(json['preparedAt'] as Object), + ); + } + + Map toJson() { + final agentId = this.agentId; + final agentStatus = this.agentStatus; + final agentVersion = this.agentVersion; + final preparedAt = this.preparedAt; + return { + 'agentId': agentId, + 'agentStatus': agentStatus.toValue(), + 'agentVersion': agentVersion, + 'preparedAt': iso8601ToJson(preparedAt), + }; + } +} + +/// Contains configurations to override a prompt template in one part of an +/// agent sequence. For more information, see Advanced +/// prompts. +class PromptConfiguration { + /// Defines the prompt template with which to replace the default prompt + /// template. You can use placeholder variables in the base prompt template to + /// customize the prompt. For more information, see Prompt + /// template placeholder variables. For more information, see Configure + /// the prompt templates. + final String? basePromptTemplate; + + /// Contains inference parameters to use when the agent invokes a foundation + /// model in the part of the agent sequence defined by the + /// promptType. For more information, see Inference + /// parameters for foundation models. + final InferenceConfiguration? inferenceConfiguration; + + /// Specifies whether to override the default parser Lambda function when + /// parsing the raw foundation model output in the part of the agent sequence + /// defined by the promptType. If you set the field as + /// OVERRIDEN, the overrideLambda field in the PromptOverrideConfiguration + /// must be specified with the ARN of a Lambda function. + final CreationMode? parserMode; + + /// Specifies whether to override the default prompt template for this + /// promptType. Set this value to OVERRIDDEN to use + /// the prompt that you provide in the basePromptTemplate. If you + /// leave it as DEFAULT, the agent uses a default prompt template. + final CreationMode? promptCreationMode; + + /// Specifies whether to allow the agent to carry out the step specified in the + /// promptType. If you set this value to DISABLED, the + /// agent skips that step. The default state for each promptType is + /// as follows. + /// + ///
      + ///
    • + /// PRE_PROCESSINGENABLED + ///
    • + ///
    • + /// ORCHESTRATIONENABLED + ///
    • + ///
    • + /// KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED + ///
    • + ///
    • + /// POST_PROCESSINGDISABLED + ///
    • + ///
    + final PromptState? promptState; + + /// The step in the agent sequence that this prompt configuration applies to. + final PromptType? promptType; + + PromptConfiguration({ + this.basePromptTemplate, + this.inferenceConfiguration, + this.parserMode, + this.promptCreationMode, + this.promptState, + this.promptType, + }); + + factory PromptConfiguration.fromJson(Map json) { + return PromptConfiguration( + basePromptTemplate: json['basePromptTemplate'] as String?, + inferenceConfiguration: json['inferenceConfiguration'] != null + ? InferenceConfiguration.fromJson( + json['inferenceConfiguration'] as Map) + : null, + parserMode: (json['parserMode'] as String?)?.toCreationMode(), + promptCreationMode: + (json['promptCreationMode'] as String?)?.toCreationMode(), + promptState: (json['promptState'] as String?)?.toPromptState(), + promptType: (json['promptType'] as String?)?.toPromptType(), + ); + } + + Map toJson() { + final basePromptTemplate = this.basePromptTemplate; + final inferenceConfiguration = this.inferenceConfiguration; + final parserMode = this.parserMode; + final promptCreationMode = this.promptCreationMode; + final promptState = this.promptState; + final promptType = this.promptType; + return { + if (basePromptTemplate != null) 'basePromptTemplate': basePromptTemplate, + if (inferenceConfiguration != null) + 'inferenceConfiguration': inferenceConfiguration, + if (parserMode != null) 'parserMode': parserMode.toValue(), + if (promptCreationMode != null) + 'promptCreationMode': promptCreationMode.toValue(), + if (promptState != null) 'promptState': promptState.toValue(), + if (promptType != null) 'promptType': promptType.toValue(), + }; + } +} + +/// Contains configurations to override prompts in different parts of an agent +/// sequence. For more information, see Advanced +/// prompts. +class PromptOverrideConfiguration { + /// Contains configurations to override a prompt template in one part of an + /// agent sequence. For more information, see Advanced + /// prompts. + final List promptConfigurations; + + /// The ARN of the Lambda function to use when parsing the raw foundation model + /// output in parts of the agent sequence. If you specify this field, at least + /// one of the promptConfigurations must contain a + /// parserMode value that is set to OVERRIDDEN. For + /// more information, see Parser + /// Lambda function in Agents for Amazon Bedrock. + final String? overrideLambda; + + PromptOverrideConfiguration({ + required this.promptConfigurations, + this.overrideLambda, + }); + + factory PromptOverrideConfiguration.fromJson(Map json) { + return PromptOverrideConfiguration( + promptConfigurations: (json['promptConfigurations'] as List) + .whereNotNull() + .map((e) => PromptConfiguration.fromJson(e as Map)) + .toList(), + overrideLambda: json['overrideLambda'] as String?, + ); + } + + Map toJson() { + final promptConfigurations = this.promptConfigurations; + final overrideLambda = this.overrideLambda; + return { + 'promptConfigurations': promptConfigurations, + if (overrideLambda != null) 'overrideLambda': overrideLambda, + }; + } +} + +enum PromptState { + enabled, + disabled, +} + +extension PromptStateValueExtension on PromptState { + String toValue() { + switch (this) { + case PromptState.enabled: + return 'ENABLED'; + case PromptState.disabled: + return 'DISABLED'; + } + } +} + +extension PromptStateFromString on String { + PromptState toPromptState() { + switch (this) { + case 'ENABLED': + return PromptState.enabled; + case 'DISABLED': + return PromptState.disabled; + } + throw Exception('$this is not known in enum PromptState'); + } +} + +enum PromptType { + preProcessing, + orchestration, + postProcessing, + knowledgeBaseResponseGeneration, +} + +extension PromptTypeValueExtension on PromptType { + String toValue() { + switch (this) { + case PromptType.preProcessing: + return 'PRE_PROCESSING'; + case PromptType.orchestration: + return 'ORCHESTRATION'; + case PromptType.postProcessing: + return 'POST_PROCESSING'; + case PromptType.knowledgeBaseResponseGeneration: + return 'KNOWLEDGE_BASE_RESPONSE_GENERATION'; + } + } +} + +extension PromptTypeFromString on String { + PromptType toPromptType() { + switch (this) { + case 'PRE_PROCESSING': + return PromptType.preProcessing; + case 'ORCHESTRATION': + return PromptType.orchestration; + case 'POST_PROCESSING': + return PromptType.postProcessing; + case 'KNOWLEDGE_BASE_RESPONSE_GENERATION': + return PromptType.knowledgeBaseResponseGeneration; + } + throw Exception('$this is not known in enum PromptType'); + } +} + +/// Contains details about the storage configuration of the knowledge base in +/// Amazon RDS. For more information, see Create +/// a vector index in Amazon RDS. +class RdsConfiguration { + /// The Amazon Resource Name (ARN) of the secret that you created in Secrets + /// Manager that is linked to your Amazon RDS database. + final String credentialsSecretArn; + + /// The name of your Amazon RDS database. + final String databaseName; + + /// Contains the names of the fields to which to map information about the + /// vector store. + final RdsFieldMapping fieldMapping; + + /// The Amazon Resource Name (ARN) of the vector store. + final String resourceArn; + + /// The name of the table in the database. + final String tableName; + + RdsConfiguration({ + required this.credentialsSecretArn, + required this.databaseName, + required this.fieldMapping, + required this.resourceArn, + required this.tableName, + }); + + factory RdsConfiguration.fromJson(Map json) { + return RdsConfiguration( + credentialsSecretArn: json['credentialsSecretArn'] as String, + databaseName: json['databaseName'] as String, + fieldMapping: RdsFieldMapping.fromJson( + json['fieldMapping'] as Map), + resourceArn: json['resourceArn'] as String, + tableName: json['tableName'] as String, + ); + } + + Map toJson() { + final credentialsSecretArn = this.credentialsSecretArn; + final databaseName = this.databaseName; + final fieldMapping = this.fieldMapping; + final resourceArn = this.resourceArn; + final tableName = this.tableName; + return { + 'credentialsSecretArn': credentialsSecretArn, + 'databaseName': databaseName, + 'fieldMapping': fieldMapping, + 'resourceArn': resourceArn, + 'tableName': tableName, + }; + } +} + +/// Contains the names of the fields to which to map information about the +/// vector store. +class RdsFieldMapping { + /// The name of the field in which Amazon Bedrock stores metadata about the + /// vector store. + final String metadataField; + + /// The name of the field in which Amazon Bedrock stores the ID for each entry. + final String primaryKeyField; + + /// The name of the field in which Amazon Bedrock stores the raw text from your + /// data. The text is split according to the chunking strategy you choose. + final String textField; + + /// The name of the field in which Amazon Bedrock stores the vector embeddings + /// for your data sources. + final String vectorField; + + RdsFieldMapping({ + required this.metadataField, + required this.primaryKeyField, + required this.textField, + required this.vectorField, + }); + + factory RdsFieldMapping.fromJson(Map json) { + return RdsFieldMapping( + metadataField: json['metadataField'] as String, + primaryKeyField: json['primaryKeyField'] as String, + textField: json['textField'] as String, + vectorField: json['vectorField'] as String, + ); + } + + Map toJson() { + final metadataField = this.metadataField; + final primaryKeyField = this.primaryKeyField; + final textField = this.textField; + final vectorField = this.vectorField; + return { + 'metadataField': metadataField, + 'primaryKeyField': primaryKeyField, + 'textField': textField, + 'vectorField': vectorField, + }; + } +} + +/// Contains details about the storage configuration of the knowledge base in +/// Redis Enterprise Cloud. For more information, see Create +/// a vector index in Redis Enterprise Cloud. +class RedisEnterpriseCloudConfiguration { + /// The Amazon Resource Name (ARN) of the secret that you created in Secrets + /// Manager that is linked to your Redis Enterprise Cloud database. + final String credentialsSecretArn; + + /// The endpoint URL of the Redis Enterprise Cloud database. + final String endpoint; + + /// Contains the names of the fields to which to map information about the + /// vector store. + final RedisEnterpriseCloudFieldMapping fieldMapping; + + /// The name of the vector index. + final String vectorIndexName; + + RedisEnterpriseCloudConfiguration({ + required this.credentialsSecretArn, + required this.endpoint, + required this.fieldMapping, + required this.vectorIndexName, + }); + + factory RedisEnterpriseCloudConfiguration.fromJson( + Map json) { + return RedisEnterpriseCloudConfiguration( + credentialsSecretArn: json['credentialsSecretArn'] as String, + endpoint: json['endpoint'] as String, + fieldMapping: RedisEnterpriseCloudFieldMapping.fromJson( + json['fieldMapping'] as Map), + vectorIndexName: json['vectorIndexName'] as String, + ); + } + + Map toJson() { + final credentialsSecretArn = this.credentialsSecretArn; + final endpoint = this.endpoint; + final fieldMapping = this.fieldMapping; + final vectorIndexName = this.vectorIndexName; + return { + 'credentialsSecretArn': credentialsSecretArn, + 'endpoint': endpoint, + 'fieldMapping': fieldMapping, + 'vectorIndexName': vectorIndexName, + }; + } +} + +/// Contains the names of the fields to which to map information about the +/// vector store. +class RedisEnterpriseCloudFieldMapping { + /// The name of the field in which Amazon Bedrock stores metadata about the + /// vector store. + final String metadataField; + + /// The name of the field in which Amazon Bedrock stores the raw text from your + /// data. The text is split according to the chunking strategy you choose. + final String textField; + + /// The name of the field in which Amazon Bedrock stores the vector embeddings + /// for your data sources. + final String vectorField; + + RedisEnterpriseCloudFieldMapping({ + required this.metadataField, + required this.textField, + required this.vectorField, + }); + + factory RedisEnterpriseCloudFieldMapping.fromJson(Map json) { + return RedisEnterpriseCloudFieldMapping( + metadataField: json['metadataField'] as String, + textField: json['textField'] as String, + vectorField: json['vectorField'] as String, + ); + } + + Map toJson() { + final metadataField = this.metadataField; + final textField = this.textField; + final vectorField = this.vectorField; + return { + 'metadataField': metadataField, + 'textField': textField, + 'vectorField': vectorField, + }; + } +} + +/// Contains information about the S3 configuration of the data source. +class S3DataSourceConfiguration { + /// The Amazon Resource Name (ARN) of the bucket that contains the data source. + final String bucketArn; + + /// The bucket account owner ID for the S3 bucket. + final String? bucketOwnerAccountId; + + /// A list of S3 prefixes that define the object containing the data sources. + /// For more information, see Organizing + /// objects using prefixes. + final List? inclusionPrefixes; + + S3DataSourceConfiguration({ + required this.bucketArn, + this.bucketOwnerAccountId, + this.inclusionPrefixes, + }); + + factory S3DataSourceConfiguration.fromJson(Map json) { + return S3DataSourceConfiguration( + bucketArn: json['bucketArn'] as String, + bucketOwnerAccountId: json['bucketOwnerAccountId'] as String?, + inclusionPrefixes: (json['inclusionPrefixes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final bucketArn = this.bucketArn; + final bucketOwnerAccountId = this.bucketOwnerAccountId; + final inclusionPrefixes = this.inclusionPrefixes; + return { + 'bucketArn': bucketArn, + if (bucketOwnerAccountId != null) + 'bucketOwnerAccountId': bucketOwnerAccountId, + if (inclusionPrefixes != null) 'inclusionPrefixes': inclusionPrefixes, + }; + } +} + +/// Contains information about the S3 object containing the resource. +class S3Identifier { + /// The name of the S3 bucket. + final String? s3BucketName; + + /// The S3 object key containing the resource. + final String? s3ObjectKey; + + S3Identifier({ + this.s3BucketName, + this.s3ObjectKey, + }); + + factory S3Identifier.fromJson(Map json) { + return S3Identifier( + s3BucketName: json['s3BucketName'] as String?, + s3ObjectKey: json['s3ObjectKey'] as String?, + ); + } + + Map toJson() { + final s3BucketName = this.s3BucketName; + final s3ObjectKey = this.s3ObjectKey; + return { + if (s3BucketName != null) 's3BucketName': s3BucketName, + if (s3ObjectKey != null) 's3ObjectKey': s3ObjectKey, + }; + } +} + +/// Contains the configuration for server-side encryption. +class ServerSideEncryptionConfiguration { + /// The Amazon Resource Name (ARN) of the KMS key used to encrypt the resource. + final String? kmsKeyArn; + + ServerSideEncryptionConfiguration({ + this.kmsKeyArn, + }); + + factory ServerSideEncryptionConfiguration.fromJson( + Map json) { + return ServerSideEncryptionConfiguration( + kmsKeyArn: json['kmsKeyArn'] as String?, + ); + } + + Map toJson() { + final kmsKeyArn = this.kmsKeyArn; + return { + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + }; + } +} + +enum SortOrder { + ascending, + descending, +} + +extension SortOrderValueExtension on SortOrder { + String toValue() { + switch (this) { + case SortOrder.ascending: + return 'ASCENDING'; + case SortOrder.descending: + return 'DESCENDING'; + } + } +} + +extension SortOrderFromString on String { + SortOrder toSortOrder() { + switch (this) { + case 'ASCENDING': + return SortOrder.ascending; + case 'DESCENDING': + return SortOrder.descending; + } + throw Exception('$this is not known in enum SortOrder'); + } +} + +class StartIngestionJobResponse { + /// An object containing information about the ingestion job. + final IngestionJob ingestionJob; + + StartIngestionJobResponse({ + required this.ingestionJob, + }); + + factory StartIngestionJobResponse.fromJson(Map json) { + return StartIngestionJobResponse( + ingestionJob: + IngestionJob.fromJson(json['ingestionJob'] as Map), + ); + } + + Map toJson() { + final ingestionJob = this.ingestionJob; + return { + 'ingestionJob': ingestionJob, + }; + } +} + +/// Contains the storage configuration of the knowledge base. +class StorageConfiguration { + /// The vector store service in which the knowledge base is stored. + final KnowledgeBaseStorageType type; + + /// Contains the storage configuration of the knowledge base in MongoDB Atlas. + final MongoDbAtlasConfiguration? mongoDbAtlasConfiguration; + + /// Contains the storage configuration of the knowledge base in Amazon + /// OpenSearch Service. + final OpenSearchServerlessConfiguration? opensearchServerlessConfiguration; + + /// Contains the storage configuration of the knowledge base in Pinecone. + final PineconeConfiguration? pineconeConfiguration; + + /// Contains details about the storage configuration of the knowledge base in + /// Amazon RDS. For more information, see Create + /// a vector index in Amazon RDS. + final RdsConfiguration? rdsConfiguration; + + /// Contains the storage configuration of the knowledge base in Redis Enterprise + /// Cloud. + final RedisEnterpriseCloudConfiguration? redisEnterpriseCloudConfiguration; + + StorageConfiguration({ + required this.type, + this.mongoDbAtlasConfiguration, + this.opensearchServerlessConfiguration, + this.pineconeConfiguration, + this.rdsConfiguration, + this.redisEnterpriseCloudConfiguration, + }); + + factory StorageConfiguration.fromJson(Map json) { + return StorageConfiguration( + type: (json['type'] as String).toKnowledgeBaseStorageType(), + mongoDbAtlasConfiguration: json['mongoDbAtlasConfiguration'] != null + ? MongoDbAtlasConfiguration.fromJson( + json['mongoDbAtlasConfiguration'] as Map) + : null, + opensearchServerlessConfiguration: + json['opensearchServerlessConfiguration'] != null + ? OpenSearchServerlessConfiguration.fromJson( + json['opensearchServerlessConfiguration'] + as Map) + : null, + pineconeConfiguration: json['pineconeConfiguration'] != null + ? PineconeConfiguration.fromJson( + json['pineconeConfiguration'] as Map) + : null, + rdsConfiguration: json['rdsConfiguration'] != null + ? RdsConfiguration.fromJson( + json['rdsConfiguration'] as Map) + : null, + redisEnterpriseCloudConfiguration: + json['redisEnterpriseCloudConfiguration'] != null + ? RedisEnterpriseCloudConfiguration.fromJson( + json['redisEnterpriseCloudConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final type = this.type; + final mongoDbAtlasConfiguration = this.mongoDbAtlasConfiguration; + final opensearchServerlessConfiguration = + this.opensearchServerlessConfiguration; + final pineconeConfiguration = this.pineconeConfiguration; + final rdsConfiguration = this.rdsConfiguration; + final redisEnterpriseCloudConfiguration = + this.redisEnterpriseCloudConfiguration; + return { + 'type': type.toValue(), + if (mongoDbAtlasConfiguration != null) + 'mongoDbAtlasConfiguration': mongoDbAtlasConfiguration, + if (opensearchServerlessConfiguration != null) + 'opensearchServerlessConfiguration': opensearchServerlessConfiguration, + if (pineconeConfiguration != null) + 'pineconeConfiguration': pineconeConfiguration, + if (rdsConfiguration != null) 'rdsConfiguration': rdsConfiguration, + if (redisEnterpriseCloudConfiguration != null) + 'redisEnterpriseCloudConfiguration': redisEnterpriseCloudConfiguration, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +enum Type { + string, + number, + integer, + boolean, + array, +} + +extension TypeValueExtension on Type { + String toValue() { + switch (this) { + case Type.string: + return 'string'; + case Type.number: + return 'number'; + case Type.integer: + return 'integer'; + case Type.boolean: + return 'boolean'; + case Type.array: + return 'array'; + } + } +} + +extension TypeFromString on String { + Type toType() { + switch (this) { + case 'string': + return Type.string; + case 'number': + return Type.number; + case 'integer': + return Type.integer; + case 'boolean': + return Type.boolean; + case 'array': + return Type.array; + } + throw Exception('$this is not known in enum Type'); + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateAgentActionGroupResponse { + /// Contains details about the action group that was updated. + final AgentActionGroup agentActionGroup; + + UpdateAgentActionGroupResponse({ + required this.agentActionGroup, + }); + + factory UpdateAgentActionGroupResponse.fromJson(Map json) { + return UpdateAgentActionGroupResponse( + agentActionGroup: AgentActionGroup.fromJson( + json['agentActionGroup'] as Map), + ); + } + + Map toJson() { + final agentActionGroup = this.agentActionGroup; + return { + 'agentActionGroup': agentActionGroup, + }; + } +} + +class UpdateAgentAliasResponse { + /// Contains details about the alias that was updated. + final AgentAlias agentAlias; + + UpdateAgentAliasResponse({ + required this.agentAlias, + }); + + factory UpdateAgentAliasResponse.fromJson(Map json) { + return UpdateAgentAliasResponse( + agentAlias: + AgentAlias.fromJson(json['agentAlias'] as Map), + ); + } + + Map toJson() { + final agentAlias = this.agentAlias; + return { + 'agentAlias': agentAlias, + }; + } +} + +class UpdateAgentKnowledgeBaseResponse { + /// Contains details about the knowledge base that has been associated with an + /// agent. + final AgentKnowledgeBase agentKnowledgeBase; + + UpdateAgentKnowledgeBaseResponse({ + required this.agentKnowledgeBase, + }); + + factory UpdateAgentKnowledgeBaseResponse.fromJson(Map json) { + return UpdateAgentKnowledgeBaseResponse( + agentKnowledgeBase: AgentKnowledgeBase.fromJson( + json['agentKnowledgeBase'] as Map), + ); + } + + Map toJson() { + final agentKnowledgeBase = this.agentKnowledgeBase; + return { + 'agentKnowledgeBase': agentKnowledgeBase, + }; + } +} + +class UpdateAgentResponse { + /// Contains details about the agent that was updated. + final Agent agent; + + UpdateAgentResponse({ + required this.agent, + }); + + factory UpdateAgentResponse.fromJson(Map json) { + return UpdateAgentResponse( + agent: Agent.fromJson(json['agent'] as Map), + ); + } + + Map toJson() { + final agent = this.agent; + return { + 'agent': agent, + }; + } +} + +class UpdateDataSourceResponse { + /// Contains details about the data source. + final DataSource dataSource; + + UpdateDataSourceResponse({ + required this.dataSource, + }); + + factory UpdateDataSourceResponse.fromJson(Map json) { + return UpdateDataSourceResponse( + dataSource: + DataSource.fromJson(json['dataSource'] as Map), + ); + } + + Map toJson() { + final dataSource = this.dataSource; + return { + 'dataSource': dataSource, + }; + } +} + +class UpdateKnowledgeBaseResponse { + /// Contains details about the knowledge base. + final KnowledgeBase knowledgeBase; + + UpdateKnowledgeBaseResponse({ + required this.knowledgeBase, + }); + + factory UpdateKnowledgeBaseResponse.fromJson(Map json) { + return UpdateKnowledgeBaseResponse( + knowledgeBase: + KnowledgeBase.fromJson(json['knowledgeBase'] as Map), + ); + } + + Map toJson() { + final knowledgeBase = this.knowledgeBase; + return { + 'knowledgeBase': knowledgeBase, + }; + } +} + +/// Contains details about how to ingest the documents in a data source. +class VectorIngestionConfiguration { + /// Details about how to chunk the documents in the data source. A chunk + /// refers to an excerpt from a data source that is returned when the knowledge + /// base that it belongs to is queried. + final ChunkingConfiguration? chunkingConfiguration; + + VectorIngestionConfiguration({ + this.chunkingConfiguration, + }); + + factory VectorIngestionConfiguration.fromJson(Map json) { + return VectorIngestionConfiguration( + chunkingConfiguration: json['chunkingConfiguration'] != null + ? ChunkingConfiguration.fromJson( + json['chunkingConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final chunkingConfiguration = this.chunkingConfiguration; + return { + if (chunkingConfiguration != null) + 'chunkingConfiguration': chunkingConfiguration, + }; + } +} + +/// Contains details about the model used to create vector embeddings for the +/// knowledge base. +class VectorKnowledgeBaseConfiguration { + /// The Amazon Resource Name (ARN) of the model used to create vector embeddings + /// for the knowledge base. + final String embeddingModelArn; + + /// The embeddings model configuration details for the vector model used in + /// Knowledge Base. + final EmbeddingModelConfiguration? embeddingModelConfiguration; + + VectorKnowledgeBaseConfiguration({ + required this.embeddingModelArn, + this.embeddingModelConfiguration, + }); + + factory VectorKnowledgeBaseConfiguration.fromJson(Map json) { + return VectorKnowledgeBaseConfiguration( + embeddingModelArn: json['embeddingModelArn'] as String, + embeddingModelConfiguration: json['embeddingModelConfiguration'] != null + ? EmbeddingModelConfiguration.fromJson( + json['embeddingModelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final embeddingModelArn = this.embeddingModelArn; + final embeddingModelConfiguration = this.embeddingModelConfiguration; + return { + 'embeddingModelArn': embeddingModelArn, + if (embeddingModelConfiguration != null) + 'embeddingModelConfiguration': embeddingModelConfiguration, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/bedrock_agent_runtime/v2023_07_26.dart b/aws_client/lib/src/generated/bedrock_agent_runtime/v2023_07_26.dart new file mode 100644 index 000000000..88a61cc05 --- /dev/null +++ b/aws_client/lib/src/generated/bedrock_agent_runtime/v2023_07_26.dart @@ -0,0 +1,5203 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Contains APIs related to model invocation and querying of knowledge bases. +class AgentsForAmazonBedrockRuntime { + final _s.RestJsonProtocol _protocol; + AgentsForAmazonBedrockRuntime({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'bedrock-agent-runtime', + signingName: 'bedrock', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// + /// The CLI doesn't support InvokeAgent. + /// + /// Sends a prompt for the agent to process and respond to. Note the following + /// fields for the request: + /// + ///
      + ///
    • + /// To continue the same conversation with an agent, use the same + /// sessionId value in the request. + ///
    • + ///
    • + /// To activate trace enablement, turn enableTrace to + /// true. Trace enablement helps you follow the agent's reasoning + /// process that led it to the information it processed, the actions it took, + /// and the final result it yielded. For more information, see Trace + /// enablement. + ///
    • + ///
    • + /// End a conversation by setting endSession to + /// true. + ///
    • + ///
    • + /// In the sessionState object, you can include attributes for + /// the session or prompt or, if you configured an action group to return + /// control, results from invocation of the action group. + ///
    • + ///
    + /// The response is returned in the bytes field of the + /// chunk object. + /// + ///
      + ///
    • + /// The attribution object contains citations for parts of the + /// response. + ///
    • + ///
    • + /// If you set enableTrace to true in the request, + /// you can trace the agent's steps and reasoning process that led it to the + /// response. + ///
    • + ///
    • + /// If the action predicted was configured to return control, the response + /// returns parameters for the action, elicited from the user, in the + /// returnControl field. + ///
    • + ///
    • + /// Errors are also surfaced in the response. + ///
    • + ///
    + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [DependencyFailedException]. + /// May throw [BadGatewayException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [agentAliasId] : + /// The alias of the agent to use. + /// + /// Parameter [agentId] : + /// The unique identifier of the agent to use. + /// + /// Parameter [sessionId] : + /// The unique identifier of the session. Use the same value across requests + /// to continue the same conversation. + /// + /// Parameter [enableTrace] : + /// Specifies whether to turn on the trace or not to track the agent's + /// reasoning process. For more information, see Trace + /// enablement. + /// + /// Parameter [endSession] : + /// Specifies whether to end the session with the agent or not. + /// + /// Parameter [inputText] : + /// The prompt text to send the agent. + /// + /// If you include returnControlInvocationResults in the + /// sessionState field, the inputText field will be + /// ignored. + /// + /// + /// Parameter [sessionState] : + /// Contains parameters that specify various attributes of the session. For + /// more information, see Control + /// session context. + /// + /// If you include returnControlInvocationResults in the + /// sessionState field, the inputText field will be + /// ignored. + /// + Future invokeAgent({ + required String agentAliasId, + required String agentId, + required String sessionId, + bool? enableTrace, + bool? endSession, + String? inputText, + SessionState? sessionState, + }) async { + final $payload = { + if (enableTrace != null) 'enableTrace': enableTrace, + if (endSession != null) 'endSession': endSession, + if (inputText != null) 'inputText': inputText, + if (sessionState != null) 'sessionState': sessionState, + }; + final response = await _protocol.sendRaw( + payload: $payload, + method: 'POST', + requestUri: + '/agents/${Uri.encodeComponent(agentId)}/agentAliases/${Uri.encodeComponent(agentAliasId)}/sessions/${Uri.encodeComponent(sessionId)}/text', + exceptionFnMap: _exceptionFns, + ); + final $json = await _s.jsonFromResponse(response); + return InvokeAgentResponse( + completion: ResponseStream.fromJson($json), + contentType: _s.extractHeaderStringValue( + response.headers, 'x-amzn-bedrock-agent-content-type')!, + sessionId: _s.extractHeaderStringValue( + response.headers, 'x-amz-bedrock-agent-session-id')!, + ); + } + + /// Queries a knowledge base and retrieves information from it. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [DependencyFailedException]. + /// May throw [BadGatewayException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [knowledgeBaseId] : + /// The unique identifier of the knowledge base to query. + /// + /// Parameter [retrievalQuery] : + /// Contains the query to send the knowledge base. + /// + /// Parameter [nextToken] : + /// If there are more results than can fit in the response, the response + /// returns a nextToken. Use this token in the + /// nextToken field of another request to retrieve the next batch + /// of results. + /// + /// Parameter [retrievalConfiguration] : + /// Contains configurations for the knowledge base query and retrieval + /// process. For more information, see Query + /// configurations. + Future retrieve({ + required String knowledgeBaseId, + required KnowledgeBaseQuery retrievalQuery, + String? nextToken, + KnowledgeBaseRetrievalConfiguration? retrievalConfiguration, + }) async { + final $payload = { + 'retrievalQuery': retrievalQuery, + if (nextToken != null) 'nextToken': nextToken, + if (retrievalConfiguration != null) + 'retrievalConfiguration': retrievalConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/knowledgebases/${Uri.encodeComponent(knowledgeBaseId)}/retrieve', + exceptionFnMap: _exceptionFns, + ); + return RetrieveResponse.fromJson(response); + } + + /// Queries a knowledge base and generates responses based on the retrieved + /// results. The response only cites sources that are relevant to the query. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [DependencyFailedException]. + /// May throw [BadGatewayException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [input] : + /// Contains the query to be made to the knowledge base. + /// + /// Parameter [retrieveAndGenerateConfiguration] : + /// Contains configurations for the knowledge base query and retrieval + /// process. For more information, see Query + /// configurations. + /// + /// Parameter [sessionConfiguration] : + /// Contains details about the session with the knowledge base. + /// + /// Parameter [sessionId] : + /// The unique identifier of the session. Reuse the same value to continue the + /// same session with the knowledge base. + Future retrieveAndGenerate({ + required RetrieveAndGenerateInput input, + RetrieveAndGenerateConfiguration? retrieveAndGenerateConfiguration, + RetrieveAndGenerateSessionConfiguration? sessionConfiguration, + String? sessionId, + }) async { + final $payload = { + 'input': input, + if (retrieveAndGenerateConfiguration != null) + 'retrieveAndGenerateConfiguration': retrieveAndGenerateConfiguration, + if (sessionConfiguration != null) + 'sessionConfiguration': sessionConfiguration, + if (sessionId != null) 'sessionId': sessionId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/retrieveAndGenerate', + exceptionFnMap: _exceptionFns, + ); + return RetrieveAndGenerateResponse.fromJson(response); + } +} + +/// The request is denied because of missing access permissions. Check your +/// permissions and retry your request. +class AccessDeniedException implements _s.AwsException { + final String? message; + + AccessDeniedException({ + this.message, + }); + + factory AccessDeniedException.fromJson(Map json) { + return AccessDeniedException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Contains information about the action group being invoked. For more +/// information about the possible structures, see the InvocationInput tab in OrchestrationTrace +/// in the Amazon Bedrock User Guide. +class ActionGroupInvocationInput { + /// The name of the action group. + final String? actionGroupName; + + /// The path to the API to call, based off the action group. + final String? apiPath; + + /// The function in the action group to call. + final String? function; + + /// The parameters in the Lambda input event. + final List? parameters; + + /// The parameters in the request body for the Lambda input event. + final RequestBody? requestBody; + + /// The API method being used, based off the action group. + final String? verb; + + ActionGroupInvocationInput({ + this.actionGroupName, + this.apiPath, + this.function, + this.parameters, + this.requestBody, + this.verb, + }); + + factory ActionGroupInvocationInput.fromJson(Map json) { + return ActionGroupInvocationInput( + actionGroupName: json['actionGroupName'] as String?, + apiPath: json['apiPath'] as String?, + function: json['function'] as String?, + parameters: (json['parameters'] as List?) + ?.whereNotNull() + .map((e) => Parameter.fromJson(e as Map)) + .toList(), + requestBody: json['requestBody'] != null + ? RequestBody.fromJson(json['requestBody'] as Map) + : null, + verb: json['verb'] as String?, + ); + } + + Map toJson() { + final actionGroupName = this.actionGroupName; + final apiPath = this.apiPath; + final function = this.function; + final parameters = this.parameters; + final requestBody = this.requestBody; + final verb = this.verb; + return { + if (actionGroupName != null) 'actionGroupName': actionGroupName, + if (apiPath != null) 'apiPath': apiPath, + if (function != null) 'function': function, + if (parameters != null) 'parameters': parameters, + if (requestBody != null) 'requestBody': requestBody, + if (verb != null) 'verb': verb, + }; + } +} + +/// Contains the JSON-formatted string returned by the API invoked by the action +/// group. +class ActionGroupInvocationOutput { + /// The JSON-formatted string returned by the API invoked by the action group. + final String? text; + + ActionGroupInvocationOutput({ + this.text, + }); + + factory ActionGroupInvocationOutput.fromJson(Map json) { + return ActionGroupInvocationOutput( + text: json['text'] as String?, + ); + } + + Map toJson() { + final text = this.text; + return { + if (text != null) 'text': text, + }; + } +} + +class AdditionalModelRequestFieldsValue { + AdditionalModelRequestFieldsValue(); + + Map toJson() { + return {}; + } +} + +/// Contains information about the API operation that the agent predicts should +/// be called. +/// +/// This data type is used in the following API operations: +/// +/// +class ApiInvocationInput { + /// The action group that the API operation belongs to. + final String actionGroup; + + /// The path to the API operation. + final String? apiPath; + + /// The HTTP method of the API operation. + final String? httpMethod; + + /// The parameters to provide for the API request, as the agent elicited from + /// the user. + final List? parameters; + + /// The request body to provide for the API request, as the agent elicited from + /// the user. + final ApiRequestBody? requestBody; + + ApiInvocationInput({ + required this.actionGroup, + this.apiPath, + this.httpMethod, + this.parameters, + this.requestBody, + }); + + factory ApiInvocationInput.fromJson(Map json) { + return ApiInvocationInput( + actionGroup: json['actionGroup'] as String, + apiPath: json['apiPath'] as String?, + httpMethod: json['httpMethod'] as String?, + parameters: (json['parameters'] as List?) + ?.whereNotNull() + .map((e) => ApiParameter.fromJson(e as Map)) + .toList(), + requestBody: json['requestBody'] != null + ? ApiRequestBody.fromJson(json['requestBody'] as Map) + : null, + ); + } + + Map toJson() { + final actionGroup = this.actionGroup; + final apiPath = this.apiPath; + final httpMethod = this.httpMethod; + final parameters = this.parameters; + final requestBody = this.requestBody; + return { + 'actionGroup': actionGroup, + if (apiPath != null) 'apiPath': apiPath, + if (httpMethod != null) 'httpMethod': httpMethod, + if (parameters != null) 'parameters': parameters, + if (requestBody != null) 'requestBody': requestBody, + }; + } +} + +/// Information about a parameter to provide to the API request. +/// +/// This data type is used in the following API operations: +/// +/// +class ApiParameter { + /// The name of the parameter. + final String? name; + + /// The data type for the parameter. + final String? type; + + /// The value of the parameter. + final String? value; + + ApiParameter({ + this.name, + this.type, + this.value, + }); + + factory ApiParameter.fromJson(Map json) { + return ApiParameter( + name: json['name'] as String?, + type: json['type'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + final value = this.value; + return { + if (name != null) 'name': name, + if (type != null) 'type': type, + if (value != null) 'value': value, + }; + } +} + +/// The request body to provide for the API request, as the agent elicited from +/// the user. +/// +/// This data type is used in the following API operations: +/// +/// +class ApiRequestBody { + /// The content of the request body. The key of the object in this field is a + /// media type defining the format of the request body. + final Map? content; + + ApiRequestBody({ + this.content, + }); + + factory ApiRequestBody.fromJson(Map json) { + return ApiRequestBody( + content: (json['content'] as Map?)?.map((k, e) => + MapEntry(k, PropertyParameters.fromJson(e as Map))), + ); + } + + Map toJson() { + final content = this.content; + return { + if (content != null) 'content': content, + }; + } +} + +/// Contains information about the API operation that was called from the action +/// group and the response body that was returned. +/// +/// This data type is used in the following API operations: +/// +/// +class ApiResult { + /// The action group that the API operation belongs to. + final String actionGroup; + + /// The path to the API operation. + final String? apiPath; + + /// The HTTP method for the API operation. + final String? httpMethod; + + /// http status code from API execution response (for example: 200, 400, 500). + final int? httpStatusCode; + + /// The response body from the API operation. The key of the object is the + /// content type (currently, only TEXT is supported). The response + /// may be returned directly or from the Lambda function. + final Map? responseBody; + + /// Controls the final response state returned to end user when API/Function + /// execution failed. When this state is FAILURE, the request would fail with + /// dependency failure exception. When this state is REPROMPT, the API/function + /// response will be sent to model for re-prompt + final ResponseState? responseState; + + ApiResult({ + required this.actionGroup, + this.apiPath, + this.httpMethod, + this.httpStatusCode, + this.responseBody, + this.responseState, + }); + + Map toJson() { + final actionGroup = this.actionGroup; + final apiPath = this.apiPath; + final httpMethod = this.httpMethod; + final httpStatusCode = this.httpStatusCode; + final responseBody = this.responseBody; + final responseState = this.responseState; + return { + 'actionGroup': actionGroup, + if (apiPath != null) 'apiPath': apiPath, + if (httpMethod != null) 'httpMethod': httpMethod, + if (httpStatusCode != null) 'httpStatusCode': httpStatusCode, + if (responseBody != null) 'responseBody': responseBody, + if (responseState != null) 'responseState': responseState.toValue(), + }; + } +} + +/// Contains citations for a part of an agent response. +class Attribution { + /// A list of citations and related information for a part of an agent response. + final List? citations; + + Attribution({ + this.citations, + }); + + factory Attribution.fromJson(Map json) { + return Attribution( + citations: (json['citations'] as List?) + ?.whereNotNull() + .map((e) => Citation.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final citations = this.citations; + return { + if (citations != null) 'citations': citations, + }; + } +} + +/// There was an issue with a dependency due to a server issue. Retry your +/// request. +class BadGatewayException implements _s.AwsException { + final String? message; + + /// The name of the dependency that caused the issue, such as Amazon Bedrock, + /// Lambda, or STS. + final String? resourceName; + + BadGatewayException({ + this.message, + this.resourceName, + }); + + factory BadGatewayException.fromJson(Map json) { + return BadGatewayException( + message: json['message'] as String?, + resourceName: json['resourceName'] as String?, + ); + } + + Map toJson() { + final message = this.message; + final resourceName = this.resourceName; + return { + if (message != null) 'message': message, + if (resourceName != null) 'resourceName': resourceName, + }; + } +} + +/// This property contains the document to chat with, along with its attributes. +class ByteContentDoc { + /// The MIME type of the document contained in the wrapper object. + final String contentType; + + /// The byte value of the file to upload, encoded as a Base-64 string. + final Uint8List data; + + /// The file name of the document contained in the wrapper object. + final String identifier; + + ByteContentDoc({ + required this.contentType, + required this.data, + required this.identifier, + }); + + Map toJson() { + final contentType = this.contentType; + final data = this.data; + final identifier = this.identifier; + return { + 'contentType': contentType, + 'data': base64Encode(data), + 'identifier': identifier, + }; + } +} + +/// An object containing a segment of the generated response that is based on a +/// source in the knowledge base, alongside information about the source. +/// +/// This data type is used in the following API operations: +/// +/// +class Citation { + /// Contains the generated response and metadata + final GeneratedResponsePart? generatedResponsePart; + + /// Contains metadata about the sources cited for the generated response. + final List? retrievedReferences; + + Citation({ + this.generatedResponsePart, + this.retrievedReferences, + }); + + factory Citation.fromJson(Map json) { + return Citation( + generatedResponsePart: json['generatedResponsePart'] != null + ? GeneratedResponsePart.fromJson( + json['generatedResponsePart'] as Map) + : null, + retrievedReferences: (json['retrievedReferences'] as List?) + ?.whereNotNull() + .map((e) => RetrievedReference.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final generatedResponsePart = this.generatedResponsePart; + final retrievedReferences = this.retrievedReferences; + return { + if (generatedResponsePart != null) + 'generatedResponsePart': generatedResponsePart, + if (retrievedReferences != null) + 'retrievedReferences': retrievedReferences, + }; + } +} + +/// There was a conflict performing an operation. Resolve the conflict and retry +/// your request. +class ConflictException implements _s.AwsException { + final String? message; + + ConflictException({ + this.message, + }); + + factory ConflictException.fromJson(Map json) { + return ConflictException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Contains the body of the API response. +/// +/// This data type is used in the following API operations: +/// +/// +class ContentBody { + /// The body of the API response. + final String? body; + + ContentBody({ + this.body, + }); + + Map toJson() { + final body = this.body; + return { + if (body != null) 'body': body, + }; + } +} + +enum CreationMode { + $default, + overridden, +} + +extension CreationModeValueExtension on CreationMode { + String toValue() { + switch (this) { + case CreationMode.$default: + return 'DEFAULT'; + case CreationMode.overridden: + return 'OVERRIDDEN'; + } + } +} + +extension CreationModeFromString on String { + CreationMode toCreationMode() { + switch (this) { + case 'DEFAULT': + return CreationMode.$default; + case 'OVERRIDDEN': + return CreationMode.overridden; + } + throw Exception('$this is not known in enum CreationMode'); + } +} + +/// There was an issue with a dependency. Check the resource configurations and +/// retry the request. +class DependencyFailedException implements _s.AwsException { + final String? message; + + /// The name of the dependency that caused the issue, such as Amazon Bedrock, + /// Lambda, or STS. + final String? resourceName; + + DependencyFailedException({ + this.message, + this.resourceName, + }); + + factory DependencyFailedException.fromJson(Map json) { + return DependencyFailedException( + message: json['message'] as String?, + resourceName: json['resourceName'] as String?, + ); + } + + Map toJson() { + final message = this.message; + final resourceName = this.resourceName; + return { + if (message != null) 'message': message, + if (resourceName != null) 'resourceName': resourceName, + }; + } +} + +/// The unique external source of the content contained in the wrapper object. +class ExternalSource { + /// The source type of the external source wrapper object. + final ExternalSourceType sourceType; + + /// The identifier, contentType, and data of the external source wrapper object. + final ByteContentDoc? byteContent; + + /// The S3 location of the external source wrapper object. + final S3ObjectDoc? s3Location; + + ExternalSource({ + required this.sourceType, + this.byteContent, + this.s3Location, + }); + + Map toJson() { + final sourceType = this.sourceType; + final byteContent = this.byteContent; + final s3Location = this.s3Location; + return { + 'sourceType': sourceType.toValue(), + if (byteContent != null) 'byteContent': byteContent, + if (s3Location != null) 's3Location': s3Location, + }; + } +} + +enum ExternalSourceType { + s3, + byteContent, +} + +extension ExternalSourceTypeValueExtension on ExternalSourceType { + String toValue() { + switch (this) { + case ExternalSourceType.s3: + return 'S3'; + case ExternalSourceType.byteContent: + return 'BYTE_CONTENT'; + } + } +} + +extension ExternalSourceTypeFromString on String { + ExternalSourceType toExternalSourceType() { + switch (this) { + case 'S3': + return ExternalSourceType.s3; + case 'BYTE_CONTENT': + return ExternalSourceType.byteContent; + } + throw Exception('$this is not known in enum ExternalSourceType'); + } +} + +/// Contains the generation configuration of the external source wrapper object. +class ExternalSourcesGenerationConfiguration { + /// Additional model parameters and their corresponding values not included in + /// the textInferenceConfig structure for an external source. Takes in custom + /// model parameters specific to the language model being used. + final Map? + additionalModelRequestFields; + + /// The configuration details for the guardrail. + final GuardrailConfiguration? guardrailConfiguration; + + /// Configuration settings for inference when using RetrieveAndGenerate to + /// generate responses while using an external source. + final InferenceConfig? inferenceConfig; + + /// Contain the textPromptTemplate string for the external source wrapper + /// object. + final PromptTemplate? promptTemplate; + + ExternalSourcesGenerationConfiguration({ + this.additionalModelRequestFields, + this.guardrailConfiguration, + this.inferenceConfig, + this.promptTemplate, + }); + + Map toJson() { + final additionalModelRequestFields = this.additionalModelRequestFields; + final guardrailConfiguration = this.guardrailConfiguration; + final inferenceConfig = this.inferenceConfig; + final promptTemplate = this.promptTemplate; + return { + if (additionalModelRequestFields != null) + 'additionalModelRequestFields': additionalModelRequestFields, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (inferenceConfig != null) 'inferenceConfig': inferenceConfig, + if (promptTemplate != null) 'promptTemplate': promptTemplate, + }; + } +} + +/// The configurations of the external source wrapper object in the +/// retrieveAndGenerate function. +class ExternalSourcesRetrieveAndGenerateConfiguration { + /// The modelArn used with the external source wrapper object in the + /// retrieveAndGenerate function. + final String modelArn; + + /// The document used with the external source wrapper object in the + /// retrieveAndGenerate function. + final List sources; + + /// The prompt used with the external source wrapper object with the + /// retrieveAndGenerate function. + final ExternalSourcesGenerationConfiguration? generationConfiguration; + + ExternalSourcesRetrieveAndGenerateConfiguration({ + required this.modelArn, + required this.sources, + this.generationConfiguration, + }); + + Map toJson() { + final modelArn = this.modelArn; + final sources = this.sources; + final generationConfiguration = this.generationConfiguration; + return { + 'modelArn': modelArn, + 'sources': sources, + if (generationConfiguration != null) + 'generationConfiguration': generationConfiguration, + }; + } +} + +/// Contains information about the failure of the interaction. +class FailureTrace { + /// The reason the interaction failed. + final String? failureReason; + + /// The unique identifier of the trace. + final String? traceId; + + FailureTrace({ + this.failureReason, + this.traceId, + }); + + factory FailureTrace.fromJson(Map json) { + return FailureTrace( + failureReason: json['failureReason'] as String?, + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final failureReason = this.failureReason; + final traceId = this.traceId; + return { + if (failureReason != null) 'failureReason': failureReason, + if (traceId != null) 'traceId': traceId, + }; + } +} + +/// Specifies the name that the metadata attribute must match and the value to +/// which to compare the value of the metadata attribute. For more information, +/// see Query +/// configurations. +/// +/// This data type is used in the following API operations: +/// +/// +class FilterAttribute { + /// The name that the metadata attribute must match. + final String key; + + /// The value to whcih to compare the value of the metadata attribute. + final FilterValue value; + + FilterAttribute({ + required this.key, + required this.value, + }); + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +class FilterValue { + FilterValue(); + + Map toJson() { + return {}; + } +} + +/// Contains details about the response to the user. +class FinalResponse { + /// The text in the response to the user. + final String? text; + + FinalResponse({ + this.text, + }); + + factory FinalResponse.fromJson(Map json) { + return FinalResponse( + text: json['text'] as String?, + ); + } + + Map toJson() { + final text = this.text; + return { + if (text != null) 'text': text, + }; + } +} + +/// Contains information about the function that the agent predicts should be +/// called. +/// +/// This data type is used in the following API operations: +/// +/// +class FunctionInvocationInput { + /// The action group that the function belongs to. + final String actionGroup; + + /// The name of the function. + final String? function; + + /// A list of parameters of the function. + final List? parameters; + + FunctionInvocationInput({ + required this.actionGroup, + this.function, + this.parameters, + }); + + factory FunctionInvocationInput.fromJson(Map json) { + return FunctionInvocationInput( + actionGroup: json['actionGroup'] as String, + function: json['function'] as String?, + parameters: (json['parameters'] as List?) + ?.whereNotNull() + .map((e) => FunctionParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final actionGroup = this.actionGroup; + final function = this.function; + final parameters = this.parameters; + return { + 'actionGroup': actionGroup, + if (function != null) 'function': function, + if (parameters != null) 'parameters': parameters, + }; + } +} + +/// Contains information about a parameter of the function. +/// +/// This data type is used in the following API operations: +/// +/// +class FunctionParameter { + /// The name of the parameter. + final String? name; + + /// The data type of the parameter. + final String? type; + + /// The value of the parameter. + final String? value; + + FunctionParameter({ + this.name, + this.type, + this.value, + }); + + factory FunctionParameter.fromJson(Map json) { + return FunctionParameter( + name: json['name'] as String?, + type: json['type'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + final value = this.value; + return { + if (name != null) 'name': name, + if (type != null) 'type': type, + if (value != null) 'value': value, + }; + } +} + +/// Contains information about the function that was called from the action +/// group and the response that was returned. +/// +/// This data type is used in the following API operations: +/// +/// +class FunctionResult { + /// The action group that the function belongs to. + final String actionGroup; + + /// The name of the function that was called. + final String? function; + + /// The response from the function call using the parameters. The key of the + /// object is the content type (currently, only TEXT is supported). + /// The response may be returned directly or from the Lambda function. + final Map? responseBody; + + /// Controls the final response state returned to end user when API/Function + /// execution failed. When this state is FAILURE, the request would fail with + /// dependency failure exception. When this state is REPROMPT, the API/function + /// response will be sent to model for re-prompt + final ResponseState? responseState; + + FunctionResult({ + required this.actionGroup, + this.function, + this.responseBody, + this.responseState, + }); + + Map toJson() { + final actionGroup = this.actionGroup; + final function = this.function; + final responseBody = this.responseBody; + final responseState = this.responseState; + return { + 'actionGroup': actionGroup, + if (function != null) 'function': function, + if (responseBody != null) 'responseBody': responseBody, + if (responseState != null) 'responseState': responseState.toValue(), + }; + } +} + +/// Contains metadata about a part of the generated response that is accompanied +/// by a citation. +/// +/// This data type is used in the following API operations: +/// +/// +class GeneratedResponsePart { + /// Contains metadata about a textual part of the generated response that is + /// accompanied by a citation. + final TextResponsePart? textResponsePart; + + GeneratedResponsePart({ + this.textResponsePart, + }); + + factory GeneratedResponsePart.fromJson(Map json) { + return GeneratedResponsePart( + textResponsePart: json['textResponsePart'] != null + ? TextResponsePart.fromJson( + json['textResponsePart'] as Map) + : null, + ); + } + + Map toJson() { + final textResponsePart = this.textResponsePart; + return { + if (textResponsePart != null) 'textResponsePart': textResponsePart, + }; + } +} + +/// Contains configurations for response generation based on the knowledge base +/// query results. +/// +/// This data type is used in the following API operations: +/// +/// +class GenerationConfiguration { + /// Additional model parameters and corresponding values not included in the + /// textInferenceConfig structure for a knowledge base. This allows users to + /// provide custom model parameters specific to the language model being used. + final Map? + additionalModelRequestFields; + + /// The configuration details for the guardrail. + final GuardrailConfiguration? guardrailConfiguration; + + /// Configuration settings for inference when using RetrieveAndGenerate to + /// generate responses while using a knowledge base as a source. + final InferenceConfig? inferenceConfig; + + /// Contains the template for the prompt that's sent to the model for response + /// generation. + final PromptTemplate? promptTemplate; + + GenerationConfiguration({ + this.additionalModelRequestFields, + this.guardrailConfiguration, + this.inferenceConfig, + this.promptTemplate, + }); + + Map toJson() { + final additionalModelRequestFields = this.additionalModelRequestFields; + final guardrailConfiguration = this.guardrailConfiguration; + final inferenceConfig = this.inferenceConfig; + final promptTemplate = this.promptTemplate; + return { + if (additionalModelRequestFields != null) + 'additionalModelRequestFields': additionalModelRequestFields, + if (guardrailConfiguration != null) + 'guardrailConfiguration': guardrailConfiguration, + if (inferenceConfig != null) 'inferenceConfig': inferenceConfig, + if (promptTemplate != null) 'promptTemplate': promptTemplate, + }; + } +} + +enum GuadrailAction { + intervened, + none, +} + +extension GuadrailActionValueExtension on GuadrailAction { + String toValue() { + switch (this) { + case GuadrailAction.intervened: + return 'INTERVENED'; + case GuadrailAction.none: + return 'NONE'; + } + } +} + +extension GuadrailActionFromString on String { + GuadrailAction toGuadrailAction() { + switch (this) { + case 'INTERVENED': + return GuadrailAction.intervened; + case 'NONE': + return GuadrailAction.none; + } + throw Exception('$this is not known in enum GuadrailAction'); + } +} + +enum GuardrailAction { + intervened, + none, +} + +extension GuardrailActionValueExtension on GuardrailAction { + String toValue() { + switch (this) { + case GuardrailAction.intervened: + return 'INTERVENED'; + case GuardrailAction.none: + return 'NONE'; + } + } +} + +extension GuardrailActionFromString on String { + GuardrailAction toGuardrailAction() { + switch (this) { + case 'INTERVENED': + return GuardrailAction.intervened; + case 'NONE': + return GuardrailAction.none; + } + throw Exception('$this is not known in enum GuardrailAction'); + } +} + +/// Assessment details of the content analyzed by Guardrails. +class GuardrailAssessment { + /// Content policy details of the Guardrail. + final GuardrailContentPolicyAssessment? contentPolicy; + + /// Sensitive Information policy details of Guardrail. + final GuardrailSensitiveInformationPolicyAssessment? + sensitiveInformationPolicy; + + /// Topic policy details of the Guardrail. + final GuardrailTopicPolicyAssessment? topicPolicy; + + /// Word policy details of the Guardrail. + final GuardrailWordPolicyAssessment? wordPolicy; + + GuardrailAssessment({ + this.contentPolicy, + this.sensitiveInformationPolicy, + this.topicPolicy, + this.wordPolicy, + }); + + factory GuardrailAssessment.fromJson(Map json) { + return GuardrailAssessment( + contentPolicy: json['contentPolicy'] != null + ? GuardrailContentPolicyAssessment.fromJson( + json['contentPolicy'] as Map) + : null, + sensitiveInformationPolicy: json['sensitiveInformationPolicy'] != null + ? GuardrailSensitiveInformationPolicyAssessment.fromJson( + json['sensitiveInformationPolicy'] as Map) + : null, + topicPolicy: json['topicPolicy'] != null + ? GuardrailTopicPolicyAssessment.fromJson( + json['topicPolicy'] as Map) + : null, + wordPolicy: json['wordPolicy'] != null + ? GuardrailWordPolicyAssessment.fromJson( + json['wordPolicy'] as Map) + : null, + ); + } + + Map toJson() { + final contentPolicy = this.contentPolicy; + final sensitiveInformationPolicy = this.sensitiveInformationPolicy; + final topicPolicy = this.topicPolicy; + final wordPolicy = this.wordPolicy; + return { + if (contentPolicy != null) 'contentPolicy': contentPolicy, + if (sensitiveInformationPolicy != null) + 'sensitiveInformationPolicy': sensitiveInformationPolicy, + if (topicPolicy != null) 'topicPolicy': topicPolicy, + if (wordPolicy != null) 'wordPolicy': wordPolicy, + }; + } +} + +/// The configuration details for the guardrail. +class GuardrailConfiguration { + /// The unique identifier for the guardrail. + final String guardrailId; + + /// The version of the guardrail. + final String guardrailVersion; + + GuardrailConfiguration({ + required this.guardrailId, + required this.guardrailVersion, + }); + + Map toJson() { + final guardrailId = this.guardrailId; + final guardrailVersion = this.guardrailVersion; + return { + 'guardrailId': guardrailId, + 'guardrailVersion': guardrailVersion, + }; + } +} + +/// Details of the content filter used in the Guardrail. +class GuardrailContentFilter { + /// The action placed on the content by the Guardrail filter. + final GuardrailContentPolicyAction? action; + + /// The confidence level regarding the content detected in the filter by the + /// Guardrail. + final GuardrailContentFilterConfidence? confidence; + + /// The type of content detected in the filter by the Guardrail. + final GuardrailContentFilterType? type; + + GuardrailContentFilter({ + this.action, + this.confidence, + this.type, + }); + + factory GuardrailContentFilter.fromJson(Map json) { + return GuardrailContentFilter( + action: (json['action'] as String?)?.toGuardrailContentPolicyAction(), + confidence: + (json['confidence'] as String?)?.toGuardrailContentFilterConfidence(), + type: (json['type'] as String?)?.toGuardrailContentFilterType(), + ); + } + + Map toJson() { + final action = this.action; + final confidence = this.confidence; + final type = this.type; + return { + if (action != null) 'action': action.toValue(), + if (confidence != null) 'confidence': confidence.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +enum GuardrailContentFilterConfidence { + none, + low, + medium, + high, +} + +extension GuardrailContentFilterConfidenceValueExtension + on GuardrailContentFilterConfidence { + String toValue() { + switch (this) { + case GuardrailContentFilterConfidence.none: + return 'NONE'; + case GuardrailContentFilterConfidence.low: + return 'LOW'; + case GuardrailContentFilterConfidence.medium: + return 'MEDIUM'; + case GuardrailContentFilterConfidence.high: + return 'HIGH'; + } + } +} + +extension GuardrailContentFilterConfidenceFromString on String { + GuardrailContentFilterConfidence toGuardrailContentFilterConfidence() { + switch (this) { + case 'NONE': + return GuardrailContentFilterConfidence.none; + case 'LOW': + return GuardrailContentFilterConfidence.low; + case 'MEDIUM': + return GuardrailContentFilterConfidence.medium; + case 'HIGH': + return GuardrailContentFilterConfidence.high; + } + throw Exception( + '$this is not known in enum GuardrailContentFilterConfidence'); + } +} + +enum GuardrailContentFilterType { + insults, + hate, + sexual, + violence, + misconduct, + promptAttack, +} + +extension GuardrailContentFilterTypeValueExtension + on GuardrailContentFilterType { + String toValue() { + switch (this) { + case GuardrailContentFilterType.insults: + return 'INSULTS'; + case GuardrailContentFilterType.hate: + return 'HATE'; + case GuardrailContentFilterType.sexual: + return 'SEXUAL'; + case GuardrailContentFilterType.violence: + return 'VIOLENCE'; + case GuardrailContentFilterType.misconduct: + return 'MISCONDUCT'; + case GuardrailContentFilterType.promptAttack: + return 'PROMPT_ATTACK'; + } + } +} + +extension GuardrailContentFilterTypeFromString on String { + GuardrailContentFilterType toGuardrailContentFilterType() { + switch (this) { + case 'INSULTS': + return GuardrailContentFilterType.insults; + case 'HATE': + return GuardrailContentFilterType.hate; + case 'SEXUAL': + return GuardrailContentFilterType.sexual; + case 'VIOLENCE': + return GuardrailContentFilterType.violence; + case 'MISCONDUCT': + return GuardrailContentFilterType.misconduct; + case 'PROMPT_ATTACK': + return GuardrailContentFilterType.promptAttack; + } + throw Exception('$this is not known in enum GuardrailContentFilterType'); + } +} + +enum GuardrailContentPolicyAction { + blocked, +} + +extension GuardrailContentPolicyActionValueExtension + on GuardrailContentPolicyAction { + String toValue() { + switch (this) { + case GuardrailContentPolicyAction.blocked: + return 'BLOCKED'; + } + } +} + +extension GuardrailContentPolicyActionFromString on String { + GuardrailContentPolicyAction toGuardrailContentPolicyAction() { + switch (this) { + case 'BLOCKED': + return GuardrailContentPolicyAction.blocked; + } + throw Exception('$this is not known in enum GuardrailContentPolicyAction'); + } +} + +/// The details of the policy assessment in the Guardrails filter. +class GuardrailContentPolicyAssessment { + /// The filter details of the policy assessment used in the Guardrails filter. + final List? filters; + + GuardrailContentPolicyAssessment({ + this.filters, + }); + + factory GuardrailContentPolicyAssessment.fromJson(Map json) { + return GuardrailContentPolicyAssessment( + filters: (json['filters'] as List?) + ?.whereNotNull() + .map( + (e) => GuardrailContentFilter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final filters = this.filters; + return { + if (filters != null) 'filters': filters, + }; + } +} + +/// The custom word details for the filter in the Guardrail. +class GuardrailCustomWord { + /// The action details for the custom word filter in the Guardrail. + final GuardrailWordPolicyAction? action; + + /// The match details for the custom word filter in the Guardrail. + final String? match; + + GuardrailCustomWord({ + this.action, + this.match, + }); + + factory GuardrailCustomWord.fromJson(Map json) { + return GuardrailCustomWord( + action: (json['action'] as String?)?.toGuardrailWordPolicyAction(), + match: json['match'] as String?, + ); + } + + Map toJson() { + final action = this.action; + final match = this.match; + return { + if (action != null) 'action': action.toValue(), + if (match != null) 'match': match, + }; + } +} + +/// The managed word details for the filter in the Guardrail. +class GuardrailManagedWord { + /// The action details for the managed word filter in the Guardrail. + final GuardrailWordPolicyAction? action; + + /// The match details for the managed word filter in the Guardrail. + final String? match; + + /// The type details for the managed word filter in the Guardrail. + final GuardrailManagedWordType? type; + + GuardrailManagedWord({ + this.action, + this.match, + this.type, + }); + + factory GuardrailManagedWord.fromJson(Map json) { + return GuardrailManagedWord( + action: (json['action'] as String?)?.toGuardrailWordPolicyAction(), + match: json['match'] as String?, + type: (json['type'] as String?)?.toGuardrailManagedWordType(), + ); + } + + Map toJson() { + final action = this.action; + final match = this.match; + final type = this.type; + return { + if (action != null) 'action': action.toValue(), + if (match != null) 'match': match, + if (type != null) 'type': type.toValue(), + }; + } +} + +enum GuardrailManagedWordType { + profanity, +} + +extension GuardrailManagedWordTypeValueExtension on GuardrailManagedWordType { + String toValue() { + switch (this) { + case GuardrailManagedWordType.profanity: + return 'PROFANITY'; + } + } +} + +extension GuardrailManagedWordTypeFromString on String { + GuardrailManagedWordType toGuardrailManagedWordType() { + switch (this) { + case 'PROFANITY': + return GuardrailManagedWordType.profanity; + } + throw Exception('$this is not known in enum GuardrailManagedWordType'); + } +} + +/// The Guardrail filter to identify and remove personally identifiable +/// information (PII). +class GuardrailPiiEntityFilter { + /// The action of the Guardrail filter to identify and remove PII. + final GuardrailSensitiveInformationPolicyAction? action; + + /// The match to settings in the Guardrail filter to identify and remove PII. + final String? match; + + /// The type of PII the Guardrail filter has identified and removed. + final GuardrailPiiEntityType? type; + + GuardrailPiiEntityFilter({ + this.action, + this.match, + this.type, + }); + + factory GuardrailPiiEntityFilter.fromJson(Map json) { + return GuardrailPiiEntityFilter( + action: (json['action'] as String?) + ?.toGuardrailSensitiveInformationPolicyAction(), + match: json['match'] as String?, + type: (json['type'] as String?)?.toGuardrailPiiEntityType(), + ); + } + + Map toJson() { + final action = this.action; + final match = this.match; + final type = this.type; + return { + if (action != null) 'action': action.toValue(), + if (match != null) 'match': match, + if (type != null) 'type': type.toValue(), + }; + } +} + +enum GuardrailPiiEntityType { + address, + age, + awsAccessKey, + awsSecretKey, + caHealthNumber, + caSocialInsuranceNumber, + creditDebitCardCvv, + creditDebitCardExpiry, + creditDebitCardNumber, + driverId, + email, + internationalBankAccountNumber, + ipAddress, + licensePlate, + macAddress, + name, + password, + phone, + pin, + swiftCode, + ukNationalHealthServiceNumber, + ukNationalInsuranceNumber, + ukUniqueTaxpayerReferenceNumber, + url, + username, + usBankAccountNumber, + usBankRoutingNumber, + usIndividualTaxIdentificationNumber, + usPassportNumber, + usSocialSecurityNumber, + vehicleIdentificationNumber, +} + +extension GuardrailPiiEntityTypeValueExtension on GuardrailPiiEntityType { + String toValue() { + switch (this) { + case GuardrailPiiEntityType.address: + return 'ADDRESS'; + case GuardrailPiiEntityType.age: + return 'AGE'; + case GuardrailPiiEntityType.awsAccessKey: + return 'AWS_ACCESS_KEY'; + case GuardrailPiiEntityType.awsSecretKey: + return 'AWS_SECRET_KEY'; + case GuardrailPiiEntityType.caHealthNumber: + return 'CA_HEALTH_NUMBER'; + case GuardrailPiiEntityType.caSocialInsuranceNumber: + return 'CA_SOCIAL_INSURANCE_NUMBER'; + case GuardrailPiiEntityType.creditDebitCardCvv: + return 'CREDIT_DEBIT_CARD_CVV'; + case GuardrailPiiEntityType.creditDebitCardExpiry: + return 'CREDIT_DEBIT_CARD_EXPIRY'; + case GuardrailPiiEntityType.creditDebitCardNumber: + return 'CREDIT_DEBIT_CARD_NUMBER'; + case GuardrailPiiEntityType.driverId: + return 'DRIVER_ID'; + case GuardrailPiiEntityType.email: + return 'EMAIL'; + case GuardrailPiiEntityType.internationalBankAccountNumber: + return 'INTERNATIONAL_BANK_ACCOUNT_NUMBER'; + case GuardrailPiiEntityType.ipAddress: + return 'IP_ADDRESS'; + case GuardrailPiiEntityType.licensePlate: + return 'LICENSE_PLATE'; + case GuardrailPiiEntityType.macAddress: + return 'MAC_ADDRESS'; + case GuardrailPiiEntityType.name: + return 'NAME'; + case GuardrailPiiEntityType.password: + return 'PASSWORD'; + case GuardrailPiiEntityType.phone: + return 'PHONE'; + case GuardrailPiiEntityType.pin: + return 'PIN'; + case GuardrailPiiEntityType.swiftCode: + return 'SWIFT_CODE'; + case GuardrailPiiEntityType.ukNationalHealthServiceNumber: + return 'UK_NATIONAL_HEALTH_SERVICE_NUMBER'; + case GuardrailPiiEntityType.ukNationalInsuranceNumber: + return 'UK_NATIONAL_INSURANCE_NUMBER'; + case GuardrailPiiEntityType.ukUniqueTaxpayerReferenceNumber: + return 'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER'; + case GuardrailPiiEntityType.url: + return 'URL'; + case GuardrailPiiEntityType.username: + return 'USERNAME'; + case GuardrailPiiEntityType.usBankAccountNumber: + return 'US_BANK_ACCOUNT_NUMBER'; + case GuardrailPiiEntityType.usBankRoutingNumber: + return 'US_BANK_ROUTING_NUMBER'; + case GuardrailPiiEntityType.usIndividualTaxIdentificationNumber: + return 'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER'; + case GuardrailPiiEntityType.usPassportNumber: + return 'US_PASSPORT_NUMBER'; + case GuardrailPiiEntityType.usSocialSecurityNumber: + return 'US_SOCIAL_SECURITY_NUMBER'; + case GuardrailPiiEntityType.vehicleIdentificationNumber: + return 'VEHICLE_IDENTIFICATION_NUMBER'; + } + } +} + +extension GuardrailPiiEntityTypeFromString on String { + GuardrailPiiEntityType toGuardrailPiiEntityType() { + switch (this) { + case 'ADDRESS': + return GuardrailPiiEntityType.address; + case 'AGE': + return GuardrailPiiEntityType.age; + case 'AWS_ACCESS_KEY': + return GuardrailPiiEntityType.awsAccessKey; + case 'AWS_SECRET_KEY': + return GuardrailPiiEntityType.awsSecretKey; + case 'CA_HEALTH_NUMBER': + return GuardrailPiiEntityType.caHealthNumber; + case 'CA_SOCIAL_INSURANCE_NUMBER': + return GuardrailPiiEntityType.caSocialInsuranceNumber; + case 'CREDIT_DEBIT_CARD_CVV': + return GuardrailPiiEntityType.creditDebitCardCvv; + case 'CREDIT_DEBIT_CARD_EXPIRY': + return GuardrailPiiEntityType.creditDebitCardExpiry; + case 'CREDIT_DEBIT_CARD_NUMBER': + return GuardrailPiiEntityType.creditDebitCardNumber; + case 'DRIVER_ID': + return GuardrailPiiEntityType.driverId; + case 'EMAIL': + return GuardrailPiiEntityType.email; + case 'INTERNATIONAL_BANK_ACCOUNT_NUMBER': + return GuardrailPiiEntityType.internationalBankAccountNumber; + case 'IP_ADDRESS': + return GuardrailPiiEntityType.ipAddress; + case 'LICENSE_PLATE': + return GuardrailPiiEntityType.licensePlate; + case 'MAC_ADDRESS': + return GuardrailPiiEntityType.macAddress; + case 'NAME': + return GuardrailPiiEntityType.name; + case 'PASSWORD': + return GuardrailPiiEntityType.password; + case 'PHONE': + return GuardrailPiiEntityType.phone; + case 'PIN': + return GuardrailPiiEntityType.pin; + case 'SWIFT_CODE': + return GuardrailPiiEntityType.swiftCode; + case 'UK_NATIONAL_HEALTH_SERVICE_NUMBER': + return GuardrailPiiEntityType.ukNationalHealthServiceNumber; + case 'UK_NATIONAL_INSURANCE_NUMBER': + return GuardrailPiiEntityType.ukNationalInsuranceNumber; + case 'UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER': + return GuardrailPiiEntityType.ukUniqueTaxpayerReferenceNumber; + case 'URL': + return GuardrailPiiEntityType.url; + case 'USERNAME': + return GuardrailPiiEntityType.username; + case 'US_BANK_ACCOUNT_NUMBER': + return GuardrailPiiEntityType.usBankAccountNumber; + case 'US_BANK_ROUTING_NUMBER': + return GuardrailPiiEntityType.usBankRoutingNumber; + case 'US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER': + return GuardrailPiiEntityType.usIndividualTaxIdentificationNumber; + case 'US_PASSPORT_NUMBER': + return GuardrailPiiEntityType.usPassportNumber; + case 'US_SOCIAL_SECURITY_NUMBER': + return GuardrailPiiEntityType.usSocialSecurityNumber; + case 'VEHICLE_IDENTIFICATION_NUMBER': + return GuardrailPiiEntityType.vehicleIdentificationNumber; + } + throw Exception('$this is not known in enum GuardrailPiiEntityType'); + } +} + +/// The details for the regex filter used in the Guardrail. +class GuardrailRegexFilter { + /// The action details for the regex filter used in the Guardrail. + final GuardrailSensitiveInformationPolicyAction? action; + + /// The match details for the regex filter used in the Guardrail. + final String? match; + + /// The name details for the regex filter used in the Guardrail. + final String? name; + + /// The regex details for the regex filter used in the Guardrail. + final String? regex; + + GuardrailRegexFilter({ + this.action, + this.match, + this.name, + this.regex, + }); + + factory GuardrailRegexFilter.fromJson(Map json) { + return GuardrailRegexFilter( + action: (json['action'] as String?) + ?.toGuardrailSensitiveInformationPolicyAction(), + match: json['match'] as String?, + name: json['name'] as String?, + regex: json['regex'] as String?, + ); + } + + Map toJson() { + final action = this.action; + final match = this.match; + final name = this.name; + final regex = this.regex; + return { + if (action != null) 'action': action.toValue(), + if (match != null) 'match': match, + if (name != null) 'name': name, + if (regex != null) 'regex': regex, + }; + } +} + +enum GuardrailSensitiveInformationPolicyAction { + blocked, + anonymized, +} + +extension GuardrailSensitiveInformationPolicyActionValueExtension + on GuardrailSensitiveInformationPolicyAction { + String toValue() { + switch (this) { + case GuardrailSensitiveInformationPolicyAction.blocked: + return 'BLOCKED'; + case GuardrailSensitiveInformationPolicyAction.anonymized: + return 'ANONYMIZED'; + } + } +} + +extension GuardrailSensitiveInformationPolicyActionFromString on String { + GuardrailSensitiveInformationPolicyAction + toGuardrailSensitiveInformationPolicyAction() { + switch (this) { + case 'BLOCKED': + return GuardrailSensitiveInformationPolicyAction.blocked; + case 'ANONYMIZED': + return GuardrailSensitiveInformationPolicyAction.anonymized; + } + throw Exception( + '$this is not known in enum GuardrailSensitiveInformationPolicyAction'); + } +} + +/// The details of the sensitive policy assessment used in the Guardrail. +class GuardrailSensitiveInformationPolicyAssessment { + /// The details of the PII entities used in the sensitive policy assessment for + /// the Guardrail. + final List? piiEntities; + + /// The details of the regexes used in the sensitive policy assessment for the + /// Guardrail. + final List? regexes; + + GuardrailSensitiveInformationPolicyAssessment({ + this.piiEntities, + this.regexes, + }); + + factory GuardrailSensitiveInformationPolicyAssessment.fromJson( + Map json) { + return GuardrailSensitiveInformationPolicyAssessment( + piiEntities: (json['piiEntities'] as List?) + ?.whereNotNull() + .map((e) => + GuardrailPiiEntityFilter.fromJson(e as Map)) + .toList(), + regexes: (json['regexes'] as List?) + ?.whereNotNull() + .map((e) => GuardrailRegexFilter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final piiEntities = this.piiEntities; + final regexes = this.regexes; + return { + if (piiEntities != null) 'piiEntities': piiEntities, + if (regexes != null) 'regexes': regexes, + }; + } +} + +/// The details for a specific topic defined in the Guardrail. +class GuardrailTopic { + /// The action details on a specific topic in the Guardrail. + final GuardrailTopicPolicyAction? action; + + /// The name details on a specific topic in the Guardrail. + final String? name; + + /// The type details on a specific topic in the Guardrail. + final GuardrailTopicType? type; + + GuardrailTopic({ + this.action, + this.name, + this.type, + }); + + factory GuardrailTopic.fromJson(Map json) { + return GuardrailTopic( + action: (json['action'] as String?)?.toGuardrailTopicPolicyAction(), + name: json['name'] as String?, + type: (json['type'] as String?)?.toGuardrailTopicType(), + ); + } + + Map toJson() { + final action = this.action; + final name = this.name; + final type = this.type; + return { + if (action != null) 'action': action.toValue(), + if (name != null) 'name': name, + if (type != null) 'type': type.toValue(), + }; + } +} + +enum GuardrailTopicPolicyAction { + blocked, +} + +extension GuardrailTopicPolicyActionValueExtension + on GuardrailTopicPolicyAction { + String toValue() { + switch (this) { + case GuardrailTopicPolicyAction.blocked: + return 'BLOCKED'; + } + } +} + +extension GuardrailTopicPolicyActionFromString on String { + GuardrailTopicPolicyAction toGuardrailTopicPolicyAction() { + switch (this) { + case 'BLOCKED': + return GuardrailTopicPolicyAction.blocked; + } + throw Exception('$this is not known in enum GuardrailTopicPolicyAction'); + } +} + +/// The details of the policy assessment used in the Guardrail. +class GuardrailTopicPolicyAssessment { + /// The topic details of the policy assessment used in the Guardrail. + final List? topics; + + GuardrailTopicPolicyAssessment({ + this.topics, + }); + + factory GuardrailTopicPolicyAssessment.fromJson(Map json) { + return GuardrailTopicPolicyAssessment( + topics: (json['topics'] as List?) + ?.whereNotNull() + .map((e) => GuardrailTopic.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final topics = this.topics; + return { + if (topics != null) 'topics': topics, + }; + } +} + +enum GuardrailTopicType { + deny, +} + +extension GuardrailTopicTypeValueExtension on GuardrailTopicType { + String toValue() { + switch (this) { + case GuardrailTopicType.deny: + return 'DENY'; + } + } +} + +extension GuardrailTopicTypeFromString on String { + GuardrailTopicType toGuardrailTopicType() { + switch (this) { + case 'DENY': + return GuardrailTopicType.deny; + } + throw Exception('$this is not known in enum GuardrailTopicType'); + } +} + +/// The trace details used in the Guardrail. +class GuardrailTrace { + /// The trace action details used with the Guardrail. + final GuardrailAction? action; + + /// The details of the input assessments used in the Guardrail Trace. + final List? inputAssessments; + + /// The details of the output assessments used in the Guardrail Trace. + final List? outputAssessments; + + /// The details of the trace Id used in the Guardrail Trace. + final String? traceId; + + GuardrailTrace({ + this.action, + this.inputAssessments, + this.outputAssessments, + this.traceId, + }); + + factory GuardrailTrace.fromJson(Map json) { + return GuardrailTrace( + action: (json['action'] as String?)?.toGuardrailAction(), + inputAssessments: (json['inputAssessments'] as List?) + ?.whereNotNull() + .map((e) => GuardrailAssessment.fromJson(e as Map)) + .toList(), + outputAssessments: (json['outputAssessments'] as List?) + ?.whereNotNull() + .map((e) => GuardrailAssessment.fromJson(e as Map)) + .toList(), + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final action = this.action; + final inputAssessments = this.inputAssessments; + final outputAssessments = this.outputAssessments; + final traceId = this.traceId; + return { + if (action != null) 'action': action.toValue(), + if (inputAssessments != null) 'inputAssessments': inputAssessments, + if (outputAssessments != null) 'outputAssessments': outputAssessments, + if (traceId != null) 'traceId': traceId, + }; + } +} + +enum GuardrailWordPolicyAction { + blocked, +} + +extension GuardrailWordPolicyActionValueExtension on GuardrailWordPolicyAction { + String toValue() { + switch (this) { + case GuardrailWordPolicyAction.blocked: + return 'BLOCKED'; + } + } +} + +extension GuardrailWordPolicyActionFromString on String { + GuardrailWordPolicyAction toGuardrailWordPolicyAction() { + switch (this) { + case 'BLOCKED': + return GuardrailWordPolicyAction.blocked; + } + throw Exception('$this is not known in enum GuardrailWordPolicyAction'); + } +} + +/// The assessment details for words defined in the Guardrail filter. +class GuardrailWordPolicyAssessment { + /// The custom word details for words defined in the Guardrail filter. + final List? customWords; + + /// The managed word lists for words defined in the Guardrail filter. + final List? managedWordLists; + + GuardrailWordPolicyAssessment({ + this.customWords, + this.managedWordLists, + }); + + factory GuardrailWordPolicyAssessment.fromJson(Map json) { + return GuardrailWordPolicyAssessment( + customWords: (json['customWords'] as List?) + ?.whereNotNull() + .map((e) => GuardrailCustomWord.fromJson(e as Map)) + .toList(), + managedWordLists: (json['managedWordLists'] as List?) + ?.whereNotNull() + .map((e) => GuardrailManagedWord.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final customWords = this.customWords; + final managedWordLists = this.managedWordLists; + return { + if (customWords != null) 'customWords': customWords, + if (managedWordLists != null) 'managedWordLists': managedWordLists, + }; + } +} + +/// The configuration for inference settings when generating responses using +/// RetrieveAndGenerate. +class InferenceConfig { + /// Configuration settings specific to text generation while generating + /// responses using RetrieveAndGenerate. + final TextInferenceConfig? textInferenceConfig; + + InferenceConfig({ + this.textInferenceConfig, + }); + + Map toJson() { + final textInferenceConfig = this.textInferenceConfig; + return { + if (textInferenceConfig != null) + 'textInferenceConfig': textInferenceConfig, + }; + } +} + +/// Specifications about the inference parameters that were provided alongside +/// the prompt. These are specified in the PromptOverrideConfiguration +/// object that was set when the agent was created or updated. For more +/// information, see Inference +/// parameters for foundation models. +class InferenceConfiguration { + /// The maximum number of tokens allowed in the generated response. + final int? maximumLength; + + /// A list of stop sequences. A stop sequence is a sequence of characters that + /// causes the model to stop generating the response. + final List? stopSequences; + + /// The likelihood of the model selecting higher-probability options while + /// generating a response. A lower value makes the model more likely to choose + /// higher-probability options, while a higher value makes the model more likely + /// to choose lower-probability options. + final double? temperature; + + /// While generating a response, the model determines the probability of the + /// following token at each point of generation. The value that you set for + /// topK is the number of most-likely candidates from which the + /// model chooses the next token in the sequence. For example, if you set + /// topK to 50, the model selects the next token from among the top + /// 50 most likely choices. + final int? topK; + + /// While generating a response, the model determines the probability of the + /// following token at each point of generation. The value that you set for + /// Top P determines the number of most-likely candidates from + /// which the model chooses the next token in the sequence. For example, if you + /// set topP to 80, the model only selects the next token from the + /// top 80% of the probability distribution of next tokens. + final double? topP; + + InferenceConfiguration({ + this.maximumLength, + this.stopSequences, + this.temperature, + this.topK, + this.topP, + }); + + factory InferenceConfiguration.fromJson(Map json) { + return InferenceConfiguration( + maximumLength: json['maximumLength'] as int?, + stopSequences: (json['stopSequences'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + temperature: json['temperature'] as double?, + topK: json['topK'] as int?, + topP: json['topP'] as double?, + ); + } + + Map toJson() { + final maximumLength = this.maximumLength; + final stopSequences = this.stopSequences; + final temperature = this.temperature; + final topK = this.topK; + final topP = this.topP; + return { + if (maximumLength != null) 'maximumLength': maximumLength, + if (stopSequences != null) 'stopSequences': stopSequences, + if (temperature != null) 'temperature': temperature, + if (topK != null) 'topK': topK, + if (topP != null) 'topP': topP, + }; + } +} + +/// An internal server error occurred. Retry your request. +class InternalServerException implements _s.AwsException { + final String? message; + + InternalServerException({ + this.message, + }); + + factory InternalServerException.fromJson(Map json) { + return InternalServerException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Contains information pertaining to the action group or knowledge base that +/// is being invoked. +class InvocationInput { + /// Contains information about the action group to be invoked. + final ActionGroupInvocationInput? actionGroupInvocationInput; + + /// Specifies whether the agent is invoking an action group or a knowledge base. + final InvocationType? invocationType; + + /// Contains details about the knowledge base to look up and the query to be + /// made. + final KnowledgeBaseLookupInput? knowledgeBaseLookupInput; + + /// The unique identifier of the trace. + final String? traceId; + + InvocationInput({ + this.actionGroupInvocationInput, + this.invocationType, + this.knowledgeBaseLookupInput, + this.traceId, + }); + + factory InvocationInput.fromJson(Map json) { + return InvocationInput( + actionGroupInvocationInput: json['actionGroupInvocationInput'] != null + ? ActionGroupInvocationInput.fromJson( + json['actionGroupInvocationInput'] as Map) + : null, + invocationType: (json['invocationType'] as String?)?.toInvocationType(), + knowledgeBaseLookupInput: json['knowledgeBaseLookupInput'] != null + ? KnowledgeBaseLookupInput.fromJson( + json['knowledgeBaseLookupInput'] as Map) + : null, + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final actionGroupInvocationInput = this.actionGroupInvocationInput; + final invocationType = this.invocationType; + final knowledgeBaseLookupInput = this.knowledgeBaseLookupInput; + final traceId = this.traceId; + return { + if (actionGroupInvocationInput != null) + 'actionGroupInvocationInput': actionGroupInvocationInput, + if (invocationType != null) 'invocationType': invocationType.toValue(), + if (knowledgeBaseLookupInput != null) + 'knowledgeBaseLookupInput': knowledgeBaseLookupInput, + if (traceId != null) 'traceId': traceId, + }; + } +} + +/// Contains details about the API operation or function that the agent predicts +/// should be called. +/// +/// This data type is used in the following API operations: +/// +/// +class InvocationInputMember { + /// Contains information about the API operation that the agent predicts should + /// be called. + final ApiInvocationInput? apiInvocationInput; + + /// Contains information about the function that the agent predicts should be + /// called. + final FunctionInvocationInput? functionInvocationInput; + + InvocationInputMember({ + this.apiInvocationInput, + this.functionInvocationInput, + }); + + factory InvocationInputMember.fromJson(Map json) { + return InvocationInputMember( + apiInvocationInput: json['apiInvocationInput'] != null + ? ApiInvocationInput.fromJson( + json['apiInvocationInput'] as Map) + : null, + functionInvocationInput: json['functionInvocationInput'] != null + ? FunctionInvocationInput.fromJson( + json['functionInvocationInput'] as Map) + : null, + ); + } + + Map toJson() { + final apiInvocationInput = this.apiInvocationInput; + final functionInvocationInput = this.functionInvocationInput; + return { + if (apiInvocationInput != null) 'apiInvocationInput': apiInvocationInput, + if (functionInvocationInput != null) + 'functionInvocationInput': functionInvocationInput, + }; + } +} + +/// A result from the invocation of an action. For more information, see Return +/// control to the agent developer and Control +/// session context. +/// +/// This data type is used in the following API operations: +/// +/// +class InvocationResultMember { + /// The result from the API response from the action group invocation. + final ApiResult? apiResult; + + /// The result from the function from the action group invocation. + final FunctionResult? functionResult; + + InvocationResultMember({ + this.apiResult, + this.functionResult, + }); + + Map toJson() { + final apiResult = this.apiResult; + final functionResult = this.functionResult; + return { + if (apiResult != null) 'apiResult': apiResult, + if (functionResult != null) 'functionResult': functionResult, + }; + } +} + +enum InvocationType { + actionGroup, + knowledgeBase, + finish, +} + +extension InvocationTypeValueExtension on InvocationType { + String toValue() { + switch (this) { + case InvocationType.actionGroup: + return 'ACTION_GROUP'; + case InvocationType.knowledgeBase: + return 'KNOWLEDGE_BASE'; + case InvocationType.finish: + return 'FINISH'; + } + } +} + +extension InvocationTypeFromString on String { + InvocationType toInvocationType() { + switch (this) { + case 'ACTION_GROUP': + return InvocationType.actionGroup; + case 'KNOWLEDGE_BASE': + return InvocationType.knowledgeBase; + case 'FINISH': + return InvocationType.finish; + } + throw Exception('$this is not known in enum InvocationType'); + } +} + +class InvokeAgentResponse { + /// The agent's response to the user prompt. + final ResponseStream completion; + + /// The MIME type of the input data in the request. The default value is + /// application/json. + final String contentType; + + /// The unique identifier of the session with the agent. + final String sessionId; + + InvokeAgentResponse({ + required this.completion, + required this.contentType, + required this.sessionId, + }); + + Map toJson() { + final completion = this.completion; + final contentType = this.contentType; + final sessionId = this.sessionId; + return { + 'completion': completion, + }; + } +} + +/// Contains details about the knowledge base to look up and the query to be +/// made. +class KnowledgeBaseLookupInput { + /// The unique identifier of the knowledge base to look up. + final String? knowledgeBaseId; + + /// The query made to the knowledge base. + final String? text; + + KnowledgeBaseLookupInput({ + this.knowledgeBaseId, + this.text, + }); + + factory KnowledgeBaseLookupInput.fromJson(Map json) { + return KnowledgeBaseLookupInput( + knowledgeBaseId: json['knowledgeBaseId'] as String?, + text: json['text'] as String?, + ); + } + + Map toJson() { + final knowledgeBaseId = this.knowledgeBaseId; + final text = this.text; + return { + if (knowledgeBaseId != null) 'knowledgeBaseId': knowledgeBaseId, + if (text != null) 'text': text, + }; + } +} + +/// Contains details about the results from looking up the knowledge base. +class KnowledgeBaseLookupOutput { + /// Contains metadata about the sources cited for the generated response. + final List? retrievedReferences; + + KnowledgeBaseLookupOutput({ + this.retrievedReferences, + }); + + factory KnowledgeBaseLookupOutput.fromJson(Map json) { + return KnowledgeBaseLookupOutput( + retrievedReferences: (json['retrievedReferences'] as List?) + ?.whereNotNull() + .map((e) => RetrievedReference.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final retrievedReferences = this.retrievedReferences; + return { + if (retrievedReferences != null) + 'retrievedReferences': retrievedReferences, + }; + } +} + +/// Contains the query made to the knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class KnowledgeBaseQuery { + /// The text of the query made to the knowledge base. + final String text; + + KnowledgeBaseQuery({ + required this.text, + }); + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +/// Contains configurations for the knowledge base query and retrieval process. +/// For more information, see Query +/// configurations. +/// +/// This data type is used in the following API operations: +/// +/// +class KnowledgeBaseRetrievalConfiguration { + /// Contains details about how the results from the vector search should be + /// returned. For more information, see Query + /// configurations. + final KnowledgeBaseVectorSearchConfiguration vectorSearchConfiguration; + + KnowledgeBaseRetrievalConfiguration({ + required this.vectorSearchConfiguration, + }); + + Map toJson() { + final vectorSearchConfiguration = this.vectorSearchConfiguration; + return { + 'vectorSearchConfiguration': vectorSearchConfiguration, + }; + } +} + +/// Details about a result from querying the knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class KnowledgeBaseRetrievalResult { + /// Contains a chunk of text from a data source in the knowledge base. + final RetrievalResultContent content; + + /// Contains information about the location of the data source. + final RetrievalResultLocation? location; + + /// Contains metadata attributes and their values for the file in the data + /// source. For more information, see Metadata + /// and filtering. + final Map? metadata; + + /// The level of relevance of the result to the query. + final double? score; + + KnowledgeBaseRetrievalResult({ + required this.content, + this.location, + this.metadata, + this.score, + }); + + factory KnowledgeBaseRetrievalResult.fromJson(Map json) { + return KnowledgeBaseRetrievalResult( + content: RetrievalResultContent.fromJson( + json['content'] as Map), + location: json['location'] != null + ? RetrievalResultLocation.fromJson( + json['location'] as Map) + : null, + metadata: (json['metadata'] as Map?)?.map((k, e) => + MapEntry( + k, + RetrievalResultMetadataValue.fromJson( + e as Map))), + score: json['score'] as double?, + ); + } + + Map toJson() { + final content = this.content; + final location = this.location; + final metadata = this.metadata; + final score = this.score; + return { + 'content': content, + if (location != null) 'location': location, + if (metadata != null) 'metadata': metadata, + if (score != null) 'score': score, + }; + } +} + +/// Contains details about the resource being queried. +/// +/// This data type is used in the following API operations: +/// +/// +class KnowledgeBaseRetrieveAndGenerateConfiguration { + /// The unique identifier of the knowledge base that is queried and the + /// foundation model used for generation. + final String knowledgeBaseId; + + /// The ARN of the foundation model used to generate a response. + final String modelArn; + + /// Contains configurations for response generation based on the knowwledge base + /// query results. + final GenerationConfiguration? generationConfiguration; + + /// Contains configurations for how to retrieve and return the knowledge base + /// query. + final KnowledgeBaseRetrievalConfiguration? retrievalConfiguration; + + KnowledgeBaseRetrieveAndGenerateConfiguration({ + required this.knowledgeBaseId, + required this.modelArn, + this.generationConfiguration, + this.retrievalConfiguration, + }); + + Map toJson() { + final knowledgeBaseId = this.knowledgeBaseId; + final modelArn = this.modelArn; + final generationConfiguration = this.generationConfiguration; + final retrievalConfiguration = this.retrievalConfiguration; + return { + 'knowledgeBaseId': knowledgeBaseId, + 'modelArn': modelArn, + if (generationConfiguration != null) + 'generationConfiguration': generationConfiguration, + if (retrievalConfiguration != null) + 'retrievalConfiguration': retrievalConfiguration, + }; + } +} + +/// Configurations for how to perform the search query and return results. For +/// more information, see Query +/// configurations. +/// +/// This data type is used in the following API operations: +/// +/// +class KnowledgeBaseVectorSearchConfiguration { + /// Specifies the filters to use on the metadata in the knowledge base data + /// sources before returning results. For more information, see Query + /// configurations. + final RetrievalFilter? filter; + + /// The number of source chunks to retrieve. + final int? numberOfResults; + + /// By default, Amazon Bedrock decides a search strategy for you. If you're + /// using an Amazon OpenSearch Serverless vector store that contains a + /// filterable text field, you can specify whether to query the knowledge base + /// with a HYBRID search using both vector embeddings and raw text, + /// or SEMANTIC search using only vector embeddings. For other + /// vector store configurations, only SEMANTIC search is available. + /// For more information, see Test + /// a knowledge base. + final SearchType? overrideSearchType; + + KnowledgeBaseVectorSearchConfiguration({ + this.filter, + this.numberOfResults, + this.overrideSearchType, + }); + + Map toJson() { + final filter = this.filter; + final numberOfResults = this.numberOfResults; + final overrideSearchType = this.overrideSearchType; + return { + if (filter != null) 'filter': filter, + if (numberOfResults != null) 'numberOfResults': numberOfResults, + if (overrideSearchType != null) + 'overrideSearchType': overrideSearchType.toValue(), + }; + } +} + +/// The input for the pre-processing step. +/// +///
      +///
    • +/// The type matches the agent step. +///
    • +///
    • +/// The text contains the prompt. +///
    • +///
    • +/// The inferenceConfiguration, parserMode, and +/// overrideLambda values are set in the PromptOverrideConfiguration +/// object that was set when the agent was created or updated. +///
    • +///
    +class ModelInvocationInput { + /// Specifications about the inference parameters that were provided alongside + /// the prompt. These are specified in the PromptOverrideConfiguration + /// object that was set when the agent was created or updated. For more + /// information, see Inference + /// parameters for foundation models. + final InferenceConfiguration? inferenceConfiguration; + + /// The ARN of the Lambda function to use when parsing the raw foundation model + /// output in parts of the agent sequence. + final String? overrideLambda; + + /// Specifies whether to override the default parser Lambda function when + /// parsing the raw foundation model output in the part of the agent sequence + /// defined by the promptType. + final CreationMode? parserMode; + + /// Specifies whether the default prompt template was OVERRIDDEN. + /// If it was, the basePromptTemplate that was set in the PromptOverrideConfiguration + /// object when the agent was created or updated is used instead. + final CreationMode? promptCreationMode; + + /// The text that prompted the agent at this step. + final String? text; + + /// The unique identifier of the trace. + final String? traceId; + + /// The step in the agent sequence. + final PromptType? type; + + ModelInvocationInput({ + this.inferenceConfiguration, + this.overrideLambda, + this.parserMode, + this.promptCreationMode, + this.text, + this.traceId, + this.type, + }); + + factory ModelInvocationInput.fromJson(Map json) { + return ModelInvocationInput( + inferenceConfiguration: json['inferenceConfiguration'] != null + ? InferenceConfiguration.fromJson( + json['inferenceConfiguration'] as Map) + : null, + overrideLambda: json['overrideLambda'] as String?, + parserMode: (json['parserMode'] as String?)?.toCreationMode(), + promptCreationMode: + (json['promptCreationMode'] as String?)?.toCreationMode(), + text: json['text'] as String?, + traceId: json['traceId'] as String?, + type: (json['type'] as String?)?.toPromptType(), + ); + } + + Map toJson() { + final inferenceConfiguration = this.inferenceConfiguration; + final overrideLambda = this.overrideLambda; + final parserMode = this.parserMode; + final promptCreationMode = this.promptCreationMode; + final text = this.text; + final traceId = this.traceId; + final type = this.type; + return { + if (inferenceConfiguration != null) + 'inferenceConfiguration': inferenceConfiguration, + if (overrideLambda != null) 'overrideLambda': overrideLambda, + if (parserMode != null) 'parserMode': parserMode.toValue(), + if (promptCreationMode != null) + 'promptCreationMode': promptCreationMode.toValue(), + if (text != null) 'text': text, + if (traceId != null) 'traceId': traceId, + if (type != null) 'type': type.toValue(), + }; + } +} + +/// Contains the result or output of an action group or knowledge base, or the +/// response to the user. +class Observation { + /// Contains the JSON-formatted string returned by the API invoked by the action + /// group. + final ActionGroupInvocationOutput? actionGroupInvocationOutput; + + /// Contains details about the response to the user. + final FinalResponse? finalResponse; + + /// Contains details about the results from looking up the knowledge base. + final KnowledgeBaseLookupOutput? knowledgeBaseLookupOutput; + + /// Contains details about the response to reprompt the input. + final RepromptResponse? repromptResponse; + + /// The unique identifier of the trace. + final String? traceId; + + /// Specifies what kind of information the agent returns in the observation. The + /// following values are possible. + /// + ///
      + ///
    • + /// ACTION_GROUP – The agent returns the result of an action group. + ///
    • + ///
    • + /// KNOWLEDGE_BASE – The agent returns information from a knowledge + /// base. + ///
    • + ///
    • + /// FINISH – The agent returns a final response to the user with no + /// follow-up. + ///
    • + ///
    • + /// ASK_USER – The agent asks the user a question. + ///
    • + ///
    • + /// REPROMPT – The agent prompts the user again for the same + /// information. + ///
    • + ///
    + final Type? type; + + Observation({ + this.actionGroupInvocationOutput, + this.finalResponse, + this.knowledgeBaseLookupOutput, + this.repromptResponse, + this.traceId, + this.type, + }); + + factory Observation.fromJson(Map json) { + return Observation( + actionGroupInvocationOutput: json['actionGroupInvocationOutput'] != null + ? ActionGroupInvocationOutput.fromJson( + json['actionGroupInvocationOutput'] as Map) + : null, + finalResponse: json['finalResponse'] != null + ? FinalResponse.fromJson( + json['finalResponse'] as Map) + : null, + knowledgeBaseLookupOutput: json['knowledgeBaseLookupOutput'] != null + ? KnowledgeBaseLookupOutput.fromJson( + json['knowledgeBaseLookupOutput'] as Map) + : null, + repromptResponse: json['repromptResponse'] != null + ? RepromptResponse.fromJson( + json['repromptResponse'] as Map) + : null, + traceId: json['traceId'] as String?, + type: (json['type'] as String?)?.toType(), + ); + } + + Map toJson() { + final actionGroupInvocationOutput = this.actionGroupInvocationOutput; + final finalResponse = this.finalResponse; + final knowledgeBaseLookupOutput = this.knowledgeBaseLookupOutput; + final repromptResponse = this.repromptResponse; + final traceId = this.traceId; + final type = this.type; + return { + if (actionGroupInvocationOutput != null) + 'actionGroupInvocationOutput': actionGroupInvocationOutput, + if (finalResponse != null) 'finalResponse': finalResponse, + if (knowledgeBaseLookupOutput != null) + 'knowledgeBaseLookupOutput': knowledgeBaseLookupOutput, + if (repromptResponse != null) 'repromptResponse': repromptResponse, + if (traceId != null) 'traceId': traceId, + if (type != null) 'type': type.toValue(), + }; + } +} + +/// Details about the orchestration step, in which the agent determines the +/// order in which actions are executed and which knowledge bases are retrieved. +class OrchestrationTrace { + /// Contains information pertaining to the action group or knowledge base that + /// is being invoked. + final InvocationInput? invocationInput; + + /// The input for the orchestration step. + /// + ///
      + ///
    • + /// The type is ORCHESTRATION. + ///
    • + ///
    • + /// The text contains the prompt. + ///
    • + ///
    • + /// The inferenceConfiguration, parserMode, and + /// overrideLambda values are set in the PromptOverrideConfiguration + /// object that was set when the agent was created or updated. + ///
    • + ///
    + final ModelInvocationInput? modelInvocationInput; + + /// Details about the observation (the output of the action group Lambda or + /// knowledge base) made by the agent. + final Observation? observation; + + /// Details about the reasoning, based on the input, that the agent uses to + /// justify carrying out an action group or getting information from a knowledge + /// base. + final Rationale? rationale; + + OrchestrationTrace({ + this.invocationInput, + this.modelInvocationInput, + this.observation, + this.rationale, + }); + + factory OrchestrationTrace.fromJson(Map json) { + return OrchestrationTrace( + invocationInput: json['invocationInput'] != null + ? InvocationInput.fromJson( + json['invocationInput'] as Map) + : null, + modelInvocationInput: json['modelInvocationInput'] != null + ? ModelInvocationInput.fromJson( + json['modelInvocationInput'] as Map) + : null, + observation: json['observation'] != null + ? Observation.fromJson(json['observation'] as Map) + : null, + rationale: json['rationale'] != null + ? Rationale.fromJson(json['rationale'] as Map) + : null, + ); + } + + Map toJson() { + final invocationInput = this.invocationInput; + final modelInvocationInput = this.modelInvocationInput; + final observation = this.observation; + final rationale = this.rationale; + return { + if (invocationInput != null) 'invocationInput': invocationInput, + if (modelInvocationInput != null) + 'modelInvocationInput': modelInvocationInput, + if (observation != null) 'observation': observation, + if (rationale != null) 'rationale': rationale, + }; + } +} + +/// A parameter for the API request or function. +class Parameter { + /// The name of the parameter. + final String? name; + + /// The type of the parameter. + final String? type; + + /// The value of the parameter. + final String? value; + + Parameter({ + this.name, + this.type, + this.value, + }); + + factory Parameter.fromJson(Map json) { + return Parameter( + name: json['name'] as String?, + type: json['type'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + final value = this.value; + return { + if (name != null) 'name': name, + if (type != null) 'type': type, + if (value != null) 'value': value, + }; + } +} + +/// Contains a part of an agent response and citations for it. +class PayloadPart { + /// Contains citations for a part of an agent response. + final Attribution? attribution; + + /// A part of the agent response in bytes. + final Uint8List? bytes; + + PayloadPart({ + this.attribution, + this.bytes, + }); + + factory PayloadPart.fromJson(Map json) { + return PayloadPart( + attribution: json['attribution'] != null + ? Attribution.fromJson(json['attribution'] as Map) + : null, + bytes: _s.decodeNullableUint8List(json['bytes'] as String?), + ); + } + + Map toJson() { + final attribution = this.attribution; + final bytes = this.bytes; + return { + if (attribution != null) 'attribution': attribution, + if (bytes != null) 'bytes': base64Encode(bytes), + }; + } +} + +/// The foundation model output from the post-processing step. +class PostProcessingModelInvocationOutput { + /// Details about the response from the Lambda parsing of the output of the + /// post-processing step. + final PostProcessingParsedResponse? parsedResponse; + + /// The unique identifier of the trace. + final String? traceId; + + PostProcessingModelInvocationOutput({ + this.parsedResponse, + this.traceId, + }); + + factory PostProcessingModelInvocationOutput.fromJson( + Map json) { + return PostProcessingModelInvocationOutput( + parsedResponse: json['parsedResponse'] != null + ? PostProcessingParsedResponse.fromJson( + json['parsedResponse'] as Map) + : null, + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final parsedResponse = this.parsedResponse; + final traceId = this.traceId; + return { + if (parsedResponse != null) 'parsedResponse': parsedResponse, + if (traceId != null) 'traceId': traceId, + }; + } +} + +/// Details about the response from the Lambda parsing of the output from the +/// post-processing step. +class PostProcessingParsedResponse { + /// The text returned by the parser. + final String? text; + + PostProcessingParsedResponse({ + this.text, + }); + + factory PostProcessingParsedResponse.fromJson(Map json) { + return PostProcessingParsedResponse( + text: json['text'] as String?, + ); + } + + Map toJson() { + final text = this.text; + return { + if (text != null) 'text': text, + }; + } +} + +/// Details about the post-processing step, in which the agent shapes the +/// response. +class PostProcessingTrace { + /// The input for the post-processing step. + /// + ///
      + ///
    • + /// The type is POST_PROCESSING. + ///
    • + ///
    • + /// The text contains the prompt. + ///
    • + ///
    • + /// The inferenceConfiguration, parserMode, and + /// overrideLambda values are set in the PromptOverrideConfiguration + /// object that was set when the agent was created or updated. + ///
    • + ///
    + final ModelInvocationInput? modelInvocationInput; + + /// The foundation model output from the post-processing step. + final PostProcessingModelInvocationOutput? modelInvocationOutput; + + PostProcessingTrace({ + this.modelInvocationInput, + this.modelInvocationOutput, + }); + + factory PostProcessingTrace.fromJson(Map json) { + return PostProcessingTrace( + modelInvocationInput: json['modelInvocationInput'] != null + ? ModelInvocationInput.fromJson( + json['modelInvocationInput'] as Map) + : null, + modelInvocationOutput: json['modelInvocationOutput'] != null + ? PostProcessingModelInvocationOutput.fromJson( + json['modelInvocationOutput'] as Map) + : null, + ); + } + + Map toJson() { + final modelInvocationInput = this.modelInvocationInput; + final modelInvocationOutput = this.modelInvocationOutput; + return { + if (modelInvocationInput != null) + 'modelInvocationInput': modelInvocationInput, + if (modelInvocationOutput != null) + 'modelInvocationOutput': modelInvocationOutput, + }; + } +} + +/// The foundation model output from the pre-processing step. +class PreProcessingModelInvocationOutput { + /// Details about the response from the Lambda parsing of the output of the + /// pre-processing step. + final PreProcessingParsedResponse? parsedResponse; + + /// The unique identifier of the trace. + final String? traceId; + + PreProcessingModelInvocationOutput({ + this.parsedResponse, + this.traceId, + }); + + factory PreProcessingModelInvocationOutput.fromJson( + Map json) { + return PreProcessingModelInvocationOutput( + parsedResponse: json['parsedResponse'] != null + ? PreProcessingParsedResponse.fromJson( + json['parsedResponse'] as Map) + : null, + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final parsedResponse = this.parsedResponse; + final traceId = this.traceId; + return { + if (parsedResponse != null) 'parsedResponse': parsedResponse, + if (traceId != null) 'traceId': traceId, + }; + } +} + +/// Details about the response from the Lambda parsing of the output from the +/// pre-processing step. +class PreProcessingParsedResponse { + /// Whether the user input is valid or not. If false, the agent + /// doesn't proceed to orchestration. + final bool? isValid; + + /// The text returned by the parsing of the pre-processing step, explaining the + /// steps that the agent plans to take in orchestration, if the user input is + /// valid. + final String? rationale; + + PreProcessingParsedResponse({ + this.isValid, + this.rationale, + }); + + factory PreProcessingParsedResponse.fromJson(Map json) { + return PreProcessingParsedResponse( + isValid: json['isValid'] as bool?, + rationale: json['rationale'] as String?, + ); + } + + Map toJson() { + final isValid = this.isValid; + final rationale = this.rationale; + return { + if (isValid != null) 'isValid': isValid, + if (rationale != null) 'rationale': rationale, + }; + } +} + +/// Details about the pre-processing step, in which the agent contextualizes and +/// categorizes user inputs. +class PreProcessingTrace { + /// The input for the pre-processing step. + /// + ///
      + ///
    • + /// The type is PRE_PROCESSING. + ///
    • + ///
    • + /// The text contains the prompt. + ///
    • + ///
    • + /// The inferenceConfiguration, parserMode, and + /// overrideLambda values are set in the PromptOverrideConfiguration + /// object that was set when the agent was created or updated. + ///
    • + ///
    + final ModelInvocationInput? modelInvocationInput; + + /// The foundation model output from the pre-processing step. + final PreProcessingModelInvocationOutput? modelInvocationOutput; + + PreProcessingTrace({ + this.modelInvocationInput, + this.modelInvocationOutput, + }); + + factory PreProcessingTrace.fromJson(Map json) { + return PreProcessingTrace( + modelInvocationInput: json['modelInvocationInput'] != null + ? ModelInvocationInput.fromJson( + json['modelInvocationInput'] as Map) + : null, + modelInvocationOutput: json['modelInvocationOutput'] != null + ? PreProcessingModelInvocationOutput.fromJson( + json['modelInvocationOutput'] as Map) + : null, + ); + } + + Map toJson() { + final modelInvocationInput = this.modelInvocationInput; + final modelInvocationOutput = this.modelInvocationOutput; + return { + if (modelInvocationInput != null) + 'modelInvocationInput': modelInvocationInput, + if (modelInvocationOutput != null) + 'modelInvocationOutput': modelInvocationOutput, + }; + } +} + +/// Contains the template for the prompt that's sent to the model for response +/// generation. For more information, see Knowledge +/// base prompt templates. +/// +/// This data type is used in the following API operations: +/// +/// +class PromptTemplate { + /// The template for the prompt that's sent to the model for response + /// generation. You can include prompt placeholders, which become replaced + /// before the prompt is sent to the model to provide instructions and context + /// to the model. In addition, you can include XML tags to delineate meaningful + /// sections of the prompt template. + /// + /// For more information, see the following resources: + /// + /// + final String? textPromptTemplate; + + PromptTemplate({ + this.textPromptTemplate, + }); + + Map toJson() { + final textPromptTemplate = this.textPromptTemplate; + return { + if (textPromptTemplate != null) 'textPromptTemplate': textPromptTemplate, + }; + } +} + +enum PromptType { + preProcessing, + orchestration, + knowledgeBaseResponseGeneration, + postProcessing, +} + +extension PromptTypeValueExtension on PromptType { + String toValue() { + switch (this) { + case PromptType.preProcessing: + return 'PRE_PROCESSING'; + case PromptType.orchestration: + return 'ORCHESTRATION'; + case PromptType.knowledgeBaseResponseGeneration: + return 'KNOWLEDGE_BASE_RESPONSE_GENERATION'; + case PromptType.postProcessing: + return 'POST_PROCESSING'; + } + } +} + +extension PromptTypeFromString on String { + PromptType toPromptType() { + switch (this) { + case 'PRE_PROCESSING': + return PromptType.preProcessing; + case 'ORCHESTRATION': + return PromptType.orchestration; + case 'KNOWLEDGE_BASE_RESPONSE_GENERATION': + return PromptType.knowledgeBaseResponseGeneration; + case 'POST_PROCESSING': + return PromptType.postProcessing; + } + throw Exception('$this is not known in enum PromptType'); + } +} + +/// Contains the parameters in the request body. +class PropertyParameters { + /// A list of parameters in the request body. + final List? properties; + + PropertyParameters({ + this.properties, + }); + + factory PropertyParameters.fromJson(Map json) { + return PropertyParameters( + properties: (json['properties'] as List?) + ?.whereNotNull() + .map((e) => Parameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final properties = this.properties; + return { + if (properties != null) 'properties': properties, + }; + } +} + +/// Contains the reasoning, based on the input, that the agent uses to justify +/// carrying out an action group or getting information from a knowledge base. +class Rationale { + /// The reasoning or thought process of the agent, based on the input. + final String? text; + + /// The unique identifier of the trace step. + final String? traceId; + + Rationale({ + this.text, + this.traceId, + }); + + factory Rationale.fromJson(Map json) { + return Rationale( + text: json['text'] as String?, + traceId: json['traceId'] as String?, + ); + } + + Map toJson() { + final text = this.text; + final traceId = this.traceId; + return { + if (text != null) 'text': text, + if (traceId != null) 'traceId': traceId, + }; + } +} + +/// Contains details about the agent's response to reprompt the input. +class RepromptResponse { + /// Specifies what output is prompting the agent to reprompt the input. + final Source? source; + + /// The text reprompting the input. + final String? text; + + RepromptResponse({ + this.source, + this.text, + }); + + factory RepromptResponse.fromJson(Map json) { + return RepromptResponse( + source: (json['source'] as String?)?.toSource(), + text: json['text'] as String?, + ); + } + + Map toJson() { + final source = this.source; + final text = this.text; + return { + if (source != null) 'source': source.toValue(), + if (text != null) 'text': text, + }; + } +} + +/// The parameters in the API request body. +class RequestBody { + /// The content in the request body. + final Map>? content; + + RequestBody({ + this.content, + }); + + factory RequestBody.fromJson(Map json) { + return RequestBody( + content: (json['content'] as Map?)?.map((k, e) => + MapEntry( + k, + (e as List) + .whereNotNull() + .map((e) => Parameter.fromJson(e as Map)) + .toList())), + ); + } + + Map toJson() { + final content = this.content; + return { + if (content != null) 'content': content, + }; + } +} + +/// The specified resource Amazon Resource Name (ARN) was not found. Check the +/// Amazon Resource Name (ARN) and try your request again. +class ResourceNotFoundException implements _s.AwsException { + final String? message; + + ResourceNotFoundException({ + this.message, + }); + + factory ResourceNotFoundException.fromJson(Map json) { + return ResourceNotFoundException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +enum ResponseState { + failure, + reprompt, +} + +extension ResponseStateValueExtension on ResponseState { + String toValue() { + switch (this) { + case ResponseState.failure: + return 'FAILURE'; + case ResponseState.reprompt: + return 'REPROMPT'; + } + } +} + +extension ResponseStateFromString on String { + ResponseState toResponseState() { + switch (this) { + case 'FAILURE': + return ResponseState.failure; + case 'REPROMPT': + return ResponseState.reprompt; + } + throw Exception('$this is not known in enum ResponseState'); + } +} + +/// The response from invoking the agent and associated citations and trace +/// information. +class ResponseStream { + /// The request is denied because of missing access permissions. Check your + /// permissions and retry your request. + final AccessDeniedException? accessDeniedException; + + /// There was an issue with a dependency due to a server issue. Retry your + /// request. + final BadGatewayException? badGatewayException; + + /// Contains a part of an agent response and citations for it. + final PayloadPart? chunk; + + /// There was a conflict performing an operation. Resolve the conflict and retry + /// your request. + final ConflictException? conflictException; + + /// There was an issue with a dependency. Check the resource configurations and + /// retry the request. + final DependencyFailedException? dependencyFailedException; + + /// An internal server error occurred. Retry your request. + final InternalServerException? internalServerException; + + /// The specified resource Amazon Resource Name (ARN) was not found. Check the + /// Amazon Resource Name (ARN) and try your request again. + final ResourceNotFoundException? resourceNotFoundException; + + /// Contains the parameters and information that the agent elicited from the + /// customer to carry out an action. This information is returned to the system + /// and can be used in your own setup for fulfilling the action. + final ReturnControlPayload? returnControl; + + /// The number of requests exceeds the service quota. Resubmit your request + /// later. + final ServiceQuotaExceededException? serviceQuotaExceededException; + + /// The number of requests exceeds the limit. Resubmit your request later. + final ThrottlingException? throttlingException; + + /// Contains information about the agent and session, alongside the agent's + /// reasoning process and results from calling actions and querying knowledge + /// bases and metadata about the trace. You can use the trace to understand how + /// the agent arrived at the response it provided the customer. For more + /// information, see Trace + /// events. + final TracePart? trace; + + /// Input validation failed. Check your request parameters and retry the + /// request. + final ValidationException? validationException; + + ResponseStream({ + this.accessDeniedException, + this.badGatewayException, + this.chunk, + this.conflictException, + this.dependencyFailedException, + this.internalServerException, + this.resourceNotFoundException, + this.returnControl, + this.serviceQuotaExceededException, + this.throttlingException, + this.trace, + this.validationException, + }); + + factory ResponseStream.fromJson(Map json) { + return ResponseStream( + accessDeniedException: json['accessDeniedException'] != null + ? AccessDeniedException.fromJson( + json['accessDeniedException'] as Map) + : null, + badGatewayException: json['badGatewayException'] != null + ? BadGatewayException.fromJson( + json['badGatewayException'] as Map) + : null, + chunk: json['chunk'] != null + ? PayloadPart.fromJson(json['chunk'] as Map) + : null, + conflictException: json['conflictException'] != null + ? ConflictException.fromJson( + json['conflictException'] as Map) + : null, + dependencyFailedException: json['dependencyFailedException'] != null + ? DependencyFailedException.fromJson( + json['dependencyFailedException'] as Map) + : null, + internalServerException: json['internalServerException'] != null + ? InternalServerException.fromJson( + json['internalServerException'] as Map) + : null, + resourceNotFoundException: json['resourceNotFoundException'] != null + ? ResourceNotFoundException.fromJson( + json['resourceNotFoundException'] as Map) + : null, + returnControl: json['returnControl'] != null + ? ReturnControlPayload.fromJson( + json['returnControl'] as Map) + : null, + serviceQuotaExceededException: + json['serviceQuotaExceededException'] != null + ? ServiceQuotaExceededException.fromJson( + json['serviceQuotaExceededException'] as Map) + : null, + throttlingException: json['throttlingException'] != null + ? ThrottlingException.fromJson( + json['throttlingException'] as Map) + : null, + trace: json['trace'] != null + ? TracePart.fromJson(json['trace'] as Map) + : null, + validationException: json['validationException'] != null + ? ValidationException.fromJson( + json['validationException'] as Map) + : null, + ); + } + + Map toJson() { + final accessDeniedException = this.accessDeniedException; + final badGatewayException = this.badGatewayException; + final chunk = this.chunk; + final conflictException = this.conflictException; + final dependencyFailedException = this.dependencyFailedException; + final internalServerException = this.internalServerException; + final resourceNotFoundException = this.resourceNotFoundException; + final returnControl = this.returnControl; + final serviceQuotaExceededException = this.serviceQuotaExceededException; + final throttlingException = this.throttlingException; + final trace = this.trace; + final validationException = this.validationException; + return { + if (accessDeniedException != null) + 'accessDeniedException': accessDeniedException, + if (badGatewayException != null) + 'badGatewayException': badGatewayException, + if (chunk != null) 'chunk': chunk, + if (conflictException != null) 'conflictException': conflictException, + if (dependencyFailedException != null) + 'dependencyFailedException': dependencyFailedException, + if (internalServerException != null) + 'internalServerException': internalServerException, + if (resourceNotFoundException != null) + 'resourceNotFoundException': resourceNotFoundException, + if (returnControl != null) 'returnControl': returnControl, + if (serviceQuotaExceededException != null) + 'serviceQuotaExceededException': serviceQuotaExceededException, + if (throttlingException != null) + 'throttlingException': throttlingException, + if (trace != null) 'trace': trace, + if (validationException != null) + 'validationException': validationException, + }; + } +} + +/// Specifies the filters to use on the metadata attributes in the knowledge +/// base data sources before returning results. For more information, see Query +/// configurations. See the examples below to see how to use these filters. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrievalFilter { + /// Knowledge base data sources are returned if their metadata attributes + /// fulfill all the filter conditions inside this list. + final List? andAll; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value matches + /// the value in this object. + /// + /// The following example would return data sources with an animal + /// attribute whose value is cat: + /// + /// "equals": { "key": "animal", "value": "cat" } + final FilterAttribute? equals; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is greater + /// than the value in this object. + /// + /// The following example would return data sources with an year + /// attribute whose value is greater than 1989: + /// + /// "greaterThan": { "key": "year", "value": 1989 } + final FilterAttribute? greaterThan; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is greater + /// than or equal to the value in this object. + /// + /// The following example would return data sources with an year + /// attribute whose value is greater than or equal to 1989: + /// + /// "greaterThanOrEquals": { "key": "year", "value": 1989 } + final FilterAttribute? greaterThanOrEquals; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is in the + /// list specified in the value in this object. + /// + /// The following example would return data sources with an animal + /// attribute that is either cat or dog: + /// + /// "in": { "key": "animal", "value": ["cat", "dog"] } + final FilterAttribute? inValue; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is less + /// than the value in this object. + /// + /// The following example would return data sources with an year + /// attribute whose value is less than to 1989. + /// + /// "lessThan": { "key": "year", "value": 1989 } + final FilterAttribute? lessThan; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is less + /// than or equal to the value in this object. + /// + /// The following example would return data sources with an year + /// attribute whose value is less than or equal to 1989. + /// + /// "lessThanOrEquals": { "key": "year", "value": 1989 } + final FilterAttribute? lessThanOrEquals; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is a list + /// that contains the value as one of its members. + /// + /// The following example would return data sources with an animals + /// attribute that is a list containing a cat member (for example + /// ["dog", "cat"]). + /// + /// "listContains": { "key": "animals", "value": "cat" } + final FilterAttribute? listContains; + + /// Knowledge base data sources that contain a metadata attribute whose name + /// matches the key and whose value doesn't match the + /// value in this object are returned. + /// + /// The following example would return data sources that don't contain an + /// animal attribute whose value is cat. + /// + /// "notEquals": { "key": "animal", "value": "cat" } + final FilterAttribute? notEquals; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value isn't in + /// the list specified in the value in this object. + /// + /// The following example would return data sources whose animal + /// attribute is neither cat nor dog. + /// + /// "notIn": { "key": "animal", "value": ["cat", "dog"] } + final FilterAttribute? notIn; + + /// Knowledge base data sources are returned if their metadata attributes + /// fulfill at least one of the filter conditions inside this list. + final List? orAll; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value starts + /// with the value in this object. This filter is currently only + /// supported for Amazon OpenSearch Serverless vector stores. + /// + /// The following example would return data sources with an animal + /// attribute starts with ca (for example, cat or + /// camel). + /// + /// "startsWith": { "key": "animal", "value": "ca" } + final FilterAttribute? startsWith; + + /// Knowledge base data sources are returned if they contain a metadata + /// attribute whose name matches the key and whose value is one of + /// the following: + /// + ///
      + ///
    • + /// A string that contains the value as a substring. The following + /// example would return data sources with an animal attribute that + /// contains the substring at (for example cat). + /// + /// "stringContains": { "key": "animal", "value": "at" } + ///
    • + ///
    • + /// A list with a member that contains the value as a substring. + /// The following example would return data sources with an animals + /// attribute that is a list containing a member that contains the substring + /// at (for example ["dog", "cat"]). + /// + /// "stringContains": { "key": "animals", "value": "at" } + ///
    • + ///
    + final FilterAttribute? stringContains; + + RetrievalFilter({ + this.andAll, + this.equals, + this.greaterThan, + this.greaterThanOrEquals, + this.inValue, + this.lessThan, + this.lessThanOrEquals, + this.listContains, + this.notEquals, + this.notIn, + this.orAll, + this.startsWith, + this.stringContains, + }); + + Map toJson() { + final andAll = this.andAll; + final equals = this.equals; + final greaterThan = this.greaterThan; + final greaterThanOrEquals = this.greaterThanOrEquals; + final inValue = this.inValue; + final lessThan = this.lessThan; + final lessThanOrEquals = this.lessThanOrEquals; + final listContains = this.listContains; + final notEquals = this.notEquals; + final notIn = this.notIn; + final orAll = this.orAll; + final startsWith = this.startsWith; + final stringContains = this.stringContains; + return { + if (andAll != null) 'andAll': andAll, + if (equals != null) 'equals': equals, + if (greaterThan != null) 'greaterThan': greaterThan, + if (greaterThanOrEquals != null) + 'greaterThanOrEquals': greaterThanOrEquals, + if (inValue != null) 'in': inValue, + if (lessThan != null) 'lessThan': lessThan, + if (lessThanOrEquals != null) 'lessThanOrEquals': lessThanOrEquals, + if (listContains != null) 'listContains': listContains, + if (notEquals != null) 'notEquals': notEquals, + if (notIn != null) 'notIn': notIn, + if (orAll != null) 'orAll': orAll, + if (startsWith != null) 'startsWith': startsWith, + if (stringContains != null) 'stringContains': stringContains, + }; + } +} + +/// Contains the cited text from the data source. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrievalResultContent { + /// The cited text from the data source. + final String text; + + RetrievalResultContent({ + required this.text, + }); + + factory RetrievalResultContent.fromJson(Map json) { + return RetrievalResultContent( + text: json['text'] as String, + ); + } + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +/// Contains information about the location of the data source. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrievalResultLocation { + /// The type of the location of the data source. + final RetrievalResultLocationType type; + + /// Contains the S3 location of the data source. + final RetrievalResultS3Location? s3Location; + + RetrievalResultLocation({ + required this.type, + this.s3Location, + }); + + factory RetrievalResultLocation.fromJson(Map json) { + return RetrievalResultLocation( + type: (json['type'] as String).toRetrievalResultLocationType(), + s3Location: json['s3Location'] != null + ? RetrievalResultS3Location.fromJson( + json['s3Location'] as Map) + : null, + ); + } + + Map toJson() { + final type = this.type; + final s3Location = this.s3Location; + return { + 'type': type.toValue(), + if (s3Location != null) 's3Location': s3Location, + }; + } +} + +enum RetrievalResultLocationType { + s3, +} + +extension RetrievalResultLocationTypeValueExtension + on RetrievalResultLocationType { + String toValue() { + switch (this) { + case RetrievalResultLocationType.s3: + return 'S3'; + } + } +} + +extension RetrievalResultLocationTypeFromString on String { + RetrievalResultLocationType toRetrievalResultLocationType() { + switch (this) { + case 'S3': + return RetrievalResultLocationType.s3; + } + throw Exception('$this is not known in enum RetrievalResultLocationType'); + } +} + +class RetrievalResultMetadataValue { + RetrievalResultMetadataValue(); + + factory RetrievalResultMetadataValue.fromJson(Map _) { + return RetrievalResultMetadataValue(); + } + + Map toJson() { + return {}; + } +} + +/// Contains the S3 location of the data source. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrievalResultS3Location { + /// The S3 URI of the data source. + final String? uri; + + RetrievalResultS3Location({ + this.uri, + }); + + factory RetrievalResultS3Location.fromJson(Map json) { + return RetrievalResultS3Location( + uri: json['uri'] as String?, + ); + } + + Map toJson() { + final uri = this.uri; + return { + if (uri != null) 'uri': uri, + }; + } +} + +/// Contains details about the resource being queried. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrieveAndGenerateConfiguration { + /// The type of resource that is queried by the request. + final RetrieveAndGenerateType type; + + /// The configuration used with the external source wrapper object in the + /// retrieveAndGenerate function. + final ExternalSourcesRetrieveAndGenerateConfiguration? + externalSourcesConfiguration; + + /// Contains details about the resource being queried. + final KnowledgeBaseRetrieveAndGenerateConfiguration? + knowledgeBaseConfiguration; + + RetrieveAndGenerateConfiguration({ + required this.type, + this.externalSourcesConfiguration, + this.knowledgeBaseConfiguration, + }); + + Map toJson() { + final type = this.type; + final externalSourcesConfiguration = this.externalSourcesConfiguration; + final knowledgeBaseConfiguration = this.knowledgeBaseConfiguration; + return { + 'type': type.toValue(), + if (externalSourcesConfiguration != null) + 'externalSourcesConfiguration': externalSourcesConfiguration, + if (knowledgeBaseConfiguration != null) + 'knowledgeBaseConfiguration': knowledgeBaseConfiguration, + }; + } +} + +/// Contains the query made to the knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrieveAndGenerateInput { + /// The query made to the knowledge base. + final String text; + + RetrieveAndGenerateInput({ + required this.text, + }); + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +/// Contains the response generated from querying the knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrieveAndGenerateOutput { + /// The response generated from querying the knowledge base. + final String text; + + RetrieveAndGenerateOutput({ + required this.text, + }); + + factory RetrieveAndGenerateOutput.fromJson(Map json) { + return RetrieveAndGenerateOutput( + text: json['text'] as String, + ); + } + + Map toJson() { + final text = this.text; + return { + 'text': text, + }; + } +} + +class RetrieveAndGenerateResponse { + /// Contains the response generated from querying the knowledge base. + final RetrieveAndGenerateOutput output; + + /// The unique identifier of the session. Reuse the same value to continue the + /// same session with the knowledge base. + final String sessionId; + + /// A list of segments of the generated response that are based on sources in + /// the knowledge base, alongside information about the sources. + final List? citations; + + /// Specifies if there is a guardrail intervention in the response. + final GuadrailAction? guardrailAction; + + RetrieveAndGenerateResponse({ + required this.output, + required this.sessionId, + this.citations, + this.guardrailAction, + }); + + factory RetrieveAndGenerateResponse.fromJson(Map json) { + return RetrieveAndGenerateResponse( + output: RetrieveAndGenerateOutput.fromJson( + json['output'] as Map), + sessionId: json['sessionId'] as String, + citations: (json['citations'] as List?) + ?.whereNotNull() + .map((e) => Citation.fromJson(e as Map)) + .toList(), + guardrailAction: (json['guardrailAction'] as String?)?.toGuadrailAction(), + ); + } + + Map toJson() { + final output = this.output; + final sessionId = this.sessionId; + final citations = this.citations; + final guardrailAction = this.guardrailAction; + return { + 'output': output, + 'sessionId': sessionId, + if (citations != null) 'citations': citations, + if (guardrailAction != null) 'guardrailAction': guardrailAction.toValue(), + }; + } +} + +/// Contains configuration about the session with the knowledge base. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrieveAndGenerateSessionConfiguration { + /// The ARN of the KMS key encrypting the session. + final String kmsKeyArn; + + RetrieveAndGenerateSessionConfiguration({ + required this.kmsKeyArn, + }); + + Map toJson() { + final kmsKeyArn = this.kmsKeyArn; + return { + 'kmsKeyArn': kmsKeyArn, + }; + } +} + +enum RetrieveAndGenerateType { + knowledgeBase, + externalSources, +} + +extension RetrieveAndGenerateTypeValueExtension on RetrieveAndGenerateType { + String toValue() { + switch (this) { + case RetrieveAndGenerateType.knowledgeBase: + return 'KNOWLEDGE_BASE'; + case RetrieveAndGenerateType.externalSources: + return 'EXTERNAL_SOURCES'; + } + } +} + +extension RetrieveAndGenerateTypeFromString on String { + RetrieveAndGenerateType toRetrieveAndGenerateType() { + switch (this) { + case 'KNOWLEDGE_BASE': + return RetrieveAndGenerateType.knowledgeBase; + case 'EXTERNAL_SOURCES': + return RetrieveAndGenerateType.externalSources; + } + throw Exception('$this is not known in enum RetrieveAndGenerateType'); + } +} + +class RetrieveResponse { + /// A list of results from querying the knowledge base. + final List retrievalResults; + + /// If there are more results than can fit in the response, the response returns + /// a nextToken. Use this token in the nextToken field + /// of another request to retrieve the next batch of results. + final String? nextToken; + + RetrieveResponse({ + required this.retrievalResults, + this.nextToken, + }); + + factory RetrieveResponse.fromJson(Map json) { + return RetrieveResponse( + retrievalResults: (json['retrievalResults'] as List) + .whereNotNull() + .map((e) => + KnowledgeBaseRetrievalResult.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final retrievalResults = this.retrievalResults; + final nextToken = this.nextToken; + return { + 'retrievalResults': retrievalResults, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +/// Contains metadata about a source cited for the generated response. +/// +/// This data type is used in the following API operations: +/// +/// +class RetrievedReference { + /// Contains the cited text from the data source. + final RetrievalResultContent? content; + + /// Contains information about the location of the data source. + final RetrievalResultLocation? location; + + /// Contains metadata attributes and their values for the file in the data + /// source. For more information, see Metadata + /// and filtering. + final Map? metadata; + + RetrievedReference({ + this.content, + this.location, + this.metadata, + }); + + factory RetrievedReference.fromJson(Map json) { + return RetrievedReference( + content: json['content'] != null + ? RetrievalResultContent.fromJson( + json['content'] as Map) + : null, + location: json['location'] != null + ? RetrievalResultLocation.fromJson( + json['location'] as Map) + : null, + metadata: (json['metadata'] as Map?)?.map((k, e) => + MapEntry( + k, + RetrievalResultMetadataValue.fromJson( + e as Map))), + ); + } + + Map toJson() { + final content = this.content; + final location = this.location; + final metadata = this.metadata; + return { + if (content != null) 'content': content, + if (location != null) 'location': location, + if (metadata != null) 'metadata': metadata, + }; + } +} + +/// Contains information to return from the action group that the agent has +/// predicted to invoke. +/// +/// This data type is used in the following API operations: +/// +/// +class ReturnControlPayload { + /// The identifier of the action group invocation. + final String? invocationId; + + /// A list of objects that contain information about the parameters and inputs + /// that need to be sent into the API operation or function, based on what the + /// agent determines from its session with the user. + final List? invocationInputs; + + ReturnControlPayload({ + this.invocationId, + this.invocationInputs, + }); + + factory ReturnControlPayload.fromJson(Map json) { + return ReturnControlPayload( + invocationId: json['invocationId'] as String?, + invocationInputs: (json['invocationInputs'] as List?) + ?.whereNotNull() + .map((e) => InvocationInputMember.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final invocationId = this.invocationId; + final invocationInputs = this.invocationInputs; + return { + if (invocationId != null) 'invocationId': invocationId, + if (invocationInputs != null) 'invocationInputs': invocationInputs, + }; + } +} + +/// The unique wrapper object of the document from the S3 location. +class S3ObjectDoc { + /// The file location of the S3 wrapper object. + final String uri; + + S3ObjectDoc({ + required this.uri, + }); + + Map toJson() { + final uri = this.uri; + return { + 'uri': uri, + }; + } +} + +enum SearchType { + hybrid, + semantic, +} + +extension SearchTypeValueExtension on SearchType { + String toValue() { + switch (this) { + case SearchType.hybrid: + return 'HYBRID'; + case SearchType.semantic: + return 'SEMANTIC'; + } + } +} + +extension SearchTypeFromString on String { + SearchType toSearchType() { + switch (this) { + case 'HYBRID': + return SearchType.hybrid; + case 'SEMANTIC': + return SearchType.semantic; + } + throw Exception('$this is not known in enum SearchType'); + } +} + +/// The number of requests exceeds the service quota. Resubmit your request +/// later. +class ServiceQuotaExceededException implements _s.AwsException { + final String? message; + + ServiceQuotaExceededException({ + this.message, + }); + + factory ServiceQuotaExceededException.fromJson(Map json) { + return ServiceQuotaExceededException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Contains parameters that specify various attributes that persist across a +/// session or prompt. You can define session state attributes as key-value +/// pairs when writing a Lambda +/// function for an action group or pass them when making an InvokeAgent +/// request. Use session state attributes to control and provide conversational +/// context for your agent and to help customize your agent's behavior. For more +/// information, see Control +/// session context. +class SessionState { + /// The identifier of the invocation of an action. This value must match the + /// invocationId returned in the InvokeAgent response + /// for the action whose results are provided in the + /// returnControlInvocationResults field. For more information, see + /// Return + /// control to the agent developer and Control + /// session context. + final String? invocationId; + + /// Contains attributes that persist across a prompt and the values of those + /// attributes. These attributes replace the $prompt_session_attributes$ + /// placeholder variable in the orchestration prompt template. For more + /// information, see Prompt + /// template placeholder variables. + final Map? promptSessionAttributes; + + /// Contains information about the results from the action group invocation. For + /// more information, see Return + /// control to the agent developer and Control + /// session context. + /// + /// If you include this field, the inputText field will be ignored. + /// + final List? returnControlInvocationResults; + + /// Contains attributes that persist across a session and the values of those + /// attributes. + final Map? sessionAttributes; + + SessionState({ + this.invocationId, + this.promptSessionAttributes, + this.returnControlInvocationResults, + this.sessionAttributes, + }); + + Map toJson() { + final invocationId = this.invocationId; + final promptSessionAttributes = this.promptSessionAttributes; + final returnControlInvocationResults = this.returnControlInvocationResults; + final sessionAttributes = this.sessionAttributes; + return { + if (invocationId != null) 'invocationId': invocationId, + if (promptSessionAttributes != null) + 'promptSessionAttributes': promptSessionAttributes, + if (returnControlInvocationResults != null) + 'returnControlInvocationResults': returnControlInvocationResults, + if (sessionAttributes != null) 'sessionAttributes': sessionAttributes, + }; + } +} + +enum Source { + actionGroup, + knowledgeBase, + parser, +} + +extension SourceValueExtension on Source { + String toValue() { + switch (this) { + case Source.actionGroup: + return 'ACTION_GROUP'; + case Source.knowledgeBase: + return 'KNOWLEDGE_BASE'; + case Source.parser: + return 'PARSER'; + } + } +} + +extension SourceFromString on String { + Source toSource() { + switch (this) { + case 'ACTION_GROUP': + return Source.actionGroup; + case 'KNOWLEDGE_BASE': + return Source.knowledgeBase; + case 'PARSER': + return Source.parser; + } + throw Exception('$this is not known in enum Source'); + } +} + +/// Contains information about where the text with a citation begins and ends in +/// the generated output. +/// +/// This data type is used in the following API operations: +/// +/// +class Span { + /// Where the text with a citation ends in the generated output. + final int? end; + + /// Where the text with a citation starts in the generated output. + final int? start; + + Span({ + this.end, + this.start, + }); + + factory Span.fromJson(Map json) { + return Span( + end: json['end'] as int?, + start: json['start'] as int?, + ); + } + + Map toJson() { + final end = this.end; + final start = this.start; + return { + if (end != null) 'end': end, + if (start != null) 'start': start, + }; + } +} + +/// Configuration settings for text generation using a language model via the +/// RetrieveAndGenerate operation. Includes parameters like temperature, top-p, +/// maximum token count, and stop sequences. +/// +/// The valid range of maxTokens depends on the accepted values for +/// your chosen model's inference parameters. To see the inference parameters +/// for your model, see Inference +/// parameters for foundation models. +/// +class TextInferenceConfig { + /// The maximum number of tokens to generate in the output text. Do not use the + /// minimum of 0 or the maximum of 65536. The limit values described here are + /// arbitary values, for actual values consult the limits defined by your + /// specific model. + final int? maxTokens; + + /// A list of sequences of characters that, if generated, will cause the model + /// to stop generating further tokens. Do not use a minimum length of 1 or a + /// maximum length of 1000. The limit values described here are arbitary values, + /// for actual values consult the limits defined by your specific model. + final List? stopSequences; + + /// Controls the random-ness of text generated by the language model, + /// influencing how much the model sticks to the most predictable next words + /// versus exploring more surprising options. A lower temperature value (e.g. + /// 0.2 or 0.3) makes model outputs more deterministic or predictable, while a + /// higher temperature (e.g. 0.8 or 0.9) makes the outputs more creative or + /// unpredictable. + final double? temperature; + + /// A probability distribution threshold which controls what the model considers + /// for the set of possible next tokens. The model will only consider the top p% + /// of the probability distribution when generating the next token. + final double? topP; + + TextInferenceConfig({ + this.maxTokens, + this.stopSequences, + this.temperature, + this.topP, + }); + + Map toJson() { + final maxTokens = this.maxTokens; + final stopSequences = this.stopSequences; + final temperature = this.temperature; + final topP = this.topP; + return { + if (maxTokens != null) 'maxTokens': maxTokens, + if (stopSequences != null) 'stopSequences': stopSequences, + if (temperature != null) 'temperature': temperature, + if (topP != null) 'topP': topP, + }; + } +} + +/// Contains the part of the generated text that contains a citation, alongside +/// where it begins and ends. +/// +/// This data type is used in the following API operations: +/// +/// +class TextResponsePart { + /// Contains information about where the text with a citation begins and ends in + /// the generated output. + final Span? span; + + /// The part of the generated text that contains a citation. + final String? text; + + TextResponsePart({ + this.span, + this.text, + }); + + factory TextResponsePart.fromJson(Map json) { + return TextResponsePart( + span: json['span'] != null + ? Span.fromJson(json['span'] as Map) + : null, + text: json['text'] as String?, + ); + } + + Map toJson() { + final span = this.span; + final text = this.text; + return { + if (span != null) 'span': span, + if (text != null) 'text': text, + }; + } +} + +/// The number of requests exceeds the limit. Resubmit your request later. +class ThrottlingException implements _s.AwsException { + final String? message; + + ThrottlingException({ + this.message, + }); + + factory ThrottlingException.fromJson(Map json) { + return ThrottlingException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Contains one part of the agent's reasoning process and results from calling +/// API actions and querying knowledge bases. You can use the trace to +/// understand how the agent arrived at the response it provided the customer. +/// For more information, see Trace +/// enablement. +class Trace { + /// Contains information about the failure of the interaction. + final FailureTrace? failureTrace; + + /// The trace details for a trace defined in the Guardrail filter. + final GuardrailTrace? guardrailTrace; + + /// Details about the orchestration step, in which the agent determines the + /// order in which actions are executed and which knowledge bases are retrieved. + final OrchestrationTrace? orchestrationTrace; + + /// Details about the post-processing step, in which the agent shapes the + /// response.. + final PostProcessingTrace? postProcessingTrace; + + /// Details about the pre-processing step, in which the agent contextualizes and + /// categorizes user inputs. + final PreProcessingTrace? preProcessingTrace; + + Trace({ + this.failureTrace, + this.guardrailTrace, + this.orchestrationTrace, + this.postProcessingTrace, + this.preProcessingTrace, + }); + + factory Trace.fromJson(Map json) { + return Trace( + failureTrace: json['failureTrace'] != null + ? FailureTrace.fromJson(json['failureTrace'] as Map) + : null, + guardrailTrace: json['guardrailTrace'] != null + ? GuardrailTrace.fromJson( + json['guardrailTrace'] as Map) + : null, + orchestrationTrace: json['orchestrationTrace'] != null + ? OrchestrationTrace.fromJson( + json['orchestrationTrace'] as Map) + : null, + postProcessingTrace: json['postProcessingTrace'] != null + ? PostProcessingTrace.fromJson( + json['postProcessingTrace'] as Map) + : null, + preProcessingTrace: json['preProcessingTrace'] != null + ? PreProcessingTrace.fromJson( + json['preProcessingTrace'] as Map) + : null, + ); + } + + Map toJson() { + final failureTrace = this.failureTrace; + final guardrailTrace = this.guardrailTrace; + final orchestrationTrace = this.orchestrationTrace; + final postProcessingTrace = this.postProcessingTrace; + final preProcessingTrace = this.preProcessingTrace; + return { + if (failureTrace != null) 'failureTrace': failureTrace, + if (guardrailTrace != null) 'guardrailTrace': guardrailTrace, + if (orchestrationTrace != null) 'orchestrationTrace': orchestrationTrace, + if (postProcessingTrace != null) + 'postProcessingTrace': postProcessingTrace, + if (preProcessingTrace != null) 'preProcessingTrace': preProcessingTrace, + }; + } +} + +/// Contains information about the agent and session, alongside the agent's +/// reasoning process and results from calling API actions and querying +/// knowledge bases and metadata about the trace. You can use the trace to +/// understand how the agent arrived at the response it provided the customer. +/// For more information, see Trace +/// enablement. +class TracePart { + /// The unique identifier of the alias of the agent. + final String? agentAliasId; + + /// The unique identifier of the agent. + final String? agentId; + + /// The version of the agent. + final String? agentVersion; + + /// The unique identifier of the session with the agent. + final String? sessionId; + + /// Contains one part of the agent's reasoning process and results from calling + /// API actions and querying knowledge bases. You can use the trace to + /// understand how the agent arrived at the response it provided the customer. + /// For more information, see Trace + /// enablement. + final Trace? trace; + + TracePart({ + this.agentAliasId, + this.agentId, + this.agentVersion, + this.sessionId, + this.trace, + }); + + factory TracePart.fromJson(Map json) { + return TracePart( + agentAliasId: json['agentAliasId'] as String?, + agentId: json['agentId'] as String?, + agentVersion: json['agentVersion'] as String?, + sessionId: json['sessionId'] as String?, + trace: json['trace'] != null + ? Trace.fromJson(json['trace'] as Map) + : null, + ); + } + + Map toJson() { + final agentAliasId = this.agentAliasId; + final agentId = this.agentId; + final agentVersion = this.agentVersion; + final sessionId = this.sessionId; + final trace = this.trace; + return { + if (agentAliasId != null) 'agentAliasId': agentAliasId, + if (agentId != null) 'agentId': agentId, + if (agentVersion != null) 'agentVersion': agentVersion, + if (sessionId != null) 'sessionId': sessionId, + if (trace != null) 'trace': trace, + }; + } +} + +enum Type { + actionGroup, + knowledgeBase, + finish, + askUser, + reprompt, +} + +extension TypeValueExtension on Type { + String toValue() { + switch (this) { + case Type.actionGroup: + return 'ACTION_GROUP'; + case Type.knowledgeBase: + return 'KNOWLEDGE_BASE'; + case Type.finish: + return 'FINISH'; + case Type.askUser: + return 'ASK_USER'; + case Type.reprompt: + return 'REPROMPT'; + } + } +} + +extension TypeFromString on String { + Type toType() { + switch (this) { + case 'ACTION_GROUP': + return Type.actionGroup; + case 'KNOWLEDGE_BASE': + return Type.knowledgeBase; + case 'FINISH': + return Type.finish; + case 'ASK_USER': + return Type.askUser; + case 'REPROMPT': + return Type.reprompt; + } + throw Exception('$this is not known in enum Type'); + } +} + +/// Input validation failed. Check your request parameters and retry the +/// request. +class ValidationException implements _s.AwsException { + final String? message; + + ValidationException({ + this.message, + }); + + factory ValidationException.fromJson(Map json) { + return ValidationException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(message: message), + 'BadGatewayException': (type, message) => + BadGatewayException(message: message), + 'ConflictException': (type, message) => ConflictException(message: message), + 'DependencyFailedException': (type, message) => + DependencyFailedException(message: message), + 'InternalServerException': (type, message) => + InternalServerException(message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(message: message), + 'ValidationException': (type, message) => + ValidationException(message: message), +}; diff --git a/aws_client/lib/src/generated/bedrock_runtime/v2023_09_30.dart b/aws_client/lib/src/generated/bedrock_runtime/v2023_09_30.dart new file mode 100644 index 000000000..de454e5f5 --- /dev/null +++ b/aws_client/lib/src/generated/bedrock_runtime/v2023_09_30.dart @@ -0,0 +1,2198 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Describes the API operations for running inference using Amazon Bedrock +/// models. +class BedrockRuntime { + final _s.RestJsonProtocol _protocol; + BedrockRuntime({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'bedrock-runtime', + signingName: 'bedrock', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Sends messages to the specified Amazon Bedrock model. + /// Converse provides a consistent interface that works with all + /// models that support messages. This allows you to write code once and use + /// it with different models. Should a model have unique inference parameters, + /// you can also pass those unique parameters to the model. For more + /// information, see Run + /// inference in the Bedrock User Guide. + /// + /// This operation requires permission for the + /// bedrock:InvokeModel action. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ModelTimeoutException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ModelNotReadyException]. + /// May throw [ModelErrorException]. + /// + /// Parameter [messages] : + /// The messages that you want to send to the model. + /// + /// Parameter [modelId] : + /// The identifier for the model that you want to call. + /// + /// The modelId to provide depends on the type of model that you + /// use: + /// + /// + /// + /// Parameter [additionalModelRequestFields] : + /// Additional inference parameters that the model supports, beyond the base + /// set of inference parameters that Converse supports in the + /// inferenceConfig field. For more information, see Model + /// parameters. + /// + /// Parameter [additionalModelResponseFieldPaths] : + /// Additional model parameters field paths to return in the response. + /// Converse returns the requested fields as a JSON Pointer + /// object in the additionalModelResultFields field. The + /// following is example JSON for + /// additionalModelResponseFieldPaths. + /// + /// [ "/stop_sequence" ] + /// + /// For information about the JSON Pointer syntax, see the Internet Engineering + /// Task Force (IETF) documentation. + /// + /// Converse rejects an empty JSON Pointer or incorrectly + /// structured JSON Pointer with a 400 error code. if the JSON + /// Pointer is valid, but the requested field is not in the model response, it + /// is ignored by Converse. + /// + /// Parameter [inferenceConfig] : + /// Inference parameters to pass to the model. Converse supports + /// a base set of inference parameters. If you need to pass additional + /// parameters that the model supports, use the + /// additionalModelRequestFields request field. + /// + /// Parameter [system] : + /// A system prompt to pass to the model. + /// + /// Parameter [toolConfig] : + /// Configuration information for the tools that the model can use when + /// generating a response. + /// + /// This field is only supported by Anthropic Claude 3, Cohere Command R, + /// Cohere Command R+, and Mistral Large models. + /// + Future converse({ + required List messages, + required String modelId, + Document? additionalModelRequestFields, + List? additionalModelResponseFieldPaths, + InferenceConfiguration? inferenceConfig, + List? system, + ToolConfiguration? toolConfig, + }) async { + final $payload = { + 'messages': messages, + if (additionalModelRequestFields != null) + 'additionalModelRequestFields': additionalModelRequestFields, + if (additionalModelResponseFieldPaths != null) + 'additionalModelResponseFieldPaths': additionalModelResponseFieldPaths, + if (inferenceConfig != null) 'inferenceConfig': inferenceConfig, + if (system != null) 'system': system, + if (toolConfig != null) 'toolConfig': toolConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/model/${Uri.encodeComponent(modelId)}/converse', + exceptionFnMap: _exceptionFns, + ); + return ConverseResponse.fromJson(response); + } + + /// Sends messages to the specified Amazon Bedrock model and returns the + /// response in a stream. ConverseStream provides a consistent + /// API that works with all Amazon Bedrock models that support messages. This + /// allows you to write code once and use it with different models. Should a + /// model have unique inference parameters, you can also pass those unique + /// parameters to the model. For more information, see Run + /// inference in the Bedrock User Guide. + /// + /// To find out if a model supports streaming, call GetFoundationModel + /// and check the responseStreamingSupported field in the + /// response. + /// + /// For example code, see Invoke model with streaming code example in + /// the Amazon Bedrock User Guide. + /// + /// This operation requires permission for the + /// bedrock:InvokeModelWithResponseStream action. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ModelTimeoutException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ModelNotReadyException]. + /// May throw [ModelErrorException]. + /// + /// Parameter [messages] : + /// The messages that you want to send to the model. + /// + /// Parameter [modelId] : + /// The ID for the model. + /// + /// The modelId to provide depends on the type of model that you + /// use: + /// + /// + /// + /// Parameter [additionalModelRequestFields] : + /// Additional inference parameters that the model supports, beyond the base + /// set of inference parameters that ConverseStream supports in + /// the inferenceConfig field. + /// + /// Parameter [additionalModelResponseFieldPaths] : + /// Additional model parameters field paths to return in the response. + /// ConverseStream returns the requested fields as a JSON Pointer + /// object in the additionalModelResultFields field. The + /// following is example JSON for + /// additionalModelResponseFieldPaths. + /// + /// [ "/stop_sequence" ] + /// + /// For information about the JSON Pointer syntax, see the Internet Engineering + /// Task Force (IETF) documentation. + /// + /// ConverseStream rejects an empty JSON Pointer or incorrectly + /// structured JSON Pointer with a 400 error code. if the JSON + /// Pointer is valid, but the requested field is not in the model response, it + /// is ignored by ConverseStream. + /// + /// Parameter [inferenceConfig] : + /// Inference parameters to pass to the model. ConverseStream + /// supports a base set of inference parameters. If you need to pass + /// additional parameters that the model supports, use the + /// additionalModelRequestFields request field. + /// + /// Parameter [system] : + /// A system prompt to send to the model. + /// + /// Parameter [toolConfig] : + /// Configuration information for the tools that the model can use when + /// generating a response. + /// + /// This field is only supported by Anthropic Claude 3 models. + /// + Future converseStream({ + required List messages, + required String modelId, + Document? additionalModelRequestFields, + List? additionalModelResponseFieldPaths, + InferenceConfiguration? inferenceConfig, + List? system, + ToolConfiguration? toolConfig, + }) async { + final $payload = { + 'messages': messages, + if (additionalModelRequestFields != null) + 'additionalModelRequestFields': additionalModelRequestFields, + if (additionalModelResponseFieldPaths != null) + 'additionalModelResponseFieldPaths': additionalModelResponseFieldPaths, + if (inferenceConfig != null) 'inferenceConfig': inferenceConfig, + if (system != null) 'system': system, + if (toolConfig != null) 'toolConfig': toolConfig, + }; + final response = await _protocol.sendRaw( + payload: $payload, + method: 'POST', + requestUri: '/model/${Uri.encodeComponent(modelId)}/converse-stream', + exceptionFnMap: _exceptionFns, + ); + final $json = await _s.jsonFromResponse(response); + return ConverseStreamResponse( + stream: ConverseStreamOutput.fromJson($json), + ); + } + + /// Invokes the specified Amazon Bedrock model to run inference using the + /// prompt and inference parameters provided in the request body. You use + /// model inference to generate text, images, and embeddings. + /// + /// For example code, see Invoke model code examples in the Amazon + /// Bedrock User Guide. + /// + /// This operation requires permission for the + /// bedrock:InvokeModel action. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ModelTimeoutException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ModelNotReadyException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ModelErrorException]. + /// + /// Parameter [body] : + /// The prompt and inference parameters in the format specified in the + /// contentType in the header. To see the format and content of + /// the request and response bodies for different models, refer to Inference + /// parameters. For more information, see Run + /// inference in the Bedrock User Guide. + /// + /// Parameter [modelId] : + /// The unique identifier of the model to invoke to run inference. + /// + /// The modelId to provide depends on the type of model that you + /// use: + /// + /// + /// + /// Parameter [accept] : + /// The desired MIME type of the inference body in the response. The default + /// value is application/json. + /// + /// Parameter [contentType] : + /// The MIME type of the input data in the request. The default value is + /// application/json. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail that you want to use. If you don't + /// provide a value, no guardrail is applied to the invocation. + /// + /// An error will be thrown in the following situations. + /// + ///
      + ///
    • + /// You don't provide a guardrail identifier but you specify the + /// amazon-bedrock-guardrailConfig field in the request body. + ///
    • + ///
    • + /// You enable the guardrail but the contentType isn't + /// application/json. + ///
    • + ///
    • + /// You provide a guardrail identifier, but guardrailVersion + /// isn't specified. + ///
    • + ///
    + /// + /// Parameter [guardrailVersion] : + /// The version number for the guardrail. The value can also be + /// DRAFT. + /// + /// Parameter [trace] : + /// Specifies whether to enable or disable the Bedrock trace. If enabled, you + /// can see the full Bedrock trace. + Future invokeModel({ + required Uint8List body, + required String modelId, + String? accept, + String? contentType, + String? guardrailIdentifier, + String? guardrailVersion, + Trace? trace, + }) async { + final headers = { + if (accept != null) 'Accept': accept.toString(), + if (contentType != null) 'Content-Type': contentType.toString(), + if (guardrailIdentifier != null) + 'X-Amzn-Bedrock-GuardrailIdentifier': guardrailIdentifier.toString(), + if (guardrailVersion != null) + 'X-Amzn-Bedrock-GuardrailVersion': guardrailVersion.toString(), + if (trace != null) 'X-Amzn-Bedrock-Trace': trace.toValue(), + }; + final response = await _protocol.sendRaw( + payload: body, + method: 'POST', + requestUri: '/model/${Uri.encodeComponent(modelId)}/invoke', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return InvokeModelResponse( + body: await response.stream.toBytes(), + contentType: + _s.extractHeaderStringValue(response.headers, 'Content-Type')!, + ); + } + + /// Invoke the specified Amazon Bedrock model to run inference using the + /// prompt and inference parameters provided in the request body. The response + /// is returned in a stream. + /// + /// To see if a model supports streaming, call GetFoundationModel + /// and check the responseStreamingSupported field in the + /// response. + /// + /// The CLI doesn't support InvokeModelWithResponseStream. + /// + /// For example code, see Invoke model with streaming code example in + /// the Amazon Bedrock User Guide. + /// + /// This operation requires permissions to perform the + /// bedrock:InvokeModelWithResponseStream action. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ModelTimeoutException]. + /// May throw [InternalServerException]. + /// May throw [ModelStreamErrorException]. + /// May throw [ValidationException]. + /// May throw [ModelNotReadyException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ModelErrorException]. + /// + /// Parameter [body] : + /// The prompt and inference parameters in the format specified in the + /// contentType in the header. To see the format and content of + /// the request and response bodies for different models, refer to Inference + /// parameters. For more information, see Run + /// inference in the Bedrock User Guide. + /// + /// Parameter [modelId] : + /// The unique identifier of the model to invoke to run inference. + /// + /// The modelId to provide depends on the type of model that you + /// use: + /// + /// + /// + /// Parameter [accept] : + /// The desired MIME type of the inference body in the response. The default + /// value is application/json. + /// + /// Parameter [contentType] : + /// The MIME type of the input data in the request. The default value is + /// application/json. + /// + /// Parameter [guardrailIdentifier] : + /// The unique identifier of the guardrail that you want to use. If you don't + /// provide a value, no guardrail is applied to the invocation. + /// + /// An error is thrown in the following situations. + /// + ///
      + ///
    • + /// You don't provide a guardrail identifier but you specify the + /// amazon-bedrock-guardrailConfig field in the request body. + ///
    • + ///
    • + /// You enable the guardrail but the contentType isn't + /// application/json. + ///
    • + ///
    • + /// You provide a guardrail identifier, but guardrailVersion + /// isn't specified. + ///
    • + ///
    + /// + /// Parameter [guardrailVersion] : + /// The version number for the guardrail. The value can also be + /// DRAFT. + /// + /// Parameter [trace] : + /// Specifies whether to enable or disable the Bedrock trace. If enabled, you + /// can see the full Bedrock trace. + Future invokeModelWithResponseStream({ + required Uint8List body, + required String modelId, + String? accept, + String? contentType, + String? guardrailIdentifier, + String? guardrailVersion, + Trace? trace, + }) async { + final headers = { + if (accept != null) 'X-Amzn-Bedrock-Accept': accept.toString(), + if (contentType != null) 'Content-Type': contentType.toString(), + if (guardrailIdentifier != null) + 'X-Amzn-Bedrock-GuardrailIdentifier': guardrailIdentifier.toString(), + if (guardrailVersion != null) + 'X-Amzn-Bedrock-GuardrailVersion': guardrailVersion.toString(), + if (trace != null) 'X-Amzn-Bedrock-Trace': trace.toValue(), + }; + final response = await _protocol.sendRaw( + payload: body, + method: 'POST', + requestUri: + '/model/${Uri.encodeComponent(modelId)}/invoke-with-response-stream', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + final $json = await _s.jsonFromResponse(response); + return InvokeModelWithResponseStreamResponse( + body: ResponseStream.fromJson($json), + contentType: _s.extractHeaderStringValue( + response.headers, 'X-Amzn-Bedrock-Content-Type')!, + ); + } +} + +/// The model must request at least one tool (no text is generated). +class AnyToolChoice { + AnyToolChoice(); + + Map toJson() { + return {}; + } +} + +/// The Model automatically decides if a tool should be called or to whether to +/// generate text instead. +class AutoToolChoice { + AutoToolChoice(); + + Map toJson() { + return {}; + } +} + +/// A block of content for a message. +class ContentBlock { + /// Image to include in the message. + /// + /// This field is only supported by Anthropic Claude 3 models. + /// + final ImageBlock? image; + + /// Text to include in the message. + final String? text; + + /// The result for a tool request that a model makes. + final ToolResultBlock? toolResult; + + /// Information about a tool use request from a model. + final ToolUseBlock? toolUse; + + ContentBlock({ + this.image, + this.text, + this.toolResult, + this.toolUse, + }); + + factory ContentBlock.fromJson(Map json) { + return ContentBlock( + image: json['image'] != null + ? ImageBlock.fromJson(json['image'] as Map) + : null, + text: json['text'] as String?, + toolResult: json['toolResult'] != null + ? ToolResultBlock.fromJson(json['toolResult'] as Map) + : null, + toolUse: json['toolUse'] != null + ? ToolUseBlock.fromJson(json['toolUse'] as Map) + : null, + ); + } + + Map toJson() { + final image = this.image; + final text = this.text; + final toolResult = this.toolResult; + final toolUse = this.toolUse; + return { + if (image != null) 'image': image, + if (text != null) 'text': text, + if (toolResult != null) 'toolResult': toolResult, + if (toolUse != null) 'toolUse': toolUse, + }; + } +} + +/// A bock of content in a streaming response. +class ContentBlockDelta { + /// The content text. + final String? text; + + /// Information about a tool that the model is requesting to use. + final ToolUseBlockDelta? toolUse; + + ContentBlockDelta({ + this.text, + this.toolUse, + }); + + factory ContentBlockDelta.fromJson(Map json) { + return ContentBlockDelta( + text: json['text'] as String?, + toolUse: json['toolUse'] != null + ? ToolUseBlockDelta.fromJson(json['toolUse'] as Map) + : null, + ); + } + + Map toJson() { + final text = this.text; + final toolUse = this.toolUse; + return { + if (text != null) 'text': text, + if (toolUse != null) 'toolUse': toolUse, + }; + } +} + +/// The content block delta event. +class ContentBlockDeltaEvent { + /// The block index for a content block delta event. + final int contentBlockIndex; + + /// The delta for a content block delta event. + final ContentBlockDelta delta; + + ContentBlockDeltaEvent({ + required this.contentBlockIndex, + required this.delta, + }); + + factory ContentBlockDeltaEvent.fromJson(Map json) { + return ContentBlockDeltaEvent( + contentBlockIndex: json['contentBlockIndex'] as int, + delta: ContentBlockDelta.fromJson(json['delta'] as Map), + ); + } + + Map toJson() { + final contentBlockIndex = this.contentBlockIndex; + final delta = this.delta; + return { + 'contentBlockIndex': contentBlockIndex, + 'delta': delta, + }; + } +} + +/// Content block start information. +class ContentBlockStart { + /// Information about a tool that the model is requesting to use. + final ToolUseBlockStart? toolUse; + + ContentBlockStart({ + this.toolUse, + }); + + factory ContentBlockStart.fromJson(Map json) { + return ContentBlockStart( + toolUse: json['toolUse'] != null + ? ToolUseBlockStart.fromJson(json['toolUse'] as Map) + : null, + ); + } + + Map toJson() { + final toolUse = this.toolUse; + return { + if (toolUse != null) 'toolUse': toolUse, + }; + } +} + +/// Content block start event. +class ContentBlockStartEvent { + /// The index for a content block start event. + final int contentBlockIndex; + + /// Start information about a content block start event. + final ContentBlockStart start; + + ContentBlockStartEvent({ + required this.contentBlockIndex, + required this.start, + }); + + factory ContentBlockStartEvent.fromJson(Map json) { + return ContentBlockStartEvent( + contentBlockIndex: json['contentBlockIndex'] as int, + start: ContentBlockStart.fromJson(json['start'] as Map), + ); + } + + Map toJson() { + final contentBlockIndex = this.contentBlockIndex; + final start = this.start; + return { + 'contentBlockIndex': contentBlockIndex, + 'start': start, + }; + } +} + +/// A content block stop event. +class ContentBlockStopEvent { + /// The index for a content block. + final int contentBlockIndex; + + ContentBlockStopEvent({ + required this.contentBlockIndex, + }); + + factory ContentBlockStopEvent.fromJson(Map json) { + return ContentBlockStopEvent( + contentBlockIndex: json['contentBlockIndex'] as int, + ); + } + + Map toJson() { + final contentBlockIndex = this.contentBlockIndex; + return { + 'contentBlockIndex': contentBlockIndex, + }; + } +} + +enum ConversationRole { + user, + assistant, +} + +extension ConversationRoleValueExtension on ConversationRole { + String toValue() { + switch (this) { + case ConversationRole.user: + return 'user'; + case ConversationRole.assistant: + return 'assistant'; + } + } +} + +extension ConversationRoleFromString on String { + ConversationRole toConversationRole() { + switch (this) { + case 'user': + return ConversationRole.user; + case 'assistant': + return ConversationRole.assistant; + } + throw Exception('$this is not known in enum ConversationRole'); + } +} + +/// Metrics for a call to Converse. +class ConverseMetrics { + /// The latency of the call to Converse, in milliseconds. + final int latencyMs; + + ConverseMetrics({ + required this.latencyMs, + }); + + factory ConverseMetrics.fromJson(Map json) { + return ConverseMetrics( + latencyMs: json['latencyMs'] as int, + ); + } + + Map toJson() { + final latencyMs = this.latencyMs; + return { + 'latencyMs': latencyMs, + }; + } +} + +/// The output from a call to Converse. +class ConverseOutput { + /// The message that the model generates. + final Message? message; + + ConverseOutput({ + this.message, + }); + + factory ConverseOutput.fromJson(Map json) { + return ConverseOutput( + message: json['message'] != null + ? Message.fromJson(json['message'] as Map) + : null, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +class ConverseResponse { + /// Metrics for the call to Converse. + final ConverseMetrics metrics; + + /// The result from the call to Converse. + final ConverseOutput output; + + /// The reason why the model stopped generating output. + final StopReason stopReason; + + /// The total number of tokens used in the call to Converse. The + /// total includes the tokens input to the model and the tokens generated by the + /// model. + final TokenUsage usage; + + /// Additional fields in the response that are unique to the model. + final Document? additionalModelResponseFields; + + ConverseResponse({ + required this.metrics, + required this.output, + required this.stopReason, + required this.usage, + this.additionalModelResponseFields, + }); + + factory ConverseResponse.fromJson(Map json) { + return ConverseResponse( + metrics: + ConverseMetrics.fromJson(json['metrics'] as Map), + output: ConverseOutput.fromJson(json['output'] as Map), + stopReason: (json['stopReason'] as String).toStopReason(), + usage: TokenUsage.fromJson(json['usage'] as Map), + additionalModelResponseFields: + json['additionalModelResponseFields'] != null + ? Document.fromJson( + json['additionalModelResponseFields'] as Map) + : null, + ); + } + + Map toJson() { + final metrics = this.metrics; + final output = this.output; + final stopReason = this.stopReason; + final usage = this.usage; + final additionalModelResponseFields = this.additionalModelResponseFields; + return { + 'metrics': metrics, + 'output': output, + 'stopReason': stopReason.toValue(), + 'usage': usage, + if (additionalModelResponseFields != null) + 'additionalModelResponseFields': additionalModelResponseFields, + }; + } +} + +/// A conversation stream metadata event. +class ConverseStreamMetadataEvent { + /// The metrics for the conversation stream metadata event. + final ConverseStreamMetrics metrics; + + /// Usage information for the conversation stream event. + final TokenUsage usage; + + ConverseStreamMetadataEvent({ + required this.metrics, + required this.usage, + }); + + factory ConverseStreamMetadataEvent.fromJson(Map json) { + return ConverseStreamMetadataEvent( + metrics: ConverseStreamMetrics.fromJson( + json['metrics'] as Map), + usage: TokenUsage.fromJson(json['usage'] as Map), + ); + } + + Map toJson() { + final metrics = this.metrics; + final usage = this.usage; + return { + 'metrics': metrics, + 'usage': usage, + }; + } +} + +/// Metrics for the stream. +class ConverseStreamMetrics { + /// The latency for the streaming request, in milliseconds. + final int latencyMs; + + ConverseStreamMetrics({ + required this.latencyMs, + }); + + factory ConverseStreamMetrics.fromJson(Map json) { + return ConverseStreamMetrics( + latencyMs: json['latencyMs'] as int, + ); + } + + Map toJson() { + final latencyMs = this.latencyMs; + return { + 'latencyMs': latencyMs, + }; + } +} + +/// The messages output stream +class ConverseStreamOutput { + /// The messages output content block delta. + final ContentBlockDeltaEvent? contentBlockDelta; + + /// Start information for a content block. + final ContentBlockStartEvent? contentBlockStart; + + /// Stop information for a content block. + final ContentBlockStopEvent? contentBlockStop; + + /// An internal server error occurred. Retry your request. + final InternalServerException? internalServerException; + + /// Message start information. + final MessageStartEvent? messageStart; + + /// Message stop information. + final MessageStopEvent? messageStop; + + /// Metadata for the converse output stream. + final ConverseStreamMetadataEvent? metadata; + + /// A streaming error occurred. Retry your request. + final ModelStreamErrorException? modelStreamErrorException; + + /// The number of requests exceeds the limit. Resubmit your request later. + final ThrottlingException? throttlingException; + + /// Input validation failed. Check your request parameters and retry the + /// request. + final ValidationException? validationException; + + ConverseStreamOutput({ + this.contentBlockDelta, + this.contentBlockStart, + this.contentBlockStop, + this.internalServerException, + this.messageStart, + this.messageStop, + this.metadata, + this.modelStreamErrorException, + this.throttlingException, + this.validationException, + }); + + factory ConverseStreamOutput.fromJson(Map json) { + return ConverseStreamOutput( + contentBlockDelta: json['contentBlockDelta'] != null + ? ContentBlockDeltaEvent.fromJson( + json['contentBlockDelta'] as Map) + : null, + contentBlockStart: json['contentBlockStart'] != null + ? ContentBlockStartEvent.fromJson( + json['contentBlockStart'] as Map) + : null, + contentBlockStop: json['contentBlockStop'] != null + ? ContentBlockStopEvent.fromJson( + json['contentBlockStop'] as Map) + : null, + internalServerException: json['internalServerException'] != null + ? InternalServerException.fromJson( + json['internalServerException'] as Map) + : null, + messageStart: json['messageStart'] != null + ? MessageStartEvent.fromJson( + json['messageStart'] as Map) + : null, + messageStop: json['messageStop'] != null + ? MessageStopEvent.fromJson( + json['messageStop'] as Map) + : null, + metadata: json['metadata'] != null + ? ConverseStreamMetadataEvent.fromJson( + json['metadata'] as Map) + : null, + modelStreamErrorException: json['modelStreamErrorException'] != null + ? ModelStreamErrorException.fromJson( + json['modelStreamErrorException'] as Map) + : null, + throttlingException: json['throttlingException'] != null + ? ThrottlingException.fromJson( + json['throttlingException'] as Map) + : null, + validationException: json['validationException'] != null + ? ValidationException.fromJson( + json['validationException'] as Map) + : null, + ); + } + + Map toJson() { + final contentBlockDelta = this.contentBlockDelta; + final contentBlockStart = this.contentBlockStart; + final contentBlockStop = this.contentBlockStop; + final internalServerException = this.internalServerException; + final messageStart = this.messageStart; + final messageStop = this.messageStop; + final metadata = this.metadata; + final modelStreamErrorException = this.modelStreamErrorException; + final throttlingException = this.throttlingException; + final validationException = this.validationException; + return { + if (contentBlockDelta != null) 'contentBlockDelta': contentBlockDelta, + if (contentBlockStart != null) 'contentBlockStart': contentBlockStart, + if (contentBlockStop != null) 'contentBlockStop': contentBlockStop, + if (internalServerException != null) + 'internalServerException': internalServerException, + if (messageStart != null) 'messageStart': messageStart, + if (messageStop != null) 'messageStop': messageStop, + if (metadata != null) 'metadata': metadata, + if (modelStreamErrorException != null) + 'modelStreamErrorException': modelStreamErrorException, + if (throttlingException != null) + 'throttlingException': throttlingException, + if (validationException != null) + 'validationException': validationException, + }; + } +} + +class ConverseStreamResponse { + /// The output stream that the model generated. + final ConverseStreamOutput? stream; + + ConverseStreamResponse({ + this.stream, + }); + + Map toJson() { + final stream = this.stream; + return { + if (stream != null) 'stream': stream, + }; + } +} + +class Document { + Document(); + + factory Document.fromJson(Map _) { + return Document(); + } + + Map toJson() { + return {}; + } +} + +/// Image content for a message. +class ImageBlock { + /// The format of the image. + final ImageFormat format; + + /// The source for the image. + final ImageSource source; + + ImageBlock({ + required this.format, + required this.source, + }); + + factory ImageBlock.fromJson(Map json) { + return ImageBlock( + format: (json['format'] as String).toImageFormat(), + source: ImageSource.fromJson(json['source'] as Map), + ); + } + + Map toJson() { + final format = this.format; + final source = this.source; + return { + 'format': format.toValue(), + 'source': source, + }; + } +} + +enum ImageFormat { + png, + jpeg, + gif, + webp, +} + +extension ImageFormatValueExtension on ImageFormat { + String toValue() { + switch (this) { + case ImageFormat.png: + return 'png'; + case ImageFormat.jpeg: + return 'jpeg'; + case ImageFormat.gif: + return 'gif'; + case ImageFormat.webp: + return 'webp'; + } + } +} + +extension ImageFormatFromString on String { + ImageFormat toImageFormat() { + switch (this) { + case 'png': + return ImageFormat.png; + case 'jpeg': + return ImageFormat.jpeg; + case 'gif': + return ImageFormat.gif; + case 'webp': + return ImageFormat.webp; + } + throw Exception('$this is not known in enum ImageFormat'); + } +} + +/// The source for an image. +class ImageSource { + /// The raw image bytes for the image. If you use an AWS SDK, you don't need to + /// base64 encode the image bytes. + final Uint8List? bytes; + + ImageSource({ + this.bytes, + }); + + factory ImageSource.fromJson(Map json) { + return ImageSource( + bytes: _s.decodeNullableUint8List(json['bytes'] as String?), + ); + } + + Map toJson() { + final bytes = this.bytes; + return { + if (bytes != null) 'bytes': base64Encode(bytes), + }; + } +} + +/// Base inference parameters to pass to a model in a call to Converse +/// or ConverseStream. +/// For more information, see Inference +/// parameters for foundation models. +/// +/// If you need to pass additional parameters that the model supports, use the +/// additionalModelRequestFields request field in the call to +/// Converse or ConverseStream. For more information, +/// see Model +/// parameters. +class InferenceConfiguration { + /// The maximum number of tokens to allow in the generated response. The default + /// value is the maximum allowed value for the model that you are using. For + /// more information, see Inference + /// parameters for foundatio{ "messages": [ { "role": "user", "content": [ { + /// "text": "what's the weather in Queens, NY and Austin, TX?" } ] }, { "role": + /// "assistant", "content": [ { "toolUse": { "toolUseId": "1", "name": + /// "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { + /// "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": + /// "Austin", "state": "TX" } } } ] }, { "role": "user", "content": [ { + /// "toolResult": { "toolUseId": "2", "content": [ { "json": { "weather": "40" } + /// } ] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": [ + /// { "text": "result text" } ] } } ] } ], "toolConfig": { "tools": [ { "name": + /// "get_weather", "description": "Get weather", "inputSchema": { "type": + /// "object", "properties": { "city": { "type": "string", "description": "City + /// of location" }, "state": { "type": "string", "description": "State of + /// location" } }, "required": ["city", "state"] } } ] } } n models. + final int? maxTokens; + + /// A list of stop sequences. A stop sequence is a sequence of characters that + /// causes the model to stop generating the response. + final List? stopSequences; + + /// The likelihood of the model selecting higher-probability options while + /// generating a response. A lower value makes the model more likely to choose + /// higher-probability options, while a higher value makes the model more likely + /// to choose lower-probability options. + /// + /// The default value is the default value for the model that you are using. For + /// more information, see Inference + /// parameters for foundation models. + final double? temperature; + + /// The percentage of most-likely candidates that the model considers for the + /// next token. For example, if you choose a value of 0.8 for topP, + /// the model selects from the top 80% of the probability distribution of tokens + /// that could be next in the sequence. + /// + /// The default value is the default value for the model that you are using. For + /// more information, see Inference + /// parameters for foundation models. + final double? topP; + + InferenceConfiguration({ + this.maxTokens, + this.stopSequences, + this.temperature, + this.topP, + }); + + Map toJson() { + final maxTokens = this.maxTokens; + final stopSequences = this.stopSequences; + final temperature = this.temperature; + final topP = this.topP; + return { + if (maxTokens != null) 'maxTokens': maxTokens, + if (stopSequences != null) 'stopSequences': stopSequences, + if (temperature != null) 'temperature': temperature, + if (topP != null) 'topP': topP, + }; + } +} + +/// An internal server error occurred. Retry your request. +class InternalServerException implements _s.AwsException { + final String? message; + + InternalServerException({ + this.message, + }); + + factory InternalServerException.fromJson(Map json) { + return InternalServerException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +class InvokeModelResponse { + /// Inference response from the model in the format specified in the + /// contentType header. To see the format and content of the + /// request and response bodies for different models, refer to Inference + /// parameters. + final Uint8List body; + + /// The MIME type of the inference result. + final String contentType; + + InvokeModelResponse({ + required this.body, + required this.contentType, + }); + + Map toJson() { + final body = this.body; + final contentType = this.contentType; + return { + 'body': base64Encode(body), + }; + } +} + +class InvokeModelWithResponseStreamResponse { + /// Inference response from the model in the format specified by the + /// contentType header. To see the format and content of this field + /// for different models, refer to Inference + /// parameters. + final ResponseStream body; + + /// The MIME type of the inference result. + final String contentType; + + InvokeModelWithResponseStreamResponse({ + required this.body, + required this.contentType, + }); + + Map toJson() { + final body = this.body; + final contentType = this.contentType; + return { + 'body': body, + }; + } +} + +/// A message in the Message +/// field. Use to send a message in a call to Converse. +class Message { + /// The message content. + final List content; + + /// The role that the message plays in the message. + final ConversationRole role; + + Message({ + required this.content, + required this.role, + }); + + factory Message.fromJson(Map json) { + return Message( + content: (json['content'] as List) + .whereNotNull() + .map((e) => ContentBlock.fromJson(e as Map)) + .toList(), + role: (json['role'] as String).toConversationRole(), + ); + } + + Map toJson() { + final content = this.content; + final role = this.role; + return { + 'content': content, + 'role': role.toValue(), + }; + } +} + +/// The start of a message. +class MessageStartEvent { + /// The role for the message. + final ConversationRole role; + + MessageStartEvent({ + required this.role, + }); + + factory MessageStartEvent.fromJson(Map json) { + return MessageStartEvent( + role: (json['role'] as String).toConversationRole(), + ); + } + + Map toJson() { + final role = this.role; + return { + 'role': role.toValue(), + }; + } +} + +/// The stop event for a message. +class MessageStopEvent { + /// The reason why the model stopped generating output. + final StopReason stopReason; + + /// The additional model response fields. + final Document? additionalModelResponseFields; + + MessageStopEvent({ + required this.stopReason, + this.additionalModelResponseFields, + }); + + factory MessageStopEvent.fromJson(Map json) { + return MessageStopEvent( + stopReason: (json['stopReason'] as String).toStopReason(), + additionalModelResponseFields: + json['additionalModelResponseFields'] != null + ? Document.fromJson( + json['additionalModelResponseFields'] as Map) + : null, + ); + } + + Map toJson() { + final stopReason = this.stopReason; + final additionalModelResponseFields = this.additionalModelResponseFields; + return { + 'stopReason': stopReason.toValue(), + if (additionalModelResponseFields != null) + 'additionalModelResponseFields': additionalModelResponseFields, + }; + } +} + +/// An error occurred while streaming the response. Retry your request. +class ModelStreamErrorException implements _s.AwsException { + final String? message; + + /// The original message. + final String? originalMessage; + + /// The original status code. + final int? originalStatusCode; + + ModelStreamErrorException({ + this.message, + this.originalMessage, + this.originalStatusCode, + }); + + factory ModelStreamErrorException.fromJson(Map json) { + return ModelStreamErrorException( + message: json['message'] as String?, + originalMessage: json['originalMessage'] as String?, + originalStatusCode: json['originalStatusCode'] as int?, + ); + } + + Map toJson() { + final message = this.message; + final originalMessage = this.originalMessage; + final originalStatusCode = this.originalStatusCode; + return { + if (message != null) 'message': message, + if (originalMessage != null) 'originalMessage': originalMessage, + if (originalStatusCode != null) 'originalStatusCode': originalStatusCode, + }; + } +} + +/// The request took too long to process. Processing time exceeded the model +/// timeout length. +class ModelTimeoutException implements _s.AwsException { + final String? message; + + ModelTimeoutException({ + this.message, + }); + + factory ModelTimeoutException.fromJson(Map json) { + return ModelTimeoutException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// Payload content included in the response. +class PayloadPart { + /// Base64-encoded bytes of payload data. + final Uint8List? bytes; + + PayloadPart({ + this.bytes, + }); + + factory PayloadPart.fromJson(Map json) { + return PayloadPart( + bytes: _s.decodeNullableUint8List(json['bytes'] as String?), + ); + } + + Map toJson() { + final bytes = this.bytes; + return { + if (bytes != null) 'bytes': base64Encode(bytes), + }; + } +} + +/// Definition of content in the response stream. +class ResponseStream { + /// Content included in the response. + final PayloadPart? chunk; + + /// An internal server error occurred. Retry your request. + final InternalServerException? internalServerException; + + /// An error occurred while streaming the response. Retry your request. + final ModelStreamErrorException? modelStreamErrorException; + + /// The request took too long to process. Processing time exceeded the model + /// timeout length. + final ModelTimeoutException? modelTimeoutException; + + /// The number or frequency of requests exceeds the limit. Resubmit your request + /// later. + final ThrottlingException? throttlingException; + + /// Input validation failed. Check your request parameters and retry the + /// request. + final ValidationException? validationException; + + ResponseStream({ + this.chunk, + this.internalServerException, + this.modelStreamErrorException, + this.modelTimeoutException, + this.throttlingException, + this.validationException, + }); + + factory ResponseStream.fromJson(Map json) { + return ResponseStream( + chunk: json['chunk'] != null + ? PayloadPart.fromJson(json['chunk'] as Map) + : null, + internalServerException: json['internalServerException'] != null + ? InternalServerException.fromJson( + json['internalServerException'] as Map) + : null, + modelStreamErrorException: json['modelStreamErrorException'] != null + ? ModelStreamErrorException.fromJson( + json['modelStreamErrorException'] as Map) + : null, + modelTimeoutException: json['modelTimeoutException'] != null + ? ModelTimeoutException.fromJson( + json['modelTimeoutException'] as Map) + : null, + throttlingException: json['throttlingException'] != null + ? ThrottlingException.fromJson( + json['throttlingException'] as Map) + : null, + validationException: json['validationException'] != null + ? ValidationException.fromJson( + json['validationException'] as Map) + : null, + ); + } + + Map toJson() { + final chunk = this.chunk; + final internalServerException = this.internalServerException; + final modelStreamErrorException = this.modelStreamErrorException; + final modelTimeoutException = this.modelTimeoutException; + final throttlingException = this.throttlingException; + final validationException = this.validationException; + return { + if (chunk != null) 'chunk': chunk, + if (internalServerException != null) + 'internalServerException': internalServerException, + if (modelStreamErrorException != null) + 'modelStreamErrorException': modelStreamErrorException, + if (modelTimeoutException != null) + 'modelTimeoutException': modelTimeoutException, + if (throttlingException != null) + 'throttlingException': throttlingException, + if (validationException != null) + 'validationException': validationException, + }; + } +} + +/// The model must request a specific tool. +/// +/// This field is only supported by Anthropic Claude 3 models. +/// +class SpecificToolChoice { + /// The name of the tool that the model must request. + final String name; + + SpecificToolChoice({ + required this.name, + }); + + Map toJson() { + final name = this.name; + return { + 'name': name, + }; + } +} + +enum StopReason { + endTurn, + toolUse, + maxTokens, + stopSequence, + contentFiltered, +} + +extension StopReasonValueExtension on StopReason { + String toValue() { + switch (this) { + case StopReason.endTurn: + return 'end_turn'; + case StopReason.toolUse: + return 'tool_use'; + case StopReason.maxTokens: + return 'max_tokens'; + case StopReason.stopSequence: + return 'stop_sequence'; + case StopReason.contentFiltered: + return 'content_filtered'; + } + } +} + +extension StopReasonFromString on String { + StopReason toStopReason() { + switch (this) { + case 'end_turn': + return StopReason.endTurn; + case 'tool_use': + return StopReason.toolUse; + case 'max_tokens': + return StopReason.maxTokens; + case 'stop_sequence': + return StopReason.stopSequence; + case 'content_filtered': + return StopReason.contentFiltered; + } + throw Exception('$this is not known in enum StopReason'); + } +} + +/// A system content block +class SystemContentBlock { + /// A system prompt for the model. + final String? text; + + SystemContentBlock({ + this.text, + }); + + Map toJson() { + final text = this.text; + return { + if (text != null) 'text': text, + }; + } +} + +/// The number of requests exceeds the limit. Resubmit your request later. +class ThrottlingException implements _s.AwsException { + final String? message; + + ThrottlingException({ + this.message, + }); + + factory ThrottlingException.fromJson(Map json) { + return ThrottlingException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// The tokens used in a message API inference call. +class TokenUsage { + /// The number of tokens sent in the request to the model. + final int inputTokens; + + /// The number of tokens that the model generated for the request. + final int outputTokens; + + /// The total of input tokens and tokens generated by the model. + final int totalTokens; + + TokenUsage({ + required this.inputTokens, + required this.outputTokens, + required this.totalTokens, + }); + + factory TokenUsage.fromJson(Map json) { + return TokenUsage( + inputTokens: json['inputTokens'] as int, + outputTokens: json['outputTokens'] as int, + totalTokens: json['totalTokens'] as int, + ); + } + + Map toJson() { + final inputTokens = this.inputTokens; + final outputTokens = this.outputTokens; + final totalTokens = this.totalTokens; + return { + 'inputTokens': inputTokens, + 'outputTokens': outputTokens, + 'totalTokens': totalTokens, + }; + } +} + +/// Information about a tool that you can use with the Converse API. +class Tool { + /// The specfication for the tool. + final ToolSpecification? toolSpec; + + Tool({ + this.toolSpec, + }); + + Map toJson() { + final toolSpec = this.toolSpec; + return { + if (toolSpec != null) 'toolSpec': toolSpec, + }; + } +} + +/// Forces a model to use a tool. +class ToolChoice { + /// The model must request at least one tool (no text is generated). + final AnyToolChoice? any; + + /// The Model automatically decides if a tool should be called or to whether to + /// generate text instead. + final AutoToolChoice? auto; + + /// The Model must request the specified tool. + final SpecificToolChoice? tool; + + ToolChoice({ + this.any, + this.auto, + this.tool, + }); + + Map toJson() { + final any = this.any; + final auto = this.auto; + final tool = this.tool; + return { + if (any != null) 'any': any, + if (auto != null) 'auto': auto, + if (tool != null) 'tool': tool, + }; + } +} + +/// Configuration information for the tools that you pass to a model. +/// +/// This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere +/// Command R+, and Mistral Large models. +/// +class ToolConfiguration { + /// An array of tools that you want to pass to a model. + final List tools; + + /// If supported by model, forces the model to request a tool. + final ToolChoice? toolChoice; + + ToolConfiguration({ + required this.tools, + this.toolChoice, + }); + + Map toJson() { + final tools = this.tools; + final toolChoice = this.toolChoice; + return { + 'tools': tools, + if (toolChoice != null) 'toolChoice': toolChoice, + }; + } +} + +/// The schema for the tool. The top level schema type must be +/// object. +class ToolInputSchema { + /// The JSON schema for the tool. For more information, see JSON + /// Schema Reference. + final Document? json; + + ToolInputSchema({ + this.json, + }); + + Map toJson() { + final json = this.json; + return { + if (json != null) 'json': json, + }; + } +} + +/// A tool result block that contains the results for a tool request that the +/// model previously made. +class ToolResultBlock { + /// The content for tool result content block. + final List content; + + /// The ID of the tool request that this is the result for. + final String toolUseId; + + /// The status for the tool result content block. + /// + /// This field is only supported Anthropic Claude 3 models. + /// + final ToolResultStatus? status; + + ToolResultBlock({ + required this.content, + required this.toolUseId, + this.status, + }); + + factory ToolResultBlock.fromJson(Map json) { + return ToolResultBlock( + content: (json['content'] as List) + .whereNotNull() + .map( + (e) => ToolResultContentBlock.fromJson(e as Map)) + .toList(), + toolUseId: json['toolUseId'] as String, + status: (json['status'] as String?)?.toToolResultStatus(), + ); + } + + Map toJson() { + final content = this.content; + final toolUseId = this.toolUseId; + final status = this.status; + return { + 'content': content, + 'toolUseId': toolUseId, + if (status != null) 'status': status.toValue(), + }; + } +} + +/// The tool result content block. +class ToolResultContentBlock { + /// A tool result that is an image. + /// + /// This field is only supported by Anthropic Claude 3 models. + /// + final ImageBlock? image; + + /// A tool result that is JSON format data. + final Document? json; + + /// A tool result that is text. + final String? text; + + ToolResultContentBlock({ + this.image, + this.json, + this.text, + }); + + factory ToolResultContentBlock.fromJson(Map json) { + return ToolResultContentBlock( + image: json['image'] != null + ? ImageBlock.fromJson(json['image'] as Map) + : null, + json: json['json'] != null + ? Document.fromJson(json['json'] as Map) + : null, + text: json['text'] as String?, + ); + } + + Map toJson() { + final image = this.image; + final json = this.json; + final text = this.text; + return { + if (image != null) 'image': image, + if (json != null) 'json': json, + if (text != null) 'text': text, + }; + } +} + +enum ToolResultStatus { + success, + error, +} + +extension ToolResultStatusValueExtension on ToolResultStatus { + String toValue() { + switch (this) { + case ToolResultStatus.success: + return 'success'; + case ToolResultStatus.error: + return 'error'; + } + } +} + +extension ToolResultStatusFromString on String { + ToolResultStatus toToolResultStatus() { + switch (this) { + case 'success': + return ToolResultStatus.success; + case 'error': + return ToolResultStatus.error; + } + throw Exception('$this is not known in enum ToolResultStatus'); + } +} + +/// The specification for the tool. +class ToolSpecification { + /// The input schema for the tool in JSON format. + final ToolInputSchema inputSchema; + + /// The name for the tool. + final String name; + + /// The description for the tool. + final String? description; + + ToolSpecification({ + required this.inputSchema, + required this.name, + this.description, + }); + + Map toJson() { + final inputSchema = this.inputSchema; + final name = this.name; + final description = this.description; + return { + 'inputSchema': inputSchema, + 'name': name, + if (description != null) 'description': description, + }; + } +} + +/// A tool use content block. Contains information about a tool that the model +/// is requesting be run., The model uses the result from the tool to generate a +/// response. +class ToolUseBlock { + /// The input to pass to the tool. + final Document input; + + /// The name of the tool that the model wants to use. + final String name; + + /// The ID for the tool request. + final String toolUseId; + + ToolUseBlock({ + required this.input, + required this.name, + required this.toolUseId, + }); + + factory ToolUseBlock.fromJson(Map json) { + return ToolUseBlock( + input: Document.fromJson(json['input'] as Map), + name: json['name'] as String, + toolUseId: json['toolUseId'] as String, + ); + } + + Map toJson() { + final input = this.input; + final name = this.name; + final toolUseId = this.toolUseId; + return { + 'input': input, + 'name': name, + 'toolUseId': toolUseId, + }; + } +} + +/// The delta for a tool use block. +class ToolUseBlockDelta { + /// The input for a requested tool. + final String input; + + ToolUseBlockDelta({ + required this.input, + }); + + factory ToolUseBlockDelta.fromJson(Map json) { + return ToolUseBlockDelta( + input: json['input'] as String, + ); + } + + Map toJson() { + final input = this.input; + return { + 'input': input, + }; + } +} + +/// The start of a tool use block. +class ToolUseBlockStart { + /// The name of the tool that the model is requesting to use. + final String name; + + /// The ID for the tool request. + final String toolUseId; + + ToolUseBlockStart({ + required this.name, + required this.toolUseId, + }); + + factory ToolUseBlockStart.fromJson(Map json) { + return ToolUseBlockStart( + name: json['name'] as String, + toolUseId: json['toolUseId'] as String, + ); + } + + Map toJson() { + final name = this.name; + final toolUseId = this.toolUseId; + return { + 'name': name, + 'toolUseId': toolUseId, + }; + } +} + +enum Trace { + enabled, + disabled, +} + +extension TraceValueExtension on Trace { + String toValue() { + switch (this) { + case Trace.enabled: + return 'ENABLED'; + case Trace.disabled: + return 'DISABLED'; + } + } +} + +extension TraceFromString on String { + Trace toTrace() { + switch (this) { + case 'ENABLED': + return Trace.enabled; + case 'DISABLED': + return Trace.disabled; + } + throw Exception('$this is not known in enum Trace'); + } +} + +/// Input validation failed. Check your request parameters and retry the +/// request. +class ValidationException implements _s.AwsException { + final String? message; + + ValidationException({ + this.message, + }); + + factory ValidationException.fromJson(Map json) { + return ValidationException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ModelErrorException extends _s.GenericAwsException { + ModelErrorException({String? type, String? message}) + : super(type: type, code: 'ModelErrorException', message: message); +} + +class ModelNotReadyException extends _s.GenericAwsException { + ModelNotReadyException({String? type, String? message}) + : super(type: type, code: 'ModelNotReadyException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(message: message), + 'ModelErrorException': (type, message) => + ModelErrorException(type: type, message: message), + 'ModelNotReadyException': (type, message) => + ModelNotReadyException(type: type, message: message), + 'ModelStreamErrorException': (type, message) => + ModelStreamErrorException(message: message), + 'ModelTimeoutException': (type, message) => + ModelTimeoutException(message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(message: message), + 'ValidationException': (type, message) => + ValidationException(message: message), +}; diff --git a/aws_client/lib/src/generated/billingconductor/v2021_07_30.dart b/aws_client/lib/src/generated/billingconductor/v2021_07_30.dart index 80d084155..75d733180 100644 --- a/aws_client/lib/src/generated/billingconductor/v2021_07_30.dart +++ b/aws_client/lib/src/generated/billingconductor/v2021_07_30.dart @@ -21,19 +21,18 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// Amazon Web Services Billing Conductor is a fully managed service that you /// can use to customize a pro -/// forma version of your billing data each month, to accurately show or -/// chargeback your end customers. Amazon Web Services Billing Conductor doesn't -/// change the way you're billed by Amazon Web Services each month by design. -/// Instead, it provides you with a mechanism to configure, generate, and -/// display rates to certain customers over a given billing period. You can also -/// analyze the difference between the rates you apply to your accounting -/// groupings relative to your actual rates from Amazon Web Services. As a -/// result of your Amazon Web Services Billing Conductor configuration, the -/// payer account can also see the custom rate applied on the billing details -/// page of the Amazon Web -/// Services Billing console, or configure a cost and usage report per -/// billing group. +/// href="https://docs.aws.amazon.com/billingconductor/latest/userguide/understanding-eb.html#eb-other-definitions">proforma +/// version of your billing data each month, to accurately show or chargeback +/// your end customers. Amazon Web Services Billing Conductor doesn't change the +/// way you're billed by Amazon Web Services each month by design. Instead, it +/// provides you with a mechanism to configure, generate, and display rates to +/// certain customers over a given billing period. You can also analyze the +/// difference between the rates you apply to your accounting groupings relative +/// to your actual rates from Amazon Web Services. As a result of your Amazon +/// Web Services Billing Conductor configuration, the payer account can also see +/// the custom rate applied on the billing details page of the Amazon Web Services Billing +/// console, or configure a cost and usage report per billing group. /// /// This documentation shows how you can configure Amazon Web Services Billing /// Conductor using its API. For more information about using the ? tags, @@ -332,6 +336,7 @@ class BillingConductor { 'ChargeDetails': chargeDetails, 'Description': description, 'Name': name, + if (accountId != null) 'AccountId': accountId, if (billingPeriodRange != null) 'BillingPeriodRange': billingPeriodRange, if (tags != null) 'Tags': tags, }; @@ -680,6 +685,64 @@ class BillingConductor { return DisassociatePricingRulesOutput.fromJson(response); } + /// Retrieves the margin summary report, which includes the Amazon Web + /// Services cost and charged amount (pro forma cost) by Amazon Web Service + /// for a specific billing group. + /// + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [arn] : + /// The Amazon Resource Number (ARN) that uniquely identifies the billing + /// group. + /// + /// Parameter [billingPeriodRange] : + /// A time range for which the margin summary is effective. You can specify up + /// to 12 months. + /// + /// Parameter [groupBy] : + /// A list of strings that specify the attributes that are used to break down + /// costs in the margin summary reports for the billing group. For example, + /// you can view your costs by the Amazon Web Service name or the billing + /// period. + /// + /// Parameter [maxResults] : + /// The maximum number of margin summary reports to retrieve. + /// + /// Parameter [nextToken] : + /// The pagination token used on subsequent calls to get reports. + Future getBillingGroupCostReport({ + required String arn, + BillingPeriodRange? billingPeriodRange, + List? groupBy, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 200, + 300, + ); + final $payload = { + 'Arn': arn, + if (billingPeriodRange != null) 'BillingPeriodRange': billingPeriodRange, + if (groupBy != null) 'GroupBy': groupBy.map((e) => e.toValue()).toList(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-billing-group-cost-report', + exceptionFnMap: _exceptionFns, + ); + return GetBillingGroupCostReportOutput.fromJson(response); + } + /// This is a paginated call to list linked accounts that are linked to the /// payer account for the specified time period. If no information is /// provided, the current billing period is used. The response will optionally @@ -1265,6 +1328,10 @@ class BillingConductor { /// Parameter [arn] : /// The Amazon Resource Name (ARN) of the billing group being updated. /// + /// Parameter [accountGrouping] : + /// Specifies if the billing group has automatic account association + /// (AutoAssociate) enabled. + /// /// Parameter [computationPreference] : /// The preferences and settings that will be used to compute the Amazon Web /// Services charges for a billing group. @@ -1280,6 +1347,7 @@ class BillingConductor { /// The status of the billing group. Only one of the valid values can be used. Future updateBillingGroup({ required String arn, + UpdateBillingGroupAccountGrouping? accountGrouping, ComputationPreference? computationPreference, String? description, String? name, @@ -1287,6 +1355,7 @@ class BillingConductor { }) async { final $payload = { 'Arn': arn, + if (accountGrouping != null) 'AccountGrouping': accountGrouping, if (computationPreference != null) 'ComputationPreference': computationPreference, if (description != null) 'Description': description, @@ -1487,21 +1556,28 @@ class AccountAssociationsListElement { } /// The set of accounts that will be under the billing group. The set of -/// accounts resemble the linked accounts in a consolidated family. +/// accounts resemble the linked accounts in a consolidated billing family. class AccountGrouping { /// The account IDs that make up the billing group. Account IDs must be a part /// of the consolidated billing family, and not associated with another billing /// group. final List linkedAccountIds; + /// Specifies if this billing group will automatically associate newly added + /// Amazon Web Services accounts that join your consolidated billing family. + final bool? autoAssociate; + AccountGrouping({ required this.linkedAccountIds, + this.autoAssociate, }); Map toJson() { final linkedAccountIds = this.linkedAccountIds; + final autoAssociate = this.autoAssociate; return { 'LinkedAccountIds': linkedAccountIds, + if (autoAssociate != null) 'AutoAssociate': autoAssociate, }; } } @@ -1660,6 +1736,40 @@ class AssociateResourceResponseElement { } } +/// The key-value pair that represents the attribute by which the +/// BillingGroupCostReportResults are grouped. For example, if you +/// want a service-level breakdown for Amazon Simple Storage Service (Amazon S3) +/// of the billing group, the attribute will be a key-value pair of +/// "PRODUCT_NAME" and "S3". +class Attribute { + /// The key in a key-value pair that describes the margin summary. + final String? key; + + /// The value in a key-value pair that describes the margin summary. + final String? value; + + Attribute({ + this.key, + this.value, + }); + + factory Attribute.fromJson(Map json) { + return Attribute( + key: json['Key'] as String?, + value: json['Value'] as String?, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + if (key != null) 'Key': key, + if (value != null) 'Value': value, + }; + } +} + class BatchAssociateResourcesToCustomLineItemOutput { /// A list of AssociateResourceResponseElement for each resource /// that failed association to a percentage custom line item. @@ -1812,8 +1922,89 @@ class BillingGroupCostReportElement { } } +/// A paginated call to retrieve a list of summary reports of actual Amazon Web +/// Services charges and the calculated Amazon Web Services charges, broken down +/// by attributes. +class BillingGroupCostReportResultElement { + /// The actual Amazon Web Services charges for the billing group. + final String? awsCost; + + /// The Amazon Resource Number (ARN) that uniquely identifies the billing group. + final String? arn; + + /// The list of key-value pairs that represent the attributes by which the + /// BillingGroupCostReportResults are grouped. For example, if you + /// want the Amazon S3 service-level breakdown of a billing group for November + /// 2023, the attributes list will contain a key-value pair of + /// "PRODUCT_NAME" and "S3" and a key-value pair of + /// "BILLING_PERIOD" and "Nov 2023". + final List? attributes; + + /// The displayed currency. + final String? currency; + + /// The billing group margin. + final String? margin; + + /// The percentage of the billing group margin. + final String? marginPercentage; + + /// The hypothetical Amazon Web Services charges based on the associated pricing + /// plan of a billing group. + final String? proformaCost; + + BillingGroupCostReportResultElement({ + this.awsCost, + this.arn, + this.attributes, + this.currency, + this.margin, + this.marginPercentage, + this.proformaCost, + }); + + factory BillingGroupCostReportResultElement.fromJson( + Map json) { + return BillingGroupCostReportResultElement( + awsCost: json['AWSCost'] as String?, + arn: json['Arn'] as String?, + attributes: (json['Attributes'] as List?) + ?.whereNotNull() + .map((e) => Attribute.fromJson(e as Map)) + .toList(), + currency: json['Currency'] as String?, + margin: json['Margin'] as String?, + marginPercentage: json['MarginPercentage'] as String?, + proformaCost: json['ProformaCost'] as String?, + ); + } + + Map toJson() { + final awsCost = this.awsCost; + final arn = this.arn; + final attributes = this.attributes; + final currency = this.currency; + final margin = this.margin; + final marginPercentage = this.marginPercentage; + final proformaCost = this.proformaCost; + return { + if (awsCost != null) 'AWSCost': awsCost, + if (arn != null) 'Arn': arn, + if (attributes != null) 'Attributes': attributes, + if (currency != null) 'Currency': currency, + if (margin != null) 'Margin': margin, + if (marginPercentage != null) 'MarginPercentage': marginPercentage, + if (proformaCost != null) 'ProformaCost': proformaCost, + }; + } +} + /// A representation of a billing group. class BillingGroupListElement { + /// Specifies if the billing group has automatic account association + /// (AutoAssociate) enabled. + final ListBillingGroupAccountGrouping? accountGrouping; + /// The Amazon Resource Number (ARN) that can be used to uniquely identify the /// billing group. final String? arn; @@ -1844,6 +2035,7 @@ class BillingGroupListElement { final String? statusReason; BillingGroupListElement({ + this.accountGrouping, this.arn, this.computationPreference, this.creationTime, @@ -1858,6 +2050,10 @@ class BillingGroupListElement { factory BillingGroupListElement.fromJson(Map json) { return BillingGroupListElement( + accountGrouping: json['AccountGrouping'] != null + ? ListBillingGroupAccountGrouping.fromJson( + json['AccountGrouping'] as Map) + : null, arn: json['Arn'] as String?, computationPreference: json['ComputationPreference'] != null ? ComputationPreference.fromJson( @@ -1875,6 +2071,7 @@ class BillingGroupListElement { } Map toJson() { + final accountGrouping = this.accountGrouping; final arn = this.arn; final computationPreference = this.computationPreference; final creationTime = this.creationTime; @@ -1886,6 +2083,7 @@ class BillingGroupListElement { final status = this.status; final statusReason = this.statusReason; return { + if (accountGrouping != null) 'AccountGrouping': accountGrouping, if (arn != null) 'Arn': arn, if (computationPreference != null) 'ComputationPreference': computationPreference, @@ -1929,6 +2127,34 @@ extension BillingGroupStatusFromString on String { } } +/// A time range for which the margin summary is effective. The time range can +/// be up to 12 months. +class BillingPeriodRange { + /// The exclusive end billing period that defines a billing period range for the + /// margin summary. For example, if you choose a billing period that starts in + /// October 2023 and ends in December 2023, the margin summary will only include + /// data from October 2023 and November 2023. + final String exclusiveEndBillingPeriod; + + /// The inclusive start billing period that defines a billing period range for + /// the margin summary. + final String inclusiveStartBillingPeriod; + + BillingPeriodRange({ + required this.exclusiveEndBillingPeriod, + required this.inclusiveStartBillingPeriod, + }); + + Map toJson() { + final exclusiveEndBillingPeriod = this.exclusiveEndBillingPeriod; + final inclusiveStartBillingPeriod = this.inclusiveStartBillingPeriod; + return { + 'ExclusiveEndBillingPeriod': exclusiveEndBillingPeriod, + 'InclusiveStartBillingPeriod': inclusiveStartBillingPeriod, + }; + } +} + /// The preferences and settings that will be used to compute the Amazon Web /// Services charges for a billing group. class ComputationPreference { @@ -2142,6 +2368,9 @@ class CustomLineItemChargeDetails { /// details of a flat custom line item. final CustomLineItemFlatChargeDetails? flat; + /// A representation of the line item filter. + final List? lineItemFilters; + /// A CustomLineItemPercentageChargeDetails that describes the /// charge details of a percentage custom line item. final CustomLineItemPercentageChargeDetails? percentage; @@ -2149,16 +2378,19 @@ class CustomLineItemChargeDetails { CustomLineItemChargeDetails({ required this.type, this.flat, + this.lineItemFilters, this.percentage, }); Map toJson() { final type = this.type; final flat = this.flat; + final lineItemFilters = this.lineItemFilters; final percentage = this.percentage; return { 'Type': type.toValue(), if (flat != null) 'Flat': flat, + if (lineItemFilters != null) 'LineItemFilters': lineItemFilters, if (percentage != null) 'Percentage': percentage, }; } @@ -2184,6 +2416,10 @@ class CustomLineItemFlatChargeDetails { /// A representation of a custom line item. class CustomLineItemListElement { + /// The Amazon Web Services account in which this custom line item will be + /// applied to. + final String? accountId; + /// The Amazon Resource Names (ARNs) for custom line items. final String? arn; @@ -2219,6 +2455,7 @@ class CustomLineItemListElement { final String? productCode; CustomLineItemListElement({ + this.accountId, this.arn, this.associationSize, this.billingGroupArn, @@ -2233,6 +2470,7 @@ class CustomLineItemListElement { factory CustomLineItemListElement.fromJson(Map json) { return CustomLineItemListElement( + accountId: json['AccountId'] as String?, arn: json['Arn'] as String?, associationSize: json['AssociationSize'] as int?, billingGroupArn: json['BillingGroupArn'] as String?, @@ -2250,6 +2488,7 @@ class CustomLineItemListElement { } Map toJson() { + final accountId = this.accountId; final arn = this.arn; final associationSize = this.associationSize; final billingGroupArn = this.billingGroupArn; @@ -2261,6 +2500,7 @@ class CustomLineItemListElement { final name = this.name; final productCode = this.productCode; return { + if (accountId != null) 'AccountId': accountId, if (arn != null) 'Arn': arn, if (associationSize != null) 'AssociationSize': associationSize, if (billingGroupArn != null) 'BillingGroupArn': billingGroupArn, @@ -2359,6 +2599,10 @@ extension CustomLineItemTypeFromString on String { /// A representation of a custom line item version. class CustomLineItemVersionListElement { + /// The Amazon Web Services account in which this custom line item will be + /// applied to. + final String? accountId; + /// A list of custom line item Amazon Resource Names (ARNs) to retrieve /// information. final String? arn; @@ -2399,6 +2643,7 @@ class CustomLineItemVersionListElement { final int? startTime; CustomLineItemVersionListElement({ + this.accountId, this.arn, this.associationSize, this.billingGroupArn, @@ -2416,6 +2661,7 @@ class CustomLineItemVersionListElement { factory CustomLineItemVersionListElement.fromJson(Map json) { return CustomLineItemVersionListElement( + accountId: json['AccountId'] as String?, arn: json['Arn'] as String?, associationSize: json['AssociationSize'] as int?, billingGroupArn: json['BillingGroupArn'] as String?, @@ -2436,6 +2682,7 @@ class CustomLineItemVersionListElement { } Map toJson() { + final accountId = this.accountId; final arn = this.arn; final associationSize = this.associationSize; final billingGroupArn = this.billingGroupArn; @@ -2450,6 +2697,7 @@ class CustomLineItemVersionListElement { final startBillingPeriod = this.startBillingPeriod; final startTime = this.startTime; return { + if (accountId != null) 'AccountId': accountId, if (arn != null) 'Arn': arn, if (associationSize != null) 'AssociationSize': associationSize, if (billingGroupArn != null) 'BillingGroupArn': billingGroupArn, @@ -2490,7 +2738,7 @@ class DeleteBillingGroupOutput { } class DeleteCustomLineItemOutput { - /// Then ARN of the deleted custom line item. + /// The ARN of the deleted custom line item. final String? arn; DeleteCustomLineItemOutput({ @@ -2659,6 +2907,164 @@ class FreeTierConfig { } } +class GetBillingGroupCostReportOutput { + /// The list of margin summary reports. + final List? + billingGroupCostReportResults; + + /// The pagination token used on subsequent calls to get reports. + final String? nextToken; + + GetBillingGroupCostReportOutput({ + this.billingGroupCostReportResults, + this.nextToken, + }); + + factory GetBillingGroupCostReportOutput.fromJson(Map json) { + return GetBillingGroupCostReportOutput( + billingGroupCostReportResults: + (json['BillingGroupCostReportResults'] as List?) + ?.whereNotNull() + .map((e) => BillingGroupCostReportResultElement.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final billingGroupCostReportResults = this.billingGroupCostReportResults; + final nextToken = this.nextToken; + return { + if (billingGroupCostReportResults != null) + 'BillingGroupCostReportResults': billingGroupCostReportResults, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +enum GroupByAttributeName { + productName, + billingPeriod, +} + +extension GroupByAttributeNameValueExtension on GroupByAttributeName { + String toValue() { + switch (this) { + case GroupByAttributeName.productName: + return 'PRODUCT_NAME'; + case GroupByAttributeName.billingPeriod: + return 'BILLING_PERIOD'; + } + } +} + +extension GroupByAttributeNameFromString on String { + GroupByAttributeName toGroupByAttributeName() { + switch (this) { + case 'PRODUCT_NAME': + return GroupByAttributeName.productName; + case 'BILLING_PERIOD': + return GroupByAttributeName.billingPeriod; + } + throw Exception('$this is not known in enum GroupByAttributeName'); + } +} + +/// A representation of the line item filter for your custom line item. You can +/// use line item filters to include or exclude specific resource values from +/// the billing group's total cost. For example, if you create a custom line +/// item and you want to filter out a value, such as Savings Plan discounts, you +/// can update LineItemFilter to exclude it. +class LineItemFilter { + /// The attribute of the line item filter. This specifies what attribute that + /// you can filter on. + final LineItemFilterAttributeName attribute; + + /// The match criteria of the line item filter. This parameter specifies whether + /// not to include the resource value from the billing group total cost. + final MatchOption matchOption; + + /// The values of the line item filter. This specifies the values to filter on. + /// Currently, you can only exclude Savings Plan discounts. + final List values; + + LineItemFilter({ + required this.attribute, + required this.matchOption, + required this.values, + }); + + factory LineItemFilter.fromJson(Map json) { + return LineItemFilter( + attribute: (json['Attribute'] as String).toLineItemFilterAttributeName(), + matchOption: (json['MatchOption'] as String).toMatchOption(), + values: (json['Values'] as List) + .whereNotNull() + .map((e) => (e as String).toLineItemFilterValue()) + .toList(), + ); + } + + Map toJson() { + final attribute = this.attribute; + final matchOption = this.matchOption; + final values = this.values; + return { + 'Attribute': attribute.toValue(), + 'MatchOption': matchOption.toValue(), + 'Values': values.map((e) => e.toValue()).toList(), + }; + } +} + +enum LineItemFilterAttributeName { + lineItemType, +} + +extension LineItemFilterAttributeNameValueExtension + on LineItemFilterAttributeName { + String toValue() { + switch (this) { + case LineItemFilterAttributeName.lineItemType: + return 'LINE_ITEM_TYPE'; + } + } +} + +extension LineItemFilterAttributeNameFromString on String { + LineItemFilterAttributeName toLineItemFilterAttributeName() { + switch (this) { + case 'LINE_ITEM_TYPE': + return LineItemFilterAttributeName.lineItemType; + } + throw Exception('$this is not known in enum LineItemFilterAttributeName'); + } +} + +enum LineItemFilterValue { + savingsPlanNegation, +} + +extension LineItemFilterValueValueExtension on LineItemFilterValue { + String toValue() { + switch (this) { + case LineItemFilterValue.savingsPlanNegation: + return 'SAVINGS_PLAN_NEGATION'; + } + } +} + +extension LineItemFilterValueFromString on String { + LineItemFilterValue toLineItemFilterValue() { + switch (this) { + case 'SAVINGS_PLAN_NEGATION': + return LineItemFilterValue.savingsPlanNegation; + } + throw Exception('$this is not known in enum LineItemFilterValue'); + } +} + /// The filter on the account ID of the linked account, or any of the following: /// /// MONITORED: linked accounts that are associated to billing @@ -2738,6 +3144,30 @@ class ListAccountAssociationsOutput { } } +/// Specifies if the billing group has the following features enabled. +class ListBillingGroupAccountGrouping { + /// Specifies if this billing group will automatically associate newly added + /// Amazon Web Services accounts that join your consolidated billing family. + final bool? autoAssociate; + + ListBillingGroupAccountGrouping({ + this.autoAssociate, + }); + + factory ListBillingGroupAccountGrouping.fromJson(Map json) { + return ListBillingGroupAccountGrouping( + autoAssociate: json['AutoAssociate'] as bool?, + ); + } + + Map toJson() { + final autoAssociate = this.autoAssociate; + return { + if (autoAssociate != null) 'AutoAssociate': autoAssociate, + }; + } +} + /// The filter used to retrieve specific /// BillingGroupCostReportElements. class ListBillingGroupCostReportsFilter { @@ -2799,6 +3229,10 @@ class ListBillingGroupsFilter { /// information. final List? arns; + /// Specifies if this billing group will automatically associate newly added + /// Amazon Web Services accounts that join your consolidated billing family. + final bool? autoAssociate; + /// The pricing plan Amazon Resource Names (ARNs) to retrieve information. final String? pricingPlan; @@ -2808,16 +3242,19 @@ class ListBillingGroupsFilter { ListBillingGroupsFilter({ this.arns, + this.autoAssociate, this.pricingPlan, this.statuses, }); Map toJson() { final arns = this.arns; + final autoAssociate = this.autoAssociate; final pricingPlan = this.pricingPlan; final statuses = this.statuses; return { if (arns != null) 'Arns': arns, + if (autoAssociate != null) 'AutoAssociate': autoAssociate, if (pricingPlan != null) 'PricingPlan': pricingPlan, if (statuses != null) 'Statuses': statuses.map((e) => e.toValue()).toList(), @@ -2868,6 +3305,9 @@ class ListCustomLineItemChargeDetails { /// details of a flat custom line item. final ListCustomLineItemFlatChargeDetails? flat; + /// A representation of the line item filter. + final List? lineItemFilters; + /// A ListCustomLineItemPercentageChargeDetails that describes the /// charge details of a percentage custom line item. final ListCustomLineItemPercentageChargeDetails? percentage; @@ -2875,6 +3315,7 @@ class ListCustomLineItemChargeDetails { ListCustomLineItemChargeDetails({ required this.type, this.flat, + this.lineItemFilters, this.percentage, }); @@ -2885,6 +3326,10 @@ class ListCustomLineItemChargeDetails { ? ListCustomLineItemFlatChargeDetails.fromJson( json['Flat'] as Map) : null, + lineItemFilters: (json['LineItemFilters'] as List?) + ?.whereNotNull() + .map((e) => LineItemFilter.fromJson(e as Map)) + .toList(), percentage: json['Percentage'] != null ? ListCustomLineItemPercentageChargeDetails.fromJson( json['Percentage'] as Map) @@ -2895,10 +3340,12 @@ class ListCustomLineItemChargeDetails { Map toJson() { final type = this.type; final flat = this.flat; + final lineItemFilters = this.lineItemFilters; final percentage = this.percentage; return { 'Type': type.toValue(), if (flat != null) 'Flat': flat, + if (lineItemFilters != null) 'LineItemFilters': lineItemFilters, if (percentage != null) 'Percentage': percentage, }; } @@ -3037,6 +3484,10 @@ class ListCustomLineItemVersionsOutput { /// A filter that specifies the custom line items and billing groups to retrieve /// FFLI information. class ListCustomLineItemsFilter { + /// The Amazon Web Services accounts in which this custom line item will be + /// applied to. + final List? accountIds; + /// A list of custom line item ARNs to retrieve information. final List? arns; @@ -3047,16 +3498,19 @@ class ListCustomLineItemsFilter { final List? names; ListCustomLineItemsFilter({ + this.accountIds, this.arns, this.billingGroups, this.names, }); Map toJson() { + final accountIds = this.accountIds; final arns = this.arns; final billingGroups = this.billingGroups; final names = this.names; return { + if (accountIds != null) 'AccountIds': accountIds, if (arns != null) 'Arns': arns, if (billingGroups != null) 'BillingGroups': billingGroups, if (names != null) 'Names': names, @@ -3442,6 +3896,29 @@ class ListTagsForResourceResponse { } } +enum MatchOption { + notEqual, +} + +extension MatchOptionValueExtension on MatchOption { + String toValue() { + switch (this) { + case MatchOption.notEqual: + return 'NOT_EQUAL'; + } + } +} + +extension MatchOptionFromString on String { + MatchOption toMatchOption() { + switch (this) { + case 'NOT_EQUAL': + return MatchOption.notEqual; + } + throw Exception('$this is not known in enum MatchOption'); + } +} + /// A representation of a pricing plan. class PricingPlanListElement { /// The pricing plan Amazon Resource Names (ARN). This can be used to uniquely @@ -3754,7 +4231,36 @@ class UntagResourceResponse { } } +/// Specifies if the billing group has the following features enabled. +class UpdateBillingGroupAccountGrouping { + /// Specifies if this billing group will automatically associate newly added + /// Amazon Web Services accounts that join your consolidated billing family. + final bool? autoAssociate; + + UpdateBillingGroupAccountGrouping({ + this.autoAssociate, + }); + + factory UpdateBillingGroupAccountGrouping.fromJson( + Map json) { + return UpdateBillingGroupAccountGrouping( + autoAssociate: json['AutoAssociate'] as bool?, + ); + } + + Map toJson() { + final autoAssociate = this.autoAssociate; + return { + if (autoAssociate != null) 'AutoAssociate': autoAssociate, + }; + } +} + class UpdateBillingGroupOutput { + /// Specifies if the billing group has automatic account association + /// (AutoAssociate) enabled. + final UpdateBillingGroupAccountGrouping? accountGrouping; + /// The Amazon Resource Name (ARN) of the billing group that was updated. final String? arn; @@ -3785,6 +4291,7 @@ class UpdateBillingGroupOutput { final String? statusReason; UpdateBillingGroupOutput({ + this.accountGrouping, this.arn, this.description, this.lastModifiedTime, @@ -3798,6 +4305,10 @@ class UpdateBillingGroupOutput { factory UpdateBillingGroupOutput.fromJson(Map json) { return UpdateBillingGroupOutput( + accountGrouping: json['AccountGrouping'] != null + ? UpdateBillingGroupAccountGrouping.fromJson( + json['AccountGrouping'] as Map) + : null, arn: json['Arn'] as String?, description: json['Description'] as String?, lastModifiedTime: json['LastModifiedTime'] as int?, @@ -3811,6 +4322,7 @@ class UpdateBillingGroupOutput { } Map toJson() { + final accountGrouping = this.accountGrouping; final arn = this.arn; final description = this.description; final lastModifiedTime = this.lastModifiedTime; @@ -3821,6 +4333,7 @@ class UpdateBillingGroupOutput { final status = this.status; final statusReason = this.statusReason; return { + if (accountGrouping != null) 'AccountGrouping': accountGrouping, if (arn != null) 'Arn': arn, if (description != null) 'Description': description, if (lastModifiedTime != null) 'LastModifiedTime': lastModifiedTime, @@ -3841,20 +4354,26 @@ class UpdateCustomLineItemChargeDetails { /// charge details of a flat custom line item. final UpdateCustomLineItemFlatChargeDetails? flat; + /// A representation of the line item filter. + final List? lineItemFilters; + /// An UpdateCustomLineItemPercentageChargeDetails that describes /// the new charge details of a percentage custom line item. final UpdateCustomLineItemPercentageChargeDetails? percentage; UpdateCustomLineItemChargeDetails({ this.flat, + this.lineItemFilters, this.percentage, }); Map toJson() { final flat = this.flat; + final lineItemFilters = this.lineItemFilters; final percentage = this.percentage; return { if (flat != null) 'Flat': flat, + if (lineItemFilters != null) 'LineItemFilters': lineItemFilters, if (percentage != null) 'Percentage': percentage, }; } diff --git a/aws_client/lib/src/generated/braket/v2019_09_01.dart b/aws_client/lib/src/generated/braket/v2019_09_01.dart index 582179350..d2c42e3ab 100644 --- a/aws_client/lib/src/generated/braket/v2019_09_01.dart +++ b/aws_client/lib/src/generated/braket/v2019_09_01.dart @@ -118,6 +118,7 @@ class Braket { /// May throw [ConflictException]. /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. + /// May throw [DeviceOfflineException]. /// May throw [DeviceRetiredException]. /// May throw [InternalServiceException]. /// May throw [ServiceQuotaExceededException]. @@ -149,6 +150,9 @@ class Braket { /// run an Amazon Braket job container on behalf of user, and output resources /// to the users' s3 buckets. /// + /// Parameter [associations] : + /// The list of Amazon Braket resources associated with the hybrid job. + /// /// Parameter [checkpointConfig] : /// Information about the output locations for job checkpoint data. /// @@ -178,6 +182,7 @@ class Braket { required String jobName, required JobOutputDataConfig outputDataConfig, required String roleArn, + List? associations, JobCheckpointConfig? checkpointConfig, String? clientToken, Map? hyperParameters, @@ -192,6 +197,7 @@ class Braket { 'jobName': jobName, 'outputDataConfig': outputDataConfig, 'roleArn': roleArn, + if (associations != null) 'associations': associations, if (checkpointConfig != null) 'checkpointConfig': checkpointConfig, 'clientToken': clientToken ?? _s.generateIdempotencyToken(), if (hyperParameters != null) 'hyperParameters': hyperParameters, @@ -233,6 +239,9 @@ class Braket { /// Parameter [shots] : /// The number of shots to use for the task. /// + /// Parameter [associations] : + /// The list of Amazon Braket resources associated with the quantum task. + /// /// Parameter [clientToken] : /// The client token associated with the request. /// @@ -251,6 +260,7 @@ class Braket { required String outputS3Bucket, required String outputS3KeyPrefix, required int shots, + List? associations, String? clientToken, Object? deviceParameters, String? jobToken, @@ -269,6 +279,7 @@ class Braket { 'outputS3Bucket': outputS3Bucket, 'outputS3KeyPrefix': outputS3KeyPrefix, 'shots': shots, + if (associations != null) 'associations': associations, 'clientToken': clientToken ?? _s.generateIdempotencyToken(), if (deviceParameters != null) 'deviceParameters': jsonEncode(deviceParameters), @@ -327,13 +338,23 @@ class Braket { /// /// Parameter [jobArn] : /// The ARN of the job to retrieve. + /// + /// Parameter [additionalAttributeNames] : + /// A list of attributes to return information for. Future getJob({ required String jobArn, + List? additionalAttributeNames, }) async { + final $query = >{ + if (additionalAttributeNames != null) + 'additionalAttributeNames': + additionalAttributeNames.map((e) => e.toValue()).toList(), + }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: '/job/${Uri.encodeComponent(jobArn)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); return GetJobResponse.fromJson(response); @@ -348,14 +369,24 @@ class Braket { /// May throw [ValidationException]. /// /// Parameter [quantumTaskArn] : - /// the ARN of the task to retrieve. + /// The ARN of the task to retrieve. + /// + /// Parameter [additionalAttributeNames] : + /// A list of attributes to return information for. Future getQuantumTask({ required String quantumTaskArn, + List? additionalAttributeNames, }) async { + final $query = >{ + if (additionalAttributeNames != null) + 'additionalAttributeNames': + additionalAttributeNames.map((e) => e.toValue()).toList(), + }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: '/quantum-task/${Uri.encodeComponent(quantumTaskArn)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); return GetQuantumTaskResponse.fromJson(response); @@ -602,6 +633,59 @@ class AlgorithmSpecification { } } +/// The Amazon Braket resource and the association type. +class Association { + /// The Amazon Braket resource arn. + final String arn; + + /// The association type for the specified Amazon Braket resource arn. + final AssociationType type; + + Association({ + required this.arn, + required this.type, + }); + + factory Association.fromJson(Map json) { + return Association( + arn: json['arn'] as String, + type: (json['type'] as String).toAssociationType(), + ); + } + + Map toJson() { + final arn = this.arn; + final type = this.type; + return { + 'arn': arn, + 'type': type.toValue(), + }; + } +} + +enum AssociationType { + reservationTimeWindowArn, +} + +extension AssociationTypeValueExtension on AssociationType { + String toValue() { + switch (this) { + case AssociationType.reservationTimeWindowArn: + return 'RESERVATION_TIME_WINDOW_ARN'; + } + } +} + +extension AssociationTypeFromString on String { + AssociationType toAssociationType() { + switch (this) { + case 'RESERVATION_TIME_WINDOW_ARN': + return AssociationType.reservationTimeWindowArn; + } + throw Exception('$this is not known in enum AssociationType'); + } +} + class CancelJobResponse { /// The status of the job cancellation request. final CancellationStatus cancellationStatus; @@ -835,6 +919,44 @@ class DeviceConfig { } } +/// Information about tasks and jobs queued on a device. +class DeviceQueueInfo { + /// The name of the queue. + final QueueName queue; + + /// The number of jobs or tasks in the queue for a given device. + final String queueSize; + + /// Optional. Specifies the priority of the queue. Tasks in a priority queue are + /// processed before the tasks in a normal queue. + final QueuePriority? queuePriority; + + DeviceQueueInfo({ + required this.queue, + required this.queueSize, + this.queuePriority, + }); + + factory DeviceQueueInfo.fromJson(Map json) { + return DeviceQueueInfo( + queue: (json['queue'] as String).toQueueName(), + queueSize: json['queueSize'] as String, + queuePriority: (json['queuePriority'] as String?)?.toQueuePriority(), + ); + } + + Map toJson() { + final queue = this.queue; + final queueSize = this.queueSize; + final queuePriority = this.queuePriority; + return { + 'queue': queue.toValue(), + 'queueSize': queueSize, + if (queuePriority != null) 'queuePriority': queuePriority.toValue(), + }; + } +} + enum DeviceStatus { online, offline, @@ -966,6 +1088,9 @@ class GetDeviceResponse { /// The name of the partner company for the device. final String providerName; + /// List of information about tasks and jobs queued on a device. + final List? deviceQueueInfo; + GetDeviceResponse({ required this.deviceArn, required this.deviceCapabilities, @@ -973,6 +1098,7 @@ class GetDeviceResponse { required this.deviceStatus, required this.deviceType, required this.providerName, + this.deviceQueueInfo, }); factory GetDeviceResponse.fromJson(Map json) { @@ -984,6 +1110,10 @@ class GetDeviceResponse { deviceStatus: (json['deviceStatus'] as String).toDeviceStatus(), deviceType: (json['deviceType'] as String).toDeviceType(), providerName: json['providerName'] as String, + deviceQueueInfo: (json['deviceQueueInfo'] as List?) + ?.whereNotNull() + .map((e) => DeviceQueueInfo.fromJson(e as Map)) + .toList(), ); } @@ -994,6 +1124,7 @@ class GetDeviceResponse { final deviceStatus = this.deviceStatus; final deviceType = this.deviceType; final providerName = this.providerName; + final deviceQueueInfo = this.deviceQueueInfo; return { 'deviceArn': deviceArn, 'deviceCapabilities': jsonEncode(deviceCapabilities), @@ -1001,6 +1132,7 @@ class GetDeviceResponse { 'deviceStatus': deviceStatus.toValue(), 'deviceType': deviceType.toValue(), 'providerName': providerName, + if (deviceQueueInfo != null) 'deviceQueueInfo': deviceQueueInfo, }; } } @@ -1036,6 +1168,9 @@ class GetJobResponse { /// The status of the Amazon Braket job. final JobPrimaryStatus status; + /// The list of Amazon Braket resources associated with the hybrid job. + final List? associations; + /// The billable time the Amazon Braket job used to complete. final int? billableDuration; @@ -1066,6 +1201,12 @@ class GetJobResponse { /// it is located. final List? inputDataConfig; + /// Queue information for the requested job. Only returned if + /// QueueInfo is specified in the + /// additionalAttributeNames" field in the GetJob API + /// request. + final HybridJobQueueInfo? queueInfo; + /// The date and time that the Amazon Braket job was started. final DateTime? startedAt; @@ -1085,6 +1226,7 @@ class GetJobResponse { required this.outputDataConfig, required this.roleArn, required this.status, + this.associations, this.billableDuration, this.checkpointConfig, this.deviceConfig, @@ -1093,6 +1235,7 @@ class GetJobResponse { this.failureReason, this.hyperParameters, this.inputDataConfig, + this.queueInfo, this.startedAt, this.stoppingCondition, this.tags, @@ -1111,6 +1254,10 @@ class GetJobResponse { json['outputDataConfig'] as Map), roleArn: json['roleArn'] as String, status: (json['status'] as String).toJobPrimaryStatus(), + associations: (json['associations'] as List?) + ?.whereNotNull() + .map((e) => Association.fromJson(e as Map)) + .toList(), billableDuration: json['billableDuration'] as int?, checkpointConfig: json['checkpointConfig'] != null ? JobCheckpointConfig.fromJson( @@ -1131,6 +1278,10 @@ class GetJobResponse { ?.whereNotNull() .map((e) => InputFileConfig.fromJson(e as Map)) .toList(), + queueInfo: json['queueInfo'] != null + ? HybridJobQueueInfo.fromJson( + json['queueInfo'] as Map) + : null, startedAt: timeStampFromJson(json['startedAt']), stoppingCondition: json['stoppingCondition'] != null ? JobStoppingCondition.fromJson( @@ -1150,6 +1301,7 @@ class GetJobResponse { final outputDataConfig = this.outputDataConfig; final roleArn = this.roleArn; final status = this.status; + final associations = this.associations; final billableDuration = this.billableDuration; final checkpointConfig = this.checkpointConfig; final deviceConfig = this.deviceConfig; @@ -1158,6 +1310,7 @@ class GetJobResponse { final failureReason = this.failureReason; final hyperParameters = this.hyperParameters; final inputDataConfig = this.inputDataConfig; + final queueInfo = this.queueInfo; final startedAt = this.startedAt; final stoppingCondition = this.stoppingCondition; final tags = this.tags; @@ -1170,6 +1323,7 @@ class GetJobResponse { 'outputDataConfig': outputDataConfig, 'roleArn': roleArn, 'status': status.toValue(), + if (associations != null) 'associations': associations, if (billableDuration != null) 'billableDuration': billableDuration, if (checkpointConfig != null) 'checkpointConfig': checkpointConfig, if (deviceConfig != null) 'deviceConfig': deviceConfig, @@ -1178,6 +1332,7 @@ class GetJobResponse { if (failureReason != null) 'failureReason': failureReason, if (hyperParameters != null) 'hyperParameters': hyperParameters, if (inputDataConfig != null) 'inputDataConfig': inputDataConfig, + if (queueInfo != null) 'queueInfo': queueInfo, if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), if (stoppingCondition != null) 'stoppingCondition': stoppingCondition, if (tags != null) 'tags': tags, @@ -1210,6 +1365,9 @@ class GetQuantumTaskResponse { /// The status of the task. final QuantumTaskStatus status; + /// The list of Amazon Braket resources associated with the quantum task. + final List? associations; + /// The time at which the task ended. final DateTime? endedAt; @@ -1219,6 +1377,12 @@ class GetQuantumTaskResponse { /// The ARN of the Amazon Braket job associated with the quantum task. final String? jobArn; + /// Queue information for the requested quantum task. Only returned if + /// QueueInfo is specified in the + /// additionalAttributeNames" field in the + /// GetQuantumTask API request. + final QuantumTaskQueueInfo? queueInfo; + /// The tags that belong to this task. final Map? tags; @@ -1231,9 +1395,11 @@ class GetQuantumTaskResponse { required this.quantumTaskArn, required this.shots, required this.status, + this.associations, this.endedAt, this.failureReason, this.jobArn, + this.queueInfo, this.tags, }); @@ -1248,9 +1414,17 @@ class GetQuantumTaskResponse { quantumTaskArn: json['quantumTaskArn'] as String, shots: json['shots'] as int, status: (json['status'] as String).toQuantumTaskStatus(), + associations: (json['associations'] as List?) + ?.whereNotNull() + .map((e) => Association.fromJson(e as Map)) + .toList(), endedAt: timeStampFromJson(json['endedAt']), failureReason: json['failureReason'] as String?, jobArn: json['jobArn'] as String?, + queueInfo: json['queueInfo'] != null + ? QuantumTaskQueueInfo.fromJson( + json['queueInfo'] as Map) + : null, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -1265,9 +1439,11 @@ class GetQuantumTaskResponse { final quantumTaskArn = this.quantumTaskArn; final shots = this.shots; final status = this.status; + final associations = this.associations; final endedAt = this.endedAt; final failureReason = this.failureReason; final jobArn = this.jobArn; + final queueInfo = this.queueInfo; final tags = this.tags; return { 'createdAt': iso8601ToJson(createdAt), @@ -1278,14 +1454,80 @@ class GetQuantumTaskResponse { 'quantumTaskArn': quantumTaskArn, 'shots': shots, 'status': status.toValue(), + if (associations != null) 'associations': associations, if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), if (failureReason != null) 'failureReason': failureReason, if (jobArn != null) 'jobArn': jobArn, + if (queueInfo != null) 'queueInfo': queueInfo, if (tags != null) 'tags': tags, }; } } +enum HybridJobAdditionalAttributeName { + queueInfo, +} + +extension HybridJobAdditionalAttributeNameValueExtension + on HybridJobAdditionalAttributeName { + String toValue() { + switch (this) { + case HybridJobAdditionalAttributeName.queueInfo: + return 'QueueInfo'; + } + } +} + +extension HybridJobAdditionalAttributeNameFromString on String { + HybridJobAdditionalAttributeName toHybridJobAdditionalAttributeName() { + switch (this) { + case 'QueueInfo': + return HybridJobAdditionalAttributeName.queueInfo; + } + throw Exception( + '$this is not known in enum HybridJobAdditionalAttributeName'); + } +} + +/// Information about the queue for a specified job. +class HybridJobQueueInfo { + /// Current position of the job in the jobs queue. + final String position; + + /// The name of the queue. + final QueueName queue; + + /// Optional. Provides more information about the queue position. For example, + /// if the job is complete and no longer in the queue, the message field + /// contains that information. + final String? message; + + HybridJobQueueInfo({ + required this.position, + required this.queue, + this.message, + }); + + factory HybridJobQueueInfo.fromJson(Map json) { + return HybridJobQueueInfo( + position: json['position'] as String, + queue: (json['queue'] as String).toQueueName(), + message: json['message'] as String?, + ); + } + + Map toJson() { + final position = this.position; + final queue = this.queue; + final message = this.message; + return { + 'position': position, + 'queue': queue.toValue(), + if (message != null) 'message': message, + }; + } +} + /// A list of parameters that specify the input channels, type of input data, /// and where it is located. class InputFileConfig { @@ -1620,7 +1862,7 @@ class JobEventDetails { /// job. final String? message; - /// TThe type of event that occurred related to the Amazon Braket job. + /// The type of event that occurred related to the Amazon Braket job. final DateTime? timeOfEvent; JobEventDetails({ @@ -1927,6 +2169,78 @@ class ListTagsForResourceResponse { } } +enum QuantumTaskAdditionalAttributeName { + queueInfo, +} + +extension QuantumTaskAdditionalAttributeNameValueExtension + on QuantumTaskAdditionalAttributeName { + String toValue() { + switch (this) { + case QuantumTaskAdditionalAttributeName.queueInfo: + return 'QueueInfo'; + } + } +} + +extension QuantumTaskAdditionalAttributeNameFromString on String { + QuantumTaskAdditionalAttributeName toQuantumTaskAdditionalAttributeName() { + switch (this) { + case 'QueueInfo': + return QuantumTaskAdditionalAttributeName.queueInfo; + } + throw Exception( + '$this is not known in enum QuantumTaskAdditionalAttributeName'); + } +} + +/// Information about the queue for the specified quantum task. +class QuantumTaskQueueInfo { + /// Current position of the task in the quantum tasks queue. + final String position; + + /// The name of the queue. + final QueueName queue; + + /// Optional. Provides more information about the queue position. For example, + /// if the task is complete and no longer in the queue, the message field + /// contains that information. + final String? message; + + /// Optional. Specifies the priority of the queue. Quantum tasks in a priority + /// queue are processed before the tasks in a normal queue. + final QueuePriority? queuePriority; + + QuantumTaskQueueInfo({ + required this.position, + required this.queue, + this.message, + this.queuePriority, + }); + + factory QuantumTaskQueueInfo.fromJson(Map json) { + return QuantumTaskQueueInfo( + position: json['position'] as String, + queue: (json['queue'] as String).toQueueName(), + message: json['message'] as String?, + queuePriority: (json['queuePriority'] as String?)?.toQueuePriority(), + ); + } + + Map toJson() { + final position = this.position; + final queue = this.queue; + final message = this.message; + final queuePriority = this.queuePriority; + return { + 'position': position, + 'queue': queue.toValue(), + if (message != null) 'message': message, + if (queuePriority != null) 'queuePriority': queuePriority.toValue(), + }; + } +} + enum QuantumTaskStatus { created, queued, @@ -2060,6 +2374,62 @@ class QuantumTaskSummary { } } +enum QueueName { + quantumTasksQueue, + jobsQueue, +} + +extension QueueNameValueExtension on QueueName { + String toValue() { + switch (this) { + case QueueName.quantumTasksQueue: + return 'QUANTUM_TASKS_QUEUE'; + case QueueName.jobsQueue: + return 'JOBS_QUEUE'; + } + } +} + +extension QueueNameFromString on String { + QueueName toQueueName() { + switch (this) { + case 'QUANTUM_TASKS_QUEUE': + return QueueName.quantumTasksQueue; + case 'JOBS_QUEUE': + return QueueName.jobsQueue; + } + throw Exception('$this is not known in enum QueueName'); + } +} + +enum QueuePriority { + normal, + priority, +} + +extension QueuePriorityValueExtension on QueuePriority { + String toValue() { + switch (this) { + case QueuePriority.normal: + return 'Normal'; + case QueuePriority.priority: + return 'Priority'; + } + } +} + +extension QueuePriorityFromString on String { + QueuePriority toQueuePriority() { + switch (this) { + case 'Normal': + return QueuePriority.normal; + case 'Priority': + return QueuePriority.priority; + } + throw Exception('$this is not known in enum QueuePriority'); + } +} + /// Information about the data stored in Amazon S3 used by the Amazon Braket /// job. class S3DataSource { diff --git a/aws_client/lib/src/generated/budgets/v2016_10_20.dart b/aws_client/lib/src/generated/budgets/v2016_10_20.dart index 45415f838..afbe31761 100644 --- a/aws_client/lib/src/generated/budgets/v2016_10_20.dart +++ b/aws_client/lib/src/generated/budgets/v2016_10_20.dart @@ -122,6 +122,7 @@ class Budgets { /// May throw [DuplicateRecordException]. /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. /// /// Parameter [accountId] : /// The accountId that is associated with the budget. @@ -135,10 +136,16 @@ class Budgets { /// subscriber and up to 10 email subscribers. If you include notifications /// and subscribers in your CreateBudget call, Amazon Web /// Services creates the notifications and subscribers for you. + /// + /// Parameter [resourceTags] : + /// An optional list of tags to associate with the specified budget. Each tag + /// consists of a key and a value, and each key must be unique for the + /// resource. Future createBudget({ required String accountId, required Budget budget, List? notificationsWithSubscribers, + List? resourceTags, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -155,6 +162,7 @@ class Budgets { 'Budget': budget, if (notificationsWithSubscribers != null) 'NotificationsWithSubscribers': notificationsWithSubscribers, + if (resourceTags != null) 'ResourceTags': resourceTags, }, ); } @@ -168,6 +176,7 @@ class Budgets { /// May throw [NotFoundException]. /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. /// /// Parameter [actionType] : /// The type of action. This defines the type of tasks that can be carried out @@ -179,6 +188,11 @@ class Budgets { /// Parameter [executionRoleArn] : /// The role passed for action execution and reversion. Roles and actions must /// be in the same account. + /// + /// Parameter [resourceTags] : + /// An optional list of tags to associate with the specified budget action. + /// Each tag consists of a key and a value, and each key must be unique for + /// the resource. Future createBudgetAction({ required String accountId, required ActionThreshold actionThreshold, @@ -189,6 +203,7 @@ class Budgets { required String executionRoleArn, required NotificationType notificationType, required List subscribers, + List? resourceTags, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -210,6 +225,7 @@ class Budgets { 'ExecutionRoleArn': executionRoleArn, 'NotificationType': notificationType.toValue(), 'Subscribers': subscribers, + if (resourceTags != null) 'ResourceTags': resourceTags, }, ); @@ -703,8 +719,8 @@ class Budgets { /// May throw [ThrottlingException]. /// /// Parameter [maxResults] : - /// An integer that shows how many budget name entries a paginated response - /// contains. + /// An integer that represents how many budgets a paginated response contains. + /// The default is 50. Future describeBudgetNotificationsForAccount({ required String accountId, @@ -715,7 +731,7 @@ class Budgets { 'maxResults', maxResults, 1, - 50, + 1000, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -808,11 +824,11 @@ class Budgets { /// /// Parameter [accountId] : /// The accountId that is associated with the budgets that you - /// want descriptions of. + /// want to describe. /// /// Parameter [maxResults] : - /// An optional integer that represents how many entries a paginated response - /// contains. The maximum is 100. + /// An integer that represents how many budgets a paginated response contains. + /// The default is 100. /// /// Parameter [nextToken] : /// The pagination token that you include in your request to indicate the next @@ -826,7 +842,7 @@ class Budgets { 'maxResults', maxResults, 1, - 100, + 1000, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -867,7 +883,7 @@ class Budgets { /// /// Parameter [maxResults] : /// An optional integer that represents how many entries a paginated response - /// contains. The maximum is 100. + /// contains. /// /// Parameter [nextToken] : /// The pagination token that you include in your request to indicate the next @@ -928,7 +944,7 @@ class Budgets { /// /// Parameter [maxResults] : /// An optional integer that represents how many entries a paginated response - /// contains. The maximum is 100. + /// contains. /// /// Parameter [nextToken] : /// The pagination token that you include in your request to indicate the next @@ -1012,6 +1028,106 @@ class Budgets { return ExecuteBudgetActionResponse.fromJson(jsonResponse.body); } + /// Lists tags associated with a budget or budget action resource. + /// + /// May throw [ThrottlingException]. + /// May throw [NotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalErrorException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [resourceARN] : + /// The unique identifier for the resource. + Future listTagsForResource({ + required String resourceARN, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBudgetServiceGateway.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + }, + ); + + return ListTagsForResourceResponse.fromJson(jsonResponse.body); + } + + /// Creates tags for a budget or budget action resource. + /// + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [NotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalErrorException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [resourceARN] : + /// The unique identifier for the resource. + /// + /// Parameter [resourceTags] : + /// The tags associated with the resource. + Future tagResource({ + required String resourceARN, + required List resourceTags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBudgetServiceGateway.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + 'ResourceTags': resourceTags, + }, + ); + } + + /// Deletes tags associated with a budget or budget action resource. + /// + /// May throw [ThrottlingException]. + /// May throw [NotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [InternalErrorException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [resourceARN] : + /// The unique identifier for the resource. + /// + /// Parameter [resourceTagKeys] : + /// The key that's associated with the tag. + Future untagResource({ + required String resourceARN, + required List resourceTagKeys, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSBudgetServiceGateway.UntagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceARN': resourceARN, + 'ResourceTagKeys': resourceTagKeys, + }, + ); + } + /// Updates a budget. You can change every part of a budget except for the /// budgetName and the calculatedSpend. When you /// modify a budget, the calculatedSpend drops to zero until @@ -1638,8 +1754,8 @@ extension AutoAdjustTypeFromString on String { /// arn:aws:budgets::AccountId:budget/budgetName class Budget { /// The name of a budget. The name must be unique within an account. The - /// : and \ characters aren't allowed in - /// BudgetName. + /// : and \ characters, and the "/action/" substring, + /// aren't allowed in BudgetName. final String budgetName; /// Specifies whether this budget tracks costs, usage, RI utilization, RI @@ -1670,8 +1786,8 @@ class Budget { final CalculatedSpend? calculatedSpend; /// The cost filters, such as Region, Service, - /// member account, Tag, or Cost - /// Category, that are applied to a budget. + /// LinkedAccount, Tag, or CostCategory, + /// that are applied to a budget. /// /// Amazon Web Services Budgets supports the following services as a /// Service filter for RI budgets: @@ -2996,6 +3112,31 @@ class IamActionDefinition { } } +class ListTagsForResourceResponse { + /// The tags associated with the resource. + final List? resourceTags; + + ListTagsForResourceResponse({ + this.resourceTags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + resourceTags: (json['ResourceTags'] as List?) + ?.whereNotNull() + .map((e) => ResourceTag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final resourceTags = this.resourceTags; + return { + if (resourceTags != null) 'ResourceTags': resourceTags, + }; + } +} + /// A notification that's associated with a budget. A budget can have up to ten /// notifications. /// @@ -3170,6 +3311,36 @@ class NotificationWithSubscribers { } } +/// The tag structure that contains a tag key and value. +class ResourceTag { + /// The key that's associated with the tag. + final String key; + + /// The value that's associated with the tag. + final String value; + + ResourceTag({ + required this.key, + required this.value, + }); + + factory ResourceTag.fromJson(Map json) { + return ResourceTag( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + /// The service control policies (SCP) action definition details. class ScpActionDefinition { /// The policy ID attached. @@ -3205,15 +3376,26 @@ class ScpActionDefinition { /// The amount of cost or usage that's measured for a budget. /// -/// For example, a Spend for 3 GB of S3 usage has the -/// following parameters: +/// Cost example: A Spend for 3 USD of costs +/// has the following parameters: /// ///
      ///
    • /// An Amount of 3 ///
    • ///
    • -/// A unit of GB +/// A Unit of USD +///
    • +///
    +/// Usage example: A Spend for 3 GB of S3 usage +/// has the following parameters: +/// +///
      +///
    • +/// An Amount of 3 +///
    • +///
    • +/// A Unit of GB ///
    • ///
    class Spend { @@ -3222,7 +3404,7 @@ class Spend { final String amount; /// The unit of measurement that's used for the budget forecast, actual spend, - /// or budget threshold, such as USD or GBP. + /// or budget threshold. final String unit; Spend({ @@ -3363,6 +3545,18 @@ extension SubscriptionTypeFromString on String { } } +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + /// The type of threshold for a notification. enum ThresholdType { percentage, @@ -3478,6 +3672,18 @@ extension TimeUnitFromString on String { } } +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + class UpdateBudgetActionResponse { final String accountId; final String budgetName; @@ -3605,6 +3811,14 @@ class ResourceLockedException extends _s.GenericAwsException { : super(type: type, code: 'ResourceLockedException', message: message); } +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + class ThrottlingException extends _s.GenericAwsException { ThrottlingException({String? type, String? message}) : super(type: type, code: 'ThrottlingException', message: message); @@ -3629,6 +3843,8 @@ final _exceptionFns = { NotFoundException(type: type, message: message), 'ResourceLockedException': (type, message) => ResourceLockedException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), 'ThrottlingException': (type, message) => ThrottlingException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/chatbot/v2017_10_11.dart b/aws_client/lib/src/generated/chatbot/v2017_10_11.dart new file mode 100644 index 000000000..f29c7deac --- /dev/null +++ b/aws_client/lib/src/generated/chatbot/v2017_10_11.dart @@ -0,0 +1,2641 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// AWS Chatbot API +class Chatbot { + final _s.RestJsonProtocol _protocol; + Chatbot({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'chatbot', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Creates Chime Webhook Configuration + /// + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. + /// May throw [InvalidRequestException]. + /// May throw [CreateChimeWebhookConfigurationException]. + /// May throw [ConflictException]. + /// + /// Parameter [configurationName] : + /// The name of the configuration. + /// + /// Parameter [iamRoleArn] : + /// This is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [webhookDescription] : + /// Description of the webhook. Recommend using the convention + /// `RoomName/WebhookName`. See Chime setup tutorial for more details: + /// https://docs.aws.amazon.com/chatbot/latest/adminguide/chime-setup.html. + /// + /// Parameter [webhookUrl] : + /// URL for the Chime webhook. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [tags] : + /// A list of tags to apply to the configuration. + Future + createChimeWebhookConfiguration({ + required String configurationName, + required String iamRoleArn, + required List snsTopicArns, + required String webhookDescription, + required String webhookUrl, + String? loggingLevel, + List? tags, + }) async { + final $payload = { + 'ConfigurationName': configurationName, + 'IamRoleArn': iamRoleArn, + 'SnsTopicArns': snsTopicArns, + 'WebhookDescription': webhookDescription, + 'WebhookUrl': webhookUrl, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/create-chime-webhook-configuration', + exceptionFnMap: _exceptionFns, + ); + return CreateChimeWebhookConfigurationResult.fromJson(response); + } + + /// Creates MS Teams Channel Configuration + /// + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. + /// May throw [InvalidRequestException]. + /// May throw [CreateTeamsChannelConfigurationException]. + /// May throw [ConflictException]. + /// + /// Parameter [channelId] : + /// The ID of the Microsoft Teams channel. + /// + /// Parameter [configurationName] : + /// The name of the configuration. + /// + /// Parameter [iamRoleArn] : + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [teamId] : + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams + /// in the AWS Chatbot console. Then you can copy and paste the team ID from + /// the console. For more details, see steps 1-4 in Get started with Microsoft + /// Teams in the AWS Chatbot Administrator Guide. + /// + /// Parameter [tenantId] : + /// The ID of the Microsoft Teams tenant. + /// + /// Parameter [channelName] : + /// The name of the Microsoft Teams channel. + /// + /// Parameter [guardrailPolicyArns] : + /// The list of IAM policy ARNs that are applied as channel guardrails. The + /// AWS managed 'AdministratorAccess' policy is applied by default if this is + /// not set. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [tags] : + /// A list of tags to apply to the configuration. + /// + /// Parameter [teamName] : + /// The name of the Microsoft Teams Team. + /// + /// Parameter [userAuthorizationRequired] : + /// Enables use of a user role requirement in your chat configuration. + Future + createMicrosoftTeamsChannelConfiguration({ + required String channelId, + required String configurationName, + required String iamRoleArn, + required String teamId, + required String tenantId, + String? channelName, + List? guardrailPolicyArns, + String? loggingLevel, + List? snsTopicArns, + List? tags, + String? teamName, + bool? userAuthorizationRequired, + }) async { + final $payload = { + 'ChannelId': channelId, + 'ConfigurationName': configurationName, + 'IamRoleArn': iamRoleArn, + 'TeamId': teamId, + 'TenantId': tenantId, + if (channelName != null) 'ChannelName': channelName, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns, + if (tags != null) 'Tags': tags, + if (teamName != null) 'TeamName': teamName, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/create-ms-teams-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + return CreateTeamsChannelConfigurationResult.fromJson(response); + } + + /// Creates Slack Channel Configuration + /// + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. + /// May throw [InvalidRequestException]. + /// May throw [CreateSlackChannelConfigurationException]. + /// May throw [ConflictException]. + /// + /// Parameter [configurationName] : + /// The name of the configuration. + /// + /// Parameter [iamRoleArn] : + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [slackChannelId] : + /// The ID of the Slack channel. To get the ID, open Slack, right click on the + /// channel name in the left pane, then choose Copy Link. The channel ID is + /// the 9-character string at the end of the URL. For example, ABCBBLZZZ. + /// + /// Parameter [slackTeamId] : + /// The ID of the Slack workspace authorized with AWS Chatbot. + /// + /// Parameter [guardrailPolicyArns] : + /// The list of IAM policy ARNs that are applied as channel guardrails. The + /// AWS managed 'AdministratorAccess' policy is applied by default if this is + /// not set. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [slackChannelName] : + /// The name of the Slack Channel. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [tags] : + /// A list of tags to apply to the configuration. + /// + /// Parameter [userAuthorizationRequired] : + /// Enables use of a user role requirement in your chat configuration. + Future + createSlackChannelConfiguration({ + required String configurationName, + required String iamRoleArn, + required String slackChannelId, + required String slackTeamId, + List? guardrailPolicyArns, + String? loggingLevel, + String? slackChannelName, + List? snsTopicArns, + List? tags, + bool? userAuthorizationRequired, + }) async { + final $payload = { + 'ConfigurationName': configurationName, + 'IamRoleArn': iamRoleArn, + 'SlackChannelId': slackChannelId, + 'SlackTeamId': slackTeamId, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (slackChannelName != null) 'SlackChannelName': slackChannelName, + if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns, + if (tags != null) 'Tags': tags, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/create-slack-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + return CreateSlackChannelConfigurationResult.fromJson(response); + } + + /// Deletes a Chime Webhook Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [DeleteChimeWebhookConfigurationException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the ChimeWebhookConfiguration to delete. + Future deleteChimeWebhookConfiguration({ + required String chatConfigurationArn, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-chime-webhook-configuration', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes MS Teams Channel Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [DeleteTeamsChannelConfigurationException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the MicrosoftTeamsChannelConfiguration to delete. + Future deleteMicrosoftTeamsChannelConfiguration({ + required String chatConfigurationArn, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-ms-teams-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the Microsoft Teams team authorization allowing for channels to be + /// configured in that Microsoft Teams team. Note that the Microsoft Teams + /// team must have no channels configured to remove it. + /// + /// May throw [InvalidParameterException]. + /// May throw [DeleteTeamsConfiguredTeamException]. + /// + /// Parameter [teamId] : + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams + /// in the AWS Chatbot console. Then you can copy and paste the team ID from + /// the console. For more details, see steps 1-4 in Get started with Microsoft + /// Teams in the AWS Chatbot Administrator Guide. + Future deleteMicrosoftTeamsConfiguredTeam({ + required String teamId, + }) async { + final $payload = { + 'TeamId': teamId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-ms-teams-configured-teams', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a Teams user identity + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [DeleteMicrosoftTeamsUserIdentityException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the MicrosoftTeamsChannelConfiguration associated with the user + /// identity to delete. + /// + /// Parameter [userId] : + /// Id from Microsoft Teams for user. + Future deleteMicrosoftTeamsUserIdentity({ + required String chatConfigurationArn, + required String userId, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + 'UserId': userId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-ms-teams-user-identity', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes Slack Channel Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [DeleteSlackChannelConfigurationException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the SlackChannelConfiguration to delete. + Future deleteSlackChannelConfiguration({ + required String chatConfigurationArn, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-slack-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a Slack user identity + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [DeleteSlackUserIdentityException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the SlackChannelConfiguration associated with the user identity + /// to delete. + /// + /// Parameter [slackTeamId] : + /// The ID of the Slack workspace authorized with AWS Chatbot. + /// + /// Parameter [slackUserId] : + /// The ID of the user in Slack. + Future deleteSlackUserIdentity({ + required String chatConfigurationArn, + required String slackTeamId, + required String slackUserId, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + 'SlackTeamId': slackTeamId, + 'SlackUserId': slackUserId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-slack-user-identity', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the Slack workspace authorization that allows channels to be + /// configured in that workspace. This requires all configured channels in the + /// workspace to be deleted. + /// + /// May throw [InvalidParameterException]. + /// May throw [DeleteSlackWorkspaceAuthorizationFault]. + /// + /// Parameter [slackTeamId] : + /// The ID of the Slack workspace authorized with AWS Chatbot. + Future deleteSlackWorkspaceAuthorization({ + required String slackTeamId, + }) async { + final $payload = { + 'SlackTeamId': slackTeamId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-slack-workspace-authorization', + exceptionFnMap: _exceptionFns, + ); + } + + /// Lists Chime Webhook Configurations optionally filtered by + /// ChatConfigurationArn + /// + /// May throw [DescribeChimeWebhookConfigurationsException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [chatConfigurationArn] : + /// An optional ARN of a ChimeWebhookConfiguration to describe. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future + describeChimeWebhookConfigurations({ + String? chatConfigurationArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (chatConfigurationArn != null) + 'ChatConfigurationArn': chatConfigurationArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/describe-chime-webhook-configurations', + exceptionFnMap: _exceptionFns, + ); + return DescribeChimeWebhookConfigurationsResult.fromJson(response); + } + + /// Lists Slack Channel Configurations optionally filtered by + /// ChatConfigurationArn + /// + /// May throw [DescribeSlackChannelConfigurationsException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [chatConfigurationArn] : + /// An optional ARN of a SlackChannelConfiguration to describe. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future + describeSlackChannelConfigurations({ + String? chatConfigurationArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (chatConfigurationArn != null) + 'ChatConfigurationArn': chatConfigurationArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/describe-slack-channel-configurations', + exceptionFnMap: _exceptionFns, + ); + return DescribeSlackChannelConfigurationsResult.fromJson(response); + } + + /// Lists all Slack user identities with a mapped role. + /// + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [DescribeSlackUserIdentitiesException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the SlackChannelConfiguration associated with the user + /// identities to describe. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future describeSlackUserIdentities({ + String? chatConfigurationArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (chatConfigurationArn != null) + 'ChatConfigurationArn': chatConfigurationArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/describe-slack-user-identities', + exceptionFnMap: _exceptionFns, + ); + return DescribeSlackUserIdentitiesResult.fromJson(response); + } + + /// Lists all authorized Slack Workspaces for AWS Account + /// + /// May throw [DescribeSlackWorkspacesException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future describeSlackWorkspaces({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/describe-slack-workspaces', + exceptionFnMap: _exceptionFns, + ); + return DescribeSlackWorkspacesResult.fromJson(response); + } + + /// Get Chatbot account level preferences + /// + /// May throw [GetAccountPreferencesException]. + /// May throw [InvalidRequestException]. + Future getAccountPreferences() async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/get-account-preferences', + exceptionFnMap: _exceptionFns, + ); + return GetAccountPreferencesResult.fromJson(response); + } + + /// Get a single MS Teams Channel Configurations + /// + /// May throw [GetTeamsChannelConfigurationException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the MicrosoftTeamsChannelConfiguration to retrieve. + Future + getMicrosoftTeamsChannelConfiguration({ + required String chatConfigurationArn, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-ms-teams-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + return GetTeamsChannelConfigurationResult.fromJson(response); + } + + /// Lists MS Teams Channel Configurations optionally filtered by TeamId + /// + /// May throw [ListTeamsChannelConfigurationsException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + /// + /// Parameter [teamId] : + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams + /// in the AWS Chatbot console. Then you can copy and paste the team ID from + /// the console. For more details, see steps 1-4 in Get started with Microsoft + /// Teams in the AWS Chatbot Administrator Guide. + Future + listMicrosoftTeamsChannelConfigurations({ + int? maxResults, + String? nextToken, + String? teamId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (teamId != null) 'TeamId': teamId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-ms-teams-channel-configurations', + exceptionFnMap: _exceptionFns, + ); + return ListTeamsChannelConfigurationsResult.fromJson(response); + } + + /// Lists all authorized MS teams for AWS Account + /// + /// May throw [ListMicrosoftTeamsConfiguredTeamsException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future + listMicrosoftTeamsConfiguredTeams({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-ms-teams-configured-teams', + exceptionFnMap: _exceptionFns, + ); + return ListMicrosoftTeamsConfiguredTeamsResult.fromJson(response); + } + + /// Lists all Microsoft Teams user identities with a mapped role. + /// + /// May throw [ListMicrosoftTeamsUserIdentitiesException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the MicrosoftTeamsChannelConfiguration associated with the user + /// identities to list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to include in the response. If more results + /// exist than the specified MaxResults value, a token is included in the + /// response so that the remaining results can be retrieved. + /// + /// Parameter [nextToken] : + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, + /// the response includes only results beyond the token, up to the value + /// specified by MaxResults. + Future + listMicrosoftTeamsUserIdentities({ + String? chatConfigurationArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (chatConfigurationArn != null) + 'ChatConfigurationArn': chatConfigurationArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-ms-teams-user-identities', + exceptionFnMap: _exceptionFns, + ); + return ListMicrosoftTeamsUserIdentitiesResult.fromJson(response); + } + + /// Retrieves the list of tags applied to a configuration. + /// + /// May throw [InternalServiceError]. + /// May throw [ServiceUnavailableException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceARN] : + /// The ARN of the configuration. + Future listTagsForResource({ + required String resourceARN, + }) async { + final $payload = { + 'ResourceARN': resourceARN, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-tags-for-resource', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Applies the supplied tags to a configuration. + /// + /// May throw [InternalServiceError]. + /// May throw [ServiceUnavailableException]. + /// May throw [ResourceNotFoundException]. + /// May throw [TooManyTagsException]. + /// + /// Parameter [resourceARN] : + /// The ARN of the configuration. + /// + /// Parameter [tags] : + /// A list of tags to apply to the configuration. + Future tagResource({ + required String resourceARN, + required List tags, + }) async { + final $payload = { + 'ResourceARN': resourceARN, + 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tag-resource', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes the supplied tags from a configuration + /// + /// May throw [InternalServiceError]. + /// May throw [ServiceUnavailableException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceARN] : + /// The ARN of the configuration. + /// + /// Parameter [tagKeys] : + /// A list of tag keys to remove from the configuration. + Future untagResource({ + required String resourceARN, + required List tagKeys, + }) async { + final $payload = { + 'ResourceARN': resourceARN, + 'TagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/untag-resource', + exceptionFnMap: _exceptionFns, + ); + } + + /// Update Chatbot account level preferences + /// + /// May throw [UpdateAccountPreferencesException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// + /// Parameter [trainingDataCollectionEnabled] : + /// Turns on training data collection. This helps improve the AWS Chatbot + /// experience by allowing AWS Chatbot to store and use your customer + /// information, such as AWS Chatbot configurations, notifications, user + /// inputs, AWS Chatbot generated responses, and interaction data. This data + /// helps us to continuously improve and develop Artificial Intelligence (AI) + /// technologies. Your data is not shared with any third parties and is + /// protected using sophisticated controls to prevent unauthorized access and + /// misuse. AWS Chatbot does not store or use interactions in chat channels + /// with Amazon Q for training AWS Chatbot’s AI technologies. + /// + /// Parameter [userAuthorizationRequired] : + /// Enables use of a user role requirement in your chat configuration. + Future updateAccountPreferences({ + bool? trainingDataCollectionEnabled, + bool? userAuthorizationRequired, + }) async { + final $payload = { + if (trainingDataCollectionEnabled != null) + 'TrainingDataCollectionEnabled': trainingDataCollectionEnabled, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-account-preferences', + exceptionFnMap: _exceptionFns, + ); + return UpdateAccountPreferencesResult.fromJson(response); + } + + /// Updates a Chime Webhook Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [UpdateChimeWebhookConfigurationException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the ChimeWebhookConfiguration to update. + /// + /// Parameter [iamRoleArn] : + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [webhookDescription] : + /// Description of the webhook. Recommend using the convention + /// `RoomName/WebhookName`. See Chime setup tutorial for more details: + /// https://docs.aws.amazon.com/chatbot/latest/adminguide/chime-setup.html. + /// + /// Parameter [webhookUrl] : + /// URL for the Chime webhook. + Future + updateChimeWebhookConfiguration({ + required String chatConfigurationArn, + String? iamRoleArn, + String? loggingLevel, + List? snsTopicArns, + String? webhookDescription, + String? webhookUrl, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns, + if (webhookDescription != null) 'WebhookDescription': webhookDescription, + if (webhookUrl != null) 'WebhookUrl': webhookUrl, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-chime-webhook-configuration', + exceptionFnMap: _exceptionFns, + ); + return UpdateChimeWebhookConfigurationResult.fromJson(response); + } + + /// Updates MS Teams Channel Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [UpdateTeamsChannelConfigurationException]. + /// + /// Parameter [channelId] : + /// The ID of the Microsoft Teams channel. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the MicrosoftTeamsChannelConfiguration to update. + /// + /// Parameter [channelName] : + /// The name of the Microsoft Teams channel. + /// + /// Parameter [guardrailPolicyArns] : + /// The list of IAM policy ARNs that are applied as channel guardrails. The + /// AWS managed 'AdministratorAccess' policy is applied by default if this is + /// not set. + /// + /// Parameter [iamRoleArn] : + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [userAuthorizationRequired] : + /// Enables use of a user role requirement in your chat configuration. + Future + updateMicrosoftTeamsChannelConfiguration({ + required String channelId, + required String chatConfigurationArn, + String? channelName, + List? guardrailPolicyArns, + String? iamRoleArn, + String? loggingLevel, + List? snsTopicArns, + bool? userAuthorizationRequired, + }) async { + final $payload = { + 'ChannelId': channelId, + 'ChatConfigurationArn': chatConfigurationArn, + if (channelName != null) 'ChannelName': channelName, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-ms-teams-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + return UpdateTeamsChannelConfigurationResult.fromJson(response); + } + + /// Updates Slack Channel Configuration + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [UpdateSlackChannelConfigurationException]. + /// + /// Parameter [chatConfigurationArn] : + /// The ARN of the SlackChannelConfiguration to update. + /// + /// Parameter [slackChannelId] : + /// The ID of the Slack channel. To get the ID, open Slack, right click on the + /// channel name in the left pane, then choose Copy Link. The channel ID is + /// the 9-character string at the end of the URL. For example, ABCBBLZZZ. + /// + /// Parameter [guardrailPolicyArns] : + /// The list of IAM policy ARNs that are applied as channel guardrails. The + /// AWS managed 'AdministratorAccess' policy is applied by default if this is + /// not set. + /// + /// Parameter [iamRoleArn] : + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS + /// Chatbot. + /// + /// Parameter [loggingLevel] : + /// Logging levels include ERROR, INFO, or NONE. + /// + /// Parameter [slackChannelName] : + /// The name of the Slack Channel. + /// + /// Parameter [snsTopicArns] : + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + /// + /// Parameter [userAuthorizationRequired] : + /// Enables use of a user role requirement in your chat configuration. + Future + updateSlackChannelConfiguration({ + required String chatConfigurationArn, + required String slackChannelId, + List? guardrailPolicyArns, + String? iamRoleArn, + String? loggingLevel, + String? slackChannelName, + List? snsTopicArns, + bool? userAuthorizationRequired, + }) async { + final $payload = { + 'ChatConfigurationArn': chatConfigurationArn, + 'SlackChannelId': slackChannelId, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (iamRoleArn != null) 'IamRoleArn': iamRoleArn, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (slackChannelName != null) 'SlackChannelName': slackChannelName, + if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-slack-channel-configuration', + exceptionFnMap: _exceptionFns, + ); + return UpdateSlackChannelConfigurationResult.fromJson(response); + } +} + +/// Preferences which apply for AWS Chatbot usage in the calling AWS account. +class AccountPreferences { + /// Turns on training data collection. This helps improve the AWS Chatbot + /// experience by allowing AWS Chatbot to store and use your customer + /// information, such as AWS Chatbot configurations, notifications, user inputs, + /// AWS Chatbot generated responses, and interaction data. This data helps us to + /// continuously improve and develop Artificial Intelligence (AI) technologies. + /// Your data is not shared with any third parties and is protected using + /// sophisticated controls to prevent unauthorized access and misuse. AWS + /// Chatbot does not store or use interactions in chat channels with Amazon Q + /// for training AWS Chatbot’s AI technologies. + final bool? trainingDataCollectionEnabled; + + /// Enables use of a user role requirement in your chat configuration. + final bool? userAuthorizationRequired; + + AccountPreferences({ + this.trainingDataCollectionEnabled, + this.userAuthorizationRequired, + }); + + factory AccountPreferences.fromJson(Map json) { + return AccountPreferences( + trainingDataCollectionEnabled: + json['TrainingDataCollectionEnabled'] as bool?, + userAuthorizationRequired: json['UserAuthorizationRequired'] as bool?, + ); + } + + Map toJson() { + final trainingDataCollectionEnabled = this.trainingDataCollectionEnabled; + final userAuthorizationRequired = this.userAuthorizationRequired; + return { + if (trainingDataCollectionEnabled != null) + 'TrainingDataCollectionEnabled': trainingDataCollectionEnabled, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + } +} + +/// An AWS Chatbot configuration for Amazon Chime. +class ChimeWebhookConfiguration { + /// The ARN of the ChimeWebhookConfiguration. + final String chatConfigurationArn; + + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS Chatbot. + final String iamRoleArn; + + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + final List snsTopicArns; + + /// Description of the webhook. Recommend using the convention + /// `RoomName/WebhookName`. See Chime setup tutorial for more details: + /// https://docs.aws.amazon.com/chatbot/latest/adminguide/chime-setup.html. + final String webhookDescription; + + /// The name of the configuration. + final String? configurationName; + + /// Specifies the logging level for this configuration. This property affects + /// the log entries pushed to Amazon CloudWatch Logs.Logging levels include + /// ERROR, INFO, or NONE. + final String? loggingLevel; + + /// A list of tags applied to the configuration. + final List? tags; + + ChimeWebhookConfiguration({ + required this.chatConfigurationArn, + required this.iamRoleArn, + required this.snsTopicArns, + required this.webhookDescription, + this.configurationName, + this.loggingLevel, + this.tags, + }); + + factory ChimeWebhookConfiguration.fromJson(Map json) { + return ChimeWebhookConfiguration( + chatConfigurationArn: json['ChatConfigurationArn'] as String, + iamRoleArn: json['IamRoleArn'] as String, + snsTopicArns: (json['SnsTopicArns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + webhookDescription: json['WebhookDescription'] as String, + configurationName: json['ConfigurationName'] as String?, + loggingLevel: json['LoggingLevel'] as String?, + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final chatConfigurationArn = this.chatConfigurationArn; + final iamRoleArn = this.iamRoleArn; + final snsTopicArns = this.snsTopicArns; + final webhookDescription = this.webhookDescription; + final configurationName = this.configurationName; + final loggingLevel = this.loggingLevel; + final tags = this.tags; + return { + 'ChatConfigurationArn': chatConfigurationArn, + 'IamRoleArn': iamRoleArn, + 'SnsTopicArns': snsTopicArns, + 'WebhookDescription': webhookDescription, + if (configurationName != null) 'ConfigurationName': configurationName, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (tags != null) 'Tags': tags, + }; + } +} + +/// A Microsoft Teams team that has been authorized with AWS Chatbot. +class ConfiguredTeam { + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams in + /// the AWS Chatbot console. Then you can copy and paste the team ID from the + /// console. For more details, see steps 1-4 in Get started with Microsoft Teams + /// in the AWS Chatbot Administrator Guide. + final String teamId; + + /// The ID of the Microsoft Teams tenant. + final String tenantId; + + /// The name of the Microsoft Teams Team. + final String? teamName; + + ConfiguredTeam({ + required this.teamId, + required this.tenantId, + this.teamName, + }); + + factory ConfiguredTeam.fromJson(Map json) { + return ConfiguredTeam( + teamId: json['TeamId'] as String, + tenantId: json['TenantId'] as String, + teamName: json['TeamName'] as String?, + ); + } + + Map toJson() { + final teamId = this.teamId; + final tenantId = this.tenantId; + final teamName = this.teamName; + return { + 'TeamId': teamId, + 'TenantId': tenantId, + if (teamName != null) 'TeamName': teamName, + }; + } +} + +class CreateChimeWebhookConfigurationResult { + /// Chime webhook configuration. + final ChimeWebhookConfiguration? webhookConfiguration; + + CreateChimeWebhookConfigurationResult({ + this.webhookConfiguration, + }); + + factory CreateChimeWebhookConfigurationResult.fromJson( + Map json) { + return CreateChimeWebhookConfigurationResult( + webhookConfiguration: json['WebhookConfiguration'] != null + ? ChimeWebhookConfiguration.fromJson( + json['WebhookConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final webhookConfiguration = this.webhookConfiguration; + return { + if (webhookConfiguration != null) + 'WebhookConfiguration': webhookConfiguration, + }; + } +} + +class CreateSlackChannelConfigurationResult { + /// The configuration for a Slack channel configured with AWS Chatbot. + final SlackChannelConfiguration? channelConfiguration; + + CreateSlackChannelConfigurationResult({ + this.channelConfiguration, + }); + + factory CreateSlackChannelConfigurationResult.fromJson( + Map json) { + return CreateSlackChannelConfigurationResult( + channelConfiguration: json['ChannelConfiguration'] != null + ? SlackChannelConfiguration.fromJson( + json['ChannelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final channelConfiguration = this.channelConfiguration; + return { + if (channelConfiguration != null) + 'ChannelConfiguration': channelConfiguration, + }; + } +} + +class CreateTeamsChannelConfigurationResult { + /// The configuration for a Microsoft Teams channel configured with AWS Chatbot. + final TeamsChannelConfiguration? channelConfiguration; + + CreateTeamsChannelConfigurationResult({ + this.channelConfiguration, + }); + + factory CreateTeamsChannelConfigurationResult.fromJson( + Map json) { + return CreateTeamsChannelConfigurationResult( + channelConfiguration: json['ChannelConfiguration'] != null + ? TeamsChannelConfiguration.fromJson( + json['ChannelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final channelConfiguration = this.channelConfiguration; + return { + if (channelConfiguration != null) + 'ChannelConfiguration': channelConfiguration, + }; + } +} + +class DeleteChimeWebhookConfigurationResult { + DeleteChimeWebhookConfigurationResult(); + + factory DeleteChimeWebhookConfigurationResult.fromJson( + Map _) { + return DeleteChimeWebhookConfigurationResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteMicrosoftTeamsUserIdentityResult { + DeleteMicrosoftTeamsUserIdentityResult(); + + factory DeleteMicrosoftTeamsUserIdentityResult.fromJson( + Map _) { + return DeleteMicrosoftTeamsUserIdentityResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSlackChannelConfigurationResult { + DeleteSlackChannelConfigurationResult(); + + factory DeleteSlackChannelConfigurationResult.fromJson( + Map _) { + return DeleteSlackChannelConfigurationResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSlackUserIdentityResult { + DeleteSlackUserIdentityResult(); + + factory DeleteSlackUserIdentityResult.fromJson(Map _) { + return DeleteSlackUserIdentityResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSlackWorkspaceAuthorizationResult { + DeleteSlackWorkspaceAuthorizationResult(); + + factory DeleteSlackWorkspaceAuthorizationResult.fromJson( + Map _) { + return DeleteSlackWorkspaceAuthorizationResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteTeamsChannelConfigurationResult { + DeleteTeamsChannelConfigurationResult(); + + factory DeleteTeamsChannelConfigurationResult.fromJson( + Map _) { + return DeleteTeamsChannelConfigurationResult(); + } + + Map toJson() { + return {}; + } +} + +class DeleteTeamsConfiguredTeamResult { + DeleteTeamsConfiguredTeamResult(); + + factory DeleteTeamsConfiguredTeamResult.fromJson(Map _) { + return DeleteTeamsConfiguredTeamResult(); + } + + Map toJson() { + return {}; + } +} + +class DescribeChimeWebhookConfigurationsResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// A list of Chime webhooks associated with the account. + final List? webhookConfigurations; + + DescribeChimeWebhookConfigurationsResult({ + this.nextToken, + this.webhookConfigurations, + }); + + factory DescribeChimeWebhookConfigurationsResult.fromJson( + Map json) { + return DescribeChimeWebhookConfigurationsResult( + nextToken: json['NextToken'] as String?, + webhookConfigurations: (json['WebhookConfigurations'] as List?) + ?.whereNotNull() + .map((e) => + ChimeWebhookConfiguration.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final webhookConfigurations = this.webhookConfigurations; + return { + if (nextToken != null) 'NextToken': nextToken, + if (webhookConfigurations != null) + 'WebhookConfigurations': webhookConfigurations, + }; + } +} + +class DescribeSlackChannelConfigurationsResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// A list of Slack channel configurations. + final List? slackChannelConfigurations; + + DescribeSlackChannelConfigurationsResult({ + this.nextToken, + this.slackChannelConfigurations, + }); + + factory DescribeSlackChannelConfigurationsResult.fromJson( + Map json) { + return DescribeSlackChannelConfigurationsResult( + nextToken: json['NextToken'] as String?, + slackChannelConfigurations: (json['SlackChannelConfigurations'] as List?) + ?.whereNotNull() + .map((e) => + SlackChannelConfiguration.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final slackChannelConfigurations = this.slackChannelConfigurations; + return { + if (nextToken != null) 'NextToken': nextToken, + if (slackChannelConfigurations != null) + 'SlackChannelConfigurations': slackChannelConfigurations, + }; + } +} + +class DescribeSlackUserIdentitiesResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// A list of Slack User Identities. + final List? slackUserIdentities; + + DescribeSlackUserIdentitiesResult({ + this.nextToken, + this.slackUserIdentities, + }); + + factory DescribeSlackUserIdentitiesResult.fromJson( + Map json) { + return DescribeSlackUserIdentitiesResult( + nextToken: json['NextToken'] as String?, + slackUserIdentities: (json['SlackUserIdentities'] as List?) + ?.whereNotNull() + .map((e) => SlackUserIdentity.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final slackUserIdentities = this.slackUserIdentities; + return { + if (nextToken != null) 'NextToken': nextToken, + if (slackUserIdentities != null) + 'SlackUserIdentities': slackUserIdentities, + }; + } +} + +class DescribeSlackWorkspacesResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// A list of Slack Workspaces registered with AWS Chatbot. + final List? slackWorkspaces; + + DescribeSlackWorkspacesResult({ + this.nextToken, + this.slackWorkspaces, + }); + + factory DescribeSlackWorkspacesResult.fromJson(Map json) { + return DescribeSlackWorkspacesResult( + nextToken: json['NextToken'] as String?, + slackWorkspaces: (json['SlackWorkspaces'] as List?) + ?.whereNotNull() + .map((e) => SlackWorkspace.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final slackWorkspaces = this.slackWorkspaces; + return { + if (nextToken != null) 'NextToken': nextToken, + if (slackWorkspaces != null) 'SlackWorkspaces': slackWorkspaces, + }; + } +} + +class GetAccountPreferencesResult { + /// Preferences which apply for AWS Chatbot usage in the calling AWS account. + final AccountPreferences? accountPreferences; + + GetAccountPreferencesResult({ + this.accountPreferences, + }); + + factory GetAccountPreferencesResult.fromJson(Map json) { + return GetAccountPreferencesResult( + accountPreferences: json['AccountPreferences'] != null + ? AccountPreferences.fromJson( + json['AccountPreferences'] as Map) + : null, + ); + } + + Map toJson() { + final accountPreferences = this.accountPreferences; + return { + if (accountPreferences != null) 'AccountPreferences': accountPreferences, + }; + } +} + +class GetTeamsChannelConfigurationResult { + /// The configuration for a Microsoft Teams channel configured with AWS Chatbot. + final TeamsChannelConfiguration? channelConfiguration; + + GetTeamsChannelConfigurationResult({ + this.channelConfiguration, + }); + + factory GetTeamsChannelConfigurationResult.fromJson( + Map json) { + return GetTeamsChannelConfigurationResult( + channelConfiguration: json['ChannelConfiguration'] != null + ? TeamsChannelConfiguration.fromJson( + json['ChannelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final channelConfiguration = this.channelConfiguration; + return { + if (channelConfiguration != null) + 'ChannelConfiguration': channelConfiguration, + }; + } +} + +class ListMicrosoftTeamsConfiguredTeamsResult { + /// A list of teams in Microsoft Teams that have been configured with AWS + /// Chatbot. + final List? configuredTeams; + + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + ListMicrosoftTeamsConfiguredTeamsResult({ + this.configuredTeams, + this.nextToken, + }); + + factory ListMicrosoftTeamsConfiguredTeamsResult.fromJson( + Map json) { + return ListMicrosoftTeamsConfiguredTeamsResult( + configuredTeams: (json['ConfiguredTeams'] as List?) + ?.whereNotNull() + .map((e) => ConfiguredTeam.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final configuredTeams = this.configuredTeams; + final nextToken = this.nextToken; + return { + if (configuredTeams != null) 'ConfiguredTeams': configuredTeams, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListMicrosoftTeamsUserIdentitiesResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// User level permissions associated to a channel configuration. + final List? teamsUserIdentities; + + ListMicrosoftTeamsUserIdentitiesResult({ + this.nextToken, + this.teamsUserIdentities, + }); + + factory ListMicrosoftTeamsUserIdentitiesResult.fromJson( + Map json) { + return ListMicrosoftTeamsUserIdentitiesResult( + nextToken: json['NextToken'] as String?, + teamsUserIdentities: (json['TeamsUserIdentities'] as List?) + ?.whereNotNull() + .map((e) => TeamsUserIdentity.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final teamsUserIdentities = this.teamsUserIdentities; + return { + if (nextToken != null) 'NextToken': nextToken, + if (teamsUserIdentities != null) + 'TeamsUserIdentities': teamsUserIdentities, + }; + } +} + +class ListTagsForResourceResponse { + /// A list of tags applied to the configuration. + final List? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'Tags': tags, + }; + } +} + +class ListTeamsChannelConfigurationsResult { + /// An optional token returned from a prior request. Use this token for + /// pagination of results from this action. If this parameter is specified, the + /// response includes only results beyond the token, up to the value specified + /// by MaxResults. + final String? nextToken; + + /// A list of AWS Chatbot channel configurations for Microsoft Teams. + final List? teamChannelConfigurations; + + ListTeamsChannelConfigurationsResult({ + this.nextToken, + this.teamChannelConfigurations, + }); + + factory ListTeamsChannelConfigurationsResult.fromJson( + Map json) { + return ListTeamsChannelConfigurationsResult( + nextToken: json['NextToken'] as String?, + teamChannelConfigurations: (json['TeamChannelConfigurations'] as List?) + ?.whereNotNull() + .map((e) => + TeamsChannelConfiguration.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final teamChannelConfigurations = this.teamChannelConfigurations; + return { + if (nextToken != null) 'NextToken': nextToken, + if (teamChannelConfigurations != null) + 'TeamChannelConfigurations': teamChannelConfigurations, + }; + } +} + +/// An AWS Chatbot configuration for Slack. +class SlackChannelConfiguration { + /// The ARN of the SlackChannelConfiguration. + final String chatConfigurationArn; + + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS Chatbot. + final String iamRoleArn; + + /// The ID of the Slack channel. To get the ID, open Slack, right click on the + /// channel name in the left pane, then choose Copy Link. The channel ID is the + /// 9-character string at the end of the URL. For example, ABCBBLZZZ. + final String slackChannelId; + + /// The name of the Slack Channel. + final String slackChannelName; + + /// The ID of the Slack workspace authorized with AWS Chatbot. + final String slackTeamId; + + /// Name of the Slack Workspace. + final String slackTeamName; + + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + final List snsTopicArns; + + /// The name of the configuration. + final String? configurationName; + + /// The list of IAM policy ARNs that are applied as channel guardrails. The AWS + /// managed 'AdministratorAccess' policy is applied by default if this is not + /// set. + final List? guardrailPolicyArns; + + /// Logging levels include ERROR, INFO, or NONE. + final String? loggingLevel; + + /// A list of tags applied to the configuration. + final List? tags; + + /// Enables use of a user role requirement in your chat configuration. + final bool? userAuthorizationRequired; + + SlackChannelConfiguration({ + required this.chatConfigurationArn, + required this.iamRoleArn, + required this.slackChannelId, + required this.slackChannelName, + required this.slackTeamId, + required this.slackTeamName, + required this.snsTopicArns, + this.configurationName, + this.guardrailPolicyArns, + this.loggingLevel, + this.tags, + this.userAuthorizationRequired, + }); + + factory SlackChannelConfiguration.fromJson(Map json) { + return SlackChannelConfiguration( + chatConfigurationArn: json['ChatConfigurationArn'] as String, + iamRoleArn: json['IamRoleArn'] as String, + slackChannelId: json['SlackChannelId'] as String, + slackChannelName: json['SlackChannelName'] as String, + slackTeamId: json['SlackTeamId'] as String, + slackTeamName: json['SlackTeamName'] as String, + snsTopicArns: (json['SnsTopicArns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + configurationName: json['ConfigurationName'] as String?, + guardrailPolicyArns: (json['GuardrailPolicyArns'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + loggingLevel: json['LoggingLevel'] as String?, + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + userAuthorizationRequired: json['UserAuthorizationRequired'] as bool?, + ); + } + + Map toJson() { + final chatConfigurationArn = this.chatConfigurationArn; + final iamRoleArn = this.iamRoleArn; + final slackChannelId = this.slackChannelId; + final slackChannelName = this.slackChannelName; + final slackTeamId = this.slackTeamId; + final slackTeamName = this.slackTeamName; + final snsTopicArns = this.snsTopicArns; + final configurationName = this.configurationName; + final guardrailPolicyArns = this.guardrailPolicyArns; + final loggingLevel = this.loggingLevel; + final tags = this.tags; + final userAuthorizationRequired = this.userAuthorizationRequired; + return { + 'ChatConfigurationArn': chatConfigurationArn, + 'IamRoleArn': iamRoleArn, + 'SlackChannelId': slackChannelId, + 'SlackChannelName': slackChannelName, + 'SlackTeamId': slackTeamId, + 'SlackTeamName': slackTeamName, + 'SnsTopicArns': snsTopicArns, + if (configurationName != null) 'ConfigurationName': configurationName, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (tags != null) 'Tags': tags, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + } +} + +/// Identifes a User level permission for a channel configuration. +class SlackUserIdentity { + /// The ARN of the SlackChannelConfiguration associated with the user identity. + final String chatConfigurationArn; + + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS Chatbot. + final String iamRoleArn; + + /// The ID of the Slack workspace authorized with AWS Chatbot. + final String slackTeamId; + + /// The ID of the user in Slack. + final String slackUserId; + + /// The AWS user identity ARN used to associate a Slack User Identity with an + /// IAM Role. + final String? awsUserIdentity; + + SlackUserIdentity({ + required this.chatConfigurationArn, + required this.iamRoleArn, + required this.slackTeamId, + required this.slackUserId, + this.awsUserIdentity, + }); + + factory SlackUserIdentity.fromJson(Map json) { + return SlackUserIdentity( + chatConfigurationArn: json['ChatConfigurationArn'] as String, + iamRoleArn: json['IamRoleArn'] as String, + slackTeamId: json['SlackTeamId'] as String, + slackUserId: json['SlackUserId'] as String, + awsUserIdentity: json['AwsUserIdentity'] as String?, + ); + } + + Map toJson() { + final chatConfigurationArn = this.chatConfigurationArn; + final iamRoleArn = this.iamRoleArn; + final slackTeamId = this.slackTeamId; + final slackUserId = this.slackUserId; + final awsUserIdentity = this.awsUserIdentity; + return { + 'ChatConfigurationArn': chatConfigurationArn, + 'IamRoleArn': iamRoleArn, + 'SlackTeamId': slackTeamId, + 'SlackUserId': slackUserId, + if (awsUserIdentity != null) 'AwsUserIdentity': awsUserIdentity, + }; + } +} + +/// A Slack Workspace. +class SlackWorkspace { + /// The ID of the Slack workspace authorized with AWS Chatbot. + final String slackTeamId; + + /// Name of the Slack Workspace. + final String slackTeamName; + + SlackWorkspace({ + required this.slackTeamId, + required this.slackTeamName, + }); + + factory SlackWorkspace.fromJson(Map json) { + return SlackWorkspace( + slackTeamId: json['SlackTeamId'] as String, + slackTeamName: json['SlackTeamName'] as String, + ); + } + + Map toJson() { + final slackTeamId = this.slackTeamId; + final slackTeamName = this.slackTeamName; + return { + 'SlackTeamId': slackTeamId, + 'SlackTeamName': slackTeamName, + }; + } +} + +/// A tag applied to the configuration. +class Tag { + /// The tag key. + final String tagKey; + + /// The tag value. + final String tagValue; + + Tag({ + required this.tagKey, + required this.tagValue, + }); + + factory Tag.fromJson(Map json) { + return Tag( + tagKey: json['TagKey'] as String, + tagValue: json['TagValue'] as String, + ); + } + + Map toJson() { + final tagKey = this.tagKey; + final tagValue = this.tagValue; + return { + 'TagKey': tagKey, + 'TagValue': tagValue, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +/// An AWS Chatbot configuration for Microsoft Teams. +class TeamsChannelConfiguration { + /// The ID of the Microsoft Teams channel. + final String channelId; + + /// The ARN of the MicrosoftTeamsChannelConfiguration. + final String chatConfigurationArn; + + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS Chatbot. + final String iamRoleArn; + + /// The ARNs of the SNS topics that deliver notifications to AWS Chatbot. + final List snsTopicArns; + + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams in + /// the AWS Chatbot console. Then you can copy and paste the team ID from the + /// console. For more details, see steps 1-4 in Get started with Microsoft Teams + /// in the AWS Chatbot Administrator Guide. + final String teamId; + + /// The ID of the Microsoft Teams tenant. + final String tenantId; + + /// The name of the Microsoft Teams channel. + final String? channelName; + + /// The name of the configuration. + final String? configurationName; + + /// The list of IAM policy ARNs that are applied as channel guardrails. The AWS + /// managed 'AdministratorAccess' policy is applied by default if this is not + /// set. + final List? guardrailPolicyArns; + + /// Logging levels include ERROR, INFO, or NONE. + final String? loggingLevel; + + /// A list of tags applied to the configuration. + final List? tags; + + /// The name of the Microsoft Teams Team. + final String? teamName; + + /// Enables use of a user role requirement in your chat configuration. + final bool? userAuthorizationRequired; + + TeamsChannelConfiguration({ + required this.channelId, + required this.chatConfigurationArn, + required this.iamRoleArn, + required this.snsTopicArns, + required this.teamId, + required this.tenantId, + this.channelName, + this.configurationName, + this.guardrailPolicyArns, + this.loggingLevel, + this.tags, + this.teamName, + this.userAuthorizationRequired, + }); + + factory TeamsChannelConfiguration.fromJson(Map json) { + return TeamsChannelConfiguration( + channelId: json['ChannelId'] as String, + chatConfigurationArn: json['ChatConfigurationArn'] as String, + iamRoleArn: json['IamRoleArn'] as String, + snsTopicArns: (json['SnsTopicArns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + teamId: json['TeamId'] as String, + tenantId: json['TenantId'] as String, + channelName: json['ChannelName'] as String?, + configurationName: json['ConfigurationName'] as String?, + guardrailPolicyArns: (json['GuardrailPolicyArns'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + loggingLevel: json['LoggingLevel'] as String?, + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + teamName: json['TeamName'] as String?, + userAuthorizationRequired: json['UserAuthorizationRequired'] as bool?, + ); + } + + Map toJson() { + final channelId = this.channelId; + final chatConfigurationArn = this.chatConfigurationArn; + final iamRoleArn = this.iamRoleArn; + final snsTopicArns = this.snsTopicArns; + final teamId = this.teamId; + final tenantId = this.tenantId; + final channelName = this.channelName; + final configurationName = this.configurationName; + final guardrailPolicyArns = this.guardrailPolicyArns; + final loggingLevel = this.loggingLevel; + final tags = this.tags; + final teamName = this.teamName; + final userAuthorizationRequired = this.userAuthorizationRequired; + return { + 'ChannelId': channelId, + 'ChatConfigurationArn': chatConfigurationArn, + 'IamRoleArn': iamRoleArn, + 'SnsTopicArns': snsTopicArns, + 'TeamId': teamId, + 'TenantId': tenantId, + if (channelName != null) 'ChannelName': channelName, + if (configurationName != null) 'ConfigurationName': configurationName, + if (guardrailPolicyArns != null) + 'GuardrailPolicyArns': guardrailPolicyArns, + if (loggingLevel != null) 'LoggingLevel': loggingLevel, + if (tags != null) 'Tags': tags, + if (teamName != null) 'TeamName': teamName, + if (userAuthorizationRequired != null) + 'UserAuthorizationRequired': userAuthorizationRequired, + }; + } +} + +/// Identifes a user level permission for a channel configuration. +class TeamsUserIdentity { + /// The ARN of the MicrosoftTeamsChannelConfiguration associated with the user + /// identity. + final String chatConfigurationArn; + + /// The ARN of the IAM role that defines the permissions for AWS Chatbot. This + /// is a user-defined role that AWS Chatbot will assume. This is not the + /// service-linked role. For more information, see IAM Policies for AWS Chatbot. + final String iamRoleArn; + + /// The ID of the Microsoft Team authorized with AWS Chatbot. To get the team + /// ID, you must perform the initial authorization flow with Microsoft Teams in + /// the AWS Chatbot console. Then you can copy and paste the team ID from the + /// console. For more details, see steps 1-4 in Get started with Microsoft Teams + /// in the AWS Chatbot Administrator Guide. + final String teamId; + + /// The AWS user identity ARN used to associate a Microsoft Teams User Identity + /// with an IAM Role. + final String? awsUserIdentity; + + /// The ID of the Microsoft Teams channel. + final String? teamsChannelId; + + /// The ID of the Microsoft Teams tenant. + final String? teamsTenantId; + + /// Id from Microsoft Teams for user. + final String? userId; + + TeamsUserIdentity({ + required this.chatConfigurationArn, + required this.iamRoleArn, + required this.teamId, + this.awsUserIdentity, + this.teamsChannelId, + this.teamsTenantId, + this.userId, + }); + + factory TeamsUserIdentity.fromJson(Map json) { + return TeamsUserIdentity( + chatConfigurationArn: json['ChatConfigurationArn'] as String, + iamRoleArn: json['IamRoleArn'] as String, + teamId: json['TeamId'] as String, + awsUserIdentity: json['AwsUserIdentity'] as String?, + teamsChannelId: json['TeamsChannelId'] as String?, + teamsTenantId: json['TeamsTenantId'] as String?, + userId: json['UserId'] as String?, + ); + } + + Map toJson() { + final chatConfigurationArn = this.chatConfigurationArn; + final iamRoleArn = this.iamRoleArn; + final teamId = this.teamId; + final awsUserIdentity = this.awsUserIdentity; + final teamsChannelId = this.teamsChannelId; + final teamsTenantId = this.teamsTenantId; + final userId = this.userId; + return { + 'ChatConfigurationArn': chatConfigurationArn, + 'IamRoleArn': iamRoleArn, + 'TeamId': teamId, + if (awsUserIdentity != null) 'AwsUserIdentity': awsUserIdentity, + if (teamsChannelId != null) 'TeamsChannelId': teamsChannelId, + if (teamsTenantId != null) 'TeamsTenantId': teamsTenantId, + if (userId != null) 'UserId': userId, + }; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateAccountPreferencesResult { + /// Preferences which apply for AWS Chatbot usage in the calling AWS account. + final AccountPreferences? accountPreferences; + + UpdateAccountPreferencesResult({ + this.accountPreferences, + }); + + factory UpdateAccountPreferencesResult.fromJson(Map json) { + return UpdateAccountPreferencesResult( + accountPreferences: json['AccountPreferences'] != null + ? AccountPreferences.fromJson( + json['AccountPreferences'] as Map) + : null, + ); + } + + Map toJson() { + final accountPreferences = this.accountPreferences; + return { + if (accountPreferences != null) 'AccountPreferences': accountPreferences, + }; + } +} + +class UpdateChimeWebhookConfigurationResult { + /// Chime webhook configuration. + final ChimeWebhookConfiguration? webhookConfiguration; + + UpdateChimeWebhookConfigurationResult({ + this.webhookConfiguration, + }); + + factory UpdateChimeWebhookConfigurationResult.fromJson( + Map json) { + return UpdateChimeWebhookConfigurationResult( + webhookConfiguration: json['WebhookConfiguration'] != null + ? ChimeWebhookConfiguration.fromJson( + json['WebhookConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final webhookConfiguration = this.webhookConfiguration; + return { + if (webhookConfiguration != null) + 'WebhookConfiguration': webhookConfiguration, + }; + } +} + +class UpdateSlackChannelConfigurationResult { + /// The configuration for a Slack channel configured with AWS Chatbot. + final SlackChannelConfiguration? channelConfiguration; + + UpdateSlackChannelConfigurationResult({ + this.channelConfiguration, + }); + + factory UpdateSlackChannelConfigurationResult.fromJson( + Map json) { + return UpdateSlackChannelConfigurationResult( + channelConfiguration: json['ChannelConfiguration'] != null + ? SlackChannelConfiguration.fromJson( + json['ChannelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final channelConfiguration = this.channelConfiguration; + return { + if (channelConfiguration != null) + 'ChannelConfiguration': channelConfiguration, + }; + } +} + +class UpdateTeamsChannelConfigurationResult { + /// The configuration for a Microsoft Teams channel configured with AWS Chatbot. + final TeamsChannelConfiguration? channelConfiguration; + + UpdateTeamsChannelConfigurationResult({ + this.channelConfiguration, + }); + + factory UpdateTeamsChannelConfigurationResult.fromJson( + Map json) { + return UpdateTeamsChannelConfigurationResult( + channelConfiguration: json['ChannelConfiguration'] != null + ? TeamsChannelConfiguration.fromJson( + json['ChannelConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final channelConfiguration = this.channelConfiguration; + return { + if (channelConfiguration != null) + 'ChannelConfiguration': channelConfiguration, + }; + } +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class CreateChimeWebhookConfigurationException extends _s.GenericAwsException { + CreateChimeWebhookConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'CreateChimeWebhookConfigurationException', + message: message); +} + +class CreateSlackChannelConfigurationException extends _s.GenericAwsException { + CreateSlackChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'CreateSlackChannelConfigurationException', + message: message); +} + +class CreateTeamsChannelConfigurationException extends _s.GenericAwsException { + CreateTeamsChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'CreateTeamsChannelConfigurationException', + message: message); +} + +class DeleteChimeWebhookConfigurationException extends _s.GenericAwsException { + DeleteChimeWebhookConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'DeleteChimeWebhookConfigurationException', + message: message); +} + +class DeleteMicrosoftTeamsUserIdentityException extends _s.GenericAwsException { + DeleteMicrosoftTeamsUserIdentityException({String? type, String? message}) + : super( + type: type, + code: 'DeleteMicrosoftTeamsUserIdentityException', + message: message); +} + +class DeleteSlackChannelConfigurationException extends _s.GenericAwsException { + DeleteSlackChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'DeleteSlackChannelConfigurationException', + message: message); +} + +class DeleteSlackUserIdentityException extends _s.GenericAwsException { + DeleteSlackUserIdentityException({String? type, String? message}) + : super( + type: type, + code: 'DeleteSlackUserIdentityException', + message: message); +} + +class DeleteSlackWorkspaceAuthorizationFault extends _s.GenericAwsException { + DeleteSlackWorkspaceAuthorizationFault({String? type, String? message}) + : super( + type: type, + code: 'DeleteSlackWorkspaceAuthorizationFault', + message: message); +} + +class DeleteTeamsChannelConfigurationException extends _s.GenericAwsException { + DeleteTeamsChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'DeleteTeamsChannelConfigurationException', + message: message); +} + +class DeleteTeamsConfiguredTeamException extends _s.GenericAwsException { + DeleteTeamsConfiguredTeamException({String? type, String? message}) + : super( + type: type, + code: 'DeleteTeamsConfiguredTeamException', + message: message); +} + +class DescribeChimeWebhookConfigurationsException + extends _s.GenericAwsException { + DescribeChimeWebhookConfigurationsException({String? type, String? message}) + : super( + type: type, + code: 'DescribeChimeWebhookConfigurationsException', + message: message); +} + +class DescribeSlackChannelConfigurationsException + extends _s.GenericAwsException { + DescribeSlackChannelConfigurationsException({String? type, String? message}) + : super( + type: type, + code: 'DescribeSlackChannelConfigurationsException', + message: message); +} + +class DescribeSlackUserIdentitiesException extends _s.GenericAwsException { + DescribeSlackUserIdentitiesException({String? type, String? message}) + : super( + type: type, + code: 'DescribeSlackUserIdentitiesException', + message: message); +} + +class DescribeSlackWorkspacesException extends _s.GenericAwsException { + DescribeSlackWorkspacesException({String? type, String? message}) + : super( + type: type, + code: 'DescribeSlackWorkspacesException', + message: message); +} + +class GetAccountPreferencesException extends _s.GenericAwsException { + GetAccountPreferencesException({String? type, String? message}) + : super( + type: type, + code: 'GetAccountPreferencesException', + message: message); +} + +class GetTeamsChannelConfigurationException extends _s.GenericAwsException { + GetTeamsChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'GetTeamsChannelConfigurationException', + message: message); +} + +class InternalServiceError extends _s.GenericAwsException { + InternalServiceError({String? type, String? message}) + : super(type: type, code: 'InternalServiceError', message: message); +} + +class InvalidParameterException extends _s.GenericAwsException { + InvalidParameterException({String? type, String? message}) + : super(type: type, code: 'InvalidParameterException', message: message); +} + +class InvalidRequestException extends _s.GenericAwsException { + InvalidRequestException({String? type, String? message}) + : super(type: type, code: 'InvalidRequestException', message: message); +} + +class LimitExceededException extends _s.GenericAwsException { + LimitExceededException({String? type, String? message}) + : super(type: type, code: 'LimitExceededException', message: message); +} + +class ListMicrosoftTeamsConfiguredTeamsException + extends _s.GenericAwsException { + ListMicrosoftTeamsConfiguredTeamsException({String? type, String? message}) + : super( + type: type, + code: 'ListMicrosoftTeamsConfiguredTeamsException', + message: message); +} + +class ListMicrosoftTeamsUserIdentitiesException extends _s.GenericAwsException { + ListMicrosoftTeamsUserIdentitiesException({String? type, String? message}) + : super( + type: type, + code: 'ListMicrosoftTeamsUserIdentitiesException', + message: message); +} + +class ListTeamsChannelConfigurationsException extends _s.GenericAwsException { + ListTeamsChannelConfigurationsException({String? type, String? message}) + : super( + type: type, + code: 'ListTeamsChannelConfigurationsException', + message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceUnavailableException extends _s.GenericAwsException { + ServiceUnavailableException({String? type, String? message}) + : super( + type: type, code: 'ServiceUnavailableException', message: message); +} + +class TooManyTagsException extends _s.GenericAwsException { + TooManyTagsException({String? type, String? message}) + : super(type: type, code: 'TooManyTagsException', message: message); +} + +class UpdateAccountPreferencesException extends _s.GenericAwsException { + UpdateAccountPreferencesException({String? type, String? message}) + : super( + type: type, + code: 'UpdateAccountPreferencesException', + message: message); +} + +class UpdateChimeWebhookConfigurationException extends _s.GenericAwsException { + UpdateChimeWebhookConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'UpdateChimeWebhookConfigurationException', + message: message); +} + +class UpdateSlackChannelConfigurationException extends _s.GenericAwsException { + UpdateSlackChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'UpdateSlackChannelConfigurationException', + message: message); +} + +class UpdateTeamsChannelConfigurationException extends _s.GenericAwsException { + UpdateTeamsChannelConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'UpdateTeamsChannelConfigurationException', + message: message); +} + +final _exceptionFns = { + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'CreateChimeWebhookConfigurationException': (type, message) => + CreateChimeWebhookConfigurationException(type: type, message: message), + 'CreateSlackChannelConfigurationException': (type, message) => + CreateSlackChannelConfigurationException(type: type, message: message), + 'CreateTeamsChannelConfigurationException': (type, message) => + CreateTeamsChannelConfigurationException(type: type, message: message), + 'DeleteChimeWebhookConfigurationException': (type, message) => + DeleteChimeWebhookConfigurationException(type: type, message: message), + 'DeleteMicrosoftTeamsUserIdentityException': (type, message) => + DeleteMicrosoftTeamsUserIdentityException(type: type, message: message), + 'DeleteSlackChannelConfigurationException': (type, message) => + DeleteSlackChannelConfigurationException(type: type, message: message), + 'DeleteSlackUserIdentityException': (type, message) => + DeleteSlackUserIdentityException(type: type, message: message), + 'DeleteSlackWorkspaceAuthorizationFault': (type, message) => + DeleteSlackWorkspaceAuthorizationFault(type: type, message: message), + 'DeleteTeamsChannelConfigurationException': (type, message) => + DeleteTeamsChannelConfigurationException(type: type, message: message), + 'DeleteTeamsConfiguredTeamException': (type, message) => + DeleteTeamsConfiguredTeamException(type: type, message: message), + 'DescribeChimeWebhookConfigurationsException': (type, message) => + DescribeChimeWebhookConfigurationsException(type: type, message: message), + 'DescribeSlackChannelConfigurationsException': (type, message) => + DescribeSlackChannelConfigurationsException(type: type, message: message), + 'DescribeSlackUserIdentitiesException': (type, message) => + DescribeSlackUserIdentitiesException(type: type, message: message), + 'DescribeSlackWorkspacesException': (type, message) => + DescribeSlackWorkspacesException(type: type, message: message), + 'GetAccountPreferencesException': (type, message) => + GetAccountPreferencesException(type: type, message: message), + 'GetTeamsChannelConfigurationException': (type, message) => + GetTeamsChannelConfigurationException(type: type, message: message), + 'InternalServiceError': (type, message) => + InternalServiceError(type: type, message: message), + 'InvalidParameterException': (type, message) => + InvalidParameterException(type: type, message: message), + 'InvalidRequestException': (type, message) => + InvalidRequestException(type: type, message: message), + 'LimitExceededException': (type, message) => + LimitExceededException(type: type, message: message), + 'ListMicrosoftTeamsConfiguredTeamsException': (type, message) => + ListMicrosoftTeamsConfiguredTeamsException(type: type, message: message), + 'ListMicrosoftTeamsUserIdentitiesException': (type, message) => + ListMicrosoftTeamsUserIdentitiesException(type: type, message: message), + 'ListTeamsChannelConfigurationsException': (type, message) => + ListTeamsChannelConfigurationsException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceUnavailableException': (type, message) => + ServiceUnavailableException(type: type, message: message), + 'TooManyTagsException': (type, message) => + TooManyTagsException(type: type, message: message), + 'UpdateAccountPreferencesException': (type, message) => + UpdateAccountPreferencesException(type: type, message: message), + 'UpdateChimeWebhookConfigurationException': (type, message) => + UpdateChimeWebhookConfigurationException(type: type, message: message), + 'UpdateSlackChannelConfigurationException': (type, message) => + UpdateSlackChannelConfigurationException(type: type, message: message), + 'UpdateTeamsChannelConfigurationException': (type, message) => + UpdateTeamsChannelConfigurationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/chime/v2018_05_01.dart b/aws_client/lib/src/generated/chime/v2018_05_01.dart index 96ab96bf5..38856d7ed 100644 --- a/aws_client/lib/src/generated/chime/v2018_05_01.dart +++ b/aws_client/lib/src/generated/chime/v2018_05_01.dart @@ -19,6 +19,18 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; +/// +/// Most of these APIs are no longer supported and will not be updated. +/// We recommend using the latest versions in the
    Amazon +/// Chime SDK API reference, in the Amazon Chime SDK. +/// +/// Using the latest versions requires migrating to dedicated namespaces. For +/// more information, refer to Migrating +/// from the Amazon Chime namespace in the Amazon Chime SDK Developer +/// Guide. +/// /// The Amazon Chime application programming interface (API) is designed so /// administrators can perform key tasks, such as creating and managing Amazon /// Chime accounts, users, and Voice Connectors. This guide provides detailed @@ -124,6 +136,18 @@ class Chime { } /// Associates phone numbers with the specified Amazon Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, AssociatePhoneNumbersWithVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -145,6 +169,8 @@ class Chime { /// Chime Voice Connector and removes any previously existing associations. If /// false, does not associate any phone numbers that have previously existing /// associations. + @Deprecated( + 'Replaced by AssociatePhoneNumbersWithVoiceConnector in the Amazon Chime SDK Voice Namespace') Future associatePhoneNumbersWithVoiceConnector({ required List e164PhoneNumbers, @@ -167,6 +193,18 @@ class Chime { /// Associates phone numbers with the specified Amazon Chime Voice Connector /// group. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, AssociatePhoneNumbersWithVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -188,6 +226,8 @@ class Chime { /// Chime Voice Connector Group and removes any previously existing /// associations. If false, does not associate any phone numbers that have /// previously existing associations. + @Deprecated( + 'Replaced by AssociatePhoneNumbersWithVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future associatePhoneNumbersWithVoiceConnectorGroup({ required List e164PhoneNumbers, @@ -242,6 +282,18 @@ class Chime { } /// Creates up to 100 new attendees for an active Amazon Chime SDK meeting. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, BatchCreateAttendee, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// For more information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. @@ -260,6 +312,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Replaced by BatchCreateAttendee in the Amazon Chime SDK Meetings Namespace') Future batchCreateAttendee({ required List attendees, required String meetingId, @@ -278,6 +332,18 @@ class Chime { } /// Adds a specified number of users to a channel. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, BatchCreateChannelMembership, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [ServiceFailureException]. /// May throw [ServiceUnavailableException]. @@ -302,6 +368,8 @@ class Chime { /// the type filter in ListChannelMemberships equals /// HIDDEN. Otherwise hidden members are not returned. This is /// only supported by moderators. + @Deprecated( + 'Replaced by BatchCreateChannelMembership in the Amazon Chime SDK Messaging Namespace') Future batchCreateChannelMembership({ required String channelArn, required List memberArns, @@ -596,6 +664,18 @@ class Chime { /// AWS account. Only SDK messaging customers use this API. /// CreateAppInstance supports idempotency behavior as described /// in the AWS API Standard. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateAppInstance, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -618,6 +698,8 @@ class Chime { /// /// Parameter [tags] : /// Tags assigned to the AppInstance. + @Deprecated( + 'Replaced by CreateAppInstance in the Amazon Chime SDK Identity Namespace') Future createAppInstance({ required String name, String? clientRequestToken, @@ -642,7 +724,18 @@ class Chime { /// Promotes an AppInstanceUser to an /// AppInstanceAdmin. The promoted user can perform the following /// actions. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateAppInstanceAdmin, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// ///
      ///
    • /// ChannelModerator actions across all channels in the @@ -669,6 +762,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by CreateAppInstanceAdmin in the Amazon Chime SDK Identity Namespace') Future createAppInstanceAdmin({ required String appInstanceAdminArn, required String appInstanceArn, @@ -689,6 +784,18 @@ class Chime { /// Creates a user under an Amazon Chime AppInstance. The request /// consists of a unique appInstanceUserId and Name /// for that user. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -716,6 +823,8 @@ class Chime { /// /// Parameter [tags] : /// Tags assigned to the AppInstanceUser. + @Deprecated( + 'Replaced by CreateAppInstanceUser in the Amazon Chime SDK Identity Namespace') Future createAppInstanceUser({ required String appInstanceArn, required String appInstanceUserId, @@ -745,6 +854,18 @@ class Chime { /// information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateAttendee, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -764,6 +885,8 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated( + 'Replaced by CreateAttendee in the Amazon Chime SDK Meetings Namespace') Future createAttendee({ required String externalUserId, required String meetingId, @@ -826,7 +949,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateChannel, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -865,6 +999,8 @@ class Chime { /// /// Parameter [tags] : /// The tags for the creation request. + @Deprecated( + 'Replaced by CreateChannel in the Amazon Chime SDK Messaging Namespace') Future createChannel({ required String appInstanceArn, required String name, @@ -909,7 +1045,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateChannelBan, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -928,6 +1075,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by CreateChannelBan in the Amazon Chime SDK Messaging Namespace') Future createChannelBan({ required String channelArn, required String memberArn, @@ -983,7 +1132,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateChannelMembership, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1010,6 +1170,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by CreateChannelMembership in the Amazon Chime SDK Messaging Namespace') Future createChannelMembership({ required String channelArn, required String memberArn, @@ -1055,7 +1217,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateChannelModerator, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1074,6 +1247,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by CreateChannelModerator in the Amazon Chime SDK Messaging Namespace') Future createChannelModerator({ required String channelArn, required String channelModeratorArn, @@ -1096,6 +1271,18 @@ class Chime { } /// Creates a media capture pipeline. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateMediaCapturePipeline, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [ResourceLimitExceededException]. /// May throw [ForbiddenException]. @@ -1127,6 +1314,8 @@ class Chime { /// The unique identifier for the client request. The token makes the API /// request idempotent. Use a different token for different media pipeline /// requests. + @Deprecated( + 'Replaced by CreateMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace') Future createMediaCapturePipeline({ required String sinkArn, required MediaPipelineSinkType sinkType, @@ -1160,7 +1349,19 @@ class Chime { /// Chime SDK Media Regions in the Amazon Chime SDK Developer Guide /// . For more information about the Amazon Chime SDK, see Using - /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide . + /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateMeeting, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1199,6 +1400,8 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated( + 'Replaced by CreateMeeting in the Amazon Chime SDK Meetings Namespace') Future createMeeting({ String? clientRequestToken, String? externalMeetingId, @@ -1233,6 +1436,9 @@ class Chime { /// To play welcome audio or implement an interactive voice response (IVR), /// use the CreateSipMediaApplicationCall action with the /// corresponding SIP media application ID. + /// + /// This API is is not available in a dedicated namespace. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1283,6 +1489,18 @@ class Chime { /// . For more information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide . + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateMeetingWithAttendees, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1325,6 +1543,8 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated( + 'Replaced by CreateMeetingWithAttendees in the Amazon Chime SDK Meetings Namespace') Future createMeetingWithAttendees({ List? attendees, String? clientRequestToken, @@ -1391,6 +1611,18 @@ class Chime { /// Creates a proxy session on the specified Amazon Chime Voice Connector for /// the specified participant phone numbers. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateProxySession, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -1425,6 +1657,8 @@ class Chime { /// Parameter [numberSelectionBehavior] : /// The preference for proxy phone number reuse, or stickiness, between the /// same participants across sessions. + @Deprecated( + 'Replaced by CreateProxySession in the Amazon Chime SDK Voice Namespace') Future createProxySession({ required List capabilities, required List participantPhoneNumbers, @@ -1544,6 +1778,18 @@ class Chime { } /// Creates a SIP media application. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateSipMediaApplication, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1564,6 +1810,8 @@ class Chime { /// /// Parameter [name] : /// The SIP media application name. + @Deprecated( + 'Replaced by CreateSipMediaApplication in the Amazon Chime SDK Voice Namespace') Future createSipMediaApplication({ required String awsRegion, required List endpoints, @@ -1586,6 +1834,18 @@ class Chime { /// Creates an outbound call to a phone number from the phone number specified /// in the request, and it invokes the endpoint of the specified /// sipMediaApplicationId. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateSipMediaApplicationCall, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1608,6 +1868,8 @@ class Chime { /// /// Parameter [sipHeaders] : /// The SIP headers added to an outbound call leg. + @Deprecated( + 'Replaced by CreateSipMediaApplicationCall in the Amazon Chime SDK Voice Namespace') Future createSipMediaApplicationCall({ required String fromPhoneNumber, required String sipMediaApplicationId, @@ -1631,6 +1893,18 @@ class Chime { /// Creates a SIP rule which can be used to run a SIP media application as a /// target for a specific trigger type. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateSipRule, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1666,6 +1940,8 @@ class Chime { /// Parameter [disabled] : /// Enables or disables a rule. You must disable rules before you can delete /// them. + @Deprecated( + 'Replaced by CreateSipRule in the Amazon Chime SDK Voice Namespace') Future createSipRule({ required String name, required List targetApplications, @@ -1740,6 +2016,18 @@ class Chime { /// your Amazon Chime Voice Connector to use TLS transport for SIP signaling /// and Secure RTP (SRTP) for media. Inbound calls use TLS transport, and /// unencrypted outbound calls are blocked. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1759,6 +2047,8 @@ class Chime { /// Parameter [awsRegion] : /// The AWS Region in which the Amazon Chime Voice Connector is created. /// Default value: us-east-1 . + @Deprecated( + 'Replaced by CreateVoiceConnector in the Amazon Chime SDK Voice Namespace') Future createVoiceConnector({ required String name, required bool requireEncryption, @@ -1786,6 +2076,18 @@ class Chime { /// You can include Amazon Chime Voice Connectors from different AWS Regions /// in your group. This creates a fault tolerant mechanism for fallback in /// case of availability events. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, CreateVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1801,6 +2103,8 @@ class Chime { /// /// Parameter [voiceConnectorItems] : /// The Amazon Chime Voice Connectors to route inbound calls to. + @Deprecated( + 'Replaced by CreateVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future createVoiceConnectorGroup({ required String name, List? voiceConnectorItems, @@ -1859,6 +2163,18 @@ class Chime { /// Deletes an AppInstance and all associated data /// asynchronously. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteAppInstance, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1869,6 +2185,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by DeleteAppInstance in the Amazon Chime SDK Identity Namespace') Future deleteAppInstance({ required String appInstanceArn, }) async { @@ -1882,6 +2200,18 @@ class Chime { /// Demotes an AppInstanceAdmin to an /// AppInstanceUser. This action does not delete the user. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteAppInstanceAdmin, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -1896,6 +2226,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by DeleteAppInstanceAdmin in the Amazon Chime SDK Identity Namespace') Future deleteAppInstanceAdmin({ required String appInstanceAdminArn, required String appInstanceArn, @@ -1910,6 +2242,18 @@ class Chime { } /// Deletes the streaming configurations of an AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteAppInstanceStreamingConfigurations, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1921,6 +2265,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the streaming configurations being deleted. + @Deprecated( + 'Replaced by DeleteAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace') Future deleteAppInstanceStreamingConfigurations({ required String appInstanceArn, }) async { @@ -1934,6 +2280,18 @@ class Chime { } /// Deletes an AppInstanceUser. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1944,6 +2302,8 @@ class Chime { /// /// Parameter [appInstanceUserArn] : /// The ARN of the user request being deleted. + @Deprecated( + 'Replaced by DeleteAppInstanceUser in the Amazon Chime SDK Identity Namespace') Future deleteAppInstanceUser({ required String appInstanceUserArn, }) async { @@ -1962,6 +2322,18 @@ class Chime { /// Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteAttendee, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -1976,6 +2348,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Replaced by DeleteAttendee in the Amazon Chime SDK Meetings Namespace') Future deleteAttendee({ required String attendeeId, required String meetingId, @@ -1995,7 +2369,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteChannel, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2009,6 +2394,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DeleteChannel in the Amazon Chime SDK Messaging Namespace') Future deleteChannel({ required String channelArn, String? chimeBearer, @@ -2030,7 +2417,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteChannelBan, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2048,6 +2446,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DeleteChannelBan in the Amazon Chime SDK Messaging Namespace') Future deleteChannelBan({ required String channelArn, required String memberArn, @@ -2071,7 +2471,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteChannelMembership, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2089,6 +2500,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DeleteChannelMembership in the Amazon Chime SDK Messaging Namespace') Future deleteChannelMembership({ required String channelArn, required String memberArn, @@ -2114,7 +2527,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteChannelMessage, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2131,6 +2555,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DeleteChannelMessage in the Amazon Chime SDK Messaging Namespace') Future deleteChannelMessage({ required String channelArn, required String messageId, @@ -2154,7 +2580,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteChannelModerator, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2171,6 +2608,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DeleteChannelModerator in the Amazon Chime SDK Messaging Namespace') Future deleteChannelModerator({ required String channelArn, required String channelModeratorArn, @@ -2218,6 +2657,18 @@ class Chime { } /// Deletes the media capture pipeline. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteMediaCapturePipeline, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [ForbiddenException]. /// May throw [NotFoundException]. @@ -2229,6 +2680,8 @@ class Chime { /// /// Parameter [mediaPipelineId] : /// The ID of the media capture pipeline being deleted. + @Deprecated( + 'Replaced by DeleteMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace') Future deleteMediaCapturePipeline({ required String mediaPipelineId, }) async { @@ -2246,6 +2699,18 @@ class Chime { /// the meeting. For more information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteMeeting, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2257,6 +2722,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Replaced by DeleteMeeting in the Amazon Chime SDK Meetings Namespace') Future deleteMeeting({ required String meetingId, }) async { @@ -2298,6 +2765,18 @@ class Chime { /// Deletes the specified proxy session from the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteProxySession, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2312,6 +2791,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime voice connector ID. + @Deprecated( + 'Replaced by DeleteProxySession in the Amazon Chime SDK Voice Namespace') Future deleteProxySession({ required String proxySessionId, required String voiceConnectorId, @@ -2386,6 +2867,18 @@ class Chime { } /// Deletes a SIP media application. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteSipMediaApplication, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2398,6 +2891,8 @@ class Chime { /// /// Parameter [sipMediaApplicationId] : /// The SIP media application ID. + @Deprecated( + 'Replaced by DeleteSipMediaApplication in the Amazon Chime SDK Voice Namespace') Future deleteSipMediaApplication({ required String sipMediaApplicationId, }) async { @@ -2411,6 +2906,18 @@ class Chime { } /// Deletes a SIP rule. You must disable a SIP rule before you can delete it. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteSipRule, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2423,6 +2930,8 @@ class Chime { /// /// Parameter [sipRuleId] : /// The SIP rule ID. + @Deprecated( + 'Replaced by DeleteSipRule in the Amazon Chime SDK Voice Namespace') Future deleteSipRule({ required String sipRuleId, }) async { @@ -2437,6 +2946,18 @@ class Chime { /// Deletes the specified Amazon Chime Voice Connector. Any phone numbers /// associated with the Amazon Chime Voice Connector must be disassociated /// from it before it can be deleted. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2449,6 +2970,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnector in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnector({ required String voiceConnectorId, }) async { @@ -2462,6 +2985,18 @@ class Chime { /// Deletes the emergency calling configuration details from the specified /// Amazon Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorEmergencyCallingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2473,6 +3008,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorEmergencyCallingConfiguration({ required String voiceConnectorId, }) async { @@ -2488,6 +3025,18 @@ class Chime { /// Deletes the specified Amazon Chime Voice Connector group. Any /// VoiceConnectorItems and phone numbers associated with the /// group must be removed before it can be deleted. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2500,6 +3049,8 @@ class Chime { /// /// Parameter [voiceConnectorGroupId] : /// The Amazon Chime Voice Connector group ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorGroup({ required String voiceConnectorGroupId, }) async { @@ -2517,7 +3068,18 @@ class Chime { /// /// If emergency calling is configured for the Amazon Chime Voice Connector, /// it must be deleted prior to deleting the origination settings. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorOrigination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2529,6 +3091,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorOrigination({ required String voiceConnectorId, }) async { @@ -2543,6 +3107,18 @@ class Chime { /// Deletes the proxy configuration from the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceProxy, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2554,6 +3130,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorProxy({ required String voiceConnectorId, }) async { @@ -2568,6 +3146,18 @@ class Chime { /// Deletes the streaming configuration for the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorStreamingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2579,6 +3169,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorStreamingConfiguration({ required String voiceConnectorId, }) async { @@ -2596,7 +3188,18 @@ class Chime { /// /// If emergency calling is configured for the Amazon Chime Voice Connector, /// it must be deleted prior to deleting the termination settings. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorTermination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2608,6 +3211,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorTermination({ required String voiceConnectorId, }) async { @@ -2622,6 +3227,18 @@ class Chime { /// Deletes the specified SIP credentials used by your equipment to /// authenticate during call termination. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DeleteVoiceConnectorTerminationCredentials, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2637,6 +3254,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DeleteVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace') Future deleteVoiceConnectorTerminationCredentials({ required List usernames, required String voiceConnectorId, @@ -2654,6 +3273,18 @@ class Chime { } /// Returns the full details of an AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeAppInstance, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2664,6 +3295,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by DescribeAppInstance in the Amazon Chime SDK Identity Namespace') Future describeAppInstance({ required String appInstanceArn, }) async { @@ -2677,6 +3310,18 @@ class Chime { } /// Returns the full details of an AppInstanceAdmin. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeAppInstanceAdmin, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2690,6 +3335,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by DescribeAppInstanceAdmin in the Amazon Chime SDK Identity Namespace') Future describeAppInstanceAdmin({ required String appInstanceAdminArn, required String appInstanceArn, @@ -2705,6 +3352,18 @@ class Chime { } /// Returns the full details of an AppInstanceUser. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2715,6 +3374,8 @@ class Chime { /// /// Parameter [appInstanceUserArn] : /// The ARN of the AppInstanceUser. + @Deprecated( + 'Replaced by DescribeAppInstanceUser in the Amazon Chime SDK Identity Namespace') Future describeAppInstanceUser({ required String appInstanceUserArn, }) async { @@ -2734,7 +3395,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannel, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2748,6 +3420,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannel in the Amazon Chime SDK Messaging Namespace') Future describeChannel({ required String channelArn, String? chimeBearer, @@ -2770,7 +3444,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannelBan, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2788,6 +3473,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannelBan in the Amazon Chime SDK Messaging Namespace') Future describeChannelBan({ required String channelArn, required String memberArn, @@ -2812,7 +3499,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannelMembership, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2830,6 +3528,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannelMembership in the Amazon Chime SDK Messaging Namespace') Future describeChannelMembership({ required String channelArn, required String memberArn, @@ -2855,7 +3555,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannelMembershipForAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2872,6 +3583,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannelMembershipForAppInstanceUser in the Amazon Chime SDK Messaging Namespace') Future describeChannelMembershipForAppInstanceUser({ required String appInstanceUserArn, @@ -2903,7 +3616,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannelModeratedByAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2920,6 +3644,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannelModeratedByAppInstanceUser in the Amazon Chime SDK Messaging Namespace') Future describeChannelModeratedByAppInstanceUser({ required String appInstanceUserArn, @@ -2949,7 +3675,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DescribeChannelModerator, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -2967,6 +3704,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by DescribeChannelModerator in the Amazon Chime SDK Messaging Namespace') Future describeChannelModerator({ required String channelArn, required String channelModeratorArn, @@ -3017,6 +3756,18 @@ class Chime { /// Disassociates the specified phone numbers from the specified Amazon Chime /// Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DisassociatePhoneNumbersFromVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3031,6 +3782,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by DisassociatePhoneNumbersFromVoiceConnector in the Amazon Chime SDK Voice Namespace') Future disassociatePhoneNumbersFromVoiceConnector({ required List e164PhoneNumbers, @@ -3052,6 +3805,18 @@ class Chime { /// Disassociates the specified phone numbers from the specified Amazon Chime /// Voice Connector group. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, DisassociatePhoneNumbersFromVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3066,6 +3831,8 @@ class Chime { /// /// Parameter [voiceConnectorGroupId] : /// The Amazon Chime Voice Connector group ID. + @Deprecated( + 'Replaced by DisassociatePhoneNumbersFromVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future disassociatePhoneNumbersFromVoiceConnectorGroup({ required List e164PhoneNumbers, @@ -3171,6 +3938,18 @@ class Chime { } /// Gets the retention settings for an AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetMessagingRetentionSettings, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3182,6 +3961,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by GetAppInstanceRetentionSettings in the Amazon Chime SDK Identity Namespace') Future getAppInstanceRetentionSettings({ required String appInstanceArn, @@ -3197,6 +3978,18 @@ class Chime { } /// Gets the streaming settings for an AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetMessagingStreamingConfigurations, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -3208,6 +4001,8 @@ class Chime { /// /// Parameter [appInstanceArn] : /// The ARN of the AppInstance. + @Deprecated( + 'Replaced by GetAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace') Future getAppInstanceStreamingConfigurations({ required String appInstanceArn, @@ -3225,7 +4020,19 @@ class Chime { /// Gets the Amazon Chime SDK attendee details for a specified meeting ID and /// attendee ID. For more information about the Amazon Chime SDK, see Using - /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide . + /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetAttendee, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -3240,6 +4047,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Replaced by GetAttendee in the Amazon Chime SDK Meetings Namespace') Future getAttendee({ required String attendeeId, required String meetingId, @@ -3289,7 +4098,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetChannelMessage, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -3307,6 +4127,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by GetChannelMessage in the Amazon Chime SDK Messaging Namespace') Future getChannelMessage({ required String channelArn, required String messageId, @@ -3376,6 +4198,18 @@ class Chime { } /// Gets an existing media capture pipeline. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetMediaCapturePipeline, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [NotFoundException]. /// May throw [ForbiddenException]. @@ -3387,6 +4221,8 @@ class Chime { /// /// Parameter [mediaPipelineId] : /// The ID of the pipeline that you want to get. + @Deprecated( + 'Replaced by GetMediaCapturePipeline in the Amazon Chime SDK Media Pipelines Namespace') Future getMediaCapturePipeline({ required String mediaPipelineId, }) async { @@ -3400,6 +4236,18 @@ class Chime { return GetMediaCapturePipelineResponse.fromJson(response); } + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetMeeting, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// Gets the Amazon Chime SDK meeting details for the specified meeting ID. /// For more information about the Amazon Chime SDK, see Using @@ -3415,6 +4263,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Replaced by GetMeeting in the Amazon Chime SDK Meetings Namespace') Future getMeeting({ required String meetingId, }) async { @@ -3428,12 +4278,26 @@ class Chime { } /// The details of the endpoint for the messaging session. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetMessagingSessionEndpoint, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [ForbiddenException]. /// May throw [ThrottledClientException]. /// May throw [ServiceUnavailableException]. /// May throw [ServiceFailureException]. + @Deprecated( + 'Replaced by GetMessagingSessionEndpoint in the Amazon Chime SDK Messaging Namespace') Future getMessagingSessionEndpoint() async { final response = await _protocol.send( @@ -3518,6 +4382,18 @@ class Chime { /// Gets the specified proxy session details for the specified Amazon Chime /// Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetProxySession, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3532,6 +4408,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime voice connector ID. + @Deprecated( + 'Replaced by GetProxySession in the Amazon Chime SDK Voice Namespace') Future getProxySession({ required String proxySessionId, required String voiceConnectorId, @@ -3607,6 +4485,18 @@ class Chime { /// Retrieves the information for a SIP media application, including name, AWS /// Region, and endpoints. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetSipMediaApplication, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3618,6 +4508,8 @@ class Chime { /// /// Parameter [sipMediaApplicationId] : /// The SIP media application ID. + @Deprecated( + 'Replaced by GetSipMediaApplication in the Amazon Chime SDK Voice Namespace') Future getSipMediaApplication({ required String sipMediaApplicationId, }) async { @@ -3632,6 +4524,18 @@ class Chime { } /// Returns the logging configuration for the specified SIP media application. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetSipMediaApplicationLoggingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3643,6 +4547,8 @@ class Chime { /// /// Parameter [sipMediaApplicationId] : /// The SIP media application ID. + @Deprecated( + 'Replaced by GetSipMediaApplicationLoggingConfiguration in the Amazon Chime SDK Voice Namespace') Future getSipMediaApplicationLoggingConfiguration({ required String sipMediaApplicationId, @@ -3660,6 +4566,18 @@ class Chime { /// Retrieves the details of a SIP rule, such as the rule ID, name, triggers, /// and target endpoints. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetSipRule, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3671,6 +4589,7 @@ class Chime { /// /// Parameter [sipRuleId] : /// The SIP rule ID. + @Deprecated('Replaced by GetSipRule in the Amazon Chime SDK Voice Namespace') Future getSipRule({ required String sipRuleId, }) async { @@ -3748,6 +4667,18 @@ class Chime { /// Retrieves details for the specified Amazon Chime Voice Connector, such as /// timestamps,name, outbound host, and encryption requirements. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3759,6 +4690,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnector in the Amazon Chime SDK Voice Namespace') Future getVoiceConnector({ required String voiceConnectorId, }) async { @@ -3773,6 +4706,18 @@ class Chime { /// Gets the emergency calling configuration details for the specified Amazon /// Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorEmergencyCallingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3784,6 +4729,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorEmergencyCallingConfiguration({ required String voiceConnectorId, @@ -3801,6 +4748,18 @@ class Chime { /// Retrieves details for the specified Amazon Chime Voice Connector group, /// such as timestamps,name, and associated VoiceConnectorItems. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3812,6 +4771,8 @@ class Chime { /// /// Parameter [voiceConnectorGroupId] : /// The Amazon Chime Voice Connector group ID. + @Deprecated( + 'Replaced by GetVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorGroup({ required String voiceConnectorGroupId, }) async { @@ -3828,6 +4789,18 @@ class Chime { /// Retrieves the logging configuration details for the specified Amazon Chime /// Voice Connector. Shows whether SIP message logs are enabled for sending to /// Amazon CloudWatch Logs. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorLoggingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3839,6 +4812,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorLoggingConfiguration in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorLoggingConfiguration({ required String voiceConnectorId, @@ -3855,6 +4830,18 @@ class Chime { /// Retrieves origination setting details for the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorOrigination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3866,6 +4853,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorOrigination({ required String voiceConnectorId, }) async { @@ -3881,6 +4870,18 @@ class Chime { /// Gets the proxy configuration details for the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorProxy, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3892,6 +4893,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime voice connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorProxy({ required String voiceConnectorId, }) async { @@ -3909,6 +4912,18 @@ class Chime { /// Chime Voice Connector. Shows whether media streaming is enabled for /// sending to Amazon Kinesis. It also shows the retention period, in hours, /// for the Amazon Kinesis data. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorStreamingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3920,6 +4935,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorStreamingConfiguration({ required String voiceConnectorId, @@ -3936,6 +4953,18 @@ class Chime { /// Retrieves termination setting details for the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorTermination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -3947,6 +4976,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorTermination({ required String voiceConnectorId, }) async { @@ -3960,6 +4991,18 @@ class Chime { return GetVoiceConnectorTerminationResponse.fromJson(response); } + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, GetVoiceConnectorTerminationHealth, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// Retrieves information about the last time a SIP OPTIONS ping /// was received from your SIP infrastructure for the specified Amazon Chime /// Voice Connector. @@ -3974,6 +5017,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by GetVoiceConnectorTerminationHealth in the Amazon Chime SDK Voice Namespace') Future getVoiceConnectorTerminationHealth({ required String voiceConnectorId, @@ -4080,6 +5125,18 @@ class Chime { } /// Returns a list of the administrators in the AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListAppInstanceAdmins, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4097,6 +5154,8 @@ class Chime { /// Parameter [nextToken] : /// The token returned from previous API requests until the number of /// administrators is reached. + @Deprecated( + 'Replaced by ListAppInstanceAdmins in the Amazon Chime SDK Identity Namespace') Future listAppInstanceAdmins({ required String appInstanceArn, int? maxResults, @@ -4125,6 +5184,18 @@ class Chime { /// List all AppInstanceUsers created under a single /// AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListAppInstanceUsers, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4142,6 +5213,8 @@ class Chime { /// Parameter [nextToken] : /// The token passed by previous API calls until all requested users are /// returned. + @Deprecated( + 'Replaced by ListAppInstanceUsers in the Amazon Chime SDK Identity Namespace') Future listAppInstanceUsers({ required String appInstanceArn, int? maxResults, @@ -4170,6 +5243,18 @@ class Chime { /// Lists all Amazon Chime AppInstances created under a single /// AWS account. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListAppInstances, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4184,6 +5269,8 @@ class Chime { /// Parameter [nextToken] : /// The token passed by previous API requests until you reach the maximum /// number of AppInstances. + @Deprecated( + 'Replaced by ListAppInstances in the Amazon Chime SDK Identity Namespace') Future listAppInstances({ int? maxResults, String? nextToken, @@ -4209,6 +5296,10 @@ class Chime { } /// Lists the tags applied to an Amazon Chime SDK attendee resource. + /// + /// ListAttendeeTags is not supported in the Amazon Chime SDK Meetings + /// Namespace. Update your application to remove calls to this API. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4223,6 +5314,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.') Future listAttendeeTags({ required String attendeeId, required String meetingId, @@ -4241,6 +5334,18 @@ class Chime { /// information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListAttendees, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4258,6 +5363,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token to use to retrieve the next page of results. + @Deprecated( + 'Replaced by ListAttendees in the Amazon Chime SDK Meetings Namespace') Future listAttendees({ required String meetingId, int? maxResults, @@ -4333,7 +5440,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelBans, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4354,6 +5472,8 @@ class Chime { /// Parameter [nextToken] : /// The token passed by previous API calls until all requested bans are /// returned. + @Deprecated( + 'Replaced by ListChannelBans in the Amazon Chime SDK Messaging Namespace') Future listChannelBans({ required String channelArn, String? chimeBearer, @@ -4389,7 +5509,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelMemberships, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4417,6 +5548,8 @@ class Chime { /// ListChannelMemberships. Hidden members are only returned if /// the type filter in ListChannelMemberships equals /// HIDDEN. Otherwise hidden members are not returned. + @Deprecated( + 'Replaced by ListChannelMemberships in the Amazon Chime SDK Messaging Namespace') Future listChannelMemberships({ required String channelArn, String? chimeBearer, @@ -4456,7 +5589,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelMembershipsForAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4477,6 +5621,8 @@ class Chime { /// Parameter [nextToken] : /// The token returned from previous API requests until the number of channel /// memberships is reached. + @Deprecated( + 'Replaced by ListChannelMembershipsForAppInstanceUser in the Amazon Chime SDK Messaging Namespace') Future listChannelMembershipsForAppInstanceUser({ String? appInstanceUserArn, @@ -4521,7 +5667,18 @@ class Chime { /// Also, the x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelMessages, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4552,6 +5709,8 @@ class Chime { /// Parameter [sortOrder] : /// The order in which you want messages sorted. Default is Descending, based /// on time created. + @Deprecated( + 'Replaced by ListChannelMessages in the Amazon Chime SDK Messaging Namespace') Future listChannelMessages({ required String channelArn, String? chimeBearer, @@ -4595,7 +5754,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelModerators, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4616,6 +5786,8 @@ class Chime { /// Parameter [nextToken] : /// The token passed by previous API calls until all requested moderators are /// returned. + @Deprecated( + 'Replaced by ListChannelModerators in the Amazon Chime SDK Messaging Namespace') Future listChannelModerators({ required String channelArn, String? chimeBearer, @@ -4663,7 +5835,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannels, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4689,6 +5872,8 @@ class Chime { /// The privacy setting. PUBLIC retrieves all the public /// channels. PRIVATE retrieves private channels. Only an /// AppInstanceAdmin can retrieve private channels. + @Deprecated( + 'Replaced by ListChannels in the Amazon Chime SDK Messaging Namespace') Future listChannels({ required String appInstanceArn, String? chimeBearer, @@ -4727,7 +5912,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListChannelsModeratedByAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4748,6 +5944,8 @@ class Chime { /// Parameter [nextToken] : /// The token returned from previous API requests until the number of channels /// moderated by the user is reached. + @Deprecated( + 'Replaced by ListChannelsModeratedByAppInstanceUser in the Amazon Chime SDK Messaging Namespace') Future listChannelsModeratedByAppInstanceUser({ String? appInstanceUserArn, @@ -4782,6 +5980,18 @@ class Chime { } /// Returns a list of media capture pipelines. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListMediaCapturePipelines, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4796,6 +6006,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token used to retrieve the next page of results. + @Deprecated( + 'Replaced by ListMediaCapturePipelines in the Amazon Chime SDK Media Pipelines Namespace') Future listMediaCapturePipelines({ int? maxResults, String? nextToken, @@ -4821,6 +6033,18 @@ class Chime { } /// Lists the tags applied to an Amazon Chime SDK meeting resource. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListTagsForResource, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -4832,6 +6056,8 @@ class Chime { /// /// Parameter [meetingId] : /// The Amazon Chime SDK meeting ID. + @Deprecated( + 'Use ListTagsForResource in the Amazon Chime SDK Meetings Namespace.') Future listMeetingTags({ required String meetingId, }) async { @@ -4844,8 +6070,12 @@ class Chime { return ListMeetingTagsResponse.fromJson(response); } - /// Lists up to 100 active Amazon Chime SDK meetings. For more information - /// about the Amazon Chime SDK, see + /// ListMeetings is not supported in the Amazon Chime SDK Meetings Namespace. + /// Update your application to remove calls to this API. + /// + /// For more information about the Amazon Chime SDK, see Using /// the Amazon Chime SDK in the Amazon Chime SDK Developer Guide. /// @@ -4861,6 +6091,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token to use to retrieve the next page of results. + @Deprecated( + 'ListMeetings is not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.') Future listMeetings({ int? maxResults, String? nextToken, @@ -4986,6 +6218,18 @@ class Chime { } /// Lists the proxy sessions for the specified Amazon Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListProxySessions, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5006,6 +6250,8 @@ class Chime { /// /// Parameter [status] : /// The proxy session status. + @Deprecated( + 'Replaced by ListProxySessions in the Amazon Chime SDK Voice Namespace') Future listProxySessions({ required String voiceConnectorId, int? maxResults, @@ -5134,6 +6380,18 @@ class Chime { } /// Lists the SIP media applications under the administrator's AWS account. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListSipMediaApplications, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [ForbiddenException]. @@ -5147,6 +6405,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token to use to retrieve the next page of results. + @Deprecated( + 'Replaced by ListSipMediaApplications in the Amazon Chime SDK Voice Namespace') Future listSipMediaApplications({ int? maxResults, String? nextToken, @@ -5172,6 +6432,18 @@ class Chime { } /// Lists the SIP rules under the administrator's AWS account. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListSipRules, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [ForbiddenException]. @@ -5188,6 +6460,8 @@ class Chime { /// /// Parameter [sipMediaApplicationId] : /// The SIP media application ID. + @Deprecated( + 'Replaced by ListSipRules in the Amazon Chime SDK Voice Namespace') Future listSipRules({ int? maxResults, String? nextToken, @@ -5244,7 +6518,28 @@ class Chime { return ListSupportedPhoneNumberCountriesResponse.fromJson(response); } - /// Lists the tags applied to an Amazon Chime SDK meeting resource. + /// Lists the tags applied to an Amazon Chime SDK meeting and messaging + /// resources. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the applicable latest version in the Amazon Chime SDK. + /// + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -5255,6 +6550,8 @@ class Chime { /// /// Parameter [resourceARN] : /// The resource ARN. + @Deprecated( + 'Replaced by ListTagsForResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces') Future listTagsForResource({ required String resourceARN, }) async { @@ -5328,6 +6625,18 @@ class Chime { /// Lists the Amazon Chime Voice Connector groups for the administrator's AWS /// account. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListVoiceConnectorGroups, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [ForbiddenException]. @@ -5341,6 +6650,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token to use to retrieve the next page of results. + @Deprecated( + 'Replaced by ListVoiceConnectorGroups in the Amazon Chime SDK Voice Namespace') Future listVoiceConnectorGroups({ int? maxResults, String? nextToken, @@ -5366,6 +6677,18 @@ class Chime { } /// Lists the SIP credentials for the specified Amazon Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListVoiceConnectorTerminationCredentials, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5377,6 +6700,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by ListVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace') Future listVoiceConnectorTerminationCredentials({ required String voiceConnectorId, @@ -5393,6 +6718,18 @@ class Chime { /// Lists the Amazon Chime Voice Connectors for the administrator's AWS /// account. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ListVoiceConnectors, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [ForbiddenException]. @@ -5406,6 +6743,8 @@ class Chime { /// /// Parameter [nextToken] : /// The token to use to retrieve the next page of results. + @Deprecated( + 'Replaced by ListVoiceConnectors in the Amazon Chime SDK Voice Namespace') Future listVoiceConnectors({ int? maxResults, String? nextToken, @@ -5461,6 +6800,18 @@ class Chime { /// Sets the amount of time in days that a given AppInstance /// retains data. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutAppInstanceRetentionSettings, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5476,6 +6827,8 @@ class Chime { /// /// Parameter [appInstanceRetentionSettings] : /// The time in days to retain data. Data type: number. + @Deprecated( + 'Replaced by PutAppInstanceRetentionSettings in the Amazon Chime SDK Identity Namespace') Future putAppInstanceRetentionSettings({ required String appInstanceArn, @@ -5495,6 +6848,18 @@ class Chime { } /// The data streaming configurations of an AppInstance. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutMessagingStreamingConfigurations, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [NotFoundException]. /// May throw [BadRequestException]. @@ -5509,6 +6874,8 @@ class Chime { /// /// Parameter [appInstanceStreamingConfigurations] : /// The streaming configurations set for an AppInstance. + @Deprecated( + 'Replaced by PutAppInstanceStreamingConfigurations in the Amazon Chime SDK Messaging Namespace') Future putAppInstanceStreamingConfigurations({ required String appInstanceArn, @@ -5619,6 +6986,18 @@ class Chime { } /// Updates the logging configuration for the specified SIP media application. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutSipMediaApplicationLoggingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5633,6 +7012,8 @@ class Chime { /// /// Parameter [sipMediaApplicationLoggingConfiguration] : /// The actual logging configuration. + @Deprecated( + 'Replaced by PutSipMediaApplicationLoggingConfiguration in the Amazon Chime SDK Voice Namespace') Future putSipMediaApplicationLoggingConfiguration({ required String sipMediaApplicationId, @@ -5659,6 +7040,18 @@ class Chime { /// Voice Connector, such as emergency phone numbers and calling countries. /// Origination and termination settings must be enabled for the Amazon Chime /// Voice Connector before emergency calling can be configured. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorEmergencyCallingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5673,6 +7066,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by PutVoiceConnectorEmergencyCallingConfiguration in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorEmergencyCallingConfiguration({ required EmergencyCallingConfiguration emergencyCallingConfiguration, @@ -5695,6 +7090,18 @@ class Chime { /// Adds a logging configuration for the specified Amazon Chime Voice /// Connector. The logging configuration specifies whether SIP message logs /// are enabled for sending to Amazon CloudWatch Logs. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorLoggingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5709,6 +7116,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by PutVoiceConnectorLoggingConfiguration in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorLoggingConfiguration({ required LoggingConfiguration loggingConfiguration, @@ -5731,7 +7140,18 @@ class Chime { /// /// If emergency calling is configured for the Amazon Chime Voice Connector, /// it must be deleted prior to turning off origination settings. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorOrigination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5746,6 +7166,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by PutVoiceConnectorOrigination in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorOrigination({ required Origination origination, required String voiceConnectorId, @@ -5765,6 +7187,18 @@ class Chime { /// Puts the specified proxy configuration to the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorProxy, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [AccessDeniedException]. @@ -5790,6 +7224,8 @@ class Chime { /// /// Parameter [fallBackPhoneNumber] : /// The phone number to route calls to after a proxy session expires. + @Deprecated( + 'Replaced by PutVoiceConnectorProxy in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorProxy({ required int defaultSessionExpiryMinutes, required List phoneNumberPoolCountries, @@ -5818,6 +7254,18 @@ class Chime { /// Connector. The streaming configuration specifies whether media streaming /// is enabled for sending to Kinesis. It also sets the retention period, in /// hours, for the Amazon Kinesis data. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorStreamingConfiguration, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5832,6 +7280,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by PutVoiceConnectorStreamingConfiguration in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorStreamingConfiguration({ required StreamingConfiguration streamingConfiguration, @@ -5854,7 +7304,18 @@ class Chime { /// /// If emergency calling is configured for the Amazon Chime Voice Connector, /// it must be deleted prior to turning off termination settings. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorTermination, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5870,6 +7331,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by PutVoiceConnectorTermination in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorTermination({ required Termination termination, required String voiceConnectorId, @@ -5889,6 +7352,18 @@ class Chime { /// Adds termination SIP credentials for the specified Amazon Chime Voice /// Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, PutVoiceConnectorTerminationCredentials, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -5903,6 +7378,8 @@ class Chime { /// /// Parameter [credentials] : /// The termination SIP credentials. + @Deprecated( + 'Replaced by PutVoiceConnectorTerminationCredentials in the Amazon Chime SDK Voice Namespace') Future putVoiceConnectorTerminationCredentials({ required String voiceConnectorId, List? credentials, @@ -5925,7 +7402,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, RedactChannelMessage, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -5942,6 +7430,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by RedactChannelMessage in the Amazon Chime SDK Messaging Namespace') Future redactChannelMessage({ required String channelArn, required String messageId, @@ -6200,7 +7690,18 @@ class Chime { /// Also, STANDARD messages can contain 4KB of data and the 1KB /// of metadata. CONTROL messages can contain 30 bytes of data /// and no metadata. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, SendChannelMessage, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -6231,6 +7732,8 @@ class Chime { /// /// Parameter [metadata] : /// The optional metadata for each message. + @Deprecated( + 'Replaced by SendChannelMessage in the Amazon Chime SDK Messaging Namespace') Future sendChannelMessage({ required String channelArn, required String content, @@ -6273,12 +7776,23 @@ class Chime { /// the StartStreamTranscription /// API in the Amazon Transcribe Developer Guide. - /// + /// /// Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use /// of Amazon Transcribe is subject to the AWS Service Terms, /// including the terms specific to the AWS Machine Learning and Artificial /// Intelligence Services. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, StartMeetingTranscription, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. /// /// /// May throw [NotFoundException]. @@ -6298,6 +7812,8 @@ class Chime { /// The configuration for the current transcription operation. Must contain /// EngineTranscribeSettings or /// EngineTranscribeMedicalSettings. + @Deprecated( + 'Replaced by StartMeetingTranscription in the Amazon Chime SDK Meetings Namespace') Future startMeetingTranscription({ required String meetingId, required TranscriptionConfiguration transcriptionConfiguration, @@ -6315,6 +7831,18 @@ class Chime { } /// Stops transcription for the specified meetingId. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, StopMeetingTranscription, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [ForbiddenException]. /// May throw [NotFoundException]. @@ -6327,6 +7855,8 @@ class Chime { /// /// Parameter [meetingId] : /// The unique ID of the meeting for which you stop transcription. + @Deprecated( + 'Replaced by StopMeetingTranscription in the Amazon Chime SDK Meetings Namespace') Future stopMeetingTranscription({ required String meetingId, }) async { @@ -6339,7 +7869,11 @@ class Chime { ); } - /// Applies the specified tags to the specified Amazon Chime SDK attendee. + /// Applies the specified tags to the specified Amazon Chime attendee. + /// + /// TagAttendee is not supported in the Amazon Chime SDK Meetings Namespace. + /// Update your application to remove calls to this API. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6358,6 +7892,8 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated( + 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.') Future tagAttendee({ required String attendeeId, required String meetingId, @@ -6376,6 +7912,18 @@ class Chime { } /// Applies the specified tags to the specified Amazon Chime SDK meeting. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, TagResource, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6391,6 +7939,7 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated('Use TagResource in the Amazon Chime SDK Meetings Namespace.') Future tagMeeting({ required String meetingId, required List tags, @@ -6409,6 +7958,18 @@ class Chime { /// Applies the specified tags to the specified Amazon Chime SDK meeting /// resource. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, TagResource, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6422,6 +7983,8 @@ class Chime { /// /// Parameter [tags] : /// The tag key-value pairs. + @Deprecated( + 'Replaced by TagResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces') Future tagResource({ required String resourceARN, required List tags, @@ -6439,6 +8002,10 @@ class Chime { } /// Untags the specified tags from the specified Amazon Chime SDK attendee. + /// + /// UntagAttendee is not supported in the Amazon Chime SDK Meetings Namespace. + /// Update your application to remove calls to this API. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6456,6 +8023,8 @@ class Chime { /// /// Parameter [tagKeys] : /// The tag keys. + @Deprecated( + 'Attendee Tags are not supported in the Amazon Chime SDK Meetings Namespace. Update your application to remove calls to this API.') Future untagAttendee({ required String attendeeId, required String meetingId, @@ -6474,6 +8043,18 @@ class Chime { } /// Untags the specified tags from the specified Amazon Chime SDK meeting. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UntagResource, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6488,6 +8069,7 @@ class Chime { /// /// Parameter [tagKeys] : /// The tag keys. + @Deprecated('Use UntagResource in the Amazon Chime SDK Meetings Namespace.') Future untagMeeting({ required String meetingId, required List tagKeys, @@ -6507,6 +8089,21 @@ class Chime { /// Untags the specified tags from the specified Amazon Chime SDK meeting /// resource. /// + /// Applies the specified tags to the specified Amazon Chime SDK meeting + /// resource. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UntagResource, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// + /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. /// May throw [NotFoundException]. @@ -6519,6 +8116,8 @@ class Chime { /// /// Parameter [tagKeys] : /// The tag keys. + @Deprecated( + 'Replaced by UntagResource in the Amazon Chime SDK Voice, Amazon Chime SDK Meetings, Amazon Chime SDK Identity, Amazon Chime SDK Messaging, and Amazon Chime SDK Media Pipelines Namespaces') Future untagResource({ required String resourceARN, required List tagKeys, @@ -6609,6 +8208,18 @@ class Chime { } /// Updates AppInstance metadata. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateAppInstance, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -6626,6 +8237,8 @@ class Chime { /// /// Parameter [metadata] : /// The metadata that you want to change. + @Deprecated( + 'Replaced by UpdateAppInstance in the Amazon Chime SDK Identity Namespace') Future updateAppInstance({ required String appInstanceArn, required String name, @@ -6646,6 +8259,18 @@ class Chime { /// Updates the details of an AppInstanceUser. You can update /// names and metadata. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateAppInstanceUser, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -6663,6 +8288,8 @@ class Chime { /// /// Parameter [metadata] : /// The metadata of the AppInstanceUser. + @Deprecated( + 'Replaced by UpdateAppInstanceUser in the Amazon Chime SDK Identity Namespace') Future updateAppInstanceUser({ required String appInstanceUserArn, required String name, @@ -6726,7 +8353,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateChannel, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6750,6 +8388,8 @@ class Chime { /// /// Parameter [metadata] : /// The metadata for the update request. + @Deprecated( + 'Replaced by UpdateChannel in the Amazon Chime SDK Messaging Namespace') Future updateChannel({ required String channelArn, required ChannelMode mode, @@ -6780,7 +8420,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateChannelMessage, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ConflictException]. @@ -6804,6 +8455,8 @@ class Chime { /// /// Parameter [metadata] : /// The metadata of the message being updated. + @Deprecated( + 'Replaced by UpdateChannelMessage in the Amazon Chime SDK Messaging Namespace') Future updateChannelMessage({ required String channelArn, required String messageId, @@ -6834,7 +8487,18 @@ class Chime { /// The x-amz-chime-bearer request header is mandatory. Use the /// AppInstanceUserArn of the user that makes the API call as the /// value in the header. - /// + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateChannelReadMarker, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [ForbiddenException]. @@ -6849,6 +8513,8 @@ class Chime { /// /// Parameter [chimeBearer] : /// The AppInstanceUserArn of the user that makes the API call. + @Deprecated( + 'Replaced by UpdateChannelReadMarker in the Amazon Chime SDK Messaging Namespace') Future updateChannelReadMarker({ required String channelArn, String? chimeBearer, @@ -6975,6 +8641,18 @@ class Chime { /// Updates the specified proxy session details, such as voice or SMS /// capabilities. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateProxySession, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -6995,6 +8673,8 @@ class Chime { /// /// Parameter [expiryMinutes] : /// The number of minutes allowed for the proxy session. + @Deprecated( + 'Replaced by UpdateProxySession in the Amazon Chime SDK Voice Namespace') Future updateProxySession({ required List capabilities, required String proxySessionId, @@ -7102,6 +8782,18 @@ class Chime { } /// Updates the details of the specified SIP media application. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateSipMediaApplication, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -7120,6 +8812,8 @@ class Chime { /// /// Parameter [name] : /// The new name for the specified SIP media application. + @Deprecated( + 'Replaced by UpdateSipMediaApplication in the Amazon Chime SDK Voice Namespace') Future updateSipMediaApplication({ required String sipMediaApplicationId, List? endpoints, @@ -7142,6 +8836,18 @@ class Chime { /// Invokes the AWS Lambda function associated with the SIP media application /// and transaction ID in an update request. The Lambda function can then /// return a new set of actions. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateSipMediaApplicationCall, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [BadRequestException]. /// May throw [NotFoundException]. @@ -7162,6 +8868,8 @@ class Chime { /// /// Parameter [transactionId] : /// The ID of the call transaction. + @Deprecated( + 'Replaced by UpdateSipMediaApplicationCall in the Amazon Chime SDK Voice Namespace') Future updateSipMediaApplicationCall({ required Map arguments, required String sipMediaApplicationId, @@ -7181,6 +8889,18 @@ class Chime { } /// Updates the details of the specified SIP rule. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateSipRule, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -7203,6 +8923,8 @@ class Chime { /// /// Parameter [targetApplications] : /// The new value of the list of target applications. + @Deprecated( + 'Replaced by UpdateSipRule in the Amazon Chime SDK Voice Namespace') Future updateSipRule({ required String name, required String sipRuleId, @@ -7309,6 +9031,18 @@ class Chime { } /// Updates details for the specified Amazon Chime Voice Connector. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateVoiceConnector, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -7326,6 +9060,8 @@ class Chime { /// /// Parameter [voiceConnectorId] : /// The Amazon Chime Voice Connector ID. + @Deprecated( + 'Replaced by UpdateVoiceConnector in the Amazon Chime SDK Voice Namespace') Future updateVoiceConnector({ required String name, required bool requireEncryption, @@ -7346,6 +9082,18 @@ class Chime { /// Updates details of the specified Amazon Chime Voice Connector group, such /// as the name and Amazon Chime Voice Connector priority ranking. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, UpdateVoiceConnectorGroup, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -7364,6 +9112,8 @@ class Chime { /// /// Parameter [voiceConnectorItems] : /// The VoiceConnectorItems to associate with the group. + @Deprecated( + 'Replaced by UpdateVoiceConnectorGroup in the Amazon Chime SDK Voice Namespace') Future updateVoiceConnectorGroup({ required String name, required String voiceConnectorGroupId, @@ -7388,6 +9138,18 @@ class Chime { /// Format Location Object file that you include in SIP requests. That helps /// ensure that addresses are routed to the appropriate Public Safety /// Answering Point. + /// + /// This API is is no longer supported and will not be updated. We + /// recommend using the latest version, ValidateE911Address, + /// in the Amazon Chime SDK. + /// + /// Using the latest version requires migrating to a dedicated namespace. For + /// more information, refer to Migrating + /// from the Amazon Chime namespace in the Amazon Chime SDK Developer + /// Guide. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -7417,6 +9179,8 @@ class Chime { /// /// Parameter [streetNumber] : /// The address street number, such as 200 or 2121. + @Deprecated( + 'Replaced by ValidateE911Address in the Amazon Chime SDK Voice Namespace') Future validateE911Address({ required String awsAccountId, required String city, @@ -13783,18 +15547,34 @@ class MediaPlacement { final String? eventIngestionUrl; /// The screen data URL. + /// + /// This parameter is is no longer supported and no longer used by the Amazon + /// Chime SDK. + /// final String? screenDataUrl; /// The screen sharing URL. + /// + /// This parameter is is no longer supported and no longer used by the Amazon + /// Chime SDK.. + /// final String? screenSharingUrl; /// The screen viewing URL. + /// + /// This parameter is is no longer supported and no longer used by the Amazon + /// Chime SDK. + /// final String? screenViewingUrl; /// The signaling URL. final String? signalingUrl; /// The turn control URL. + /// + /// This parameter is is no longer supported and no longer used by the Amazon + /// Chime SDK. + /// final String? turnControlUrl; MediaPlacement({ diff --git a/aws_client/lib/src/generated/chime_sdk_identity/v2021_04_20.dart b/aws_client/lib/src/generated/chime_sdk_identity/v2021_04_20.dart index e7a307524..582eb5788 100644 --- a/aws_client/lib/src/generated/chime_sdk_identity/v2021_04_20.dart +++ b/aws_client/lib/src/generated/chime_sdk_identity/v2021_04_20.dart @@ -1077,14 +1077,19 @@ class ChimeSdkIdentity { /// /// Parameter [name] : /// The name of the AppInstanceBot. + /// + /// Parameter [configuration] : + /// The configuration for the bot update. Future updateAppInstanceBot({ required String appInstanceBotArn, required String metadata, required String name, + Configuration? configuration, }) async { final $payload = { 'Metadata': metadata, 'Name': name, + if (configuration != null) 'Configuration': configuration, }; final response = await _protocol.send( payload: $payload, @@ -2362,6 +2367,67 @@ class Identity { } } +/// Specifies the type of message that triggers a bot. +class InvokedBy { + /// Sets standard messages as the bot trigger. For standard messages: + /// + ///
        + ///
      • + /// ALL: The bot processes all standard messages. + ///
      • + ///
      • + /// AUTO: The bot responds to ALL messages when the channel has one + /// other non-hidden member, and responds to MENTIONS when the channel has more + /// than one other non-hidden member. + ///
      • + ///
      • + /// MENTIONS: The bot processes all standard messages that have a + /// message attribute with CHIME.mentions and a value of the bot + /// ARN. + ///
      • + ///
      • + /// NONE: The bot processes no standard messages. + ///
      • + ///
      + final StandardMessages standardMessages; + + /// Sets targeted messages as the bot trigger. For targeted messages: + /// + ///
        + ///
      • + /// ALL: The bot processes all TargetedMessages sent + /// to it. The bot then responds with a targeted message back to the sender. + ///
      • + ///
      • + /// NONE: The bot processes no targeted messages. + ///
      • + ///
      + final TargetedMessages targetedMessages; + + InvokedBy({ + required this.standardMessages, + required this.targetedMessages, + }); + + factory InvokedBy.fromJson(Map json) { + return InvokedBy( + standardMessages: + (json['StandardMessages'] as String).toStandardMessages(), + targetedMessages: + (json['TargetedMessages'] as String).toTargetedMessages(), + ); + } + + Map toJson() { + final standardMessages = this.standardMessages; + final targetedMessages = this.targetedMessages; + return { + 'StandardMessages': standardMessages.toValue(), + 'TargetedMessages': targetedMessages.toValue(), + }; + } +} + /// The configuration for an Amazon Lex V2 bot. class LexConfiguration { /// The ARN of the Amazon Lex V2 bot's alias. The ARN uses this format: @@ -2376,9 +2442,15 @@ class LexConfiguration { /// languages in the Amazon Lex V2 Developer Guide. final String localeId; + /// Specifies the type of message that triggers a bot. + final InvokedBy? invokedBy; + + /// + /// Deprecated. Use InvokedBy instead. + /// /// Determines whether the Amazon Lex V2 bot responds to all standard messages. /// Control messages are not supported. - final RespondsTo respondsTo; + final RespondsTo? respondsTo; /// The name of the welcome intent configured in the Amazon Lex V2 bot. final String? welcomeIntent; @@ -2386,7 +2458,8 @@ class LexConfiguration { LexConfiguration({ required this.lexBotAliasArn, required this.localeId, - required this.respondsTo, + this.invokedBy, + this.respondsTo, this.welcomeIntent, }); @@ -2394,7 +2467,10 @@ class LexConfiguration { return LexConfiguration( lexBotAliasArn: json['LexBotAliasArn'] as String, localeId: json['LocaleId'] as String, - respondsTo: (json['RespondsTo'] as String).toRespondsTo(), + invokedBy: json['InvokedBy'] != null + ? InvokedBy.fromJson(json['InvokedBy'] as Map) + : null, + respondsTo: (json['RespondsTo'] as String?)?.toRespondsTo(), welcomeIntent: json['WelcomeIntent'] as String?, ); } @@ -2402,12 +2478,14 @@ class LexConfiguration { Map toJson() { final lexBotAliasArn = this.lexBotAliasArn; final localeId = this.localeId; + final invokedBy = this.invokedBy; final respondsTo = this.respondsTo; final welcomeIntent = this.welcomeIntent; return { 'LexBotAliasArn': lexBotAliasArn, 'LocaleId': localeId, - 'RespondsTo': respondsTo.toValue(), + if (invokedBy != null) 'InvokedBy': invokedBy, + if (respondsTo != null) 'RespondsTo': respondsTo.toValue(), if (welcomeIntent != null) 'WelcomeIntent': welcomeIntent, }; } @@ -2753,6 +2831,44 @@ extension RespondsToFromString on String { } } +enum StandardMessages { + auto, + all, + mentions, + none, +} + +extension StandardMessagesValueExtension on StandardMessages { + String toValue() { + switch (this) { + case StandardMessages.auto: + return 'AUTO'; + case StandardMessages.all: + return 'ALL'; + case StandardMessages.mentions: + return 'MENTIONS'; + case StandardMessages.none: + return 'NONE'; + } + } +} + +extension StandardMessagesFromString on String { + StandardMessages toStandardMessages() { + switch (this) { + case 'AUTO': + return StandardMessages.auto; + case 'ALL': + return StandardMessages.all; + case 'MENTIONS': + return StandardMessages.mentions; + case 'NONE': + return StandardMessages.none; + } + throw Exception('$this is not known in enum StandardMessages'); + } +} + /// A tag object containing a key-value pair. class Tag { /// The key in a tag. @@ -2783,6 +2899,34 @@ class Tag { } } +enum TargetedMessages { + all, + none, +} + +extension TargetedMessagesValueExtension on TargetedMessages { + String toValue() { + switch (this) { + case TargetedMessages.all: + return 'ALL'; + case TargetedMessages.none: + return 'NONE'; + } + } +} + +extension TargetedMessagesFromString on String { + TargetedMessages toTargetedMessages() { + switch (this) { + case 'ALL': + return TargetedMessages.all; + case 'NONE': + return TargetedMessages.none; + } + throw Exception('$this is not known in enum TargetedMessages'); + } +} + class UpdateAppInstanceBotResponse { /// The ARN of the AppInstanceBot. final String? appInstanceBotArn; diff --git a/aws_client/lib/src/generated/chime_sdk_media_pipelines/v2021_07_15.dart b/aws_client/lib/src/generated/chime_sdk_media_pipelines/v2021_07_15.dart index 4f023989c..55b632379 100644 --- a/aws_client/lib/src/generated/chime_sdk_media_pipelines/v2021_07_15.dart +++ b/aws_client/lib/src/generated/chime_sdk_media_pipelines/v2021_07_15.dart @@ -191,7 +191,9 @@ class ChimeSdkMediaPipelines { /// key-value map of strings. /// /// Parameter [s3RecordingSinkRuntimeConfiguration] : - /// The runtime configuration for the S3 recording sink. + /// The runtime configuration for the S3 recording sink. If specified, the + /// settings in this structure override any settings in + /// S3RecordingSinkConfiguration. /// /// Parameter [tags] : /// The tags assigned to the media insights pipeline. @@ -337,6 +339,93 @@ class ChimeSdkMediaPipelines { return CreateMediaLiveConnectorPipelineResponse.fromJson(response); } + /// Creates an Kinesis video stream pool for the media pipeline. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [ResourceLimitExceededException]. + /// May throw [ConflictException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [poolName] : + /// The name of the video stream pool. + /// + /// Parameter [streamConfiguration] : + /// The configuration settings for the video stream. + /// + /// Parameter [clientRequestToken] : + /// The token assigned to the client making the request. + /// + /// Parameter [tags] : + /// The tags assigned to the video stream pool. + Future + createMediaPipelineKinesisVideoStreamPool({ + required String poolName, + required KinesisVideoStreamConfiguration streamConfiguration, + String? clientRequestToken, + List? tags, + }) async { + final $payload = { + 'PoolName': poolName, + 'StreamConfiguration': streamConfiguration, + 'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/media-pipeline-kinesis-video-stream-pools', + exceptionFnMap: _exceptionFns, + ); + return CreateMediaPipelineKinesisVideoStreamPoolResponse.fromJson(response); + } + + /// Creates a streaming media pipeline. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [ResourceLimitExceededException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [sinks] : + /// The data sink for the media pipeline. + /// + /// Parameter [sources] : + /// The data sources for the media pipeline. + /// + /// Parameter [clientRequestToken] : + /// The token assigned to the client making the request. + /// + /// Parameter [tags] : + /// The tags assigned to the media pipeline. + Future createMediaStreamPipeline({ + required List sinks, + required List sources, + String? clientRequestToken, + List? tags, + }) async { + final $payload = { + 'Sinks': sinks, + 'Sources': sources, + 'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/sdk-media-stream-pipelines', + exceptionFnMap: _exceptionFns, + ); + return CreateMediaStreamPipelineResponse.fromJson(response); + } + /// Deletes the media pipeline. /// /// May throw [BadRequestException]. @@ -394,6 +483,7 @@ class ChimeSdkMediaPipelines { /// May throw [ThrottledClientException]. /// May throw [NotFoundException]. /// May throw [UnauthorizedClientException]. + /// May throw [ConflictException]. /// May throw [ServiceUnavailableException]. /// May throw [ServiceFailureException]. /// @@ -411,6 +501,31 @@ class ChimeSdkMediaPipelines { ); } + /// Deletes an Kinesis video stream pool. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ConflictException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The ID of the pool being deleted. + Future deleteMediaPipelineKinesisVideoStreamPool({ + required String identifier, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/media-pipeline-kinesis-video-stream-pools/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Gets an existing media pipeline. /// /// May throw [BadRequestException]. @@ -488,6 +603,92 @@ class ChimeSdkMediaPipelines { return GetMediaPipelineResponse.fromJson(response); } + /// Gets an Kinesis video stream pool. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The ID of the video stream pool. + Future + getMediaPipelineKinesisVideoStreamPool({ + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/media-pipeline-kinesis-video-stream-pools/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetMediaPipelineKinesisVideoStreamPoolResponse.fromJson(response); + } + + /// Retrieves the details of the specified speaker search task. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [speakerSearchTaskId] : + /// The ID of the speaker search task. + Future getSpeakerSearchTask({ + required String identifier, + required String speakerSearchTaskId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/speaker-search-tasks/${Uri.encodeComponent(speakerSearchTaskId)}', + exceptionFnMap: _exceptionFns, + ); + return GetSpeakerSearchTaskResponse.fromJson(response); + } + + /// Retrieves the details of a voice tone analysis task. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [voiceToneAnalysisTaskId] : + /// The ID of the voice tone analysis task. + Future getVoiceToneAnalysisTask({ + required String identifier, + required String voiceToneAnalysisTaskId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/voice-tone-analysis-tasks/${Uri.encodeComponent(voiceToneAnalysisTaskId)}', + exceptionFnMap: _exceptionFns, + ); + return GetVoiceToneAnalysisTaskResponse.fromJson(response); + } + /// Returns a list of media pipelines. /// /// May throw [BadRequestException]. @@ -568,6 +769,46 @@ class ChimeSdkMediaPipelines { return ListMediaInsightsPipelineConfigurationsResponse.fromJson(response); } + /// Lists the video stream pools in the media pipeline. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [ResourceLimitExceededException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call. + /// + /// Parameter [nextToken] : + /// The token used to return the next page of results. + Future + listMediaPipelineKinesisVideoStreamPools({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/media-pipeline-kinesis-video-stream-pools', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListMediaPipelineKinesisVideoStreamPoolsResponse.fromJson(response); + } + /// Returns a list of media pipelines. /// /// May throw [BadRequestException]. @@ -637,6 +878,182 @@ class ChimeSdkMediaPipelines { return ListTagsForResourceResponse.fromJson(response); } + /// Starts a speaker search task. + /// + /// Before starting any speaker search tasks, you must provide all notices and + /// obtain all consents from the speaker as required under applicable privacy + /// and biometrics laws, and as required under the AWS service terms for the + /// Amazon Chime SDK. + /// + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [ConflictException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [voiceProfileDomainArn] : + /// The ARN of the voice profile domain that will store the voice profile. + /// + /// Parameter [clientRequestToken] : + /// The unique identifier for the client request. Use a different token for + /// different speaker search tasks. + /// + /// Parameter [kinesisVideoStreamSourceTaskConfiguration] : + /// The task configuration for the Kinesis video stream source of the media + /// insights pipeline. + Future startSpeakerSearchTask({ + required String identifier, + required String voiceProfileDomainArn, + String? clientRequestToken, + KinesisVideoStreamSourceTaskConfiguration? + kinesisVideoStreamSourceTaskConfiguration, + }) async { + final $payload = { + 'VoiceProfileDomainArn': voiceProfileDomainArn, + 'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (kinesisVideoStreamSourceTaskConfiguration != null) + 'KinesisVideoStreamSourceTaskConfiguration': + kinesisVideoStreamSourceTaskConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/speaker-search-tasks?operation=start', + exceptionFnMap: _exceptionFns, + ); + return StartSpeakerSearchTaskResponse.fromJson(response); + } + + /// Starts a voice tone analysis task. For more information about voice tone + /// analysis, see Using + /// Amazon Chime SDK voice analytics in the Amazon Chime SDK Developer + /// Guide. + /// + /// Before starting any voice tone analysis tasks, you must provide all + /// notices and obtain all consents from the speaker as required under + /// applicable privacy and biometrics laws, and as required under the AWS service terms for the + /// Amazon Chime SDK. + /// + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [ConflictException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [languageCode] : + /// The language code. + /// + /// Parameter [clientRequestToken] : + /// The unique identifier for the client request. Use a different token for + /// different voice tone analysis tasks. + /// + /// Parameter [kinesisVideoStreamSourceTaskConfiguration] : + /// The task configuration for the Kinesis video stream source of the media + /// insights pipeline. + Future startVoiceToneAnalysisTask({ + required String identifier, + required VoiceAnalyticsLanguageCode languageCode, + String? clientRequestToken, + KinesisVideoStreamSourceTaskConfiguration? + kinesisVideoStreamSourceTaskConfiguration, + }) async { + final $payload = { + 'LanguageCode': languageCode.toValue(), + 'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (kinesisVideoStreamSourceTaskConfiguration != null) + 'KinesisVideoStreamSourceTaskConfiguration': + kinesisVideoStreamSourceTaskConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/voice-tone-analysis-tasks?operation=start', + exceptionFnMap: _exceptionFns, + ); + return StartVoiceToneAnalysisTaskResponse.fromJson(response); + } + + /// Stops a speaker search task. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [ConflictException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [speakerSearchTaskId] : + /// The speaker search task ID. + Future stopSpeakerSearchTask({ + required String identifier, + required String speakerSearchTaskId, + }) async { + await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/speaker-search-tasks/${Uri.encodeComponent(speakerSearchTaskId)}?operation=stop', + exceptionFnMap: _exceptionFns, + ); + } + + /// Stops a voice tone analysis task. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [ConflictException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [NotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The unique identifier of the resource to be updated. Valid values include + /// the ID and ARN of the media insights pipeline. + /// + /// Parameter [voiceToneAnalysisTaskId] : + /// The ID of the voice tone analysis task. + Future stopVoiceToneAnalysisTask({ + required String identifier, + required String voiceToneAnalysisTaskId, + }) async { + await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/media-insights-pipelines/${Uri.encodeComponent(identifier)}/voice-tone-analysis-tasks/${Uri.encodeComponent(voiceToneAnalysisTaskId)}?operation=stop', + exceptionFnMap: _exceptionFns, + ); + } + /// The ARN of the media pipeline that you want to tag. Consists of the /// pipeline's endpoint region, resource ID, and pipeline ID. /// @@ -782,6 +1199,104 @@ class ChimeSdkMediaPipelines { exceptionFnMap: _exceptionFns, ); } + + /// Updates an Kinesis video stream pool in a media pipeline. + /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [NotFoundException]. + /// May throw [UnauthorizedClientException]. + /// May throw [ThrottledClientException]. + /// May throw [ConflictException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// + /// Parameter [identifier] : + /// The ID of the video stream pool. + /// + /// Parameter [streamConfiguration] : + /// The configuration settings for the video stream. + Future + updateMediaPipelineKinesisVideoStreamPool({ + required String identifier, + KinesisVideoStreamConfigurationUpdate? streamConfiguration, + }) async { + final $payload = { + if (streamConfiguration != null) + 'StreamConfiguration': streamConfiguration, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/media-pipeline-kinesis-video-stream-pools/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateMediaPipelineKinesisVideoStreamPoolResponse.fromJson(response); + } +} + +/// Defines the configuration for an ActiveSpeakerOnly video tile. +class ActiveSpeakerOnlyConfiguration { + /// The position of the ActiveSpeakerOnly video tile. + final ActiveSpeakerPosition? activeSpeakerPosition; + + ActiveSpeakerOnlyConfiguration({ + this.activeSpeakerPosition, + }); + + factory ActiveSpeakerOnlyConfiguration.fromJson(Map json) { + return ActiveSpeakerOnlyConfiguration( + activeSpeakerPosition: + (json['ActiveSpeakerPosition'] as String?)?.toActiveSpeakerPosition(), + ); + } + + Map toJson() { + final activeSpeakerPosition = this.activeSpeakerPosition; + return { + if (activeSpeakerPosition != null) + 'ActiveSpeakerPosition': activeSpeakerPosition.toValue(), + }; + } +} + +enum ActiveSpeakerPosition { + topLeft, + topRight, + bottomLeft, + bottomRight, +} + +extension ActiveSpeakerPositionValueExtension on ActiveSpeakerPosition { + String toValue() { + switch (this) { + case ActiveSpeakerPosition.topLeft: + return 'TopLeft'; + case ActiveSpeakerPosition.topRight: + return 'TopRight'; + case ActiveSpeakerPosition.bottomLeft: + return 'BottomLeft'; + case ActiveSpeakerPosition.bottomRight: + return 'BottomRight'; + } + } +} + +extension ActiveSpeakerPositionFromString on String { + ActiveSpeakerPosition toActiveSpeakerPosition() { + switch (this) { + case 'TopLeft': + return ActiveSpeakerPosition.topLeft; + case 'TopRight': + return ActiveSpeakerPosition.topRight; + case 'BottomLeft': + return ActiveSpeakerPosition.bottomLeft; + case 'BottomRight': + return ActiveSpeakerPosition.bottomRight; + } + throw Exception('$this is not known in enum ActiveSpeakerPosition'); + } } /// A structure that contains the configuration settings for an Amazon @@ -1015,16 +1530,6 @@ class AmazonTranscribeCallAnalyticsProcessorConfiguration { /// A structure that contains the configuration settings for an Amazon /// Transcribe processor. class AmazonTranscribeProcessorConfiguration { - /// The language code that represents the language spoken in your audio. - /// - /// If you're unsure of the language spoken in your audio, consider using - /// IdentifyLanguage to enable automatic language identification. - /// - /// For a list of languages that real-time Call Analytics supports, see the Supported - /// languages table in the Amazon Transcribe Developer Guide. - final CallAnalyticsLanguageCode languageCode; - /// Labels all personally identifiable information (PII) identified in your /// transcript. /// @@ -1070,6 +1575,19 @@ class AmazonTranscribeProcessorConfiguration { /// filtered out of the insights target. final bool? filterPartialResults; + /// Turns language identification on or off. + final bool? identifyLanguage; + + /// The language code that represents the language spoken in your audio. + /// + /// If you're unsure of the language spoken in your audio, consider using + /// IdentifyLanguage to enable automatic language identification. + /// + /// For a list of languages that real-time Call Analytics supports, see the Supported + /// languages table in the Amazon Transcribe Developer Guide. + final CallAnalyticsLanguageCode? languageCode; + /// The name of the custom language model that you want to use when processing /// your transcription. Note that language model names are case sensitive. /// @@ -1083,6 +1601,10 @@ class AmazonTranscribeProcessorConfiguration { /// language models in the Amazon Transcribe Developer Guide. final String? languageModelName; + /// The language options for the transcription, such as automatic language + /// detection. + final String? languageOptions; + /// The level of stability to use when you enable partial results stabilization /// (EnablePartialResultsStabilization). /// @@ -1112,6 +1634,9 @@ class AmazonTranscribeProcessorConfiguration { /// ALL. final String? piiEntityTypes; + /// The preferred language for the transcription. + final CallAnalyticsLanguageCode? preferredLanguage; + /// Enables speaker partitioning (diarization) in your transcription output. /// Speaker partitioning labels the speech from individual speakers in your /// media file. @@ -1130,32 +1655,43 @@ class AmazonTranscribeProcessorConfiguration { /// Length Constraints: Minimum length of 1. Maximum length of 200. final String? vocabularyFilterName; + /// The names of the custom vocabulary filter or filters using during + /// transcription. + final String? vocabularyFilterNames; + /// The name of the custom vocabulary that you specified in your Call Analytics /// request. /// /// Length Constraints: Minimum length of 1. Maximum length of 200. final String? vocabularyName; + /// The names of the custom vocabulary or vocabularies used during + /// transcription. + final String? vocabularyNames; + AmazonTranscribeProcessorConfiguration({ - required this.languageCode, this.contentIdentificationType, this.contentRedactionType, this.enablePartialResultsStabilization, this.filterPartialResults, + this.identifyLanguage, + this.languageCode, this.languageModelName, + this.languageOptions, this.partialResultsStability, this.piiEntityTypes, + this.preferredLanguage, this.showSpeakerLabel, this.vocabularyFilterMethod, this.vocabularyFilterName, + this.vocabularyFilterNames, this.vocabularyName, + this.vocabularyNames, }); factory AmazonTranscribeProcessorConfiguration.fromJson( Map json) { return AmazonTranscribeProcessorConfiguration( - languageCode: - (json['LanguageCode'] as String).toCallAnalyticsLanguageCode(), contentIdentificationType: (json['ContentIdentificationType'] as String?)?.toContentType(), contentRedactionType: @@ -1163,34 +1699,46 @@ class AmazonTranscribeProcessorConfiguration { enablePartialResultsStabilization: json['EnablePartialResultsStabilization'] as bool?, filterPartialResults: json['FilterPartialResults'] as bool?, + identifyLanguage: json['IdentifyLanguage'] as bool?, + languageCode: + (json['LanguageCode'] as String?)?.toCallAnalyticsLanguageCode(), languageModelName: json['LanguageModelName'] as String?, + languageOptions: json['LanguageOptions'] as String?, partialResultsStability: (json['PartialResultsStability'] as String?) ?.toPartialResultsStability(), piiEntityTypes: json['PiiEntityTypes'] as String?, + preferredLanguage: + (json['PreferredLanguage'] as String?)?.toCallAnalyticsLanguageCode(), showSpeakerLabel: json['ShowSpeakerLabel'] as bool?, vocabularyFilterMethod: (json['VocabularyFilterMethod'] as String?) ?.toVocabularyFilterMethod(), vocabularyFilterName: json['VocabularyFilterName'] as String?, + vocabularyFilterNames: json['VocabularyFilterNames'] as String?, vocabularyName: json['VocabularyName'] as String?, + vocabularyNames: json['VocabularyNames'] as String?, ); } Map toJson() { - final languageCode = this.languageCode; final contentIdentificationType = this.contentIdentificationType; final contentRedactionType = this.contentRedactionType; final enablePartialResultsStabilization = this.enablePartialResultsStabilization; final filterPartialResults = this.filterPartialResults; + final identifyLanguage = this.identifyLanguage; + final languageCode = this.languageCode; final languageModelName = this.languageModelName; + final languageOptions = this.languageOptions; final partialResultsStability = this.partialResultsStability; final piiEntityTypes = this.piiEntityTypes; + final preferredLanguage = this.preferredLanguage; final showSpeakerLabel = this.showSpeakerLabel; final vocabularyFilterMethod = this.vocabularyFilterMethod; final vocabularyFilterName = this.vocabularyFilterName; + final vocabularyFilterNames = this.vocabularyFilterNames; final vocabularyName = this.vocabularyName; + final vocabularyNames = this.vocabularyNames; return { - 'LanguageCode': languageCode.toValue(), if (contentIdentificationType != null) 'ContentIdentificationType': contentIdentificationType.toValue(), if (contentRedactionType != null) @@ -1199,16 +1747,24 @@ class AmazonTranscribeProcessorConfiguration { 'EnablePartialResultsStabilization': enablePartialResultsStabilization, if (filterPartialResults != null) 'FilterPartialResults': filterPartialResults, + if (identifyLanguage != null) 'IdentifyLanguage': identifyLanguage, + if (languageCode != null) 'LanguageCode': languageCode.toValue(), if (languageModelName != null) 'LanguageModelName': languageModelName, + if (languageOptions != null) 'LanguageOptions': languageOptions, if (partialResultsStability != null) 'PartialResultsStability': partialResultsStability.toValue(), if (piiEntityTypes != null) 'PiiEntityTypes': piiEntityTypes, + if (preferredLanguage != null) + 'PreferredLanguage': preferredLanguage.toValue(), if (showSpeakerLabel != null) 'ShowSpeakerLabel': showSpeakerLabel, if (vocabularyFilterMethod != null) 'VocabularyFilterMethod': vocabularyFilterMethod.toValue(), if (vocabularyFilterName != null) 'VocabularyFilterName': vocabularyFilterName, + if (vocabularyFilterNames != null) + 'VocabularyFilterNames': vocabularyFilterNames, if (vocabularyName != null) 'VocabularyName': vocabularyName, + if (vocabularyNames != null) 'VocabularyNames': vocabularyNames, }; } } @@ -1526,6 +2082,54 @@ extension AudioMuxTypeFromString on String { } } +enum BorderColor { + black, + blue, + red, + green, + white, + yellow, +} + +extension BorderColorValueExtension on BorderColor { + String toValue() { + switch (this) { + case BorderColor.black: + return 'Black'; + case BorderColor.blue: + return 'Blue'; + case BorderColor.red: + return 'Red'; + case BorderColor.green: + return 'Green'; + case BorderColor.white: + return 'White'; + case BorderColor.yellow: + return 'Yellow'; + } + } +} + +extension BorderColorFromString on String { + BorderColor toBorderColor() { + switch (this) { + case 'Black': + return BorderColor.black; + case 'Blue': + return BorderColor.blue; + case 'Red': + return BorderColor.red; + case 'Green': + return BorderColor.green; + case 'White': + return BorderColor.white; + case 'Yellow': + return BorderColor.yellow; + } + throw Exception('$this is not known in enum BorderColor'); + } +} + enum CallAnalyticsLanguageCode { enUs, enGb, @@ -1589,6 +2193,34 @@ extension CallAnalyticsLanguageCodeFromString on String { } } +enum CanvasOrientation { + landscape, + portrait, +} + +extension CanvasOrientationValueExtension on CanvasOrientation { + String toValue() { + switch (this) { + case CanvasOrientation.landscape: + return 'Landscape'; + case CanvasOrientation.portrait: + return 'Portrait'; + } + } +} + +extension CanvasOrientationFromString on String { + CanvasOrientation toCanvasOrientation() { + switch (this) { + case 'Landscape': + return CanvasOrientation.landscape; + case 'Portrait': + return CanvasOrientation.portrait; + } + throw Exception('$this is not known in enum CanvasOrientation'); + } +} + /// Defines an audio channel in a Kinesis video stream. class ChannelDefinition { /// The channel ID. @@ -2030,6 +2662,7 @@ enum ContentShareLayoutOption { presenterOnly, horizontal, vertical, + activeSpeakerOnly, } extension ContentShareLayoutOptionValueExtension on ContentShareLayoutOption { @@ -2041,6 +2674,8 @@ extension ContentShareLayoutOptionValueExtension on ContentShareLayoutOption { return 'Horizontal'; case ContentShareLayoutOption.vertical: return 'Vertical'; + case ContentShareLayoutOption.activeSpeakerOnly: + return 'ActiveSpeakerOnly'; } } } @@ -2054,6 +2689,8 @@ extension ContentShareLayoutOptionFromString on String { return ContentShareLayoutOption.horizontal; case 'Vertical': return ContentShareLayoutOption.vertical; + case 'ActiveSpeakerOnly': + return ContentShareLayoutOption.activeSpeakerOnly; } throw Exception('$this is not known in enum ContentShareLayoutOption'); } @@ -2221,6 +2858,65 @@ class CreateMediaLiveConnectorPipelineResponse { } } +class CreateMediaPipelineKinesisVideoStreamPoolResponse { + /// The configuration for the Kinesis video stream pool. + final KinesisVideoStreamPoolConfiguration? + kinesisVideoStreamPoolConfiguration; + + CreateMediaPipelineKinesisVideoStreamPoolResponse({ + this.kinesisVideoStreamPoolConfiguration, + }); + + factory CreateMediaPipelineKinesisVideoStreamPoolResponse.fromJson( + Map json) { + return CreateMediaPipelineKinesisVideoStreamPoolResponse( + kinesisVideoStreamPoolConfiguration: + json['KinesisVideoStreamPoolConfiguration'] != null + ? KinesisVideoStreamPoolConfiguration.fromJson( + json['KinesisVideoStreamPoolConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final kinesisVideoStreamPoolConfiguration = + this.kinesisVideoStreamPoolConfiguration; + return { + if (kinesisVideoStreamPoolConfiguration != null) + 'KinesisVideoStreamPoolConfiguration': + kinesisVideoStreamPoolConfiguration, + }; + } +} + +class CreateMediaStreamPipelineResponse { + /// The requested media pipeline. + final MediaStreamPipeline? mediaStreamPipeline; + + CreateMediaStreamPipelineResponse({ + this.mediaStreamPipeline, + }); + + factory CreateMediaStreamPipelineResponse.fromJson( + Map json) { + return CreateMediaStreamPipelineResponse( + mediaStreamPipeline: json['MediaStreamPipeline'] != null + ? MediaStreamPipeline.fromJson( + json['MediaStreamPipeline'] as Map) + : null, + ); + } + + Map toJson() { + final mediaStreamPipeline = this.mediaStreamPipeline; + return { + if (mediaStreamPipeline != null) + 'MediaStreamPipeline': mediaStreamPipeline, + }; + } +} + /// The content configuration object's data channel. class DataChannelConcatenationConfiguration { /// Enables or disables the configuration object. @@ -2271,7 +2967,7 @@ class DataChannelConcatenationConfiguration { class FragmentSelector { /// The origin of the timestamps to use, Server or /// Producer. For more information, see StartSelectorType + /// href="https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_StartSelector.html">StartSelectorType /// in the Amazon Kinesis Video Streams Developer Guide. final FragmentSelectorType fragmentSelectorType; @@ -2387,6 +3083,38 @@ class GetMediaInsightsPipelineConfigurationResponse { } } +class GetMediaPipelineKinesisVideoStreamPoolResponse { + /// The video stream pool configuration object. + final KinesisVideoStreamPoolConfiguration? + kinesisVideoStreamPoolConfiguration; + + GetMediaPipelineKinesisVideoStreamPoolResponse({ + this.kinesisVideoStreamPoolConfiguration, + }); + + factory GetMediaPipelineKinesisVideoStreamPoolResponse.fromJson( + Map json) { + return GetMediaPipelineKinesisVideoStreamPoolResponse( + kinesisVideoStreamPoolConfiguration: + json['KinesisVideoStreamPoolConfiguration'] != null + ? KinesisVideoStreamPoolConfiguration.fromJson( + json['KinesisVideoStreamPoolConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final kinesisVideoStreamPoolConfiguration = + this.kinesisVideoStreamPoolConfiguration; + return { + if (kinesisVideoStreamPoolConfiguration != null) + 'KinesisVideoStreamPoolConfiguration': + kinesisVideoStreamPoolConfiguration, + }; + } +} + class GetMediaPipelineResponse { /// The media pipeline object. final MediaPipeline? mediaPipeline; @@ -2412,41 +3140,267 @@ class GetMediaPipelineResponse { } } +class GetSpeakerSearchTaskResponse { + /// The details of the speaker search task. + final SpeakerSearchTask? speakerSearchTask; + + GetSpeakerSearchTaskResponse({ + this.speakerSearchTask, + }); + + factory GetSpeakerSearchTaskResponse.fromJson(Map json) { + return GetSpeakerSearchTaskResponse( + speakerSearchTask: json['SpeakerSearchTask'] != null + ? SpeakerSearchTask.fromJson( + json['SpeakerSearchTask'] as Map) + : null, + ); + } + + Map toJson() { + final speakerSearchTask = this.speakerSearchTask; + return { + if (speakerSearchTask != null) 'SpeakerSearchTask': speakerSearchTask, + }; + } +} + +class GetVoiceToneAnalysisTaskResponse { + /// The details of the voice tone analysis task. + final VoiceToneAnalysisTask? voiceToneAnalysisTask; + + GetVoiceToneAnalysisTaskResponse({ + this.voiceToneAnalysisTask, + }); + + factory GetVoiceToneAnalysisTaskResponse.fromJson(Map json) { + return GetVoiceToneAnalysisTaskResponse( + voiceToneAnalysisTask: json['VoiceToneAnalysisTask'] != null + ? VoiceToneAnalysisTask.fromJson( + json['VoiceToneAnalysisTask'] as Map) + : null, + ); + } + + Map toJson() { + final voiceToneAnalysisTask = this.voiceToneAnalysisTask; + return { + if (voiceToneAnalysisTask != null) + 'VoiceToneAnalysisTask': voiceToneAnalysisTask, + }; + } +} + /// Specifies the type of grid layout. class GridViewConfiguration { /// Defines the layout of the video tiles when content sharing is enabled. final ContentShareLayoutOption contentShareLayout; + /// The configuration settings for an ActiveSpeakerOnly video tile. + final ActiveSpeakerOnlyConfiguration? activeSpeakerOnlyConfiguration; + + /// The orientation setting, horizontal or vertical. + final CanvasOrientation? canvasOrientation; + + /// The configuration settings for a horizontal layout. + final HorizontalLayoutConfiguration? horizontalLayoutConfiguration; + /// Defines the configuration options for a presenter only video tile. final PresenterOnlyConfiguration? presenterOnlyConfiguration; + /// The configuration settings for a vertical layout. + final VerticalLayoutConfiguration? verticalLayoutConfiguration; + + /// The attribute settings for the video tiles. + final VideoAttribute? videoAttribute; + GridViewConfiguration({ required this.contentShareLayout, + this.activeSpeakerOnlyConfiguration, + this.canvasOrientation, + this.horizontalLayoutConfiguration, this.presenterOnlyConfiguration, + this.verticalLayoutConfiguration, + this.videoAttribute, }); factory GridViewConfiguration.fromJson(Map json) { return GridViewConfiguration( contentShareLayout: (json['ContentShareLayout'] as String).toContentShareLayoutOption(), + activeSpeakerOnlyConfiguration: json['ActiveSpeakerOnlyConfiguration'] != + null + ? ActiveSpeakerOnlyConfiguration.fromJson( + json['ActiveSpeakerOnlyConfiguration'] as Map) + : null, + canvasOrientation: + (json['CanvasOrientation'] as String?)?.toCanvasOrientation(), + horizontalLayoutConfiguration: + json['HorizontalLayoutConfiguration'] != null + ? HorizontalLayoutConfiguration.fromJson( + json['HorizontalLayoutConfiguration'] as Map) + : null, presenterOnlyConfiguration: json['PresenterOnlyConfiguration'] != null ? PresenterOnlyConfiguration.fromJson( json['PresenterOnlyConfiguration'] as Map) : null, + verticalLayoutConfiguration: json['VerticalLayoutConfiguration'] != null + ? VerticalLayoutConfiguration.fromJson( + json['VerticalLayoutConfiguration'] as Map) + : null, + videoAttribute: json['VideoAttribute'] != null + ? VideoAttribute.fromJson( + json['VideoAttribute'] as Map) + : null, ); } Map toJson() { final contentShareLayout = this.contentShareLayout; + final activeSpeakerOnlyConfiguration = this.activeSpeakerOnlyConfiguration; + final canvasOrientation = this.canvasOrientation; + final horizontalLayoutConfiguration = this.horizontalLayoutConfiguration; final presenterOnlyConfiguration = this.presenterOnlyConfiguration; + final verticalLayoutConfiguration = this.verticalLayoutConfiguration; + final videoAttribute = this.videoAttribute; return { 'ContentShareLayout': contentShareLayout.toValue(), + if (activeSpeakerOnlyConfiguration != null) + 'ActiveSpeakerOnlyConfiguration': activeSpeakerOnlyConfiguration, + if (canvasOrientation != null) + 'CanvasOrientation': canvasOrientation.toValue(), + if (horizontalLayoutConfiguration != null) + 'HorizontalLayoutConfiguration': horizontalLayoutConfiguration, if (presenterOnlyConfiguration != null) 'PresenterOnlyConfiguration': presenterOnlyConfiguration, + if (verticalLayoutConfiguration != null) + 'VerticalLayoutConfiguration': verticalLayoutConfiguration, + if (videoAttribute != null) 'VideoAttribute': videoAttribute, + }; + } +} + +enum HighlightColor { + black, + blue, + red, + green, + white, + yellow, +} + +extension HighlightColorValueExtension on HighlightColor { + String toValue() { + switch (this) { + case HighlightColor.black: + return 'Black'; + case HighlightColor.blue: + return 'Blue'; + case HighlightColor.red: + return 'Red'; + case HighlightColor.green: + return 'Green'; + case HighlightColor.white: + return 'White'; + case HighlightColor.yellow: + return 'Yellow'; + } + } +} + +extension HighlightColorFromString on String { + HighlightColor toHighlightColor() { + switch (this) { + case 'Black': + return HighlightColor.black; + case 'Blue': + return HighlightColor.blue; + case 'Red': + return HighlightColor.red; + case 'Green': + return HighlightColor.green; + case 'White': + return HighlightColor.white; + case 'Yellow': + return HighlightColor.yellow; + } + throw Exception('$this is not known in enum HighlightColor'); + } +} + +/// Defines the configuration settings for the horizontal layout. +class HorizontalLayoutConfiguration { + /// Specifies the aspect ratio of all video tiles. + final String? tileAspectRatio; + + /// The maximum number of video tiles to display. + final int? tileCount; + + /// Sets the automatic ordering of the video tiles. + final TileOrder? tileOrder; + + /// Sets the position of horizontal tiles. + final HorizontalTilePosition? tilePosition; + + HorizontalLayoutConfiguration({ + this.tileAspectRatio, + this.tileCount, + this.tileOrder, + this.tilePosition, + }); + + factory HorizontalLayoutConfiguration.fromJson(Map json) { + return HorizontalLayoutConfiguration( + tileAspectRatio: json['TileAspectRatio'] as String?, + tileCount: json['TileCount'] as int?, + tileOrder: (json['TileOrder'] as String?)?.toTileOrder(), + tilePosition: + (json['TilePosition'] as String?)?.toHorizontalTilePosition(), + ); + } + + Map toJson() { + final tileAspectRatio = this.tileAspectRatio; + final tileCount = this.tileCount; + final tileOrder = this.tileOrder; + final tilePosition = this.tilePosition; + return { + if (tileAspectRatio != null) 'TileAspectRatio': tileAspectRatio, + if (tileCount != null) 'TileCount': tileCount, + if (tileOrder != null) 'TileOrder': tileOrder.toValue(), + if (tilePosition != null) 'TilePosition': tilePosition.toValue(), }; } } +enum HorizontalTilePosition { + top, + bottom, +} + +extension HorizontalTilePositionValueExtension on HorizontalTilePosition { + String toValue() { + switch (this) { + case HorizontalTilePosition.top: + return 'Top'; + case HorizontalTilePosition.bottom: + return 'Bottom'; + } + } +} + +extension HorizontalTilePositionFromString on String { + HorizontalTilePosition toHorizontalTilePosition() { + switch (this) { + case 'Top': + return HorizontalTilePosition.top; + case 'Bottom': + return HorizontalTilePosition.bottom; + } + throw Exception('$this is not known in enum HorizontalTilePosition'); + } +} + /// A structure that contains the configuration settings for an issue detection /// task. class IssueDetectionConfiguration { @@ -2519,21 +3473,231 @@ class KinesisDataStreamSinkConfiguration { /// The ARN of the sink. final String? insightsTarget; - KinesisDataStreamSinkConfiguration({ - this.insightsTarget, + KinesisDataStreamSinkConfiguration({ + this.insightsTarget, + }); + + factory KinesisDataStreamSinkConfiguration.fromJson( + Map json) { + return KinesisDataStreamSinkConfiguration( + insightsTarget: json['InsightsTarget'] as String?, + ); + } + + Map toJson() { + final insightsTarget = this.insightsTarget; + return { + if (insightsTarget != null) 'InsightsTarget': insightsTarget, + }; + } +} + +/// The configuration of an Kinesis video stream. +class KinesisVideoStreamConfiguration { + /// The Amazon Web Services Region of the video stream. + final String region; + + /// The amount of time that data is retained. + final int? dataRetentionInHours; + + KinesisVideoStreamConfiguration({ + required this.region, + this.dataRetentionInHours, + }); + + factory KinesisVideoStreamConfiguration.fromJson(Map json) { + return KinesisVideoStreamConfiguration( + region: json['Region'] as String, + dataRetentionInHours: json['DataRetentionInHours'] as int?, + ); + } + + Map toJson() { + final region = this.region; + final dataRetentionInHours = this.dataRetentionInHours; + return { + 'Region': region, + if (dataRetentionInHours != null) + 'DataRetentionInHours': dataRetentionInHours, + }; + } +} + +/// The updated Kinesis video stream configuration object. +class KinesisVideoStreamConfigurationUpdate { + /// The updated time that data is retained. + final int? dataRetentionInHours; + + KinesisVideoStreamConfigurationUpdate({ + this.dataRetentionInHours, + }); + + Map toJson() { + final dataRetentionInHours = this.dataRetentionInHours; + return { + if (dataRetentionInHours != null) + 'DataRetentionInHours': dataRetentionInHours, + }; + } +} + +/// The video stream pool configuration object. +class KinesisVideoStreamPoolConfiguration { + /// The time at which the configuration was created. + final DateTime? createdTimestamp; + + /// The ARN of the video stream pool configuration. + final String? poolArn; + + /// The ID of the video stream pool in the configuration. + final String? poolId; + + /// The name of the video stream pool configuration. + final String? poolName; + + /// The size of the video stream pool in the configuration. + final int? poolSize; + + /// The status of the video stream pool in the configuration. + final KinesisVideoStreamPoolStatus? poolStatus; + + /// The Kinesis video stream pool configuration object. + final KinesisVideoStreamConfiguration? streamConfiguration; + + /// The time at which the configuration was updated. + final DateTime? updatedTimestamp; + + KinesisVideoStreamPoolConfiguration({ + this.createdTimestamp, + this.poolArn, + this.poolId, + this.poolName, + this.poolSize, + this.poolStatus, + this.streamConfiguration, + this.updatedTimestamp, + }); + + factory KinesisVideoStreamPoolConfiguration.fromJson( + Map json) { + return KinesisVideoStreamPoolConfiguration( + createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), + poolArn: json['PoolArn'] as String?, + poolId: json['PoolId'] as String?, + poolName: json['PoolName'] as String?, + poolSize: json['PoolSize'] as int?, + poolStatus: + (json['PoolStatus'] as String?)?.toKinesisVideoStreamPoolStatus(), + streamConfiguration: json['StreamConfiguration'] != null + ? KinesisVideoStreamConfiguration.fromJson( + json['StreamConfiguration'] as Map) + : null, + updatedTimestamp: timeStampFromJson(json['UpdatedTimestamp']), + ); + } + + Map toJson() { + final createdTimestamp = this.createdTimestamp; + final poolArn = this.poolArn; + final poolId = this.poolId; + final poolName = this.poolName; + final poolSize = this.poolSize; + final poolStatus = this.poolStatus; + final streamConfiguration = this.streamConfiguration; + final updatedTimestamp = this.updatedTimestamp; + return { + if (createdTimestamp != null) + 'CreatedTimestamp': iso8601ToJson(createdTimestamp), + if (poolArn != null) 'PoolArn': poolArn, + if (poolId != null) 'PoolId': poolId, + if (poolName != null) 'PoolName': poolName, + if (poolSize != null) 'PoolSize': poolSize, + if (poolStatus != null) 'PoolStatus': poolStatus.toValue(), + if (streamConfiguration != null) + 'StreamConfiguration': streamConfiguration, + if (updatedTimestamp != null) + 'UpdatedTimestamp': iso8601ToJson(updatedTimestamp), + }; + } +} + +enum KinesisVideoStreamPoolStatus { + creating, + active, + updating, + deleting, + failed, +} + +extension KinesisVideoStreamPoolStatusValueExtension + on KinesisVideoStreamPoolStatus { + String toValue() { + switch (this) { + case KinesisVideoStreamPoolStatus.creating: + return 'CREATING'; + case KinesisVideoStreamPoolStatus.active: + return 'ACTIVE'; + case KinesisVideoStreamPoolStatus.updating: + return 'UPDATING'; + case KinesisVideoStreamPoolStatus.deleting: + return 'DELETING'; + case KinesisVideoStreamPoolStatus.failed: + return 'FAILED'; + } + } +} + +extension KinesisVideoStreamPoolStatusFromString on String { + KinesisVideoStreamPoolStatus toKinesisVideoStreamPoolStatus() { + switch (this) { + case 'CREATING': + return KinesisVideoStreamPoolStatus.creating; + case 'ACTIVE': + return KinesisVideoStreamPoolStatus.active; + case 'UPDATING': + return KinesisVideoStreamPoolStatus.updating; + case 'DELETING': + return KinesisVideoStreamPoolStatus.deleting; + case 'FAILED': + return KinesisVideoStreamPoolStatus.failed; + } + throw Exception('$this is not known in enum KinesisVideoStreamPoolStatus'); + } +} + +/// A summary of the Kinesis video stream pool. +class KinesisVideoStreamPoolSummary { + /// The ARN of the video stream pool. + final String? poolArn; + + /// The ID of the video stream pool. + final String? poolId; + + /// The name of the video stream pool. + final String? poolName; + + KinesisVideoStreamPoolSummary({ + this.poolArn, + this.poolId, + this.poolName, }); - factory KinesisDataStreamSinkConfiguration.fromJson( - Map json) { - return KinesisDataStreamSinkConfiguration( - insightsTarget: json['InsightsTarget'] as String?, + factory KinesisVideoStreamPoolSummary.fromJson(Map json) { + return KinesisVideoStreamPoolSummary( + poolArn: json['PoolArn'] as String?, + poolId: json['PoolId'] as String?, + poolName: json['PoolName'] as String?, ); } Map toJson() { - final insightsTarget = this.insightsTarget; + final poolArn = this.poolArn; + final poolId = this.poolId; + final poolName = this.poolName; return { - if (insightsTarget != null) 'InsightsTarget': insightsTarget, + if (poolArn != null) 'PoolArn': poolArn, + if (poolId != null) 'PoolId': poolId, + if (poolName != null) 'PoolName': poolName, }; } } @@ -2627,6 +3791,35 @@ class KinesisVideoStreamSourceRuntimeConfiguration { } } +/// The task configuration settings for the Kinesis video stream source. +class KinesisVideoStreamSourceTaskConfiguration { + /// The channel ID. + final int channelId; + + /// The ARN of the stream. + final String streamArn; + + /// The unique identifier of the fragment to begin processing. + final String? fragmentNumber; + + KinesisVideoStreamSourceTaskConfiguration({ + required this.channelId, + required this.streamArn, + this.fragmentNumber, + }); + + Map toJson() { + final channelId = this.channelId; + final streamArn = this.streamArn; + final fragmentNumber = this.fragmentNumber; + return { + 'ChannelId': channelId, + 'StreamArn': streamArn, + if (fragmentNumber != null) 'FragmentNumber': fragmentNumber, + }; + } +} + /// A structure that contains the configuration settings for an AWS Lambda /// function's data sink. class LambdaFunctionSinkConfiguration { @@ -2748,6 +3941,41 @@ class ListMediaInsightsPipelineConfigurationsResponse { } } +class ListMediaPipelineKinesisVideoStreamPoolsResponse { + /// The list of video stream pools. + final List? kinesisVideoStreamPools; + + /// The token used to return the next page of results. + final String? nextToken; + + ListMediaPipelineKinesisVideoStreamPoolsResponse({ + this.kinesisVideoStreamPools, + this.nextToken, + }); + + factory ListMediaPipelineKinesisVideoStreamPoolsResponse.fromJson( + Map json) { + return ListMediaPipelineKinesisVideoStreamPoolsResponse( + kinesisVideoStreamPools: (json['KinesisVideoStreamPools'] as List?) + ?.whereNotNull() + .map((e) => + KinesisVideoStreamPoolSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final kinesisVideoStreamPools = this.kinesisVideoStreamPools; + final nextToken = this.nextToken; + return { + if (kinesisVideoStreamPools != null) + 'KinesisVideoStreamPools': kinesisVideoStreamPools, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListMediaPipelinesResponse { /// The media pipeline objects in the list. final List? mediaPipelines; @@ -3247,6 +4475,10 @@ class MediaInsightsPipeline { /// The time at which the media insights pipeline was created. final DateTime? createdTimestamp; + /// The statuses that the elements in a media insights pipeline can have during + /// data processing. + final List? elementStatuses; + /// The runtime configuration settings for a Kinesis recording video stream in a /// media insights pipeline. final KinesisVideoStreamRecordingSourceRuntimeConfiguration? @@ -3279,6 +4511,7 @@ class MediaInsightsPipeline { MediaInsightsPipeline({ this.createdTimestamp, + this.elementStatuses, this.kinesisVideoStreamRecordingSourceRuntimeConfiguration, this.kinesisVideoStreamSourceRuntimeConfiguration, this.mediaInsightsPipelineConfigurationArn, @@ -3292,6 +4525,11 @@ class MediaInsightsPipeline { factory MediaInsightsPipeline.fromJson(Map json) { return MediaInsightsPipeline( createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), + elementStatuses: (json['ElementStatuses'] as List?) + ?.whereNotNull() + .map((e) => MediaInsightsPipelineElementStatus.fromJson( + e as Map)) + .toList(), kinesisVideoStreamRecordingSourceRuntimeConfiguration: json['KinesisVideoStreamRecordingSourceRuntimeConfiguration'] != null ? KinesisVideoStreamRecordingSourceRuntimeConfiguration.fromJson( @@ -3323,6 +4561,7 @@ class MediaInsightsPipeline { Map toJson() { final createdTimestamp = this.createdTimestamp; + final elementStatuses = this.elementStatuses; final kinesisVideoStreamRecordingSourceRuntimeConfiguration = this.kinesisVideoStreamRecordingSourceRuntimeConfiguration; final kinesisVideoStreamSourceRuntimeConfiguration = @@ -3338,6 +4577,7 @@ class MediaInsightsPipeline { return { if (createdTimestamp != null) 'CreatedTimestamp': iso8601ToJson(createdTimestamp), + if (elementStatuses != null) 'ElementStatuses': elementStatuses, if (kinesisVideoStreamRecordingSourceRuntimeConfiguration != null) 'KinesisVideoStreamRecordingSourceRuntimeConfiguration': kinesisVideoStreamRecordingSourceRuntimeConfiguration, @@ -3497,6 +4737,10 @@ class MediaInsightsPipelineConfigurationElement { final VoiceAnalyticsProcessorConfiguration? voiceAnalyticsProcessorConfiguration; + /// The configuration settings for voice enhancement sink in a media insights + /// pipeline configuration element. + final VoiceEnhancementSinkConfiguration? voiceEnhancementSinkConfiguration; + MediaInsightsPipelineConfigurationElement({ required this.type, this.amazonTranscribeCallAnalyticsProcessorConfiguration, @@ -3507,6 +4751,7 @@ class MediaInsightsPipelineConfigurationElement { this.snsTopicSinkConfiguration, this.sqsQueueSinkConfiguration, this.voiceAnalyticsProcessorConfiguration, + this.voiceEnhancementSinkConfiguration, }); factory MediaInsightsPipelineConfigurationElement.fromJson( @@ -3556,6 +4801,12 @@ class MediaInsightsPipelineConfigurationElement { json['VoiceAnalyticsProcessorConfiguration'] as Map) : null, + voiceEnhancementSinkConfiguration: + json['VoiceEnhancementSinkConfiguration'] != null + ? VoiceEnhancementSinkConfiguration.fromJson( + json['VoiceEnhancementSinkConfiguration'] + as Map) + : null, ); } @@ -3574,6 +4825,8 @@ class MediaInsightsPipelineConfigurationElement { final sqsQueueSinkConfiguration = this.sqsQueueSinkConfiguration; final voiceAnalyticsProcessorConfiguration = this.voiceAnalyticsProcessorConfiguration; + final voiceEnhancementSinkConfiguration = + this.voiceEnhancementSinkConfiguration; return { 'Type': type.toValue(), if (amazonTranscribeCallAnalyticsProcessorConfiguration != null) @@ -3596,6 +4849,8 @@ class MediaInsightsPipelineConfigurationElement { if (voiceAnalyticsProcessorConfiguration != null) 'VoiceAnalyticsProcessorConfiguration': voiceAnalyticsProcessorConfiguration, + if (voiceEnhancementSinkConfiguration != null) + 'VoiceEnhancementSinkConfiguration': voiceEnhancementSinkConfiguration, }; } } @@ -3609,6 +4864,7 @@ enum MediaInsightsPipelineConfigurationElementType { sqsQueueSink, snsTopicSink, s3RecordingSink, + voiceEnhancementSink, } extension MediaInsightsPipelineConfigurationElementTypeValueExtension @@ -3634,6 +4890,8 @@ extension MediaInsightsPipelineConfigurationElementTypeValueExtension return 'SnsTopicSink'; case MediaInsightsPipelineConfigurationElementType.s3RecordingSink: return 'S3RecordingSink'; + case MediaInsightsPipelineConfigurationElementType.voiceEnhancementSink: + return 'VoiceEnhancementSink'; } } } @@ -3662,6 +4920,9 @@ extension MediaInsightsPipelineConfigurationElementTypeFromString on String { return MediaInsightsPipelineConfigurationElementType.snsTopicSink; case 'S3RecordingSink': return MediaInsightsPipelineConfigurationElementType.s3RecordingSink; + case 'VoiceEnhancementSink': + return MediaInsightsPipelineConfigurationElementType + .voiceEnhancementSink; } throw Exception( '$this is not known in enum MediaInsightsPipelineConfigurationElementType'); @@ -3718,6 +4979,38 @@ class MediaInsightsPipelineConfigurationSummary { } } +/// The status of the pipeline element. +class MediaInsightsPipelineElementStatus { + /// The element's status. + final MediaPipelineElementStatus? status; + + /// The type of status. + final MediaInsightsPipelineConfigurationElementType? type; + + MediaInsightsPipelineElementStatus({ + this.status, + this.type, + }); + + factory MediaInsightsPipelineElementStatus.fromJson( + Map json) { + return MediaInsightsPipelineElementStatus( + status: (json['Status'] as String?)?.toMediaPipelineElementStatus(), + type: (json['Type'] as String?) + ?.toMediaInsightsPipelineConfigurationElementType(), + ); + } + + Map toJson() { + final status = this.status; + final type = this.type; + return { + if (status != null) 'Status': status.toValue(), + if (type != null) 'Type': type.toValue(), + }; + } +} + /// The connector pipeline. class MediaLiveConnectorPipeline { /// The time at which the connector pipeline was created. @@ -3808,11 +5101,15 @@ class MediaPipeline { /// The connector pipeline of the media pipeline. final MediaLiveConnectorPipeline? mediaLiveConnectorPipeline; + /// Designates a media pipeline as a media stream pipeline. + final MediaStreamPipeline? mediaStreamPipeline; + MediaPipeline({ this.mediaCapturePipeline, this.mediaConcatenationPipeline, this.mediaInsightsPipeline, this.mediaLiveConnectorPipeline, + this.mediaStreamPipeline, }); factory MediaPipeline.fromJson(Map json) { @@ -3833,6 +5130,10 @@ class MediaPipeline { ? MediaLiveConnectorPipeline.fromJson( json['MediaLiveConnectorPipeline'] as Map) : null, + mediaStreamPipeline: json['MediaStreamPipeline'] != null + ? MediaStreamPipeline.fromJson( + json['MediaStreamPipeline'] as Map) + : null, ); } @@ -3841,6 +5142,7 @@ class MediaPipeline { final mediaConcatenationPipeline = this.mediaConcatenationPipeline; final mediaInsightsPipeline = this.mediaInsightsPipeline; final mediaLiveConnectorPipeline = this.mediaLiveConnectorPipeline; + final mediaStreamPipeline = this.mediaStreamPipeline; return { if (mediaCapturePipeline != null) 'MediaCapturePipeline': mediaCapturePipeline, @@ -3850,10 +5152,71 @@ class MediaPipeline { 'MediaInsightsPipeline': mediaInsightsPipeline, if (mediaLiveConnectorPipeline != null) 'MediaLiveConnectorPipeline': mediaLiveConnectorPipeline, + if (mediaStreamPipeline != null) + 'MediaStreamPipeline': mediaStreamPipeline, }; } } +enum MediaPipelineElementStatus { + notStarted, + notSupported, + initializing, + inProgress, + failed, + stopping, + stopped, + paused, +} + +extension MediaPipelineElementStatusValueExtension + on MediaPipelineElementStatus { + String toValue() { + switch (this) { + case MediaPipelineElementStatus.notStarted: + return 'NotStarted'; + case MediaPipelineElementStatus.notSupported: + return 'NotSupported'; + case MediaPipelineElementStatus.initializing: + return 'Initializing'; + case MediaPipelineElementStatus.inProgress: + return 'InProgress'; + case MediaPipelineElementStatus.failed: + return 'Failed'; + case MediaPipelineElementStatus.stopping: + return 'Stopping'; + case MediaPipelineElementStatus.stopped: + return 'Stopped'; + case MediaPipelineElementStatus.paused: + return 'Paused'; + } + } +} + +extension MediaPipelineElementStatusFromString on String { + MediaPipelineElementStatus toMediaPipelineElementStatus() { + switch (this) { + case 'NotStarted': + return MediaPipelineElementStatus.notStarted; + case 'NotSupported': + return MediaPipelineElementStatus.notSupported; + case 'Initializing': + return MediaPipelineElementStatus.initializing; + case 'InProgress': + return MediaPipelineElementStatus.inProgress; + case 'Failed': + return MediaPipelineElementStatus.failed; + case 'Stopping': + return MediaPipelineElementStatus.stopping; + case 'Stopped': + return MediaPipelineElementStatus.stopped; + case 'Paused': + return MediaPipelineElementStatus.paused; + } + throw Exception('$this is not known in enum MediaPipelineElementStatus'); + } +} + enum MediaPipelineSinkType { s3Bucket, } @@ -3907,6 +5270,7 @@ enum MediaPipelineStatus { stopping, stopped, paused, + notStarted, } extension MediaPipelineStatusValueExtension on MediaPipelineStatus { @@ -3924,6 +5288,8 @@ extension MediaPipelineStatusValueExtension on MediaPipelineStatus { return 'Stopped'; case MediaPipelineStatus.paused: return 'Paused'; + case MediaPipelineStatus.notStarted: + return 'NotStarted'; } } } @@ -3943,6 +5309,8 @@ extension MediaPipelineStatusFromString on String { return MediaPipelineStatus.stopped; case 'Paused': return MediaPipelineStatus.paused; + case 'NotStarted': + return MediaPipelineStatus.notStarted; } throw Exception('$this is not known in enum MediaPipelineStatus'); } @@ -3953,59 +5321,306 @@ enum MediaPipelineStatusUpdate { resume, } -extension MediaPipelineStatusUpdateValueExtension on MediaPipelineStatusUpdate { +extension MediaPipelineStatusUpdateValueExtension on MediaPipelineStatusUpdate { + String toValue() { + switch (this) { + case MediaPipelineStatusUpdate.pause: + return 'Pause'; + case MediaPipelineStatusUpdate.resume: + return 'Resume'; + } + } +} + +extension MediaPipelineStatusUpdateFromString on String { + MediaPipelineStatusUpdate toMediaPipelineStatusUpdate() { + switch (this) { + case 'Pause': + return MediaPipelineStatusUpdate.pause; + case 'Resume': + return MediaPipelineStatusUpdate.resume; + } + throw Exception('$this is not known in enum MediaPipelineStatusUpdate'); + } +} + +/// The summary of the media pipeline. +class MediaPipelineSummary { + /// The ARN of the media pipeline in the summary. + final String? mediaPipelineArn; + + /// The ID of the media pipeline in the summary. + final String? mediaPipelineId; + + MediaPipelineSummary({ + this.mediaPipelineArn, + this.mediaPipelineId, + }); + + factory MediaPipelineSummary.fromJson(Map json) { + return MediaPipelineSummary( + mediaPipelineArn: json['MediaPipelineArn'] as String?, + mediaPipelineId: json['MediaPipelineId'] as String?, + ); + } + + Map toJson() { + final mediaPipelineArn = this.mediaPipelineArn; + final mediaPipelineId = this.mediaPipelineId; + return { + if (mediaPipelineArn != null) 'MediaPipelineArn': mediaPipelineArn, + if (mediaPipelineId != null) 'MediaPipelineId': mediaPipelineId, + }; + } +} + +enum MediaPipelineTaskStatus { + notStarted, + initializing, + inProgress, + failed, + stopping, + stopped, +} + +extension MediaPipelineTaskStatusValueExtension on MediaPipelineTaskStatus { + String toValue() { + switch (this) { + case MediaPipelineTaskStatus.notStarted: + return 'NotStarted'; + case MediaPipelineTaskStatus.initializing: + return 'Initializing'; + case MediaPipelineTaskStatus.inProgress: + return 'InProgress'; + case MediaPipelineTaskStatus.failed: + return 'Failed'; + case MediaPipelineTaskStatus.stopping: + return 'Stopping'; + case MediaPipelineTaskStatus.stopped: + return 'Stopped'; + } + } +} + +extension MediaPipelineTaskStatusFromString on String { + MediaPipelineTaskStatus toMediaPipelineTaskStatus() { + switch (this) { + case 'NotStarted': + return MediaPipelineTaskStatus.notStarted; + case 'Initializing': + return MediaPipelineTaskStatus.initializing; + case 'InProgress': + return MediaPipelineTaskStatus.inProgress; + case 'Failed': + return MediaPipelineTaskStatus.failed; + case 'Stopping': + return MediaPipelineTaskStatus.stopping; + case 'Stopped': + return MediaPipelineTaskStatus.stopped; + } + throw Exception('$this is not known in enum MediaPipelineTaskStatus'); + } +} + +/// Structure that contains the settings for a media stream pipeline. +class MediaStreamPipeline { + /// The time at which the media stream pipeline was created. + final DateTime? createdTimestamp; + + /// The ARN of the media stream pipeline. + final String? mediaPipelineArn; + + /// The ID of the media stream pipeline + final String? mediaPipelineId; + + /// The media stream pipeline's data sinks. + final List? sinks; + + /// The media stream pipeline's data sources. + final List? sources; + + /// The status of the media stream pipeline. + final MediaPipelineStatus? status; + + /// The time at which the media stream pipeline was updated. + final DateTime? updatedTimestamp; + + MediaStreamPipeline({ + this.createdTimestamp, + this.mediaPipelineArn, + this.mediaPipelineId, + this.sinks, + this.sources, + this.status, + this.updatedTimestamp, + }); + + factory MediaStreamPipeline.fromJson(Map json) { + return MediaStreamPipeline( + createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), + mediaPipelineArn: json['MediaPipelineArn'] as String?, + mediaPipelineId: json['MediaPipelineId'] as String?, + sinks: (json['Sinks'] as List?) + ?.whereNotNull() + .map((e) => MediaStreamSink.fromJson(e as Map)) + .toList(), + sources: (json['Sources'] as List?) + ?.whereNotNull() + .map((e) => MediaStreamSource.fromJson(e as Map)) + .toList(), + status: (json['Status'] as String?)?.toMediaPipelineStatus(), + updatedTimestamp: timeStampFromJson(json['UpdatedTimestamp']), + ); + } + + Map toJson() { + final createdTimestamp = this.createdTimestamp; + final mediaPipelineArn = this.mediaPipelineArn; + final mediaPipelineId = this.mediaPipelineId; + final sinks = this.sinks; + final sources = this.sources; + final status = this.status; + final updatedTimestamp = this.updatedTimestamp; + return { + if (createdTimestamp != null) + 'CreatedTimestamp': iso8601ToJson(createdTimestamp), + if (mediaPipelineArn != null) 'MediaPipelineArn': mediaPipelineArn, + if (mediaPipelineId != null) 'MediaPipelineId': mediaPipelineId, + if (sinks != null) 'Sinks': sinks, + if (sources != null) 'Sources': sources, + if (status != null) 'Status': status.toValue(), + if (updatedTimestamp != null) + 'UpdatedTimestamp': iso8601ToJson(updatedTimestamp), + }; + } +} + +enum MediaStreamPipelineSinkType { + kinesisVideoStreamPool, +} + +extension MediaStreamPipelineSinkTypeValueExtension + on MediaStreamPipelineSinkType { String toValue() { switch (this) { - case MediaPipelineStatusUpdate.pause: - return 'Pause'; - case MediaPipelineStatusUpdate.resume: - return 'Resume'; + case MediaStreamPipelineSinkType.kinesisVideoStreamPool: + return 'KinesisVideoStreamPool'; } } } -extension MediaPipelineStatusUpdateFromString on String { - MediaPipelineStatusUpdate toMediaPipelineStatusUpdate() { +extension MediaStreamPipelineSinkTypeFromString on String { + MediaStreamPipelineSinkType toMediaStreamPipelineSinkType() { switch (this) { - case 'Pause': - return MediaPipelineStatusUpdate.pause; - case 'Resume': - return MediaPipelineStatusUpdate.resume; + case 'KinesisVideoStreamPool': + return MediaStreamPipelineSinkType.kinesisVideoStreamPool; } - throw Exception('$this is not known in enum MediaPipelineStatusUpdate'); + throw Exception('$this is not known in enum MediaStreamPipelineSinkType'); } } -/// The summary of the media pipeline. -class MediaPipelineSummary { - /// The ARN of the media pipeline in the summary. - final String? mediaPipelineArn; +/// Structure that contains the settings for a media stream sink. +class MediaStreamSink { + /// The media stream sink's media stream type. + final MediaStreamType mediaStreamType; - /// The ID of the media pipeline in the summary. - final String? mediaPipelineId; + /// Specifies the number of streams that the sink can accept. + final int reservedStreamCapacity; - MediaPipelineSummary({ - this.mediaPipelineArn, - this.mediaPipelineId, + /// The ARN of the media stream sink. + final String sinkArn; + + /// The media stream sink's type. + final MediaStreamPipelineSinkType sinkType; + + MediaStreamSink({ + required this.mediaStreamType, + required this.reservedStreamCapacity, + required this.sinkArn, + required this.sinkType, }); - factory MediaPipelineSummary.fromJson(Map json) { - return MediaPipelineSummary( - mediaPipelineArn: json['MediaPipelineArn'] as String?, - mediaPipelineId: json['MediaPipelineId'] as String?, + factory MediaStreamSink.fromJson(Map json) { + return MediaStreamSink( + mediaStreamType: (json['MediaStreamType'] as String).toMediaStreamType(), + reservedStreamCapacity: json['ReservedStreamCapacity'] as int, + sinkArn: json['SinkArn'] as String, + sinkType: (json['SinkType'] as String).toMediaStreamPipelineSinkType(), ); } Map toJson() { - final mediaPipelineArn = this.mediaPipelineArn; - final mediaPipelineId = this.mediaPipelineId; + final mediaStreamType = this.mediaStreamType; + final reservedStreamCapacity = this.reservedStreamCapacity; + final sinkArn = this.sinkArn; + final sinkType = this.sinkType; return { - if (mediaPipelineArn != null) 'MediaPipelineArn': mediaPipelineArn, - if (mediaPipelineId != null) 'MediaPipelineId': mediaPipelineId, + 'MediaStreamType': mediaStreamType.toValue(), + 'ReservedStreamCapacity': reservedStreamCapacity, + 'SinkArn': sinkArn, + 'SinkType': sinkType.toValue(), + }; + } +} + +/// Structure that contains the settings for media stream sources. +class MediaStreamSource { + /// The ARN of the media stream source. + final String sourceArn; + + /// The type of media stream source. + final MediaPipelineSourceType sourceType; + + MediaStreamSource({ + required this.sourceArn, + required this.sourceType, + }); + + factory MediaStreamSource.fromJson(Map json) { + return MediaStreamSource( + sourceArn: json['SourceArn'] as String, + sourceType: (json['SourceType'] as String).toMediaPipelineSourceType(), + ); + } + + Map toJson() { + final sourceArn = this.sourceArn; + final sourceType = this.sourceType; + return { + 'SourceArn': sourceArn, + 'SourceType': sourceType.toValue(), }; } } +enum MediaStreamType { + mixedAudio, + individualAudio, +} + +extension MediaStreamTypeValueExtension on MediaStreamType { + String toValue() { + switch (this) { + case MediaStreamType.mixedAudio: + return 'MixedAudio'; + case MediaStreamType.individualAudio: + return 'IndividualAudio'; + } + } +} + +extension MediaStreamTypeFromString on String { + MediaStreamType toMediaStreamType() { + switch (this) { + case 'MixedAudio': + return MediaStreamType.mixedAudio; + case 'IndividualAudio': + return MediaStreamType.individualAudio; + } + throw Exception('$this is not known in enum MediaStreamType'); + } +} + /// The configuration object for an event concatenation pipeline. class MeetingEventsConcatenationConfiguration { /// Enables or disables the configuration object. @@ -4660,6 +6275,56 @@ class SourceConfiguration { } } +/// A representation of an asynchronous request to perform speaker search +/// analysis on a media insights pipeline. +class SpeakerSearchTask { + /// The time at which a speaker search task was created. + final DateTime? createdTimestamp; + + /// The speaker search task ID. + final String? speakerSearchTaskId; + + /// The status of the speaker search task. + final MediaPipelineTaskStatus? speakerSearchTaskStatus; + + /// The time at which a speaker search task was updated. + final DateTime? updatedTimestamp; + + SpeakerSearchTask({ + this.createdTimestamp, + this.speakerSearchTaskId, + this.speakerSearchTaskStatus, + this.updatedTimestamp, + }); + + factory SpeakerSearchTask.fromJson(Map json) { + return SpeakerSearchTask( + createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), + speakerSearchTaskId: json['SpeakerSearchTaskId'] as String?, + speakerSearchTaskStatus: (json['SpeakerSearchTaskStatus'] as String?) + ?.toMediaPipelineTaskStatus(), + updatedTimestamp: timeStampFromJson(json['UpdatedTimestamp']), + ); + } + + Map toJson() { + final createdTimestamp = this.createdTimestamp; + final speakerSearchTaskId = this.speakerSearchTaskId; + final speakerSearchTaskStatus = this.speakerSearchTaskStatus; + final updatedTimestamp = this.updatedTimestamp; + return { + if (createdTimestamp != null) + 'CreatedTimestamp': iso8601ToJson(createdTimestamp), + if (speakerSearchTaskId != null) + 'SpeakerSearchTaskId': speakerSearchTaskId, + if (speakerSearchTaskStatus != null) + 'SpeakerSearchTaskStatus': speakerSearchTaskStatus.toValue(), + if (updatedTimestamp != null) + 'UpdatedTimestamp': iso8601ToJson(updatedTimestamp), + }; + } +} + /// The configuration settings for the SQS sink. class SqsQueueSinkConfiguration { /// The ARN of the SQS sink. @@ -4683,6 +6348,58 @@ class SqsQueueSinkConfiguration { } } +class StartSpeakerSearchTaskResponse { + /// The details of the speaker search task. + final SpeakerSearchTask? speakerSearchTask; + + StartSpeakerSearchTaskResponse({ + this.speakerSearchTask, + }); + + factory StartSpeakerSearchTaskResponse.fromJson(Map json) { + return StartSpeakerSearchTaskResponse( + speakerSearchTask: json['SpeakerSearchTask'] != null + ? SpeakerSearchTask.fromJson( + json['SpeakerSearchTask'] as Map) + : null, + ); + } + + Map toJson() { + final speakerSearchTask = this.speakerSearchTask; + return { + if (speakerSearchTask != null) 'SpeakerSearchTask': speakerSearchTask, + }; + } +} + +class StartVoiceToneAnalysisTaskResponse { + /// The details of the voice tone analysis task. + final VoiceToneAnalysisTask? voiceToneAnalysisTask; + + StartVoiceToneAnalysisTaskResponse({ + this.voiceToneAnalysisTask, + }); + + factory StartVoiceToneAnalysisTaskResponse.fromJson( + Map json) { + return StartVoiceToneAnalysisTaskResponse( + voiceToneAnalysisTask: json['VoiceToneAnalysisTask'] != null + ? VoiceToneAnalysisTask.fromJson( + json['VoiceToneAnalysisTask'] as Map) + : null, + ); + } + + Map toJson() { + final voiceToneAnalysisTask = this.voiceToneAnalysisTask; + return { + if (voiceToneAnalysisTask != null) + 'VoiceToneAnalysisTask': voiceToneAnalysisTask, + }; + } +} + /// Defines a streaming channel. class StreamChannelDefinition { /// The number of channels in a streaming channel. @@ -4796,6 +6513,34 @@ class TagResourceResponse { } } +enum TileOrder { + joinSequence, + speakerSequence, +} + +extension TileOrderValueExtension on TileOrder { + String toValue() { + switch (this) { + case TileOrder.joinSequence: + return 'JoinSequence'; + case TileOrder.speakerSequence: + return 'SpeakerSequence'; + } + } +} + +extension TileOrderFromString on String { + TileOrder toTileOrder() { + switch (this) { + case 'JoinSequence': + return TileOrder.joinSequence; + case 'SpeakerSequence': + return TileOrder.speakerSequence; + } + throw Exception('$this is not known in enum TileOrder'); + } +} + /// The range of timestamps to return. class TimestampRange { /// The ending timestamp for the specified range. @@ -4895,6 +6640,110 @@ class UpdateMediaInsightsPipelineConfigurationResponse { } } +class UpdateMediaPipelineKinesisVideoStreamPoolResponse { + /// The video stream pool configuration object. + final KinesisVideoStreamPoolConfiguration? + kinesisVideoStreamPoolConfiguration; + + UpdateMediaPipelineKinesisVideoStreamPoolResponse({ + this.kinesisVideoStreamPoolConfiguration, + }); + + factory UpdateMediaPipelineKinesisVideoStreamPoolResponse.fromJson( + Map json) { + return UpdateMediaPipelineKinesisVideoStreamPoolResponse( + kinesisVideoStreamPoolConfiguration: + json['KinesisVideoStreamPoolConfiguration'] != null + ? KinesisVideoStreamPoolConfiguration.fromJson( + json['KinesisVideoStreamPoolConfiguration'] + as Map) + : null, + ); + } + + Map toJson() { + final kinesisVideoStreamPoolConfiguration = + this.kinesisVideoStreamPoolConfiguration; + return { + if (kinesisVideoStreamPoolConfiguration != null) + 'KinesisVideoStreamPoolConfiguration': + kinesisVideoStreamPoolConfiguration, + }; + } +} + +/// Defines the configuration settings for a vertical layout. +class VerticalLayoutConfiguration { + /// Sets the aspect ratio of the video tiles, such as 16:9. + final String? tileAspectRatio; + + /// The maximum number of tiles to display. + final int? tileCount; + + /// Sets the automatic ordering of the video tiles. + final TileOrder? tileOrder; + + /// Sets the position of vertical tiles. + final VerticalTilePosition? tilePosition; + + VerticalLayoutConfiguration({ + this.tileAspectRatio, + this.tileCount, + this.tileOrder, + this.tilePosition, + }); + + factory VerticalLayoutConfiguration.fromJson(Map json) { + return VerticalLayoutConfiguration( + tileAspectRatio: json['TileAspectRatio'] as String?, + tileCount: json['TileCount'] as int?, + tileOrder: (json['TileOrder'] as String?)?.toTileOrder(), + tilePosition: (json['TilePosition'] as String?)?.toVerticalTilePosition(), + ); + } + + Map toJson() { + final tileAspectRatio = this.tileAspectRatio; + final tileCount = this.tileCount; + final tileOrder = this.tileOrder; + final tilePosition = this.tilePosition; + return { + if (tileAspectRatio != null) 'TileAspectRatio': tileAspectRatio, + if (tileCount != null) 'TileCount': tileCount, + if (tileOrder != null) 'TileOrder': tileOrder.toValue(), + if (tilePosition != null) 'TilePosition': tilePosition.toValue(), + }; + } +} + +enum VerticalTilePosition { + left, + right, +} + +extension VerticalTilePositionValueExtension on VerticalTilePosition { + String toValue() { + switch (this) { + case VerticalTilePosition.left: + return 'Left'; + case VerticalTilePosition.right: + return 'Right'; + } + } +} + +extension VerticalTilePositionFromString on String { + VerticalTilePosition toVerticalTilePosition() { + switch (this) { + case 'Left': + return VerticalTilePosition.left; + case 'Right': + return VerticalTilePosition.right; + } + throw Exception('$this is not known in enum VerticalTilePosition'); + } +} + /// The video artifact configuration object. class VideoArtifactsConfiguration { /// Indicates whether the video artifact is enabled or disabled. @@ -4925,6 +6774,50 @@ class VideoArtifactsConfiguration { } } +/// Defines the settings for a video tile. +class VideoAttribute { + /// Defines the border color of all video tiles. + final BorderColor? borderColor; + + /// Defines the border thickness for all video tiles. + final int? borderThickness; + + /// Sets the corner radius of all video tiles. + final int? cornerRadius; + + /// Defines the highlight color for the active video tile. + final HighlightColor? highlightColor; + + VideoAttribute({ + this.borderColor, + this.borderThickness, + this.cornerRadius, + this.highlightColor, + }); + + factory VideoAttribute.fromJson(Map json) { + return VideoAttribute( + borderColor: (json['BorderColor'] as String?)?.toBorderColor(), + borderThickness: json['BorderThickness'] as int?, + cornerRadius: json['CornerRadius'] as int?, + highlightColor: (json['HighlightColor'] as String?)?.toHighlightColor(), + ); + } + + Map toJson() { + final borderColor = this.borderColor; + final borderThickness = this.borderThickness; + final cornerRadius = this.cornerRadius; + final highlightColor = this.highlightColor; + return { + if (borderColor != null) 'BorderColor': borderColor.toValue(), + if (borderThickness != null) 'BorderThickness': borderThickness, + if (cornerRadius != null) 'CornerRadius': cornerRadius, + if (highlightColor != null) 'HighlightColor': highlightColor.toValue(), + }; + } +} + /// The configuration object of a video concatenation pipeline. class VideoConcatenationConfiguration { /// Enables or disables the configuration object. @@ -5034,6 +6927,30 @@ extension VoiceAnalyticsConfigurationStatusFromString on String { } } +enum VoiceAnalyticsLanguageCode { + enUs, +} + +extension VoiceAnalyticsLanguageCodeValueExtension + on VoiceAnalyticsLanguageCode { + String toValue() { + switch (this) { + case VoiceAnalyticsLanguageCode.enUs: + return 'en-US'; + } + } +} + +extension VoiceAnalyticsLanguageCodeFromString on String { + VoiceAnalyticsLanguageCode toVoiceAnalyticsLanguageCode() { + switch (this) { + case 'en-US': + return VoiceAnalyticsLanguageCode.enUs; + } + throw Exception('$this is not known in enum VoiceAnalyticsLanguageCode'); + } +} + /// The configuration settings for a voice analytics processor. class VoiceAnalyticsProcessorConfiguration { /// The status of the speaker search task. @@ -5069,6 +6986,82 @@ class VoiceAnalyticsProcessorConfiguration { } } +/// A static structure that contains the configuration data for a +/// VoiceEnhancementSinkConfiguration element. +class VoiceEnhancementSinkConfiguration { + /// Disables the VoiceEnhancementSinkConfiguration element. + final bool? disabled; + + VoiceEnhancementSinkConfiguration({ + this.disabled, + }); + + factory VoiceEnhancementSinkConfiguration.fromJson( + Map json) { + return VoiceEnhancementSinkConfiguration( + disabled: json['Disabled'] as bool?, + ); + } + + Map toJson() { + final disabled = this.disabled; + return { + if (disabled != null) 'Disabled': disabled, + }; + } +} + +/// A representation of an asynchronous request to perform voice tone analysis +/// on a media insights pipeline. +class VoiceToneAnalysisTask { + /// The time at which a voice tone analysis task was created. + final DateTime? createdTimestamp; + + /// The time at which a voice tone analysis task was updated. + final DateTime? updatedTimestamp; + + /// The ID of the voice tone analysis task. + final String? voiceToneAnalysisTaskId; + + /// The status of a voice tone analysis task. + final MediaPipelineTaskStatus? voiceToneAnalysisTaskStatus; + + VoiceToneAnalysisTask({ + this.createdTimestamp, + this.updatedTimestamp, + this.voiceToneAnalysisTaskId, + this.voiceToneAnalysisTaskStatus, + }); + + factory VoiceToneAnalysisTask.fromJson(Map json) { + return VoiceToneAnalysisTask( + createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), + updatedTimestamp: timeStampFromJson(json['UpdatedTimestamp']), + voiceToneAnalysisTaskId: json['VoiceToneAnalysisTaskId'] as String?, + voiceToneAnalysisTaskStatus: + (json['VoiceToneAnalysisTaskStatus'] as String?) + ?.toMediaPipelineTaskStatus(), + ); + } + + Map toJson() { + final createdTimestamp = this.createdTimestamp; + final updatedTimestamp = this.updatedTimestamp; + final voiceToneAnalysisTaskId = this.voiceToneAnalysisTaskId; + final voiceToneAnalysisTaskStatus = this.voiceToneAnalysisTaskStatus; + return { + if (createdTimestamp != null) + 'CreatedTimestamp': iso8601ToJson(createdTimestamp), + if (updatedTimestamp != null) + 'UpdatedTimestamp': iso8601ToJson(updatedTimestamp), + if (voiceToneAnalysisTaskId != null) + 'VoiceToneAnalysisTaskId': voiceToneAnalysisTaskId, + if (voiceToneAnalysisTaskStatus != null) + 'VoiceToneAnalysisTaskStatus': voiceToneAnalysisTaskStatus.toValue(), + }; + } +} + class BadRequestException extends _s.GenericAwsException { BadRequestException({String? type, String? message}) : super(type: type, code: 'BadRequestException', message: message); diff --git a/aws_client/lib/src/generated/chime_sdk_meetings/v2021_07_15.dart b/aws_client/lib/src/generated/chime_sdk_meetings/v2021_07_15.dart index 0ad98a824..a0d2d2ab8 100644 --- a/aws_client/lib/src/generated/chime_sdk_meetings/v2021_07_15.dart +++ b/aws_client/lib/src/generated/chime_sdk_meetings/v2021_07_15.dart @@ -20,9 +20,9 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; /// The Amazon Chime SDK meetings APIs in this section allow software developers -/// to create Amazon Chime SDK meetings, set the AWS Regions for meetings, -/// create and manage users, and send and receive meeting notifications. For -/// more information about the meeting APIs, see Amazon /// Chime SDK meetings. class ChimeSdkMeetings { @@ -102,6 +102,20 @@ class ChimeSdkMeetings { /// ///
        ///
      • + /// If you specify MeetingFeatures:Video:MaxResolution:None when + /// you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Video will be rejected with + /// ValidationError 400. + ///
      • + ///
      • + /// If you specify MeetingFeatures:Content:MaxResolution:None + /// when you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Content will be rejected with + /// ValidationError 400. + ///
      • + ///
      • /// You can't set content capabilities to /// SendReceive or Receive unless you also set /// video capabilities to SendReceive or @@ -132,6 +146,8 @@ class ChimeSdkMeetings { /// May throw [NotFoundException]. /// May throw [ForbiddenException]. /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// May throw [ThrottlingException]. /// /// Parameter [capabilities] : /// The capabilities (audio, video, or @@ -202,6 +218,20 @@ class ChimeSdkMeetings { /// ///
          ///
        • + /// If you specify MeetingFeatures:Video:MaxResolution:None when + /// you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Video will be rejected with + /// ValidationError 400. + ///
        • + ///
        • + /// If you specify MeetingFeatures:Content:MaxResolution:None + /// when you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Content will be rejected with + /// ValidationError 400. + ///
        • + ///
        • /// You can't set content capabilities to /// SendReceive or Receive unless you also set /// video capabilities to SendReceive or @@ -253,6 +283,7 @@ class ChimeSdkMeetings { /// the Amazon Chime SDK in the Amazon Chime Developer Guide. /// /// May throw [BadRequestException]. + /// May throw [ConflictException]. /// May throw [ForbiddenException]. /// May throw [UnauthorizedException]. /// May throw [ThrottlingException]. @@ -280,8 +311,8 @@ class ChimeSdkMeetings { /// us-east-1, us-east-2, us-west-1, /// us-west-2. /// - /// Available values in AWS GovCloud (US) Regions: us-gov-east-1, - /// us-gov-west-1. + /// Available values in Amazon Web Services GovCloud (US) Regions: + /// us-gov-east-1, us-gov-west-1. /// /// Parameter [clientRequestToken] : /// The unique identifier for the client request. Use a different token for @@ -322,8 +353,8 @@ class ChimeSdkMeetings { /// Naming and Usage Conventions in the AWS General Reference. ///
        • ///
        • - /// You can only tag resources that are located in the specified AWS Region - /// for the AWS account. + /// You can only tag resources that are located in the specified Amazon Web + /// Services Region for the Amazon Web Services account. ///
        • ///
        • /// To add tags to a resource, you need the necessary permissions for the @@ -399,6 +430,7 @@ class ChimeSdkMeetings { /// the Amazon Chime SDK in the Amazon Chime Developer Guide. /// /// May throw [BadRequestException]. + /// May throw [ConflictException]. /// May throw [ForbiddenException]. /// May throw [UnauthorizedException]. /// May throw [ThrottlingException]. @@ -429,8 +461,8 @@ class ChimeSdkMeetings { /// us-east-1, us-east-2, us-west-1, /// us-west-2. /// - /// Available values in AWS GovCloud (US) Regions: us-gov-east-1, - /// us-gov-west-1. + /// Available values in Amazon Web Services GovCloud (US) Regions: + /// us-gov-east-1, us-gov-west-1. /// /// Parameter [clientRequestToken] : /// The unique identifier for the client request. Use a different token for @@ -658,6 +690,13 @@ class ChimeSdkMeetings { /// Returns a list of the tags available for the specified resource. /// + /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedException]. + /// May throw [LimitExceededException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// May throw [ThrottlingException]. /// May throw [ResourceNotFoundException]. /// /// Parameter [resourceARN] : @@ -691,13 +730,21 @@ class ChimeSdkMeetings { /// the StartStreamTranscription /// API in the Amazon Transcribe Developer Guide. - /// - /// Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use - /// of Amazon Transcribe is subject to the AWS Service Terms, - /// including the terms specific to the AWS Machine Learning and Artificial - /// Intelligence Services. - /// + /// + /// By default, Amazon Transcribe may use and store audio content processed by + /// the service to develop and improve Amazon Web Services AI/ML services as + /// further described in section 50 of the Amazon Web Services Service + /// Terms. Using Amazon Transcribe may be subject to federal and state + /// laws or regulations regarding the recording or interception of electronic + /// communications. It is your and your end users’ responsibility to comply + /// with all applicable laws regarding the recording, including properly + /// notifying all participants in a recorded session or communication that the + /// session or communication is being recorded, and obtaining all necessary + /// consents. You can opt out from Amazon Web Services using audio content to + /// develop and improve AWS AI/ML services by configuring an AI services opt + /// out policy using Amazon Web Services Organizations. + /// /// /// May throw [NotFoundException]. /// May throw [ForbiddenException]. @@ -738,11 +785,19 @@ class ChimeSdkMeetings { /// Using Amazon Chime SDK live transcription in the Amazon Chime SDK /// Developer Guide. /// - /// Amazon Chime SDK live transcription is powered by Amazon Transcribe. Use - /// of Amazon Transcribe is subject to the AWS Service Terms, - /// including the terms specific to the AWS Machine Learning and Artificial - /// Intelligence Services. + /// By default, Amazon Transcribe may use and store audio content processed by + /// the service to develop and improve Amazon Web Services AI/ML services as + /// further described in section 50 of the Amazon Web Services Service + /// Terms. Using Amazon Transcribe may be subject to federal and state + /// laws or regulations regarding the recording or interception of electronic + /// communications. It is your and your end users’ responsibility to comply + /// with all applicable laws regarding the recording, including properly + /// notifying all participants in a recorded session or communication that the + /// session or communication is being recorded, and obtaining all necessary + /// consents. You can opt out from Amazon Web Services using audio content to + /// develop and improve Amazon Web Services AI/ML services by configuring an + /// AI services opt out policy using Amazon Web Services Organizations. /// /// /// May throw [ForbiddenException]. @@ -771,6 +826,12 @@ class ChimeSdkMeetings { /// The resource that supports tags. /// /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedException]. + /// May throw [LimitExceededException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// May throw [ThrottlingException]. /// May throw [ResourceNotFoundException]. /// May throw [TooManyTagsException]. /// @@ -808,8 +869,8 @@ class ChimeSdkMeetings { /// resource you want to untag. ///
        • ///
        • - /// You can only tag resources that are located in the specified AWS Region - /// for the calling AWS account. + /// You can only tag resources that are located in the specified Amazon Web + /// Services Region for the calling Amazon Web Services account. ///
        • ///
        /// Minimum permissions @@ -825,6 +886,12 @@ class ChimeSdkMeetings { /// ChimeSDKMeetings:DeleteTags /// /// May throw [BadRequestException]. + /// May throw [ForbiddenException]. + /// May throw [UnauthorizedException]. + /// May throw [LimitExceededException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// May throw [ThrottlingException]. /// May throw [ResourceNotFoundException]. /// /// Parameter [resourceARN] : @@ -858,6 +925,20 @@ class ChimeSdkMeetings { /// ///
          ///
        • + /// If you specify MeetingFeatures:Video:MaxResolution:None when + /// you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Video will be rejected with + /// ValidationError 400. + ///
        • + ///
        • + /// If you specify MeetingFeatures:Content:MaxResolution:None + /// when you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Content will be rejected with + /// ValidationError 400. + ///
        • + ///
        • /// You can't set content capabilities to /// SendReceive or Receive unless you also set /// video capabilities to SendReceive or @@ -888,6 +969,8 @@ class ChimeSdkMeetings { /// May throw [NotFoundException]. /// May throw [ForbiddenException]. /// May throw [ServiceUnavailableException]. + /// May throw [ServiceFailureException]. + /// May throw [ThrottlingException]. /// /// Parameter [attendeeId] : /// The ID of the attendee associated with the update request. @@ -940,6 +1023,20 @@ class Attendee { /// ///
            ///
          • + /// If you specify MeetingFeatures:Video:MaxResolution:None when + /// you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Video will be rejected with + /// ValidationError 400. + ///
          • + ///
          • + /// If you specify MeetingFeatures:Content:MaxResolution:None when + /// you create a meeting, all API requests that include + /// SendReceive, Send, or Receive for + /// AttendeeCapabilities:Content will be rejected with + /// ValidationError 400. + ///
          • + ///
          • /// You can't set content capabilities to SendReceive /// or Receive unless you also set video capabilities /// to SendReceive or Receive. If you don't set the @@ -1013,12 +1110,26 @@ class Attendee { /// /// You use the capabilities with a set of values that control what the /// capabilities can do, such as SendReceive data. For more -/// information about those values, see . +/// information, refer to and . /// /// When using capabilities, be aware of these corner cases: /// ///
              ///
            • +/// If you specify MeetingFeatures:Video:MaxResolution:None when +/// you create a meeting, all API requests that include +/// SendReceive, Send, or Receive for +/// AttendeeCapabilities:Video will be rejected with +/// ValidationError 400. +///
            • +///
            • +/// If you specify MeetingFeatures:Content:MaxResolution:None when +/// you create a meeting, all API requests that include +/// SendReceive, Send, or Receive for +/// AttendeeCapabilities:Content will be rejected with +/// ValidationError 400. +///
            • +///
            • /// You can't set content capabilities to SendReceive /// or Receive unless you also set video capabilities /// to SendReceive or Receive. If you don't set the @@ -1030,15 +1141,15 @@ class Attendee { ///
            • /// When you change an audio capability from None or /// Receive to Send or SendReceive , and -/// if the attendee left their microphone unmuted, audio will flow from the -/// attendee to the other meeting participants. +/// an attendee unmutes their microphone, audio flows from the attendee to the +/// other meeting participants. ///
            • ///
            • /// When you change a video or content capability from /// None or Receive to Send or -/// SendReceive , and if the attendee turned on their video or -/// content streams, remote attendees can receive those streams, but only after -/// media renegotiation between the client and the Amazon Chime back-end server. +/// SendReceive , and the attendee turns on their video or content +/// streams, remote attendees can receive those streams, but only after media +/// renegotiation between the client and the Amazon Chime back-end server. ///
            • ///
            class AttendeeCapabilities { @@ -1077,6 +1188,36 @@ class AttendeeCapabilities { } } +/// Lists the maximum number of attendees allowed into the meeting. +/// +/// If you specify FHD for +/// MeetingFeatures:Video:MaxResolution, or if you specify +/// UHD for MeetingFeatures:Content:MaxResolution, the +/// maximum number of attendees changes from the default of 250 to +/// 25. +/// +class AttendeeFeatures { + /// The maximum number of attendees allowed into the meeting. + final int? maxCount; + + AttendeeFeatures({ + this.maxCount, + }); + + factory AttendeeFeatures.fromJson(Map json) { + return AttendeeFeatures( + maxCount: json['MaxCount'] as int?, + ); + } + + Map toJson() { + final maxCount = this.maxCount; + return { + if (maxCount != null) 'MaxCount': maxCount, + }; + } +} + /// A structure that contains one or more attendee IDs. class AttendeeIdItem { /// A list of one or more attendee IDs. @@ -1155,6 +1296,75 @@ class BatchCreateAttendeeResponse { } } +/// Lists the content (screen share) features for the meeting. Applies to all +/// attendees. +/// +/// If you specify MeetingFeatures:Content:MaxResolution:None when +/// you create a meeting, all API requests that include +/// SendReceive, Send, or Receive for +/// AttendeeCapabilities:Content will be rejected with +/// ValidationError 400. +/// +class ContentFeatures { + /// The maximum resolution for the meeting content. + /// + /// Defaults to FHD. To use UHD, you must also provide + /// a MeetingFeatures:Attendee:MaxCount value and override the + /// default size limit of 250 attendees. + /// + final ContentResolution? maxResolution; + + ContentFeatures({ + this.maxResolution, + }); + + factory ContentFeatures.fromJson(Map json) { + return ContentFeatures( + maxResolution: (json['MaxResolution'] as String?)?.toContentResolution(), + ); + } + + Map toJson() { + final maxResolution = this.maxResolution; + return { + if (maxResolution != null) 'MaxResolution': maxResolution.toValue(), + }; + } +} + +enum ContentResolution { + none, + fhd, + uhd, +} + +extension ContentResolutionValueExtension on ContentResolution { + String toValue() { + switch (this) { + case ContentResolution.none: + return 'None'; + case ContentResolution.fhd: + return 'FHD'; + case ContentResolution.uhd: + return 'UHD'; + } + } +} + +extension ContentResolutionFromString on String { + ContentResolution toContentResolution() { + switch (this) { + case 'None': + return ContentResolution.none; + case 'FHD': + return ContentResolution.fhd; + case 'UHD': + return ContentResolution.uhd; + } + throw Exception('$this is not known in enum ContentResolution'); + } +} + /// The list of errors returned when errors are encountered during the /// BatchCreateAttendee and CreateAttendee actions. This includes external user /// IDs, error codes, and error messages. @@ -1341,8 +1551,8 @@ class EngineTranscribeMedicalSettings { /// in the transcription output. final TranscribeMedicalContentIdentificationType? contentIdentificationType; - /// The AWS Region passed to Amazon Transcribe Medical. If you don't specify a - /// Region, Amazon Chime uses the meeting's Region. + /// The Amazon Web Services Region passed to Amazon Transcribe Medical. If you + /// don't specify a Region, Amazon Chime uses the meeting's Region. final TranscribeMedicalRegion? region; /// The name of the vocabulary passed to Amazon Transcribe Medical. @@ -1489,7 +1699,7 @@ class EngineTranscribeSettings { /// and LanguageOptions. final TranscribeLanguageCode? preferredLanguage; - /// The AWS Region in which to use Amazon Transcribe. + /// The Amazon Web Services Region in which to use Amazon Transcribe. /// /// If you don't specify a Region, then the MediaRegion @@ -1782,18 +1992,34 @@ class MediaPlacement { final String? eventIngestionUrl; /// The screen data URL. + /// + /// This parameter is deprecated and no longer used by the Amazon Chime + /// SDK. + /// final String? screenDataUrl; /// The screen sharing URL. + /// + /// This parameter is deprecated and no longer used by the Amazon Chime + /// SDK. + /// final String? screenSharingUrl; /// The screen viewing URL. + /// + /// This parameter is deprecated and no longer used by the Amazon Chime + /// SDK. + /// final String? screenViewingUrl; /// The signaling URL. final String? signalingUrl; /// The turn control URL. + /// + /// This parameter is deprecated and no longer used by the Amazon Chime + /// SDK. + /// final String? turnControlUrl; MediaPlacement({ @@ -1865,8 +2091,8 @@ class Meeting { /// us-east-1, us-east-2, us-west-1, /// us-west-2. /// - /// Available values in AWS GovCloud (US) Regions: us-gov-east-1, - /// us-gov-west-1. + /// Available values in Amazon Web Services GovCloud (US) Regions: + /// us-gov-east-1, us-gov-west-1. final String? mediaRegion; /// The ARN of the meeting. @@ -1977,25 +2203,52 @@ extension MeetingFeatureStatusFromString on String { /// The configuration settings of the features available to a meeting. class MeetingFeaturesConfiguration { + /// The configuration settings for the attendee features available to a meeting. + final AttendeeFeatures? attendee; + /// The configuration settings for the audio features available to a meeting. final AudioFeatures? audio; + /// The configuration settings for the content features available to a meeting. + final ContentFeatures? content; + + /// The configuration settings for the video features available to a meeting. + final VideoFeatures? video; + MeetingFeaturesConfiguration({ + this.attendee, this.audio, + this.content, + this.video, }); factory MeetingFeaturesConfiguration.fromJson(Map json) { return MeetingFeaturesConfiguration( + attendee: json['Attendee'] != null + ? AttendeeFeatures.fromJson(json['Attendee'] as Map) + : null, audio: json['Audio'] != null ? AudioFeatures.fromJson(json['Audio'] as Map) : null, + content: json['Content'] != null + ? ContentFeatures.fromJson(json['Content'] as Map) + : null, + video: json['Video'] != null + ? VideoFeatures.fromJson(json['Video'] as Map) + : null, ); } Map toJson() { + final attendee = this.attendee; final audio = this.audio; + final content = this.content; + final video = this.video; return { + if (attendee != null) 'Attendee': attendee, if (audio != null) 'Audio': audio, + if (content != null) 'Content': content, + if (video != null) 'Video': video, }; } } @@ -2003,7 +2256,8 @@ class MeetingFeaturesConfiguration { /// The configuration for resource targets to receive notifications when meeting /// and attendee events occur. class NotificationsConfiguration { - /// The ARN of the AWS Lambda function in the notifications configuration. + /// The ARN of the Amazon Web Services Lambda function in the notifications + /// configuration. final String? lambdaFunctionArn; /// The ARN of the SNS topic. @@ -2609,6 +2863,74 @@ class UpdateAttendeeCapabilitiesResponse { } } +/// The video features set for the meeting. Applies to all attendees. +/// +/// If you specify MeetingFeatures:Video:MaxResolution:None when +/// you create a meeting, all API requests that include +/// SendReceive, Send, or Receive for +/// AttendeeCapabilities:Video will be rejected with +/// ValidationError 400. +/// +class VideoFeatures { + /// The maximum video resolution for the meeting. Applies to all attendees. + /// + /// Defaults to HD. To use FHD, you must also provide + /// a MeetingFeatures:Attendee:MaxCount value and override the + /// default size limit of 250 attendees. + /// + final VideoResolution? maxResolution; + + VideoFeatures({ + this.maxResolution, + }); + + factory VideoFeatures.fromJson(Map json) { + return VideoFeatures( + maxResolution: (json['MaxResolution'] as String?)?.toVideoResolution(), + ); + } + + Map toJson() { + final maxResolution = this.maxResolution; + return { + if (maxResolution != null) 'MaxResolution': maxResolution.toValue(), + }; + } +} + +enum VideoResolution { + none, + hd, + fhd, +} + +extension VideoResolutionValueExtension on VideoResolution { + String toValue() { + switch (this) { + case VideoResolution.none: + return 'None'; + case VideoResolution.hd: + return 'HD'; + case VideoResolution.fhd: + return 'FHD'; + } + } +} + +extension VideoResolutionFromString on String { + VideoResolution toVideoResolution() { + switch (this) { + case 'None': + return VideoResolution.none; + case 'HD': + return VideoResolution.hd; + case 'FHD': + return VideoResolution.fhd; + } + throw Exception('$this is not known in enum VideoResolution'); + } +} + class BadRequestException extends _s.GenericAwsException { BadRequestException({String? type, String? message}) : super(type: type, code: 'BadRequestException', message: message); diff --git a/aws_client/lib/src/generated/chime_sdk_messaging/v2021_05_15.dart b/aws_client/lib/src/generated/chime_sdk_messaging/v2021_05_15.dart index 29adfd2a7..5fc2eef12 100644 --- a/aws_client/lib/src/generated/chime_sdk_messaging/v2021_05_15.dart +++ b/aws_client/lib/src/generated/chime_sdk_messaging/v2021_05_15.dart @@ -19,10 +19,10 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// The Amazon Chime SDK Messaging APIs in this section allow software +/// The Amazon Chime SDK messaging APIs in this section allow software /// developers to send and receive messages in custom messaging applications. /// These APIs depend on the frameworks provided by the Amazon Chime SDK -/// Identity APIs. For more information about the messaging APIs, see Amazon /// Chime SDK messaging. class ChimeSdkMessaging { @@ -164,8 +164,8 @@ class ChimeSdkMessaging { return BatchCreateChannelMembershipResponse.fromJson(response); } - /// Calls back Chime SDK Messaging with a processing response message. This - /// should be invoked from the processor Lambda. This is a developer API. + /// Calls back Amazon Chime SDK messaging with a processing response message. + /// This should be invoked from the processor Lambda. This is a developer API. /// /// You can return one of the following processing responses: /// @@ -402,7 +402,7 @@ class ChimeSdkMessaging { /// The Standard message type ///
          • /// Channel flows don't process Control or System messages. For more - /// information about the message types provided by Chime SDK Messaging, refer + /// information about the message types provided by Chime SDK messaging, refer /// to Message /// types in the Amazon Chime developer guide. @@ -1248,7 +1248,7 @@ class ChimeSdkMessaging { /// Gets the membership preferences of an AppInstanceUser or /// AppInstanceBot for the specified channel. A user or a bot - /// must be a member of the channel and own the membership to be able to + /// must be a member of the channel and own the membership in order to /// retrieve membership preferences. Users or bots in the /// AppInstanceAdmin and channel moderator roles can't retrieve /// preferences for other users or bots. Banned users or bots can't retrieve @@ -1365,7 +1365,7 @@ class ChimeSdkMessaging { ///
            FAILED
            /// Processing failed ///
            DENIED
            - /// Messasge denied by the processor + /// Message denied by the processor ///
            ///
              ///
            • @@ -1656,7 +1656,7 @@ class ChimeSdkMessaging { return ListChannelMembershipsResponse.fromJson(response); } - /// Lists all channels that anr AppInstanceUser or + /// Lists all channels that an AppInstanceUser or /// AppInstanceBot is a part of. Only an /// AppInstanceAdmin can call the API with a user ARN that is not /// their own. @@ -2188,12 +2188,12 @@ class ChimeSdkMessaging { } /// Sets the membership preferences of an AppInstanceUser or - /// AppIntanceBot for the specified channel. The user or bot must - /// be a member of the channel. Only the user or bot who owns the membership - /// can set preferences. Users or bots in the AppInstanceAdmin - /// and channel moderator roles can't set preferences for other users or - /// users. Banned users or bots can't set membership preferences for the - /// channel from which they are banned. + /// AppInstanceBot for the specified channel. The user or bot + /// must be a member of the channel. Only the user or bot who owns the + /// membership can set preferences. Users or bots in the + /// AppInstanceAdmin and channel moderator roles can't set + /// preferences for other users. Banned users or bots can't set membership + /// preferences for the channel from which they are banned. /// /// The x-amz-chime-bearer request header is mandatory. Use the ARN of an /// AppInstanceUser or AppInstanceBot that makes the @@ -2398,9 +2398,12 @@ class ChimeSdkMessaging { /// ARN of the AppInstanceUser or AppInstanceBot /// that makes the API call as the value in the header. /// - /// Also, STANDARD messages can contain 4KB of data and the 1KB - /// of metadata. CONTROL messages can contain 30 bytes of data - /// and no metadata. + /// Also, STANDARD messages can be up to 4KB in size and contain + /// metadata. Metadata is arbitrary, and you can use it in a variety of ways, + /// such as containing a link to an attachment. + /// + /// CONTROL messages are limited to 30 bytes and do not contain + /// metadata. /// /// /// May throw [BadRequestException]. @@ -2419,7 +2422,7 @@ class ChimeSdkMessaging { /// that makes the API call. /// /// Parameter [content] : - /// The content of the message. + /// The content of the channel message. /// /// Parameter [persistence] : /// Boolean that controls whether the message is persisted on the back end. @@ -2428,6 +2431,13 @@ class ChimeSdkMessaging { /// Parameter [type] : /// The type of message, STANDARD or CONTROL. /// + /// STANDARD messages can be up to 4KB in size and contain + /// metadata. Metadata is arbitrary, and you can use it in a variety of ways, + /// such as containing a link to an attachment. + /// + /// CONTROL messages are limited to 30 bytes and do not contain + /// metadata. + /// /// Parameter [clientRequestToken] : /// The Idempotency token for each client request. /// @@ -2447,6 +2457,13 @@ class ChimeSdkMessaging { /// /// Parameter [subChannelId] : /// The ID of the SubChannel in the request. + /// + /// Parameter [target] : + /// The target of a message. Must be a member of the channel, such as another + /// user, a bot, or the sender. Only the target and the sender can view + /// targeted messages. Only users who can see targeted messages can take + /// actions on them. However, administrators can delete targeted messages that + /// they can’t see. Future sendChannelMessage({ required String channelArn, required String chimeBearer, @@ -2459,6 +2476,7 @@ class ChimeSdkMessaging { String? metadata, PushNotificationConfiguration? pushNotification, String? subChannelId, + List? target, }) async { final headers = { 'x-amz-chime-bearer': chimeBearer.toString(), @@ -2473,6 +2491,7 @@ class ChimeSdkMessaging { if (metadata != null) 'Metadata': metadata, if (pushNotification != null) 'PushNotification': pushNotification, if (subChannelId != null) 'SubChannelId': subChannelId, + if (target != null) 'Target': target, }; final response = await _protocol.send( payload: $payload, @@ -2663,7 +2682,7 @@ class ChimeSdkMessaging { /// that makes the API call. /// /// Parameter [content] : - /// The content of the message being updated. + /// The content of the channel message. /// /// Parameter [messageId] : /// The ID string of the message being updated. @@ -3517,10 +3536,21 @@ class ChannelMessage { /// The ARN of the channel. final String? channelArn; - /// The message content. + /// The content of the channel message. For Amazon Lex V2 bot responses, this + /// field holds a list of messages originating from the bot. For more + /// information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? content; - /// The content type of the channel message. + /// The content type of the channel message. For Amazon Lex V2 bot responses, + /// the content type is application/amz-chime-lex-msgs for success + /// responses and application/amz-chime-lex-error for failure + /// responses. For more information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? contentType; /// The time at which the message was created. @@ -3532,9 +3562,12 @@ class ChannelMessage { /// The time at which a message was updated. final DateTime? lastUpdatedTimestamp; - /// The attributes for the message, used for message filtering along with a - /// FilterRule defined in the - /// PushNotificationPreferences. + /// The attributes for the channel message. For Amazon Lex V2 bot responses, the + /// attributes are mapped to specific fields from the bot. For more information, + /// refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final Map? messageAttributes; /// The ID of a message. @@ -3558,6 +3591,12 @@ class ChannelMessage { /// The ID of the SubChannel. final String? subChannelId; + /// The target of a message, a sender, a user, or a bot. Only the target and the + /// sender can view targeted messages. Only users who can see targeted messages + /// can take actions on them. However, administrators can delete targeted + /// messages that they can’t see. + final List? target; + /// The message type. final ChannelMessageType? type; @@ -3576,6 +3615,7 @@ class ChannelMessage { this.sender, this.status, this.subChannelId, + this.target, this.type, }); @@ -3603,6 +3643,10 @@ class ChannelMessage { json['Status'] as Map) : null, subChannelId: json['SubChannelId'] as String?, + target: (json['Target'] as List?) + ?.whereNotNull() + .map((e) => Target.fromJson(e as Map)) + .toList(), type: (json['Type'] as String?)?.toChannelMessageType(), ); } @@ -3622,6 +3666,7 @@ class ChannelMessage { final sender = this.sender; final status = this.status; final subChannelId = this.subChannelId; + final target = this.target; final type = this.type; return { if (channelArn != null) 'ChannelArn': channelArn, @@ -3641,6 +3686,7 @@ class ChannelMessage { if (sender != null) 'Sender': sender, if (status != null) 'Status': status, if (subChannelId != null) 'SubChannelId': subChannelId, + if (target != null) 'Target': target, if (type != null) 'Type': type.toValue(), }; } @@ -3651,15 +3697,28 @@ class ChannelMessageCallback { /// The message ID. final String messageId; - /// The message content. + /// The message content. For Amazon Lex V2 bot responses, this field holds a + /// list of messages originating from the bot. For more information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? content; - /// The content type of the call-back message. + /// The content type of the call-back message. For Amazon Lex V2 bot responses, + /// the content type is application/amz-chime-lex-msgs for success + /// responses and application/amz-chime-lex-error for failure + /// responses. For more information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? contentType; - /// The attributes for the message, used for message filtering along with a - /// FilterRule defined in the - /// PushNotificationPreferences. + /// The attributes for the channel message. For Amazon Lex V2 bot responses, the + /// attributes are mapped to specific fields from the bot. For more information, + /// refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final Map? messageAttributes; /// The message metadata. @@ -3770,7 +3829,7 @@ extension ChannelMessageStatusFromString on String { /// Stores information about a message status. class ChannelMessageStatusStructure { - /// Contains more details about the messasge status. + /// Contains more details about the message status. final String? detail; /// The message status value. @@ -3800,10 +3859,22 @@ class ChannelMessageStatusStructure { /// Summary of the messages in a Channel. class ChannelMessageSummary { - /// The content of the message. + /// The content of the channel message. For Amazon Lex V2 bot responses, this + /// field holds a list of messages originating from the bot. For more + /// information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? content; - /// The content type of the channel messsage listed in the summary. + /// The content type of the channel message listed in the summary. For Amazon + /// Lex V2 bot responses, the content type is + /// application/amz-chime-lex-msgs for success responses and + /// application/amz-chime-lex-error for failure responses. For more + /// information, refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final String? contentType; /// The time at which the message summary was created. @@ -3815,7 +3886,12 @@ class ChannelMessageSummary { /// The time at which a message was last updated. final DateTime? lastUpdatedTimestamp; - /// The message attribues listed in a the summary of a channel message. + /// The attributes for the channel message. For Amazon Lex V2 bot responses, the + /// attributes are mapped to specific fields from the bot. For more information, + /// refer to Processing + /// responses from an AppInstanceBot in the Amazon Chime SDK Messaging + /// Developer Guide. final Map? messageAttributes; /// The ID of the message. @@ -3835,6 +3911,12 @@ class ChannelMessageSummary { /// flow, the value determines the processing stage. final ChannelMessageStatusStructure? status; + /// The target of a message, a sender, a user, or a bot. Only the target and the + /// sender can view targeted messages. Only users who can see targeted messages + /// can take actions on them. However, administrators can delete targeted + /// messages that they can’t see. + final List? target; + /// The type of message. final ChannelMessageType? type; @@ -3850,6 +3932,7 @@ class ChannelMessageSummary { this.redacted, this.sender, this.status, + this.target, this.type, }); @@ -3873,6 +3956,10 @@ class ChannelMessageSummary { ? ChannelMessageStatusStructure.fromJson( json['Status'] as Map) : null, + target: (json['Target'] as List?) + ?.whereNotNull() + .map((e) => Target.fromJson(e as Map)) + .toList(), type: (json['Type'] as String?)?.toChannelMessageType(), ); } @@ -3889,6 +3976,7 @@ class ChannelMessageSummary { final redacted = this.redacted; final sender = this.sender; final status = this.status; + final target = this.target; final type = this.type; return { if (content != null) 'Content': content, @@ -3905,6 +3993,7 @@ class ChannelMessageSummary { if (redacted != null) 'Redacted': redacted, if (sender != null) 'Sender': sender, if (status != null) 'Status': status, + if (target != null) 'Target': target, if (type != null) 'Type': type.toValue(), }; } @@ -4100,7 +4189,8 @@ class ChannelSummary { /// The ARN of the channel. final String? channelArn; - /// The time at which the last persistent message in a channel was sent. + /// The time at which the last persistent message visible to the caller in a + /// channel was sent. final DateTime? lastMessageTimestamp; /// The metadata of the channel. @@ -6013,6 +6103,32 @@ class Tag { } } +/// The target of a message, a sender, a user, or a bot. Only the target and the +/// sender can view targeted messages. Only users who can see targeted messages +/// can take actions on them. However, administrators can delete targeted +/// messages that they can’t see. +class Target { + /// The ARN of the target channel member. + final String? memberArn; + + Target({ + this.memberArn, + }); + + factory Target.fromJson(Map json) { + return Target( + memberArn: json['MemberArn'] as String?, + ); + } + + Map toJson() { + final memberArn = this.memberArn; + return { + if (memberArn != null) 'MemberArn': memberArn, + }; + } +} + class UpdateChannelFlowResponse { /// The ARN of the channel flow. final String? channelFlowArn; diff --git a/aws_client/lib/src/generated/chime_sdk_voice/v2022_08_03.dart b/aws_client/lib/src/generated/chime_sdk_voice/v2022_08_03.dart index cd3da0732..b9718b92d 100644 --- a/aws_client/lib/src/generated/chime_sdk_voice/v2022_08_03.dart +++ b/aws_client/lib/src/generated/chime_sdk_voice/v2022_08_03.dart @@ -172,7 +172,13 @@ class ChimeSdkVoice { return BatchDeletePhoneNumberResponse.fromJson(response); } - /// Updates one or more phone numbers. + /// Updates phone number product types, calling names, or phone number names. + /// You can update one attribute at a time for each + /// UpdatePhoneNumberRequestItem. For example, you can update the + /// product type, the calling name, or phone name. + /// + /// You cannot have a duplicate phoneNumberId in a request. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -217,13 +223,18 @@ class ChimeSdkVoice { /// /// Parameter [productType] : /// The phone number product type. + /// + /// Parameter [name] : + /// Specifies the name assigned to one or more phone numbers. Future createPhoneNumberOrder({ required List e164PhoneNumbers, required PhoneNumberProductType productType, + String? name, }) async { final $payload = { 'E164PhoneNumbers': e164PhoneNumbers, 'ProductType': productType.toValue(), + if (name != null) 'Name': name, }; final response = await _protocol.send( payload: $payload, @@ -1260,6 +1271,12 @@ class ChimeSdkVoice { } /// Gets the Alexa Skill configuration for the SIP media application. + /// + /// Due to changes made by the Amazon Alexa service, this API is no longer + /// available for use. For more information, refer to the Alexa + /// Smart Properties page. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -1271,6 +1288,8 @@ class ChimeSdkVoice { /// /// Parameter [sipMediaApplicationId] : /// The SIP media application ID. + @Deprecated( + 'Due to changes made by the Amazon Alexa service, this API is no longer available for use. For more information, refer to the Alexa Smart Properties page(https://developer.amazon.com/en-US/alexa/alexasmartproperties).') Future getSipMediaApplicationAlexaSkillConfiguration({ required String sipMediaApplicationId, @@ -2200,6 +2219,12 @@ class ChimeSdkVoice { } /// Updates the Alexa Skill configuration for the SIP media application. + /// + /// Due to changes made by the Amazon Alexa service, this API is no longer + /// available for use. For more information, refer to the Alexa + /// Smart Properties page. + /// /// /// May throw [UnauthorizedClientException]. /// May throw [NotFoundException]. @@ -2214,6 +2239,8 @@ class ChimeSdkVoice { /// /// Parameter [sipMediaApplicationAlexaSkillConfiguration] : /// The Alexa Skill configuration. + @Deprecated( + 'Due to changes made by the Amazon Alexa service, this API is no longer available for use. For more information, refer to the Alexa Smart Properties page(https://developer.amazon.com/en-US/alexa/alexasmartproperties).') Future putSipMediaApplicationAlexaSkillConfiguration({ required String sipMediaApplicationId, @@ -2653,6 +2680,9 @@ class ChimeSdkVoice { /// Parameter [voiceProfileDomainId] : /// The ID of the voice profile domain that will store the voice profile. /// + /// Parameter [callLeg] : + /// Specifies which call leg to stream for speaker search. + /// /// Parameter [clientRequestToken] : /// The unique identifier for the client request. Use a different token for /// different speaker search tasks. @@ -2660,11 +2690,13 @@ class ChimeSdkVoice { required String transactionId, required String voiceConnectorId, required String voiceProfileDomainId, + CallLegType? callLeg, String? clientRequestToken, }) async { final $payload = { 'TransactionId': transactionId, 'VoiceProfileDomainId': voiceProfileDomainId, + if (callLeg != null) 'CallLeg': callLeg.toValue(), if (clientRequestToken != null) 'ClientRequestToken': clientRequestToken, }; final response = await _protocol.send( @@ -2885,10 +2917,10 @@ class ChimeSdkVoice { ); } - /// Updates phone number details, such as product type or calling name, for - /// the specified phone number ID. You can update one phone number detail at a - /// time. For example, you can update either the product type or the calling - /// name in one action. + /// Updates phone number details, such as product type, calling name, or phone + /// number name for the specified phone number ID. You can update one phone + /// number detail at a time. For example, you can update either the product + /// type, calling name, or phone number name in one action. /// /// For numbers outside the U.S., you must use the Amazon Chime SDK SIP Media /// Application Dial-In product type. @@ -2912,15 +2944,20 @@ class ChimeSdkVoice { /// Parameter [callingName] : /// The outbound calling name associated with the phone number. /// + /// Parameter [name] : + /// Specifies the updated name assigned to one or more phone numbers. + /// /// Parameter [productType] : /// The product type. Future updatePhoneNumber({ required String phoneNumberId, String? callingName, + String? name, PhoneNumberProductType? productType, }) async { final $payload = { if (callingName != null) 'CallingName': callingName, + if (name != null) 'Name': name, if (productType != null) 'ProductType': productType.toValue(), }; final response = await _protocol.send( @@ -3615,6 +3652,34 @@ class CallDetails { } } +enum CallLegType { + caller, + callee, +} + +extension CallLegTypeValueExtension on CallLegType { + String toValue() { + switch (this) { + case CallLegType.caller: + return 'Caller'; + case CallLegType.callee: + return 'Callee'; + } + } +} + +extension CallLegTypeFromString on String { + CallLegType toCallLegType() { + switch (this) { + case 'Caller': + return CallLegType.caller; + case 'Callee': + return CallLegType.callee; + } + throw Exception('$this is not known in enum CallLegType'); + } +} + enum CallingNameStatus { unassigned, updateInProgress, @@ -5653,6 +5718,9 @@ class PhoneNumber { /// The phone number, in E.164 format. final String? e164PhoneNumber; + /// The name of the phone number. + final String? name; + /// The phone number's order ID. final String? orderId; @@ -5680,6 +5748,7 @@ class PhoneNumber { this.createdTimestamp, this.deletionTimestamp, this.e164PhoneNumber, + this.name, this.orderId, this.phoneNumberId, this.productType, @@ -5706,6 +5775,7 @@ class PhoneNumber { createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), deletionTimestamp: timeStampFromJson(json['DeletionTimestamp']), e164PhoneNumber: json['E164PhoneNumber'] as String?, + name: json['Name'] as String?, orderId: json['OrderId'] as String?, phoneNumberId: json['PhoneNumberId'] as String?, productType: (json['ProductType'] as String?)?.toPhoneNumberProductType(), @@ -5724,6 +5794,7 @@ class PhoneNumber { final createdTimestamp = this.createdTimestamp; final deletionTimestamp = this.deletionTimestamp; final e164PhoneNumber = this.e164PhoneNumber; + final name = this.name; final orderId = this.orderId; final phoneNumberId = this.phoneNumberId; final productType = this.productType; @@ -5742,6 +5813,7 @@ class PhoneNumber { if (deletionTimestamp != null) 'DeletionTimestamp': iso8601ToJson(deletionTimestamp), if (e164PhoneNumber != null) 'E164PhoneNumber': e164PhoneNumber, + if (name != null) 'Name': name, if (orderId != null) 'OrderId': orderId, if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, if (productType != null) 'ProductType': productType.toValue(), @@ -6853,6 +6925,12 @@ class SipMediaApplication { } /// The Alexa Skill configuration of a SIP media application. +/// +/// Due to changes made by the Amazon Alexa service, this data type is no longer +/// available for use. For more information, refer to the Alexa +/// Smart Properties page. +/// class SipMediaApplicationAlexaSkillConfiguration { /// The ID of the Alexa Skill configuration. final List alexaSkillIds; @@ -7532,22 +7610,28 @@ class UpdatePhoneNumberRequestItem { /// The outbound calling name to update. final String? callingName; + /// The name of the phone number. + final String? name; + /// The product type to update. final PhoneNumberProductType? productType; UpdatePhoneNumberRequestItem({ required this.phoneNumberId, this.callingName, + this.name, this.productType, }); Map toJson() { final phoneNumberId = this.phoneNumberId; final callingName = this.callingName; + final name = this.name; final productType = this.productType; return { 'PhoneNumberId': phoneNumberId, if (callingName != null) 'CallingName': callingName, + if (name != null) 'Name': name, if (productType != null) 'ProductType': productType.toValue(), }; } diff --git a/aws_client/lib/src/generated/clean_rooms/v2022_02_17.dart b/aws_client/lib/src/generated/clean_rooms/v2022_02_17.dart index 03344f3be..1205a1fa5 100644 --- a/aws_client/lib/src/generated/clean_rooms/v2022_02_17.dart +++ b/aws_client/lib/src/generated/clean_rooms/v2022_02_17.dart @@ -19,18 +19,23 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Welcome to the AWS Clean Rooms API Reference. +/// Welcome to the Clean Rooms API Reference. /// -/// AWS Clean Rooms is an AWS service that helps multiple parties to join their -/// data together in a secure collaboration workspace. In the collaboration, -/// members who can query and receive results can get insights into the -/// collective datasets without either party getting access to the other party's -/// raw data. +/// Clean Rooms is an Amazon Web Services service that helps multiple parties to +/// join their data together in a secure collaboration workspace. In the +/// collaboration, members who can query and receive results can get insights +/// into the collective datasets without either party getting access to the +/// other party's raw data. /// -/// To learn more about AWS Clean Rooms concepts, procedures, and best -/// practices, see the AWS -/// Clean Rooms User Guide. +/// To learn more about Clean Rooms concepts, procedures, and best practices, +/// see the Clean +/// Rooms User Guide. +/// +/// To learn more about SQL commands, functions, and conditions supported in +/// Clean Rooms, see the Clean +/// Rooms SQL Reference. class CleanRooms { final _s.RestJsonProtocol _protocol; CleanRooms({ @@ -60,6 +65,40 @@ class CleanRooms { _protocol.close(); } + /// Retrieves multiple analysis templates within a collaboration by their + /// Amazon Resource Names (ARNs). + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analysisTemplateArns] : + /// The Amazon Resource Name (ARN) associated with the analysis template + /// within a collaboration. + /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the analysis templates + /// belong to. Currently accepts collaboration ID. + Future + batchGetCollaborationAnalysisTemplate({ + required List analysisTemplateArns, + required String collaborationIdentifier, + }) async { + final $payload = { + 'analysisTemplateArns': analysisTemplateArns, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/batch-analysistemplates', + exceptionFnMap: _exceptionFns, + ); + return BatchGetCollaborationAnalysisTemplateOutput.fromJson(response); + } + /// Retrieves multiple schemas by their identifiers. /// /// May throw [ResourceNotFoundException]. @@ -73,7 +112,7 @@ class CleanRooms { /// Currently accepts collaboration ID. /// /// Parameter [names] : - /// The names for the schema objects to retrieve.> + /// The names for the schema objects to retrieve. Future batchGetSchema({ required String collaborationIdentifier, required List names, @@ -91,6 +130,98 @@ class CleanRooms { return BatchGetSchemaOutput.fromJson(response); } + /// Retrieves multiple analysis rule schemas. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationIdentifier] : + /// The unique identifier of the collaboration that contains the schema + /// analysis rule. + /// + /// Parameter [schemaAnalysisRuleRequests] : + /// The information that's necessary to retrieve a schema analysis rule. + Future batchGetSchemaAnalysisRule({ + required String collaborationIdentifier, + required List schemaAnalysisRuleRequests, + }) async { + final $payload = { + 'schemaAnalysisRuleRequests': schemaAnalysisRuleRequests, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/batch-schema-analysis-rule', + exceptionFnMap: _exceptionFns, + ); + return BatchGetSchemaAnalysisRuleOutput.fromJson(response); + } + + /// Creates a new analysis template. + /// + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [format] : + /// The format of the analysis template. + /// + /// Parameter [membershipIdentifier] : + /// The identifier for a membership resource. + /// + /// Parameter [name] : + /// The name of the analysis template. + /// + /// Parameter [source] : + /// The information in the analysis template. Currently supports + /// text, the query text for the analysis template. + /// + /// Parameter [analysisParameters] : + /// The parameters of the analysis template. + /// + /// Parameter [description] : + /// The description of the analysis template. + /// + /// Parameter [tags] : + /// An optional label that you can assign to a resource when you create it. + /// Each tag consists of a key and an optional value, both of which you + /// define. When you use tagging, you can also use tag-based access control in + /// IAM policies to control access to this resource. + Future createAnalysisTemplate({ + required AnalysisFormat format, + required String membershipIdentifier, + required String name, + required AnalysisSource source, + List? analysisParameters, + String? description, + Map? tags, + }) async { + final $payload = { + 'format': format.toValue(), + 'name': name, + 'source': source, + if (analysisParameters != null) 'analysisParameters': analysisParameters, + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/analysistemplates', + exceptionFnMap: _exceptionFns, + ); + return CreateAnalysisTemplateOutput.fromJson(response); + } + /// Creates a new collaboration. /// /// May throw [ServiceQuotaExceededException]. @@ -119,6 +250,14 @@ class CleanRooms { /// An indicator as to whether query logging has been enabled or disabled for /// the collaboration. /// + /// Parameter [creatorPaymentConfiguration] : + /// The collaboration creator's payment responsibilities set by the + /// collaboration creator. + /// + /// If the collaboration creator hasn't specified anyone as the member paying + /// for query compute costs, then the member who can query is the default + /// payer. + /// /// Parameter [dataEncryptionMetadata] : /// The settings for client-side encryption with Cryptographic Computing for /// Clean Rooms. @@ -135,6 +274,7 @@ class CleanRooms { required List members, required String name, required CollaborationQueryLogStatus queryLogStatus, + PaymentConfiguration? creatorPaymentConfiguration, DataEncryptionMetadata? dataEncryptionMetadata, Map? tags, }) async { @@ -146,6 +286,8 @@ class CleanRooms { 'members': members, 'name': name, 'queryLogStatus': queryLogStatus.toValue(), + if (creatorPaymentConfiguration != null) + 'creatorPaymentConfiguration': creatorPaymentConfiguration, if (dataEncryptionMetadata != null) 'dataEncryptionMetadata': dataEncryptionMetadata, if (tags != null) 'tags': tags, @@ -159,6 +301,79 @@ class CleanRooms { return CreateCollaborationOutput.fromJson(response); } + /// Provides the details necessary to create a configured audience model + /// association. + /// + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// A unique identifier for the configured audience model that you want to + /// associate. + /// + /// Parameter [configuredAudienceModelAssociationName] : + /// The name of the configured audience model association. + /// + /// Parameter [manageResourcePolicies] : + /// When TRUE, indicates that the resource policy for the + /// configured audience model resource being associated is configured for + /// Clean Rooms to manage permissions related to the given collaboration. When + /// FALSE, indicates that the configured audience model resource + /// owner will manage permissions related to the given collaboration. + /// + /// Setting this to TRUE requires you to have permissions to + /// create, update, and delete the resource policy for the + /// cleanrooms-ml resource when you call the + /// DeleteConfiguredAudienceModelAssociation resource. In addition, if + /// you are the collaboration creator and specify TRUE, you must + /// have the same permissions when you call the DeleteMember and + /// DeleteCollaboration APIs. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// configured audience model is associated to the collaboration that this + /// membership belongs to. Accepts a membership ID. + /// + /// Parameter [description] : + /// A description of the configured audience model association. + /// + /// Parameter [tags] : + /// An optional label that you can assign to a resource when you create it. + /// Each tag consists of a key and an optional value, both of which you + /// define. When you use tagging, you can also use tag-based access control in + /// IAM policies to control access to this resource. + Future + createConfiguredAudienceModelAssociation({ + required String configuredAudienceModelArn, + required String configuredAudienceModelAssociationName, + required bool manageResourcePolicies, + required String membershipIdentifier, + String? description, + Map? tags, + }) async { + final $payload = { + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'configuredAudienceModelAssociationName': + configuredAudienceModelAssociationName, + 'manageResourcePolicies': manageResourcePolicies, + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredaudiencemodelassociations', + exceptionFnMap: _exceptionFns, + ); + return CreateConfiguredAudienceModelAssociationOutput.fromJson(response); + } + /// Creates a new configured table resource. /// /// May throw [ConflictException]. @@ -181,7 +396,7 @@ class CleanRooms { /// The name of the configured table. /// /// Parameter [tableReference] : - /// A reference to the AWS Glue table being configured. + /// A reference to the Glue table being configured. /// /// Parameter [description] : /// A description for the configured table. @@ -230,7 +445,7 @@ class CleanRooms { /// The entire created configured table analysis rule object. /// /// Parameter [analysisRuleType] : - /// The type of analysis rule. Valid values are AGGREGATION and LIST. + /// The type of analysis rule. /// /// Parameter [configuredTableIdentifier] : /// The identifier for the configured table to create the analysis rule for. @@ -333,7 +548,20 @@ class CleanRooms { /// /// Parameter [queryLogStatus] : /// An indicator as to whether query logging has been enabled or disabled for - /// the collaboration. + /// the membership. + /// + /// Parameter [defaultResultConfiguration] : + /// The default protected query result configuration as specified by the + /// member who can receive results. + /// + /// Parameter [paymentConfiguration] : + /// The payment responsibilities accepted by the collaboration member. + /// + /// Not required if the collaboration member has the member ability to run + /// queries. + /// + /// Required if the collaboration member doesn't have the member ability to + /// run queries but is configured as a payer by the collaboration creator. /// /// Parameter [tags] : /// An optional label that you can assign to a resource when you create it. @@ -343,11 +571,17 @@ class CleanRooms { Future createMembership({ required String collaborationIdentifier, required MembershipQueryLogStatus queryLogStatus, + MembershipProtectedQueryResultConfiguration? defaultResultConfiguration, + MembershipPaymentConfiguration? paymentConfiguration, Map? tags, }) async { final $payload = { 'collaborationIdentifier': collaborationIdentifier, 'queryLogStatus': queryLogStatus.toValue(), + if (defaultResultConfiguration != null) + 'defaultResultConfiguration': defaultResultConfiguration, + if (paymentConfiguration != null) + 'paymentConfiguration': paymentConfiguration, if (tags != null) 'tags': tags, }; final response = await _protocol.send( @@ -359,6 +593,94 @@ class CleanRooms { return CreateMembershipOutput.fromJson(response); } + /// Creates a privacy budget template for a specified membership. Each + /// membership can have only one privacy budget template, but it can be + /// deleted and recreated. If you need to change the privacy budget template + /// for a membership, use the UpdatePrivacyBudgetTemplate operation. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [autoRefresh] : + /// How often the privacy budget refreshes. + /// + /// If you plan to regularly bring new data into the collaboration, you can + /// use CALENDAR_MONTH to automatically get a new privacy budget + /// for the collaboration every calendar month. Choosing this option allows + /// arbitrary amounts of information to be revealed about rows of the data + /// when repeatedly queries across refreshes. Avoid choosing this if the same + /// rows will be repeatedly queried between privacy budget refreshes. + /// + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget template is created in the collaboration that this + /// membership belongs to. Accepts a membership ID. + /// + /// Parameter [parameters] : + /// Specifies your parameters for the privacy budget template. + /// + /// Parameter [privacyBudgetType] : + /// Specifies the type of the privacy budget template. + /// + /// Parameter [tags] : + /// An optional label that you can assign to a resource when you create it. + /// Each tag consists of a key and an optional value, both of which you + /// define. When you use tagging, you can also use tag-based access control in + /// IAM policies to control access to this resource. + Future createPrivacyBudgetTemplate({ + required PrivacyBudgetTemplateAutoRefresh autoRefresh, + required String membershipIdentifier, + required PrivacyBudgetTemplateParametersInput parameters, + required PrivacyBudgetType privacyBudgetType, + Map? tags, + }) async { + final $payload = { + 'autoRefresh': autoRefresh.toValue(), + 'parameters': parameters, + 'privacyBudgetType': privacyBudgetType.toValue(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgettemplates', + exceptionFnMap: _exceptionFns, + ); + return CreatePrivacyBudgetTemplateOutput.fromJson(response); + } + + /// Deletes an analysis template. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analysisTemplateIdentifier] : + /// The identifier for the analysis template resource. + /// + /// Parameter [membershipIdentifier] : + /// The identifier for a membership resource. + Future deleteAnalysisTemplate({ + required String analysisTemplateIdentifier, + required String membershipIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/analysistemplates/${Uri.encodeComponent(analysisTemplateIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a collaboration. It can only be called by the collaboration owner. /// /// May throw [InternalServerException]. @@ -380,6 +702,35 @@ class CleanRooms { ); } + /// Provides the information necessary to delete a configured audience model + /// association. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredAudienceModelAssociationIdentifier] : + /// A unique identifier of the configured audience model association that you + /// want to delete. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier of the membership that contains the audience model + /// association that you want to delete. + Future deleteConfiguredAudienceModelAssociation({ + required String configuredAudienceModelAssociationIdentifier, + required String membershipIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredaudiencemodelassociations/${Uri.encodeComponent(configuredAudienceModelAssociationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a configured table. /// /// May throw [ConflictException]. @@ -515,29 +866,35 @@ class CleanRooms { ); } - /// Returns metadata about a collaboration. + /// Deletes a privacy budget template for a specified membership. /// + /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [collaborationIdentifier] : - /// The identifier for the collaboration. - Future getCollaboration({ - required String collaborationIdentifier, + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget template is deleted from the collaboration that this + /// membership belongs to. Accepts a membership ID. + /// + /// Parameter [privacyBudgetTemplateIdentifier] : + /// A unique identifier for your privacy budget template. + Future deletePrivacyBudgetTemplate({ + required String membershipIdentifier, + required String privacyBudgetTemplateIdentifier, }) async { final response = await _protocol.send( payload: null, - method: 'GET', + method: 'DELETE', requestUri: - '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgettemplates/${Uri.encodeComponent(privacyBudgetTemplateIdentifier)}', exceptionFnMap: _exceptionFns, ); - return GetCollaborationOutput.fromJson(response); } - /// Retrieves a configured table. + /// Retrieves an analysis template. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. @@ -545,52 +902,48 @@ class CleanRooms { /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [configuredTableIdentifier] : - /// The unique ID for the configured table to retrieve. - Future getConfiguredTable({ - required String configuredTableIdentifier, + /// Parameter [analysisTemplateIdentifier] : + /// The identifier for the analysis template resource. + /// + /// Parameter [membershipIdentifier] : + /// The identifier for a membership resource. + Future getAnalysisTemplate({ + required String analysisTemplateIdentifier, + required String membershipIdentifier, }) async { final response = await _protocol.send( payload: null, method: 'GET', requestUri: - '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/analysistemplates/${Uri.encodeComponent(analysisTemplateIdentifier)}', exceptionFnMap: _exceptionFns, ); - return GetConfiguredTableOutput.fromJson(response); + return GetAnalysisTemplateOutput.fromJson(response); } - /// Retrieves a configured table analysis rule. + /// Returns metadata about a collaboration. /// - /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [analysisRuleType] : - /// The analysis rule to be retrieved. Configured table analysis rules are - /// uniquely identified by their configured table identifier and analysis rule - /// type. - /// - /// Parameter [configuredTableIdentifier] : - /// The unique identifier for the configured table to retrieve. Currently - /// accepts the configured table ID. - Future getConfiguredTableAnalysisRule({ - required ConfiguredTableAnalysisRuleType analysisRuleType, - required String configuredTableIdentifier, + /// Parameter [collaborationIdentifier] : + /// The identifier for the collaboration. + Future getCollaboration({ + required String collaborationIdentifier, }) async { final response = await _protocol.send( payload: null, method: 'GET', requestUri: - '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}/analysisRule/${Uri.encodeComponent(analysisRuleType.toValue())}', + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}', exceptionFnMap: _exceptionFns, ); - return GetConfiguredTableAnalysisRuleOutput.fromJson(response); + return GetCollaborationOutput.fromJson(response); } - /// Retrieves a configured table association. + /// Retrieves an analysis template within a collaboration. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. @@ -598,12 +951,184 @@ class CleanRooms { /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [configuredTableAssociationIdentifier] : - /// The unique ID for the configured table association to retrieve. Currently - /// accepts the configured table ID. + /// Parameter [analysisTemplateArn] : + /// The Amazon Resource Name (ARN) associated with the analysis template + /// within a collaboration. /// - /// Parameter [membershipIdentifier] : - /// A unique identifier for the membership that the configured table + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the analysis templates + /// belong to. Currently accepts collaboration ID. + Future + getCollaborationAnalysisTemplate({ + required String analysisTemplateArn, + required String collaborationIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/analysistemplates/${Uri.encodeComponent(analysisTemplateArn)}', + exceptionFnMap: _exceptionFns, + ); + return GetCollaborationAnalysisTemplateOutput.fromJson(response); + } + + /// Retrieves a configured audience model association within a collaboration. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the configured audience + /// model association belongs to. Accepts a collaboration ID. + /// + /// Parameter [configuredAudienceModelAssociationIdentifier] : + /// A unique identifier for the configured audience model association that you + /// want to retrieve. + Future + getCollaborationConfiguredAudienceModelAssociation({ + required String collaborationIdentifier, + required String configuredAudienceModelAssociationIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/configuredaudiencemodelassociations/${Uri.encodeComponent(configuredAudienceModelAssociationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetCollaborationConfiguredAudienceModelAssociationOutput.fromJson( + response); + } + + /// Returns details about a specified privacy budget template. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for one of your collaborations. + /// + /// Parameter [privacyBudgetTemplateIdentifier] : + /// A unique identifier for one of your privacy budget templates. + Future + getCollaborationPrivacyBudgetTemplate({ + required String collaborationIdentifier, + required String privacyBudgetTemplateIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/privacybudgettemplates/${Uri.encodeComponent(privacyBudgetTemplateIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetCollaborationPrivacyBudgetTemplateOutput.fromJson(response); + } + + /// Returns information about a configured audience model association. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredAudienceModelAssociationIdentifier] : + /// A unique identifier for the configured audience model association that you + /// want to retrieve. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for the membership that contains the configured + /// audience model association that you want to retrieve. + Future + getConfiguredAudienceModelAssociation({ + required String configuredAudienceModelAssociationIdentifier, + required String membershipIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredaudiencemodelassociations/${Uri.encodeComponent(configuredAudienceModelAssociationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetConfiguredAudienceModelAssociationOutput.fromJson(response); + } + + /// Retrieves a configured table. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredTableIdentifier] : + /// The unique ID for the configured table to retrieve. + Future getConfiguredTable({ + required String configuredTableIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetConfiguredTableOutput.fromJson(response); + } + + /// Retrieves a configured table analysis rule. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analysisRuleType] : + /// The analysis rule to be retrieved. Configured table analysis rules are + /// uniquely identified by their configured table identifier and analysis rule + /// type. + /// + /// Parameter [configuredTableIdentifier] : + /// The unique identifier for the configured table to retrieve. Currently + /// accepts the configured table ID. + Future getConfiguredTableAnalysisRule({ + required ConfiguredTableAnalysisRuleType analysisRuleType, + required String configuredTableIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}/analysisRule/${Uri.encodeComponent(analysisRuleType.toValue())}', + exceptionFnMap: _exceptionFns, + ); + return GetConfiguredTableAnalysisRuleOutput.fromJson(response); + } + + /// Retrieves a configured table association. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredTableAssociationIdentifier] : + /// The unique ID for the configured table association to retrieve. Currently + /// accepts the configured table ID. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for the membership that the configured table /// association belongs to. Currently accepts the membership ID. Future getConfiguredTableAssociation({ required String configuredTableAssociationIdentifier, @@ -641,6 +1166,35 @@ class CleanRooms { return GetMembershipOutput.fromJson(response); } + /// Returns details for a specified privacy budget template. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget template is retrieved from the collaboration that this + /// membership belongs to. Accepts a membership ID. + /// + /// Parameter [privacyBudgetTemplateIdentifier] : + /// A unique identifier for your privacy budget template. + Future getPrivacyBudgetTemplate({ + required String membershipIdentifier, + required String privacyBudgetTemplateIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgettemplates/${Uri.encodeComponent(privacyBudgetTemplateIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetPrivacyBudgetTemplateOutput.fromJson(response); + } + /// Returns query processing metadata. /// /// May throw [ResourceNotFoundException]. @@ -730,28 +1284,26 @@ class CleanRooms { return GetSchemaAnalysisRuleOutput.fromJson(response); } - /// Lists collaborations the caller owns, is active in, or has been invited - /// to. + /// Lists analysis templates that the caller owns. /// + /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [maxResults] : - /// The maximum size of the results that is returned per call. Service chooses - /// a default if it has not been set. Service may return a nextToken even if - /// the maximum results has not been met. + /// Parameter [membershipIdentifier] : + /// The identifier for a membership resource. /// - /// Parameter [memberStatus] : - /// The caller's status in a collaboration. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - Future listCollaborations({ + Future listAnalysisTemplates({ + required String membershipIdentifier, int? maxResults, - FilterableMemberStatus? memberStatus, String? nextToken, }) async { _s.validateNumRange( @@ -762,20 +1314,20 @@ class CleanRooms { ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], - if (memberStatus != null) 'memberStatus': [memberStatus.toValue()], if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/collaborations', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/analysistemplates', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListCollaborationsOutput.fromJson(response); + return ListAnalysisTemplatesOutput.fromJson(response); } - /// Lists configured table associations for a membership. + /// Lists analysis templates within a collaboration. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. @@ -783,9 +1335,9 @@ class CleanRooms { /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [membershipIdentifier] : - /// A unique identifier for the membership to list configured table - /// associations for. Currently accepts the membership ID. + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the analysis templates + /// belong to. Currently accepts collaboration ID. /// /// Parameter [maxResults] : /// The maximum size of the results that is returned per call. @@ -793,9 +1345,9 @@ class CleanRooms { /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - Future - listConfiguredTableAssociations({ - required String membershipIdentifier, + Future + listCollaborationAnalysisTemplates({ + required String collaborationIdentifier, int? maxResults, String? nextToken, }) async { @@ -813,27 +1365,34 @@ class CleanRooms { payload: null, method: 'GET', requestUri: - '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredTableAssociations', + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/analysistemplates', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListConfiguredTableAssociationsOutput.fromJson(response); + return ListCollaborationAnalysisTemplatesOutput.fromJson(response); } - /// Lists configured tables. + /// Lists configured audience model associations within a collaboration. /// + /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the configured audience + /// model association belongs to. Accepts a collaboration ID. + /// /// Parameter [maxResults] : /// The maximum size of the results that is returned per call. /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - Future listConfiguredTables({ + Future + listCollaborationConfiguredAudienceModelAssociations({ + required String collaborationIdentifier, int? maxResults, String? nextToken, }) async { @@ -850,14 +1409,17 @@ class CleanRooms { final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/configuredTables', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/configuredaudiencemodelassociations', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListConfiguredTablesOutput.fromJson(response); + return ListCollaborationConfiguredAudienceModelAssociationsOutput.fromJson( + response); } - /// Lists all members within a collaboration. + /// Returns an array that summarizes each privacy budget template in a + /// specified collaboration. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. @@ -866,15 +1428,18 @@ class CleanRooms { /// May throw [AccessDeniedException]. /// /// Parameter [collaborationIdentifier] : - /// The identifier of the collaboration in which the members are listed. + /// A unique identifier for one of your collaborations. /// /// Parameter [maxResults] : - /// The maximum size of the results that is returned per call. + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service may return a nextToken even if + /// the maximum results has not been met. /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - Future listMembers({ + Future + listCollaborationPrivacyBudgetTemplates({ required String collaborationIdentifier, int? maxResults, String? nextToken, @@ -893,33 +1458,43 @@ class CleanRooms { payload: null, method: 'GET', requestUri: - '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/members', + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/privacybudgettemplates', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListMembersOutput.fromJson(response); + return ListCollaborationPrivacyBudgetTemplatesOutput.fromJson(response); } - /// Lists all memberships resources within the caller's account. + /// Returns an array that summarizes each privacy budget in a specified + /// collaboration. The summary includes the collaboration ARN, creation time, + /// creating account, and privacy budget details. /// + /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for one of your collaborations. + /// + /// Parameter [privacyBudgetType] : + /// Specifies the type of the privacy budget. + /// /// Parameter [maxResults] : - /// The maximum size of the results that is returned per call. + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service may return a nextToken even if + /// the maximum results has not been met. /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - /// - /// Parameter [status] : - /// A filter which will return only memberships in the specified status. - Future listMemberships({ + Future + listCollaborationPrivacyBudgets({ + required String collaborationIdentifier, + required PrivacyBudgetType privacyBudgetType, int? maxResults, String? nextToken, - MembershipStatus? status, }) async { _s.validateNumRange( 'maxResults', @@ -928,47 +1503,44 @@ class CleanRooms { 100, ); final $query = >{ + 'privacyBudgetType': [privacyBudgetType.toValue()], if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], - if (status != null) 'status': [status.toValue()], }; final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/memberships', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/privacybudgets', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListMembershipsOutput.fromJson(response); + return ListCollaborationPrivacyBudgetsOutput.fromJson(response); } - /// Lists protected queries, sorted by the most recent query. + /// Lists collaborations the caller owns, is active in, or has been invited + /// to. /// - /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [membershipIdentifier] : - /// The identifier for the membership in the collaboration. - /// /// Parameter [maxResults] : /// The maximum size of the results that is returned per call. Service chooses - /// a default if it has not been set. Service can return a nextToken even if + /// a default if it has not been set. Service may return a nextToken even if /// the maximum results has not been met. /// + /// Parameter [memberStatus] : + /// The caller's status in a collaboration. + /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - /// - /// Parameter [status] : - /// A filter on the status of the protected query. - Future listProtectedQueries({ - required String membershipIdentifier, + Future listCollaborations({ int? maxResults, + FilterableMemberStatus? memberStatus, String? nextToken, - ProtectedQueryStatus? status, }) async { _s.validateNumRange( 'maxResults', @@ -978,21 +1550,20 @@ class CleanRooms { ); final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], + if (memberStatus != null) 'memberStatus': [memberStatus.toValue()], if (nextToken != null) 'nextToken': [nextToken], - if (status != null) 'status': [status.toValue()], }; final response = await _protocol.send( payload: null, method: 'GET', - requestUri: - '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries', + requestUri: '/collaborations', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListProtectedQueriesOutput.fromJson(response); + return ListCollaborationsOutput.fromJson(response); } - /// Lists the schemas for relations within a collaboration. + /// Lists information about requested configured audience model associations. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. @@ -1000,25 +1571,23 @@ class CleanRooms { /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [collaborationIdentifier] : - /// A unique identifier for the collaboration that the schema belongs to. - /// Currently accepts a collaboration ID. + /// Parameter [membershipIdentifier] : + /// A unique identifier for a membership that contains the configured audience + /// model associations that you want to retrieve. /// /// Parameter [maxResults] : - /// The maximum size of the results that is returned per call. - /// + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service may return a nextToken even if + /// the maximum results has not been met. + /// /// Parameter [nextToken] : /// The token value retrieved from a previous call to access the next page of /// results. - /// - /// Parameter [schemaType] : - /// If present, filter schemas by schema type. The only valid schema type is - /// currently `TABLE`. - Future listSchemas({ - required String collaborationIdentifier, + Future + listConfiguredAudienceModelAssociations({ + required String membershipIdentifier, int? maxResults, String? nextToken, - SchemaType? schemaType, }) async { _s.validateNumRange( 'maxResults', @@ -1029,42 +1598,20 @@ class CleanRooms { final $query = >{ if (maxResults != null) 'maxResults': [maxResults.toString()], if (nextToken != null) 'nextToken': [nextToken], - if (schemaType != null) 'schemaType': [schemaType.toValue()], }; final response = await _protocol.send( payload: null, method: 'GET', requestUri: - '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/schemas', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredaudiencemodelassociations', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListSchemasOutput.fromJson(response); - } - - /// Lists all of the tags that have been added to a resource. - /// - /// May throw [ResourceNotFoundException]. - /// May throw [ValidationException]. - /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) associated with the resource you want to - /// list tags on. - Future listTagsForResource({ - required String resourceArn, - }) async { - final response = await _protocol.send( - payload: null, - method: 'GET', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', - exceptionFnMap: _exceptionFns, - ); - return ListTagsForResourceOutput.fromJson(response); + return ListConfiguredAudienceModelAssociationsOutput.fromJson(response); } - /// Creates a protected query that is started by AWS Clean Rooms. + /// Lists configured table associations for a membership. /// - /// May throw [ServiceQuotaExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. @@ -1072,250 +1619,388 @@ class CleanRooms { /// May throw [AccessDeniedException]. /// /// Parameter [membershipIdentifier] : - /// A unique identifier for the membership to run this query against. - /// Currently accepts a membership ID. - /// - /// Parameter [resultConfiguration] : - /// The details needed to write the query results. + /// A unique identifier for the membership to list configured table + /// associations for. Currently accepts the membership ID. /// - /// Parameter [sqlParameters] : - /// The protected SQL query parameters. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. /// - /// Parameter [type] : - /// The type of the protected query to be started. - Future startProtectedQuery({ + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future + listConfiguredTableAssociations({ required String membershipIdentifier, - required ProtectedQueryResultConfiguration resultConfiguration, - required ProtectedQuerySQLParameters sqlParameters, - required ProtectedQueryType type, + int? maxResults, + String? nextToken, }) async { - final $payload = { - 'resultConfiguration': resultConfiguration, - 'sqlParameters': sqlParameters, - 'type': type.toValue(), + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( - payload: $payload, - method: 'POST', + payload: null, + method: 'GET', requestUri: - '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredTableAssociations', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return StartProtectedQueryOutput.fromJson(response); + return ListConfiguredTableAssociationsOutput.fromJson(response); } - /// Tags a resource. + /// Lists configured tables. /// - /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) associated with the resource you want to - /// tag. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. /// - /// Parameter [tags] : - /// A map of objects specifying each key name and value. - Future tagResource({ - required String resourceArn, - required Map tags, + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listConfiguredTables({ + int? maxResults, + String? nextToken, }) async { - final $payload = { - 'tags': tags, + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + payload: null, + method: 'GET', + requestUri: '/configuredTables', + queryParams: $query, exceptionFnMap: _exceptionFns, ); + return ListConfiguredTablesOutput.fromJson(response); } - /// Removes a tag or list of tags from a resource. + /// Lists all members within a collaboration. /// /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) associated with the resource you want to - /// remove the tag from. + /// Parameter [collaborationIdentifier] : + /// The identifier of the collaboration in which the members are listed. /// - /// Parameter [tagKeys] : - /// A list of key names of tags to be removed. - Future untagResource({ - required String resourceArn, - required List tagKeys, + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listMembers({ + required String collaborationIdentifier, + int? maxResults, + String? nextToken, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); final $query = >{ - 'tagKeys': tagKeys, + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( payload: null, - method: 'DELETE', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + method: 'GET', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/members', queryParams: $query, exceptionFnMap: _exceptionFns, ); + return ListMembersOutput.fromJson(response); } - /// Updates collaboration metadata and can only be called by the collaboration - /// owner. + /// Lists all memberships resources within the caller's account. /// /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [collaborationIdentifier] : - /// The identifier for the collaboration. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. /// - /// Parameter [description] : - /// A description of the collaboration. + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. /// - /// Parameter [name] : - /// A human-readable identifier provided by the collaboration owner. Display - /// names are not unique. - Future updateCollaboration({ - required String collaborationIdentifier, - String? description, - String? name, + /// Parameter [status] : + /// A filter which will return only memberships in the specified status. + Future listMemberships({ + int? maxResults, + String? nextToken, + MembershipStatus? status, }) async { - final $payload = { - if (description != null) 'description': description, - if (name != null) 'name': name, + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], }; final response = await _protocol.send( - payload: $payload, - method: 'PATCH', - requestUri: - '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}', + payload: null, + method: 'GET', + requestUri: '/memberships', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return UpdateCollaborationOutput.fromJson(response); + return ListMembershipsOutput.fromJson(response); } - /// Updates a configured table. + /// Returns detailed information about the privacy budget templates in a + /// specified membership. /// - /// May throw [ConflictException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [configuredTableIdentifier] : - /// The identifier for the configured table to update. Currently accepts the - /// configured table ID. + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget templates are retrieved from the collaboration that this + /// membership belongs to. Accepts a membership ID. /// - /// Parameter [description] : - /// A new description for the configured table. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service may return a nextToken even if + /// the maximum results has not been met. /// - /// Parameter [name] : - /// A new name for the configured table. - Future updateConfiguredTable({ - required String configuredTableIdentifier, - String? description, - String? name, + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listPrivacyBudgetTemplates({ + required String membershipIdentifier, + int? maxResults, + String? nextToken, }) async { - final $payload = { - if (description != null) 'description': description, - if (name != null) 'name': name, + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( - payload: $payload, - method: 'PATCH', + payload: null, + method: 'GET', requestUri: - '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgettemplates', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return UpdateConfiguredTableOutput.fromJson(response); + return ListPrivacyBudgetTemplatesOutput.fromJson(response); } - /// Updates a configured table analysis rule. + /// Returns detailed information about the privacy budgets in a specified + /// membership. /// - /// May throw [ConflictException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [analysisRulePolicy] : - /// The new analysis rule policy for the configured table analysis rule. + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget is retrieved from the collaboration that this membership + /// belongs to. Accepts a membership ID. /// - /// Parameter [analysisRuleType] : - /// The analysis rule type to be updated. Configured table analysis rules are - /// uniquely identified by their configured table identifier and analysis rule - /// type. + /// Parameter [privacyBudgetType] : + /// The privacy budget type. /// - /// Parameter [configuredTableIdentifier] : - /// The unique identifier for the configured table that the analysis rule - /// applies to. Currently accepts the configured table ID. - Future - updateConfiguredTableAnalysisRule({ - required ConfiguredTableAnalysisRulePolicy analysisRulePolicy, - required ConfiguredTableAnalysisRuleType analysisRuleType, - required String configuredTableIdentifier, + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service may return a nextToken even if + /// the maximum results has not been met. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listPrivacyBudgets({ + required String membershipIdentifier, + required PrivacyBudgetType privacyBudgetType, + int? maxResults, + String? nextToken, }) async { - final $payload = { - 'analysisRulePolicy': analysisRulePolicy, + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + 'privacyBudgetType': [privacyBudgetType.toValue()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], }; final response = await _protocol.send( - payload: $payload, - method: 'PATCH', + payload: null, + method: 'GET', requestUri: - '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}/analysisRule/${Uri.encodeComponent(analysisRuleType.toValue())}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgets', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return UpdateConfiguredTableAnalysisRuleOutput.fromJson(response); + return ListPrivacyBudgetsOutput.fromJson(response); } - /// Updates a configured table association. + /// Lists protected queries, sorted by the most recent query. /// - /// May throw [ConflictException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. /// May throw [ThrottlingException]. /// May throw [AccessDeniedException]. /// - /// Parameter [configuredTableAssociationIdentifier] : - /// The unique identifier for the configured table association to update. - /// Currently accepts the configured table association ID. - /// /// Parameter [membershipIdentifier] : - /// The unique ID for the membership that the configured table association - /// belongs to. + /// The identifier for the membership in the collaboration. /// - /// Parameter [description] : - /// A new description for the configured table association. + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. Service chooses + /// a default if it has not been set. Service can return a nextToken even if + /// the maximum results has not been met. /// - /// Parameter [roleArn] : - /// The service will assume this role to access catalog metadata and query the - /// table. - Future - updateConfiguredTableAssociation({ - required String configuredTableAssociationIdentifier, + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + /// + /// Parameter [status] : + /// A filter on the status of the protected query. + Future listProtectedQueries({ required String membershipIdentifier, - String? description, - String? roleArn, + int? maxResults, + String? nextToken, + ProtectedQueryStatus? status, }) async { - final $payload = { - if (description != null) 'description': description, - if (roleArn != null) 'roleArn': roleArn, + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], }; final response = await _protocol.send( - payload: $payload, - method: 'PATCH', + payload: null, + method: 'GET', requestUri: - '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredTableAssociations/${Uri.encodeComponent(configuredTableAssociationIdentifier)}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return UpdateConfiguredTableAssociationOutput.fromJson(response); + return ListProtectedQueriesOutput.fromJson(response); } - /// Updates a membership. + /// Lists the schemas for relations within a collaboration. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationIdentifier] : + /// A unique identifier for the collaboration that the schema belongs to. + /// Currently accepts a collaboration ID. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + /// + /// Parameter [schemaType] : + /// If present, filter schemas by schema type. The only valid schema type is + /// currently `TABLE`. + Future listSchemas({ + required String collaborationIdentifier, + int? maxResults, + String? nextToken, + SchemaType? schemaType, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (schemaType != null) 'schemaType': [schemaType.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}/schemas', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSchemasOutput.fromJson(response); + } + + /// Lists all of the tags that have been added to a resource. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) associated with the resource you want to + /// list tags on. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceOutput.fromJson(response); + } + + /// An estimate of the number of aggregation functions that the member who can + /// query can run given epsilon and noise parameters. /// - /// May throw [ConflictException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. @@ -1323,30 +2008,31 @@ class CleanRooms { /// May throw [AccessDeniedException]. /// /// Parameter [membershipIdentifier] : - /// The unique identifier of the membership. + /// A unique identifier for one of your memberships for a collaboration. + /// Accepts a membership ID. /// - /// Parameter [queryLogStatus] : - /// An indicator as to whether query logging has been enabled or disabled for - /// the collaboration. - Future updateMembership({ + /// Parameter [parameters] : + /// Specifies the desired epsilon and noise parameters to preview. + Future previewPrivacyImpact({ required String membershipIdentifier, - MembershipQueryLogStatus? queryLogStatus, + required PreviewPrivacyImpactParametersInput parameters, }) async { final $payload = { - if (queryLogStatus != null) 'queryLogStatus': queryLogStatus.toValue(), + 'parameters': parameters, }; final response = await _protocol.send( payload: $payload, - method: 'PATCH', - requestUri: '/memberships/${Uri.encodeComponent(membershipIdentifier)}', + method: 'POST', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/previewprivacyimpact', exceptionFnMap: _exceptionFns, ); - return UpdateMembershipOutput.fromJson(response); + return PreviewPrivacyImpactOutput.fromJson(response); } - /// Updates the processing of a currently running query. + /// Creates a protected query that is started by Clean Rooms. /// - /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServerException]. /// May throw [ValidationException]. @@ -1354,2480 +2040,6250 @@ class CleanRooms { /// May throw [AccessDeniedException]. /// /// Parameter [membershipIdentifier] : - /// The identifier for a member of a protected query instance. + /// A unique identifier for the membership to run this query against. + /// Currently accepts a membership ID. /// - /// Parameter [protectedQueryIdentifier] : - /// The identifier for a protected query instance. + /// Parameter [sqlParameters] : + /// The protected SQL query parameters. /// - /// Parameter [targetStatus] : - /// The target status of a query. Used to update the execution status of a - /// currently running query. - Future updateProtectedQuery({ + /// Parameter [type] : + /// The type of the protected query to be started. + /// + /// Parameter [resultConfiguration] : + /// The details needed to write the query results. + Future startProtectedQuery({ required String membershipIdentifier, - required String protectedQueryIdentifier, - required TargetProtectedQueryStatus targetStatus, + required ProtectedQuerySQLParameters sqlParameters, + required ProtectedQueryType type, + ProtectedQueryResultConfiguration? resultConfiguration, }) async { final $payload = { - 'targetStatus': targetStatus.toValue(), + 'sqlParameters': sqlParameters, + 'type': type.toValue(), + if (resultConfiguration != null) + 'resultConfiguration': resultConfiguration, }; final response = await _protocol.send( payload: $payload, - method: 'PATCH', + method: 'POST', requestUri: - '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries/${Uri.encodeComponent(protectedQueryIdentifier)}', + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries', exceptionFnMap: _exceptionFns, ); - return UpdateProtectedQueryOutput.fromJson(response); + return StartProtectedQueryOutput.fromJson(response); } -} - -/// Column in configured table that can be used in aggregate function in query. -class AggregateColumn { - /// Column names in configured table of aggregate columns. - final List columnNames; - /// Aggregation function that can be applied to aggregate column in query. - final AggregateFunctionName function; - - AggregateColumn({ - required this.columnNames, - required this.function, - }); + /// Tags a resource. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) associated with the resource you want to + /// tag. + /// + /// Parameter [tags] : + /// A map of objects specifying each key name and value. + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes a tag or list of tags from a resource. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) associated with the resource you want to + /// remove the tag from. + /// + /// Parameter [tagKeys] : + /// A list of key names of tags to be removed. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates the analysis template metadata. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analysisTemplateIdentifier] : + /// The identifier for the analysis template resource. + /// + /// Parameter [membershipIdentifier] : + /// The identifier for a membership resource. + /// + /// Parameter [description] : + /// A new description for the analysis template. + Future updateAnalysisTemplate({ + required String analysisTemplateIdentifier, + required String membershipIdentifier, + String? description, + }) async { + final $payload = { + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/analysistemplates/${Uri.encodeComponent(analysisTemplateIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateAnalysisTemplateOutput.fromJson(response); + } + + /// Updates collaboration metadata and can only be called by the collaboration + /// owner. + /// + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationIdentifier] : + /// The identifier for the collaboration. + /// + /// Parameter [description] : + /// A description of the collaboration. + /// + /// Parameter [name] : + /// A human-readable identifier provided by the collaboration owner. Display + /// names are not unique. + Future updateCollaboration({ + required String collaborationIdentifier, + String? description, + String? name, + }) async { + final $payload = { + if (description != null) 'description': description, + if (name != null) 'name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/collaborations/${Uri.encodeComponent(collaborationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateCollaborationOutput.fromJson(response); + } + + /// Provides the details necessary to update a configured audience model + /// association. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredAudienceModelAssociationIdentifier] : + /// A unique identifier for the configured audience model association that you + /// want to update. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier of the membership that contains the configured + /// audience model association that you want to update. + /// + /// Parameter [description] : + /// A new description for the configured audience model association. + /// + /// Parameter [name] : + /// A new name for the configured audience model association. + Future + updateConfiguredAudienceModelAssociation({ + required String configuredAudienceModelAssociationIdentifier, + required String membershipIdentifier, + String? description, + String? name, + }) async { + final $payload = { + if (description != null) 'description': description, + if (name != null) 'name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredaudiencemodelassociations/${Uri.encodeComponent(configuredAudienceModelAssociationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateConfiguredAudienceModelAssociationOutput.fromJson(response); + } + + /// Updates a configured table. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredTableIdentifier] : + /// The identifier for the configured table to update. Currently accepts the + /// configured table ID. + /// + /// Parameter [description] : + /// A new description for the configured table. + /// + /// Parameter [name] : + /// A new name for the configured table. + Future updateConfiguredTable({ + required String configuredTableIdentifier, + String? description, + String? name, + }) async { + final $payload = { + if (description != null) 'description': description, + if (name != null) 'name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateConfiguredTableOutput.fromJson(response); + } + + /// Updates a configured table analysis rule. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [analysisRulePolicy] : + /// The new analysis rule policy for the configured table analysis rule. + /// + /// Parameter [analysisRuleType] : + /// The analysis rule type to be updated. Configured table analysis rules are + /// uniquely identified by their configured table identifier and analysis rule + /// type. + /// + /// Parameter [configuredTableIdentifier] : + /// The unique identifier for the configured table that the analysis rule + /// applies to. Currently accepts the configured table ID. + Future + updateConfiguredTableAnalysisRule({ + required ConfiguredTableAnalysisRulePolicy analysisRulePolicy, + required ConfiguredTableAnalysisRuleType analysisRuleType, + required String configuredTableIdentifier, + }) async { + final $payload = { + 'analysisRulePolicy': analysisRulePolicy, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/configuredTables/${Uri.encodeComponent(configuredTableIdentifier)}/analysisRule/${Uri.encodeComponent(analysisRuleType.toValue())}', + exceptionFnMap: _exceptionFns, + ); + return UpdateConfiguredTableAnalysisRuleOutput.fromJson(response); + } + + /// Updates a configured table association. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [configuredTableAssociationIdentifier] : + /// The unique identifier for the configured table association to update. + /// Currently accepts the configured table association ID. + /// + /// Parameter [membershipIdentifier] : + /// The unique ID for the membership that the configured table association + /// belongs to. + /// + /// Parameter [description] : + /// A new description for the configured table association. + /// + /// Parameter [roleArn] : + /// The service will assume this role to access catalog metadata and query the + /// table. + Future + updateConfiguredTableAssociation({ + required String configuredTableAssociationIdentifier, + required String membershipIdentifier, + String? description, + String? roleArn, + }) async { + final $payload = { + if (description != null) 'description': description, + if (roleArn != null) 'roleArn': roleArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/configuredTableAssociations/${Uri.encodeComponent(configuredTableAssociationIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateConfiguredTableAssociationOutput.fromJson(response); + } + + /// Updates a membership. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [membershipIdentifier] : + /// The unique identifier of the membership. + /// + /// Parameter [defaultResultConfiguration] : + /// The default protected query result configuration as specified by the + /// member who can receive results. + /// + /// Parameter [queryLogStatus] : + /// An indicator as to whether query logging has been enabled or disabled for + /// the membership. + Future updateMembership({ + required String membershipIdentifier, + MembershipProtectedQueryResultConfiguration? defaultResultConfiguration, + MembershipQueryLogStatus? queryLogStatus, + }) async { + final $payload = { + if (defaultResultConfiguration != null) + 'defaultResultConfiguration': defaultResultConfiguration, + if (queryLogStatus != null) 'queryLogStatus': queryLogStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/memberships/${Uri.encodeComponent(membershipIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateMembershipOutput.fromJson(response); + } + + /// Updates the privacy budget template for the specified membership. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [membershipIdentifier] : + /// A unique identifier for one of your memberships for a collaboration. The + /// privacy budget template is updated in the collaboration that this + /// membership belongs to. Accepts a membership ID. + /// + /// Parameter [privacyBudgetTemplateIdentifier] : + /// A unique identifier for your privacy budget template that you want to + /// update. + /// + /// Parameter [privacyBudgetType] : + /// Specifies the type of the privacy budget template. + /// + /// Parameter [parameters] : + /// Specifies the epsilon and noise parameters for the privacy budget + /// template. + Future updatePrivacyBudgetTemplate({ + required String membershipIdentifier, + required String privacyBudgetTemplateIdentifier, + required PrivacyBudgetType privacyBudgetType, + PrivacyBudgetTemplateUpdateParameters? parameters, + }) async { + final $payload = { + 'privacyBudgetType': privacyBudgetType.toValue(), + if (parameters != null) 'parameters': parameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/privacybudgettemplates/${Uri.encodeComponent(privacyBudgetTemplateIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdatePrivacyBudgetTemplateOutput.fromJson(response); + } + + /// Updates the processing of a currently running query. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [membershipIdentifier] : + /// The identifier for a member of a protected query instance. + /// + /// Parameter [protectedQueryIdentifier] : + /// The identifier for a protected query instance. + /// + /// Parameter [targetStatus] : + /// The target status of a query. Used to update the execution status of a + /// currently running query. + Future updateProtectedQuery({ + required String membershipIdentifier, + required String protectedQueryIdentifier, + required TargetProtectedQueryStatus targetStatus, + }) async { + final $payload = { + 'targetStatus': targetStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/memberships/${Uri.encodeComponent(membershipIdentifier)}/protectedQueries/${Uri.encodeComponent(protectedQueryIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateProtectedQueryOutput.fromJson(response); + } +} + +/// Column in configured table that can be used in aggregate function in query. +class AggregateColumn { + /// Column names in configured table of aggregate columns. + final List columnNames; + + /// Aggregation function that can be applied to aggregate column in query. + final AggregateFunctionName function; + + AggregateColumn({ + required this.columnNames, + required this.function, + }); factory AggregateColumn.fromJson(Map json) { return AggregateColumn( columnNames: (json['columnNames'] as List) .whereNotNull() - .map((e) => e as String) + .map((e) => e as String) + .toList(), + function: (json['function'] as String).toAggregateFunctionName(), + ); + } + + Map toJson() { + final columnNames = this.columnNames; + final function = this.function; + return { + 'columnNames': columnNames, + 'function': function.toValue(), + }; + } +} + +enum AggregateFunctionName { + sum, + sumDistinct, + count, + countDistinct, + avg, +} + +extension AggregateFunctionNameValueExtension on AggregateFunctionName { + String toValue() { + switch (this) { + case AggregateFunctionName.sum: + return 'SUM'; + case AggregateFunctionName.sumDistinct: + return 'SUM_DISTINCT'; + case AggregateFunctionName.count: + return 'COUNT'; + case AggregateFunctionName.countDistinct: + return 'COUNT_DISTINCT'; + case AggregateFunctionName.avg: + return 'AVG'; + } + } +} + +extension AggregateFunctionNameFromString on String { + AggregateFunctionName toAggregateFunctionName() { + switch (this) { + case 'SUM': + return AggregateFunctionName.sum; + case 'SUM_DISTINCT': + return AggregateFunctionName.sumDistinct; + case 'COUNT': + return AggregateFunctionName.count; + case 'COUNT_DISTINCT': + return AggregateFunctionName.countDistinct; + case 'AVG': + return AggregateFunctionName.avg; + } + throw Exception('$this is not known in enum AggregateFunctionName'); + } +} + +/// Constraint on query output removing output rows that do not meet a minimum +/// number of distinct values of a specified column. +class AggregationConstraint { + /// Column in aggregation constraint for which there must be a minimum number of + /// distinct values in an output row for it to be in the query output. + final String columnName; + + /// The minimum number of distinct values that an output row must be an + /// aggregation of. Minimum threshold of distinct values for a specified column + /// that must exist in an output row for it to be in the query output. + final int minimum; + + /// The type of aggregation the constraint allows. The only valid value is + /// currently `COUNT_DISTINCT`. + final AggregationType type; + + AggregationConstraint({ + required this.columnName, + required this.minimum, + required this.type, + }); + + factory AggregationConstraint.fromJson(Map json) { + return AggregationConstraint( + columnName: json['columnName'] as String, + minimum: json['minimum'] as int, + type: (json['type'] as String).toAggregationType(), + ); + } + + Map toJson() { + final columnName = this.columnName; + final minimum = this.minimum; + final type = this.type; + return { + 'columnName': columnName, + 'minimum': minimum, + 'type': type.toValue(), + }; + } +} + +enum AggregationType { + countDistinct, +} + +extension AggregationTypeValueExtension on AggregationType { + String toValue() { + switch (this) { + case AggregationType.countDistinct: + return 'COUNT_DISTINCT'; + } + } +} + +extension AggregationTypeFromString on String { + AggregationType toAggregationType() { + switch (this) { + case 'COUNT_DISTINCT': + return AggregationType.countDistinct; + } + throw Exception('$this is not known in enum AggregationType'); + } +} + +enum AnalysisFormat { + sql, +} + +extension AnalysisFormatValueExtension on AnalysisFormat { + String toValue() { + switch (this) { + case AnalysisFormat.sql: + return 'SQL'; + } + } +} + +extension AnalysisFormatFromString on String { + AnalysisFormat toAnalysisFormat() { + switch (this) { + case 'SQL': + return AnalysisFormat.sql; + } + throw Exception('$this is not known in enum AnalysisFormat'); + } +} + +enum AnalysisMethod { + directQuery, +} + +extension AnalysisMethodValueExtension on AnalysisMethod { + String toValue() { + switch (this) { + case AnalysisMethod.directQuery: + return 'DIRECT_QUERY'; + } + } +} + +extension AnalysisMethodFromString on String { + AnalysisMethod toAnalysisMethod() { + switch (this) { + case 'DIRECT_QUERY': + return AnalysisMethod.directQuery; + } + throw Exception('$this is not known in enum AnalysisMethod'); + } +} + +/// Optional. The member who can query can provide this placeholder for a +/// literal data value in an analysis template. +class AnalysisParameter { + /// The name of the parameter. The name must use only alphanumeric, underscore + /// (_), or hyphen (-) characters but cannot start or end with a hyphen. + final String name; + + /// The type of parameter. + final ParameterType type; + + /// Optional. The default value that is applied in the analysis template. The + /// member who can query can override this value in the query editor. + final String? defaultValue; + + AnalysisParameter({ + required this.name, + required this.type, + this.defaultValue, + }); + + factory AnalysisParameter.fromJson(Map json) { + return AnalysisParameter( + name: json['name'] as String, + type: (json['type'] as String).toParameterType(), + defaultValue: json['defaultValue'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + final defaultValue = this.defaultValue; + return { + 'name': name, + 'type': type.toValue(), + if (defaultValue != null) 'defaultValue': defaultValue, + }; + } +} + +/// A specification about how data from the configured table can be used in a +/// query. +class AnalysisRule { + /// The unique ID for the associated collaboration. + final String collaborationId; + + /// The time the analysis rule was created. + final DateTime createTime; + + /// The name for the analysis rule. + final String name; + + /// A policy that describes the associated data usage limitations. + final AnalysisRulePolicy policy; + + /// The type of analysis rule. + final AnalysisRuleType type; + + /// The time the analysis rule was last updated. + final DateTime updateTime; + + AnalysisRule({ + required this.collaborationId, + required this.createTime, + required this.name, + required this.policy, + required this.type, + required this.updateTime, + }); + + factory AnalysisRule.fromJson(Map json) { + return AnalysisRule( + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + policy: + AnalysisRulePolicy.fromJson(json['policy'] as Map), + type: (json['type'] as String).toAnalysisRuleType(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final name = this.name; + final policy = this.policy; + final type = this.type; + final updateTime = this.updateTime; + return { + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'name': name, + 'policy': policy, + 'type': type.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// A type of analysis rule that enables query structure and specified queries +/// that produce aggregate statistics. +class AnalysisRuleAggregation { + /// The columns that query runners are allowed to use in aggregation queries. + final List aggregateColumns; + + /// The columns that query runners are allowed to select, group by, or filter + /// by. + final List dimensionColumns; + + /// Columns in configured table that can be used in join statements and/or as + /// aggregate columns. They can never be outputted directly. + final List joinColumns; + + /// Columns that must meet a specific threshold value (after an aggregation + /// function is applied to it) for each output row to be returned. + final List outputConstraints; + + /// Set of scalar functions that are allowed to be used on dimension columns and + /// the output of aggregation of metrics. + final List scalarFunctions; + + /// Which logical operators (if any) are to be used in an INNER JOIN match + /// condition. Default is AND. + final List? allowedJoinOperators; + + /// Control that requires member who runs query to do a join with their + /// configured table and/or other configured table in query. + final JoinRequiredOption? joinRequired; + + AnalysisRuleAggregation({ + required this.aggregateColumns, + required this.dimensionColumns, + required this.joinColumns, + required this.outputConstraints, + required this.scalarFunctions, + this.allowedJoinOperators, + this.joinRequired, + }); + + factory AnalysisRuleAggregation.fromJson(Map json) { + return AnalysisRuleAggregation( + aggregateColumns: (json['aggregateColumns'] as List) + .whereNotNull() + .map((e) => AggregateColumn.fromJson(e as Map)) + .toList(), + dimensionColumns: (json['dimensionColumns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + joinColumns: (json['joinColumns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + outputConstraints: (json['outputConstraints'] as List) + .whereNotNull() + .map((e) => AggregationConstraint.fromJson(e as Map)) + .toList(), + scalarFunctions: (json['scalarFunctions'] as List) + .whereNotNull() + .map((e) => (e as String).toScalarFunctions()) + .toList(), + allowedJoinOperators: (json['allowedJoinOperators'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toJoinOperator()) + .toList(), + joinRequired: (json['joinRequired'] as String?)?.toJoinRequiredOption(), + ); + } + + Map toJson() { + final aggregateColumns = this.aggregateColumns; + final dimensionColumns = this.dimensionColumns; + final joinColumns = this.joinColumns; + final outputConstraints = this.outputConstraints; + final scalarFunctions = this.scalarFunctions; + final allowedJoinOperators = this.allowedJoinOperators; + final joinRequired = this.joinRequired; + return { + 'aggregateColumns': aggregateColumns, + 'dimensionColumns': dimensionColumns, + 'joinColumns': joinColumns, + 'outputConstraints': outputConstraints, + 'scalarFunctions': scalarFunctions.map((e) => e.toValue()).toList(), + if (allowedJoinOperators != null) + 'allowedJoinOperators': + allowedJoinOperators.map((e) => e.toValue()).toList(), + if (joinRequired != null) 'joinRequired': joinRequired.toValue(), + }; + } +} + +/// A type of analysis rule that enables the table owner to approve custom SQL +/// queries on their configured tables. It supports differential privacy. +class AnalysisRuleCustom { + /// The ARN of the analysis templates that are allowed by the custom analysis + /// rule. + final List allowedAnalyses; + + /// The IDs of the Amazon Web Services accounts that are allowed to query by the + /// custom analysis rule. Required when allowedAnalyses is + /// ANY_QUERY. + final List? allowedAnalysisProviders; + + /// The differential privacy configuration. + final DifferentialPrivacyConfiguration? differentialPrivacy; + + AnalysisRuleCustom({ + required this.allowedAnalyses, + this.allowedAnalysisProviders, + this.differentialPrivacy, + }); + + factory AnalysisRuleCustom.fromJson(Map json) { + return AnalysisRuleCustom( + allowedAnalyses: (json['allowedAnalyses'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + allowedAnalysisProviders: (json['allowedAnalysisProviders'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + differentialPrivacy: json['differentialPrivacy'] != null + ? DifferentialPrivacyConfiguration.fromJson( + json['differentialPrivacy'] as Map) + : null, + ); + } + + Map toJson() { + final allowedAnalyses = this.allowedAnalyses; + final allowedAnalysisProviders = this.allowedAnalysisProviders; + final differentialPrivacy = this.differentialPrivacy; + return { + 'allowedAnalyses': allowedAnalyses, + if (allowedAnalysisProviders != null) + 'allowedAnalysisProviders': allowedAnalysisProviders, + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, + }; + } +} + +/// A type of analysis rule that enables row-level analysis. +class AnalysisRuleList { + /// Columns that can be used to join a configured table with the table of the + /// member who can query and other members' configured tables. + final List joinColumns; + + /// Columns that can be listed in the output. + final List listColumns; + + /// The logical operators (if any) that are to be used in an INNER JOIN match + /// condition. Default is AND. + final List? allowedJoinOperators; + + AnalysisRuleList({ + required this.joinColumns, + required this.listColumns, + this.allowedJoinOperators, + }); + + factory AnalysisRuleList.fromJson(Map json) { + return AnalysisRuleList( + joinColumns: (json['joinColumns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + listColumns: (json['listColumns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + allowedJoinOperators: (json['allowedJoinOperators'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toJoinOperator()) + .toList(), + ); + } + + Map toJson() { + final joinColumns = this.joinColumns; + final listColumns = this.listColumns; + final allowedJoinOperators = this.allowedJoinOperators; + return { + 'joinColumns': joinColumns, + 'listColumns': listColumns, + if (allowedJoinOperators != null) + 'allowedJoinOperators': + allowedJoinOperators.map((e) => e.toValue()).toList(), + }; + } +} + +/// Controls on the query specifications that can be run on configured table. +class AnalysisRulePolicy { + /// Controls on the query specifications that can be run on configured table. + final AnalysisRulePolicyV1? v1; + + AnalysisRulePolicy({ + this.v1, + }); + + factory AnalysisRulePolicy.fromJson(Map json) { + return AnalysisRulePolicy( + v1: json['v1'] != null + ? AnalysisRulePolicyV1.fromJson(json['v1'] as Map) + : null, + ); + } + + Map toJson() { + final v1 = this.v1; + return { + if (v1 != null) 'v1': v1, + }; + } +} + +/// Controls on the query specifications that can be run on configured table. +class AnalysisRulePolicyV1 { + /// Analysis rule type that enables only aggregation queries on a configured + /// table. + final AnalysisRuleAggregation? aggregation; + + /// Analysis rule type that enables custom SQL queries on a configured table. + final AnalysisRuleCustom? custom; + + /// Analysis rule type that enables only list queries on a configured table. + final AnalysisRuleList? list; + + AnalysisRulePolicyV1({ + this.aggregation, + this.custom, + this.list, + }); + + factory AnalysisRulePolicyV1.fromJson(Map json) { + return AnalysisRulePolicyV1( + aggregation: json['aggregation'] != null + ? AnalysisRuleAggregation.fromJson( + json['aggregation'] as Map) + : null, + custom: json['custom'] != null + ? AnalysisRuleCustom.fromJson(json['custom'] as Map) + : null, + list: json['list'] != null + ? AnalysisRuleList.fromJson(json['list'] as Map) + : null, + ); + } + + Map toJson() { + final aggregation = this.aggregation; + final custom = this.custom; + final list = this.list; + return { + if (aggregation != null) 'aggregation': aggregation, + if (custom != null) 'custom': custom, + if (list != null) 'list': list, + }; + } +} + +enum AnalysisRuleType { + aggregation, + list, + custom, +} + +extension AnalysisRuleTypeValueExtension on AnalysisRuleType { + String toValue() { + switch (this) { + case AnalysisRuleType.aggregation: + return 'AGGREGATION'; + case AnalysisRuleType.list: + return 'LIST'; + case AnalysisRuleType.custom: + return 'CUSTOM'; + } + } +} + +extension AnalysisRuleTypeFromString on String { + AnalysisRuleType toAnalysisRuleType() { + switch (this) { + case 'AGGREGATION': + return AnalysisRuleType.aggregation; + case 'LIST': + return AnalysisRuleType.list; + case 'CUSTOM': + return AnalysisRuleType.custom; + } + throw Exception('$this is not known in enum AnalysisRuleType'); + } +} + +/// A relation within an analysis. +class AnalysisSchema { + /// The tables referenced in the analysis schema. + final List? referencedTables; + + AnalysisSchema({ + this.referencedTables, + }); + + factory AnalysisSchema.fromJson(Map json) { + return AnalysisSchema( + referencedTables: (json['referencedTables'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final referencedTables = this.referencedTables; + return { + if (referencedTables != null) 'referencedTables': referencedTables, + }; + } +} + +/// The structure that defines the body of the analysis template. +class AnalysisSource { + /// The query text. + final String? text; + + AnalysisSource({ + this.text, + }); + + factory AnalysisSource.fromJson(Map json) { + return AnalysisSource( + text: json['text'] as String?, + ); + } + + Map toJson() { + final text = this.text; + return { + if (text != null) 'text': text, + }; + } +} + +/// The analysis template. +class AnalysisTemplate { + /// The Amazon Resource Name (ARN) of the analysis template. + final String arn; + + /// The unique ARN for the analysis template’s associated collaboration. + final String collaborationArn; + + /// The unique ID for the associated collaboration of the analysis template. + final String collaborationId; + + /// The time that the analysis template was created. + final DateTime createTime; + + /// The format of the analysis template. + final AnalysisFormat format; + + /// The identifier for the analysis template. + final String id; + + /// The Amazon Resource Name (ARN) of the member who created the analysis + /// template. + final String membershipArn; + + /// The identifier of a member who created the analysis template. + final String membershipId; + + /// The name of the analysis template. + final String name; + + /// The entire schema object. + final AnalysisSchema schema; + + /// The source of the analysis template. + final AnalysisSource source; + + /// The time that the analysis template was last updated. + final DateTime updateTime; + + /// The parameters of the analysis template. + final List? analysisParameters; + + /// The description of the analysis template. + final String? description; + + /// Information about the validations performed on the analysis template. + final List? validations; + + AnalysisTemplate({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.format, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.schema, + required this.source, + required this.updateTime, + this.analysisParameters, + this.description, + this.validations, + }); + + factory AnalysisTemplate.fromJson(Map json) { + return AnalysisTemplate( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + format: (json['format'] as String).toAnalysisFormat(), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + schema: AnalysisSchema.fromJson(json['schema'] as Map), + source: AnalysisSource.fromJson(json['source'] as Map), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + analysisParameters: (json['analysisParameters'] as List?) + ?.whereNotNull() + .map((e) => AnalysisParameter.fromJson(e as Map)) + .toList(), + description: json['description'] as String?, + validations: (json['validations'] as List?) + ?.whereNotNull() + .map((e) => AnalysisTemplateValidationStatusDetail.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final format = this.format; + final id = this.id; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final schema = this.schema; + final source = this.source; + final updateTime = this.updateTime; + final analysisParameters = this.analysisParameters; + final description = this.description; + final validations = this.validations; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'format': format.toValue(), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'schema': schema, + 'source': source, + 'updateTime': unixTimestampToJson(updateTime), + if (analysisParameters != null) 'analysisParameters': analysisParameters, + if (description != null) 'description': description, + if (validations != null) 'validations': validations, + }; + } +} + +/// The metadata of the analysis template. +class AnalysisTemplateSummary { + /// The Amazon Resource Name (ARN) of the analysis template. + final String arn; + + /// The unique ARN for the analysis template summary’s associated collaboration. + final String collaborationArn; + + /// A unique identifier for the collaboration that the analysis template summary + /// belongs to. Currently accepts collaboration ID. + final String collaborationId; + + /// The time that the analysis template summary was created. + final DateTime createTime; + + /// The identifier of the analysis template. + final String id; + + /// The Amazon Resource Name (ARN) of the member who created the analysis + /// template. + final String membershipArn; + + /// The identifier for a membership resource. + final String membershipId; + + /// The name of the analysis template. + final String name; + + /// The time that the analysis template summary was last updated. + final DateTime updateTime; + + /// The description of the analysis template. + final String? description; + + AnalysisTemplateSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.updateTime, + this.description, + }); + + factory AnalysisTemplateSummary.fromJson(Map json) { + return AnalysisTemplateSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final id = this.id; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +enum AnalysisTemplateValidationStatus { + valid, + invalid, + unableToValidate, +} + +extension AnalysisTemplateValidationStatusValueExtension + on AnalysisTemplateValidationStatus { + String toValue() { + switch (this) { + case AnalysisTemplateValidationStatus.valid: + return 'VALID'; + case AnalysisTemplateValidationStatus.invalid: + return 'INVALID'; + case AnalysisTemplateValidationStatus.unableToValidate: + return 'UNABLE_TO_VALIDATE'; + } + } +} + +extension AnalysisTemplateValidationStatusFromString on String { + AnalysisTemplateValidationStatus toAnalysisTemplateValidationStatus() { + switch (this) { + case 'VALID': + return AnalysisTemplateValidationStatus.valid; + case 'INVALID': + return AnalysisTemplateValidationStatus.invalid; + case 'UNABLE_TO_VALIDATE': + return AnalysisTemplateValidationStatus.unableToValidate; + } + throw Exception( + '$this is not known in enum AnalysisTemplateValidationStatus'); + } +} + +/// The status details of the analysis template validation. Clean Rooms +/// Differential Privacy uses a general-purpose query structure to support +/// complex SQL queries and validates whether an analysis template fits that +/// general-purpose query structure. Validation is performed when analysis +/// templates are created and fetched. Because analysis templates are immutable +/// by design, we recommend that you create analysis templates after you +/// associate the configured tables with their analysis rule to your +/// collaboration. +/// +/// For more information, see https://docs.aws.amazon.com/clean-rooms/latest/userguide/analysis-rules-custom.html#custom-diff-privacy. +class AnalysisTemplateValidationStatusDetail { + /// The status of the validation. + final AnalysisTemplateValidationStatus status; + + /// The type of validation that was performed. + final AnalysisTemplateValidationType type; + + /// The reasons for the validation results. + final List? reasons; + + AnalysisTemplateValidationStatusDetail({ + required this.status, + required this.type, + this.reasons, + }); + + factory AnalysisTemplateValidationStatusDetail.fromJson( + Map json) { + return AnalysisTemplateValidationStatusDetail( + status: (json['status'] as String).toAnalysisTemplateValidationStatus(), + type: (json['type'] as String).toAnalysisTemplateValidationType(), + reasons: (json['reasons'] as List?) + ?.whereNotNull() + .map((e) => AnalysisTemplateValidationStatusReason.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final status = this.status; + final type = this.type; + final reasons = this.reasons; + return { + 'status': status.toValue(), + 'type': type.toValue(), + if (reasons != null) 'reasons': reasons, + }; + } +} + +/// The reasons for the validation results. +class AnalysisTemplateValidationStatusReason { + /// The validation message. + final String message; + + AnalysisTemplateValidationStatusReason({ + required this.message, + }); + + factory AnalysisTemplateValidationStatusReason.fromJson( + Map json) { + return AnalysisTemplateValidationStatusReason( + message: json['message'] as String, + ); + } + + Map toJson() { + final message = this.message; + return { + 'message': message, + }; + } +} + +enum AnalysisTemplateValidationType { + differentialPrivacy, +} + +extension AnalysisTemplateValidationTypeValueExtension + on AnalysisTemplateValidationType { + String toValue() { + switch (this) { + case AnalysisTemplateValidationType.differentialPrivacy: + return 'DIFFERENTIAL_PRIVACY'; + } + } +} + +extension AnalysisTemplateValidationTypeFromString on String { + AnalysisTemplateValidationType toAnalysisTemplateValidationType() { + switch (this) { + case 'DIFFERENTIAL_PRIVACY': + return AnalysisTemplateValidationType.differentialPrivacy; + } + throw Exception( + '$this is not known in enum AnalysisTemplateValidationType'); + } +} + +/// Details of errors thrown by the call to retrieve multiple analysis templates +/// within a collaboration by their identifiers. +class BatchGetCollaborationAnalysisTemplateError { + /// The Amazon Resource Name (ARN) of the analysis template. + final String arn; + + /// An error code for the error. + final String code; + + /// A description of why the call failed. + final String message; + + BatchGetCollaborationAnalysisTemplateError({ + required this.arn, + required this.code, + required this.message, + }); + + factory BatchGetCollaborationAnalysisTemplateError.fromJson( + Map json) { + return BatchGetCollaborationAnalysisTemplateError( + arn: json['arn'] as String, + code: json['code'] as String, + message: json['message'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + final code = this.code; + final message = this.message; + return { + 'arn': arn, + 'code': code, + 'message': message, + }; + } +} + +class BatchGetCollaborationAnalysisTemplateOutput { + /// The retrieved list of analysis templates within a collaboration. + final List collaborationAnalysisTemplates; + + /// Error reasons for collaboration analysis templates that could not be + /// retrieved. One error is returned for every collaboration analysis template + /// that could not be retrieved. + final List errors; + + BatchGetCollaborationAnalysisTemplateOutput({ + required this.collaborationAnalysisTemplates, + required this.errors, + }); + + factory BatchGetCollaborationAnalysisTemplateOutput.fromJson( + Map json) { + return BatchGetCollaborationAnalysisTemplateOutput( + collaborationAnalysisTemplates: (json['collaborationAnalysisTemplates'] + as List) + .whereNotNull() + .map((e) => + CollaborationAnalysisTemplate.fromJson(e as Map)) + .toList(), + errors: (json['errors'] as List) + .whereNotNull() + .map((e) => BatchGetCollaborationAnalysisTemplateError.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final collaborationAnalysisTemplates = this.collaborationAnalysisTemplates; + final errors = this.errors; + return { + 'collaborationAnalysisTemplates': collaborationAnalysisTemplates, + 'errors': errors, + }; + } +} + +/// An error that describes why a schema could not be fetched. +class BatchGetSchemaAnalysisRuleError { + /// An error code for the error. + final String code; + + /// A description of why the call failed. + final String message; + + /// An error name for the error. + final String name; + + /// The analysis rule type. + final AnalysisRuleType type; + + BatchGetSchemaAnalysisRuleError({ + required this.code, + required this.message, + required this.name, + required this.type, + }); + + factory BatchGetSchemaAnalysisRuleError.fromJson(Map json) { + return BatchGetSchemaAnalysisRuleError( + code: json['code'] as String, + message: json['message'] as String, + name: json['name'] as String, + type: (json['type'] as String).toAnalysisRuleType(), + ); + } + + Map toJson() { + final code = this.code; + final message = this.message; + final name = this.name; + final type = this.type; + return { + 'code': code, + 'message': message, + 'name': name, + 'type': type.toValue(), + }; + } +} + +class BatchGetSchemaAnalysisRuleOutput { + /// The retrieved list of analysis rules. + final List analysisRules; + + /// Error reasons for schemas that could not be retrieved. One error is returned + /// for every schema that could not be retrieved. + final List errors; + + BatchGetSchemaAnalysisRuleOutput({ + required this.analysisRules, + required this.errors, + }); + + factory BatchGetSchemaAnalysisRuleOutput.fromJson(Map json) { + return BatchGetSchemaAnalysisRuleOutput( + analysisRules: (json['analysisRules'] as List) + .whereNotNull() + .map((e) => AnalysisRule.fromJson(e as Map)) + .toList(), + errors: (json['errors'] as List) + .whereNotNull() + .map((e) => BatchGetSchemaAnalysisRuleError.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final analysisRules = this.analysisRules; + final errors = this.errors; + return { + 'analysisRules': analysisRules, + 'errors': errors, + }; + } +} + +/// An error describing why a schema could not be fetched. +class BatchGetSchemaError { + /// An error code for the error. + final String code; + + /// An error message for the error. + final String message; + + /// An error name for the error. + final String name; + + BatchGetSchemaError({ + required this.code, + required this.message, + required this.name, + }); + + factory BatchGetSchemaError.fromJson(Map json) { + return BatchGetSchemaError( + code: json['code'] as String, + message: json['message'] as String, + name: json['name'] as String, + ); + } + + Map toJson() { + final code = this.code; + final message = this.message; + final name = this.name; + return { + 'code': code, + 'message': message, + 'name': name, + }; + } +} + +class BatchGetSchemaOutput { + /// Error reasons for schemas that could not be retrieved. One error is returned + /// for every schema that could not be retrieved. + final List errors; + + /// The retrieved list of schemas. + final List schemas; + + BatchGetSchemaOutput({ + required this.errors, + required this.schemas, + }); + + factory BatchGetSchemaOutput.fromJson(Map json) { + return BatchGetSchemaOutput( + errors: (json['errors'] as List) + .whereNotNull() + .map((e) => BatchGetSchemaError.fromJson(e as Map)) + .toList(), + schemas: (json['schemas'] as List) + .whereNotNull() + .map((e) => Schema.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final errors = this.errors; + final schemas = this.schemas; + return { + 'errors': errors, + 'schemas': schemas, + }; + } +} + +/// The multi-party data share environment. The collaboration contains metadata +/// about its purpose and participants. +class Collaboration { + /// The unique ARN for the collaboration. + final String arn; + + /// The time when the collaboration was created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String creatorAccountId; + + /// A display name of the collaboration creator. + final String creatorDisplayName; + + /// The unique ID for the collaboration. + final String id; + + /// The status of a member in a collaboration. + final MemberStatus memberStatus; + + /// A human-readable identifier provided by the collaboration owner. Display + /// names are not unique. + final String name; + + /// An indicator as to whether query logging has been enabled or disabled for + /// the collaboration. + final CollaborationQueryLogStatus queryLogStatus; + + /// The time the collaboration metadata was last updated. + final DateTime updateTime; + + /// The settings for client-side encryption for cryptographic computing. + final DataEncryptionMetadata? dataEncryptionMetadata; + + /// A description of the collaboration provided by the collaboration owner. + final String? description; + + /// The unique ARN for your membership within the collaboration. + final String? membershipArn; + + /// The unique ID for your membership within the collaboration. + final String? membershipId; + + Collaboration({ + required this.arn, + required this.createTime, + required this.creatorAccountId, + required this.creatorDisplayName, + required this.id, + required this.memberStatus, + required this.name, + required this.queryLogStatus, + required this.updateTime, + this.dataEncryptionMetadata, + this.description, + this.membershipArn, + this.membershipId, + }); + + factory Collaboration.fromJson(Map json) { + return Collaboration( + arn: json['arn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + creatorDisplayName: json['creatorDisplayName'] as String, + id: json['id'] as String, + memberStatus: (json['memberStatus'] as String).toMemberStatus(), + name: json['name'] as String, + queryLogStatus: + (json['queryLogStatus'] as String).toCollaborationQueryLogStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + dataEncryptionMetadata: json['dataEncryptionMetadata'] != null + ? DataEncryptionMetadata.fromJson( + json['dataEncryptionMetadata'] as Map) + : null, + description: json['description'] as String?, + membershipArn: json['membershipArn'] as String?, + membershipId: json['membershipId'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final creatorDisplayName = this.creatorDisplayName; + final id = this.id; + final memberStatus = this.memberStatus; + final name = this.name; + final queryLogStatus = this.queryLogStatus; + final updateTime = this.updateTime; + final dataEncryptionMetadata = this.dataEncryptionMetadata; + final description = this.description; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + return { + 'arn': arn, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'creatorDisplayName': creatorDisplayName, + 'id': id, + 'memberStatus': memberStatus.toValue(), + 'name': name, + 'queryLogStatus': queryLogStatus.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + if (dataEncryptionMetadata != null) + 'dataEncryptionMetadata': dataEncryptionMetadata, + if (description != null) 'description': description, + if (membershipArn != null) 'membershipArn': membershipArn, + if (membershipId != null) 'membershipId': membershipId, + }; + } +} + +/// The analysis template within a collaboration. +class CollaborationAnalysisTemplate { + /// The Amazon Resource Name (ARN) of the analysis template. + final String arn; + + /// The unique ARN for the analysis template’s associated collaboration. + final String collaborationArn; + + /// A unique identifier for the collaboration that the analysis templates belong + /// to. Currently accepts collaboration ID. + final String collaborationId; + + /// The time that the analysis template within a collaboration was created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String creatorAccountId; + + /// The format of the analysis template in the collaboration. + final AnalysisFormat format; + + /// The identifier of the analysis template. + final String id; + + /// The name of the analysis template. + final String name; + + /// The entire schema object. + final AnalysisSchema schema; + + /// The source of the analysis template within a collaboration. + final AnalysisSource source; + + /// The time that the analysis template in the collaboration was last updated. + final DateTime updateTime; + + /// The analysis parameters that have been specified in the analysis template. + final List? analysisParameters; + + /// The description of the analysis template. + final String? description; + + /// The validations that were performed. + final List? validations; + + CollaborationAnalysisTemplate({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.format, + required this.id, + required this.name, + required this.schema, + required this.source, + required this.updateTime, + this.analysisParameters, + this.description, + this.validations, + }); + + factory CollaborationAnalysisTemplate.fromJson(Map json) { + return CollaborationAnalysisTemplate( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + format: (json['format'] as String).toAnalysisFormat(), + id: json['id'] as String, + name: json['name'] as String, + schema: AnalysisSchema.fromJson(json['schema'] as Map), + source: AnalysisSource.fromJson(json['source'] as Map), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + analysisParameters: (json['analysisParameters'] as List?) + ?.whereNotNull() + .map((e) => AnalysisParameter.fromJson(e as Map)) + .toList(), + description: json['description'] as String?, + validations: (json['validations'] as List?) + ?.whereNotNull() + .map((e) => AnalysisTemplateValidationStatusDetail.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final format = this.format; + final id = this.id; + final name = this.name; + final schema = this.schema; + final source = this.source; + final updateTime = this.updateTime; + final analysisParameters = this.analysisParameters; + final description = this.description; + final validations = this.validations; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'format': format.toValue(), + 'id': id, + 'name': name, + 'schema': schema, + 'source': source, + 'updateTime': unixTimestampToJson(updateTime), + if (analysisParameters != null) 'analysisParameters': analysisParameters, + if (description != null) 'description': description, + if (validations != null) 'validations': validations, + }; + } +} + +/// The metadata of the analysis template within a collaboration. +class CollaborationAnalysisTemplateSummary { + /// The Amazon Resource Name (ARN) of the analysis template. + final String arn; + + /// The unique ARN for the analysis template’s associated collaboration. + final String collaborationArn; + + /// A unique identifier for the collaboration that the analysis templates belong + /// to. Currently accepts collaboration ID. + final String collaborationId; + + /// The time that the summary of the analysis template in a collaboration was + /// created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String creatorAccountId; + + /// The identifier of the analysis template. + final String id; + + /// The name of the analysis template. + final String name; + + /// The time that the summary of the analysis template in the collaboration was + /// last updated. + final DateTime updateTime; + + /// The description of the analysis template. + final String? description; + + CollaborationAnalysisTemplateSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.name, + required this.updateTime, + this.description, + }); + + factory CollaborationAnalysisTemplateSummary.fromJson( + Map json) { + return CollaborationAnalysisTemplateSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// The configured audience model association within a collaboration. +class CollaborationConfiguredAudienceModelAssociation { + /// The Amazon Resource Name (ARN) of the configured audience model association. + final String arn; + + /// The unique ARN for the configured audience model's associated collaboration. + final String collaborationArn; + + /// A unique identifier for the collaboration that the configured audience model + /// associations belong to. Accepts collaboration ID. + final String collaborationId; + + /// The Amazon Resource Name (ARN) of the configure audience model. + final String configuredAudienceModelArn; + + /// The time at which the configured audience model association was created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Only supports + /// AWS account ID. + final String creatorAccountId; + + /// The identifier of the configured audience model association. + final String id; + + /// The name of the configured audience model association. + final String name; + + /// The most recent time at which the configured audience model association was + /// updated. + final DateTime updateTime; + + /// The description of the configured audience model association. + final String? description; + + CollaborationConfiguredAudienceModelAssociation({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.configuredAudienceModelArn, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.name, + required this.updateTime, + this.description, + }); + + factory CollaborationConfiguredAudienceModelAssociation.fromJson( + Map json) { + return CollaborationConfiguredAudienceModelAssociation( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// A summary of the configured audience model association in the collaboration. +class CollaborationConfiguredAudienceModelAssociationSummary { + /// The Amazon Resource Name (ARN) of the configured audience model association. + final String arn; + + /// The unique ARN for the configured audience model's associated collaboration. + final String collaborationArn; + + /// A unique identifier for the collaboration that the configured audience model + /// associations belong to. Accepts collaboration ID. + final String collaborationId; + + /// The time at which the configured audience model association was created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Only supports + /// AWS account ID. + final String creatorAccountId; + + /// The identifier of the configured audience model association. + final String id; + + /// The name of the configured audience model association. + final String name; + + /// The most recent time at which the configured audience model association was + /// updated. + final DateTime updateTime; + + /// The description of the configured audience model association. + final String? description; + + CollaborationConfiguredAudienceModelAssociationSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.name, + required this.updateTime, + this.description, + }); + + factory CollaborationConfiguredAudienceModelAssociationSummary.fromJson( + Map json) { + return CollaborationConfiguredAudienceModelAssociationSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// A summary of the collaboration privacy budgets. This summary includes the +/// collaboration information, creation information, epsilon provided, and +/// utility in terms of aggregations. +class CollaborationPrivacyBudgetSummary { + /// The includes epsilon provided and utility in terms of aggregations. + final PrivacyBudget budget; + + /// The ARN of the collaboration that includes this privacy budget. + final String collaborationArn; + + /// The unique identifier of the collaboration that includes this privacy + /// budget. + final String collaborationId; + + /// The time at which the privacy budget was created. + final DateTime createTime; + + /// The unique identifier of the account that created this privacy budget. + final String creatorAccountId; + + /// The unique identifier of the collaboration privacy budget. + final String id; + + /// The ARN of the collaboration privacy budget template. + final String privacyBudgetTemplateArn; + + /// The unique identifier of the collaboration privacy budget template. + final String privacyBudgetTemplateId; + + /// The type of privacy budget template. + final PrivacyBudgetType type; + + /// The most recent time at which the privacy budget was updated. + final DateTime updateTime; + + CollaborationPrivacyBudgetSummary({ + required this.budget, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.privacyBudgetTemplateArn, + required this.privacyBudgetTemplateId, + required this.type, + required this.updateTime, + }); + + factory CollaborationPrivacyBudgetSummary.fromJson( + Map json) { + return CollaborationPrivacyBudgetSummary( + budget: PrivacyBudget.fromJson(json['budget'] as Map), + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + privacyBudgetTemplateArn: json['privacyBudgetTemplateArn'] as String, + privacyBudgetTemplateId: json['privacyBudgetTemplateId'] as String, + type: (json['type'] as String).toPrivacyBudgetType(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final budget = this.budget; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final privacyBudgetTemplateArn = this.privacyBudgetTemplateArn; + final privacyBudgetTemplateId = this.privacyBudgetTemplateId; + final type = this.type; + final updateTime = this.updateTime; + return { + 'budget': budget, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'privacyBudgetTemplateArn': privacyBudgetTemplateArn, + 'privacyBudgetTemplateId': privacyBudgetTemplateId, + 'type': type.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// An array that specifies the information for a collaboration's privacy budget +/// template. +class CollaborationPrivacyBudgetTemplate { + /// The ARN of the collaboration privacy budget template. + final String arn; + + /// How often the privacy budget refreshes. + /// + /// If you plan to regularly bring new data into the collaboration, use + /// CALENDAR_MONTH to automatically get a new privacy budget for + /// the collaboration every calendar month. Choosing this option allows + /// arbitrary amounts of information to be revealed about rows of the data when + /// repeatedly queried across refreshes. Avoid choosing this if the same rows + /// will be repeatedly queried between privacy budget refreshes. + /// + final PrivacyBudgetTemplateAutoRefresh autoRefresh; + + /// The ARN of the collaboration that includes this collaboration privacy budget + /// template. + final String collaborationArn; + + /// The unique identifier of the collaboration that includes this collaboration + /// privacy budget template. + final String collaborationId; + + /// The time at which the collaboration privacy budget template was created. + final DateTime createTime; + + /// The unique identifier of the account that created this collaboration privacy + /// budget template. + final String creatorAccountId; + + /// The unique identifier of the collaboration privacy budget template. + final String id; + + /// Specifies the epsilon and noise parameters for the privacy budget template. + final PrivacyBudgetTemplateParametersOutput parameters; + + /// The type of privacy budget template. + final PrivacyBudgetType privacyBudgetType; + + /// The most recent time at which the collaboration privacy budget template was + /// updated. + final DateTime updateTime; + + CollaborationPrivacyBudgetTemplate({ + required this.arn, + required this.autoRefresh, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.parameters, + required this.privacyBudgetType, + required this.updateTime, + }); + + factory CollaborationPrivacyBudgetTemplate.fromJson( + Map json) { + return CollaborationPrivacyBudgetTemplate( + arn: json['arn'] as String, + autoRefresh: + (json['autoRefresh'] as String).toPrivacyBudgetTemplateAutoRefresh(), + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + parameters: PrivacyBudgetTemplateParametersOutput.fromJson( + json['parameters'] as Map), + privacyBudgetType: + (json['privacyBudgetType'] as String).toPrivacyBudgetType(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final arn = this.arn; + final autoRefresh = this.autoRefresh; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final parameters = this.parameters; + final privacyBudgetType = this.privacyBudgetType; + final updateTime = this.updateTime; + return { + 'arn': arn, + 'autoRefresh': autoRefresh.toValue(), + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'parameters': parameters, + 'privacyBudgetType': privacyBudgetType.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// A summary of the collaboration's privacy budget template. This summary +/// includes information about who created the privacy budget template and what +/// collaborations it belongs to. +class CollaborationPrivacyBudgetTemplateSummary { + /// The ARN of the collaboration privacy budget template. + final String arn; + + /// The ARN of the collaboration that contains this collaboration privacy budget + /// template. + final String collaborationArn; + + /// The unique identifier of the collaboration that contains this collaboration + /// privacy budget template. + final String collaborationId; + + /// The time at which the collaboration privacy budget template was created. + final DateTime createTime; + + /// The unique identifier of the account that created this collaboration privacy + /// budget template. + final String creatorAccountId; + + /// The unique identifier of the collaboration privacy budget template. + final String id; + + /// The type of the privacy budget template. + final PrivacyBudgetType privacyBudgetType; + + /// The most recent time at which the collaboration privacy budget template was + /// updated. + final DateTime updateTime; + + CollaborationPrivacyBudgetTemplateSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.createTime, + required this.creatorAccountId, + required this.id, + required this.privacyBudgetType, + required this.updateTime, + }); + + factory CollaborationPrivacyBudgetTemplateSummary.fromJson( + Map json) { + return CollaborationPrivacyBudgetTemplateSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + id: json['id'] as String, + privacyBudgetType: + (json['privacyBudgetType'] as String).toPrivacyBudgetType(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final id = this.id; + final privacyBudgetType = this.privacyBudgetType; + final updateTime = this.updateTime; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'id': id, + 'privacyBudgetType': privacyBudgetType.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +enum CollaborationQueryLogStatus { + enabled, + disabled, +} + +extension CollaborationQueryLogStatusValueExtension + on CollaborationQueryLogStatus { + String toValue() { + switch (this) { + case CollaborationQueryLogStatus.enabled: + return 'ENABLED'; + case CollaborationQueryLogStatus.disabled: + return 'DISABLED'; + } + } +} + +extension CollaborationQueryLogStatusFromString on String { + CollaborationQueryLogStatus toCollaborationQueryLogStatus() { + switch (this) { + case 'ENABLED': + return CollaborationQueryLogStatus.enabled; + case 'DISABLED': + return CollaborationQueryLogStatus.disabled; + } + throw Exception('$this is not known in enum CollaborationQueryLogStatus'); + } +} + +/// The metadata of the collaboration. +class CollaborationSummary { + /// The ARN of the collaboration. + final String arn; + + /// The time when the collaboration was created. + final DateTime createTime; + + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String creatorAccountId; + + /// The display name of the collaboration creator. + final String creatorDisplayName; + + /// The identifier for the collaboration. + final String id; + + /// The status of a member in a collaboration. + final MemberStatus memberStatus; + + /// A human-readable identifier provided by the collaboration owner. Display + /// names are not unique. + final String name; + + /// The time the collaboration metadata was last updated. + final DateTime updateTime; + + /// The ARN of a member in a collaboration. + final String? membershipArn; + + /// The identifier of a member in a collaboration. + final String? membershipId; + + CollaborationSummary({ + required this.arn, + required this.createTime, + required this.creatorAccountId, + required this.creatorDisplayName, + required this.id, + required this.memberStatus, + required this.name, + required this.updateTime, + this.membershipArn, + this.membershipId, + }); + + factory CollaborationSummary.fromJson(Map json) { + return CollaborationSummary( + arn: json['arn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + creatorAccountId: json['creatorAccountId'] as String, + creatorDisplayName: json['creatorDisplayName'] as String, + id: json['id'] as String, + memberStatus: (json['memberStatus'] as String).toMemberStatus(), + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + membershipArn: json['membershipArn'] as String?, + membershipId: json['membershipId'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createTime = this.createTime; + final creatorAccountId = this.creatorAccountId; + final creatorDisplayName = this.creatorDisplayName; + final id = this.id; + final memberStatus = this.memberStatus; + final name = this.name; + final updateTime = this.updateTime; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + return { + 'arn': arn, + 'createTime': unixTimestampToJson(createTime), + 'creatorAccountId': creatorAccountId, + 'creatorDisplayName': creatorDisplayName, + 'id': id, + 'memberStatus': memberStatus.toValue(), + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (membershipArn != null) 'membershipArn': membershipArn, + if (membershipId != null) 'membershipId': membershipId, + }; + } +} + +/// A column within a schema relation, derived from the underlying Glue table. +class Column { + /// The name of the column. + final String name; + + /// The type of the column. + final String type; + + Column({ + required this.name, + required this.type, + }); + + factory Column.fromJson(Map json) { + return Column( + name: json['name'] as String, + type: json['type'] as String, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + return { + 'name': name, + 'type': type, + }; + } +} + +/// Details about the configured audience model association. +class ConfiguredAudienceModelAssociation { + /// The Amazon Resource Name (ARN) of the configured audience model association. + final String arn; + + /// The Amazon Resource Name (ARN) of the collaboration that contains this + /// configured audience model association. + final String collaborationArn; + + /// A unique identifier of the collaboration that contains this configured + /// audience model association. + final String collaborationId; + + /// The Amazon Resource Name (ARN) of the configured audience model that was + /// used for this configured audience model association. + final String configuredAudienceModelArn; + + /// The time at which the configured audience model association was created. + final DateTime createTime; + + /// A unique identifier of the configured audience model association. + final String id; + + /// When TRUE, indicates that the resource policy for the + /// configured audience model resource being associated is configured for Clean + /// Rooms to manage permissions related to the given collaboration. When + /// FALSE, indicates that the configured audience model resource + /// owner will manage permissions related to the given collaboration. + final bool manageResourcePolicies; + + /// The Amazon Resource Name (ARN) of the membership that contains this + /// configured audience model association. + final String membershipArn; + + /// A unique identifier for the membership that contains this configured + /// audience model association. + final String membershipId; + + /// The name of the configured audience model association. + final String name; + + /// The most recent time at which the configured audience model association was + /// updated. + final DateTime updateTime; + + /// The description of the configured audience model association. + final String? description; + + ConfiguredAudienceModelAssociation({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.configuredAudienceModelArn, + required this.createTime, + required this.id, + required this.manageResourcePolicies, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.updateTime, + this.description, + }); + + factory ConfiguredAudienceModelAssociation.fromJson( + Map json) { + return ConfiguredAudienceModelAssociation( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + manageResourcePolicies: json['manageResourcePolicies'] as bool, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final id = this.id; + final manageResourcePolicies = this.manageResourcePolicies; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'manageResourcePolicies': manageResourcePolicies, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// A summary of the configured audience model association. +class ConfiguredAudienceModelAssociationSummary { + /// The Amazon Resource Name (ARN) of the configured audience model association. + final String arn; + + /// The Amazon Resource Name (ARN) of the collaboration that contains the + /// configured audience model association. + final String collaborationArn; + + /// A unique identifier of the collaboration that configured audience model is + /// associated with. + final String collaborationId; + + /// The Amazon Resource Name (ARN) of the configured audience model that was + /// used for this configured audience model association. + final String configuredAudienceModelArn; + + /// The time at which the configured audience model association was created. + final DateTime createTime; + + /// A unique identifier of the configured audience model association. + final String id; + + /// The Amazon Resource Name (ARN) of the membership that contains the + /// configured audience model association. + final String membershipArn; + + /// A unique identifier of the membership that contains the configured audience + /// model association. + final String membershipId; + + /// The name of the configured audience model association. + final String name; + + /// The most recent time at which the configured audience model association was + /// updated. + final DateTime updateTime; + + /// The description of the configured audience model association. + final String? description; + + ConfiguredAudienceModelAssociationSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationId, + required this.configuredAudienceModelArn, + required this.createTime, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.updateTime, + this.description, + }); + + factory ConfiguredAudienceModelAssociationSummary.fromJson( + Map json) { + return ConfiguredAudienceModelAssociationSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final id = this.id; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// A table that has been configured for use in a collaboration. +class ConfiguredTable { + /// The columns within the underlying Glue table that can be utilized within + /// collaborations. + final List allowedColumns; + + /// The analysis method for the configured table. The only valid value is + /// currently `DIRECT_QUERY`. + final AnalysisMethod analysisMethod; + + /// The types of analysis rules associated with this configured table. + /// Currently, only one analysis rule may be associated with a configured table. + final List analysisRuleTypes; + + /// The unique ARN for the configured table. + final String arn; + + /// The time the configured table was created. + final DateTime createTime; + + /// The unique ID for the configured table. + final String id; + + /// A name for the configured table. + final String name; + + /// The Glue table that this configured table represents. + final TableReference tableReference; + + /// The time the configured table was last updated + final DateTime updateTime; + + /// A description for the configured table. + final String? description; + + ConfiguredTable({ + required this.allowedColumns, + required this.analysisMethod, + required this.analysisRuleTypes, + required this.arn, + required this.createTime, + required this.id, + required this.name, + required this.tableReference, + required this.updateTime, + this.description, + }); + + factory ConfiguredTable.fromJson(Map json) { + return ConfiguredTable( + allowedColumns: (json['allowedColumns'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + analysisMethod: (json['analysisMethod'] as String).toAnalysisMethod(), + analysisRuleTypes: (json['analysisRuleTypes'] as List) + .whereNotNull() + .map((e) => (e as String).toConfiguredTableAnalysisRuleType()) + .toList(), + arn: json['arn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + name: json['name'] as String, + tableReference: TableReference.fromJson( + json['tableReference'] as Map), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final allowedColumns = this.allowedColumns; + final analysisMethod = this.analysisMethod; + final analysisRuleTypes = this.analysisRuleTypes; + final arn = this.arn; + final createTime = this.createTime; + final id = this.id; + final name = this.name; + final tableReference = this.tableReference; + final updateTime = this.updateTime; + final description = this.description; + return { + 'allowedColumns': allowedColumns, + 'analysisMethod': analysisMethod.toValue(), + 'analysisRuleTypes': analysisRuleTypes.map((e) => e.toValue()).toList(), + 'arn': arn, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'name': name, + 'tableReference': tableReference, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// A configured table analysis rule, which limits how data for this table can +/// be used. +class ConfiguredTableAnalysisRule { + /// The unique ARN for the configured table. + final String configuredTableArn; + + /// The unique ID for the configured table. + final String configuredTableId; + + /// The time the configured table analysis rule was created. + final DateTime createTime; + + /// The policy that controls SQL query rules. + final ConfiguredTableAnalysisRulePolicy policy; + + /// The type of configured table analysis rule. + final ConfiguredTableAnalysisRuleType type; + + /// The time the configured table analysis rule was last updated. + final DateTime updateTime; + + ConfiguredTableAnalysisRule({ + required this.configuredTableArn, + required this.configuredTableId, + required this.createTime, + required this.policy, + required this.type, + required this.updateTime, + }); + + factory ConfiguredTableAnalysisRule.fromJson(Map json) { + return ConfiguredTableAnalysisRule( + configuredTableArn: json['configuredTableArn'] as String, + configuredTableId: json['configuredTableId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + policy: ConfiguredTableAnalysisRulePolicy.fromJson( + json['policy'] as Map), + type: (json['type'] as String).toConfiguredTableAnalysisRuleType(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final configuredTableArn = this.configuredTableArn; + final configuredTableId = this.configuredTableId; + final createTime = this.createTime; + final policy = this.policy; + final type = this.type; + final updateTime = this.updateTime; + return { + 'configuredTableArn': configuredTableArn, + 'configuredTableId': configuredTableId, + 'createTime': unixTimestampToJson(createTime), + 'policy': policy, + 'type': type.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// Controls on the query specifications that can be run on a configured table. +class ConfiguredTableAnalysisRulePolicy { + /// Controls on the query specifications that can be run on a configured table. + final ConfiguredTableAnalysisRulePolicyV1? v1; + + ConfiguredTableAnalysisRulePolicy({ + this.v1, + }); + + factory ConfiguredTableAnalysisRulePolicy.fromJson( + Map json) { + return ConfiguredTableAnalysisRulePolicy( + v1: json['v1'] != null + ? ConfiguredTableAnalysisRulePolicyV1.fromJson( + json['v1'] as Map) + : null, + ); + } + + Map toJson() { + final v1 = this.v1; + return { + if (v1 != null) 'v1': v1, + }; + } +} + +/// Controls on the query specifications that can be run on a configured table. +class ConfiguredTableAnalysisRulePolicyV1 { + /// Analysis rule type that enables only aggregation queries on a configured + /// table. + final AnalysisRuleAggregation? aggregation; + final AnalysisRuleCustom? custom; + + /// Analysis rule type that enables only list queries on a configured table. + final AnalysisRuleList? list; + + ConfiguredTableAnalysisRulePolicyV1({ + this.aggregation, + this.custom, + this.list, + }); + + factory ConfiguredTableAnalysisRulePolicyV1.fromJson( + Map json) { + return ConfiguredTableAnalysisRulePolicyV1( + aggregation: json['aggregation'] != null + ? AnalysisRuleAggregation.fromJson( + json['aggregation'] as Map) + : null, + custom: json['custom'] != null + ? AnalysisRuleCustom.fromJson(json['custom'] as Map) + : null, + list: json['list'] != null + ? AnalysisRuleList.fromJson(json['list'] as Map) + : null, + ); + } + + Map toJson() { + final aggregation = this.aggregation; + final custom = this.custom; + final list = this.list; + return { + if (aggregation != null) 'aggregation': aggregation, + if (custom != null) 'custom': custom, + if (list != null) 'list': list, + }; + } +} + +enum ConfiguredTableAnalysisRuleType { + aggregation, + list, + custom, +} + +extension ConfiguredTableAnalysisRuleTypeValueExtension + on ConfiguredTableAnalysisRuleType { + String toValue() { + switch (this) { + case ConfiguredTableAnalysisRuleType.aggregation: + return 'AGGREGATION'; + case ConfiguredTableAnalysisRuleType.list: + return 'LIST'; + case ConfiguredTableAnalysisRuleType.custom: + return 'CUSTOM'; + } + } +} + +extension ConfiguredTableAnalysisRuleTypeFromString on String { + ConfiguredTableAnalysisRuleType toConfiguredTableAnalysisRuleType() { + switch (this) { + case 'AGGREGATION': + return ConfiguredTableAnalysisRuleType.aggregation; + case 'LIST': + return ConfiguredTableAnalysisRuleType.list; + case 'CUSTOM': + return ConfiguredTableAnalysisRuleType.custom; + } + throw Exception( + '$this is not known in enum ConfiguredTableAnalysisRuleType'); + } +} + +/// A configured table association links a configured table to a collaboration. +class ConfiguredTableAssociation { + /// The unique ARN for the configured table association. + final String arn; + + /// The unique ARN for the configured table that the association refers to. + final String configuredTableArn; + + /// The unique ID for the configured table that the association refers to. + final String configuredTableId; + + /// The time the configured table association was created. + final DateTime createTime; + + /// The unique ID for the configured table association. + final String id; + + /// The unique ARN for the membership this configured table association belongs + /// to. + final String membershipArn; + + /// The unique ID for the membership this configured table association belongs + /// to. + final String membershipId; + + /// The name of the configured table association, in lowercase. The table is + /// identified by this name when running protected queries against the + /// underlying data. + final String name; + + /// The service will assume this role to access catalog metadata and query the + /// table. + final String roleArn; + + /// The time the configured table association was last updated. + final DateTime updateTime; + + /// A description of the configured table association. + final String? description; + + ConfiguredTableAssociation({ + required this.arn, + required this.configuredTableArn, + required this.configuredTableId, + required this.createTime, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.roleArn, + required this.updateTime, + this.description, + }); + + factory ConfiguredTableAssociation.fromJson(Map json) { + return ConfiguredTableAssociation( + arn: json['arn'] as String, + configuredTableArn: json['configuredTableArn'] as String, + configuredTableId: json['configuredTableId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + roleArn: json['roleArn'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final configuredTableArn = this.configuredTableArn; + final configuredTableId = this.configuredTableId; + final createTime = this.createTime; + final id = this.id; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final roleArn = this.roleArn; + final updateTime = this.updateTime; + final description = this.description; + return { + 'arn': arn, + 'configuredTableArn': configuredTableArn, + 'configuredTableId': configuredTableId, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'roleArn': roleArn, + 'updateTime': unixTimestampToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// The configured table association summary for the objects listed by the +/// request. +class ConfiguredTableAssociationSummary { + /// The unique ARN for the configured table association. + final String arn; + + /// The unique configured table ID that this configured table association refers + /// to. + final String configuredTableId; + + /// The time the configured table association was created. + final DateTime createTime; + + /// The unique ID for the configured table association. + final String id; + + /// The unique ARN for the membership that the configured table association + /// belongs to. + final String membershipArn; + + /// The unique ID for the membership that the configured table association + /// belongs to. + final String membershipId; + + /// The name of the configured table association. The table is identified by + /// this name when running Protected Queries against the underlying data. + final String name; + + /// The time the configured table association was last updated. + final DateTime updateTime; + + ConfiguredTableAssociationSummary({ + required this.arn, + required this.configuredTableId, + required this.createTime, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.name, + required this.updateTime, + }); + + factory ConfiguredTableAssociationSummary.fromJson( + Map json) { + return ConfiguredTableAssociationSummary( + arn: json['arn'] as String, + configuredTableId: json['configuredTableId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final arn = this.arn; + final configuredTableId = this.configuredTableId; + final createTime = this.createTime; + final id = this.id; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final name = this.name; + final updateTime = this.updateTime; + return { + 'arn': arn, + 'configuredTableId': configuredTableId, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// The configured table summary for the objects listed by the request. +class ConfiguredTableSummary { + /// The analysis method for the configured tables. The only valid value is + /// currently `DIRECT_QUERY`. + final AnalysisMethod analysisMethod; + + /// The types of analysis rules associated with this configured table. + final List analysisRuleTypes; + + /// The unique ARN of the configured table. + final String arn; + + /// The time the configured table was created. + final DateTime createTime; + + /// The unique ID of the configured table. + final String id; + + /// The name of the configured table. + final String name; + + /// The time the configured table was last updated. + final DateTime updateTime; + + ConfiguredTableSummary({ + required this.analysisMethod, + required this.analysisRuleTypes, + required this.arn, + required this.createTime, + required this.id, + required this.name, + required this.updateTime, + }); + + factory ConfiguredTableSummary.fromJson(Map json) { + return ConfiguredTableSummary( + analysisMethod: (json['analysisMethod'] as String).toAnalysisMethod(), + analysisRuleTypes: (json['analysisRuleTypes'] as List) + .whereNotNull() + .map((e) => (e as String).toConfiguredTableAnalysisRuleType()) .toList(), - function: (json['function'] as String).toAggregateFunctionName(), + arn: json['arn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + name: json['name'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + ); + } + + Map toJson() { + final analysisMethod = this.analysisMethod; + final analysisRuleTypes = this.analysisRuleTypes; + final arn = this.arn; + final createTime = this.createTime; + final id = this.id; + final name = this.name; + final updateTime = this.updateTime; + return { + 'analysisMethod': analysisMethod.toValue(), + 'analysisRuleTypes': analysisRuleTypes.map((e) => e.toValue()).toList(), + 'arn': arn, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'name': name, + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +class CreateAnalysisTemplateOutput { + /// The analysis template. + final AnalysisTemplate analysisTemplate; + + CreateAnalysisTemplateOutput({ + required this.analysisTemplate, + }); + + factory CreateAnalysisTemplateOutput.fromJson(Map json) { + return CreateAnalysisTemplateOutput( + analysisTemplate: AnalysisTemplate.fromJson( + json['analysisTemplate'] as Map), + ); + } + + Map toJson() { + final analysisTemplate = this.analysisTemplate; + return { + 'analysisTemplate': analysisTemplate, + }; + } +} + +class CreateCollaborationOutput { + /// The entire created collaboration object. + final Collaboration collaboration; + + CreateCollaborationOutput({ + required this.collaboration, + }); + + factory CreateCollaborationOutput.fromJson(Map json) { + return CreateCollaborationOutput( + collaboration: + Collaboration.fromJson(json['collaboration'] as Map), + ); + } + + Map toJson() { + final collaboration = this.collaboration; + return { + 'collaboration': collaboration, + }; + } +} + +class CreateConfiguredAudienceModelAssociationOutput { + /// Information about the configured audience model association. + final ConfiguredAudienceModelAssociation configuredAudienceModelAssociation; + + CreateConfiguredAudienceModelAssociationOutput({ + required this.configuredAudienceModelAssociation, + }); + + factory CreateConfiguredAudienceModelAssociationOutput.fromJson( + Map json) { + return CreateConfiguredAudienceModelAssociationOutput( + configuredAudienceModelAssociation: + ConfiguredAudienceModelAssociation.fromJson( + json['configuredAudienceModelAssociation'] + as Map), + ); + } + + Map toJson() { + final configuredAudienceModelAssociation = + this.configuredAudienceModelAssociation; + return { + 'configuredAudienceModelAssociation': configuredAudienceModelAssociation, + }; + } +} + +class CreateConfiguredTableAnalysisRuleOutput { + /// The entire created analysis rule. + final ConfiguredTableAnalysisRule analysisRule; + + CreateConfiguredTableAnalysisRuleOutput({ + required this.analysisRule, + }); + + factory CreateConfiguredTableAnalysisRuleOutput.fromJson( + Map json) { + return CreateConfiguredTableAnalysisRuleOutput( + analysisRule: ConfiguredTableAnalysisRule.fromJson( + json['analysisRule'] as Map), + ); + } + + Map toJson() { + final analysisRule = this.analysisRule; + return { + 'analysisRule': analysisRule, + }; + } +} + +class CreateConfiguredTableAssociationOutput { + /// The entire configured table association object. + final ConfiguredTableAssociation configuredTableAssociation; + + CreateConfiguredTableAssociationOutput({ + required this.configuredTableAssociation, + }); + + factory CreateConfiguredTableAssociationOutput.fromJson( + Map json) { + return CreateConfiguredTableAssociationOutput( + configuredTableAssociation: ConfiguredTableAssociation.fromJson( + json['configuredTableAssociation'] as Map), + ); + } + + Map toJson() { + final configuredTableAssociation = this.configuredTableAssociation; + return { + 'configuredTableAssociation': configuredTableAssociation, + }; + } +} + +class CreateConfiguredTableOutput { + /// The created configured table. + final ConfiguredTable configuredTable; + + CreateConfiguredTableOutput({ + required this.configuredTable, + }); + + factory CreateConfiguredTableOutput.fromJson(Map json) { + return CreateConfiguredTableOutput( + configuredTable: ConfiguredTable.fromJson( + json['configuredTable'] as Map), + ); + } + + Map toJson() { + final configuredTable = this.configuredTable; + return { + 'configuredTable': configuredTable, + }; + } +} + +class CreateMembershipOutput { + /// The membership that was created. + final Membership membership; + + CreateMembershipOutput({ + required this.membership, + }); + + factory CreateMembershipOutput.fromJson(Map json) { + return CreateMembershipOutput( + membership: + Membership.fromJson(json['membership'] as Map), + ); + } + + Map toJson() { + final membership = this.membership; + return { + 'membership': membership, + }; + } +} + +class CreatePrivacyBudgetTemplateOutput { + /// A summary of the elements in the privacy budget template. + final PrivacyBudgetTemplate privacyBudgetTemplate; + + CreatePrivacyBudgetTemplateOutput({ + required this.privacyBudgetTemplate, + }); + + factory CreatePrivacyBudgetTemplateOutput.fromJson( + Map json) { + return CreatePrivacyBudgetTemplateOutput( + privacyBudgetTemplate: PrivacyBudgetTemplate.fromJson( + json['privacyBudgetTemplate'] as Map), + ); + } + + Map toJson() { + final privacyBudgetTemplate = this.privacyBudgetTemplate; + return { + 'privacyBudgetTemplate': privacyBudgetTemplate, + }; + } +} + +/// The settings for client-side encryption for cryptographic computing. +class DataEncryptionMetadata { + /// Indicates whether encrypted tables can contain cleartext data + /// (TRUE) or are to cryptographically process every column + /// (FALSE). + final bool allowCleartext; + + /// Indicates whether Fingerprint columns can contain duplicate entries + /// (TRUE) or are to contain only non-repeated values + /// (FALSE). + final bool allowDuplicates; + + /// Indicates whether Fingerprint columns can be joined on any other Fingerprint + /// column with a different name (TRUE) or can only be joined on + /// Fingerprint columns of the same name (FALSE). + final bool allowJoinsOnColumnsWithDifferentNames; + + /// Indicates whether NULL values are to be copied as NULL to encrypted tables + /// (TRUE) or cryptographically processed (FALSE). + final bool preserveNulls; + + DataEncryptionMetadata({ + required this.allowCleartext, + required this.allowDuplicates, + required this.allowJoinsOnColumnsWithDifferentNames, + required this.preserveNulls, + }); + + factory DataEncryptionMetadata.fromJson(Map json) { + return DataEncryptionMetadata( + allowCleartext: json['allowCleartext'] as bool, + allowDuplicates: json['allowDuplicates'] as bool, + allowJoinsOnColumnsWithDifferentNames: + json['allowJoinsOnColumnsWithDifferentNames'] as bool, + preserveNulls: json['preserveNulls'] as bool, ); } Map toJson() { - final columnNames = this.columnNames; - final function = this.function; + final allowCleartext = this.allowCleartext; + final allowDuplicates = this.allowDuplicates; + final allowJoinsOnColumnsWithDifferentNames = + this.allowJoinsOnColumnsWithDifferentNames; + final preserveNulls = this.preserveNulls; return { - 'columnNames': columnNames, - 'function': function.toValue(), + 'allowCleartext': allowCleartext, + 'allowDuplicates': allowDuplicates, + 'allowJoinsOnColumnsWithDifferentNames': + allowJoinsOnColumnsWithDifferentNames, + 'preserveNulls': preserveNulls, }; } } -enum AggregateFunctionName { - sum, - sumDistinct, - count, - countDistinct, - avg, +class DeleteAnalysisTemplateOutput { + DeleteAnalysisTemplateOutput(); + + factory DeleteAnalysisTemplateOutput.fromJson(Map _) { + return DeleteAnalysisTemplateOutput(); + } + + Map toJson() { + return {}; + } } -extension AggregateFunctionNameValueExtension on AggregateFunctionName { - String toValue() { - switch (this) { - case AggregateFunctionName.sum: - return 'SUM'; - case AggregateFunctionName.sumDistinct: - return 'SUM_DISTINCT'; - case AggregateFunctionName.count: - return 'COUNT'; - case AggregateFunctionName.countDistinct: - return 'COUNT_DISTINCT'; - case AggregateFunctionName.avg: - return 'AVG'; - } +class DeleteCollaborationOutput { + DeleteCollaborationOutput(); + + factory DeleteCollaborationOutput.fromJson(Map _) { + return DeleteCollaborationOutput(); + } + + Map toJson() { + return {}; } } -extension AggregateFunctionNameFromString on String { - AggregateFunctionName toAggregateFunctionName() { - switch (this) { - case 'SUM': - return AggregateFunctionName.sum; - case 'SUM_DISTINCT': - return AggregateFunctionName.sumDistinct; - case 'COUNT': - return AggregateFunctionName.count; - case 'COUNT_DISTINCT': - return AggregateFunctionName.countDistinct; - case 'AVG': - return AggregateFunctionName.avg; - } - throw Exception('$this is not known in enum AggregateFunctionName'); +class DeleteConfiguredAudienceModelAssociationOutput { + DeleteConfiguredAudienceModelAssociationOutput(); + + factory DeleteConfiguredAudienceModelAssociationOutput.fromJson( + Map _) { + return DeleteConfiguredAudienceModelAssociationOutput(); + } + + Map toJson() { + return {}; } } -/// Constraint on query output removing output rows that do not meet a minimum -/// number of distinct values of a specified column. -class AggregationConstraint { - /// Column in aggregation constraint for which there must be a minimum number of - /// distinct values in an output row for it to be in the query output. - final String columnName; +/// An empty response that indicates a successful delete. +class DeleteConfiguredTableAnalysisRuleOutput { + DeleteConfiguredTableAnalysisRuleOutput(); - /// The minimum number of distinct values that an output row must be an - /// aggregation of. Minimum threshold of distinct values for a specified column - /// that must exist in an output row for it to be in the query output. - final int minimum; + factory DeleteConfiguredTableAnalysisRuleOutput.fromJson( + Map _) { + return DeleteConfiguredTableAnalysisRuleOutput(); + } - /// The type of aggregation the constraint allows. The only valid value is - /// currently `COUNT_DISTINCT`. - final AggregationType type; + Map toJson() { + return {}; + } +} - AggregationConstraint({ - required this.columnName, - required this.minimum, - required this.type, - }); +class DeleteConfiguredTableAssociationOutput { + DeleteConfiguredTableAssociationOutput(); - factory AggregationConstraint.fromJson(Map json) { - return AggregationConstraint( - columnName: json['columnName'] as String, - minimum: json['minimum'] as int, - type: (json['type'] as String).toAggregationType(), - ); + factory DeleteConfiguredTableAssociationOutput.fromJson( + Map _) { + return DeleteConfiguredTableAssociationOutput(); } Map toJson() { - final columnName = this.columnName; - final minimum = this.minimum; - final type = this.type; - return { - 'columnName': columnName, - 'minimum': minimum, - 'type': type.toValue(), - }; + return {}; } } -enum AggregationType { +/// The empty output for a successful deletion. +class DeleteConfiguredTableOutput { + DeleteConfiguredTableOutput(); + + factory DeleteConfiguredTableOutput.fromJson(Map _) { + return DeleteConfiguredTableOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteMemberOutput { + DeleteMemberOutput(); + + factory DeleteMemberOutput.fromJson(Map _) { + return DeleteMemberOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteMembershipOutput { + DeleteMembershipOutput(); + + factory DeleteMembershipOutput.fromJson(Map _) { + return DeleteMembershipOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeletePrivacyBudgetTemplateOutput { + DeletePrivacyBudgetTemplateOutput(); + + factory DeletePrivacyBudgetTemplateOutput.fromJson(Map _) { + return DeletePrivacyBudgetTemplateOutput(); + } + + Map toJson() { + return {}; + } +} + +enum DifferentialPrivacyAggregationType { + avg, + count, countDistinct, + sum, + stddev, } -extension AggregationTypeValueExtension on AggregationType { +extension DifferentialPrivacyAggregationTypeValueExtension + on DifferentialPrivacyAggregationType { String toValue() { switch (this) { - case AggregationType.countDistinct: + case DifferentialPrivacyAggregationType.avg: + return 'AVG'; + case DifferentialPrivacyAggregationType.count: + return 'COUNT'; + case DifferentialPrivacyAggregationType.countDistinct: return 'COUNT_DISTINCT'; + case DifferentialPrivacyAggregationType.sum: + return 'SUM'; + case DifferentialPrivacyAggregationType.stddev: + return 'STDDEV'; } } } -extension AggregationTypeFromString on String { - AggregationType toAggregationType() { +extension DifferentialPrivacyAggregationTypeFromString on String { + DifferentialPrivacyAggregationType toDifferentialPrivacyAggregationType() { switch (this) { + case 'AVG': + return DifferentialPrivacyAggregationType.avg; + case 'COUNT': + return DifferentialPrivacyAggregationType.count; case 'COUNT_DISTINCT': - return AggregationType.countDistinct; + return DifferentialPrivacyAggregationType.countDistinct; + case 'SUM': + return DifferentialPrivacyAggregationType.sum; + case 'STDDEV': + return DifferentialPrivacyAggregationType.stddev; } - throw Exception('$this is not known in enum AggregationType'); + throw Exception( + '$this is not known in enum DifferentialPrivacyAggregationType'); } } -enum AnalysisMethod { - directQuery, -} +/// Specifies the name of the column that contains the unique identifier of your +/// users, whose privacy you want to protect. +class DifferentialPrivacyColumn { + /// The name of the column, such as user_id, that contains the unique identifier + /// of your users, whose privacy you want to protect. If you want to turn on + /// differential privacy for two or more tables in a collaboration, you must + /// configure the same column as the user identifier column in both analysis + /// rules. + final String name; -extension AnalysisMethodValueExtension on AnalysisMethod { - String toValue() { - switch (this) { - case AnalysisMethod.directQuery: - return 'DIRECT_QUERY'; - } + DifferentialPrivacyColumn({ + required this.name, + }); + + factory DifferentialPrivacyColumn.fromJson(Map json) { + return DifferentialPrivacyColumn( + name: json['name'] as String, + ); } -} -extension AnalysisMethodFromString on String { - AnalysisMethod toAnalysisMethod() { - switch (this) { - case 'DIRECT_QUERY': - return AnalysisMethod.directQuery; - } - throw Exception('$this is not known in enum AnalysisMethod'); + Map toJson() { + final name = this.name; + return { + 'name': name, + }; } } -/// A specification about how data from the configured table can be used in a -/// query. -class AnalysisRule { - /// The unique ID for the associated collaboration. - final String collaborationId; +/// Specifies the unique identifier for your users. +class DifferentialPrivacyConfiguration { + /// The name of the column (such as user_id) that contains the unique identifier + /// of your users whose privacy you want to protect. If you want to turn on + /// differential privacy for two or more tables in a collaboration, you must + /// configure the same column as the user identifier column in both analysis + /// rules. + final List columns; + + DifferentialPrivacyConfiguration({ + required this.columns, + }); + + factory DifferentialPrivacyConfiguration.fromJson(Map json) { + return DifferentialPrivacyConfiguration( + columns: (json['columns'] as List) + .whereNotNull() + .map((e) => + DifferentialPrivacyColumn.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final columns = this.columns; + return { + 'columns': columns, + }; + } +} - /// The time the analysis rule was created. - final DateTime createTime; +/// An array that contains the sensitivity parameters. +class DifferentialPrivacyParameters { + /// Provides the sensitivity parameters that you can use to better understand + /// the total amount of noise in query results. + final List sensitivityParameters; - /// The name for the analysis rule. - final String name; + DifferentialPrivacyParameters({ + required this.sensitivityParameters, + }); - /// A policy that describes the associated data usage limitations. - final AnalysisRulePolicy policy; + factory DifferentialPrivacyParameters.fromJson(Map json) { + return DifferentialPrivacyParameters( + sensitivityParameters: (json['sensitivityParameters'] as List) + .whereNotNull() + .map((e) => DifferentialPrivacySensitivityParameters.fromJson( + e as Map)) + .toList(), + ); + } - /// The type of analysis rule. Valid values are `AGGREGATION` and `LIST`. - final AnalysisRuleType type; + Map toJson() { + final sensitivityParameters = this.sensitivityParameters; + return { + 'sensitivityParameters': sensitivityParameters, + }; + } +} - /// The time the analysis rule was last updated. - final DateTime updateTime; +/// Provides an estimate of the number of aggregation functions that the member +/// who can query can run given the epsilon and noise parameters. +class DifferentialPrivacyPreviewAggregation { + /// The maximum number of aggregations that the member who can query can run + /// given the epsilon and noise parameters. + final int maxCount; - AnalysisRule({ - required this.collaborationId, - required this.createTime, - required this.name, - required this.policy, + /// The type of aggregation function. + final DifferentialPrivacyAggregationType type; + + DifferentialPrivacyPreviewAggregation({ + required this.maxCount, required this.type, - required this.updateTime, }); - factory AnalysisRule.fromJson(Map json) { - return AnalysisRule( - collaborationId: json['collaborationId'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - name: json['name'] as String, - policy: - AnalysisRulePolicy.fromJson(json['policy'] as Map), - type: (json['type'] as String).toAnalysisRuleType(), - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + factory DifferentialPrivacyPreviewAggregation.fromJson( + Map json) { + return DifferentialPrivacyPreviewAggregation( + maxCount: json['maxCount'] as int, + type: (json['type'] as String).toDifferentialPrivacyAggregationType(), ); } Map toJson() { - final collaborationId = this.collaborationId; - final createTime = this.createTime; - final name = this.name; - final policy = this.policy; + final maxCount = this.maxCount; final type = this.type; - final updateTime = this.updateTime; return { - 'collaborationId': collaborationId, - 'createTime': unixTimestampToJson(createTime), - 'name': name, - 'policy': policy, + 'maxCount': maxCount, 'type': type.toValue(), - 'updateTime': unixTimestampToJson(updateTime), }; } } -/// Enables query structure and specified queries that product aggregate -/// statistics. -class AnalysisRuleAggregation { - /// The columns that query runners are allowed to use in aggregation queries. - final List aggregateColumns; +/// The epsilon and noise parameters that you want to preview. +class DifferentialPrivacyPreviewParametersInput { + /// The epsilon value that you want to preview. + final int epsilon; - /// The columns that query runners are allowed to select, group by, or filter - /// by. - final List dimensionColumns; + /// Noise added per query is measured in terms of the number of users whose + /// contributions you want to obscure. This value governs the rate at which the + /// privacy budget is depleted. + final int usersNoisePerQuery; - /// Columns in configured table that can be used in join statements and/or as - /// aggregate columns. They can never be outputted directly. - final List joinColumns; + DifferentialPrivacyPreviewParametersInput({ + required this.epsilon, + required this.usersNoisePerQuery, + }); - /// Columns that must meet a specific threshold value (after an aggregation - /// function is applied to it) for each output row to be returned. - final List outputConstraints; + Map toJson() { + final epsilon = this.epsilon; + final usersNoisePerQuery = this.usersNoisePerQuery; + return { + 'epsilon': epsilon, + 'usersNoisePerQuery': usersNoisePerQuery, + }; + } +} - /// Set of scalar functions that are allowed to be used on dimension columns and - /// the output of aggregation of metrics. - final List scalarFunctions; +/// Specifies the configured epsilon value and the utility in terms of total +/// aggregations, as well as the remaining aggregations available. +class DifferentialPrivacyPrivacyBudget { + /// This information includes the configured epsilon value and the utility in + /// terms of total aggregations, as well as the remaining aggregations. + final List aggregations; - /// Control that requires member who runs query to do a join with their - /// configured table and/or other configured table in query - final JoinRequiredOption? joinRequired; + /// The epsilon value that you configured. + final int epsilon; - AnalysisRuleAggregation({ - required this.aggregateColumns, - required this.dimensionColumns, - required this.joinColumns, - required this.outputConstraints, - required this.scalarFunctions, - this.joinRequired, + DifferentialPrivacyPrivacyBudget({ + required this.aggregations, + required this.epsilon, }); - factory AnalysisRuleAggregation.fromJson(Map json) { - return AnalysisRuleAggregation( - aggregateColumns: (json['aggregateColumns'] as List) - .whereNotNull() - .map((e) => AggregateColumn.fromJson(e as Map)) - .toList(), - dimensionColumns: (json['dimensionColumns'] as List) - .whereNotNull() - .map((e) => e as String) - .toList(), - joinColumns: (json['joinColumns'] as List) - .whereNotNull() - .map((e) => e as String) - .toList(), - outputConstraints: (json['outputConstraints'] as List) - .whereNotNull() - .map((e) => AggregationConstraint.fromJson(e as Map)) - .toList(), - scalarFunctions: (json['scalarFunctions'] as List) + factory DifferentialPrivacyPrivacyBudget.fromJson(Map json) { + return DifferentialPrivacyPrivacyBudget( + aggregations: (json['aggregations'] as List) .whereNotNull() - .map((e) => (e as String).toScalarFunctions()) + .map((e) => DifferentialPrivacyPrivacyBudgetAggregation.fromJson( + e as Map)) .toList(), - joinRequired: (json['joinRequired'] as String?)?.toJoinRequiredOption(), + epsilon: json['epsilon'] as int, ); } Map toJson() { - final aggregateColumns = this.aggregateColumns; - final dimensionColumns = this.dimensionColumns; - final joinColumns = this.joinColumns; - final outputConstraints = this.outputConstraints; - final scalarFunctions = this.scalarFunctions; - final joinRequired = this.joinRequired; + final aggregations = this.aggregations; + final epsilon = this.epsilon; return { - 'aggregateColumns': aggregateColumns, - 'dimensionColumns': dimensionColumns, - 'joinColumns': joinColumns, - 'outputConstraints': outputConstraints, - 'scalarFunctions': scalarFunctions.map((e) => e.toValue()).toList(), - if (joinRequired != null) 'joinRequired': joinRequired.toValue(), + 'aggregations': aggregations, + 'epsilon': epsilon, }; } } -/// A type of analysis rule that enables row-level analysis. -class AnalysisRuleList { - /// Columns that can be used to join a configured table with the table of the - /// member who can query and another members' configured tables. - final List joinColumns; +/// Information about the total number of aggregations, as well as the remaining +/// aggregations. +class DifferentialPrivacyPrivacyBudgetAggregation { + /// The maximum number of aggregation functions that you can perform with the + /// given privacy budget. + final int maxCount; - /// Columns that can be listed in the output. - final List listColumns; + /// The remaining number of aggregation functions that can be run with the + /// available privacy budget. + final int remainingCount; - AnalysisRuleList({ - required this.joinColumns, - required this.listColumns, + /// The different types of aggregation functions that you can perform. + final DifferentialPrivacyAggregationType type; + + DifferentialPrivacyPrivacyBudgetAggregation({ + required this.maxCount, + required this.remainingCount, + required this.type, }); - factory AnalysisRuleList.fromJson(Map json) { - return AnalysisRuleList( - joinColumns: (json['joinColumns'] as List) - .whereNotNull() - .map((e) => e as String) - .toList(), - listColumns: (json['listColumns'] as List) + factory DifferentialPrivacyPrivacyBudgetAggregation.fromJson( + Map json) { + return DifferentialPrivacyPrivacyBudgetAggregation( + maxCount: json['maxCount'] as int, + remainingCount: json['remainingCount'] as int, + type: (json['type'] as String).toDifferentialPrivacyAggregationType(), + ); + } + + Map toJson() { + final maxCount = this.maxCount; + final remainingCount = this.remainingCount; + final type = this.type; + return { + 'maxCount': maxCount, + 'remainingCount': remainingCount, + 'type': type.toValue(), + }; + } +} + +/// Information about the number of aggregation functions that the member who +/// can query can run given the epsilon and noise parameters. +class DifferentialPrivacyPrivacyImpact { + /// The number of aggregation functions that you can perform. + final List aggregations; + + DifferentialPrivacyPrivacyImpact({ + required this.aggregations, + }); + + factory DifferentialPrivacyPrivacyImpact.fromJson(Map json) { + return DifferentialPrivacyPrivacyImpact( + aggregations: (json['aggregations'] as List) .whereNotNull() - .map((e) => e as String) + .map((e) => DifferentialPrivacyPreviewAggregation.fromJson( + e as Map)) .toList(), ); } Map toJson() { - final joinColumns = this.joinColumns; - final listColumns = this.listColumns; + final aggregations = this.aggregations; return { - 'joinColumns': joinColumns, - 'listColumns': listColumns, + 'aggregations': aggregations, }; } } -/// Controls on the query specifications that can be run on configured table.. -class AnalysisRulePolicy { - /// Controls on the query specifications that can be run on configured table.. - final AnalysisRulePolicyV1? v1; +/// Provides the sensitivity parameters. +class DifferentialPrivacySensitivityParameters { + /// The aggregation expression that was run. + final String aggregationExpression; - AnalysisRulePolicy({ - this.v1, + /// The type of aggregation function that was run. + final DifferentialPrivacyAggregationType aggregationType; + + /// The maximum number of rows contributed by a user in a SQL query. + final int userContributionLimit; + + /// The upper bound of the aggregation expression. + final double? maxColumnValue; + + /// The lower bound of the aggregation expression. + final double? minColumnValue; + + DifferentialPrivacySensitivityParameters({ + required this.aggregationExpression, + required this.aggregationType, + required this.userContributionLimit, + this.maxColumnValue, + this.minColumnValue, }); - factory AnalysisRulePolicy.fromJson(Map json) { - return AnalysisRulePolicy( - v1: json['v1'] != null - ? AnalysisRulePolicyV1.fromJson(json['v1'] as Map) - : null, + factory DifferentialPrivacySensitivityParameters.fromJson( + Map json) { + return DifferentialPrivacySensitivityParameters( + aggregationExpression: json['aggregationExpression'] as String, + aggregationType: (json['aggregationType'] as String) + .toDifferentialPrivacyAggregationType(), + userContributionLimit: json['userContributionLimit'] as int, + maxColumnValue: json['maxColumnValue'] as double?, + minColumnValue: json['minColumnValue'] as double?, ); } Map toJson() { - final v1 = this.v1; + final aggregationExpression = this.aggregationExpression; + final aggregationType = this.aggregationType; + final userContributionLimit = this.userContributionLimit; + final maxColumnValue = this.maxColumnValue; + final minColumnValue = this.minColumnValue; return { - if (v1 != null) 'v1': v1, + 'aggregationExpression': aggregationExpression, + 'aggregationType': aggregationType.toValue(), + 'userContributionLimit': userContributionLimit, + if (maxColumnValue != null) 'maxColumnValue': maxColumnValue, + if (minColumnValue != null) 'minColumnValue': minColumnValue, }; } } -/// Controls on the query specifications that can be run on configured table.. -class AnalysisRulePolicyV1 { - /// Analysis rule type that enables only aggregation queries on a configured - /// table. - final AnalysisRuleAggregation? aggregation; +/// The epsilon and noise parameter values that you want to use for the +/// differential privacy template. +class DifferentialPrivacyTemplateParametersInput { + /// The epsilon value that you want to use. + final int epsilon; - /// Analysis rule type that enables only list queries on a configured table. - final AnalysisRuleList? list; + /// Noise added per query is measured in terms of the number of users whose + /// contributions you want to obscure. This value governs the rate at which the + /// privacy budget is depleted. + final int usersNoisePerQuery; - AnalysisRulePolicyV1({ - this.aggregation, - this.list, + DifferentialPrivacyTemplateParametersInput({ + required this.epsilon, + required this.usersNoisePerQuery, }); - factory AnalysisRulePolicyV1.fromJson(Map json) { - return AnalysisRulePolicyV1( - aggregation: json['aggregation'] != null - ? AnalysisRuleAggregation.fromJson( - json['aggregation'] as Map) - : null, - list: json['list'] != null - ? AnalysisRuleList.fromJson(json['list'] as Map) - : null, + Map toJson() { + final epsilon = this.epsilon; + final usersNoisePerQuery = this.usersNoisePerQuery; + return { + 'epsilon': epsilon, + 'usersNoisePerQuery': usersNoisePerQuery, + }; + } +} + +/// The epsilon and noise parameter values that were used for the differential +/// privacy template. +class DifferentialPrivacyTemplateParametersOutput { + /// The epsilon value that you specified. + final int epsilon; + + /// Noise added per query is measured in terms of the number of users whose + /// contributions you want to obscure. This value governs the rate at which the + /// privacy budget is depleted. + final int usersNoisePerQuery; + + DifferentialPrivacyTemplateParametersOutput({ + required this.epsilon, + required this.usersNoisePerQuery, + }); + + factory DifferentialPrivacyTemplateParametersOutput.fromJson( + Map json) { + return DifferentialPrivacyTemplateParametersOutput( + epsilon: json['epsilon'] as int, + usersNoisePerQuery: json['usersNoisePerQuery'] as int, ); } Map toJson() { - final aggregation = this.aggregation; - final list = this.list; + final epsilon = this.epsilon; + final usersNoisePerQuery = this.usersNoisePerQuery; return { - if (aggregation != null) 'aggregation': aggregation, - if (list != null) 'list': list, + 'epsilon': epsilon, + 'usersNoisePerQuery': usersNoisePerQuery, }; } } -enum AnalysisRuleType { - aggregation, - list, +/// The epsilon and noise parameter values that you want to update in the +/// differential privacy template. +class DifferentialPrivacyTemplateUpdateParameters { + /// The updated epsilon value that you want to use. + final int? epsilon; + + /// The updated value of noise added per query. It is measured in terms of the + /// number of users whose contributions you want to obscure. This value governs + /// the rate at which the privacy budget is depleted. + final int? usersNoisePerQuery; + + DifferentialPrivacyTemplateUpdateParameters({ + this.epsilon, + this.usersNoisePerQuery, + }); + + Map toJson() { + final epsilon = this.epsilon; + final usersNoisePerQuery = this.usersNoisePerQuery; + return { + if (epsilon != null) 'epsilon': epsilon, + if (usersNoisePerQuery != null) 'usersNoisePerQuery': usersNoisePerQuery, + }; + } } -extension AnalysisRuleTypeValueExtension on AnalysisRuleType { +enum FilterableMemberStatus { + invited, + active, +} + +extension FilterableMemberStatusValueExtension on FilterableMemberStatus { String toValue() { switch (this) { - case AnalysisRuleType.aggregation: - return 'AGGREGATION'; - case AnalysisRuleType.list: - return 'LIST'; + case FilterableMemberStatus.invited: + return 'INVITED'; + case FilterableMemberStatus.active: + return 'ACTIVE'; } } } -extension AnalysisRuleTypeFromString on String { - AnalysisRuleType toAnalysisRuleType() { +extension FilterableMemberStatusFromString on String { + FilterableMemberStatus toFilterableMemberStatus() { switch (this) { - case 'AGGREGATION': - return AnalysisRuleType.aggregation; - case 'LIST': - return AnalysisRuleType.list; + case 'INVITED': + return FilterableMemberStatus.invited; + case 'ACTIVE': + return FilterableMemberStatus.active; } - throw Exception('$this is not known in enum AnalysisRuleType'); + throw Exception('$this is not known in enum FilterableMemberStatus'); } -} - -/// An error describing why a schema could not be fetched. -class BatchGetSchemaError { - /// An error code for the error. - final String code; - - /// An error message for the error. - final String message; - - /// An error name for the error. - final String name; - - BatchGetSchemaError({ - required this.code, - required this.message, - required this.name, +} + +class GetAnalysisTemplateOutput { + /// The analysis template. + final AnalysisTemplate analysisTemplate; + + GetAnalysisTemplateOutput({ + required this.analysisTemplate, }); - factory BatchGetSchemaError.fromJson(Map json) { - return BatchGetSchemaError( - code: json['code'] as String, - message: json['message'] as String, - name: json['name'] as String, + factory GetAnalysisTemplateOutput.fromJson(Map json) { + return GetAnalysisTemplateOutput( + analysisTemplate: AnalysisTemplate.fromJson( + json['analysisTemplate'] as Map), ); } Map toJson() { - final code = this.code; - final message = this.message; - final name = this.name; + final analysisTemplate = this.analysisTemplate; return { - 'code': code, - 'message': message, - 'name': name, + 'analysisTemplate': analysisTemplate, }; } } -class BatchGetSchemaOutput { - /// Error reasons for schemas that could not be retrieved. One error is returned - /// for every schema that could not be retrieved. - final List errors; - - /// The retrieved list of schemas. - final List schemas; +class GetCollaborationAnalysisTemplateOutput { + /// The analysis template within a collaboration. + final CollaborationAnalysisTemplate collaborationAnalysisTemplate; - BatchGetSchemaOutput({ - required this.errors, - required this.schemas, + GetCollaborationAnalysisTemplateOutput({ + required this.collaborationAnalysisTemplate, }); - factory BatchGetSchemaOutput.fromJson(Map json) { - return BatchGetSchemaOutput( - errors: (json['errors'] as List) - .whereNotNull() - .map((e) => BatchGetSchemaError.fromJson(e as Map)) - .toList(), - schemas: (json['schemas'] as List) - .whereNotNull() - .map((e) => Schema.fromJson(e as Map)) - .toList(), + factory GetCollaborationAnalysisTemplateOutput.fromJson( + Map json) { + return GetCollaborationAnalysisTemplateOutput( + collaborationAnalysisTemplate: CollaborationAnalysisTemplate.fromJson( + json['collaborationAnalysisTemplate'] as Map), ); } Map toJson() { - final errors = this.errors; - final schemas = this.schemas; + final collaborationAnalysisTemplate = this.collaborationAnalysisTemplate; return { - 'errors': errors, - 'schemas': schemas, + 'collaborationAnalysisTemplate': collaborationAnalysisTemplate, }; } } -/// The multi-party data share environment. The collaboration contains metadata -/// about its purpose and participants. -class Collaboration { - /// The unique ARN for the collaboration. - final String arn; - - /// The time when the collaboration was created. - final DateTime createTime; - - /// The identifier used to reference members of the collaboration. Currently - /// only supports AWS account ID. - final String creatorAccountId; - - /// A display name of the collaboration creator. - final String creatorDisplayName; - - /// The unique ID for the collaboration. - final String id; - - /// The status of a member in a collaboration. - final MemberStatus memberStatus; - - /// A human-readable identifier provided by the collaboration owner. Display - /// names are not unique. - final String name; - - /// An indicator as to whether query logging has been enabled or disabled for - /// the collaboration. - final CollaborationQueryLogStatus queryLogStatus; - - /// The time the collaboration metadata was last updated. - final DateTime updateTime; - - /// The settings for client-side encryption for cryptographic computing. - final DataEncryptionMetadata? dataEncryptionMetadata; - - /// A description of the collaboration provided by the collaboration owner. - final String? description; - - /// The unique ARN for your membership within the collaboration. - final String? membershipArn; - - /// The unique ID for your membership within the collaboration. - final String? membershipId; +class GetCollaborationConfiguredAudienceModelAssociationOutput { + /// The metadata of the configured audience model association. + final CollaborationConfiguredAudienceModelAssociation + collaborationConfiguredAudienceModelAssociation; - Collaboration({ - required this.arn, - required this.createTime, - required this.creatorAccountId, - required this.creatorDisplayName, - required this.id, - required this.memberStatus, - required this.name, - required this.queryLogStatus, - required this.updateTime, - this.dataEncryptionMetadata, - this.description, - this.membershipArn, - this.membershipId, + GetCollaborationConfiguredAudienceModelAssociationOutput({ + required this.collaborationConfiguredAudienceModelAssociation, }); - factory Collaboration.fromJson(Map json) { - return Collaboration( - arn: json['arn'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - creatorAccountId: json['creatorAccountId'] as String, - creatorDisplayName: json['creatorDisplayName'] as String, - id: json['id'] as String, - memberStatus: (json['memberStatus'] as String).toMemberStatus(), - name: json['name'] as String, - queryLogStatus: - (json['queryLogStatus'] as String).toCollaborationQueryLogStatus(), - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), - dataEncryptionMetadata: json['dataEncryptionMetadata'] != null - ? DataEncryptionMetadata.fromJson( - json['dataEncryptionMetadata'] as Map) - : null, - description: json['description'] as String?, - membershipArn: json['membershipArn'] as String?, - membershipId: json['membershipId'] as String?, + factory GetCollaborationConfiguredAudienceModelAssociationOutput.fromJson( + Map json) { + return GetCollaborationConfiguredAudienceModelAssociationOutput( + collaborationConfiguredAudienceModelAssociation: + CollaborationConfiguredAudienceModelAssociation.fromJson( + json['collaborationConfiguredAudienceModelAssociation'] + as Map), ); } Map toJson() { - final arn = this.arn; - final createTime = this.createTime; - final creatorAccountId = this.creatorAccountId; - final creatorDisplayName = this.creatorDisplayName; - final id = this.id; - final memberStatus = this.memberStatus; - final name = this.name; - final queryLogStatus = this.queryLogStatus; - final updateTime = this.updateTime; - final dataEncryptionMetadata = this.dataEncryptionMetadata; - final description = this.description; - final membershipArn = this.membershipArn; - final membershipId = this.membershipId; + final collaborationConfiguredAudienceModelAssociation = + this.collaborationConfiguredAudienceModelAssociation; return { - 'arn': arn, - 'createTime': unixTimestampToJson(createTime), - 'creatorAccountId': creatorAccountId, - 'creatorDisplayName': creatorDisplayName, - 'id': id, - 'memberStatus': memberStatus.toValue(), - 'name': name, - 'queryLogStatus': queryLogStatus.toValue(), - 'updateTime': unixTimestampToJson(updateTime), - if (dataEncryptionMetadata != null) - 'dataEncryptionMetadata': dataEncryptionMetadata, - if (description != null) 'description': description, - if (membershipArn != null) 'membershipArn': membershipArn, - if (membershipId != null) 'membershipId': membershipId, + 'collaborationConfiguredAudienceModelAssociation': + collaborationConfiguredAudienceModelAssociation, }; } } -enum CollaborationQueryLogStatus { - enabled, - disabled, -} +class GetCollaborationOutput { + /// The entire collaboration for this identifier. + final Collaboration collaboration; -extension CollaborationQueryLogStatusValueExtension - on CollaborationQueryLogStatus { - String toValue() { - switch (this) { - case CollaborationQueryLogStatus.enabled: - return 'ENABLED'; - case CollaborationQueryLogStatus.disabled: - return 'DISABLED'; - } + GetCollaborationOutput({ + required this.collaboration, + }); + + factory GetCollaborationOutput.fromJson(Map json) { + return GetCollaborationOutput( + collaboration: + Collaboration.fromJson(json['collaboration'] as Map), + ); } -} -extension CollaborationQueryLogStatusFromString on String { - CollaborationQueryLogStatus toCollaborationQueryLogStatus() { - switch (this) { - case 'ENABLED': - return CollaborationQueryLogStatus.enabled; - case 'DISABLED': - return CollaborationQueryLogStatus.disabled; - } - throw Exception('$this is not known in enum CollaborationQueryLogStatus'); + Map toJson() { + final collaboration = this.collaboration; + return { + 'collaboration': collaboration, + }; } } -/// The metadata of the collaboration. -class CollaborationSummary { - /// The ARN of the collaboration. - final String arn; - - /// The time when the collaboration was created. - final DateTime createTime; +class GetCollaborationPrivacyBudgetTemplateOutput { + /// Returns the details of the privacy budget template that you requested. + final CollaborationPrivacyBudgetTemplate collaborationPrivacyBudgetTemplate; - /// The identifier used to reference members of the collaboration. Currently - /// only supports AWS Account ID. - final String creatorAccountId; + GetCollaborationPrivacyBudgetTemplateOutput({ + required this.collaborationPrivacyBudgetTemplate, + }); - /// The display name of the collaboration creator. - final String creatorDisplayName; + factory GetCollaborationPrivacyBudgetTemplateOutput.fromJson( + Map json) { + return GetCollaborationPrivacyBudgetTemplateOutput( + collaborationPrivacyBudgetTemplate: + CollaborationPrivacyBudgetTemplate.fromJson( + json['collaborationPrivacyBudgetTemplate'] + as Map), + ); + } - /// The identifier for the collaboration. - final String id; + Map toJson() { + final collaborationPrivacyBudgetTemplate = + this.collaborationPrivacyBudgetTemplate; + return { + 'collaborationPrivacyBudgetTemplate': collaborationPrivacyBudgetTemplate, + }; + } +} - /// The status of a member in a collaboration. - final MemberStatus memberStatus; +class GetConfiguredAudienceModelAssociationOutput { + /// Information about the configured audience model association that you + /// requested. + final ConfiguredAudienceModelAssociation configuredAudienceModelAssociation; - /// A human-readable identifier provided by the collaboration owner. Display - /// names are not unique. - final String name; + GetConfiguredAudienceModelAssociationOutput({ + required this.configuredAudienceModelAssociation, + }); - /// The time the collaboration metadata was last updated. - final DateTime updateTime; + factory GetConfiguredAudienceModelAssociationOutput.fromJson( + Map json) { + return GetConfiguredAudienceModelAssociationOutput( + configuredAudienceModelAssociation: + ConfiguredAudienceModelAssociation.fromJson( + json['configuredAudienceModelAssociation'] + as Map), + ); + } - /// The ARN of a member in a collaboration. - final String? membershipArn; + Map toJson() { + final configuredAudienceModelAssociation = + this.configuredAudienceModelAssociation; + return { + 'configuredAudienceModelAssociation': configuredAudienceModelAssociation, + }; + } +} - /// The identifier of a member in a collaboration. - final String? membershipId; +class GetConfiguredTableAnalysisRuleOutput { + /// The entire analysis rule output. + final ConfiguredTableAnalysisRule analysisRule; - CollaborationSummary({ - required this.arn, - required this.createTime, - required this.creatorAccountId, - required this.creatorDisplayName, - required this.id, - required this.memberStatus, - required this.name, - required this.updateTime, - this.membershipArn, - this.membershipId, + GetConfiguredTableAnalysisRuleOutput({ + required this.analysisRule, }); - factory CollaborationSummary.fromJson(Map json) { - return CollaborationSummary( - arn: json['arn'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - creatorAccountId: json['creatorAccountId'] as String, - creatorDisplayName: json['creatorDisplayName'] as String, - id: json['id'] as String, - memberStatus: (json['memberStatus'] as String).toMemberStatus(), - name: json['name'] as String, - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), - membershipArn: json['membershipArn'] as String?, - membershipId: json['membershipId'] as String?, + factory GetConfiguredTableAnalysisRuleOutput.fromJson( + Map json) { + return GetConfiguredTableAnalysisRuleOutput( + analysisRule: ConfiguredTableAnalysisRule.fromJson( + json['analysisRule'] as Map), ); } Map toJson() { - final arn = this.arn; - final createTime = this.createTime; - final creatorAccountId = this.creatorAccountId; - final creatorDisplayName = this.creatorDisplayName; - final id = this.id; - final memberStatus = this.memberStatus; - final name = this.name; - final updateTime = this.updateTime; - final membershipArn = this.membershipArn; - final membershipId = this.membershipId; + final analysisRule = this.analysisRule; return { - 'arn': arn, - 'createTime': unixTimestampToJson(createTime), - 'creatorAccountId': creatorAccountId, - 'creatorDisplayName': creatorDisplayName, - 'id': id, - 'memberStatus': memberStatus.toValue(), - 'name': name, - 'updateTime': unixTimestampToJson(updateTime), - if (membershipArn != null) 'membershipArn': membershipArn, - if (membershipId != null) 'membershipId': membershipId, + 'analysisRule': analysisRule, }; } } -/// A column within a schema relation, derived from the underlying AWS Glue -/// table. -class Column { - /// The name of the column. - final String name; - - /// The type of the column. - final String type; +class GetConfiguredTableAssociationOutput { + /// The entire configured table association object. + final ConfiguredTableAssociation configuredTableAssociation; - Column({ - required this.name, - required this.type, + GetConfiguredTableAssociationOutput({ + required this.configuredTableAssociation, }); - factory Column.fromJson(Map json) { - return Column( - name: json['name'] as String, - type: json['type'] as String, + factory GetConfiguredTableAssociationOutput.fromJson( + Map json) { + return GetConfiguredTableAssociationOutput( + configuredTableAssociation: ConfiguredTableAssociation.fromJson( + json['configuredTableAssociation'] as Map), ); } Map toJson() { - final name = this.name; - final type = this.type; + final configuredTableAssociation = this.configuredTableAssociation; return { - 'name': name, - 'type': type, + 'configuredTableAssociation': configuredTableAssociation, }; } } -/// A table that has been configured for use in a collaboration. -class ConfiguredTable { - /// The columns within the underlying AWS Glue table that can be utilized within - /// collaborations. - final List allowedColumns; - - /// The analysis method for the configured table. The only valid value is - /// currently `DIRECT_QUERY`. - final AnalysisMethod analysisMethod; +class GetConfiguredTableOutput { + /// The retrieved configured table. + final ConfiguredTable configuredTable; - /// The types of analysis rules associated with this configured table. Valid - /// values are `AGGREGATION` and `LIST`. Currently, only one analysis rule may - /// be associated with a configured table. - final List analysisRuleTypes; + GetConfiguredTableOutput({ + required this.configuredTable, + }); - /// The unique ARN for the configured table. - final String arn; + factory GetConfiguredTableOutput.fromJson(Map json) { + return GetConfiguredTableOutput( + configuredTable: ConfiguredTable.fromJson( + json['configuredTable'] as Map), + ); + } - /// The time the configured table was created. - final DateTime createTime; + Map toJson() { + final configuredTable = this.configuredTable; + return { + 'configuredTable': configuredTable, + }; + } +} - /// The unique ID for the configured table. - final String id; +class GetMembershipOutput { + /// The membership retrieved for the provided identifier. + final Membership membership; - /// A name for the configured table. - final String name; + GetMembershipOutput({ + required this.membership, + }); - /// The AWS Glue table that this configured table represents. - final TableReference tableReference; + factory GetMembershipOutput.fromJson(Map json) { + return GetMembershipOutput( + membership: + Membership.fromJson(json['membership'] as Map), + ); + } - /// The time the configured table was last updated - final DateTime updateTime; + Map toJson() { + final membership = this.membership; + return { + 'membership': membership, + }; + } +} - /// A description for the configured table. - final String? description; +class GetPrivacyBudgetTemplateOutput { + /// Returns the details of the privacy budget template that you requested. + final PrivacyBudgetTemplate privacyBudgetTemplate; - ConfiguredTable({ - required this.allowedColumns, - required this.analysisMethod, - required this.analysisRuleTypes, - required this.arn, - required this.createTime, - required this.id, - required this.name, - required this.tableReference, - required this.updateTime, - this.description, + GetPrivacyBudgetTemplateOutput({ + required this.privacyBudgetTemplate, }); - factory ConfiguredTable.fromJson(Map json) { - return ConfiguredTable( - allowedColumns: (json['allowedColumns'] as List) - .whereNotNull() - .map((e) => e as String) - .toList(), - analysisMethod: (json['analysisMethod'] as String).toAnalysisMethod(), - analysisRuleTypes: (json['analysisRuleTypes'] as List) - .whereNotNull() - .map((e) => (e as String).toConfiguredTableAnalysisRuleType()) - .toList(), - arn: json['arn'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - id: json['id'] as String, - name: json['name'] as String, - tableReference: TableReference.fromJson( - json['tableReference'] as Map), - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), - description: json['description'] as String?, + factory GetPrivacyBudgetTemplateOutput.fromJson(Map json) { + return GetPrivacyBudgetTemplateOutput( + privacyBudgetTemplate: PrivacyBudgetTemplate.fromJson( + json['privacyBudgetTemplate'] as Map), ); } Map toJson() { - final allowedColumns = this.allowedColumns; - final analysisMethod = this.analysisMethod; - final analysisRuleTypes = this.analysisRuleTypes; - final arn = this.arn; - final createTime = this.createTime; - final id = this.id; - final name = this.name; - final tableReference = this.tableReference; - final updateTime = this.updateTime; - final description = this.description; + final privacyBudgetTemplate = this.privacyBudgetTemplate; return { - 'allowedColumns': allowedColumns, - 'analysisMethod': analysisMethod.toValue(), - 'analysisRuleTypes': analysisRuleTypes.map((e) => e.toValue()).toList(), - 'arn': arn, - 'createTime': unixTimestampToJson(createTime), - 'id': id, - 'name': name, - 'tableReference': tableReference, - 'updateTime': unixTimestampToJson(updateTime), - if (description != null) 'description': description, + 'privacyBudgetTemplate': privacyBudgetTemplate, }; } } -/// A configured table analysis rule, which limits how data for this table can -/// be used. -class ConfiguredTableAnalysisRule { - /// The unique ARN for the configured table. - final String configuredTableArn; - - /// The unique ID for the configured table. - final String configuredTableId; +class GetProtectedQueryOutput { + /// The query processing metadata. + final ProtectedQuery protectedQuery; - /// The time the configured table analysis rule was created. - final DateTime createTime; + GetProtectedQueryOutput({ + required this.protectedQuery, + }); - /// The policy that controls SQL query rules. - final ConfiguredTableAnalysisRulePolicy policy; + factory GetProtectedQueryOutput.fromJson(Map json) { + return GetProtectedQueryOutput( + protectedQuery: ProtectedQuery.fromJson( + json['protectedQuery'] as Map), + ); + } - /// The type of configured table analysis rule. Valid values are `AGGREGATION` - /// and `LIST`. - final ConfiguredTableAnalysisRuleType type; + Map toJson() { + final protectedQuery = this.protectedQuery; + return { + 'protectedQuery': protectedQuery, + }; + } +} - /// The time the configured table analysis rule was last updated. - final DateTime updateTime; +class GetSchemaAnalysisRuleOutput { + /// A specification about how data from the configured table can be used. + final AnalysisRule analysisRule; - ConfiguredTableAnalysisRule({ - required this.configuredTableArn, - required this.configuredTableId, - required this.createTime, - required this.policy, - required this.type, - required this.updateTime, + GetSchemaAnalysisRuleOutput({ + required this.analysisRule, }); - factory ConfiguredTableAnalysisRule.fromJson(Map json) { - return ConfiguredTableAnalysisRule( - configuredTableArn: json['configuredTableArn'] as String, - configuredTableId: json['configuredTableId'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - policy: ConfiguredTableAnalysisRulePolicy.fromJson( - json['policy'] as Map), - type: (json['type'] as String).toConfiguredTableAnalysisRuleType(), - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + factory GetSchemaAnalysisRuleOutput.fromJson(Map json) { + return GetSchemaAnalysisRuleOutput( + analysisRule: + AnalysisRule.fromJson(json['analysisRule'] as Map), ); } Map toJson() { - final configuredTableArn = this.configuredTableArn; - final configuredTableId = this.configuredTableId; - final createTime = this.createTime; - final policy = this.policy; - final type = this.type; - final updateTime = this.updateTime; + final analysisRule = this.analysisRule; return { - 'configuredTableArn': configuredTableArn, - 'configuredTableId': configuredTableId, - 'createTime': unixTimestampToJson(createTime), - 'policy': policy, - 'type': type.toValue(), - 'updateTime': unixTimestampToJson(updateTime), + 'analysisRule': analysisRule, }; } } -/// Controls on the query specifications that can be run on a configured table. -class ConfiguredTableAnalysisRulePolicy { - /// Controls on the query specifications that can be run on a configured table. - final ConfiguredTableAnalysisRulePolicyV1? v1; +class GetSchemaOutput { + /// The entire schema object. + final Schema schema; - ConfiguredTableAnalysisRulePolicy({ - this.v1, + GetSchemaOutput({ + required this.schema, }); - factory ConfiguredTableAnalysisRulePolicy.fromJson( - Map json) { - return ConfiguredTableAnalysisRulePolicy( - v1: json['v1'] != null - ? ConfiguredTableAnalysisRulePolicyV1.fromJson( - json['v1'] as Map) - : null, + factory GetSchemaOutput.fromJson(Map json) { + return GetSchemaOutput( + schema: Schema.fromJson(json['schema'] as Map), ); } Map toJson() { - final v1 = this.v1; + final schema = this.schema; return { - if (v1 != null) 'v1': v1, + 'schema': schema, }; } } -/// Controls on the query specifications that can be run on a configured table. -class ConfiguredTableAnalysisRulePolicyV1 { - /// Analysis rule type that enables only aggregation queries on a configured - /// table. - final AnalysisRuleAggregation? aggregation; +/// A reference to a table within an Glue data catalog. +class GlueTableReference { + /// The name of the database the Glue table belongs to. + final String databaseName; - /// Analysis rule type that enables only list queries on a configured table. - final AnalysisRuleList? list; + /// The name of the Glue table. + final String tableName; - ConfiguredTableAnalysisRulePolicyV1({ - this.aggregation, - this.list, + GlueTableReference({ + required this.databaseName, + required this.tableName, }); - factory ConfiguredTableAnalysisRulePolicyV1.fromJson( - Map json) { - return ConfiguredTableAnalysisRulePolicyV1( - aggregation: json['aggregation'] != null - ? AnalysisRuleAggregation.fromJson( - json['aggregation'] as Map) - : null, - list: json['list'] != null - ? AnalysisRuleList.fromJson(json['list'] as Map) - : null, + factory GlueTableReference.fromJson(Map json) { + return GlueTableReference( + databaseName: json['databaseName'] as String, + tableName: json['tableName'] as String, ); } Map toJson() { - final aggregation = this.aggregation; - final list = this.list; + final databaseName = this.databaseName; + final tableName = this.tableName; return { - if (aggregation != null) 'aggregation': aggregation, - if (list != null) 'list': list, + 'databaseName': databaseName, + 'tableName': tableName, }; } } -enum ConfiguredTableAnalysisRuleType { - aggregation, - list, +enum JoinOperator { + or, + and, } -extension ConfiguredTableAnalysisRuleTypeValueExtension - on ConfiguredTableAnalysisRuleType { +extension JoinOperatorValueExtension on JoinOperator { String toValue() { switch (this) { - case ConfiguredTableAnalysisRuleType.aggregation: - return 'AGGREGATION'; - case ConfiguredTableAnalysisRuleType.list: - return 'LIST'; + case JoinOperator.or: + return 'OR'; + case JoinOperator.and: + return 'AND'; } } } -extension ConfiguredTableAnalysisRuleTypeFromString on String { - ConfiguredTableAnalysisRuleType toConfiguredTableAnalysisRuleType() { +extension JoinOperatorFromString on String { + JoinOperator toJoinOperator() { switch (this) { - case 'AGGREGATION': - return ConfiguredTableAnalysisRuleType.aggregation; - case 'LIST': - return ConfiguredTableAnalysisRuleType.list; + case 'OR': + return JoinOperator.or; + case 'AND': + return JoinOperator.and; } - throw Exception( - '$this is not known in enum ConfiguredTableAnalysisRuleType'); + throw Exception('$this is not known in enum JoinOperator'); } } -/// A configured table association links a configured table to a collaboration. -class ConfiguredTableAssociation { - /// The unique ARN for the configured table association. - final String arn; +enum JoinRequiredOption { + queryRunner, +} - /// The unique ARN for the configured table that the association refers to. - final String configuredTableArn; +extension JoinRequiredOptionValueExtension on JoinRequiredOption { + String toValue() { + switch (this) { + case JoinRequiredOption.queryRunner: + return 'QUERY_RUNNER'; + } + } +} - /// The unique ID for the configured table that the association refers to. - final String configuredTableId; +extension JoinRequiredOptionFromString on String { + JoinRequiredOption toJoinRequiredOption() { + switch (this) { + case 'QUERY_RUNNER': + return JoinRequiredOption.queryRunner; + } + throw Exception('$this is not known in enum JoinRequiredOption'); + } +} - /// The time the configured table association was created. - final DateTime createTime; +class ListAnalysisTemplatesOutput { + /// Lists analysis template metadata. + final List analysisTemplateSummaries; - /// The unique ID for the configured table association. - final String id; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - /// The unique ARN for the membership this configured table association belongs - /// to. - final String membershipArn; + ListAnalysisTemplatesOutput({ + required this.analysisTemplateSummaries, + this.nextToken, + }); - /// The unique ID for the membership this configured table association belongs - /// to. - final String membershipId; + factory ListAnalysisTemplatesOutput.fromJson(Map json) { + return ListAnalysisTemplatesOutput( + analysisTemplateSummaries: (json['analysisTemplateSummaries'] as List) + .whereNotNull() + .map((e) => + AnalysisTemplateSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } - /// The name of the configured table association, in lowercase. The table is - /// identified by this name when running protected queries against the - /// underlying data. - final String name; + Map toJson() { + final analysisTemplateSummaries = this.analysisTemplateSummaries; + final nextToken = this.nextToken; + return { + 'analysisTemplateSummaries': analysisTemplateSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} - /// The service will assume this role to access catalog metadata and query the - /// table. - final String roleArn; +class ListCollaborationAnalysisTemplatesOutput { + /// The metadata of the analysis template within a collaboration. + final List + collaborationAnalysisTemplateSummaries; - /// The time the configured table association was last updated. - final DateTime updateTime; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - /// A description of the configured table association. - final String? description; + ListCollaborationAnalysisTemplatesOutput({ + required this.collaborationAnalysisTemplateSummaries, + this.nextToken, + }); - ConfiguredTableAssociation({ - required this.arn, - required this.configuredTableArn, - required this.configuredTableId, - required this.createTime, - required this.id, - required this.membershipArn, - required this.membershipId, - required this.name, - required this.roleArn, - required this.updateTime, - this.description, + factory ListCollaborationAnalysisTemplatesOutput.fromJson( + Map json) { + return ListCollaborationAnalysisTemplatesOutput( + collaborationAnalysisTemplateSummaries: + (json['collaborationAnalysisTemplateSummaries'] as List) + .whereNotNull() + .map((e) => CollaborationAnalysisTemplateSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final collaborationAnalysisTemplateSummaries = + this.collaborationAnalysisTemplateSummaries; + final nextToken = this.nextToken; + return { + 'collaborationAnalysisTemplateSummaries': + collaborationAnalysisTemplateSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListCollaborationConfiguredAudienceModelAssociationsOutput { + /// The metadata of the configured audience model association within a + /// collaboration. + final List + collaborationConfiguredAudienceModelAssociationSummaries; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListCollaborationConfiguredAudienceModelAssociationsOutput({ + required this.collaborationConfiguredAudienceModelAssociationSummaries, + this.nextToken, }); - factory ConfiguredTableAssociation.fromJson(Map json) { - return ConfiguredTableAssociation( - arn: json['arn'] as String, - configuredTableArn: json['configuredTableArn'] as String, - configuredTableId: json['configuredTableId'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - id: json['id'] as String, - membershipArn: json['membershipArn'] as String, - membershipId: json['membershipId'] as String, - name: json['name'] as String, - roleArn: json['roleArn'] as String, - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), - description: json['description'] as String?, + factory ListCollaborationConfiguredAudienceModelAssociationsOutput.fromJson( + Map json) { + return ListCollaborationConfiguredAudienceModelAssociationsOutput( + collaborationConfiguredAudienceModelAssociationSummaries: + (json['collaborationConfiguredAudienceModelAssociationSummaries'] + as List) + .whereNotNull() + .map((e) => CollaborationConfiguredAudienceModelAssociationSummary + .fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final arn = this.arn; - final configuredTableArn = this.configuredTableArn; - final configuredTableId = this.configuredTableId; - final createTime = this.createTime; - final id = this.id; - final membershipArn = this.membershipArn; - final membershipId = this.membershipId; - final name = this.name; - final roleArn = this.roleArn; - final updateTime = this.updateTime; - final description = this.description; + final collaborationConfiguredAudienceModelAssociationSummaries = + this.collaborationConfiguredAudienceModelAssociationSummaries; + final nextToken = this.nextToken; return { - 'arn': arn, - 'configuredTableArn': configuredTableArn, - 'configuredTableId': configuredTableId, - 'createTime': unixTimestampToJson(createTime), - 'id': id, - 'membershipArn': membershipArn, - 'membershipId': membershipId, - 'name': name, - 'roleArn': roleArn, - 'updateTime': unixTimestampToJson(updateTime), - if (description != null) 'description': description, + 'collaborationConfiguredAudienceModelAssociationSummaries': + collaborationConfiguredAudienceModelAssociationSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -/// The configured table association summary for the objects listed by the -/// request. -class ConfiguredTableAssociationSummary { - /// The unique ARN for the configured table association. - final String arn; +class ListCollaborationPrivacyBudgetTemplatesOutput { + /// An array that summarizes the collaboration privacy budget templates. The + /// summary includes collaboration information, creation information, the + /// privacy budget type. + final List + collaborationPrivacyBudgetTemplateSummaries; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListCollaborationPrivacyBudgetTemplatesOutput({ + required this.collaborationPrivacyBudgetTemplateSummaries, + this.nextToken, + }); + + factory ListCollaborationPrivacyBudgetTemplatesOutput.fromJson( + Map json) { + return ListCollaborationPrivacyBudgetTemplatesOutput( + collaborationPrivacyBudgetTemplateSummaries: + (json['collaborationPrivacyBudgetTemplateSummaries'] as List) + .whereNotNull() + .map((e) => CollaborationPrivacyBudgetTemplateSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final collaborationPrivacyBudgetTemplateSummaries = + this.collaborationPrivacyBudgetTemplateSummaries; + final nextToken = this.nextToken; + return { + 'collaborationPrivacyBudgetTemplateSummaries': + collaborationPrivacyBudgetTemplateSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListCollaborationPrivacyBudgetsOutput { + /// Summaries of the collaboration privacy budgets. + final List + collaborationPrivacyBudgetSummaries; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListCollaborationPrivacyBudgetsOutput({ + required this.collaborationPrivacyBudgetSummaries, + this.nextToken, + }); + + factory ListCollaborationPrivacyBudgetsOutput.fromJson( + Map json) { + return ListCollaborationPrivacyBudgetsOutput( + collaborationPrivacyBudgetSummaries: + (json['collaborationPrivacyBudgetSummaries'] as List) + .whereNotNull() + .map((e) => CollaborationPrivacyBudgetSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final collaborationPrivacyBudgetSummaries = + this.collaborationPrivacyBudgetSummaries; + final nextToken = this.nextToken; + return { + 'collaborationPrivacyBudgetSummaries': + collaborationPrivacyBudgetSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} - /// The unique configured table ID that this configured table association refers - /// to. - final String configuredTableId; +class ListCollaborationsOutput { + /// The list of collaborations. + final List collaborationList; - /// The time the configured table association was created. - final DateTime createTime; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - /// The unique ID for the configured table association. - final String id; + ListCollaborationsOutput({ + required this.collaborationList, + this.nextToken, + }); - /// The unique ARN for the membership that the configured table association - /// belongs to. - final String membershipArn; + factory ListCollaborationsOutput.fromJson(Map json) { + return ListCollaborationsOutput( + collaborationList: (json['collaborationList'] as List) + .whereNotNull() + .map((e) => CollaborationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } - /// The unique ID for the membership that the configured table association - /// belongs to. - final String membershipId; + Map toJson() { + final collaborationList = this.collaborationList; + final nextToken = this.nextToken; + return { + 'collaborationList': collaborationList, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} - /// The name of the configured table association. The table is identified by - /// this name when running Protected Queries against the underlying data. - final String name; +class ListConfiguredAudienceModelAssociationsOutput { + /// Summaries of the configured audience model associations that you requested. + final List + configuredAudienceModelAssociationSummaries; - /// The time the configured table association was last updated. - final DateTime updateTime; + /// The token value provided to access the next page of results. + final String? nextToken; - ConfiguredTableAssociationSummary({ - required this.arn, - required this.configuredTableId, - required this.createTime, - required this.id, - required this.membershipArn, - required this.membershipId, - required this.name, - required this.updateTime, + ListConfiguredAudienceModelAssociationsOutput({ + required this.configuredAudienceModelAssociationSummaries, + this.nextToken, }); - factory ConfiguredTableAssociationSummary.fromJson( + factory ListConfiguredAudienceModelAssociationsOutput.fromJson( Map json) { - return ConfiguredTableAssociationSummary( - arn: json['arn'] as String, - configuredTableId: json['configuredTableId'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - id: json['id'] as String, - membershipArn: json['membershipArn'] as String, - membershipId: json['membershipId'] as String, - name: json['name'] as String, - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + return ListConfiguredAudienceModelAssociationsOutput( + configuredAudienceModelAssociationSummaries: + (json['configuredAudienceModelAssociationSummaries'] as List) + .whereNotNull() + .map((e) => ConfiguredAudienceModelAssociationSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final arn = this.arn; - final configuredTableId = this.configuredTableId; - final createTime = this.createTime; - final id = this.id; - final membershipArn = this.membershipArn; - final membershipId = this.membershipId; - final name = this.name; - final updateTime = this.updateTime; + final configuredAudienceModelAssociationSummaries = + this.configuredAudienceModelAssociationSummaries; + final nextToken = this.nextToken; return { - 'arn': arn, - 'configuredTableId': configuredTableId, - 'createTime': unixTimestampToJson(createTime), - 'id': id, - 'membershipArn': membershipArn, - 'membershipId': membershipId, - 'name': name, - 'updateTime': unixTimestampToJson(updateTime), + 'configuredAudienceModelAssociationSummaries': + configuredAudienceModelAssociationSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -/// The configured table summary for the objects listed by the request. -class ConfiguredTableSummary { - /// The analysis method for the configured tables. The only valid value is - /// currently `DIRECT_QUERY`. - final AnalysisMethod analysisMethod; +class ListConfiguredTableAssociationsOutput { + /// The retrieved list of configured table associations. + final List + configuredTableAssociationSummaries; - /// The types of analysis rules associated with this configured table. - final List analysisRuleTypes; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - /// The unique ARN of the configured table. - final String arn; + ListConfiguredTableAssociationsOutput({ + required this.configuredTableAssociationSummaries, + this.nextToken, + }); - /// The time the configured table was created. - final DateTime createTime; + factory ListConfiguredTableAssociationsOutput.fromJson( + Map json) { + return ListConfiguredTableAssociationsOutput( + configuredTableAssociationSummaries: + (json['configuredTableAssociationSummaries'] as List) + .whereNotNull() + .map((e) => ConfiguredTableAssociationSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } - /// The unique ID of the configured table. - final String id; + Map toJson() { + final configuredTableAssociationSummaries = + this.configuredTableAssociationSummaries; + final nextToken = this.nextToken; + return { + 'configuredTableAssociationSummaries': + configuredTableAssociationSummaries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} - /// The name of the configured table. - final String name; +class ListConfiguredTablesOutput { + /// The configured tables listed by the request. + final List configuredTableSummaries; - /// The time the configured table was last updated. - final DateTime updateTime; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - ConfiguredTableSummary({ - required this.analysisMethod, - required this.analysisRuleTypes, - required this.arn, - required this.createTime, - required this.id, - required this.name, - required this.updateTime, + ListConfiguredTablesOutput({ + required this.configuredTableSummaries, + this.nextToken, }); - factory ConfiguredTableSummary.fromJson(Map json) { - return ConfiguredTableSummary( - analysisMethod: (json['analysisMethod'] as String).toAnalysisMethod(), - analysisRuleTypes: (json['analysisRuleTypes'] as List) + factory ListConfiguredTablesOutput.fromJson(Map json) { + return ListConfiguredTablesOutput( + configuredTableSummaries: (json['configuredTableSummaries'] as List) .whereNotNull() - .map((e) => (e as String).toConfiguredTableAnalysisRuleType()) + .map( + (e) => ConfiguredTableSummary.fromJson(e as Map)) .toList(), - arn: json['arn'] as String, - createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - id: json['id'] as String, - name: json['name'] as String, - updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final analysisMethod = this.analysisMethod; - final analysisRuleTypes = this.analysisRuleTypes; - final arn = this.arn; - final createTime = this.createTime; - final id = this.id; - final name = this.name; - final updateTime = this.updateTime; + final configuredTableSummaries = this.configuredTableSummaries; + final nextToken = this.nextToken; return { - 'analysisMethod': analysisMethod.toValue(), - 'analysisRuleTypes': analysisRuleTypes.map((e) => e.toValue()).toList(), - 'arn': arn, - 'createTime': unixTimestampToJson(createTime), - 'id': id, - 'name': name, - 'updateTime': unixTimestampToJson(updateTime), + 'configuredTableSummaries': configuredTableSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class CreateCollaborationOutput { - /// The entire created collaboration object. - final Collaboration collaboration; +class ListMembersOutput { + /// The list of members returned by the ListMembers operation. + final List memberSummaries; - CreateCollaborationOutput({ - required this.collaboration, + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListMembersOutput({ + required this.memberSummaries, + this.nextToken, }); - factory CreateCollaborationOutput.fromJson(Map json) { - return CreateCollaborationOutput( - collaboration: - Collaboration.fromJson(json['collaboration'] as Map), + factory ListMembersOutput.fromJson(Map json) { + return ListMembersOutput( + memberSummaries: (json['memberSummaries'] as List) + .whereNotNull() + .map((e) => MemberSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final collaboration = this.collaboration; + final memberSummaries = this.memberSummaries; + final nextToken = this.nextToken; return { - 'collaboration': collaboration, + 'memberSummaries': memberSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class CreateConfiguredTableAnalysisRuleOutput { - /// The entire created analysis rule. - final ConfiguredTableAnalysisRule analysisRule; +class ListMembershipsOutput { + /// The list of memberships returned from the ListMemberships operation. + final List membershipSummaries; - CreateConfiguredTableAnalysisRuleOutput({ - required this.analysisRule, + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListMembershipsOutput({ + required this.membershipSummaries, + this.nextToken, }); - factory CreateConfiguredTableAnalysisRuleOutput.fromJson( - Map json) { - return CreateConfiguredTableAnalysisRuleOutput( - analysisRule: ConfiguredTableAnalysisRule.fromJson( - json['analysisRule'] as Map), + factory ListMembershipsOutput.fromJson(Map json) { + return ListMembershipsOutput( + membershipSummaries: (json['membershipSummaries'] as List) + .whereNotNull() + .map((e) => MembershipSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final analysisRule = this.analysisRule; + final membershipSummaries = this.membershipSummaries; + final nextToken = this.nextToken; return { - 'analysisRule': analysisRule, + 'membershipSummaries': membershipSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class CreateConfiguredTableAssociationOutput { - /// The entire configured table association object. - final ConfiguredTableAssociation configuredTableAssociation; +class ListPrivacyBudgetTemplatesOutput { + /// An array that summarizes the privacy budget templates. The summary includes + /// collaboration information, creation information, and privacy budget type. + final List privacyBudgetTemplateSummaries; - CreateConfiguredTableAssociationOutput({ - required this.configuredTableAssociation, + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListPrivacyBudgetTemplatesOutput({ + required this.privacyBudgetTemplateSummaries, + this.nextToken, }); - factory CreateConfiguredTableAssociationOutput.fromJson( - Map json) { - return CreateConfiguredTableAssociationOutput( - configuredTableAssociation: ConfiguredTableAssociation.fromJson( - json['configuredTableAssociation'] as Map), + factory ListPrivacyBudgetTemplatesOutput.fromJson(Map json) { + return ListPrivacyBudgetTemplatesOutput( + privacyBudgetTemplateSummaries: (json['privacyBudgetTemplateSummaries'] + as List) + .whereNotNull() + .map((e) => + PrivacyBudgetTemplateSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final configuredTableAssociation = this.configuredTableAssociation; + final privacyBudgetTemplateSummaries = this.privacyBudgetTemplateSummaries; + final nextToken = this.nextToken; return { - 'configuredTableAssociation': configuredTableAssociation, + 'privacyBudgetTemplateSummaries': privacyBudgetTemplateSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class CreateConfiguredTableOutput { - /// The created configured table. - final ConfiguredTable configuredTable; +class ListPrivacyBudgetsOutput { + /// An array that summarizes the privacy budgets. The summary includes + /// collaboration information, membership information, privacy budget template + /// information, and privacy budget details. + final List privacyBudgetSummaries; - CreateConfiguredTableOutput({ - required this.configuredTable, + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListPrivacyBudgetsOutput({ + required this.privacyBudgetSummaries, + this.nextToken, }); - factory CreateConfiguredTableOutput.fromJson(Map json) { - return CreateConfiguredTableOutput( - configuredTable: ConfiguredTable.fromJson( - json['configuredTable'] as Map), + factory ListPrivacyBudgetsOutput.fromJson(Map json) { + return ListPrivacyBudgetsOutput( + privacyBudgetSummaries: (json['privacyBudgetSummaries'] as List) + .whereNotNull() + .map((e) => PrivacyBudgetSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final configuredTable = this.configuredTable; + final privacyBudgetSummaries = this.privacyBudgetSummaries; + final nextToken = this.nextToken; return { - 'configuredTable': configuredTable, + 'privacyBudgetSummaries': privacyBudgetSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class CreateMembershipOutput { - /// The membership that was created. - final Membership membership; +class ListProtectedQueriesOutput { + /// A list of protected queries. + final List protectedQueries; - CreateMembershipOutput({ - required this.membership, + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListProtectedQueriesOutput({ + required this.protectedQueries, + this.nextToken, }); - factory CreateMembershipOutput.fromJson(Map json) { - return CreateMembershipOutput( - membership: - Membership.fromJson(json['membership'] as Map), + factory ListProtectedQueriesOutput.fromJson(Map json) { + return ListProtectedQueriesOutput( + protectedQueries: (json['protectedQueries'] as List) + .whereNotNull() + .map((e) => ProtectedQuerySummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final membership = this.membership; + final protectedQueries = this.protectedQueries; + final nextToken = this.nextToken; return { - 'membership': membership, + 'protectedQueries': protectedQueries, + if (nextToken != null) 'nextToken': nextToken, }; } } -/// The settings for client-side encryption for cryptographic computing. -class DataEncryptionMetadata { - /// Indicates whether encrypted tables can contain cleartext data (true) or are - /// to cryptographically process every column (false). - final bool allowCleartext; - - /// Indicates whether Fingerprint columns can contain duplicate entries (true) - /// or are to contain only non-repeated values (false). - final bool allowDuplicates; - - /// Indicates whether Fingerprint columns can be joined on any other Fingerprint - /// column with a different name (true) or can only be joined on Fingerprint - /// columns of the same name (false). - final bool allowJoinsOnColumnsWithDifferentNames; +class ListSchemasOutput { + /// The retrieved list of schemas. + final List schemaSummaries; - /// Indicates whether NULL values are to be copied as NULL to encrypted tables - /// (true) or cryptographically processed (false). - final bool preserveNulls; + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; - DataEncryptionMetadata({ - required this.allowCleartext, - required this.allowDuplicates, - required this.allowJoinsOnColumnsWithDifferentNames, - required this.preserveNulls, + ListSchemasOutput({ + required this.schemaSummaries, + this.nextToken, }); - factory DataEncryptionMetadata.fromJson(Map json) { - return DataEncryptionMetadata( - allowCleartext: json['allowCleartext'] as bool, - allowDuplicates: json['allowDuplicates'] as bool, - allowJoinsOnColumnsWithDifferentNames: - json['allowJoinsOnColumnsWithDifferentNames'] as bool, - preserveNulls: json['preserveNulls'] as bool, + factory ListSchemasOutput.fromJson(Map json) { + return ListSchemasOutput( + schemaSummaries: (json['schemaSummaries'] as List) + .whereNotNull() + .map((e) => SchemaSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final allowCleartext = this.allowCleartext; - final allowDuplicates = this.allowDuplicates; - final allowJoinsOnColumnsWithDifferentNames = - this.allowJoinsOnColumnsWithDifferentNames; - final preserveNulls = this.preserveNulls; + final schemaSummaries = this.schemaSummaries; + final nextToken = this.nextToken; return { - 'allowCleartext': allowCleartext, - 'allowDuplicates': allowDuplicates, - 'allowJoinsOnColumnsWithDifferentNames': - allowJoinsOnColumnsWithDifferentNames, - 'preserveNulls': preserveNulls, + 'schemaSummaries': schemaSummaries, + if (nextToken != null) 'nextToken': nextToken, }; } } -class DeleteCollaborationOutput { - DeleteCollaborationOutput(); - - factory DeleteCollaborationOutput.fromJson(Map _) { - return DeleteCollaborationOutput(); - } - - Map toJson() { - return {}; - } -} +class ListTagsForResourceOutput { + /// A map of objects specifying each key name and value. + final Map tags; -/// An empty response that indicates a successful delete. -class DeleteConfiguredTableAnalysisRuleOutput { - DeleteConfiguredTableAnalysisRuleOutput(); + ListTagsForResourceOutput({ + required this.tags, + }); - factory DeleteConfiguredTableAnalysisRuleOutput.fromJson( - Map _) { - return DeleteConfiguredTableAnalysisRuleOutput(); + factory ListTagsForResourceOutput.fromJson(Map json) { + return ListTagsForResourceOutput( + tags: (json['tags'] as Map) + .map((k, e) => MapEntry(k, e as String)), + ); } Map toJson() { - return {}; + final tags = this.tags; + return { + 'tags': tags, + }; } } -class DeleteConfiguredTableAssociationOutput { - DeleteConfiguredTableAssociationOutput(); - - factory DeleteConfiguredTableAssociationOutput.fromJson( - Map _) { - return DeleteConfiguredTableAssociationOutput(); - } - - Map toJson() { - return {}; - } +enum MemberAbility { + canQuery, + canReceiveResults, } -/// The empty output for a successful deletion. -class DeleteConfiguredTableOutput { - DeleteConfiguredTableOutput(); - - factory DeleteConfiguredTableOutput.fromJson(Map _) { - return DeleteConfiguredTableOutput(); +extension MemberAbilityValueExtension on MemberAbility { + String toValue() { + switch (this) { + case MemberAbility.canQuery: + return 'CAN_QUERY'; + case MemberAbility.canReceiveResults: + return 'CAN_RECEIVE_RESULTS'; + } } +} - Map toJson() { - return {}; +extension MemberAbilityFromString on String { + MemberAbility toMemberAbility() { + switch (this) { + case 'CAN_QUERY': + return MemberAbility.canQuery; + case 'CAN_RECEIVE_RESULTS': + return MemberAbility.canReceiveResults; + } + throw Exception('$this is not known in enum MemberAbility'); } } -class DeleteMemberOutput { - DeleteMemberOutput(); +/// Basic metadata used to construct a new member. +class MemberSpecification { + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String accountId; - factory DeleteMemberOutput.fromJson(Map _) { - return DeleteMemberOutput(); - } + /// The member's display name. + final String displayName; - Map toJson() { - return {}; - } -} + /// The abilities granted to the collaboration member. + final List memberAbilities; -class DeleteMembershipOutput { - DeleteMembershipOutput(); + /// The collaboration member's payment responsibilities set by the collaboration + /// creator. + /// + /// If the collaboration creator hasn't specified anyone as the member paying for + /// query compute costs, then the member who can query is the default payer. + final PaymentConfiguration? paymentConfiguration; - factory DeleteMembershipOutput.fromJson(Map _) { - return DeleteMembershipOutput(); - } + MemberSpecification({ + required this.accountId, + required this.displayName, + required this.memberAbilities, + this.paymentConfiguration, + }); Map toJson() { - return {}; + final accountId = this.accountId; + final displayName = this.displayName; + final memberAbilities = this.memberAbilities; + final paymentConfiguration = this.paymentConfiguration; + return { + 'accountId': accountId, + 'displayName': displayName, + 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), + if (paymentConfiguration != null) + 'paymentConfiguration': paymentConfiguration, + }; } } -enum FilterableMemberStatus { +enum MemberStatus { invited, active, + left, + removed, } -extension FilterableMemberStatusValueExtension on FilterableMemberStatus { +extension MemberStatusValueExtension on MemberStatus { String toValue() { switch (this) { - case FilterableMemberStatus.invited: + case MemberStatus.invited: return 'INVITED'; - case FilterableMemberStatus.active: + case MemberStatus.active: return 'ACTIVE'; + case MemberStatus.left: + return 'LEFT'; + case MemberStatus.removed: + return 'REMOVED'; } } } -extension FilterableMemberStatusFromString on String { - FilterableMemberStatus toFilterableMemberStatus() { +extension MemberStatusFromString on String { + MemberStatus toMemberStatus() { switch (this) { case 'INVITED': - return FilterableMemberStatus.invited; + return MemberStatus.invited; case 'ACTIVE': - return FilterableMemberStatus.active; + return MemberStatus.active; + case 'LEFT': + return MemberStatus.left; + case 'REMOVED': + return MemberStatus.removed; } - throw Exception('$this is not known in enum FilterableMemberStatus'); + throw Exception('$this is not known in enum MemberStatus'); } } -class GetCollaborationOutput { - /// The entire collaboration for this identifier. - final Collaboration collaboration; +/// The member object listed by the request. +class MemberSummary { + /// The abilities granted to the collaboration member. + final List abilities; - GetCollaborationOutput({ - required this.collaboration, - }); + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String accountId; - factory GetCollaborationOutput.fromJson(Map json) { - return GetCollaborationOutput( - collaboration: - Collaboration.fromJson(json['collaboration'] as Map), - ); - } + /// The time when the member was created. + final DateTime createTime; - Map toJson() { - final collaboration = this.collaboration; - return { - 'collaboration': collaboration, - }; - } -} + /// The member's display name. + final String displayName; -class GetConfiguredTableAnalysisRuleOutput { - /// The entire analysis rule output. - final ConfiguredTableAnalysisRule analysisRule; + /// The collaboration member's payment responsibilities set by the collaboration + /// creator. + final PaymentConfiguration paymentConfiguration; - GetConfiguredTableAnalysisRuleOutput({ - required this.analysisRule, - }); + /// The status of the member. + final MemberStatus status; - factory GetConfiguredTableAnalysisRuleOutput.fromJson( - Map json) { - return GetConfiguredTableAnalysisRuleOutput( - analysisRule: ConfiguredTableAnalysisRule.fromJson( - json['analysisRule'] as Map), - ); - } + /// The time the member metadata was last updated. + final DateTime updateTime; - Map toJson() { - final analysisRule = this.analysisRule; - return { - 'analysisRule': analysisRule, - }; - } -} + /// The unique ARN for the member's associated membership, if present. + final String? membershipArn; -class GetConfiguredTableAssociationOutput { - /// The entire configured table association object. - final ConfiguredTableAssociation configuredTableAssociation; + /// The unique ID for the member's associated membership, if present. + final String? membershipId; - GetConfiguredTableAssociationOutput({ - required this.configuredTableAssociation, + MemberSummary({ + required this.abilities, + required this.accountId, + required this.createTime, + required this.displayName, + required this.paymentConfiguration, + required this.status, + required this.updateTime, + this.membershipArn, + this.membershipId, }); - factory GetConfiguredTableAssociationOutput.fromJson( - Map json) { - return GetConfiguredTableAssociationOutput( - configuredTableAssociation: ConfiguredTableAssociation.fromJson( - json['configuredTableAssociation'] as Map), + factory MemberSummary.fromJson(Map json) { + return MemberSummary( + abilities: (json['abilities'] as List) + .whereNotNull() + .map((e) => (e as String).toMemberAbility()) + .toList(), + accountId: json['accountId'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + displayName: json['displayName'] as String, + paymentConfiguration: PaymentConfiguration.fromJson( + json['paymentConfiguration'] as Map), + status: (json['status'] as String).toMemberStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + membershipArn: json['membershipArn'] as String?, + membershipId: json['membershipId'] as String?, ); } Map toJson() { - final configuredTableAssociation = this.configuredTableAssociation; + final abilities = this.abilities; + final accountId = this.accountId; + final createTime = this.createTime; + final displayName = this.displayName; + final paymentConfiguration = this.paymentConfiguration; + final status = this.status; + final updateTime = this.updateTime; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; return { - 'configuredTableAssociation': configuredTableAssociation, + 'abilities': abilities.map((e) => e.toValue()).toList(), + 'accountId': accountId, + 'createTime': unixTimestampToJson(createTime), + 'displayName': displayName, + 'paymentConfiguration': paymentConfiguration, + 'status': status.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + if (membershipArn != null) 'membershipArn': membershipArn, + if (membershipId != null) 'membershipId': membershipId, }; } } -class GetConfiguredTableOutput { - /// The retrieved configured table. - final ConfiguredTable configuredTable; +/// The membership object. +class Membership { + /// The unique ARN for the membership. + final String arn; - GetConfiguredTableOutput({ - required this.configuredTable, - }); + /// The unique ARN for the membership's associated collaboration. + final String collaborationArn; - factory GetConfiguredTableOutput.fromJson(Map json) { - return GetConfiguredTableOutput( - configuredTable: ConfiguredTable.fromJson( - json['configuredTable'] as Map), - ); - } + /// The identifier used to reference members of the collaboration. Currently + /// only supports Amazon Web Services account ID. + final String collaborationCreatorAccountId; - Map toJson() { - final configuredTable = this.configuredTable; - return { - 'configuredTable': configuredTable, - }; - } -} + /// The display name of the collaboration creator. + final String collaborationCreatorDisplayName; -class GetMembershipOutput { - /// The membership retrieved for the provided identifier. - final Membership membership; + /// The unique ID for the membership's collaboration. + final String collaborationId; - GetMembershipOutput({ - required this.membership, + /// The name of the membership's collaboration. + final String collaborationName; + + /// The time when the membership was created. + final DateTime createTime; + + /// The unique ID of the membership. + final String id; + + /// The abilities granted to the collaboration member. + final List memberAbilities; + + /// The payment responsibilities accepted by the collaboration member. + final MembershipPaymentConfiguration paymentConfiguration; + + /// An indicator as to whether query logging has been enabled or disabled for + /// the membership. + final MembershipQueryLogStatus queryLogStatus; + + /// The status of the membership. + final MembershipStatus status; + + /// The time the membership metadata was last updated. + final DateTime updateTime; + + /// The default protected query result configuration as specified by the member + /// who can receive results. + final MembershipProtectedQueryResultConfiguration? defaultResultConfiguration; + + Membership({ + required this.arn, + required this.collaborationArn, + required this.collaborationCreatorAccountId, + required this.collaborationCreatorDisplayName, + required this.collaborationId, + required this.collaborationName, + required this.createTime, + required this.id, + required this.memberAbilities, + required this.paymentConfiguration, + required this.queryLogStatus, + required this.status, + required this.updateTime, + this.defaultResultConfiguration, }); - factory GetMembershipOutput.fromJson(Map json) { - return GetMembershipOutput( - membership: - Membership.fromJson(json['membership'] as Map), + factory Membership.fromJson(Map json) { + return Membership( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationCreatorAccountId: + json['collaborationCreatorAccountId'] as String, + collaborationCreatorDisplayName: + json['collaborationCreatorDisplayName'] as String, + collaborationId: json['collaborationId'] as String, + collaborationName: json['collaborationName'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + memberAbilities: (json['memberAbilities'] as List) + .whereNotNull() + .map((e) => (e as String).toMemberAbility()) + .toList(), + paymentConfiguration: MembershipPaymentConfiguration.fromJson( + json['paymentConfiguration'] as Map), + queryLogStatus: + (json['queryLogStatus'] as String).toMembershipQueryLogStatus(), + status: (json['status'] as String).toMembershipStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + defaultResultConfiguration: json['defaultResultConfiguration'] != null + ? MembershipProtectedQueryResultConfiguration.fromJson( + json['defaultResultConfiguration'] as Map) + : null, ); } Map toJson() { - final membership = this.membership; + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationCreatorAccountId = this.collaborationCreatorAccountId; + final collaborationCreatorDisplayName = + this.collaborationCreatorDisplayName; + final collaborationId = this.collaborationId; + final collaborationName = this.collaborationName; + final createTime = this.createTime; + final id = this.id; + final memberAbilities = this.memberAbilities; + final paymentConfiguration = this.paymentConfiguration; + final queryLogStatus = this.queryLogStatus; + final status = this.status; + final updateTime = this.updateTime; + final defaultResultConfiguration = this.defaultResultConfiguration; return { - 'membership': membership, + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationCreatorAccountId': collaborationCreatorAccountId, + 'collaborationCreatorDisplayName': collaborationCreatorDisplayName, + 'collaborationId': collaborationId, + 'collaborationName': collaborationName, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), + 'paymentConfiguration': paymentConfiguration, + 'queryLogStatus': queryLogStatus.toValue(), + 'status': status.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + if (defaultResultConfiguration != null) + 'defaultResultConfiguration': defaultResultConfiguration, }; } } -class GetProtectedQueryOutput { - /// The query processing metadata. - final ProtectedQuery protectedQuery; +/// An object representing the payment responsibilities accepted by the +/// collaboration member. +class MembershipPaymentConfiguration { + /// The payment responsibilities accepted by the collaboration member for query + /// compute costs. + final MembershipQueryComputePaymentConfig queryCompute; - GetProtectedQueryOutput({ - required this.protectedQuery, + MembershipPaymentConfiguration({ + required this.queryCompute, }); - factory GetProtectedQueryOutput.fromJson(Map json) { - return GetProtectedQueryOutput( - protectedQuery: ProtectedQuery.fromJson( - json['protectedQuery'] as Map), + factory MembershipPaymentConfiguration.fromJson(Map json) { + return MembershipPaymentConfiguration( + queryCompute: MembershipQueryComputePaymentConfig.fromJson( + json['queryCompute'] as Map), ); } Map toJson() { - final protectedQuery = this.protectedQuery; + final queryCompute = this.queryCompute; return { - 'protectedQuery': protectedQuery, + 'queryCompute': queryCompute, }; } } -class GetSchemaAnalysisRuleOutput { - /// A specification about how data from the configured table can be used. - final AnalysisRule analysisRule; - - GetSchemaAnalysisRuleOutput({ - required this.analysisRule, +/// Contains configurations for protected query results. +class MembershipProtectedQueryOutputConfiguration { + final ProtectedQueryS3OutputConfiguration? s3; + + MembershipProtectedQueryOutputConfiguration({ + this.s3, }); - factory GetSchemaAnalysisRuleOutput.fromJson(Map json) { - return GetSchemaAnalysisRuleOutput( - analysisRule: - AnalysisRule.fromJson(json['analysisRule'] as Map), + factory MembershipProtectedQueryOutputConfiguration.fromJson( + Map json) { + return MembershipProtectedQueryOutputConfiguration( + s3: json['s3'] != null + ? ProtectedQueryS3OutputConfiguration.fromJson( + json['s3'] as Map) + : null, ); } Map toJson() { - final analysisRule = this.analysisRule; + final s3 = this.s3; return { - 'analysisRule': analysisRule, + if (s3 != null) 's3': s3, }; } } -class GetSchemaOutput { - /// The entire schema object. - final Schema schema; +/// Contains configurations for protected query results. +class MembershipProtectedQueryResultConfiguration { + /// Configuration for protected query results. + final MembershipProtectedQueryOutputConfiguration outputConfiguration; - GetSchemaOutput({ - required this.schema, + /// The unique ARN for an IAM role that is used by Clean Rooms to write + /// protected query results to the result location, given by the member who can + /// receive results. + final String? roleArn; + + MembershipProtectedQueryResultConfiguration({ + required this.outputConfiguration, + this.roleArn, }); - factory GetSchemaOutput.fromJson(Map json) { - return GetSchemaOutput( - schema: Schema.fromJson(json['schema'] as Map), + factory MembershipProtectedQueryResultConfiguration.fromJson( + Map json) { + return MembershipProtectedQueryResultConfiguration( + outputConfiguration: MembershipProtectedQueryOutputConfiguration.fromJson( + json['outputConfiguration'] as Map), + roleArn: json['roleArn'] as String?, ); } Map toJson() { - final schema = this.schema; + final outputConfiguration = this.outputConfiguration; + final roleArn = this.roleArn; return { - 'schema': schema, + 'outputConfiguration': outputConfiguration, + if (roleArn != null) 'roleArn': roleArn, }; } } -/// A reference to a table within an AWS Glue data catalog. -class GlueTableReference { - /// The name of the database the AWS Glue table belongs to. - final String databaseName; - - /// The name of the AWS Glue table. - final String tableName; +/// An object representing the payment responsibilities accepted by the +/// collaboration member for query compute costs. +class MembershipQueryComputePaymentConfig { + /// Indicates whether the collaboration member has accepted to pay for query + /// compute costs (TRUE) or has not accepted to pay for query + /// compute costs (FALSE). + /// + /// If the collaboration creator has not specified anyone to pay for query + /// compute costs, then the member who can query is the default payer. + /// + /// An error message is returned for the following reasons: + /// + ///
                + ///
              • + /// If you set the value to FALSE but you are responsible to pay + /// for query compute costs. + ///
              • + ///
              • + /// If you set the value to TRUE but you are not responsible to pay + /// for query compute costs. + ///
              • + ///
              + final bool isResponsible; - GlueTableReference({ - required this.databaseName, - required this.tableName, + MembershipQueryComputePaymentConfig({ + required this.isResponsible, }); - factory GlueTableReference.fromJson(Map json) { - return GlueTableReference( - databaseName: json['databaseName'] as String, - tableName: json['tableName'] as String, + factory MembershipQueryComputePaymentConfig.fromJson( + Map json) { + return MembershipQueryComputePaymentConfig( + isResponsible: json['isResponsible'] as bool, ); } Map toJson() { - final databaseName = this.databaseName; - final tableName = this.tableName; + final isResponsible = this.isResponsible; return { - 'databaseName': databaseName, - 'tableName': tableName, + 'isResponsible': isResponsible, }; } } -enum JoinRequiredOption { - queryRunner, +enum MembershipQueryLogStatus { + enabled, + disabled, } -extension JoinRequiredOptionValueExtension on JoinRequiredOption { +extension MembershipQueryLogStatusValueExtension on MembershipQueryLogStatus { String toValue() { switch (this) { - case JoinRequiredOption.queryRunner: - return 'QUERY_RUNNER'; + case MembershipQueryLogStatus.enabled: + return 'ENABLED'; + case MembershipQueryLogStatus.disabled: + return 'DISABLED'; } } } -extension JoinRequiredOptionFromString on String { - JoinRequiredOption toJoinRequiredOption() { +extension MembershipQueryLogStatusFromString on String { + MembershipQueryLogStatus toMembershipQueryLogStatus() { switch (this) { - case 'QUERY_RUNNER': - return JoinRequiredOption.queryRunner; + case 'ENABLED': + return MembershipQueryLogStatus.enabled; + case 'DISABLED': + return MembershipQueryLogStatus.disabled; } - throw Exception('$this is not known in enum JoinRequiredOption'); + throw Exception('$this is not known in enum MembershipQueryLogStatus'); } } -class ListCollaborationsOutput { - /// The list of collaborations. - final List collaborationList; - - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; - - ListCollaborationsOutput({ - required this.collaborationList, - this.nextToken, - }); +enum MembershipStatus { + active, + removed, + collaborationDeleted, +} - factory ListCollaborationsOutput.fromJson(Map json) { - return ListCollaborationsOutput( - collaborationList: (json['collaborationList'] as List) - .whereNotNull() - .map((e) => CollaborationSummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, - ); +extension MembershipStatusValueExtension on MembershipStatus { + String toValue() { + switch (this) { + case MembershipStatus.active: + return 'ACTIVE'; + case MembershipStatus.removed: + return 'REMOVED'; + case MembershipStatus.collaborationDeleted: + return 'COLLABORATION_DELETED'; + } } +} - Map toJson() { - final collaborationList = this.collaborationList; - final nextToken = this.nextToken; - return { - 'collaborationList': collaborationList, - if (nextToken != null) 'nextToken': nextToken, - }; +extension MembershipStatusFromString on String { + MembershipStatus toMembershipStatus() { + switch (this) { + case 'ACTIVE': + return MembershipStatus.active; + case 'REMOVED': + return MembershipStatus.removed; + case 'COLLABORATION_DELETED': + return MembershipStatus.collaborationDeleted; + } + throw Exception('$this is not known in enum MembershipStatus'); } } -class ListConfiguredTableAssociationsOutput { - /// The retrieved list of configured table associations. - final List - configuredTableAssociationSummaries; +/// The membership object listed by the request. +class MembershipSummary { + /// The unique ARN for the membership. + final String arn; - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; + /// The unique ARN for the membership's associated collaboration. + final String collaborationArn; - ListConfiguredTableAssociationsOutput({ - required this.configuredTableAssociationSummaries, - this.nextToken, - }); + /// The identifier of the Amazon Web Services principal that created the + /// collaboration. Currently only supports Amazon Web Services account ID. + final String collaborationCreatorAccountId; - factory ListConfiguredTableAssociationsOutput.fromJson( - Map json) { - return ListConfiguredTableAssociationsOutput( - configuredTableAssociationSummaries: - (json['configuredTableAssociationSummaries'] as List) - .whereNotNull() - .map((e) => ConfiguredTableAssociationSummary.fromJson( - e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, - ); - } + /// The display name of the collaboration creator. + final String collaborationCreatorDisplayName; - Map toJson() { - final configuredTableAssociationSummaries = - this.configuredTableAssociationSummaries; - final nextToken = this.nextToken; - return { - 'configuredTableAssociationSummaries': - configuredTableAssociationSummaries, - if (nextToken != null) 'nextToken': nextToken, - }; - } -} + /// The unique ID for the membership's collaboration. + final String collaborationId; -class ListConfiguredTablesOutput { - /// The configured tables listed by the request. - final List configuredTableSummaries; + /// The name for the membership's collaboration. + final String collaborationName; - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; + /// The time when the membership was created. + final DateTime createTime; - ListConfiguredTablesOutput({ - required this.configuredTableSummaries, - this.nextToken, - }); + /// The unique ID for the membership's collaboration. + final String id; - factory ListConfiguredTablesOutput.fromJson(Map json) { - return ListConfiguredTablesOutput( - configuredTableSummaries: (json['configuredTableSummaries'] as List) - .whereNotNull() - .map( - (e) => ConfiguredTableSummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, - ); - } + /// The abilities granted to the collaboration member. + final List memberAbilities; - Map toJson() { - final configuredTableSummaries = this.configuredTableSummaries; - final nextToken = this.nextToken; - return { - 'configuredTableSummaries': configuredTableSummaries, - if (nextToken != null) 'nextToken': nextToken, - }; - } -} + /// The payment responsibilities accepted by the collaboration member. + final MembershipPaymentConfiguration paymentConfiguration; -class ListMembersOutput { - /// The list of members returned by the ListMembers operation. - final List memberSummaries; + /// The status of the membership. + final MembershipStatus status; - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; + /// The time the membership metadata was last updated. + final DateTime updateTime; - ListMembersOutput({ - required this.memberSummaries, - this.nextToken, + MembershipSummary({ + required this.arn, + required this.collaborationArn, + required this.collaborationCreatorAccountId, + required this.collaborationCreatorDisplayName, + required this.collaborationId, + required this.collaborationName, + required this.createTime, + required this.id, + required this.memberAbilities, + required this.paymentConfiguration, + required this.status, + required this.updateTime, }); - factory ListMembersOutput.fromJson(Map json) { - return ListMembersOutput( - memberSummaries: (json['memberSummaries'] as List) + factory MembershipSummary.fromJson(Map json) { + return MembershipSummary( + arn: json['arn'] as String, + collaborationArn: json['collaborationArn'] as String, + collaborationCreatorAccountId: + json['collaborationCreatorAccountId'] as String, + collaborationCreatorDisplayName: + json['collaborationCreatorDisplayName'] as String, + collaborationId: json['collaborationId'] as String, + collaborationName: json['collaborationName'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + id: json['id'] as String, + memberAbilities: (json['memberAbilities'] as List) .whereNotNull() - .map((e) => MemberSummary.fromJson(e as Map)) + .map((e) => (e as String).toMemberAbility()) .toList(), - nextToken: json['nextToken'] as String?, + paymentConfiguration: MembershipPaymentConfiguration.fromJson( + json['paymentConfiguration'] as Map), + status: (json['status'] as String).toMembershipStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), ); } Map toJson() { - final memberSummaries = this.memberSummaries; - final nextToken = this.nextToken; + final arn = this.arn; + final collaborationArn = this.collaborationArn; + final collaborationCreatorAccountId = this.collaborationCreatorAccountId; + final collaborationCreatorDisplayName = + this.collaborationCreatorDisplayName; + final collaborationId = this.collaborationId; + final collaborationName = this.collaborationName; + final createTime = this.createTime; + final id = this.id; + final memberAbilities = this.memberAbilities; + final paymentConfiguration = this.paymentConfiguration; + final status = this.status; + final updateTime = this.updateTime; return { - 'memberSummaries': memberSummaries, - if (nextToken != null) 'nextToken': nextToken, + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationCreatorAccountId': collaborationCreatorAccountId, + 'collaborationCreatorDisplayName': collaborationCreatorDisplayName, + 'collaborationId': collaborationId, + 'collaborationName': collaborationName, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), + 'paymentConfiguration': paymentConfiguration, + 'status': status.toValue(), + 'updateTime': unixTimestampToJson(updateTime), }; } } -class ListMembershipsOutput { - /// The list of memberships returned from the ListMemberships operation. - final List membershipSummaries; - - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; - - ListMembershipsOutput({ - required this.membershipSummaries, - this.nextToken, - }); +enum ParameterType { + smallint, + integer, + bigint, + decimal, + real, + doublePrecision, + boolean, + char, + varchar, + date, + timestamp, + timestamptz, + time, + timetz, + varbyte, +} - factory ListMembershipsOutput.fromJson(Map json) { - return ListMembershipsOutput( - membershipSummaries: (json['membershipSummaries'] as List) - .whereNotNull() - .map((e) => MembershipSummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, - ); +extension ParameterTypeValueExtension on ParameterType { + String toValue() { + switch (this) { + case ParameterType.smallint: + return 'SMALLINT'; + case ParameterType.integer: + return 'INTEGER'; + case ParameterType.bigint: + return 'BIGINT'; + case ParameterType.decimal: + return 'DECIMAL'; + case ParameterType.real: + return 'REAL'; + case ParameterType.doublePrecision: + return 'DOUBLE_PRECISION'; + case ParameterType.boolean: + return 'BOOLEAN'; + case ParameterType.char: + return 'CHAR'; + case ParameterType.varchar: + return 'VARCHAR'; + case ParameterType.date: + return 'DATE'; + case ParameterType.timestamp: + return 'TIMESTAMP'; + case ParameterType.timestamptz: + return 'TIMESTAMPTZ'; + case ParameterType.time: + return 'TIME'; + case ParameterType.timetz: + return 'TIMETZ'; + case ParameterType.varbyte: + return 'VARBYTE'; + } } +} - Map toJson() { - final membershipSummaries = this.membershipSummaries; - final nextToken = this.nextToken; - return { - 'membershipSummaries': membershipSummaries, - if (nextToken != null) 'nextToken': nextToken, - }; +extension ParameterTypeFromString on String { + ParameterType toParameterType() { + switch (this) { + case 'SMALLINT': + return ParameterType.smallint; + case 'INTEGER': + return ParameterType.integer; + case 'BIGINT': + return ParameterType.bigint; + case 'DECIMAL': + return ParameterType.decimal; + case 'REAL': + return ParameterType.real; + case 'DOUBLE_PRECISION': + return ParameterType.doublePrecision; + case 'BOOLEAN': + return ParameterType.boolean; + case 'CHAR': + return ParameterType.char; + case 'VARCHAR': + return ParameterType.varchar; + case 'DATE': + return ParameterType.date; + case 'TIMESTAMP': + return ParameterType.timestamp; + case 'TIMESTAMPTZ': + return ParameterType.timestamptz; + case 'TIME': + return ParameterType.time; + case 'TIMETZ': + return ParameterType.timetz; + case 'VARBYTE': + return ParameterType.varbyte; + } + throw Exception('$this is not known in enum ParameterType'); } } -class ListProtectedQueriesOutput { - /// A list of protected queries. - final List protectedQueries; - - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; +/// An object representing the collaboration member's payment responsibilities +/// set by the collaboration creator. +class PaymentConfiguration { + /// The collaboration member's payment responsibilities set by the collaboration + /// creator for query compute costs. + final QueryComputePaymentConfig queryCompute; - ListProtectedQueriesOutput({ - required this.protectedQueries, - this.nextToken, + PaymentConfiguration({ + required this.queryCompute, }); - factory ListProtectedQueriesOutput.fromJson(Map json) { - return ListProtectedQueriesOutput( - protectedQueries: (json['protectedQueries'] as List) - .whereNotNull() - .map((e) => ProtectedQuerySummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, + factory PaymentConfiguration.fromJson(Map json) { + return PaymentConfiguration( + queryCompute: QueryComputePaymentConfig.fromJson( + json['queryCompute'] as Map), ); } Map toJson() { - final protectedQueries = this.protectedQueries; - final nextToken = this.nextToken; + final queryCompute = this.queryCompute; return { - 'protectedQueries': protectedQueries, - if (nextToken != null) 'nextToken': nextToken, + 'queryCompute': queryCompute, }; } } -class ListSchemasOutput { - /// The retrieved list of schemas. - final List schemaSummaries; - - /// The token value retrieved from a previous call to access the next page of - /// results. - final String? nextToken; +class PreviewPrivacyImpactOutput { + /// An estimate of the number of aggregation functions that the member who can + /// query can run given the epsilon and noise parameters. This does not change + /// the privacy budget. + final PrivacyImpact privacyImpact; - ListSchemasOutput({ - required this.schemaSummaries, - this.nextToken, + PreviewPrivacyImpactOutput({ + required this.privacyImpact, }); - factory ListSchemasOutput.fromJson(Map json) { - return ListSchemasOutput( - schemaSummaries: (json['schemaSummaries'] as List) - .whereNotNull() - .map((e) => SchemaSummary.fromJson(e as Map)) - .toList(), - nextToken: json['nextToken'] as String?, + factory PreviewPrivacyImpactOutput.fromJson(Map json) { + return PreviewPrivacyImpactOutput( + privacyImpact: + PrivacyImpact.fromJson(json['privacyImpact'] as Map), ); } Map toJson() { - final schemaSummaries = this.schemaSummaries; - final nextToken = this.nextToken; + final privacyImpact = this.privacyImpact; return { - 'schemaSummaries': schemaSummaries, - if (nextToken != null) 'nextToken': nextToken, + 'privacyImpact': privacyImpact, }; } } -class ListTagsForResourceOutput { - /// A map of objects specifying each key name and value. - final Map tags; +/// Specifies the updated epsilon and noise parameters to preview. The preview +/// allows you to see how the maximum number of each type of aggregation +/// function would change with the new parameters. +class PreviewPrivacyImpactParametersInput { + /// An array that specifies the epsilon and noise parameters. + final DifferentialPrivacyPreviewParametersInput? differentialPrivacy; - ListTagsForResourceOutput({ - required this.tags, + PreviewPrivacyImpactParametersInput({ + this.differentialPrivacy, }); - factory ListTagsForResourceOutput.fromJson(Map json) { - return ListTagsForResourceOutput( - tags: (json['tags'] as Map) - .map((k, e) => MapEntry(k, e as String)), - ); - } - Map toJson() { - final tags = this.tags; + final differentialPrivacy = this.differentialPrivacy; return { - 'tags': tags, + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, }; } } -enum MemberAbility { - canQuery, - canReceiveResults, -} +/// The epsilon parameter value and number of each aggregation function that you +/// can perform. +class PrivacyBudget { + /// An object that specifies the epsilon parameter and the utility in terms of + /// total aggregations, as well as the remaining aggregations available. + final DifferentialPrivacyPrivacyBudget? differentialPrivacy; -extension MemberAbilityValueExtension on MemberAbility { - String toValue() { - switch (this) { - case MemberAbility.canQuery: - return 'CAN_QUERY'; - case MemberAbility.canReceiveResults: - return 'CAN_RECEIVE_RESULTS'; - } - } -} + PrivacyBudget({ + this.differentialPrivacy, + }); -extension MemberAbilityFromString on String { - MemberAbility toMemberAbility() { - switch (this) { - case 'CAN_QUERY': - return MemberAbility.canQuery; - case 'CAN_RECEIVE_RESULTS': - return MemberAbility.canReceiveResults; - } - throw Exception('$this is not known in enum MemberAbility'); + factory PrivacyBudget.fromJson(Map json) { + return PrivacyBudget( + differentialPrivacy: json['differentialPrivacy'] != null + ? DifferentialPrivacyPrivacyBudget.fromJson( + json['differentialPrivacy'] as Map) + : null, + ); } -} - -/// Basic metadata used to construct a new member. -class MemberSpecification { - /// The identifier used to reference members of the collaboration. Currently - /// only supports AWS Account ID. - final String accountId; - - /// The member's display name. - final String displayName; - - /// The abilities granted to the collaboration member. - final List memberAbilities; - - MemberSpecification({ - required this.accountId, - required this.displayName, - required this.memberAbilities, - }); Map toJson() { - final accountId = this.accountId; - final displayName = this.displayName; - final memberAbilities = this.memberAbilities; + final differentialPrivacy = this.differentialPrivacy; return { - 'accountId': accountId, - 'displayName': displayName, - 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, }; } } -enum MemberStatus { - invited, - active, - left, - removed, -} +/// An array that summaries the specified privacy budget. This summary includes +/// collaboration information, creation information, membership information, and +/// privacy budget information. +class PrivacyBudgetSummary { + /// The provided privacy budget. + final PrivacyBudget budget; -extension MemberStatusValueExtension on MemberStatus { - String toValue() { - switch (this) { - case MemberStatus.invited: - return 'INVITED'; - case MemberStatus.active: - return 'ACTIVE'; - case MemberStatus.left: - return 'LEFT'; - case MemberStatus.removed: - return 'REMOVED'; - } - } -} + /// The ARN of the collaboration that contains this privacy budget. + final String collaborationArn; -extension MemberStatusFromString on String { - MemberStatus toMemberStatus() { - switch (this) { - case 'INVITED': - return MemberStatus.invited; - case 'ACTIVE': - return MemberStatus.active; - case 'LEFT': - return MemberStatus.left; - case 'REMOVED': - return MemberStatus.removed; - } - throw Exception('$this is not known in enum MemberStatus'); - } -} + /// The unique identifier of the collaboration that contains this privacy + /// budget. + final String collaborationId; -/// The member object listed by the request. -class MemberSummary { - /// The abilities granted to the collaboration member. - final List abilities; + /// The time at which the privacy budget was created. + final DateTime createTime; - /// The identifier used to reference members of the collaboration. Currently - /// only supports AWS Account ID. - final String accountId; + /// The unique identifier of the privacy budget. + final String id; - /// The time when the member was created. - final DateTime createTime; + /// The Amazon Resource Name (ARN) of the member who created the privacy budget + /// summary. + final String membershipArn; - /// The member's display name. - final String displayName; + /// The identifier for a membership resource. + final String membershipId; - /// The status of the member. Valid values are `INVITED`, `ACTIVE`, `LEFT`, and - /// `REMOVED`. - final MemberStatus status; + /// The ARN of the privacy budget template. + final String privacyBudgetTemplateArn; - /// The time the member metadata was last updated. - final DateTime updateTime; + /// The unique identifier of the privacy budget template. + final String privacyBudgetTemplateId; - /// The unique ARN for the member's associated membership, if present. - final String? membershipArn; + /// Specifies the type of the privacy budget. + final PrivacyBudgetType type; - /// The unique ID for the member's associated membership, if present. - final String? membershipId; + /// The most recent time at which the privacy budget was updated. + final DateTime updateTime; - MemberSummary({ - required this.abilities, - required this.accountId, + PrivacyBudgetSummary({ + required this.budget, + required this.collaborationArn, + required this.collaborationId, required this.createTime, - required this.displayName, - required this.status, - required this.updateTime, - this.membershipArn, - this.membershipId, - }); - - factory MemberSummary.fromJson(Map json) { - return MemberSummary( - abilities: (json['abilities'] as List) - .whereNotNull() - .map((e) => (e as String).toMemberAbility()) - .toList(), - accountId: json['accountId'] as String, + required this.id, + required this.membershipArn, + required this.membershipId, + required this.privacyBudgetTemplateArn, + required this.privacyBudgetTemplateId, + required this.type, + required this.updateTime, + }); + + factory PrivacyBudgetSummary.fromJson(Map json) { + return PrivacyBudgetSummary( + budget: PrivacyBudget.fromJson(json['budget'] as Map), + collaborationArn: json['collaborationArn'] as String, + collaborationId: json['collaborationId'] as String, createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), - displayName: json['displayName'] as String, - status: (json['status'] as String).toMemberStatus(), + id: json['id'] as String, + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + privacyBudgetTemplateArn: json['privacyBudgetTemplateArn'] as String, + privacyBudgetTemplateId: json['privacyBudgetTemplateId'] as String, + type: (json['type'] as String).toPrivacyBudgetType(), updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), - membershipArn: json['membershipArn'] as String?, - membershipId: json['membershipId'] as String?, ); } Map toJson() { - final abilities = this.abilities; - final accountId = this.accountId; + final budget = this.budget; + final collaborationArn = this.collaborationArn; + final collaborationId = this.collaborationId; final createTime = this.createTime; - final displayName = this.displayName; - final status = this.status; - final updateTime = this.updateTime; + final id = this.id; final membershipArn = this.membershipArn; final membershipId = this.membershipId; + final privacyBudgetTemplateArn = this.privacyBudgetTemplateArn; + final privacyBudgetTemplateId = this.privacyBudgetTemplateId; + final type = this.type; + final updateTime = this.updateTime; return { - 'abilities': abilities.map((e) => e.toValue()).toList(), - 'accountId': accountId, + 'budget': budget, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, 'createTime': unixTimestampToJson(createTime), - 'displayName': displayName, - 'status': status.toValue(), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'privacyBudgetTemplateArn': privacyBudgetTemplateArn, + 'privacyBudgetTemplateId': privacyBudgetTemplateId, + 'type': type.toValue(), 'updateTime': unixTimestampToJson(updateTime), - if (membershipArn != null) 'membershipArn': membershipArn, - if (membershipId != null) 'membershipId': membershipId, }; } } -/// The membership object. -class Membership { - /// The unique ARN for the membership. +/// An object that defines the privacy budget template. +class PrivacyBudgetTemplate { + /// The ARN of the privacy budget template. final String arn; - /// The unique ARN for the membership's associated collaboration. + /// How often the privacy budget refreshes. + /// + /// If you plan to regularly bring new data into the collaboration, use + /// CALENDAR_MONTH to automatically get a new privacy budget for + /// the collaboration every calendar month. Choosing this option allows + /// arbitrary amounts of information to be revealed about rows of the data when + /// repeatedly queried across refreshes. Avoid choosing this if the same rows + /// will be repeatedly queried between privacy budget refreshes. + /// + final PrivacyBudgetTemplateAutoRefresh autoRefresh; + + /// The ARN of the collaboration that contains this privacy budget template. final String collaborationArn; - /// The identifier used to reference members of the collaboration. Currently - /// only supports AWS account ID. - final String collaborationCreatorAccountId; - - /// The display name of the collaboration creator. - final String collaborationCreatorDisplayName; - - /// The unique ID for the membership's collaboration. + /// The unique ID of the collaboration that contains this privacy budget + /// template. final String collaborationId; - /// The name of the membership's collaboration. - final String collaborationName; - - /// The time when the membership was created. + /// The time at which the privacy budget template was created. final DateTime createTime; - /// The unique ID of the membership. + /// The unique identifier of the privacy budget template. final String id; - /// The abilities granted to the collaboration member. - final List memberAbilities; + /// The Amazon Resource Name (ARN) of the member who created the privacy budget + /// template. + final String membershipArn; - /// An indicator as to whether query logging has been enabled or disabled for - /// the collaboration. - final MembershipQueryLogStatus queryLogStatus; + /// The identifier for a membership resource. + final String membershipId; - /// The status of the membership. Valid values are `ACTIVE`, `REMOVED`, and - /// `COLLABORATION_DELETED`. - final MembershipStatus status; + /// Specifies the epislon and noise parameters for the privacy budget template. + final PrivacyBudgetTemplateParametersOutput parameters; - /// The time the membership metadata was last updated. + /// Specifies the type of the privacy budget template. + final PrivacyBudgetType privacyBudgetType; + + /// The most recent time at which the privacy budget template was updated. final DateTime updateTime; - Membership({ + PrivacyBudgetTemplate({ required this.arn, + required this.autoRefresh, required this.collaborationArn, - required this.collaborationCreatorAccountId, - required this.collaborationCreatorDisplayName, required this.collaborationId, - required this.collaborationName, required this.createTime, required this.id, - required this.memberAbilities, - required this.queryLogStatus, - required this.status, + required this.membershipArn, + required this.membershipId, + required this.parameters, + required this.privacyBudgetType, required this.updateTime, }); - factory Membership.fromJson(Map json) { - return Membership( + factory PrivacyBudgetTemplate.fromJson(Map json) { + return PrivacyBudgetTemplate( arn: json['arn'] as String, + autoRefresh: + (json['autoRefresh'] as String).toPrivacyBudgetTemplateAutoRefresh(), collaborationArn: json['collaborationArn'] as String, - collaborationCreatorAccountId: - json['collaborationCreatorAccountId'] as String, - collaborationCreatorDisplayName: - json['collaborationCreatorDisplayName'] as String, collaborationId: json['collaborationId'] as String, - collaborationName: json['collaborationName'] as String, createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), id: json['id'] as String, - memberAbilities: (json['memberAbilities'] as List) - .whereNotNull() - .map((e) => (e as String).toMemberAbility()) - .toList(), - queryLogStatus: - (json['queryLogStatus'] as String).toMembershipQueryLogStatus(), - status: (json['status'] as String).toMembershipStatus(), + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + parameters: PrivacyBudgetTemplateParametersOutput.fromJson( + json['parameters'] as Map), + privacyBudgetType: + (json['privacyBudgetType'] as String).toPrivacyBudgetType(), updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), ); } Map toJson() { final arn = this.arn; + final autoRefresh = this.autoRefresh; final collaborationArn = this.collaborationArn; - final collaborationCreatorAccountId = this.collaborationCreatorAccountId; - final collaborationCreatorDisplayName = - this.collaborationCreatorDisplayName; final collaborationId = this.collaborationId; - final collaborationName = this.collaborationName; final createTime = this.createTime; final id = this.id; - final memberAbilities = this.memberAbilities; - final queryLogStatus = this.queryLogStatus; - final status = this.status; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final parameters = this.parameters; + final privacyBudgetType = this.privacyBudgetType; final updateTime = this.updateTime; return { 'arn': arn, + 'autoRefresh': autoRefresh.toValue(), 'collaborationArn': collaborationArn, - 'collaborationCreatorAccountId': collaborationCreatorAccountId, - 'collaborationCreatorDisplayName': collaborationCreatorDisplayName, 'collaborationId': collaborationId, - 'collaborationName': collaborationName, 'createTime': unixTimestampToJson(createTime), 'id': id, - 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), - 'queryLogStatus': queryLogStatus.toValue(), - 'status': status.toValue(), + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'parameters': parameters, + 'privacyBudgetType': privacyBudgetType.toValue(), 'updateTime': unixTimestampToJson(updateTime), }; } } -enum MembershipQueryLogStatus { - enabled, - disabled, +enum PrivacyBudgetTemplateAutoRefresh { + calendarMonth, + none, } -extension MembershipQueryLogStatusValueExtension on MembershipQueryLogStatus { +extension PrivacyBudgetTemplateAutoRefreshValueExtension + on PrivacyBudgetTemplateAutoRefresh { String toValue() { switch (this) { - case MembershipQueryLogStatus.enabled: - return 'ENABLED'; - case MembershipQueryLogStatus.disabled: - return 'DISABLED'; + case PrivacyBudgetTemplateAutoRefresh.calendarMonth: + return 'CALENDAR_MONTH'; + case PrivacyBudgetTemplateAutoRefresh.none: + return 'NONE'; } } } -extension MembershipQueryLogStatusFromString on String { - MembershipQueryLogStatus toMembershipQueryLogStatus() { +extension PrivacyBudgetTemplateAutoRefreshFromString on String { + PrivacyBudgetTemplateAutoRefresh toPrivacyBudgetTemplateAutoRefresh() { switch (this) { - case 'ENABLED': - return MembershipQueryLogStatus.enabled; - case 'DISABLED': - return MembershipQueryLogStatus.disabled; + case 'CALENDAR_MONTH': + return PrivacyBudgetTemplateAutoRefresh.calendarMonth; + case 'NONE': + return PrivacyBudgetTemplateAutoRefresh.none; } - throw Exception('$this is not known in enum MembershipQueryLogStatus'); + throw Exception( + '$this is not known in enum PrivacyBudgetTemplateAutoRefresh'); } } -enum MembershipStatus { - active, - removed, - collaborationDeleted, -} +/// The epsilon and noise parameters that you want to use for the privacy budget +/// template. +class PrivacyBudgetTemplateParametersInput { + /// An object that specifies the epsilon and noise parameters. + final DifferentialPrivacyTemplateParametersInput? differentialPrivacy; -extension MembershipStatusValueExtension on MembershipStatus { - String toValue() { - switch (this) { - case MembershipStatus.active: - return 'ACTIVE'; - case MembershipStatus.removed: - return 'REMOVED'; - case MembershipStatus.collaborationDeleted: - return 'COLLABORATION_DELETED'; - } + PrivacyBudgetTemplateParametersInput({ + this.differentialPrivacy, + }); + + Map toJson() { + final differentialPrivacy = this.differentialPrivacy; + return { + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, + }; } } -extension MembershipStatusFromString on String { - MembershipStatus toMembershipStatus() { - switch (this) { - case 'ACTIVE': - return MembershipStatus.active; - case 'REMOVED': - return MembershipStatus.removed; - case 'COLLABORATION_DELETED': - return MembershipStatus.collaborationDeleted; - } - throw Exception('$this is not known in enum MembershipStatus'); +/// The epsilon and noise parameters that were used in the privacy budget +/// template. +class PrivacyBudgetTemplateParametersOutput { + /// The epsilon and noise parameters. + final DifferentialPrivacyTemplateParametersOutput? differentialPrivacy; + + PrivacyBudgetTemplateParametersOutput({ + this.differentialPrivacy, + }); + + factory PrivacyBudgetTemplateParametersOutput.fromJson( + Map json) { + return PrivacyBudgetTemplateParametersOutput( + differentialPrivacy: json['differentialPrivacy'] != null + ? DifferentialPrivacyTemplateParametersOutput.fromJson( + json['differentialPrivacy'] as Map) + : null, + ); + } + + Map toJson() { + final differentialPrivacy = this.differentialPrivacy; + return { + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, + }; } } -/// The membership object listed by the request. -class MembershipSummary { - /// The unique ARN for the membership. +/// A summary of the privacy budget template. The summary includes membership +/// information, collaboration information, and creation information. +class PrivacyBudgetTemplateSummary { + /// The ARN of the privacy budget template. final String arn; - /// The unique ARN for the membership's associated collaboration. + /// The ARN of the collaboration that contains this privacy budget template. final String collaborationArn; - /// The identifier of the AWS principal that created the collaboration. - /// Currently only supports AWS account ID. - final String collaborationCreatorAccountId; - - /// The display name of the collaboration creator. - final String collaborationCreatorDisplayName; - - /// The unique ID for the membership's collaboration. + /// The unique ID of the collaboration that contains this privacy budget + /// template. final String collaborationId; - /// The name for the membership's collaboration. - final String collaborationName; - - /// The time when the membership was created. + /// The time at which the privacy budget template was created. final DateTime createTime; - /// The unique ID for the membership's collaboration. + /// The unique identifier of the privacy budget template. final String id; - /// The abilities granted to the collaboration member. - final List memberAbilities; + /// The Amazon Resource Name (ARN) of the member who created the privacy budget + /// template. + final String membershipArn; - /// The status of the membership. Valid values are `ACTIVE`, `REMOVED`, and - /// `COLLABORATION_DELETED`. - final MembershipStatus status; + /// The identifier for a membership resource. + final String membershipId; - /// The time the membership metadata was last updated. + /// The type of the privacy budget template. + final PrivacyBudgetType privacyBudgetType; + + /// The most recent time at which the privacy budget template was updated. final DateTime updateTime; - MembershipSummary({ + PrivacyBudgetTemplateSummary({ required this.arn, required this.collaborationArn, - required this.collaborationCreatorAccountId, - required this.collaborationCreatorDisplayName, required this.collaborationId, - required this.collaborationName, required this.createTime, required this.id, - required this.memberAbilities, - required this.status, + required this.membershipArn, + required this.membershipId, + required this.privacyBudgetType, required this.updateTime, }); - factory MembershipSummary.fromJson(Map json) { - return MembershipSummary( + factory PrivacyBudgetTemplateSummary.fromJson(Map json) { + return PrivacyBudgetTemplateSummary( arn: json['arn'] as String, collaborationArn: json['collaborationArn'] as String, - collaborationCreatorAccountId: - json['collaborationCreatorAccountId'] as String, - collaborationCreatorDisplayName: - json['collaborationCreatorDisplayName'] as String, collaborationId: json['collaborationId'] as String, - collaborationName: json['collaborationName'] as String, createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), id: json['id'] as String, - memberAbilities: (json['memberAbilities'] as List) - .whereNotNull() - .map((e) => (e as String).toMemberAbility()) - .toList(), - status: (json['status'] as String).toMembershipStatus(), + membershipArn: json['membershipArn'] as String, + membershipId: json['membershipId'] as String, + privacyBudgetType: + (json['privacyBudgetType'] as String).toPrivacyBudgetType(), updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), ); } @@ -3835,33 +8291,100 @@ class MembershipSummary { Map toJson() { final arn = this.arn; final collaborationArn = this.collaborationArn; - final collaborationCreatorAccountId = this.collaborationCreatorAccountId; - final collaborationCreatorDisplayName = - this.collaborationCreatorDisplayName; final collaborationId = this.collaborationId; - final collaborationName = this.collaborationName; final createTime = this.createTime; final id = this.id; - final memberAbilities = this.memberAbilities; - final status = this.status; + final membershipArn = this.membershipArn; + final membershipId = this.membershipId; + final privacyBudgetType = this.privacyBudgetType; final updateTime = this.updateTime; return { - 'arn': arn, - 'collaborationArn': collaborationArn, - 'collaborationCreatorAccountId': collaborationCreatorAccountId, - 'collaborationCreatorDisplayName': collaborationCreatorDisplayName, - 'collaborationId': collaborationId, - 'collaborationName': collaborationName, - 'createTime': unixTimestampToJson(createTime), - 'id': id, - 'memberAbilities': memberAbilities.map((e) => e.toValue()).toList(), - 'status': status.toValue(), - 'updateTime': unixTimestampToJson(updateTime), + 'arn': arn, + 'collaborationArn': collaborationArn, + 'collaborationId': collaborationId, + 'createTime': unixTimestampToJson(createTime), + 'id': id, + 'membershipArn': membershipArn, + 'membershipId': membershipId, + 'privacyBudgetType': privacyBudgetType.toValue(), + 'updateTime': unixTimestampToJson(updateTime), + }; + } +} + +/// The epsilon and noise parameters that you want to update in the privacy +/// budget template. +class PrivacyBudgetTemplateUpdateParameters { + /// An object that specifies the new values for the epsilon and noise + /// parameters. + final DifferentialPrivacyTemplateUpdateParameters? differentialPrivacy; + + PrivacyBudgetTemplateUpdateParameters({ + this.differentialPrivacy, + }); + + Map toJson() { + final differentialPrivacy = this.differentialPrivacy; + return { + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, + }; + } +} + +enum PrivacyBudgetType { + differentialPrivacy, +} + +extension PrivacyBudgetTypeValueExtension on PrivacyBudgetType { + String toValue() { + switch (this) { + case PrivacyBudgetType.differentialPrivacy: + return 'DIFFERENTIAL_PRIVACY'; + } + } +} + +extension PrivacyBudgetTypeFromString on String { + PrivacyBudgetType toPrivacyBudgetType() { + switch (this) { + case 'DIFFERENTIAL_PRIVACY': + return PrivacyBudgetType.differentialPrivacy; + } + throw Exception('$this is not known in enum PrivacyBudgetType'); + } +} + +/// Provides an estimate of the number of aggregation functions that the member +/// who can query can run given the epsilon and noise parameters. +class PrivacyImpact { + /// An object that lists the number and type of aggregation functions you can + /// perform. + final DifferentialPrivacyPrivacyImpact? differentialPrivacy; + + PrivacyImpact({ + this.differentialPrivacy, + }); + + factory PrivacyImpact.fromJson(Map json) { + return PrivacyImpact( + differentialPrivacy: json['differentialPrivacy'] != null + ? DifferentialPrivacyPrivacyImpact.fromJson( + json['differentialPrivacy'] as Map) + : null, + ); + } + + Map toJson() { + final differentialPrivacy = this.differentialPrivacy; + return { + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, }; } } -/// The parameters for an AWS Clean Rooms protected query. +/// The parameters for an Clean Rooms protected query. class ProtectedQuery { /// The time at which the protected query was created. final DateTime createTime; @@ -3875,21 +8398,25 @@ class ProtectedQuery { /// The identifier for the membership. final String membershipId; - /// Contains any details needed to write the query results. - final ProtectedQueryResultConfiguration resultConfiguration; - - /// The protected query SQL parameters. - final ProtectedQuerySQLParameters sqlParameters; - /// The status of the query. final ProtectedQueryStatus status; + /// The sensitivity parameters of the differential privacy results of the + /// protected query. + final DifferentialPrivacyParameters? differentialPrivacy; + /// An error thrown by the protected query. final ProtectedQueryError? error; /// The result of the protected query. final ProtectedQueryResult? result; + /// Contains any details needed to write the query results. + final ProtectedQueryResultConfiguration? resultConfiguration; + + /// The protected query SQL parameters. + final ProtectedQuerySQLParameters? sqlParameters; + /// Statistics about protected query execution. final ProtectedQueryStatistics? statistics; @@ -3898,11 +8425,12 @@ class ProtectedQuery { required this.id, required this.membershipArn, required this.membershipId, - required this.resultConfiguration, - required this.sqlParameters, required this.status, + this.differentialPrivacy, this.error, this.result, + this.resultConfiguration, + this.sqlParameters, this.statistics, }); @@ -3912,11 +8440,11 @@ class ProtectedQuery { id: json['id'] as String, membershipArn: json['membershipArn'] as String, membershipId: json['membershipId'] as String, - resultConfiguration: ProtectedQueryResultConfiguration.fromJson( - json['resultConfiguration'] as Map), - sqlParameters: ProtectedQuerySQLParameters.fromJson( - json['sqlParameters'] as Map), status: (json['status'] as String).toProtectedQueryStatus(), + differentialPrivacy: json['differentialPrivacy'] != null + ? DifferentialPrivacyParameters.fromJson( + json['differentialPrivacy'] as Map) + : null, error: json['error'] != null ? ProtectedQueryError.fromJson(json['error'] as Map) : null, @@ -3924,6 +8452,14 @@ class ProtectedQuery { ? ProtectedQueryResult.fromJson( json['result'] as Map) : null, + resultConfiguration: json['resultConfiguration'] != null + ? ProtectedQueryResultConfiguration.fromJson( + json['resultConfiguration'] as Map) + : null, + sqlParameters: json['sqlParameters'] != null + ? ProtectedQuerySQLParameters.fromJson( + json['sqlParameters'] as Map) + : null, statistics: json['statistics'] != null ? ProtectedQueryStatistics.fromJson( json['statistics'] as Map) @@ -3936,22 +8472,26 @@ class ProtectedQuery { final id = this.id; final membershipArn = this.membershipArn; final membershipId = this.membershipId; - final resultConfiguration = this.resultConfiguration; - final sqlParameters = this.sqlParameters; final status = this.status; + final differentialPrivacy = this.differentialPrivacy; final error = this.error; final result = this.result; + final resultConfiguration = this.resultConfiguration; + final sqlParameters = this.sqlParameters; final statistics = this.statistics; return { 'createTime': unixTimestampToJson(createTime), 'id': id, 'membershipArn': membershipArn, 'membershipId': membershipId, - 'resultConfiguration': resultConfiguration, - 'sqlParameters': sqlParameters, 'status': status.toValue(), + if (differentialPrivacy != null) + 'differentialPrivacy': differentialPrivacy, if (error != null) 'error': error, if (result != null) 'result': result, + if (resultConfiguration != null) + 'resultConfiguration': resultConfiguration, + if (sqlParameters != null) 'sqlParameters': sqlParameters, if (statistics != null) 'statistics': statistics, }; } @@ -3989,15 +8529,25 @@ class ProtectedQueryError { /// Contains details about the protected query output. class ProtectedQueryOutput { + /// The list of member Amazon Web Services account(s) that received the results + /// of the query. + final List? memberList; + /// If present, the output for a protected query with an `S3` output type. final ProtectedQueryS3Output? s3; ProtectedQueryOutput({ + this.memberList, this.s3, }); factory ProtectedQueryOutput.fromJson(Map json) { return ProtectedQueryOutput( + memberList: (json['memberList'] as List?) + ?.whereNotNull() + .map((e) => ProtectedQuerySingleMemberOutput.fromJson( + e as Map)) + .toList(), s3: json['s3'] != null ? ProtectedQueryS3Output.fromJson(json['s3'] as Map) : null, @@ -4005,8 +8555,10 @@ class ProtectedQueryOutput { } Map toJson() { + final memberList = this.memberList; final s3 = this.s3; return { + if (memberList != null) 'memberList': memberList, if (s3 != null) 's3': s3, }; } @@ -4151,23 +8703,64 @@ class ProtectedQueryS3OutputConfiguration { /// The parameters for the SQL type Protected Query. class ProtectedQuerySQLParameters { + /// The Amazon Resource Name (ARN) associated with the analysis template within + /// a collaboration. + final String? analysisTemplateArn; + + /// The protected query SQL parameters. + final Map? parameters; + /// The query string to be submitted. - final String queryString; + final String? queryString; ProtectedQuerySQLParameters({ - required this.queryString, + this.analysisTemplateArn, + this.parameters, + this.queryString, }); factory ProtectedQuerySQLParameters.fromJson(Map json) { return ProtectedQuerySQLParameters( - queryString: json['queryString'] as String, + analysisTemplateArn: json['analysisTemplateArn'] as String?, + parameters: (json['parameters'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + queryString: json['queryString'] as String?, ); } Map toJson() { + final analysisTemplateArn = this.analysisTemplateArn; + final parameters = this.parameters; final queryString = this.queryString; return { - 'queryString': queryString, + if (analysisTemplateArn != null) + 'analysisTemplateArn': analysisTemplateArn, + if (parameters != null) 'parameters': parameters, + if (queryString != null) 'queryString': queryString, + }; + } +} + +/// Details about the member who received the query result. +class ProtectedQuerySingleMemberOutput { + /// The Amazon Web Services account ID of the member in the collaboration who + /// can receive results for the query. + final String accountId; + + ProtectedQuerySingleMemberOutput({ + required this.accountId, + }); + + factory ProtectedQuerySingleMemberOutput.fromJson(Map json) { + return ProtectedQuerySingleMemberOutput( + accountId: json['accountId'] as String, + ); + } + + Map toJson() { + final accountId = this.accountId; + return { + 'accountId': accountId, }; } } @@ -4324,6 +8917,42 @@ extension ProtectedQueryTypeFromString on String { } } +/// An object representing the collaboration member's payment responsibilities +/// set by the collaboration creator for query compute costs. +class QueryComputePaymentConfig { + /// Indicates whether the collaboration creator has configured the collaboration + /// member to pay for query compute costs (TRUE) or has not + /// configured the collaboration member to pay for query compute costs + /// (FALSE). + /// + /// Exactly one member can be configured to pay for query compute costs. An + /// error is returned if the collaboration creator sets a TRUE + /// value for more than one member in the collaboration. + /// + /// If the collaboration creator hasn't specified anyone as the member paying + /// for query compute costs, then the member who can query is the default payer. + /// An error is returned if the collaboration creator sets a FALSE + /// value for the member who can query. + final bool isResponsible; + + QueryComputePaymentConfig({ + required this.isResponsible, + }); + + factory QueryComputePaymentConfig.fromJson(Map json) { + return QueryComputePaymentConfig( + isResponsible: json['isResponsible'] as bool, + ); + } + + Map toJson() { + final isResponsible = this.isResponsible; + return { + 'isResponsible': isResponsible, + }; + } +} + enum ResultFormat { csv, parquet, @@ -4353,50 +8982,83 @@ extension ResultFormatFromString on String { } enum ScalarFunctions { - trunc, abs, + cast, ceiling, + coalesce, + convert, + currentDate, + dateadd, + extract, floor, + getdate, ln, log, - round, - sqrt, - cast, lower, + round, rtrim, + sqrt, + substring, + toChar, + toDate, + toNumber, + toTimestamp, + trim, + trunc, upper, - coalesce, } extension ScalarFunctionsValueExtension on ScalarFunctions { String toValue() { switch (this) { - case ScalarFunctions.trunc: - return 'TRUNC'; case ScalarFunctions.abs: return 'ABS'; + case ScalarFunctions.cast: + return 'CAST'; case ScalarFunctions.ceiling: return 'CEILING'; + case ScalarFunctions.coalesce: + return 'COALESCE'; + case ScalarFunctions.convert: + return 'CONVERT'; + case ScalarFunctions.currentDate: + return 'CURRENT_DATE'; + case ScalarFunctions.dateadd: + return 'DATEADD'; + case ScalarFunctions.extract: + return 'EXTRACT'; case ScalarFunctions.floor: return 'FLOOR'; + case ScalarFunctions.getdate: + return 'GETDATE'; case ScalarFunctions.ln: return 'LN'; case ScalarFunctions.log: return 'LOG'; - case ScalarFunctions.round: - return 'ROUND'; - case ScalarFunctions.sqrt: - return 'SQRT'; - case ScalarFunctions.cast: - return 'CAST'; case ScalarFunctions.lower: return 'LOWER'; + case ScalarFunctions.round: + return 'ROUND'; case ScalarFunctions.rtrim: return 'RTRIM'; + case ScalarFunctions.sqrt: + return 'SQRT'; + case ScalarFunctions.substring: + return 'SUBSTRING'; + case ScalarFunctions.toChar: + return 'TO_CHAR'; + case ScalarFunctions.toDate: + return 'TO_DATE'; + case ScalarFunctions.toNumber: + return 'TO_NUMBER'; + case ScalarFunctions.toTimestamp: + return 'TO_TIMESTAMP'; + case ScalarFunctions.trim: + return 'TRIM'; + case ScalarFunctions.trunc: + return 'TRUNC'; case ScalarFunctions.upper: return 'UPPER'; - case ScalarFunctions.coalesce: - return 'COALESCE'; } } } @@ -4404,32 +9066,54 @@ extension ScalarFunctionsValueExtension on ScalarFunctions { extension ScalarFunctionsFromString on String { ScalarFunctions toScalarFunctions() { switch (this) { - case 'TRUNC': - return ScalarFunctions.trunc; case 'ABS': return ScalarFunctions.abs; + case 'CAST': + return ScalarFunctions.cast; case 'CEILING': return ScalarFunctions.ceiling; + case 'COALESCE': + return ScalarFunctions.coalesce; + case 'CONVERT': + return ScalarFunctions.convert; + case 'CURRENT_DATE': + return ScalarFunctions.currentDate; + case 'DATEADD': + return ScalarFunctions.dateadd; + case 'EXTRACT': + return ScalarFunctions.extract; case 'FLOOR': return ScalarFunctions.floor; + case 'GETDATE': + return ScalarFunctions.getdate; case 'LN': return ScalarFunctions.ln; case 'LOG': return ScalarFunctions.log; - case 'ROUND': - return ScalarFunctions.round; - case 'SQRT': - return ScalarFunctions.sqrt; - case 'CAST': - return ScalarFunctions.cast; case 'LOWER': return ScalarFunctions.lower; + case 'ROUND': + return ScalarFunctions.round; case 'RTRIM': return ScalarFunctions.rtrim; + case 'SQRT': + return ScalarFunctions.sqrt; + case 'SUBSTRING': + return ScalarFunctions.substring; + case 'TO_CHAR': + return ScalarFunctions.toChar; + case 'TO_DATE': + return ScalarFunctions.toDate; + case 'TO_NUMBER': + return ScalarFunctions.toNumber; + case 'TO_TIMESTAMP': + return ScalarFunctions.toTimestamp; + case 'TRIM': + return ScalarFunctions.trim; + case 'TRUNC': + return ScalarFunctions.trunc; case 'UPPER': return ScalarFunctions.upper; - case 'COALESCE': - return ScalarFunctions.coalesce; } throw Exception('$this is not known in enum ScalarFunctions'); } @@ -4437,8 +9121,8 @@ extension ScalarFunctionsFromString on String { /// A schema is a relation within a collaboration. class Schema { - /// The analysis rule types associated with the schema. Valued values are LIST - /// and AGGREGATION. Currently, only one entry is present. + /// The analysis rule types associated with the schema. Currently, only one + /// entry is present. final List analysisRuleTypes; /// The unique ARN for the collaboration that the schema belongs to. @@ -4453,7 +9137,8 @@ class Schema { /// The time the schema was created. final DateTime createTime; - /// The unique account ID for the AWS account that owns the schema. + /// The unique account ID for the Amazon Web Services account that owns the + /// schema. final String creatorAccountId; /// A description for the schema. @@ -4466,6 +9151,10 @@ class Schema { /// The partition keys for the dataset underlying this schema. final List partitionKeys; + /// Details about the status of the schema. Currently, only one entry is + /// present. + final List schemaStatusDetails; + /// The type of schema. The only valid value is currently `TABLE`. final SchemaType type; @@ -4486,6 +9175,7 @@ class Schema { required this.description, required this.name, required this.partitionKeys, + required this.schemaStatusDetails, required this.type, required this.updateTime, this.analysisMethod, @@ -4511,6 +9201,10 @@ class Schema { .whereNotNull() .map((e) => Column.fromJson(e as Map)) .toList(), + schemaStatusDetails: (json['schemaStatusDetails'] as List) + .whereNotNull() + .map((e) => SchemaStatusDetail.fromJson(e as Map)) + .toList(), type: (json['type'] as String).toSchemaType(), updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), analysisMethod: (json['analysisMethod'] as String?)?.toAnalysisMethod(), @@ -4527,6 +9221,7 @@ class Schema { final description = this.description; final name = this.name; final partitionKeys = this.partitionKeys; + final schemaStatusDetails = this.schemaStatusDetails; final type = this.type; final updateTime = this.updateTime; final analysisMethod = this.analysisMethod; @@ -4540,6 +9235,7 @@ class Schema { 'description': description, 'name': name, 'partitionKeys': partitionKeys, + 'schemaStatusDetails': schemaStatusDetails, 'type': type.toValue(), 'updateTime': unixTimestampToJson(updateTime), if (analysisMethod != null) 'analysisMethod': analysisMethod.toValue(), @@ -4547,6 +9243,207 @@ class Schema { } } +/// Defines the information that's necessary to retrieve an analysis rule +/// schema. Schema analysis rules are uniquely identified by a combination of the +/// schema name and the analysis rule type for a given collaboration. +class SchemaAnalysisRuleRequest { + /// The name of the analysis rule schema that you are requesting. + final String name; + + /// The type of analysis rule schema that you are requesting. + final AnalysisRuleType type; + + SchemaAnalysisRuleRequest({ + required this.name, + required this.type, + }); + + Map toJson() { + final name = this.name; + final type = this.type; + return { + 'name': name, + 'type': type.toValue(), + }; + } +} + +enum SchemaConfiguration { + differentialPrivacy, +} + +extension SchemaConfigurationValueExtension on SchemaConfiguration { + String toValue() { + switch (this) { + case SchemaConfiguration.differentialPrivacy: + return 'DIFFERENTIAL_PRIVACY'; + } + } +} + +extension SchemaConfigurationFromString on String { + SchemaConfiguration toSchemaConfiguration() { + switch (this) { + case 'DIFFERENTIAL_PRIVACY': + return SchemaConfiguration.differentialPrivacy; + } + throw Exception('$this is not known in enum SchemaConfiguration'); + } +} + +enum SchemaStatus { + ready, + notReady, +} + +extension SchemaStatusValueExtension on SchemaStatus { + String toValue() { + switch (this) { + case SchemaStatus.ready: + return 'READY'; + case SchemaStatus.notReady: + return 'NOT_READY'; + } + } +} + +extension SchemaStatusFromString on String { + SchemaStatus toSchemaStatus() { + switch (this) { + case 'READY': + return SchemaStatus.ready; + case 'NOT_READY': + return SchemaStatus.notReady; + } + throw Exception('$this is not known in enum SchemaStatus'); + } +} + +/// Information about the schema status. +/// +/// A status of READY means that based on the schema analysis rule, +/// queries of the given analysis rule type are properly configured to run +/// queries on this schema. +class SchemaStatusDetail { + /// The status of the schema. + final SchemaStatus status; + + /// The analysis rule type for which the schema status has been evaluated. + final AnalysisRuleType? analysisRuleType; + + /// The configuration details of the schema analysis rule for the given type. + final List? configurations; + + /// The reasons why the schema status is set to its current state. + final List? reasons; + + SchemaStatusDetail({ + required this.status, + this.analysisRuleType, + this.configurations, + this.reasons, + }); + + factory SchemaStatusDetail.fromJson(Map json) { + return SchemaStatusDetail( + status: (json['status'] as String).toSchemaStatus(), + analysisRuleType: + (json['analysisRuleType'] as String?)?.toAnalysisRuleType(), + configurations: (json['configurations'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toSchemaConfiguration()) + .toList(), + reasons: (json['reasons'] as List?) + ?.whereNotNull() + .map((e) => SchemaStatusReason.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final status = this.status; + final analysisRuleType = this.analysisRuleType; + final configurations = this.configurations; + final reasons = this.reasons; + return { + 'status': status.toValue(), + if (analysisRuleType != null) + 'analysisRuleType': analysisRuleType.toValue(), + if (configurations != null) + 'configurations': configurations.map((e) => e.toValue()).toList(), + if (reasons != null) 'reasons': reasons, + }; + } +} + +/// A reason why the schema status is set to its current value. +class SchemaStatusReason { + /// The schema status reason code. + final SchemaStatusReasonCode code; + + /// An explanation of the schema status reason code. + final String message; + + SchemaStatusReason({ + required this.code, + required this.message, + }); + + factory SchemaStatusReason.fromJson(Map json) { + return SchemaStatusReason( + code: (json['code'] as String).toSchemaStatusReasonCode(), + message: json['message'] as String, + ); + } + + Map toJson() { + final code = this.code; + final message = this.message; + return { + 'code': code.toValue(), + 'message': message, + }; + } +} + +enum SchemaStatusReasonCode { + analysisRuleMissing, + analysisTemplatesNotConfigured, + analysisProvidersNotConfigured, + differentialPrivacyPolicyNotConfigured, +} + +extension SchemaStatusReasonCodeValueExtension on SchemaStatusReasonCode { + String toValue() { + switch (this) { + case SchemaStatusReasonCode.analysisRuleMissing: + return 'ANALYSIS_RULE_MISSING'; + case SchemaStatusReasonCode.analysisTemplatesNotConfigured: + return 'ANALYSIS_TEMPLATES_NOT_CONFIGURED'; + case SchemaStatusReasonCode.analysisProvidersNotConfigured: + return 'ANALYSIS_PROVIDERS_NOT_CONFIGURED'; + case SchemaStatusReasonCode.differentialPrivacyPolicyNotConfigured: + return 'DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED'; + } + } +} + +extension SchemaStatusReasonCodeFromString on String { + SchemaStatusReasonCode toSchemaStatusReasonCode() { + switch (this) { + case 'ANALYSIS_RULE_MISSING': + return SchemaStatusReasonCode.analysisRuleMissing; + case 'ANALYSIS_TEMPLATES_NOT_CONFIGURED': + return SchemaStatusReasonCode.analysisTemplatesNotConfigured; + case 'ANALYSIS_PROVIDERS_NOT_CONFIGURED': + return SchemaStatusReasonCode.analysisProvidersNotConfigured; + case 'DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED': + return SchemaStatusReasonCode.differentialPrivacyPolicyNotConfigured; + } + throw Exception('$this is not known in enum SchemaStatusReasonCode'); + } +} + /// The schema summary for the objects listed by the request. class SchemaSummary { /// The types of analysis rules that are associated with this schema object. @@ -4561,7 +9458,8 @@ class SchemaSummary { /// The time the schema object was created. final DateTime createTime; - /// The unique account ID for the AWS account that owns the schema. + /// The unique account ID for the Amazon Web Services account that owns the + /// schema. final String creatorAccountId; /// The name for the schema object. @@ -4677,9 +9575,9 @@ class StartProtectedQueryOutput { } /// A pointer to the dataset that underlies this table. Currently, this can only -/// be an AWS Glue table. +/// be an Glue table. class TableReference { - /// If present, a reference to the AWS Glue table referred to by this table + /// If present, a reference to the Glue table referred to by this table /// reference. final GlueTableReference? glue; @@ -4751,6 +9649,29 @@ class UntagResourceOutput { } } +class UpdateAnalysisTemplateOutput { + /// The analysis template. + final AnalysisTemplate analysisTemplate; + + UpdateAnalysisTemplateOutput({ + required this.analysisTemplate, + }); + + factory UpdateAnalysisTemplateOutput.fromJson(Map json) { + return UpdateAnalysisTemplateOutput( + analysisTemplate: AnalysisTemplate.fromJson( + json['analysisTemplate'] as Map), + ); + } + + Map toJson() { + final analysisTemplate = this.analysisTemplate; + return { + 'analysisTemplate': analysisTemplate, + }; + } +} + class UpdateCollaborationOutput { /// The entire collaboration that has been updated. final Collaboration collaboration; @@ -4774,6 +9695,33 @@ class UpdateCollaborationOutput { } } +class UpdateConfiguredAudienceModelAssociationOutput { + /// Details about the configured audience model association that you updated. + final ConfiguredAudienceModelAssociation configuredAudienceModelAssociation; + + UpdateConfiguredAudienceModelAssociationOutput({ + required this.configuredAudienceModelAssociation, + }); + + factory UpdateConfiguredAudienceModelAssociationOutput.fromJson( + Map json) { + return UpdateConfiguredAudienceModelAssociationOutput( + configuredAudienceModelAssociation: + ConfiguredAudienceModelAssociation.fromJson( + json['configuredAudienceModelAssociation'] + as Map), + ); + } + + Map toJson() { + final configuredAudienceModelAssociation = + this.configuredAudienceModelAssociation; + return { + 'configuredAudienceModelAssociation': configuredAudienceModelAssociation, + }; + } +} + class UpdateConfiguredTableAnalysisRuleOutput { /// The entire updated analysis rule. final ConfiguredTableAnalysisRule analysisRule; @@ -4867,6 +9815,30 @@ class UpdateMembershipOutput { } } +class UpdatePrivacyBudgetTemplateOutput { + /// Summary of the privacy budget template. + final PrivacyBudgetTemplate privacyBudgetTemplate; + + UpdatePrivacyBudgetTemplateOutput({ + required this.privacyBudgetTemplate, + }); + + factory UpdatePrivacyBudgetTemplateOutput.fromJson( + Map json) { + return UpdatePrivacyBudgetTemplateOutput( + privacyBudgetTemplate: PrivacyBudgetTemplate.fromJson( + json['privacyBudgetTemplate'] as Map), + ); + } + + Map toJson() { + final privacyBudgetTemplate = this.privacyBudgetTemplate; + return { + 'privacyBudgetTemplate': privacyBudgetTemplate, + }; + } +} + class UpdateProtectedQueryOutput { /// The protected query output. final ProtectedQuery protectedQuery; diff --git a/aws_client/lib/src/generated/clean_rooms_ml/v2023_09_06.dart b/aws_client/lib/src/generated/clean_rooms_ml/v2023_09_06.dart new file mode 100644 index 000000000..28ec053b9 --- /dev/null +++ b/aws_client/lib/src/generated/clean_rooms_ml/v2023_09_06.dart @@ -0,0 +1,3266 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Welcome to the Amazon Web Services Clean Rooms ML API Reference. +/// +/// Amazon Web Services Clean Rooms ML provides a privacy-enhancing method for +/// two parties to identify similar users in their data without the need to +/// share their data with each other. The first party brings the training data +/// to Clean Rooms so that they can create and configure an audience model +/// (lookalike model) and associate it with a collaboration. The second party +/// then brings their seed data to Clean Rooms and generates an audience +/// (lookalike segment) that resembles the training data. +/// +/// To learn more about Amazon Web Services Clean Rooms ML concepts, procedures, +/// and best practices, see the Clean +/// Rooms User Guide. +/// +/// To learn more about SQL commands, functions, and conditions supported in +/// Clean Rooms, see the Clean +/// Rooms SQL Reference. +class CleanRoomsML { + final _s.RestJsonProtocol _protocol; + CleanRoomsML({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'cleanrooms-ml', + signingName: 'cleanrooms-ml', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Defines the information necessary to create an audience model. An audience + /// model is a machine learning model that Clean Rooms ML trains to measure + /// similarity between users. Clean Rooms ML manages training and storing the + /// audience model. The audience model can be used in multiple calls to the + /// StartAudienceGenerationJob API. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [name] : + /// The name of the audience model resource. + /// + /// Parameter [trainingDatasetArn] : + /// The Amazon Resource Name (ARN) of the training dataset for this audience + /// model. + /// + /// Parameter [description] : + /// The description of the audience model. + /// + /// Parameter [kmsKeyArn] : + /// The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt + /// and decrypt customer-owned data in the trained ML model and the associated + /// data. + /// + /// Parameter [tags] : + /// The optional metadata that you apply to the resource to help you + /// categorize and organize them. Each tag consists of a key and an optional + /// value, both of which you define. + /// + /// The following basic restrictions apply to tags: + /// + ///
                + ///
              • + /// Maximum number of tags per resource - 50. + ///
              • + ///
              • + /// For each resource, each tag key must be unique, and each tag key can have + /// only one value. + ///
              • + ///
              • + /// Maximum key length - 128 Unicode characters in UTF-8. + ///
              • + ///
              • + /// Maximum value length - 256 Unicode characters in UTF-8. + ///
              • + ///
              • + /// If your tagging schema is used across multiple services and resources, + /// remember that other services may have restrictions on allowed characters. + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following characters: + - = . _ : / @. + ///
              • + ///
              • + /// Tag keys and values are case sensitive. + ///
              • + ///
              • + /// Do not use aws:, AWS:, or any upper or lowercase combination of such as a + /// prefix for keys as it is reserved for AWS use. You cannot edit or delete + /// tag keys with this prefix. Values can have this prefix. If a tag value has + /// aws as its prefix but the key does not, then Clean Rooms ML considers it + /// to be a user tag and will count against the limit of 50 tags. Tags with + /// only the key prefix of aws do not count against your tags per resource + /// limit. + ///
              • + ///
              + /// + /// Parameter [trainingDataEndTime] : + /// The end date and time of the training window. + /// + /// Parameter [trainingDataStartTime] : + /// The start date and time of the training window. + Future createAudienceModel({ + required String name, + required String trainingDatasetArn, + String? description, + String? kmsKeyArn, + Map? tags, + DateTime? trainingDataEndTime, + DateTime? trainingDataStartTime, + }) async { + final $payload = { + 'name': name, + 'trainingDatasetArn': trainingDatasetArn, + if (description != null) 'description': description, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + if (tags != null) 'tags': tags, + if (trainingDataEndTime != null) + 'trainingDataEndTime': iso8601ToJson(trainingDataEndTime), + if (trainingDataStartTime != null) + 'trainingDataStartTime': iso8601ToJson(trainingDataStartTime), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/audience-model', + exceptionFnMap: _exceptionFns, + ); + return CreateAudienceModelResponse.fromJson(response); + } + + /// Defines the information necessary to create a configured audience model. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [audienceModelArn] : + /// The Amazon Resource Name (ARN) of the audience model to use for the + /// configured audience model. + /// + /// Parameter [name] : + /// The name of the configured audience model. + /// + /// Parameter [outputConfig] : + /// Configure the Amazon S3 location and IAM Role for audiences created using + /// this configured audience model. Each audience will have a unique location. + /// The IAM Role must have s3:PutObject permission on the + /// destination Amazon S3 location. If the destination is protected with + /// Amazon S3 KMS-SSE, then the Role must also have the required KMS + /// permissions. + /// + /// Parameter [sharedAudienceMetrics] : + /// Whether audience metrics are shared. + /// + /// Parameter [audienceSizeConfig] : + /// Configure the list of output sizes of audiences that can be created using + /// this configured audience model. A request to + /// StartAudienceGenerationJob that uses this configured audience model + /// must have an audienceSize selected from this list. You can + /// use the ABSOLUTE AudienceSize to configure out + /// audience sizes using the count of identifiers in the output. You can use + /// the Percentage AudienceSize to configure sizes in the + /// range 1-100 percent. + /// + /// Parameter [childResourceTagOnCreatePolicy] : + /// Configure how the service tags audience generation jobs created using this + /// configured audience model. If you specify NONE, the tags from + /// the StartAudienceGenerationJob request determine the tags of the + /// audience generation job. If you specify FROM_PARENT_RESOURCE, + /// the audience generation job inherits the tags from the configured audience + /// model, by default. Tags in the StartAudienceGenerationJob will + /// override the default. + /// + /// When the client is in a different account than the configured audience + /// model, the tags from the client are never applied to a resource in the + /// caller's account. + /// + /// Parameter [description] : + /// The description of the configured audience model. + /// + /// Parameter [minMatchingSeedSize] : + /// The minimum number of users from the seed audience that must match with + /// users in the training data of the audience model. The default value is + /// 500. + /// + /// Parameter [tags] : + /// The optional metadata that you apply to the resource to help you + /// categorize and organize them. Each tag consists of a key and an optional + /// value, both of which you define. + /// + /// The following basic restrictions apply to tags: + /// + ///
                + ///
              • + /// Maximum number of tags per resource - 50. + ///
              • + ///
              • + /// For each resource, each tag key must be unique, and each tag key can have + /// only one value. + ///
              • + ///
              • + /// Maximum key length - 128 Unicode characters in UTF-8. + ///
              • + ///
              • + /// Maximum value length - 256 Unicode characters in UTF-8. + ///
              • + ///
              • + /// If your tagging schema is used across multiple services and resources, + /// remember that other services may have restrictions on allowed characters. + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following characters: + - = . _ : / @. + ///
              • + ///
              • + /// Tag keys and values are case sensitive. + ///
              • + ///
              • + /// Do not use aws:, AWS:, or any upper or lowercase combination of such as a + /// prefix for keys as it is reserved for AWS use. You cannot edit or delete + /// tag keys with this prefix. Values can have this prefix. If a tag value has + /// aws as its prefix but the key does not, then Clean Rooms ML considers it + /// to be a user tag and will count against the limit of 50 tags. Tags with + /// only the key prefix of aws do not count against your tags per resource + /// limit. + ///
              • + ///
              + Future createConfiguredAudienceModel({ + required String audienceModelArn, + required String name, + required ConfiguredAudienceModelOutputConfig outputConfig, + required List sharedAudienceMetrics, + AudienceSizeConfig? audienceSizeConfig, + TagOnCreatePolicy? childResourceTagOnCreatePolicy, + String? description, + int? minMatchingSeedSize, + Map? tags, + }) async { + _s.validateNumRange( + 'minMatchingSeedSize', + minMatchingSeedSize, + 25, + 500000, + ); + final $payload = { + 'audienceModelArn': audienceModelArn, + 'name': name, + 'outputConfig': outputConfig, + 'sharedAudienceMetrics': + sharedAudienceMetrics.map((e) => e.toValue()).toList(), + if (audienceSizeConfig != null) 'audienceSizeConfig': audienceSizeConfig, + if (childResourceTagOnCreatePolicy != null) + 'childResourceTagOnCreatePolicy': + childResourceTagOnCreatePolicy.toValue(), + if (description != null) 'description': description, + if (minMatchingSeedSize != null) + 'minMatchingSeedSize': minMatchingSeedSize, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/configured-audience-model', + exceptionFnMap: _exceptionFns, + ); + return CreateConfiguredAudienceModelResponse.fromJson(response); + } + + /// Defines the information necessary to create a training dataset. In Clean + /// Rooms ML, the TrainingDataset is metadata that points to a + /// Glue table, which is read only during AudienceModel creation. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the training dataset. This name must be unique in your account + /// and region. + /// + /// Parameter [roleArn] : + /// The ARN of the IAM role that Clean Rooms ML can assume to read the data + /// referred to in the dataSource field of each dataset. + /// + /// Passing a role across AWS accounts is not allowed. If you pass a role that + /// isn't in your account, you get an AccessDeniedException + /// error. + /// + /// Parameter [trainingData] : + /// An array of information that lists the Dataset objects, which specifies + /// the dataset type and details on its location and schema. You must provide + /// a role that has read access to these tables. + /// + /// Parameter [description] : + /// The description of the training dataset. + /// + /// Parameter [tags] : + /// The optional metadata that you apply to the resource to help you + /// categorize and organize them. Each tag consists of a key and an optional + /// value, both of which you define. + /// + /// The following basic restrictions apply to tags: + /// + ///
                + ///
              • + /// Maximum number of tags per resource - 50. + ///
              • + ///
              • + /// For each resource, each tag key must be unique, and each tag key can have + /// only one value. + ///
              • + ///
              • + /// Maximum key length - 128 Unicode characters in UTF-8. + ///
              • + ///
              • + /// Maximum value length - 256 Unicode characters in UTF-8. + ///
              • + ///
              • + /// If your tagging schema is used across multiple services and resources, + /// remember that other services may have restrictions on allowed characters. + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following characters: + - = . _ : / @. + ///
              • + ///
              • + /// Tag keys and values are case sensitive. + ///
              • + ///
              • + /// Do not use aws:, AWS:, or any upper or lowercase combination of such as a + /// prefix for keys as it is reserved for AWS use. You cannot edit or delete + /// tag keys with this prefix. Values can have this prefix. If a tag value has + /// aws as its prefix but the key does not, then Clean Rooms ML considers it + /// to be a user tag and will count against the limit of 50 tags. Tags with + /// only the key prefix of aws do not count against your tags per resource + /// limit. + ///
              • + ///
              + Future createTrainingDataset({ + required String name, + required String roleArn, + required List trainingData, + String? description, + Map? tags, + }) async { + final $payload = { + 'name': name, + 'roleArn': roleArn, + 'trainingData': trainingData, + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/training-dataset', + exceptionFnMap: _exceptionFns, + ); + return CreateTrainingDatasetResponse.fromJson(response); + } + + /// Deletes the specified audience generation job, and removes all data + /// associated with the job. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [audienceGenerationJobArn] : + /// The Amazon Resource Name (ARN) of the audience generation job that you + /// want to delete. + Future deleteAudienceGenerationJob({ + required String audienceGenerationJobArn, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/audience-generation-job/${Uri.encodeComponent(audienceGenerationJobArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Specifies an audience model that you want to delete. You can't delete an + /// audience model if there are any configured audience models that depend on + /// the audience model. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [audienceModelArn] : + /// The Amazon Resource Name (ARN) of the audience model that you want to + /// delete. + Future deleteAudienceModel({ + required String audienceModelArn, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/audience-model/${Uri.encodeComponent(audienceModelArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the specified configured audience model. You can't delete a + /// configured audience model if there are any lookalike models that use the + /// configured audience model. If you delete a configured audience model, it + /// will be removed from any collaborations that it is associated to. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that you + /// want to delete. + Future deleteConfiguredAudienceModel({ + required String configuredAudienceModelArn, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the specified configured audience model policy. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model policy + /// that you want to delete. + Future deleteConfiguredAudienceModelPolicy({ + required String configuredAudienceModelArn, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}/policy', + exceptionFnMap: _exceptionFns, + ); + } + + /// Specifies a training dataset that you want to delete. You can't delete a + /// training dataset if there are any audience models that depend on the + /// training dataset. In Clean Rooms ML, the TrainingDataset is + /// metadata that points to a Glue table, which is read only during + /// AudienceModel creation. This action deletes the metadata. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [trainingDatasetArn] : + /// The Amazon Resource Name (ARN) of the training dataset that you want to + /// delete. + Future deleteTrainingDataset({ + required String trainingDatasetArn, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/training-dataset/${Uri.encodeComponent(trainingDatasetArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Returns information about an audience generation job. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [audienceGenerationJobArn] : + /// The Amazon Resource Name (ARN) of the audience generation job that you are + /// interested in. + Future getAudienceGenerationJob({ + required String audienceGenerationJobArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/audience-generation-job/${Uri.encodeComponent(audienceGenerationJobArn)}', + exceptionFnMap: _exceptionFns, + ); + return GetAudienceGenerationJobResponse.fromJson(response); + } + + /// Returns information about an audience model + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [audienceModelArn] : + /// The Amazon Resource Name (ARN) of the audience model that you are + /// interested in. + Future getAudienceModel({ + required String audienceModelArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audience-model/${Uri.encodeComponent(audienceModelArn)}', + exceptionFnMap: _exceptionFns, + ); + return GetAudienceModelResponse.fromJson(response); + } + + /// Returns information about a specified configured audience model. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that you + /// are interested in. + Future getConfiguredAudienceModel({ + required String configuredAudienceModelArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}', + exceptionFnMap: _exceptionFns, + ); + return GetConfiguredAudienceModelResponse.fromJson(response); + } + + /// Returns information about a configured audience model policy. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that you + /// are interested in. + Future + getConfiguredAudienceModelPolicy({ + required String configuredAudienceModelArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}/policy', + exceptionFnMap: _exceptionFns, + ); + return GetConfiguredAudienceModelPolicyResponse.fromJson(response); + } + + /// Returns information about a training dataset. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [trainingDatasetArn] : + /// The Amazon Resource Name (ARN) of the training dataset that you are + /// interested in. + Future getTrainingDataset({ + required String trainingDatasetArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/training-dataset/${Uri.encodeComponent(trainingDatasetArn)}', + exceptionFnMap: _exceptionFns, + ); + return GetTrainingDatasetResponse.fromJson(response); + } + + /// Returns a list of the audience export jobs. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [audienceGenerationJobArn] : + /// The Amazon Resource Name (ARN) of the audience generation job that you are + /// interested in. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listAudienceExportJobs({ + String? audienceGenerationJobArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (audienceGenerationJobArn != null) + 'audienceGenerationJobArn': [audienceGenerationJobArn], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audience-export-job', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAudienceExportJobsResponse.fromJson(response); + } + + /// Returns a list of audience generation jobs. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [collaborationId] : + /// The identifier of the collaboration that contains the audience generation + /// jobs that you are interested in. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that was + /// used for the audience generation jobs that you are interested in. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listAudienceGenerationJobs({ + String? collaborationId, + String? configuredAudienceModelArn, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (collaborationId != null) 'collaborationId': [collaborationId], + if (configuredAudienceModelArn != null) + 'configuredAudienceModelArn': [configuredAudienceModelArn], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audience-generation-job', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAudienceGenerationJobsResponse.fromJson(response); + } + + /// Returns a list of audience models. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listAudienceModels({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/audience-model', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAudienceModelsResponse.fromJson(response); + } + + /// Returns a list of the configured audience models. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listConfiguredAudienceModels({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/configured-audience-model', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListConfiguredAudienceModelsResponse.fromJson(response); + } + + /// Returns a list of tags for a provided resource. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource that you are interested in. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Returns a list of training datasets. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum size of the results that is returned per call. + /// + /// Parameter [nextToken] : + /// The token value retrieved from a previous call to access the next page of + /// results. + Future listTrainingDatasets({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/training-dataset', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTrainingDatasetsResponse.fromJson(response); + } + + /// Create or update the resource policy for a configured audience model. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that the + /// resource policy will govern. + /// + /// Parameter [configuredAudienceModelPolicy] : + /// The IAM resource policy. + /// + /// Parameter [policyExistenceCondition] : + /// Use this to prevent unexpected concurrent modification of the policy. + /// + /// Parameter [previousPolicyHash] : + /// A cryptographic hash of the contents of the policy used to prevent + /// unexpected concurrent modification of the policy. + Future + putConfiguredAudienceModelPolicy({ + required String configuredAudienceModelArn, + required String configuredAudienceModelPolicy, + PolicyExistenceCondition? policyExistenceCondition, + String? previousPolicyHash, + }) async { + final $payload = { + 'configuredAudienceModelPolicy': configuredAudienceModelPolicy, + if (policyExistenceCondition != null) + 'policyExistenceCondition': policyExistenceCondition.toValue(), + if (previousPolicyHash != null) 'previousPolicyHash': previousPolicyHash, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}/policy', + exceptionFnMap: _exceptionFns, + ); + return PutConfiguredAudienceModelPolicyResponse.fromJson(response); + } + + /// Export an audience of a specified size after you have generated an + /// audience. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [audienceGenerationJobArn] : + /// The Amazon Resource Name (ARN) of the audience generation job that you + /// want to export. + /// + /// Parameter [name] : + /// The name of the audience export job. + /// + /// Parameter [description] : + /// The description of the audience export job. + Future startAudienceExportJob({ + required String audienceGenerationJobArn, + required AudienceSize audienceSize, + required String name, + String? description, + }) async { + final $payload = { + 'audienceGenerationJobArn': audienceGenerationJobArn, + 'audienceSize': audienceSize, + 'name': name, + if (description != null) 'description': description, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/audience-export-job', + exceptionFnMap: _exceptionFns, + ); + } + + /// Information necessary to start the audience generation job. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that is + /// used for this audience generation job. + /// + /// Parameter [name] : + /// The name of the audience generation job. + /// + /// Parameter [seedAudience] : + /// The seed audience that is used to generate the audience. + /// + /// Parameter [collaborationId] : + /// The identifier of the collaboration that contains the audience generation + /// job. + /// + /// Parameter [description] : + /// The description of the audience generation job. + /// + /// Parameter [includeSeedInOutput] : + /// Whether the seed audience is included in the audience generation output. + /// + /// Parameter [tags] : + /// The optional metadata that you apply to the resource to help you + /// categorize and organize them. Each tag consists of a key and an optional + /// value, both of which you define. + /// + /// The following basic restrictions apply to tags: + /// + ///
                + ///
              • + /// Maximum number of tags per resource - 50. + ///
              • + ///
              • + /// For each resource, each tag key must be unique, and each tag key can have + /// only one value. + ///
              • + ///
              • + /// Maximum key length - 128 Unicode characters in UTF-8. + ///
              • + ///
              • + /// Maximum value length - 256 Unicode characters in UTF-8. + ///
              • + ///
              • + /// If your tagging schema is used across multiple services and resources, + /// remember that other services may have restrictions on allowed characters. + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following characters: + - = . _ : / @. + ///
              • + ///
              • + /// Tag keys and values are case sensitive. + ///
              • + ///
              • + /// Do not use aws:, AWS:, or any upper or lowercase combination of such as a + /// prefix for keys as it is reserved for AWS use. You cannot edit or delete + /// tag keys with this prefix. Values can have this prefix. If a tag value has + /// aws as its prefix but the key does not, then Clean Rooms ML considers it + /// to be a user tag and will count against the limit of 50 tags. Tags with + /// only the key prefix of aws do not count against your tags per resource + /// limit. + ///
              • + ///
              + Future startAudienceGenerationJob({ + required String configuredAudienceModelArn, + required String name, + required AudienceGenerationJobDataSource seedAudience, + String? collaborationId, + String? description, + bool? includeSeedInOutput, + Map? tags, + }) async { + final $payload = { + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'name': name, + 'seedAudience': seedAudience, + if (collaborationId != null) 'collaborationId': collaborationId, + if (description != null) 'description': description, + if (includeSeedInOutput != null) + 'includeSeedInOutput': includeSeedInOutput, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/audience-generation-job', + exceptionFnMap: _exceptionFns, + ); + return StartAudienceGenerationJobResponse.fromJson(response); + } + + /// Adds metadata tags to a specified resource. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource that you want to assign + /// tags. + /// + /// Parameter [tags] : + /// The optional metadata that you apply to the resource to help you + /// categorize and organize them. Each tag consists of a key and an optional + /// value, both of which you define. + /// + /// The following basic restrictions apply to tags: + /// + ///
                + ///
              • + /// Maximum number of tags per resource - 50. + ///
              • + ///
              • + /// For each resource, each tag key must be unique, and each tag key can have + /// only one value. + ///
              • + ///
              • + /// Maximum key length - 128 Unicode characters in UTF-8. + ///
              • + ///
              • + /// Maximum value length - 256 Unicode characters in UTF-8. + ///
              • + ///
              • + /// If your tagging schema is used across multiple services and resources, + /// remember that other services may have restrictions on allowed characters. + /// Generally allowed characters are: letters, numbers, and spaces + /// representable in UTF-8, and the following characters: + - = . _ : / @. + ///
              • + ///
              • + /// Tag keys and values are case sensitive. + ///
              • + ///
              • + /// Do not use aws:, AWS:, or any upper or lowercase combination of such as a + /// prefix for keys as it is reserved for AWS use. You cannot edit or delete + /// tag keys with this prefix. Values can have this prefix. If a tag value has + /// aws as its prefix but the key does not, then Clean Rooms considers it to + /// be a user tag and will count against the limit of 50 tags. Tags with only + /// the key prefix of aws do not count against your tags per resource limit. + ///
              • + ///
              + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes metadata tags from a specified resource. + /// + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource that you want to remove + /// tags from. + /// + /// Parameter [tagKeys] : + /// The key values of tags that you want to remove. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Provides the information necessary to update a configured audience model. + /// Updates that impact audience generation jobs take effect when a new job + /// starts, but do not impact currently running jobs. + /// + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [configuredAudienceModelArn] : + /// The Amazon Resource Name (ARN) of the configured audience model that you + /// want to update. + /// + /// Parameter [audienceModelArn] : + /// The Amazon Resource Name (ARN) of the new audience model that you want to + /// use. + /// + /// Parameter [audienceSizeConfig] : + /// The new audience size configuration. + /// + /// Parameter [description] : + /// The new description of the configured audience model. + /// + /// Parameter [minMatchingSeedSize] : + /// The minimum number of users from the seed audience that must match with + /// users in the training data of the audience model. + /// + /// Parameter [outputConfig] : + /// The new output configuration. + /// + /// Parameter [sharedAudienceMetrics] : + /// The new value for whether to share audience metrics. + Future updateConfiguredAudienceModel({ + required String configuredAudienceModelArn, + String? audienceModelArn, + AudienceSizeConfig? audienceSizeConfig, + String? description, + int? minMatchingSeedSize, + ConfiguredAudienceModelOutputConfig? outputConfig, + List? sharedAudienceMetrics, + }) async { + _s.validateNumRange( + 'minMatchingSeedSize', + minMatchingSeedSize, + 25, + 500000, + ); + final $payload = { + if (audienceModelArn != null) 'audienceModelArn': audienceModelArn, + if (audienceSizeConfig != null) 'audienceSizeConfig': audienceSizeConfig, + if (description != null) 'description': description, + if (minMatchingSeedSize != null) + 'minMatchingSeedSize': minMatchingSeedSize, + if (outputConfig != null) 'outputConfig': outputConfig, + if (sharedAudienceMetrics != null) + 'sharedAudienceMetrics': + sharedAudienceMetrics.map((e) => e.toValue()).toList(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/configured-audience-model/${Uri.encodeComponent(configuredAudienceModelArn)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateConfiguredAudienceModelResponse.fromJson(response); + } +} + +/// Defines the Amazon S3 bucket where the configured audience is stored. +class AudienceDestination { + /// The Amazon S3 bucket and path for the configured audience. + final S3ConfigMap s3Destination; + + AudienceDestination({ + required this.s3Destination, + }); + + factory AudienceDestination.fromJson(Map json) { + return AudienceDestination( + s3Destination: + S3ConfigMap.fromJson(json['s3Destination'] as Map), + ); + } + + Map toJson() { + final s3Destination = this.s3Destination; + return { + 's3Destination': s3Destination, + }; + } +} + +enum AudienceExportJobStatus { + createPending, + createInProgress, + createFailed, + active, +} + +extension AudienceExportJobStatusValueExtension on AudienceExportJobStatus { + String toValue() { + switch (this) { + case AudienceExportJobStatus.createPending: + return 'CREATE_PENDING'; + case AudienceExportJobStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case AudienceExportJobStatus.createFailed: + return 'CREATE_FAILED'; + case AudienceExportJobStatus.active: + return 'ACTIVE'; + } + } +} + +extension AudienceExportJobStatusFromString on String { + AudienceExportJobStatus toAudienceExportJobStatus() { + switch (this) { + case 'CREATE_PENDING': + return AudienceExportJobStatus.createPending; + case 'CREATE_IN_PROGRESS': + return AudienceExportJobStatus.createInProgress; + case 'CREATE_FAILED': + return AudienceExportJobStatus.createFailed; + case 'ACTIVE': + return AudienceExportJobStatus.active; + } + throw Exception('$this is not known in enum AudienceExportJobStatus'); + } +} + +/// Provides information about the audience export job. +class AudienceExportJobSummary { + /// The Amazon Resource Name (ARN) of the audience generation job that was + /// exported. + final String audienceGenerationJobArn; + final AudienceSize audienceSize; + + /// The time at which the audience export job was created. + final DateTime createTime; + + /// The name of the audience export job. + final String name; + + /// The status of the audience export job. + final AudienceExportJobStatus status; + + /// The most recent time at which the audience export job was updated. + final DateTime updateTime; + + /// The description of the audience export job. + final String? description; + + /// The Amazon S3 bucket where the audience export is stored. + final String? outputLocation; + final StatusDetails? statusDetails; + + AudienceExportJobSummary({ + required this.audienceGenerationJobArn, + required this.audienceSize, + required this.createTime, + required this.name, + required this.status, + required this.updateTime, + this.description, + this.outputLocation, + this.statusDetails, + }); + + factory AudienceExportJobSummary.fromJson(Map json) { + return AudienceExportJobSummary( + audienceGenerationJobArn: json['audienceGenerationJobArn'] as String, + audienceSize: + AudienceSize.fromJson(json['audienceSize'] as Map), + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toAudienceExportJobStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + outputLocation: json['outputLocation'] as String?, + statusDetails: json['statusDetails'] != null + ? StatusDetails.fromJson( + json['statusDetails'] as Map) + : null, + ); + } + + Map toJson() { + final audienceGenerationJobArn = this.audienceGenerationJobArn; + final audienceSize = this.audienceSize; + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final updateTime = this.updateTime; + final description = this.description; + final outputLocation = this.outputLocation; + final statusDetails = this.statusDetails; + return { + 'audienceGenerationJobArn': audienceGenerationJobArn, + 'audienceSize': audienceSize, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + if (outputLocation != null) 'outputLocation': outputLocation, + if (statusDetails != null) 'statusDetails': statusDetails, + }; + } +} + +/// Defines the Amazon S3 bucket where the seed audience for the generating +/// audience is stored. +class AudienceGenerationJobDataSource { + /// Defines the Amazon S3 bucket where the seed audience for the generating + /// audience is stored. A valid data source is a JSON line file in the following + /// format: + /// + /// {"user_id": "111111"} + /// + /// {"user_id": "222222"} + /// + /// ... + final S3ConfigMap dataSource; + + /// The ARN of the IAM role that can read the Amazon S3 bucket where the + /// training data is stored. + final String roleArn; + + AudienceGenerationJobDataSource({ + required this.dataSource, + required this.roleArn, + }); + + factory AudienceGenerationJobDataSource.fromJson(Map json) { + return AudienceGenerationJobDataSource( + dataSource: + S3ConfigMap.fromJson(json['dataSource'] as Map), + roleArn: json['roleArn'] as String, + ); + } + + Map toJson() { + final dataSource = this.dataSource; + final roleArn = this.roleArn; + return { + 'dataSource': dataSource, + 'roleArn': roleArn, + }; + } +} + +enum AudienceGenerationJobStatus { + createPending, + createInProgress, + createFailed, + active, + deletePending, + deleteInProgress, + deleteFailed, +} + +extension AudienceGenerationJobStatusValueExtension + on AudienceGenerationJobStatus { + String toValue() { + switch (this) { + case AudienceGenerationJobStatus.createPending: + return 'CREATE_PENDING'; + case AudienceGenerationJobStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case AudienceGenerationJobStatus.createFailed: + return 'CREATE_FAILED'; + case AudienceGenerationJobStatus.active: + return 'ACTIVE'; + case AudienceGenerationJobStatus.deletePending: + return 'DELETE_PENDING'; + case AudienceGenerationJobStatus.deleteInProgress: + return 'DELETE_IN_PROGRESS'; + case AudienceGenerationJobStatus.deleteFailed: + return 'DELETE_FAILED'; + } + } +} + +extension AudienceGenerationJobStatusFromString on String { + AudienceGenerationJobStatus toAudienceGenerationJobStatus() { + switch (this) { + case 'CREATE_PENDING': + return AudienceGenerationJobStatus.createPending; + case 'CREATE_IN_PROGRESS': + return AudienceGenerationJobStatus.createInProgress; + case 'CREATE_FAILED': + return AudienceGenerationJobStatus.createFailed; + case 'ACTIVE': + return AudienceGenerationJobStatus.active; + case 'DELETE_PENDING': + return AudienceGenerationJobStatus.deletePending; + case 'DELETE_IN_PROGRESS': + return AudienceGenerationJobStatus.deleteInProgress; + case 'DELETE_FAILED': + return AudienceGenerationJobStatus.deleteFailed; + } + throw Exception('$this is not known in enum AudienceGenerationJobStatus'); + } +} + +/// Provides information about the configured audience generation job. +class AudienceGenerationJobSummary { + /// The Amazon Resource Name (ARN) of the audience generation job. + final String audienceGenerationJobArn; + + /// The Amazon Resource Name (ARN) of the configured audience model that was + /// used for this audience generation job. + final String configuredAudienceModelArn; + + /// The time at which the audience generation job was created. + final DateTime createTime; + + /// The name of the audience generation job. + final String name; + + /// The status of the audience generation job. + final AudienceGenerationJobStatus status; + + /// The most recent time at which the audience generation job was updated. + final DateTime updateTime; + + /// The identifier of the collaboration that contains this audience generation + /// job. + final String? collaborationId; + + /// The description of the audience generation job. + final String? description; + + /// The AWS Account that submitted the job. + final String? startedBy; + + AudienceGenerationJobSummary({ + required this.audienceGenerationJobArn, + required this.configuredAudienceModelArn, + required this.createTime, + required this.name, + required this.status, + required this.updateTime, + this.collaborationId, + this.description, + this.startedBy, + }); + + factory AudienceGenerationJobSummary.fromJson(Map json) { + return AudienceGenerationJobSummary( + audienceGenerationJobArn: json['audienceGenerationJobArn'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toAudienceGenerationJobStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + collaborationId: json['collaborationId'] as String?, + description: json['description'] as String?, + startedBy: json['startedBy'] as String?, + ); + } + + Map toJson() { + final audienceGenerationJobArn = this.audienceGenerationJobArn; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final updateTime = this.updateTime; + final collaborationId = this.collaborationId; + final description = this.description; + final startedBy = this.startedBy; + return { + 'audienceGenerationJobArn': audienceGenerationJobArn, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'updateTime': iso8601ToJson(updateTime), + if (collaborationId != null) 'collaborationId': collaborationId, + if (description != null) 'description': description, + if (startedBy != null) 'startedBy': startedBy, + }; + } +} + +enum AudienceModelStatus { + createPending, + createInProgress, + createFailed, + active, + deletePending, + deleteInProgress, + deleteFailed, +} + +extension AudienceModelStatusValueExtension on AudienceModelStatus { + String toValue() { + switch (this) { + case AudienceModelStatus.createPending: + return 'CREATE_PENDING'; + case AudienceModelStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case AudienceModelStatus.createFailed: + return 'CREATE_FAILED'; + case AudienceModelStatus.active: + return 'ACTIVE'; + case AudienceModelStatus.deletePending: + return 'DELETE_PENDING'; + case AudienceModelStatus.deleteInProgress: + return 'DELETE_IN_PROGRESS'; + case AudienceModelStatus.deleteFailed: + return 'DELETE_FAILED'; + } + } +} + +extension AudienceModelStatusFromString on String { + AudienceModelStatus toAudienceModelStatus() { + switch (this) { + case 'CREATE_PENDING': + return AudienceModelStatus.createPending; + case 'CREATE_IN_PROGRESS': + return AudienceModelStatus.createInProgress; + case 'CREATE_FAILED': + return AudienceModelStatus.createFailed; + case 'ACTIVE': + return AudienceModelStatus.active; + case 'DELETE_PENDING': + return AudienceModelStatus.deletePending; + case 'DELETE_IN_PROGRESS': + return AudienceModelStatus.deleteInProgress; + case 'DELETE_FAILED': + return AudienceModelStatus.deleteFailed; + } + throw Exception('$this is not known in enum AudienceModelStatus'); + } +} + +/// Information about the audience model. +class AudienceModelSummary { + /// The Amazon Resource Name (ARN) of the audience model. + final String audienceModelArn; + + /// The time at which the audience model was created. + final DateTime createTime; + + /// The name of the audience model. + final String name; + + /// The status of the audience model. + final AudienceModelStatus status; + + /// The Amazon Resource Name (ARN) of the training dataset that was used for the + /// audience model. + final String trainingDatasetArn; + + /// The most recent time at which the audience model was updated. + final DateTime updateTime; + + /// The description of the audience model. + final String? description; + + AudienceModelSummary({ + required this.audienceModelArn, + required this.createTime, + required this.name, + required this.status, + required this.trainingDatasetArn, + required this.updateTime, + this.description, + }); + + factory AudienceModelSummary.fromJson(Map json) { + return AudienceModelSummary( + audienceModelArn: json['audienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toAudienceModelStatus(), + trainingDatasetArn: json['trainingDatasetArn'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final audienceModelArn = this.audienceModelArn; + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final trainingDatasetArn = this.trainingDatasetArn; + final updateTime = this.updateTime; + final description = this.description; + return { + 'audienceModelArn': audienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'trainingDatasetArn': trainingDatasetArn, + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +/// Metrics that describe the quality of the generated audience. +class AudienceQualityMetrics { + /// The relevance scores of the generated audience. + final List relevanceMetrics; + + /// The recall score of the generated audience. Recall is the percentage of the + /// most similar users (by default, the most similar 20%) from a sample of the + /// training data that are included in the seed audience by the audience + /// generation job. Values range from 0-1, larger values indicate a better + /// audience. A recall value approximately equal to the maximum bin size + /// indicates that the audience model is equivalent to random selection. + final double? recallMetric; + + AudienceQualityMetrics({ + required this.relevanceMetrics, + this.recallMetric, + }); + + factory AudienceQualityMetrics.fromJson(Map json) { + return AudienceQualityMetrics( + relevanceMetrics: (json['relevanceMetrics'] as List) + .whereNotNull() + .map((e) => RelevanceMetric.fromJson(e as Map)) + .toList(), + recallMetric: json['recallMetric'] as double?, + ); + } + + Map toJson() { + final relevanceMetrics = this.relevanceMetrics; + final recallMetric = this.recallMetric; + return { + 'relevanceMetrics': relevanceMetrics, + if (recallMetric != null) 'recallMetric': recallMetric, + }; + } +} + +/// The size of the generated audience. Must match one of the sizes in the +/// configured audience model. +class AudienceSize { + /// Whether the audience size is defined in absolute terms or as a percentage. + /// You can use the ABSOLUTE AudienceSize to configure out + /// audience sizes using the count of identifiers in the output. You can use the + /// Percentage AudienceSize to configure sizes in the range + /// 1-100 percent. + final AudienceSizeType type; + + /// Specify an audience size value. + final int value; + + AudienceSize({ + required this.type, + required this.value, + }); + + factory AudienceSize.fromJson(Map json) { + return AudienceSize( + type: (json['type'] as String).toAudienceSizeType(), + value: json['value'] as int, + ); + } + + Map toJson() { + final type = this.type; + final value = this.value; + return { + 'type': type.toValue(), + 'value': value, + }; + } +} + +/// Configure the list of audience output sizes that can be created. A request +/// to StartAudienceGenerationJob that uses this configured audience +/// model must have an audienceSize selected from this list. You +/// can use the ABSOLUTE AudienceSize to configure out +/// audience sizes using the count of identifiers in the output. You can use the +/// Percentage AudienceSize to configure sizes in the range +/// 1-100 percent. +class AudienceSizeConfig { + /// An array of the different audience output sizes. + final List audienceSizeBins; + + /// Whether the audience output sizes are defined as an absolute number or a + /// percentage. + final AudienceSizeType audienceSizeType; + + AudienceSizeConfig({ + required this.audienceSizeBins, + required this.audienceSizeType, + }); + + factory AudienceSizeConfig.fromJson(Map json) { + return AudienceSizeConfig( + audienceSizeBins: (json['audienceSizeBins'] as List) + .whereNotNull() + .map((e) => e as int) + .toList(), + audienceSizeType: + (json['audienceSizeType'] as String).toAudienceSizeType(), + ); + } + + Map toJson() { + final audienceSizeBins = this.audienceSizeBins; + final audienceSizeType = this.audienceSizeType; + return { + 'audienceSizeBins': audienceSizeBins, + 'audienceSizeType': audienceSizeType.toValue(), + }; + } +} + +enum AudienceSizeType { + absolute, + percentage, +} + +extension AudienceSizeTypeValueExtension on AudienceSizeType { + String toValue() { + switch (this) { + case AudienceSizeType.absolute: + return 'ABSOLUTE'; + case AudienceSizeType.percentage: + return 'PERCENTAGE'; + } + } +} + +extension AudienceSizeTypeFromString on String { + AudienceSizeType toAudienceSizeType() { + switch (this) { + case 'ABSOLUTE': + return AudienceSizeType.absolute; + case 'PERCENTAGE': + return AudienceSizeType.percentage; + } + throw Exception('$this is not known in enum AudienceSizeType'); + } +} + +/// Metadata for a column. +class ColumnSchema { + /// The name of a column. + final String columnName; + + /// The data type of column. + final List columnTypes; + + ColumnSchema({ + required this.columnName, + required this.columnTypes, + }); + + factory ColumnSchema.fromJson(Map json) { + return ColumnSchema( + columnName: json['columnName'] as String, + columnTypes: (json['columnTypes'] as List) + .whereNotNull() + .map((e) => (e as String).toColumnType()) + .toList(), + ); + } + + Map toJson() { + final columnName = this.columnName; + final columnTypes = this.columnTypes; + return { + 'columnName': columnName, + 'columnTypes': columnTypes.map((e) => e.toValue()).toList(), + }; + } +} + +enum ColumnType { + userId, + itemId, + timestamp, + categoricalFeature, + numericalFeature, +} + +extension ColumnTypeValueExtension on ColumnType { + String toValue() { + switch (this) { + case ColumnType.userId: + return 'USER_ID'; + case ColumnType.itemId: + return 'ITEM_ID'; + case ColumnType.timestamp: + return 'TIMESTAMP'; + case ColumnType.categoricalFeature: + return 'CATEGORICAL_FEATURE'; + case ColumnType.numericalFeature: + return 'NUMERICAL_FEATURE'; + } + } +} + +extension ColumnTypeFromString on String { + ColumnType toColumnType() { + switch (this) { + case 'USER_ID': + return ColumnType.userId; + case 'ITEM_ID': + return ColumnType.itemId; + case 'TIMESTAMP': + return ColumnType.timestamp; + case 'CATEGORICAL_FEATURE': + return ColumnType.categoricalFeature; + case 'NUMERICAL_FEATURE': + return ColumnType.numericalFeature; + } + throw Exception('$this is not known in enum ColumnType'); + } +} + +/// Configuration information necessary for the configure audience model output. +class ConfiguredAudienceModelOutputConfig { + final AudienceDestination destination; + + /// The ARN of the IAM role that can write the Amazon S3 bucket. + final String roleArn; + + ConfiguredAudienceModelOutputConfig({ + required this.destination, + required this.roleArn, + }); + + factory ConfiguredAudienceModelOutputConfig.fromJson( + Map json) { + return ConfiguredAudienceModelOutputConfig( + destination: AudienceDestination.fromJson( + json['destination'] as Map), + roleArn: json['roleArn'] as String, + ); + } + + Map toJson() { + final destination = this.destination; + final roleArn = this.roleArn; + return { + 'destination': destination, + 'roleArn': roleArn, + }; + } +} + +enum ConfiguredAudienceModelStatus { + active, +} + +extension ConfiguredAudienceModelStatusValueExtension + on ConfiguredAudienceModelStatus { + String toValue() { + switch (this) { + case ConfiguredAudienceModelStatus.active: + return 'ACTIVE'; + } + } +} + +extension ConfiguredAudienceModelStatusFromString on String { + ConfiguredAudienceModelStatus toConfiguredAudienceModelStatus() { + switch (this) { + case 'ACTIVE': + return ConfiguredAudienceModelStatus.active; + } + throw Exception('$this is not known in enum ConfiguredAudienceModelStatus'); + } +} + +/// Information about the configured audience model. +class ConfiguredAudienceModelSummary { + /// The Amazon Resource Name (ARN) of the audience model that was used to create + /// the configured audience model. + final String audienceModelArn; + + /// The Amazon Resource Name (ARN) of the configured audience model that you are + /// interested in. + final String configuredAudienceModelArn; + + /// The time at which the configured audience model was created. + final DateTime createTime; + + /// The name of the configured audience model. + final String name; + + /// The output configuration of the configured audience model. + final ConfiguredAudienceModelOutputConfig outputConfig; + + /// The status of the configured audience model. + final ConfiguredAudienceModelStatus status; + + /// The most recent time at which the configured audience model was updated. + final DateTime updateTime; + + /// The description of the configured audience model. + final String? description; + + ConfiguredAudienceModelSummary({ + required this.audienceModelArn, + required this.configuredAudienceModelArn, + required this.createTime, + required this.name, + required this.outputConfig, + required this.status, + required this.updateTime, + this.description, + }); + + factory ConfiguredAudienceModelSummary.fromJson(Map json) { + return ConfiguredAudienceModelSummary( + audienceModelArn: json['audienceModelArn'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + outputConfig: ConfiguredAudienceModelOutputConfig.fromJson( + json['outputConfig'] as Map), + status: (json['status'] as String).toConfiguredAudienceModelStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final audienceModelArn = this.audienceModelArn; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final name = this.name; + final outputConfig = this.outputConfig; + final status = this.status; + final updateTime = this.updateTime; + final description = this.description; + return { + 'audienceModelArn': audienceModelArn, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'outputConfig': outputConfig, + 'status': status.toValue(), + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +class CreateAudienceModelResponse { + /// The Amazon Resource Name (ARN) of the audience model. + final String audienceModelArn; + + CreateAudienceModelResponse({ + required this.audienceModelArn, + }); + + factory CreateAudienceModelResponse.fromJson(Map json) { + return CreateAudienceModelResponse( + audienceModelArn: json['audienceModelArn'] as String, + ); + } + + Map toJson() { + final audienceModelArn = this.audienceModelArn; + return { + 'audienceModelArn': audienceModelArn, + }; + } +} + +class CreateConfiguredAudienceModelResponse { + /// The Amazon Resource Name (ARN) of the configured audience model. + final String configuredAudienceModelArn; + + CreateConfiguredAudienceModelResponse({ + required this.configuredAudienceModelArn, + }); + + factory CreateConfiguredAudienceModelResponse.fromJson( + Map json) { + return CreateConfiguredAudienceModelResponse( + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + ); + } + + Map toJson() { + final configuredAudienceModelArn = this.configuredAudienceModelArn; + return { + 'configuredAudienceModelArn': configuredAudienceModelArn, + }; + } +} + +class CreateTrainingDatasetResponse { + /// The Amazon Resource Name (ARN) of the training dataset resource. + final String trainingDatasetArn; + + CreateTrainingDatasetResponse({ + required this.trainingDatasetArn, + }); + + factory CreateTrainingDatasetResponse.fromJson(Map json) { + return CreateTrainingDatasetResponse( + trainingDatasetArn: json['trainingDatasetArn'] as String, + ); + } + + Map toJson() { + final trainingDatasetArn = this.trainingDatasetArn; + return { + 'trainingDatasetArn': trainingDatasetArn, + }; + } +} + +/// Defines information about the Glue data source that contains the training +/// data. +class DataSource { + /// A GlueDataSource object that defines the catalog ID, database name, and + /// table name for the training data. + final GlueDataSource glueDataSource; + + DataSource({ + required this.glueDataSource, + }); + + factory DataSource.fromJson(Map json) { + return DataSource( + glueDataSource: GlueDataSource.fromJson( + json['glueDataSource'] as Map), + ); + } + + Map toJson() { + final glueDataSource = this.glueDataSource; + return { + 'glueDataSource': glueDataSource, + }; + } +} + +/// Defines where the training dataset is located, what type of data it +/// contains, and how to access the data. +class Dataset { + /// A DatasetInputConfig object that defines the data source and schema mapping. + final DatasetInputConfig inputConfig; + + /// What type of information is found in the dataset. + final DatasetType type; + + Dataset({ + required this.inputConfig, + required this.type, + }); + + factory Dataset.fromJson(Map json) { + return Dataset( + inputConfig: DatasetInputConfig.fromJson( + json['inputConfig'] as Map), + type: (json['type'] as String).toDatasetType(), + ); + } + + Map toJson() { + final inputConfig = this.inputConfig; + final type = this.type; + return { + 'inputConfig': inputConfig, + 'type': type.toValue(), + }; + } +} + +/// Defines the Glue data source and schema mapping information. +class DatasetInputConfig { + /// A DataSource object that specifies the Glue data source for the training + /// data. + final DataSource dataSource; + + /// The schema information for the training data. + final List schema; + + DatasetInputConfig({ + required this.dataSource, + required this.schema, + }); + + factory DatasetInputConfig.fromJson(Map json) { + return DatasetInputConfig( + dataSource: + DataSource.fromJson(json['dataSource'] as Map), + schema: (json['schema'] as List) + .whereNotNull() + .map((e) => ColumnSchema.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final dataSource = this.dataSource; + final schema = this.schema; + return { + 'dataSource': dataSource, + 'schema': schema, + }; + } +} + +enum DatasetType { + interactions, +} + +extension DatasetTypeValueExtension on DatasetType { + String toValue() { + switch (this) { + case DatasetType.interactions: + return 'INTERACTIONS'; + } + } +} + +extension DatasetTypeFromString on String { + DatasetType toDatasetType() { + switch (this) { + case 'INTERACTIONS': + return DatasetType.interactions; + } + throw Exception('$this is not known in enum DatasetType'); + } +} + +class GetAudienceGenerationJobResponse { + /// The Amazon Resource Name (ARN) of the audience generation job. + final String audienceGenerationJobArn; + + /// The Amazon Resource Name (ARN) of the configured audience model used for + /// this audience generation job. + final String configuredAudienceModelArn; + + /// The time at which the audience generation job was created. + final DateTime createTime; + + /// The name of the audience generation job. + final String name; + + /// The status of the audience generation job. + final AudienceGenerationJobStatus status; + + /// The most recent time at which the audience generation job was updated. + final DateTime updateTime; + + /// The identifier of the collaboration that this audience generation job is + /// associated with. + final String? collaborationId; + + /// The description of the audience generation job. + final String? description; + + /// Configure whether the seed users are included in the output audience. By + /// default, Clean Rooms ML removes seed users from the output audience. If you + /// specify TRUE, the seed users will appear first in the output. + /// Clean Rooms ML does not explicitly reveal whether a user was in the seed, + /// but the recipient of the audience will know that the first + /// minimumSeedSize count of users are from the seed. + final bool? includeSeedInOutput; + + /// The relevance scores for different audience sizes and the recall score of + /// the generated audience. + final AudienceQualityMetrics? metrics; + + /// The seed audience that was used for this audience generation job. This field + /// will be null if the account calling the API is the account that started this + /// audience generation job. + final AudienceGenerationJobDataSource? seedAudience; + + /// The AWS account that started this audience generation job. + final String? startedBy; + + /// Details about the status of the audience generation job. + final StatusDetails? statusDetails; + + /// The tags that are associated to this audience generation job. + final Map? tags; + + GetAudienceGenerationJobResponse({ + required this.audienceGenerationJobArn, + required this.configuredAudienceModelArn, + required this.createTime, + required this.name, + required this.status, + required this.updateTime, + this.collaborationId, + this.description, + this.includeSeedInOutput, + this.metrics, + this.seedAudience, + this.startedBy, + this.statusDetails, + this.tags, + }); + + factory GetAudienceGenerationJobResponse.fromJson(Map json) { + return GetAudienceGenerationJobResponse( + audienceGenerationJobArn: json['audienceGenerationJobArn'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toAudienceGenerationJobStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + collaborationId: json['collaborationId'] as String?, + description: json['description'] as String?, + includeSeedInOutput: json['includeSeedInOutput'] as bool?, + metrics: json['metrics'] != null + ? AudienceQualityMetrics.fromJson( + json['metrics'] as Map) + : null, + seedAudience: json['seedAudience'] != null + ? AudienceGenerationJobDataSource.fromJson( + json['seedAudience'] as Map) + : null, + startedBy: json['startedBy'] as String?, + statusDetails: json['statusDetails'] != null + ? StatusDetails.fromJson( + json['statusDetails'] as Map) + : null, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final audienceGenerationJobArn = this.audienceGenerationJobArn; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final updateTime = this.updateTime; + final collaborationId = this.collaborationId; + final description = this.description; + final includeSeedInOutput = this.includeSeedInOutput; + final metrics = this.metrics; + final seedAudience = this.seedAudience; + final startedBy = this.startedBy; + final statusDetails = this.statusDetails; + final tags = this.tags; + return { + 'audienceGenerationJobArn': audienceGenerationJobArn, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'updateTime': iso8601ToJson(updateTime), + if (collaborationId != null) 'collaborationId': collaborationId, + if (description != null) 'description': description, + if (includeSeedInOutput != null) + 'includeSeedInOutput': includeSeedInOutput, + if (metrics != null) 'metrics': metrics, + if (seedAudience != null) 'seedAudience': seedAudience, + if (startedBy != null) 'startedBy': startedBy, + if (statusDetails != null) 'statusDetails': statusDetails, + if (tags != null) 'tags': tags, + }; + } +} + +class GetAudienceModelResponse { + /// The Amazon Resource Name (ARN) of the audience model. + final String audienceModelArn; + + /// The time at which the audience model was created. + final DateTime createTime; + + /// The name of the audience model. + final String name; + + /// The status of the audience model. + final AudienceModelStatus status; + + /// The Amazon Resource Name (ARN) of the training dataset that was used for + /// this audience model. + final String trainingDatasetArn; + + /// The most recent time at which the audience model was updated. + final DateTime updateTime; + + /// The description of the audience model. + final String? description; + + /// The KMS key ARN used for the audience model. + final String? kmsKeyArn; + + /// Details about the status of the audience model. + final StatusDetails? statusDetails; + + /// The tags that are assigned to the audience model. + final Map? tags; + + /// The end date specified for the training window. + final DateTime? trainingDataEndTime; + + /// The start date specified for the training window. + final DateTime? trainingDataStartTime; + + GetAudienceModelResponse({ + required this.audienceModelArn, + required this.createTime, + required this.name, + required this.status, + required this.trainingDatasetArn, + required this.updateTime, + this.description, + this.kmsKeyArn, + this.statusDetails, + this.tags, + this.trainingDataEndTime, + this.trainingDataStartTime, + }); + + factory GetAudienceModelResponse.fromJson(Map json) { + return GetAudienceModelResponse( + audienceModelArn: json['audienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toAudienceModelStatus(), + trainingDatasetArn: json['trainingDatasetArn'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + kmsKeyArn: json['kmsKeyArn'] as String?, + statusDetails: json['statusDetails'] != null + ? StatusDetails.fromJson( + json['statusDetails'] as Map) + : null, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + trainingDataEndTime: timeStampFromJson(json['trainingDataEndTime']), + trainingDataStartTime: timeStampFromJson(json['trainingDataStartTime']), + ); + } + + Map toJson() { + final audienceModelArn = this.audienceModelArn; + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final trainingDatasetArn = this.trainingDatasetArn; + final updateTime = this.updateTime; + final description = this.description; + final kmsKeyArn = this.kmsKeyArn; + final statusDetails = this.statusDetails; + final tags = this.tags; + final trainingDataEndTime = this.trainingDataEndTime; + final trainingDataStartTime = this.trainingDataStartTime; + return { + 'audienceModelArn': audienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'trainingDatasetArn': trainingDatasetArn, + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + if (statusDetails != null) 'statusDetails': statusDetails, + if (tags != null) 'tags': tags, + if (trainingDataEndTime != null) + 'trainingDataEndTime': iso8601ToJson(trainingDataEndTime), + if (trainingDataStartTime != null) + 'trainingDataStartTime': iso8601ToJson(trainingDataStartTime), + }; + } +} + +class GetConfiguredAudienceModelPolicyResponse { + /// The Amazon Resource Name (ARN) of the configured audience model. + final String configuredAudienceModelArn; + + /// The configured audience model policy. This is a JSON IAM resource policy. + final String configuredAudienceModelPolicy; + + /// A cryptographic hash of the contents of the policy used to prevent + /// unexpected concurrent modification of the policy. + final String policyHash; + + GetConfiguredAudienceModelPolicyResponse({ + required this.configuredAudienceModelArn, + required this.configuredAudienceModelPolicy, + required this.policyHash, + }); + + factory GetConfiguredAudienceModelPolicyResponse.fromJson( + Map json) { + return GetConfiguredAudienceModelPolicyResponse( + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + configuredAudienceModelPolicy: + json['configuredAudienceModelPolicy'] as String, + policyHash: json['policyHash'] as String, + ); + } + + Map toJson() { + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final configuredAudienceModelPolicy = this.configuredAudienceModelPolicy; + final policyHash = this.policyHash; + return { + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'configuredAudienceModelPolicy': configuredAudienceModelPolicy, + 'policyHash': policyHash, + }; + } +} + +class GetConfiguredAudienceModelResponse { + /// The Amazon Resource Name (ARN) of the audience model used for this + /// configured audience model. + final String audienceModelArn; + + /// The Amazon Resource Name (ARN) of the configured audience model. + final String configuredAudienceModelArn; + + /// The time at which the configured audience model was created. + final DateTime createTime; + + /// The name of the configured audience model. + final String name; + + /// The output configuration of the configured audience model + final ConfiguredAudienceModelOutputConfig outputConfig; + + /// Whether audience metrics are shared. + final List sharedAudienceMetrics; + + /// The status of the configured audience model. + final ConfiguredAudienceModelStatus status; + + /// The most recent time at which the configured audience model was updated. + final DateTime updateTime; + + /// The list of output sizes of audiences that can be created using this + /// configured audience model. A request to StartAudienceGenerationJob + /// that uses this configured audience model must have an + /// audienceSize selected from this list. You can use the + /// ABSOLUTE AudienceSize to configure out audience sizes + /// using the count of identifiers in the output. You can use the + /// Percentage AudienceSize to configure sizes in the range + /// 1-100 percent. + final AudienceSizeConfig? audienceSizeConfig; + + /// Provides the childResourceTagOnCreatePolicy that was used for + /// this configured audience model. + final TagOnCreatePolicy? childResourceTagOnCreatePolicy; + + /// The description of the configured audience model. + final String? description; + + /// The minimum number of users from the seed audience that must match with + /// users in the training data of the audience model. + final int? minMatchingSeedSize; + + /// The tags that are associated to this configured audience model. + final Map? tags; + + GetConfiguredAudienceModelResponse({ + required this.audienceModelArn, + required this.configuredAudienceModelArn, + required this.createTime, + required this.name, + required this.outputConfig, + required this.sharedAudienceMetrics, + required this.status, + required this.updateTime, + this.audienceSizeConfig, + this.childResourceTagOnCreatePolicy, + this.description, + this.minMatchingSeedSize, + this.tags, + }); + + factory GetConfiguredAudienceModelResponse.fromJson( + Map json) { + return GetConfiguredAudienceModelResponse( + audienceModelArn: json['audienceModelArn'] as String, + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + outputConfig: ConfiguredAudienceModelOutputConfig.fromJson( + json['outputConfig'] as Map), + sharedAudienceMetrics: (json['sharedAudienceMetrics'] as List) + .whereNotNull() + .map((e) => (e as String).toSharedAudienceMetrics()) + .toList(), + status: (json['status'] as String).toConfiguredAudienceModelStatus(), + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + audienceSizeConfig: json['audienceSizeConfig'] != null + ? AudienceSizeConfig.fromJson( + json['audienceSizeConfig'] as Map) + : null, + childResourceTagOnCreatePolicy: + (json['childResourceTagOnCreatePolicy'] as String?) + ?.toTagOnCreatePolicy(), + description: json['description'] as String?, + minMatchingSeedSize: json['minMatchingSeedSize'] as int?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final audienceModelArn = this.audienceModelArn; + final configuredAudienceModelArn = this.configuredAudienceModelArn; + final createTime = this.createTime; + final name = this.name; + final outputConfig = this.outputConfig; + final sharedAudienceMetrics = this.sharedAudienceMetrics; + final status = this.status; + final updateTime = this.updateTime; + final audienceSizeConfig = this.audienceSizeConfig; + final childResourceTagOnCreatePolicy = this.childResourceTagOnCreatePolicy; + final description = this.description; + final minMatchingSeedSize = this.minMatchingSeedSize; + final tags = this.tags; + return { + 'audienceModelArn': audienceModelArn, + 'configuredAudienceModelArn': configuredAudienceModelArn, + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'outputConfig': outputConfig, + 'sharedAudienceMetrics': + sharedAudienceMetrics.map((e) => e.toValue()).toList(), + 'status': status.toValue(), + 'updateTime': iso8601ToJson(updateTime), + if (audienceSizeConfig != null) 'audienceSizeConfig': audienceSizeConfig, + if (childResourceTagOnCreatePolicy != null) + 'childResourceTagOnCreatePolicy': + childResourceTagOnCreatePolicy.toValue(), + if (description != null) 'description': description, + if (minMatchingSeedSize != null) + 'minMatchingSeedSize': minMatchingSeedSize, + if (tags != null) 'tags': tags, + }; + } +} + +class GetTrainingDatasetResponse { + /// The time at which the training dataset was created. + final DateTime createTime; + + /// The name of the training dataset. + final String name; + + /// The IAM role used to read the training data. + final String roleArn; + + /// The status of the training dataset. + final TrainingDatasetStatus status; + + /// Metadata about the requested training data. + final List trainingData; + + /// The Amazon Resource Name (ARN) of the training dataset. + final String trainingDatasetArn; + + /// The most recent time at which the training dataset was updated. + final DateTime updateTime; + + /// The description of the training dataset. + final String? description; + + /// The tags that are assigned to this training dataset. + final Map? tags; + + GetTrainingDatasetResponse({ + required this.createTime, + required this.name, + required this.roleArn, + required this.status, + required this.trainingData, + required this.trainingDatasetArn, + required this.updateTime, + this.description, + this.tags, + }); + + factory GetTrainingDatasetResponse.fromJson(Map json) { + return GetTrainingDatasetResponse( + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + roleArn: json['roleArn'] as String, + status: (json['status'] as String).toTrainingDatasetStatus(), + trainingData: (json['trainingData'] as List) + .whereNotNull() + .map((e) => Dataset.fromJson(e as Map)) + .toList(), + trainingDatasetArn: json['trainingDatasetArn'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final createTime = this.createTime; + final name = this.name; + final roleArn = this.roleArn; + final status = this.status; + final trainingData = this.trainingData; + final trainingDatasetArn = this.trainingDatasetArn; + final updateTime = this.updateTime; + final description = this.description; + final tags = this.tags; + return { + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'roleArn': roleArn, + 'status': status.toValue(), + 'trainingData': trainingData, + 'trainingDatasetArn': trainingDatasetArn, + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + } +} + +/// Defines the Glue data source that contains the training data. +class GlueDataSource { + /// The Glue database that contains the training data. + final String databaseName; + + /// The Glue table that contains the training data. + final String tableName; + + /// The Glue catalog that contains the training data. + final String? catalogId; + + GlueDataSource({ + required this.databaseName, + required this.tableName, + this.catalogId, + }); + + factory GlueDataSource.fromJson(Map json) { + return GlueDataSource( + databaseName: json['databaseName'] as String, + tableName: json['tableName'] as String, + catalogId: json['catalogId'] as String?, + ); + } + + Map toJson() { + final databaseName = this.databaseName; + final tableName = this.tableName; + final catalogId = this.catalogId; + return { + 'databaseName': databaseName, + 'tableName': tableName, + if (catalogId != null) 'catalogId': catalogId, + }; + } +} + +class ListAudienceExportJobsResponse { + /// The audience export jobs that match the request. + final List audienceExportJobs; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListAudienceExportJobsResponse({ + required this.audienceExportJobs, + this.nextToken, + }); + + factory ListAudienceExportJobsResponse.fromJson(Map json) { + return ListAudienceExportJobsResponse( + audienceExportJobs: (json['audienceExportJobs'] as List) + .whereNotNull() + .map((e) => + AudienceExportJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final audienceExportJobs = this.audienceExportJobs; + final nextToken = this.nextToken; + return { + 'audienceExportJobs': audienceExportJobs, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAudienceGenerationJobsResponse { + /// The audience generation jobs that match the request. + final List audienceGenerationJobs; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListAudienceGenerationJobsResponse({ + required this.audienceGenerationJobs, + this.nextToken, + }); + + factory ListAudienceGenerationJobsResponse.fromJson( + Map json) { + return ListAudienceGenerationJobsResponse( + audienceGenerationJobs: (json['audienceGenerationJobs'] as List) + .whereNotNull() + .map((e) => + AudienceGenerationJobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final audienceGenerationJobs = this.audienceGenerationJobs; + final nextToken = this.nextToken; + return { + 'audienceGenerationJobs': audienceGenerationJobs, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAudienceModelsResponse { + /// The audience models that match the request. + final List audienceModels; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListAudienceModelsResponse({ + required this.audienceModels, + this.nextToken, + }); + + factory ListAudienceModelsResponse.fromJson(Map json) { + return ListAudienceModelsResponse( + audienceModels: (json['audienceModels'] as List) + .whereNotNull() + .map((e) => AudienceModelSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final audienceModels = this.audienceModels; + final nextToken = this.nextToken; + return { + 'audienceModels': audienceModels, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListConfiguredAudienceModelsResponse { + /// The configured audience models. + final List configuredAudienceModels; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListConfiguredAudienceModelsResponse({ + required this.configuredAudienceModels, + this.nextToken, + }); + + factory ListConfiguredAudienceModelsResponse.fromJson( + Map json) { + return ListConfiguredAudienceModelsResponse( + configuredAudienceModels: (json['configuredAudienceModels'] as List) + .whereNotNull() + .map((e) => ConfiguredAudienceModelSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final configuredAudienceModels = this.configuredAudienceModels; + final nextToken = this.nextToken; + return { + 'configuredAudienceModels': configuredAudienceModels, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// The tags that are associated with the resource. + final Map tags; + + ListTagsForResourceResponse({ + required this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map) + .map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + 'tags': tags, + }; + } +} + +class ListTrainingDatasetsResponse { + /// The training datasets that match the request. + final List trainingDatasets; + + /// The token value retrieved from a previous call to access the next page of + /// results. + final String? nextToken; + + ListTrainingDatasetsResponse({ + required this.trainingDatasets, + this.nextToken, + }); + + factory ListTrainingDatasetsResponse.fromJson(Map json) { + return ListTrainingDatasetsResponse( + trainingDatasets: (json['trainingDatasets'] as List) + .whereNotNull() + .map( + (e) => TrainingDatasetSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final trainingDatasets = this.trainingDatasets; + final nextToken = this.nextToken; + return { + 'trainingDatasets': trainingDatasets, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +enum PolicyExistenceCondition { + policyMustExist, + policyMustNotExist, +} + +extension PolicyExistenceConditionValueExtension on PolicyExistenceCondition { + String toValue() { + switch (this) { + case PolicyExistenceCondition.policyMustExist: + return 'POLICY_MUST_EXIST'; + case PolicyExistenceCondition.policyMustNotExist: + return 'POLICY_MUST_NOT_EXIST'; + } + } +} + +extension PolicyExistenceConditionFromString on String { + PolicyExistenceCondition toPolicyExistenceCondition() { + switch (this) { + case 'POLICY_MUST_EXIST': + return PolicyExistenceCondition.policyMustExist; + case 'POLICY_MUST_NOT_EXIST': + return PolicyExistenceCondition.policyMustNotExist; + } + throw Exception('$this is not known in enum PolicyExistenceCondition'); + } +} + +class PutConfiguredAudienceModelPolicyResponse { + /// The IAM resource policy. + final String configuredAudienceModelPolicy; + + /// A cryptographic hash of the contents of the policy used to prevent + /// unexpected concurrent modification of the policy. + final String policyHash; + + PutConfiguredAudienceModelPolicyResponse({ + required this.configuredAudienceModelPolicy, + required this.policyHash, + }); + + factory PutConfiguredAudienceModelPolicyResponse.fromJson( + Map json) { + return PutConfiguredAudienceModelPolicyResponse( + configuredAudienceModelPolicy: + json['configuredAudienceModelPolicy'] as String, + policyHash: json['policyHash'] as String, + ); + } + + Map toJson() { + final configuredAudienceModelPolicy = this.configuredAudienceModelPolicy; + final policyHash = this.policyHash; + return { + 'configuredAudienceModelPolicy': configuredAudienceModelPolicy, + 'policyHash': policyHash, + }; + } +} + +/// The relevance score of a generated audience. +class RelevanceMetric { + final AudienceSize audienceSize; + + /// The relevance score of the generated audience. + final double? score; + + RelevanceMetric({ + required this.audienceSize, + this.score, + }); + + factory RelevanceMetric.fromJson(Map json) { + return RelevanceMetric( + audienceSize: + AudienceSize.fromJson(json['audienceSize'] as Map), + score: json['score'] as double?, + ); + } + + Map toJson() { + final audienceSize = this.audienceSize; + final score = this.score; + return { + 'audienceSize': audienceSize, + if (score != null) 'score': score, + }; + } +} + +/// Provides information about an Amazon S3 bucket and path. +class S3ConfigMap { + /// The Amazon S3 location URI. + final String s3Uri; + + S3ConfigMap({ + required this.s3Uri, + }); + + factory S3ConfigMap.fromJson(Map json) { + return S3ConfigMap( + s3Uri: json['s3Uri'] as String, + ); + } + + Map toJson() { + final s3Uri = this.s3Uri; + return { + 's3Uri': s3Uri, + }; + } +} + +enum SharedAudienceMetrics { + all, + none, +} + +extension SharedAudienceMetricsValueExtension on SharedAudienceMetrics { + String toValue() { + switch (this) { + case SharedAudienceMetrics.all: + return 'ALL'; + case SharedAudienceMetrics.none: + return 'NONE'; + } + } +} + +extension SharedAudienceMetricsFromString on String { + SharedAudienceMetrics toSharedAudienceMetrics() { + switch (this) { + case 'ALL': + return SharedAudienceMetrics.all; + case 'NONE': + return SharedAudienceMetrics.none; + } + throw Exception('$this is not known in enum SharedAudienceMetrics'); + } +} + +class StartAudienceGenerationJobResponse { + /// The Amazon Resource Name (ARN) of the audience generation job. + final String audienceGenerationJobArn; + + StartAudienceGenerationJobResponse({ + required this.audienceGenerationJobArn, + }); + + factory StartAudienceGenerationJobResponse.fromJson( + Map json) { + return StartAudienceGenerationJobResponse( + audienceGenerationJobArn: json['audienceGenerationJobArn'] as String, + ); + } + + Map toJson() { + final audienceGenerationJobArn = this.audienceGenerationJobArn; + return { + 'audienceGenerationJobArn': audienceGenerationJobArn, + }; + } +} + +/// Details about the status of a resource. +class StatusDetails { + /// The error message that was returned. The message is intended for human + /// consumption and can change at any time. Use the statusCode for + /// programmatic error handling. + final String? message; + + /// The status code that was returned. The status code is intended for + /// programmatic error handling. Clean Rooms ML will not change the status code + /// for existing error conditions. + final String? statusCode; + + StatusDetails({ + this.message, + this.statusCode, + }); + + factory StatusDetails.fromJson(Map json) { + return StatusDetails( + message: json['message'] as String?, + statusCode: json['statusCode'] as String?, + ); + } + + Map toJson() { + final message = this.message; + final statusCode = this.statusCode; + return { + if (message != null) 'message': message, + if (statusCode != null) 'statusCode': statusCode, + }; + } +} + +enum TagOnCreatePolicy { + fromParentResource, + none, +} + +extension TagOnCreatePolicyValueExtension on TagOnCreatePolicy { + String toValue() { + switch (this) { + case TagOnCreatePolicy.fromParentResource: + return 'FROM_PARENT_RESOURCE'; + case TagOnCreatePolicy.none: + return 'NONE'; + } + } +} + +extension TagOnCreatePolicyFromString on String { + TagOnCreatePolicy toTagOnCreatePolicy() { + switch (this) { + case 'FROM_PARENT_RESOURCE': + return TagOnCreatePolicy.fromParentResource; + case 'NONE': + return TagOnCreatePolicy.none; + } + throw Exception('$this is not known in enum TagOnCreatePolicy'); + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +enum TrainingDatasetStatus { + active, +} + +extension TrainingDatasetStatusValueExtension on TrainingDatasetStatus { + String toValue() { + switch (this) { + case TrainingDatasetStatus.active: + return 'ACTIVE'; + } + } +} + +extension TrainingDatasetStatusFromString on String { + TrainingDatasetStatus toTrainingDatasetStatus() { + switch (this) { + case 'ACTIVE': + return TrainingDatasetStatus.active; + } + throw Exception('$this is not known in enum TrainingDatasetStatus'); + } +} + +/// Provides information about the training dataset. +class TrainingDatasetSummary { + /// The time at which the training dataset was created. + final DateTime createTime; + + /// The name of the training dataset. + final String name; + + /// The status of the training dataset. + final TrainingDatasetStatus status; + + /// The Amazon Resource Name (ARN) of the training dataset. + final String trainingDatasetArn; + + /// The most recent time at which the training dataset was updated. + final DateTime updateTime; + + /// The description of the training dataset. + final String? description; + + TrainingDatasetSummary({ + required this.createTime, + required this.name, + required this.status, + required this.trainingDatasetArn, + required this.updateTime, + this.description, + }); + + factory TrainingDatasetSummary.fromJson(Map json) { + return TrainingDatasetSummary( + createTime: nonNullableTimeStampFromJson(json['createTime'] as Object), + name: json['name'] as String, + status: (json['status'] as String).toTrainingDatasetStatus(), + trainingDatasetArn: json['trainingDatasetArn'] as String, + updateTime: nonNullableTimeStampFromJson(json['updateTime'] as Object), + description: json['description'] as String?, + ); + } + + Map toJson() { + final createTime = this.createTime; + final name = this.name; + final status = this.status; + final trainingDatasetArn = this.trainingDatasetArn; + final updateTime = this.updateTime; + final description = this.description; + return { + 'createTime': iso8601ToJson(createTime), + 'name': name, + 'status': status.toValue(), + 'trainingDatasetArn': trainingDatasetArn, + 'updateTime': iso8601ToJson(updateTime), + if (description != null) 'description': description, + }; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateConfiguredAudienceModelResponse { + /// The Amazon Resource Name (ARN) of the configured audience model that was + /// updated. + final String configuredAudienceModelArn; + + UpdateConfiguredAudienceModelResponse({ + required this.configuredAudienceModelArn, + }); + + factory UpdateConfiguredAudienceModelResponse.fromJson( + Map json) { + return UpdateConfiguredAudienceModelResponse( + configuredAudienceModelArn: json['configuredAudienceModelArn'] as String, + ); + } + + Map toJson() { + final configuredAudienceModelArn = this.configuredAudienceModelArn; + return { + 'configuredAudienceModelArn': configuredAudienceModelArn, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/cloud9/v2017_09_23.dart b/aws_client/lib/src/generated/cloud9/v2017_09_23.dart index 4f49d0567..df2233986 100644 --- a/aws_client/lib/src/generated/cloud9/v2017_09_23.dart +++ b/aws_client/lib/src/generated/cloud9/v2017_09_23.dart @@ -61,6 +61,61 @@ class Cloud9 { /// May throw [LimitExceededException]. /// May throw [InternalServerErrorException]. /// + /// Parameter [imageId] : + /// The identifier for the Amazon Machine Image (AMI) that's used to create + /// the EC2 instance. To choose an AMI for the instance, you must specify a + /// valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path. + /// + /// From December 04, 2023, you will be required to include the + /// imageId parameter for the CreateEnvironmentEC2 + /// action. This change will be reflected across all direct methods of + /// communicating with the API, such as Amazon Web Services SDK, Amazon Web + /// Services CLI and Amazon Web Services CloudFormation. This change will only + /// affect direct API consumers, and not Cloud9 console users. + /// + /// We recommend using Amazon Linux 2023 as the AMI to create your environment + /// as it is fully supported. + /// + /// Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we + /// recommend you choose Ubuntu 22.04. + /// + /// AMI aliases + /// + ///
                + ///
              • + /// Amazon Linux 2: amazonlinux-2-x86_64 + ///
              • + ///
              • + /// Amazon Linux 2023 (recommended): amazonlinux-2023-x86_64 + ///
              • + ///
              • + /// Ubuntu 18.04: ubuntu-18.04-x86_64 + ///
              • + ///
              • + /// Ubuntu 22.04: ubuntu-22.04-x86_64 + ///
              • + ///
              + /// SSM paths + /// + ///
                + ///
              • + /// Amazon Linux 2: + /// resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 + ///
              • + ///
              • + /// Amazon Linux 2023 (recommended): + /// resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64 + ///
              • + ///
              • + /// Ubuntu 18.04: + /// resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 + ///
              • + ///
              • + /// Ubuntu 22.04: + /// resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64 + ///
              • + ///
              + /// /// Parameter [instanceType] : /// The type of instance to connect to the environment (for example, /// t2.micro). @@ -103,50 +158,6 @@ class Cloud9 { /// DryRunOperation. Otherwise, it is /// UnauthorizedOperation. /// - /// Parameter [imageId] : - /// The identifier for the Amazon Machine Image (AMI) that's used to create - /// the EC2 instance. To choose an AMI for the instance, you must specify a - /// valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path. - /// - /// The default Amazon Linux AMI is currently used if the parameter isn't - /// explicitly assigned a value in the request. - /// - /// In the future the parameter for Amazon Linux will no longer be available - /// when you specify an AMI for your instance. Amazon Linux 2 will then become - /// the default AMI, which is used to launch your instance if no parameter is - /// explicitly defined. - /// - /// AMI aliases - /// - ///
                - ///
              • - /// Amazon Linux (default): amazonlinux-1-x86_64 - ///
              • - ///
              • - /// Amazon Linux 2: amazonlinux-2-x86_64 - ///
              • - ///
              • - /// Ubuntu 18.04: ubuntu-18.04-x86_64 - ///
              • - ///
              - /// SSM paths - /// - ///
                - ///
              • - /// Amazon Linux (default): - /// resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64 - /// - ///
              • - ///
              • - /// Amazon Linux 2: - /// resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 - ///
              • - ///
              • - /// Ubuntu 18.04: - /// resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 - ///
              • - ///
              - /// /// Parameter [ownerArn] : /// The Amazon Resource Name (ARN) of the environment owner. This ARN can be /// the ARN of any IAM principal. If this value is not specified, the ARN @@ -160,6 +171,7 @@ class Cloud9 { /// An array of key-value pairs that will be associated with the new Cloud9 /// development environment. Future createEnvironmentEC2({ + required String imageId, required String instanceType, required String name, int? automaticStopTimeMinutes, @@ -167,7 +179,6 @@ class Cloud9 { ConnectionType? connectionType, String? description, bool? dryRun, - String? imageId, String? ownerArn, String? subnetId, List? tags, @@ -189,6 +200,7 @@ class Cloud9 { // TODO queryParams headers: headers, payload: { + 'imageId': imageId, 'instanceType': instanceType, 'name': name, if (automaticStopTimeMinutes != null) @@ -198,7 +210,6 @@ class Cloud9 { if (connectionType != null) 'connectionType': connectionType.toValue(), if (description != null) 'description': description, if (dryRun != null) 'dryRun': dryRun, - if (imageId != null) 'imageId': imageId, if (ownerArn != null) 'ownerArn': ownerArn, if (subnetId != null) 'subnetId': subnetId, if (tags != null) 'tags': tags, diff --git a/aws_client/lib/src/generated/cloud_control/v2021_09_30.dart b/aws_client/lib/src/generated/cloud_control/v2021_09_30.dart index 1ca44092e..df8ad9ed4 100644 --- a/aws_client/lib/src/generated/cloud_control/v2021_09_30.dart +++ b/aws_client/lib/src/generated/cloud_control/v2021_09_30.dart @@ -123,19 +123,26 @@ class CloudControlApi { /// consisting of that resource's properties and their desired values. /// /// Cloud Control API currently supports JSON as a structured data format. - ///
               <p>Specify the desired state as one of the
              -  /// following:</p> <ul> <li> <p>A JSON blob</p>
              -  /// </li> <li> <p>A local path containing the desired state
              -  /// in JSON data format</p> </li> </ul> <p>For more
              -  /// information, see <a
              -  /// href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate">Composing
              -  /// the desired state of the resource</a> in the <i>Amazon Web
              -  /// Services Cloud Control API User Guide</i>.</p> <p>For
              -  /// more information about the properties of a specific resource, refer to the
              -  /// related topic for the resource in the <a
              -  /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">Resource
              -  /// and property types reference</a> in the <i>CloudFormation
              -  /// Users Guide</i>.</p> 
              + /// + /// Specify the desired state as one of the following: + /// + ///
                + ///
              • + /// A JSON blob + ///
              • + ///
              • + /// A local path containing the desired state in JSON data format + ///
              • + ///
              + /// For more information, see Composing + /// the desired state of the resource in the Amazon Web Services Cloud + /// Control API User Guide. + /// + /// For more information about the properties of a specific resource, refer to + /// the related topic for the resource in the Resource + /// and property types reference in the CloudFormation Users Guide. /// /// Parameter [typeName] : /// The name of the resource type. diff --git a/aws_client/lib/src/generated/cloud_directory/v2017_01_11.dart b/aws_client/lib/src/generated/cloud_directory/v2017_01_11.dart index 1198e507e..29454eb06 100644 --- a/aws_client/lib/src/generated/cloud_directory/v2017_01_11.dart +++ b/aws_client/lib/src/generated/cloud_directory/v2017_01_11.dart @@ -6667,7 +6667,7 @@ class FacetAttributeUpdate { enum FacetStyle { static, - dynamic, + $dynamic, } extension FacetStyleValueExtension on FacetStyle { @@ -6675,7 +6675,7 @@ extension FacetStyleValueExtension on FacetStyle { switch (this) { case FacetStyle.static: return 'STATIC'; - case FacetStyle.dynamic: + case FacetStyle.$dynamic: return 'DYNAMIC'; } } @@ -6687,7 +6687,7 @@ extension FacetStyleFromString on String { case 'STATIC': return FacetStyle.static; case 'DYNAMIC': - return FacetStyle.dynamic; + return FacetStyle.$dynamic; } throw Exception('$this is not known in enum FacetStyle'); } diff --git a/aws_client/lib/src/generated/cloud_formation/v2010_05_15.dart b/aws_client/lib/src/generated/cloud_formation/v2010_05_15.dart index 1f1db6544..88be892a5 100644 --- a/aws_client/lib/src/generated/cloud_formation/v2010_05_15.dart +++ b/aws_client/lib/src/generated/cloud_formation/v2010_05_15.dart @@ -59,17 +59,38 @@ class CloudFormation { _protocol.close(); } + /// Activate trusted access with Organizations. With trusted access between + /// StackSets and Organizations activated, the management account has + /// permissions to create and manage StackSets for your organization. + /// + /// May throw [InvalidOperationException]. + /// May throw [OperationNotFoundException]. + Future activateOrganizationsAccess() async { + final $request = {}; + await _protocol.send( + $request, + action: 'ActivateOrganizationsAccess', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ActivateOrganizationsAccessInput'], + shapes: shapes, + resultWrapper: 'ActivateOrganizationsAccessResult', + ); + } + /// Activates a public third-party extension, making it available for use in /// stack templates. For more information, see Using /// public extensions in the CloudFormation User Guide. /// /// Once you have activated a public third-party extension in your account and - /// region, use SetTypeConfiguration + /// Region, use SetTypeConfiguration /// to specify configuration properties for the extension. For more /// information, see Configuring + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring /// extensions at the account level in the CloudFormation User /// Guide. /// @@ -77,7 +98,7 @@ class CloudFormation { /// May throw [TypeNotFoundException]. /// /// Parameter [autoUpdate] : - /// Whether to automatically update the extension in this account and region + /// Whether to automatically update the extension in this account and Region /// when a new minor version is published by the extension publisher. /// Major versions released by the publisher must be manually updated. /// @@ -86,6 +107,9 @@ class CloudFormation { /// Parameter [executionRoleArn] : /// The name of the IAM execution role to use to activate the extension. /// + /// Parameter [loggingConfig] : + /// Contains logging configuration information for an extension. + /// /// Parameter [majorVersion] : /// The major version of this extension you want to activate, if multiple /// major versions are available. The default is the latest major version. @@ -120,15 +144,15 @@ class CloudFormation { /// TypeName, Type, and PublisherId. /// /// Parameter [typeNameAlias] : - /// An alias to assign to the public extension, in this account and region. If + /// An alias to assign to the public extension, in this account and Region. If /// you specify an alias for the extension, CloudFormation treats the alias as - /// the extension type name within this account and region. You must use the + /// the extension type name within this account and Region. You must use the /// alias to refer to the extension in your templates, API calls, and /// CloudFormation console. /// - /// An extension alias must be unique within a given account and region. You + /// An extension alias must be unique within a given account and Region. You /// can activate the same public resource multiple times in the same account - /// and region, using different type name aliases. + /// and Region, using different type name aliases. /// /// Parameter [versionBump] : /// Manually updates a previously-activated type to a new major or minor @@ -189,10 +213,10 @@ class CloudFormation { } /// Returns configuration data for the specified CloudFormation extensions, - /// from the CloudFormation registry for the account and region. + /// from the CloudFormation registry for the account and Region. /// /// For more information, see Configuring + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring /// extensions at the account level in the CloudFormation User /// Guide. /// @@ -232,6 +256,18 @@ class CloudFormation { /// May throw [TokenAlreadyExistsException]. /// /// Parameter [stackName] : + /// + /// If you don't pass a parameter to StackName, the API returns a + /// response that describes all resources in the account. + /// + /// The IAM policy below can be added to IAM policies when you want to limit + /// resource-level permissions and avoid returning a response when no + /// parameter is sent in the request: + /// + /// { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", + /// "Action": "cloudformation:DescribeStacks", "NotResource": + /// "arn:aws:cloudformation:*:*:stack/*/*" }] } + /// /// The name or the unique stack ID that's associated with the stack. /// /// Parameter [clientRequestToken] : @@ -291,11 +327,10 @@ class CloudFormation { /// /// Parameter [clientRequestToken] : /// A unique identifier for this ContinueUpdateRollback request. - /// Specify this token if you plan to retry requests so that - /// CloudFormationknows that you're not attempting to continue the rollback to - /// a stack with the same name. You might retry - /// ContinueUpdateRollback requests to ensure that CloudFormation - /// successfully received them. + /// Specify this token if you plan to retry requests so that CloudFormation + /// knows that you're not attempting to continue the rollback to a stack with + /// the same name. You might retry ContinueUpdateRollback + /// requests to ensure that CloudFormation successfully received them. /// /// Parameter [resourcesToSkip] : /// A list of the logical IDs of the resources that CloudFormation skips @@ -492,7 +527,7 @@ class CloudFormation { ///
            • ///
            /// For more information, see Acknowledging + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM resources in CloudFormation templates. /// ///
          • @@ -507,9 +542,9 @@ class CloudFormation { /// more macros, and you choose to create a stack directly from the processed /// template, without first reviewing the resulting changes in a change set, /// you must acknowledge this capability. This includes the AWS::Include + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include /// and AWS::Serverless + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless /// transforms, which are macros hosted by CloudFormation. /// /// This capacity doesn't apply to creating change sets, and specifying it @@ -521,10 +556,13 @@ class CloudFormation { /// action, and specifying this capability. /// /// For more information about macros, see Using + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// CloudFormation macros to perform custom processing on templates. ///
          • - ///
          + ///
        + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// /// /// Parameter [changeSetType] : /// The type of change set operation. To create a change set for a new stack, @@ -535,9 +573,8 @@ class CloudFormation { /// If you create a change set for a new stack, CloudFormation creates a stack /// with a unique stack ID, but no template or resources. The stack will be in /// the - /// REVIEW_IN_PROGRESS state until you execute the change - /// set. + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html#d0e11995">REVIEW_IN_PROGRESS + /// state until you execute the change set. /// /// By default, CloudFormation specifies UPDATE. You can't use /// the UPDATE type to create a change set for a new stack or the @@ -553,6 +590,20 @@ class CloudFormation { /// Parameter [description] : /// A description to help you identify this change set. /// + /// Parameter [importExistingResources] : + /// Indicates if the change set imports resources that already exist. + /// + /// This parameter can only import resources that have custom names in + /// templates. For more information, see name + /// type in the CloudFormation User Guide. To import resources that + /// do not accept custom names, such as EC2 instances, use the resource import + /// feature instead. For more information, see Bringing + /// existing resources into CloudFormation management in the + /// CloudFormation User Guide. + /// + /// /// Parameter [includeNestedStacks] : /// Creates a change set for the all nested stacks specified in the template. /// The default behavior of this action is set to False. To @@ -563,6 +614,40 @@ class CloudFormation { /// (Amazon SNS) topics that CloudFormation associates with the stack. To /// remove all associated notification topics, specify an empty list. /// + /// Parameter [onStackFailure] : + /// Determines what action will be taken if stack creation fails. If this + /// parameter is specified, the DisableRollback parameter to the + /// ExecuteChangeSet + /// API operation must not be specified. This must be one of these values: + /// + ///
          + ///
        • + /// DELETE - Deletes the change set if the stack creation fails. + /// This is only valid when the ChangeSetType parameter is set to + /// CREATE. If the deletion of the stack fails, the status of the + /// stack is DELETE_FAILED. + ///
        • + ///
        • + /// DO_NOTHING - if the stack creation fails, do nothing. This is + /// equivalent to specifying true for the + /// DisableRollback parameter to the ExecuteChangeSet + /// API operation. + ///
        • + ///
        • + /// ROLLBACK - if the stack creation fails, roll back the stack. + /// This is equivalent to specifying false for the + /// DisableRollback parameter to the ExecuteChangeSet + /// API operation. + ///
        • + ///
        + /// For nested stacks, when the OnStackFailure parameter is set + /// to DELETE for the change set for the parent stack, any + /// failure in a child stack will cause the parent stack creation to fail and + /// all stacks to be deleted. + /// /// Parameter [parameters] : /// A list of Parameter structures that specify input parameters /// for the change set. For more information, see the Parameter data @@ -579,8 +664,12 @@ class CloudFormation { /// uses this parameter for condition keys in IAM policies for CloudFormation. /// For more information, see Controlling - /// access with Identity and Access Management in the CloudFormation User - /// Guide. + /// access with Identity and Access Management in the CloudFormation + /// User Guide. + /// + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// /// /// Parameter [resourcesToImport] : /// The resources to import into your stack. @@ -623,6 +712,8 @@ class CloudFormation { /// point to a template (max size: 460,800 bytes) that's located in an Amazon /// S3 bucket or a Systems Manager document. CloudFormation generates the /// change set by comparing this template with the stack that you specified. + /// The location for an Amazon S3 bucket must start with + /// https://. /// /// Conditional: You must specify only TemplateBody or /// TemplateURL. @@ -637,8 +728,10 @@ class CloudFormation { ChangeSetType? changeSetType, String? clientToken, String? description, + bool? importExistingResources, bool? includeNestedStacks, List? notificationARNs, + OnStackFailure? onStackFailure, List? parameters, List? resourceTypes, List? resourcesToImport, @@ -657,8 +750,11 @@ class CloudFormation { changeSetType?.also((arg) => $request['ChangeSetType'] = arg.toValue()); clientToken?.also((arg) => $request['ClientToken'] = arg); description?.also((arg) => $request['Description'] = arg); + importExistingResources + ?.also((arg) => $request['ImportExistingResources'] = arg); includeNestedStacks?.also((arg) => $request['IncludeNestedStacks'] = arg); notificationARNs?.also((arg) => $request['NotificationARNs'] = arg); + onStackFailure?.also((arg) => $request['OnStackFailure'] = arg.toValue()); parameters?.also((arg) => $request['Parameters'] = arg); resourceTypes?.also((arg) => $request['ResourceTypes'] = arg); resourcesToImport?.also((arg) => $request['ResourcesToImport'] = arg); @@ -683,9 +779,60 @@ class CloudFormation { return CreateChangeSetOutput.fromXml($result); } + /// Creates a template from existing resources that are not already managed + /// with CloudFormation. You can check the status of the template generation + /// using the DescribeGeneratedTemplate API action. + /// + /// May throw [AlreadyExistsException]. + /// May throw [LimitExceededException]. + /// May throw [ConcurrentResourcesLimitExceededException]. + /// + /// Parameter [generatedTemplateName] : + /// The name assigned to the generated template. + /// + /// Parameter [resources] : + /// An optional list of resources to be included in the generated template. + /// + /// If no resources are specified,the template will be created without any + /// resources. Resources can be added to the template using the + /// UpdateGeneratedTemplate API action. + /// + /// Parameter [stackName] : + /// An optional name or ARN of a stack to use as the base stack for the + /// generated template. + /// + /// Parameter [templateConfiguration] : + /// The configuration details of the generated template, including the + /// DeletionPolicy and UpdateReplacePolicy. + Future createGeneratedTemplate({ + required String generatedTemplateName, + List? resources, + String? stackName, + TemplateConfiguration? templateConfiguration, + }) async { + final $request = {}; + $request['GeneratedTemplateName'] = generatedTemplateName; + resources?.also((arg) => $request['Resources'] = arg); + stackName?.also((arg) => $request['StackName'] = arg); + templateConfiguration + ?.also((arg) => $request['TemplateConfiguration'] = arg); + final $result = await _protocol.send( + $request, + action: 'CreateGeneratedTemplate', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['CreateGeneratedTemplateInput'], + shapes: shapes, + resultWrapper: 'CreateGeneratedTemplateResult', + ); + return CreateGeneratedTemplateOutput.fromXml($result); + } + /// Creates a stack as specified in the template. After the call completes /// successfully, the stack creation starts. You can check the status of the - /// stack through the DescribeStacksoperation. + /// stack through the DescribeStacks operation. /// /// May throw [LimitExceededException]. /// May throw [AlreadyExistsException]. @@ -739,13 +886,11 @@ class CloudFormation { ///
          ///
        • /// - /// AWS::IAM::AccessKey + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html">AWS::IAM::AccessKey ///
        • ///
        • /// - /// AWS::IAM::Group + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html">AWS::IAM::Group ///
        • ///
        • /// ///
        • /// - /// AWS::IAM::Policy + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html">AWS::IAM::Policy ///
        • ///
        • /// - /// AWS::IAM::Role + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html">AWS::IAM::Role ///
        • ///
        • /// - /// AWS::IAM::User + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html">AWS::IAM::User ///
        • ///
        • /// ///
        /// For more information, see Acknowledging + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM Resources in CloudFormation Templates. ///
      • ///
      • @@ -787,9 +929,9 @@ class CloudFormation { /// more macros, and you choose to create a stack directly from the processed /// template, without first reviewing the resulting changes in a change set, /// you must acknowledge this capability. This includes the AWS::Include + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include /// and AWS::Serverless + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless /// transforms, which are macros hosted by CloudFormation. /// /// If you want to create a stack from a stack template that contains macros @@ -804,10 +946,13 @@ class CloudFormation { /// function operation without CloudFormation being notified. /// /// For more information, see Using + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// CloudFormation macros to perform custom processing on templates. ///
      • - ///
      + ///
    + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// /// /// Parameter [clientRequestToken] : /// A unique identifier for this CreateStack request. Specify @@ -843,12 +988,12 @@ class CloudFormation { /// attempts to delete a stack with termination protection enabled, the /// operation fails and the stack remains unchanged. For more information, see /// Protecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html">Protecting /// a Stack From Being Deleted in the CloudFormation User Guide. /// Termination protection is deactivated on stacks by default. /// /// For nested + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">nested /// stacks, termination protection is set on the root stack and can't be /// changed directly on the nested stack. /// @@ -891,6 +1036,17 @@ class CloudFormation { /// policies. For more information, see Controlling /// Access with Identity and Access Management. + /// + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// + /// + /// Parameter [retainExceptOnCreate] : + /// When set to true, newly created resources are deleted when + /// the operation rolls back. This includes newly created resources marked + /// with a deletion policy of Retain. + /// + /// Default: false /// /// Parameter [roleARN] : /// The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) @@ -921,8 +1077,10 @@ class CloudFormation { /// Parameter [stackPolicyURL] : /// Location of a file containing the stack policy. The URL must point to a /// policy (maximum size: 16 KB) located in an S3 bucket in the same Region as - /// the stack. You can specify either the StackPolicyBody or the - /// StackPolicyURL parameter, but not both. + /// the stack. The location for an Amazon S3 bucket must start with + /// https://. You can specify either the + /// StackPolicyBody or the StackPolicyURL parameter, + /// but not both. /// /// Parameter [tags] : /// Key-value pairs to associate with this stack. CloudFormation also @@ -933,7 +1091,7 @@ class CloudFormation { /// Structure containing the template body with a minimum length of 1 byte and /// a maximum length of 51,200 bytes. For more information, go to Template - /// anatomy in the CloudFormation User Guide. + /// anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify either the TemplateBody or the /// TemplateURL parameter, but not both. @@ -943,15 +1101,16 @@ class CloudFormation { /// template (max size: 460,800 bytes) that's located in an Amazon S3 bucket /// or a Systems Manager document. For more information, go to the Template - /// anatomy in the CloudFormation User Guide. + /// anatomy in the CloudFormation User Guide. The location for an + /// Amazon S3 bucket must start with https://. /// /// Conditional: You must specify either the TemplateBody or the /// TemplateURL parameter, but not both. /// /// Parameter [timeoutInMinutes] : /// The amount of time that can pass before the stack status becomes - /// CREATE_FAILED; if DisableRollback is not set or is set to - /// false, the stack will be rolled back. + /// CREATE_FAILED; if DisableRollback is not set or + /// is set to false, the stack will be rolled back. Future createStack({ required String stackName, List? capabilities, @@ -962,6 +1121,7 @@ class CloudFormation { OnFailure? onFailure, List? parameters, List? resourceTypes, + bool? retainExceptOnCreate, String? roleARN, RollbackConfiguration? rollbackConfiguration, String? stackPolicyBody, @@ -989,6 +1149,7 @@ class CloudFormation { onFailure?.also((arg) => $request['OnFailure'] = arg.toValue()); parameters?.also((arg) => $request['Parameters'] = arg); resourceTypes?.also((arg) => $request['ResourceTypes'] = arg); + retainExceptOnCreate?.also((arg) => $request['RetainExceptOnCreate'] = arg); roleARN?.also((arg) => $request['RoleARN'] = arg); rollbackConfiguration ?.also((arg) => $request['RollbackConfiguration'] = arg); @@ -1178,7 +1339,7 @@ class CloudFormation { /// Specify an IAM role only if you are using customized administrator roles /// to control which users or groups can manage specific stack sets within the /// same administrator account. For more information, see Prerequisites: + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html">Prerequisites: /// Granting Permissions for Stack Set Operations in the CloudFormation /// User Guide. /// @@ -1253,13 +1414,11 @@ class CloudFormation { ///
      ///
    • /// - /// AWS::IAM::AccessKey + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html">AWS::IAM::AccessKey ///
    • ///
    • /// - /// AWS::IAM::Group + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html">AWS::IAM::Group ///
    • ///
    • /// ///
    • /// - /// AWS::IAM::Policy + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html">AWS::IAM::Policy ///
    • ///
    • /// - /// AWS::IAM::Role + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html">AWS::IAM::Role ///
    • ///
    • /// - /// AWS::IAM::User + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html">AWS::IAM::User ///
    • ///
    • /// ///
    /// For more information, see Acknowledging + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM Resources in CloudFormation Templates. /// ///
  • @@ -1297,14 +1453,14 @@ class CloudFormation { /// template, without first reviewing the resulting changes in a change set. /// To create the stack set directly, you must acknowledge this capability. /// For more information, see Using + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// CloudFormation Macros to Perform Custom Processing on Templates. /// /// Stack sets with service-managed permissions don't currently support the /// use of macros in templates. (This includes the AWS::Include + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include /// and AWS::Serverless + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless /// transforms, which are macros hosted by CloudFormation.) Even if you /// specify this capability for a stack set with service-managed permissions, /// if you reference a macro in your template the stack set operation will @@ -1383,7 +1539,7 @@ class CloudFormation { /// The structure that contains the template body, with a minimum length of 1 /// byte and a maximum length of 51,200 bytes. For more information, see Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify either the TemplateBody or the TemplateURL /// parameter, but not both. @@ -1394,7 +1550,7 @@ class CloudFormation { /// Amazon S3 bucket or a Systems Manager document. For more information, see /// Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify either the TemplateBody or the TemplateURL /// parameter, but not both. @@ -1448,8 +1604,29 @@ class CloudFormation { return CreateStackSetOutput.fromXml($result); } + /// Deactivates trusted access with Organizations. If trusted access is + /// deactivated, the management account does not have permissions to create + /// and manage service-managed StackSets for your organization. + /// + /// May throw [InvalidOperationException]. + /// May throw [OperationNotFoundException]. + Future deactivateOrganizationsAccess() async { + final $request = {}; + await _protocol.send( + $request, + action: 'DeactivateOrganizationsAccess', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['DeactivateOrganizationsAccessInput'], + shapes: shapes, + resultWrapper: 'DeactivateOrganizationsAccessResult', + ); + } + /// Deactivates a public extension that was previously activated in this - /// account and region. + /// account and Region. /// /// Once deactivated, an extension can't be used in any CloudFormation /// operation. This includes stack update operations where the stack template @@ -1462,7 +1639,7 @@ class CloudFormation { /// /// Parameter [arn] : /// The Amazon Resource Name (ARN) for the extension, in this account and - /// region. + /// Region. /// /// Conditional: You must specify either Arn, or /// TypeName and Type. @@ -1474,7 +1651,7 @@ class CloudFormation { /// TypeName and Type. /// /// Parameter [typeName] : - /// The type name of the extension, in this account and region. If you + /// The type name of the extension, in this account and Region. If you /// specified a type name alias when enabling the extension, use the type name /// alias. /// @@ -1543,6 +1720,30 @@ class CloudFormation { ); } + /// Deleted a generated template. + /// + /// May throw [GeneratedTemplateNotFoundException]. + /// May throw [ConcurrentResourcesLimitExceededException]. + /// + /// Parameter [generatedTemplateName] : + /// The name or Amazon Resource Name (ARN) of a generated template. + Future deleteGeneratedTemplate({ + required String generatedTemplateName, + }) async { + final $request = {}; + $request['GeneratedTemplateName'] = generatedTemplateName; + await _protocol.send( + $request, + action: 'DeleteGeneratedTemplate', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['DeleteGeneratedTemplateInput'], + shapes: shapes, + ); + } + /// Deletes a specified stack. Once the call completes successfully, stack /// deletion starts. Deleted stacks don't show up in the DescribeStacks /// operation if the deletion has been completed successfully. @@ -1574,6 +1775,20 @@ class CloudFormation { /// following format: /// Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. /// + /// Parameter [deletionMode] : + /// Specifies the deletion mode for the stack. Possible values are: + /// + ///
      + ///
    • + /// STANDARD - Use the standard behavior. Specifying this value + /// is the same as not specifying this parameter. + ///
    • + ///
    • + /// FORCE_DELETE_STACK - Delete the stack if it's stuck in a + /// DELETE_FAILED state due to resource deletion failure. + ///
    • + ///
    + /// /// Parameter [retainResources] : /// For stacks in the DELETE_FAILED state, a list of resource /// logical IDs that are associated with the resources you want to retain. @@ -1595,12 +1810,14 @@ class CloudFormation { Future deleteStack({ required String stackName, String? clientRequestToken, + DeletionMode? deletionMode, List? retainResources, String? roleARN, }) async { final $request = {}; $request['StackName'] = stackName; clientRequestToken?.also((arg) => $request['ClientRequestToken'] = arg); + deletionMode?.also((arg) => $request['DeletionMode'] = arg.toValue()); retainResources?.also((arg) => $request['RetainResources'] = arg); roleARN?.also((arg) => $request['RoleARN'] = arg); await _protocol.send( @@ -1879,7 +2096,7 @@ class CloudFormation { /// CloudFormation will make if you execute the change set. For more /// information, see Updating - /// Stacks Using Change Sets in the CloudFormation User Guide. + /// Stacks Using Change Sets in the CloudFormation User Guide. /// /// May throw [ChangeSetNotFoundException]. /// @@ -1887,6 +2104,10 @@ class CloudFormation { /// The name or Amazon Resource Name (ARN) of the change set that you want to /// describe. /// + /// Parameter [includePropertyValues] : + /// If true, the returned changes include detailed changes in the + /// property values. + /// /// Parameter [nextToken] : /// A string (provided by the DescribeChangeSet response output) that /// identifies the next page of information that you want to retrieve. @@ -1896,11 +2117,14 @@ class CloudFormation { /// (ARN) of the change set you want to describe. Future describeChangeSet({ required String changeSetName, + bool? includePropertyValues, String? nextToken, String? stackName, }) async { final $request = {}; $request['ChangeSetName'] = changeSetName; + includePropertyValues + ?.also((arg) => $request['IncludePropertyValues'] = arg); nextToken?.also((arg) => $request['NextToken'] = arg); stackName?.also((arg) => $request['StackName'] = arg); final $result = await _protocol.send( @@ -1963,6 +2187,84 @@ class CloudFormation { return DescribeChangeSetHooksOutput.fromXml($result); } + /// Describes a generated template. The output includes details about the + /// progress of the creation of a generated template started by a + /// CreateGeneratedTemplate API action or the update of a + /// generated template started with an UpdateGeneratedTemplate + /// API action. + /// + /// May throw [GeneratedTemplateNotFoundException]. + /// + /// Parameter [generatedTemplateName] : + /// The name or Amazon Resource Name (ARN) of a generated template. + Future describeGeneratedTemplate({ + required String generatedTemplateName, + }) async { + final $request = {}; + $request['GeneratedTemplateName'] = generatedTemplateName; + final $result = await _protocol.send( + $request, + action: 'DescribeGeneratedTemplate', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['DescribeGeneratedTemplateInput'], + shapes: shapes, + resultWrapper: 'DescribeGeneratedTemplateResult', + ); + return DescribeGeneratedTemplateOutput.fromXml($result); + } + + /// Retrieves information about the account's OrganizationAccess + /// status. This API can be called either by the management account or the + /// delegated administrator by using the CallAs parameter. This + /// API can also be called without the CallAs parameter by the + /// management account. + /// + /// May throw [InvalidOperationException]. + /// May throw [OperationNotFoundException]. + /// + /// Parameter [callAs] : + /// [Service-managed permissions] Specifies whether you are acting as an + /// account administrator in the organization's management account or as a + /// delegated administrator in a member account. + /// + /// By default, SELF is specified. + /// + ///
      + ///
    • + /// If you are signed in to the management account, specify SELF. + ///
    • + ///
    • + /// If you are signed in to a delegated administrator account, specify + /// DELEGATED_ADMIN. + /// + /// Your Amazon Web Services account must be registered as a delegated + /// administrator in the management account. For more information, see Register + /// a delegated administrator in the CloudFormation User Guide. + ///
    • + ///
    + Future describeOrganizationsAccess({ + CallAs? callAs, + }) async { + final $request = {}; + callAs?.also((arg) => $request['CallAs'] = arg.toValue()); + final $result = await _protocol.send( + $request, + action: 'DescribeOrganizationsAccess', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['DescribeOrganizationsAccessInput'], + shapes: shapes, + resultWrapper: 'DescribeOrganizationsAccessResult', + ); + return DescribeOrganizationsAccessOutput.fromXml($result); + } + /// Returns information about a CloudFormation extension publisher. /// /// If you don't supply a PublisherId, and you have registered as @@ -2011,9 +2313,34 @@ class CloudFormation { return DescribePublisherOutput.fromXml($result); } + /// Describes details of a resource scan. + /// + /// May throw [ResourceScanNotFoundException]. + /// + /// Parameter [resourceScanId] : + /// The Amazon Resource Name (ARN) of the resource scan. + Future describeResourceScan({ + required String resourceScanId, + }) async { + final $request = {}; + $request['ResourceScanId'] = resourceScanId; + final $result = await _protocol.send( + $request, + action: 'DescribeResourceScan', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['DescribeResourceScanInput'], + shapes: shapes, + resultWrapper: 'DescribeResourceScanResult', + ); + return DescribeResourceScanOutput.fromXml($result); + } + /// Returns information about a stack drift detection operation. A stack drift /// detection operation detects whether a stack's actual configuration - /// differs, or has drifted, from it's expected configuration, as + /// differs, or has drifted, from its expected configuration, as /// defined in the stack template and any values specified as template /// parameters. A stack is considered to have drifted if one or more of its /// resources have drifted. For more information about stack and resource @@ -2056,9 +2383,9 @@ class CloudFormation { /// Returns all stack related events for a specified stack in reverse /// chronological order. For more information about a stack's event history, - /// go to Stacks - /// in the CloudFormation User Guide. + /// see CloudFormation + /// stack creation events in the CloudFormation User Guide. /// /// You can list events for stacks that have failed to create or have been /// deleted by specifying the unique stack identifier (stack ID). @@ -2103,11 +2430,11 @@ class CloudFormation { return DescribeStackEventsOutput.fromXml($result); } - /// Returns the stack instance that's associated with the specified stack set, - /// Amazon Web Services account, and Region. + /// Returns the stack instance that's associated with the specified StackSet, + /// Amazon Web Services account, and Amazon Web Services Region. /// - /// For a list of stack instances that are associated with a specific stack - /// set, use ListStackInstances. + /// For a list of stack instances that are associated with a specific + /// StackSet, use ListStackInstances. /// /// May throw [StackSetNotFoundException]. /// May throw [StackInstanceNotFoundException]. @@ -2385,7 +2712,7 @@ class CloudFormation { return DescribeStackResourcesOutput.fromXml($result); } - /// Returns the description of the specified stack set. + /// Returns the description of the specified StackSet. /// /// May throw [StackSetNotFoundException]. /// @@ -2435,7 +2762,7 @@ class CloudFormation { return DescribeStackSetOutput.fromXml($result); } - /// Returns the description of the specified stack set operation. + /// Returns the description of the specified StackSet operation. /// /// May throw [StackSetNotFoundException]. /// May throw [OperationNotFoundException]. @@ -2492,9 +2819,12 @@ class CloudFormation { } /// Returns the description for the specified stack; if no stack name was - /// specified, then it returns the description for all the stacks created. + /// specified, then it returns the description for all the stacks created. For + /// more information about a stack's event history, see CloudFormation + /// stack creation events in the CloudFormation User Guide. /// - /// If the stack doesn't exist, an ValidationError is returned. + /// If the stack doesn't exist, a ValidationError is returned. /// /// /// Parameter [nextToken] : @@ -2502,6 +2832,23 @@ class CloudFormation { /// retrieve. /// /// Parameter [stackName] : + /// + /// If you don't pass a parameter to StackName, the API returns a + /// response that describes all resources in the account, which can impact + /// performance. This requires ListStacks and + /// DescribeStacks permissions. + /// + /// Consider using the ListStacks API if you're not passing a parameter + /// to StackName. + /// + /// The IAM policy below can be added to IAM policies when you want to limit + /// resource-level permissions and avoid returning a response when no + /// parameter is sent in the request: + /// + /// { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": + /// "cloudformation:DescribeStacks", "NotResource": + /// "arn:aws:cloudformation:*:*:stack/*/*" }] } + /// /// The name or the unique stack ID that's associated with the stack, which /// aren't always interchangeable: /// @@ -2612,13 +2959,12 @@ class CloudFormation { /// Returns information about an extension's registration, including its /// current status and type and version identifiers. /// - /// When you initiate a registration request using RegisterType - /// , you can then use DescribeTypeRegistration - /// to monitor the progress of that registration request. + /// When you initiate a registration request using RegisterType, you + /// can then use DescribeTypeRegistration to monitor the progress of + /// that registration request. /// - /// Once the registration request has completed, use - /// DescribeType to return detailed information about an - /// extension. + /// Once the registration request has completed, use DescribeType to + /// return detailed information about an extension. /// /// May throw [CFNRegistryException]. /// @@ -2626,7 +2972,7 @@ class CloudFormation { /// The identifier for this registration request. /// /// This registration token is generated by CloudFormation when you initiate a - /// registration request using RegisterType . + /// registration request using RegisterType. Future describeTypeRegistration({ required String registrationToken, }) async { @@ -2647,7 +2993,7 @@ class CloudFormation { } /// Detects whether a stack's actual configuration differs, or has - /// drifted, from it's expected configuration, as defined in the stack + /// drifted, from its expected configuration, as defined in the stack /// template and any values specified as template parameters. For each /// resource in the stack that supports drift detection, CloudFormation /// compares the actual configuration of the resource with its expected @@ -2705,7 +3051,7 @@ class CloudFormation { } /// Returns information about whether a resource's actual configuration - /// differs, or has drifted, from it's expected configuration, as + /// differs, or has drifted, from its expected configuration, as /// defined in the stack template and any values specified as template /// parameters. This information includes actual and expected property values /// for resources in which CloudFormation detects drift. Only resource @@ -2756,31 +3102,31 @@ class CloudFormation { /// CloudFormation performs drift detection on a stack set. /// /// DetectStackSetDrift returns the OperationId of - /// the stack set drift detection operation. Use this operation id with - /// DescribeStackSetOperation to monitor the progress of the - /// drift detection operation. The drift detection operation may take some - /// time, depending on the number of stack instances included in the stack - /// set, in addition to the number of resources included in each stack. + /// the stack set drift detection operation. Use this operation id with + /// DescribeStackSetOperation to monitor the progress of the drift + /// detection operation. The drift detection operation may take some time, + /// depending on the number of stack instances included in the stack set, in + /// addition to the number of resources included in each stack. /// /// Once the operation has completed, use the following actions to return /// drift information: /// ///
      ///
    • - /// Use DescribeStackSet to return detailed information - /// about the stack set, including detailed information about the last - /// completed drift operation performed on the stack set. (Information - /// about drift operations that are in progress isn't included.) + /// Use DescribeStackSet to return detailed information about the stack + /// set, including detailed information about the last completed drift + /// operation performed on the stack set. (Information about drift operations + /// that are in progress isn't included.) ///
    • ///
    • - /// Use ListStackInstances to return a list of stack - /// instances belonging to the stack set, including the drift status and last - /// drift time checked of each instance. + /// Use ListStackInstances to return a list of stack instances + /// belonging to the stack set, including the drift status and last drift time + /// checked of each instance. ///
    • ///
    • - /// Use DescribeStackInstance to return detailed - /// information about a specific stack instance, including its drift status - /// and last drift time checked. + /// Use DescribeStackInstance to return detailed information about a + /// specific stack instance, including its drift status and last drift time + /// checked. ///
    • ///
    /// For more information about performing a drift detection operation on a @@ -2791,8 +3137,8 @@ class CloudFormation { /// You can only run a single drift detection operation on a given stack set /// at one time. /// - /// To stop a drift detection stack set operation, use - /// StopStackSetOperation . + /// To stop a drift detection stack set operation, use + /// StopStackSetOperation. /// /// May throw [InvalidOperationException]. /// May throw [OperationInProgressException]. @@ -2827,6 +3173,15 @@ class CloudFormation { /// /// Parameter [operationId] : /// The ID of the stack set operation. + /// + /// Parameter [operationPreferences] : + /// The user-specified preferences for how CloudFormation performs a stack set + /// operation. + /// + /// For more information about maximum concurrent accounts and failure + /// tolerance, see Stack + /// set operation options. Future detectStackSetDrift({ required String stackSetName, CallAs? callAs, @@ -2863,7 +3218,7 @@ class CloudFormation { /// Structure containing the template body with a minimum length of 1 byte and /// a maximum length of 51,200 bytes. (For more information, go to Template - /// Anatomy in the CloudFormation User Guide.) + /// Anatomy in the CloudFormation User Guide.) /// /// Conditional: You must pass TemplateBody or /// TemplateURL. If both are passed, only @@ -2874,7 +3229,8 @@ class CloudFormation { /// template that's located in an Amazon S3 bucket or a Systems Manager /// document. For more information, go to Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. The location for an + /// Amazon S3 bucket must start with https://. /// /// Conditional: You must pass TemplateURL or /// TemplateBody. If both are passed, only @@ -2936,10 +3292,36 @@ class CloudFormation { /// /// Parameter [disableRollback] : /// Preserves the state of previously provisioned resources when an operation - /// fails. + /// fails. This parameter can't be specified when the + /// OnStackFailure parameter to the CreateChangeSet + /// API operation was specified. /// + ///
      + ///
    • + /// True - if the stack creation fails, do nothing. This is + /// equivalent to specifying DO_NOTHING for the + /// OnStackFailure parameter to the CreateChangeSet + /// API operation. + ///
    • + ///
    • + /// False - if the stack creation fails, roll back the stack. + /// This is equivalent to specifying ROLLBACK for the + /// OnStackFailure parameter to the CreateChangeSet + /// API operation. + ///
    • + ///
    /// Default: True /// + /// Parameter [retainExceptOnCreate] : + /// When set to true, newly created resources are deleted when + /// the operation rolls back. This includes newly created resources marked + /// with a deletion policy of Retain. + /// + /// Default: false + /// /// Parameter [stackName] : /// If you specified the name of a change set, specify the stack name or /// Amazon Resource Name (ARN) that's associated with the change set you want @@ -2948,12 +3330,14 @@ class CloudFormation { required String changeSetName, String? clientRequestToken, bool? disableRollback, + bool? retainExceptOnCreate, String? stackName, }) async { final $request = {}; $request['ChangeSetName'] = changeSetName; clientRequestToken?.also((arg) => $request['ClientRequestToken'] = arg); disableRollback?.also((arg) => $request['DisableRollback'] = arg); + retainExceptOnCreate?.also((arg) => $request['RetainExceptOnCreate'] = arg); stackName?.also((arg) => $request['StackName'] = arg); await _protocol.send( $request, @@ -2968,6 +3352,55 @@ class CloudFormation { ); } + /// Retrieves a generated template. If the template is in an + /// InProgress or Pending status then the template + /// returned will be the template when the template was last in a + /// Complete status. If the template has not yet been in a + /// Complete status then an empty template will be returned. + /// + /// May throw [GeneratedTemplateNotFoundException]. + /// + /// Parameter [generatedTemplateName] : + /// The name or Amazon Resource Name (ARN) of the generated template. The + /// format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. + /// For example, + /// arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc + /// . + /// + /// Parameter [format] : + /// The language to use to retrieve for the generated template. Supported + /// values are: + /// + ///
      + ///
    • + /// JSON + ///
    • + ///
    • + /// YAML + ///
    • + ///
    + Future getGeneratedTemplate({ + required String generatedTemplateName, + TemplateFormat? format, + }) async { + final $request = {}; + $request['GeneratedTemplateName'] = generatedTemplateName; + format?.also((arg) => $request['Format'] = arg.toValue()); + final $result = await _protocol.send( + $request, + action: 'GetGeneratedTemplate', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['GetGeneratedTemplateInput'], + shapes: shapes, + resultWrapper: 'GetGeneratedTemplateResult', + ); + return GetGeneratedTemplateOutput.fromXml($result); + } + /// Returns the stack policy for a specified stack. If a stack doesn't have a /// policy, a null value is returned. /// @@ -3116,19 +3549,23 @@ class CloudFormation { /// a maximum length of 51,200 bytes. For more information about templates, /// see Template - /// anatomy in the CloudFormation User Guide. + /// anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify only one of the following parameters: /// StackName, StackSetName, /// TemplateBody, or TemplateURL. /// + /// Parameter [templateSummaryConfig] : + /// Specifies options for the GetTemplateSummary API action. + /// /// Parameter [templateURL] : /// Location of file containing the template body. The URL must point to a /// template (max size: 460,800 bytes) that's located in an Amazon S3 bucket /// or a Systems Manager document. For more information about templates, see /// Template - /// anatomy in the CloudFormation User Guide. + /// anatomy in the CloudFormation User Guide. The location for an + /// Amazon S3 bucket must start with https://. /// /// Conditional: You must specify only one of the following parameters: /// StackName, StackSetName, @@ -3138,6 +3575,7 @@ class CloudFormation { String? stackName, String? stackSetName, String? templateBody, + TemplateSummaryConfig? templateSummaryConfig, String? templateURL, }) async { final $request = {}; @@ -3145,6 +3583,8 @@ class CloudFormation { stackName?.also((arg) => $request['StackName'] = arg); stackSetName?.also((arg) => $request['StackSetName'] = arg); templateBody?.also((arg) => $request['TemplateBody'] = arg); + templateSummaryConfig + ?.also((arg) => $request['TemplateSummaryConfig'] = arg); templateURL?.also((arg) => $request['TemplateURL'] = arg); final $result = await _protocol.send( $request, @@ -3164,10 +3604,6 @@ class CloudFormation { /// operation to import up to 10 stacks into a new stack set in the same /// account as the source stack or in a different administrator account and /// Region, by specifying the stack ID of the stack you intend to import. - /// - /// ImportStacksToStackSet is only supported by self-managed - /// permissions. - /// /// /// May throw [LimitExceededException]. /// May throw [StackSetNotFoundException]. @@ -3197,6 +3633,15 @@ class CloudFormation { /// Parameter [operationId] : /// A unique, user defined, identifier for the stack set operation. /// + /// Parameter [operationPreferences] : + /// The user-specified preferences for how CloudFormation performs a stack set + /// operation. + /// + /// For more information about maximum concurrent accounts and failure + /// tolerance, see Stack + /// set operation options. + /// /// Parameter [organizationalUnitIds] : /// The list of OU ID's to which the stacks being imported has to be mapped as /// deployment target. @@ -3279,7 +3724,7 @@ class CloudFormation { /// call this action. Use this action to see the exported output values that /// you can import into other stacks. To import values, use the - /// Fn::ImportValue function. + /// Fn::ImportValue function. /// /// For more information, see @@ -3308,14 +3753,52 @@ class CloudFormation { return ListExportsOutput.fromXml($result); } + /// Lists your generated templates in this Region. + /// + /// Parameter [maxResults] : + /// If the number of available results exceeds this maximum, the response + /// includes a NextToken value that you can use for the + /// NextToken parameter to get the next set of results. By + /// default the ListGeneratedTemplates API action will return at + /// most 50 results in each response. The maximum value is 100. + /// + /// Parameter [nextToken] : + /// A string that identifies the next page of resource scan results. + Future listGeneratedTemplates({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $request = {}; + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + final $result = await _protocol.send( + $request, + action: 'ListGeneratedTemplates', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListGeneratedTemplatesInput'], + shapes: shapes, + resultWrapper: 'ListGeneratedTemplatesResult', + ); + return ListGeneratedTemplatesOutput.fromXml($result); + } + /// Lists all stacks that are importing an exported output value. To modify or /// remove an exported output value, first use this action to see which stacks /// are using it. To see the exported output values in your account, see /// ListExports. /// /// For more information about importing an exported output value, see the - /// Fn::ImportValue function. + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html">Fn::ImportValue + /// function. /// /// Parameter [exportName] : /// The name of the exported output value. CloudFormation returns the stack @@ -3346,6 +3829,285 @@ class CloudFormation { return ListImportsOutput.fromXml($result); } + /// Lists the related resources for a list of resources from a resource scan. + /// The response indicates whether each returned resource is already managed + /// by CloudFormation. + /// + /// May throw [ResourceScanNotFoundException]. + /// May throw [ResourceScanInProgressException]. + /// + /// Parameter [resourceScanId] : + /// The Amazon Resource Name (ARN) of the resource scan. + /// + /// Parameter [resources] : + /// The list of resources for which you want to get the related resources. Up + /// to 100 resources can be provided. + /// + /// Parameter [maxResults] : + /// If the number of available results exceeds this maximum, the response + /// includes a NextToken value that you can use for the + /// NextToken parameter to get the next set of results. By + /// default the ListResourceScanRelatedResources API action will + /// return up to 100 results in each response. The maximum value is 100. + /// + /// Parameter [nextToken] : + /// A string that identifies the next page of resource scan results. + Future + listResourceScanRelatedResources({ + required String resourceScanId, + required List resources, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $request = {}; + $request['ResourceScanId'] = resourceScanId; + $request['Resources'] = resources; + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + final $result = await _protocol.send( + $request, + action: 'ListResourceScanRelatedResources', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListResourceScanRelatedResourcesInput'], + shapes: shapes, + resultWrapper: 'ListResourceScanRelatedResourcesResult', + ); + return ListResourceScanRelatedResourcesOutput.fromXml($result); + } + + /// Lists the resources from a resource scan. The results can be filtered by + /// resource identifier, resource type prefix, tag key, and tag value. Only + /// resources that match all specified filters are returned. The response + /// indicates whether each returned resource is already managed by + /// CloudFormation. + /// + /// May throw [ResourceScanNotFoundException]. + /// May throw [ResourceScanInProgressException]. + /// + /// Parameter [resourceScanId] : + /// The Amazon Resource Name (ARN) of the resource scan. + /// + /// Parameter [maxResults] : + /// If the number of available results exceeds this maximum, the response + /// includes a NextToken value that you can use for the + /// NextToken parameter to get the next set of results. By + /// default the ListResourceScanResources API action will return + /// at most 100 results in each response. The maximum value is 100. + /// + /// Parameter [nextToken] : + /// A string that identifies the next page of resource scan results. + /// + /// Parameter [resourceIdentifier] : + /// If specified, the returned resources will have the specified resource + /// identifier (or one of them in the case where the resource has multiple + /// identifiers). + /// + /// Parameter [resourceTypePrefix] : + /// If specified, the returned resources will be of any of the resource types + /// with the specified prefix. + /// + /// Parameter [tagKey] : + /// If specified, the returned resources will have a matching tag key. + /// + /// Parameter [tagValue] : + /// If specified, the returned resources will have a matching tag value. + Future listResourceScanResources({ + required String resourceScanId, + int? maxResults, + String? nextToken, + String? resourceIdentifier, + String? resourceTypePrefix, + String? tagKey, + String? tagValue, + }) async { + final $request = {}; + $request['ResourceScanId'] = resourceScanId; + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + resourceIdentifier?.also((arg) => $request['ResourceIdentifier'] = arg); + resourceTypePrefix?.also((arg) => $request['ResourceTypePrefix'] = arg); + tagKey?.also((arg) => $request['TagKey'] = arg); + tagValue?.also((arg) => $request['TagValue'] = arg); + final $result = await _protocol.send( + $request, + action: 'ListResourceScanResources', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListResourceScanResourcesInput'], + shapes: shapes, + resultWrapper: 'ListResourceScanResourcesResult', + ); + return ListResourceScanResourcesOutput.fromXml($result); + } + + /// List the resource scans from newest to oldest. By default it will return + /// up to 10 resource scans. + /// + /// Parameter [maxResults] : + /// If the number of available results exceeds this maximum, the response + /// includes a NextToken value that you can use for the + /// NextToken parameter to get the next set of results. The + /// default value is 10. The maximum value is 100. + /// + /// Parameter [nextToken] : + /// A string that identifies the next page of resource scan results. + Future listResourceScans({ + int? maxResults, + String? nextToken, + }) async { + final $request = {}; + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + final $result = await _protocol.send( + $request, + action: 'ListResourceScans', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListResourceScansInput'], + shapes: shapes, + resultWrapper: 'ListResourceScansResult', + ); + return ListResourceScansOutput.fromXml($result); + } + + /// Returns drift information for resources in a stack instance. + /// + /// ListStackInstanceResourceDrifts returns drift information for + /// the most recent drift detection operation. If an operation is in progress, + /// it may only return partial results. + /// + /// + /// May throw [StackSetNotFoundException]. + /// May throw [StackInstanceNotFoundException]. + /// May throw [OperationNotFoundException]. + /// + /// Parameter [operationId] : + /// The unique ID of the drift operation. + /// + /// Parameter [stackInstanceAccount] : + /// The name of the Amazon Web Services account that you want to list resource + /// drifts for. + /// + /// Parameter [stackInstanceRegion] : + /// The name of the Region where you want to list resource drifts. + /// + /// Parameter [stackSetName] : + /// The name or unique ID of the stack set that you want to list drifted + /// resources for. + /// + /// Parameter [callAs] : + /// [Service-managed permissions] Specifies whether you are acting as an + /// account administrator in the organization's management account or as a + /// delegated administrator in a member account. + /// + /// By default, SELF is specified. Use SELF for + /// stack sets with self-managed permissions. + /// + ///
      + ///
    • + /// If you are signed in to the management account, specify SELF. + ///
    • + ///
    • + /// If you are signed in to a delegated administrator account, specify + /// DELEGATED_ADMIN. + /// + /// Your Amazon Web Services account must be registered as a delegated + /// administrator in the management account. For more information, see Register + /// a delegated administrator in the CloudFormation User Guide. + ///
    • + ///
    + /// + /// Parameter [maxResults] : + /// The maximum number of results to be returned with a single call. If the + /// number of available results exceeds this maximum, the response includes a + /// NextToken value that you can assign to the + /// NextToken request parameter to get the next set of results. + /// + /// Parameter [nextToken] : + /// If the previous paginated request didn't return all of the remaining + /// results, the response object's NextToken parameter value is + /// set to a token. To retrieve the next set of results, call this action + /// again and assign that token to the request object's NextToken + /// parameter. If there are no remaining results, the previous response + /// object's NextToken parameter is set to null. + /// + /// Parameter [stackInstanceResourceDriftStatuses] : + /// The resource drift status of the stack instance. + /// + ///
      + ///
    • + /// DELETED: The resource differs from its expected template + /// configuration in that the resource has been deleted. + ///
    • + ///
    • + /// MODIFIED: One or more resource properties differ from their + /// expected template values. + ///
    • + ///
    • + /// IN_SYNC: The resource's actual configuration matches its + /// expected template configuration. + ///
    • + ///
    • + /// NOT_CHECKED: CloudFormation doesn't currently return this + /// value. + ///
    • + ///
    + Future + listStackInstanceResourceDrifts({ + required String operationId, + required String stackInstanceAccount, + required String stackInstanceRegion, + required String stackSetName, + CallAs? callAs, + int? maxResults, + String? nextToken, + List? stackInstanceResourceDriftStatuses, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $request = {}; + $request['OperationId'] = operationId; + $request['StackInstanceAccount'] = stackInstanceAccount; + $request['StackInstanceRegion'] = stackInstanceRegion; + $request['StackSetName'] = stackSetName; + callAs?.also((arg) => $request['CallAs'] = arg.toValue()); + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + stackInstanceResourceDriftStatuses?.also((arg) => + $request['StackInstanceResourceDriftStatuses'] = + arg.map((e) => e.toValue()).toList()); + final $result = await _protocol.send( + $request, + action: 'ListStackInstanceResourceDrifts', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListStackInstanceResourceDriftsInput'], + shapes: shapes, + resultWrapper: 'ListStackInstanceResourceDriftsResult', + ); + return ListStackInstanceResourceDriftsOutput.fromXml($result); + } + /// Returns summary information about stack instances that are associated with /// the specified stack set. You can filter for stack instances that are /// associated with a specific Amazon Web Services account name or Region, or @@ -3484,6 +4246,78 @@ class CloudFormation { return ListStackResourcesOutput.fromXml($result); } + /// Returns summary information about deployment targets for a stack set. + /// + /// May throw [StackSetNotFoundException]. + /// + /// Parameter [stackSetName] : + /// The name or unique ID of the stack set that you want to get automatic + /// deployment targets for. + /// + /// Parameter [callAs] : + /// Specifies whether you are acting as an account administrator in the + /// organization's management account or as a delegated administrator in a + /// member account. + /// + /// By default, SELF is specified. Use SELF for + /// StackSets with self-managed permissions. + /// + ///
      + ///
    • + /// If you are signed in to the management account, specify SELF. + ///
    • + ///
    • + /// If you are signed in to a delegated administrator account, specify + /// DELEGATED_ADMIN. + /// + /// Your Amazon Web Services account must be registered as a delegated + /// administrator in the management account. For more information, see Register + /// a delegated administrator in the CloudFormation User Guide. + ///
    • + ///
    + /// + /// Parameter [maxResults] : + /// The maximum number of results to be returned with a single call. If the + /// number of available results exceeds this maximum, the response includes a + /// NextToken value that you can assign to the + /// NextToken request parameter to get the next set of results. + /// + /// Parameter [nextToken] : + /// A string that identifies the next page of stack set deployment targets + /// that you want to retrieve. + Future + listStackSetAutoDeploymentTargets({ + required String stackSetName, + CallAs? callAs, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $request = {}; + $request['StackSetName'] = stackSetName; + callAs?.also((arg) => $request['CallAs'] = arg.toValue()); + maxResults?.also((arg) => $request['MaxResults'] = arg); + nextToken?.also((arg) => $request['NextToken'] = arg); + final $result = await _protocol.send( + $request, + action: 'ListStackSetAutoDeploymentTargets', + version: '2010-05-15', + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + shape: shapes['ListStackSetAutoDeploymentTargetsInput'], + shapes: shapes, + resultWrapper: 'ListStackSetAutoDeploymentTargetsResult', + ); + return ListStackSetAutoDeploymentTargetsOutput.fromXml($result); + } + /// Returns summary information about the results of a stack set operation. /// /// May throw [StackSetNotFoundException]. @@ -4035,14 +4869,14 @@ class CloudFormation { /// /// For more information, see Acknowledging + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM Resources in CloudFormation Templates. ///
  • ///
  • @@ -5034,9 +5968,9 @@ class CloudFormation { /// more macros, and you choose to update a stack directly from the processed /// template, without first reviewing the resulting changes in a change set, /// you must acknowledge this capability. This includes the AWS::Include + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include /// and AWS::Serverless + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless /// transforms, which are macros hosted by CloudFormation. /// /// If you want to update a stack from a stack template that contains macros @@ -5051,10 +5985,13 @@ class CloudFormation { /// function operation without CloudFormation being notified. /// /// For more information, see Using + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// CloudFormation Macros to Perform Custom Processing on Templates. ///
  • - /// + /// + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// /// /// Parameter [clientRequestToken] : /// A unique identifier for this UpdateStack request. Specify @@ -5107,6 +6044,17 @@ class CloudFormation { /// policies. For more information, see Controlling /// Access with Identity and Access Management. + /// + /// Only one of the Capabilities and ResourceType + /// parameters can be specified. + /// + /// + /// Parameter [retainExceptOnCreate] : + /// When set to true, newly created resources are deleted when + /// the operation rolls back. This includes newly created resources marked + /// with a deletion policy of Retain. + /// + /// Default: false /// /// Parameter [roleARN] : /// The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) @@ -5149,7 +6097,8 @@ class CloudFormation { /// Parameter [stackPolicyDuringUpdateURL] : /// Location of a file containing the temporary overriding stack policy. The /// URL must point to a policy (max size: 16KB) located in an S3 bucket in the - /// same Region as the stack. You can specify either the + /// same Region as the stack. The location for an Amazon S3 bucket must start + /// with https://. You can specify either the /// StackPolicyDuringUpdateBody or the /// StackPolicyDuringUpdateURL parameter, but not both. /// @@ -5160,8 +6109,10 @@ class CloudFormation { /// Parameter [stackPolicyURL] : /// Location of a file containing the updated stack policy. The URL must point /// to a policy (max size: 16KB) located in an S3 bucket in the same Region as - /// the stack. You can specify either the StackPolicyBody or the - /// StackPolicyURL parameter, but not both. + /// the stack. The location for an Amazon S3 bucket must start with + /// https://. You can specify either the + /// StackPolicyBody or the StackPolicyURL parameter, + /// but not both. /// /// You might update the stack policy, for example, in order to protect a new /// resource that you created during a stack update. If you don't specify a @@ -5181,7 +6132,7 @@ class CloudFormation { /// Structure containing the template body with a minimum length of 1 byte and /// a maximum length of 51,200 bytes. (For more information, go to Template - /// Anatomy in the CloudFormation User Guide.) + /// Anatomy in the CloudFormation User Guide.) /// /// Conditional: You must specify only one of the following parameters: /// TemplateBody, TemplateURL, or set the @@ -5192,7 +6143,8 @@ class CloudFormation { /// template that's located in an Amazon S3 bucket or a Systems Manager /// document. For more information, go to Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. The location for an + /// Amazon S3 bucket must start with https://. /// /// Conditional: You must specify only one of the following parameters: /// TemplateBody, TemplateURL, or set the @@ -5213,6 +6165,7 @@ class CloudFormation { List? notificationARNs, List? parameters, List? resourceTypes, + bool? retainExceptOnCreate, String? roleARN, RollbackConfiguration? rollbackConfiguration, String? stackPolicyBody, @@ -5233,6 +6186,7 @@ class CloudFormation { notificationARNs?.also((arg) => $request['NotificationARNs'] = arg); parameters?.also((arg) => $request['Parameters'] = arg); resourceTypes?.also((arg) => $request['ResourceTypes'] = arg); + retainExceptOnCreate?.also((arg) => $request['RetainExceptOnCreate'] = arg); roleARN?.also((arg) => $request['RoleARN'] = arg); rollbackConfiguration ?.also((arg) => $request['RollbackConfiguration'] = arg); @@ -5477,7 +6431,7 @@ class CloudFormation { /// Specify an IAM role only if you are using customized administrator roles /// to control which users or groups can manage specific stack sets within the /// same administrator account. For more information, see Granting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html">Granting /// Permissions for Stack Set Operations in the CloudFormation User /// Guide. /// @@ -5555,42 +6509,35 @@ class CloudFormation { ///
      ///
    • /// - /// AWS::IAM::AccessKey + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html">AWS::IAM::AccessKey ///
    • ///
    • /// - /// AWS::IAM::Group + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html">AWS::IAM::Group ///
    • ///
    • /// - /// AWS::IAM::InstanceProfile + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html">AWS::IAM::InstanceProfile ///
    • ///
    • /// - /// AWS::IAM::Policy + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html">AWS::IAM::Policy ///
    • ///
    • /// - /// AWS::IAM::Role + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html">AWS::IAM::Role ///
    • ///
    • /// - /// AWS::IAM::User + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html">AWS::IAM::User ///
    • ///
    • /// - /// AWS::IAM::UserToGroupAddition + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html">AWS::IAM::UserToGroupAddition ///
    • ///
    /// For more information, see Acknowledging + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities">Acknowledging /// IAM Resources in CloudFormation Templates. /// ///
  • @@ -5601,14 +6548,14 @@ class CloudFormation { /// template, without first reviewing the resulting changes in a change set. /// To update the stack set directly, you must acknowledge this capability. /// For more information, see Using + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html">Using /// CloudFormation Macros to Perform Custom Processing on Templates. /// /// Stack sets with service-managed permissions do not currently support the /// use of macros in templates. (This includes the AWS::Include + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html">AWS::Include /// and AWS::Serverless + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html">AWS::Serverless /// transforms, which are macros hosted by CloudFormation.) Even if you /// specify this capability for a stack set with service-managed permissions, /// if you reference a macro in your template the stack set operation will @@ -5757,7 +6704,7 @@ class CloudFormation { /// The structure that contains the template body, with a minimum length of 1 /// byte and a maximum length of 51,200 bytes. For more information, see Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify only one of the following parameters: /// TemplateBody or TemplateURL—or set @@ -5769,7 +6716,7 @@ class CloudFormation { /// Amazon S3 bucket or a Systems Manager document. For more information, see /// Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. /// /// Conditional: You must specify only one of the following parameters: /// TemplateBody or TemplateURL—or set @@ -5886,7 +6833,7 @@ class CloudFormation { /// Structure containing the template body with a minimum length of 1 byte and /// a maximum length of 51,200 bytes. For more information, go to Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. /// /// Conditional: You must pass TemplateURL or /// TemplateBody. If both are passed, only @@ -5897,7 +6844,8 @@ class CloudFormation { /// template (max size: 460,800 bytes) that is located in an Amazon S3 bucket /// or a Systems Manager document. For more information, go to Template - /// Anatomy in the CloudFormation User Guide. + /// Anatomy in the CloudFormation User Guide. The location for an + /// Amazon S3 bucket must start with https://. /// /// Conditional: You must pass TemplateURL or /// TemplateBody. If both are passed, only @@ -6127,9 +7075,22 @@ class AccountLimit { } } +class ActivateOrganizationsAccessOutput { + ActivateOrganizationsAccessOutput(); + factory ActivateOrganizationsAccessOutput.fromXml( + // ignore: avoid_unused_constructor_parameters + _s.XmlElement elem) { + return ActivateOrganizationsAccessOutput(); + } + + Map toJson() { + return {}; + } +} + class ActivateTypeOutput { /// The Amazon Resource Name (ARN) of the activated extension, in this account - /// and region. + /// and Region. final String? arn; ActivateTypeOutput({ @@ -6149,6 +7110,39 @@ class ActivateTypeOutput { } } +enum AttributeChangeType { + add, + remove, + modify, +} + +extension AttributeChangeTypeValueExtension on AttributeChangeType { + String toValue() { + switch (this) { + case AttributeChangeType.add: + return 'Add'; + case AttributeChangeType.remove: + return 'Remove'; + case AttributeChangeType.modify: + return 'Modify'; + } + } +} + +extension AttributeChangeTypeFromString on String { + AttributeChangeType toAttributeChangeType() { + switch (this) { + case 'Add': + return AttributeChangeType.add; + case 'Remove': + return AttributeChangeType.remove; + case 'Modify': + return AttributeChangeType.modify; + } + throw Exception('$this is not known in enum AttributeChangeType'); + } +} + /// [Service-managed permissions] Describes whether StackSets automatically /// deploys to Organizations accounts that are added to a target organization or /// organizational unit (OU). @@ -6197,6 +7191,8 @@ class BatchDescribeTypeConfigurationsError { /// The error message. final String? errorMessage; + + /// Identifying information for the configuration of a CloudFormation extension. final TypeConfigurationIdentifier? typeConfigurationIdentifier; BatchDescribeTypeConfigurationsError({ @@ -6388,8 +7384,13 @@ class Change { /// action that CloudFormation will perform. final ResourceChange? resourceChange; - /// The type of entity that CloudFormation changes. Currently, the only entity - /// type is Resource. + /// The type of entity that CloudFormation changes. + /// + ///
      + ///
    • + /// Resource This change is for a resource. + ///
    • + ///
    final ChangeType? type; Change({ @@ -6425,7 +7426,7 @@ enum ChangeAction { modify, remove, import, - dynamic, + $dynamic, } extension ChangeActionValueExtension on ChangeAction { @@ -6439,7 +7440,7 @@ extension ChangeActionValueExtension on ChangeAction { return 'Remove'; case ChangeAction.import: return 'Import'; - case ChangeAction.dynamic: + case ChangeAction.$dynamic: return 'Dynamic'; } } @@ -6457,7 +7458,7 @@ extension ChangeActionFromString on String { case 'Import': return ChangeAction.import; case 'Dynamic': - return ChangeAction.dynamic; + return ChangeAction.$dynamic; } throw Exception('$this is not known in enum ChangeAction'); } @@ -6749,6 +7750,9 @@ class ChangeSetSummary { /// or in an OBSOLETE state because the stack was already updated. final ExecutionStatus? executionStatus; + /// Indicates if the change set imports resources that already exist. + final bool? importExistingResources; + /// Specifies the current setting of IncludeNestedStacks for the /// change set. final bool? includeNestedStacks; @@ -6779,6 +7783,7 @@ class ChangeSetSummary { this.creationTime, this.description, this.executionStatus, + this.importExistingResources, this.includeNestedStacks, this.parentChangeSetId, this.rootChangeSetId, @@ -6796,6 +7801,8 @@ class ChangeSetSummary { executionStatus: _s .extractXmlStringValue(elem, 'ExecutionStatus') ?.toExecutionStatus(), + importExistingResources: + _s.extractXmlBoolValue(elem, 'ImportExistingResources'), includeNestedStacks: _s.extractXmlBoolValue(elem, 'IncludeNestedStacks'), parentChangeSetId: _s.extractXmlStringValue(elem, 'ParentChangeSetId'), rootChangeSetId: _s.extractXmlStringValue(elem, 'RootChangeSetId'), @@ -6812,6 +7819,7 @@ class ChangeSetSummary { final creationTime = this.creationTime; final description = this.description; final executionStatus = this.executionStatus; + final importExistingResources = this.importExistingResources; final includeNestedStacks = this.includeNestedStacks; final parentChangeSetId = this.parentChangeSetId; final rootChangeSetId = this.rootChangeSetId; @@ -6825,6 +7833,8 @@ class ChangeSetSummary { if (creationTime != null) 'CreationTime': iso8601ToJson(creationTime), if (description != null) 'Description': description, if (executionStatus != null) 'ExecutionStatus': executionStatus.toValue(), + if (importExistingResources != null) + 'ImportExistingResources': importExistingResources, if (includeNestedStacks != null) 'IncludeNestedStacks': includeNestedStacks, if (parentChangeSetId != null) 'ParentChangeSetId': parentChangeSetId, @@ -6936,6 +7946,34 @@ extension ChangeTypeFromString on String { } } +enum ConcurrencyMode { + strictFailureTolerance, + softFailureTolerance, +} + +extension ConcurrencyModeValueExtension on ConcurrencyMode { + String toValue() { + switch (this) { + case ConcurrencyMode.strictFailureTolerance: + return 'STRICT_FAILURE_TOLERANCE'; + case ConcurrencyMode.softFailureTolerance: + return 'SOFT_FAILURE_TOLERANCE'; + } + } +} + +extension ConcurrencyModeFromString on String { + ConcurrencyMode toConcurrencyMode() { + switch (this) { + case 'STRICT_FAILURE_TOLERANCE': + return ConcurrencyMode.strictFailureTolerance; + case 'SOFT_FAILURE_TOLERANCE': + return ConcurrencyMode.softFailureTolerance; + } + throw Exception('$this is not known in enum ConcurrencyMode'); + } +} + /// The output for a ContinueUpdateRollback operation. class ContinueUpdateRollbackOutput { ContinueUpdateRollbackOutput(); @@ -6979,6 +8017,29 @@ class CreateChangeSetOutput { } } +class CreateGeneratedTemplateOutput { + /// The ID of the generated template. + final String? generatedTemplateId; + + CreateGeneratedTemplateOutput({ + this.generatedTemplateId, + }); + factory CreateGeneratedTemplateOutput.fromXml(_s.XmlElement elem) { + return CreateGeneratedTemplateOutput( + generatedTemplateId: + _s.extractXmlStringValue(elem, 'GeneratedTemplateId'), + ); + } + + Map toJson() { + final generatedTemplateId = this.generatedTemplateId; + return { + if (generatedTemplateId != null) + 'GeneratedTemplateId': generatedTemplateId, + }; + } +} + class CreateStackInstancesOutput { /// The unique identifier for this stack set operation. final String? operationId; @@ -7043,6 +8104,19 @@ class CreateStackSetOutput { } } +class DeactivateOrganizationsAccessOutput { + DeactivateOrganizationsAccessOutput(); + factory DeactivateOrganizationsAccessOutput.fromXml( + // ignore: avoid_unused_constructor_parameters + _s.XmlElement elem) { + return DeactivateOrganizationsAccessOutput(); + } + + Map toJson() { + return {}; + } +} + class DeactivateTypeOutput { DeactivateTypeOutput(); factory DeactivateTypeOutput.fromXml( @@ -7104,6 +8178,34 @@ class DeleteStackSetOutput { } } +enum DeletionMode { + standard, + forceDeleteStack, +} + +extension DeletionModeValueExtension on DeletionMode { + String toValue() { + switch (this) { + case DeletionMode.standard: + return 'STANDARD'; + case DeletionMode.forceDeleteStack: + return 'FORCE_DELETE_STACK'; + } + } +} + +extension DeletionModeFromString on String { + DeletionMode toDeletionMode() { + switch (this) { + case 'STANDARD': + return DeletionMode.standard; + case 'FORCE_DELETE_STACK': + return DeletionMode.forceDeleteStack; + } + throw Exception('$this is not known in enum DeletionMode'); + } +} + /// [Service-managed permissions] The Organizations accounts to which StackSets /// deploys. StackSets doesn't deploy stack instances to the organization /// management account, even if the organization management account is in your @@ -7359,6 +8461,17 @@ class DescribeChangeSetOutput { /// or in an OBSOLETE state because the stack was already updated. final ExecutionStatus? executionStatus; + /// Indicates if the change set imports resources that already exist. + /// + /// This parameter can only import resources that have custom + /// names in templates. To import resources that do not accept custom names, + /// such as EC2 instances, use the resource + /// import feature instead. + /// + final bool? importExistingResources; + /// Verifies if IncludeNestedStacks is set to True. final bool? includeNestedStacks; @@ -7370,6 +8483,35 @@ class DescribeChangeSetOutput { /// will be associated with the stack if you execute the change set. final List? notificationARNs; + /// Determines what action will be taken if stack creation fails. When this + /// parameter is specified, the DisableRollback parameter to the ExecuteChangeSet + /// API operation must not be specified. This must be one of these values: + /// + ///
      + ///
    • + /// DELETE - Deletes the change set if the stack creation fails. + /// This is only valid when the ChangeSetType parameter is set to + /// CREATE. If the deletion of the stack fails, the status of the + /// stack is DELETE_FAILED. + ///
    • + ///
    • + /// DO_NOTHING - if the stack creation fails, do nothing. This is + /// equivalent to specifying true for the + /// DisableRollback parameter to the ExecuteChangeSet + /// API operation. + ///
    • + ///
    • + /// ROLLBACK - if the stack creation fails, roll back the stack. + /// This is equivalent to specifying false for the + /// DisableRollback parameter to the ExecuteChangeSet + /// API operation. + ///
    • + ///
    + final OnStackFailure? onStackFailure; + /// A list of Parameter structures that describes the input /// parameters and their values used to create the change set. For more /// information, see the _s.extractXmlStringListValues(elem, 'member')), + onStackFailure: + _s.extractXmlStringValue(elem, 'OnStackFailure')?.toOnStackFailure(), parameters: _s.extractXmlChild(elem, 'Parameters')?.let((elem) => elem.findElements('member').map(Parameter.fromXml).toList()), parentChangeSetId: _s.extractXmlStringValue(elem, 'ParentChangeSetId'), @@ -7474,9 +8622,11 @@ class DescribeChangeSetOutput { final creationTime = this.creationTime; final description = this.description; final executionStatus = this.executionStatus; + final importExistingResources = this.importExistingResources; final includeNestedStacks = this.includeNestedStacks; final nextToken = this.nextToken; final notificationARNs = this.notificationARNs; + final onStackFailure = this.onStackFailure; final parameters = this.parameters; final parentChangeSetId = this.parentChangeSetId; final rollbackConfiguration = this.rollbackConfiguration; @@ -7493,22 +8643,184 @@ class DescribeChangeSetOutput { if (changeSetName != null) 'ChangeSetName': changeSetName, if (changes != null) 'Changes': changes, if (creationTime != null) 'CreationTime': iso8601ToJson(creationTime), - if (description != null) 'Description': description, - if (executionStatus != null) 'ExecutionStatus': executionStatus.toValue(), - if (includeNestedStacks != null) - 'IncludeNestedStacks': includeNestedStacks, - if (nextToken != null) 'NextToken': nextToken, - if (notificationARNs != null) 'NotificationARNs': notificationARNs, - if (parameters != null) 'Parameters': parameters, - if (parentChangeSetId != null) 'ParentChangeSetId': parentChangeSetId, - if (rollbackConfiguration != null) - 'RollbackConfiguration': rollbackConfiguration, - if (rootChangeSetId != null) 'RootChangeSetId': rootChangeSetId, + if (description != null) 'Description': description, + if (executionStatus != null) 'ExecutionStatus': executionStatus.toValue(), + if (importExistingResources != null) + 'ImportExistingResources': importExistingResources, + if (includeNestedStacks != null) + 'IncludeNestedStacks': includeNestedStacks, + if (nextToken != null) 'NextToken': nextToken, + if (notificationARNs != null) 'NotificationARNs': notificationARNs, + if (onStackFailure != null) 'OnStackFailure': onStackFailure.toValue(), + if (parameters != null) 'Parameters': parameters, + if (parentChangeSetId != null) 'ParentChangeSetId': parentChangeSetId, + if (rollbackConfiguration != null) + 'RollbackConfiguration': rollbackConfiguration, + if (rootChangeSetId != null) 'RootChangeSetId': rootChangeSetId, + if (stackId != null) 'StackId': stackId, + if (stackName != null) 'StackName': stackName, + if (status != null) 'Status': status.toValue(), + if (statusReason != null) 'StatusReason': statusReason, + if (tags != null) 'Tags': tags, + }; + } +} + +class DescribeGeneratedTemplateOutput { + /// The time the generated template was created. + final DateTime? creationTime; + + /// The Amazon Resource Name (ARN) of the generated template. The format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. + /// For example, + /// arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc + /// . + final String? generatedTemplateId; + + /// The name of the generated template. + final String? generatedTemplateName; + + /// The time the generated template was last updated. + final DateTime? lastUpdatedTime; + + /// An object describing the progress of the template generation. + final TemplateProgress? progress; + + /// A list of objects describing the details of the resources in the template + /// generation. + final List? resources; + + /// The stack ARN of the base stack if a base stack was provided when generating + /// the template. + final String? stackId; + + /// The status of the template generation. Supported values are: + /// + ///
      + ///
    • + /// CreatePending - the creation of the template is pending. + ///
    • + ///
    • + /// CreateInProgress - the creation of the template is in progress. + ///
    • + ///
    • + /// DeletePending - the deletion of the template is pending. + ///
    • + ///
    • + /// DeleteInProgress - the deletion of the template is in progress. + ///
    • + ///
    • + /// UpdatePending - the update of the template is pending. + ///
    • + ///
    • + /// UpdateInProgress - the update of the template is in progress. + ///
    • + ///
    • + /// Failed - the template operation failed. + ///
    • + ///
    • + /// Complete - the template operation is complete. + ///
    • + ///
    + final GeneratedTemplateStatus? status; + + /// The reason for the current template generation status. This will provide + /// more details if a failure happened. + final String? statusReason; + + /// The configuration details of the generated template, including the + /// DeletionPolicy and UpdateReplacePolicy. + final TemplateConfiguration? templateConfiguration; + + /// The number of warnings generated for this template. The warnings are found + /// in the details of each of the resources in the template. + final int? totalWarnings; + + DescribeGeneratedTemplateOutput({ + this.creationTime, + this.generatedTemplateId, + this.generatedTemplateName, + this.lastUpdatedTime, + this.progress, + this.resources, + this.stackId, + this.status, + this.statusReason, + this.templateConfiguration, + this.totalWarnings, + }); + factory DescribeGeneratedTemplateOutput.fromXml(_s.XmlElement elem) { + return DescribeGeneratedTemplateOutput( + creationTime: _s.extractXmlDateTimeValue(elem, 'CreationTime'), + generatedTemplateId: + _s.extractXmlStringValue(elem, 'GeneratedTemplateId'), + generatedTemplateName: + _s.extractXmlStringValue(elem, 'GeneratedTemplateName'), + lastUpdatedTime: _s.extractXmlDateTimeValue(elem, 'LastUpdatedTime'), + progress: + _s.extractXmlChild(elem, 'Progress')?.let(TemplateProgress.fromXml), + resources: _s.extractXmlChild(elem, 'Resources')?.let((elem) => + elem.findElements('member').map(ResourceDetail.fromXml).toList()), + stackId: _s.extractXmlStringValue(elem, 'StackId'), + status: + _s.extractXmlStringValue(elem, 'Status')?.toGeneratedTemplateStatus(), + statusReason: _s.extractXmlStringValue(elem, 'StatusReason'), + templateConfiguration: _s + .extractXmlChild(elem, 'TemplateConfiguration') + ?.let(TemplateConfiguration.fromXml), + totalWarnings: _s.extractXmlIntValue(elem, 'TotalWarnings'), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final generatedTemplateId = this.generatedTemplateId; + final generatedTemplateName = this.generatedTemplateName; + final lastUpdatedTime = this.lastUpdatedTime; + final progress = this.progress; + final resources = this.resources; + final stackId = this.stackId; + final status = this.status; + final statusReason = this.statusReason; + final templateConfiguration = this.templateConfiguration; + final totalWarnings = this.totalWarnings; + return { + if (creationTime != null) 'CreationTime': iso8601ToJson(creationTime), + if (generatedTemplateId != null) + 'GeneratedTemplateId': generatedTemplateId, + if (generatedTemplateName != null) + 'GeneratedTemplateName': generatedTemplateName, + if (lastUpdatedTime != null) + 'LastUpdatedTime': iso8601ToJson(lastUpdatedTime), + if (progress != null) 'Progress': progress, + if (resources != null) 'Resources': resources, if (stackId != null) 'StackId': stackId, - if (stackName != null) 'StackName': stackName, if (status != null) 'Status': status.toValue(), if (statusReason != null) 'StatusReason': statusReason, - if (tags != null) 'Tags': tags, + if (templateConfiguration != null) + 'TemplateConfiguration': templateConfiguration, + if (totalWarnings != null) 'TotalWarnings': totalWarnings, + }; + } +} + +class DescribeOrganizationsAccessOutput { + /// Presents the status of the OrganizationAccess. + final OrganizationStatus? status; + + DescribeOrganizationsAccessOutput({ + this.status, + }); + factory DescribeOrganizationsAccessOutput.fromXml(_s.XmlElement elem) { + return DescribeOrganizationsAccessOutput( + status: _s.extractXmlStringValue(elem, 'Status')?.toOrganizationStatus(), + ); + } + + Map toJson() { + final status = this.status; + return { + if (status != null) 'Status': status.toValue(), }; } } @@ -7562,6 +8874,111 @@ class DescribePublisherOutput { } } +class DescribeResourceScanOutput { + /// The time that the resource scan was finished. + final DateTime? endTime; + + /// The percentage of the resource scan that has been completed. + final double? percentageCompleted; + + /// The Amazon Resource Name (ARN) of the resource scan. The format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. + /// An example is + /// arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 + /// . + final String? resourceScanId; + + /// The list of resource types for the specified scan. Resource types are only + /// available for scans with a Status set to COMPLETE + /// or FAILED . + final List? resourceTypes; + + /// The number of resources that were read. This is only available for scans + /// with a Status set to COMPLETE, + /// EXPIRED, or FAILED . + /// + /// This field may be 0 if the resource scan failed with a + /// ResourceScanLimitExceededException. + /// + final int? resourcesRead; + + /// The number of resources that were listed. This is only available for scans + /// with a Status set to COMPLETE, + /// EXPIRED, or FAILED . + final int? resourcesScanned; + + /// The time that the resource scan was started. + final DateTime? startTime; + + /// Status of the resource scan. + ///
    INPROGRESS
    + /// The resource scan is still in progress. + ///
    COMPLETE
    + /// The resource scan is complete. + ///
    EXPIRED
    + /// The resource scan has expired. + ///
    FAILED
    + /// The resource scan has failed. + ///
    + final ResourceScanStatus? status; + + /// The reason for the resource scan status, providing more information if a + /// failure happened. + final String? statusReason; + + DescribeResourceScanOutput({ + this.endTime, + this.percentageCompleted, + this.resourceScanId, + this.resourceTypes, + this.resourcesRead, + this.resourcesScanned, + this.startTime, + this.status, + this.statusReason, + }); + factory DescribeResourceScanOutput.fromXml(_s.XmlElement elem) { + return DescribeResourceScanOutput( + endTime: _s.extractXmlDateTimeValue(elem, 'EndTime'), + percentageCompleted: + _s.extractXmlDoubleValue(elem, 'PercentageCompleted'), + resourceScanId: _s.extractXmlStringValue(elem, 'ResourceScanId'), + resourceTypes: _s + .extractXmlChild(elem, 'ResourceTypes') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + resourcesRead: _s.extractXmlIntValue(elem, 'ResourcesRead'), + resourcesScanned: _s.extractXmlIntValue(elem, 'ResourcesScanned'), + startTime: _s.extractXmlDateTimeValue(elem, 'StartTime'), + status: _s.extractXmlStringValue(elem, 'Status')?.toResourceScanStatus(), + statusReason: _s.extractXmlStringValue(elem, 'StatusReason'), + ); + } + + Map toJson() { + final endTime = this.endTime; + final percentageCompleted = this.percentageCompleted; + final resourceScanId = this.resourceScanId; + final resourceTypes = this.resourceTypes; + final resourcesRead = this.resourcesRead; + final resourcesScanned = this.resourcesScanned; + final startTime = this.startTime; + final status = this.status; + final statusReason = this.statusReason; + return { + if (endTime != null) 'EndTime': iso8601ToJson(endTime), + if (percentageCompleted != null) + 'PercentageCompleted': percentageCompleted, + if (resourceScanId != null) 'ResourceScanId': resourceScanId, + if (resourceTypes != null) 'ResourceTypes': resourceTypes, + if (resourcesRead != null) 'ResourcesRead': resourcesRead, + if (resourcesScanned != null) 'ResourcesScanned': resourcesScanned, + if (startTime != null) 'StartTime': iso8601ToJson(startTime), + if (status != null) 'Status': status.toValue(), + if (statusReason != null) 'StatusReason': statusReason, + }; + } +} + class DescribeStackDriftDetectionStatusOutput { /// The status of the stack drift detection operation. /// @@ -7913,21 +9330,21 @@ class DescribeTypeOutput { final String? arn; /// Whether CloudFormation automatically updates the extension in this account - /// and region when a new minor version is published by the extension + /// and Region when a new minor version is published by the extension /// publisher. Major versions released by the publisher must be manually /// updated. For more information, see
    Activating + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html#registry-public-enable">Activating /// public extensions for use in your account in the CloudFormation User /// Guide. final bool? autoUpdate; /// A JSON string that represent the current configuration data for the - /// extension in this account and region. + /// extension in this account and Region. /// /// To set the configuration data for an extension, use SetTypeConfiguration. /// For more information, see Configuring + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring /// extensions at the account level in the CloudFormation User Guide. final String? configurationSchema; @@ -7940,8 +9357,8 @@ class DescribeTypeOutput { /// more information, see RegisterType. /// - /// To set the default version of an extension, use - /// SetTypeDefaultVersion . + /// To set the default version of an extension, use + /// SetTypeDefaultVersion. final String? defaultVersionId; /// The deprecation status of the extension version. @@ -7982,7 +9399,7 @@ class DescribeTypeOutput { /// extension with the appropriate credentials. final String? executionRoleArn; - /// Whether the extension is activated in the account and region. + /// Whether the extension is activated in the account and Region. /// /// This only applies to public third-party extensions. For all other /// extensions, CloudFormation returns null. @@ -8026,16 +9443,16 @@ class DescribeTypeOutput { /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType. final LoggingConfig? loggingConfig; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the Amazon Resource Name (ARN) of the public extension. final String? originalTypeArn; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the type name of the public extension. /// /// If you specified a TypeNameAlias when enabling the extension in - /// this account and region, CloudFormation treats that alias as the extension's - /// type name within the account and region, not the type name of the public + /// this account and Region, CloudFormation treats that alias as the extension's + /// type name within the account and Region, not the type name of the public /// extension. For more information, see Specifying /// aliases to refer to extensions in the CloudFormation User Guide. @@ -8371,6 +9788,34 @@ class DescribeTypeRegistrationOutput { } } +enum DetailedStatus { + configurationComplete, + validationFailed, +} + +extension DetailedStatusValueExtension on DetailedStatus { + String toValue() { + switch (this) { + case DetailedStatus.configurationComplete: + return 'CONFIGURATION_COMPLETE'; + case DetailedStatus.validationFailed: + return 'VALIDATION_FAILED'; + } + } +} + +extension DetailedStatusFromString on String { + DetailedStatus toDetailedStatus() { + switch (this) { + case 'CONFIGURATION_COMPLETE': + return DetailedStatus.configurationComplete; + case 'VALIDATION_FAILED': + return DetailedStatus.validationFailed; + } + throw Exception('$this is not known in enum DetailedStatus'); + } +} + class DetectStackDriftOutput { /// The ID of the drift detection results of this operation. /// @@ -8424,8 +9869,8 @@ class DetectStackResourceDriftOutput { class DetectStackSetDriftOutput { /// The ID of the drift detection stack set operation. /// - /// You can use this operation ID with DescribeStackSetOperation - /// to monitor the progress of the drift detection operation. + /// You can use this operation ID with DescribeStackSetOperation to + /// monitor the progress of the drift detection operation. final String? operationId; DetectStackSetDriftOutput({ @@ -8503,7 +9948,7 @@ class EstimateTemplateCostOutput { enum EvaluationType { static, - dynamic, + $dynamic, } extension EvaluationTypeValueExtension on EvaluationType { @@ -8511,124 +9956,340 @@ extension EvaluationTypeValueExtension on EvaluationType { switch (this) { case EvaluationType.static: return 'Static'; - case EvaluationType.dynamic: + case EvaluationType.$dynamic: return 'Dynamic'; } } } -extension EvaluationTypeFromString on String { - EvaluationType toEvaluationType() { +extension EvaluationTypeFromString on String { + EvaluationType toEvaluationType() { + switch (this) { + case 'Static': + return EvaluationType.static; + case 'Dynamic': + return EvaluationType.$dynamic; + } + throw Exception('$this is not known in enum EvaluationType'); + } +} + +/// The output for the ExecuteChangeSet action. +class ExecuteChangeSetOutput { + ExecuteChangeSetOutput(); + factory ExecuteChangeSetOutput.fromXml( + // ignore: avoid_unused_constructor_parameters + _s.XmlElement elem) { + return ExecuteChangeSetOutput(); + } + + Map toJson() { + return {}; + } +} + +enum ExecutionStatus { + unavailable, + available, + executeInProgress, + executeComplete, + executeFailed, + obsolete, +} + +extension ExecutionStatusValueExtension on ExecutionStatus { + String toValue() { + switch (this) { + case ExecutionStatus.unavailable: + return 'UNAVAILABLE'; + case ExecutionStatus.available: + return 'AVAILABLE'; + case ExecutionStatus.executeInProgress: + return 'EXECUTE_IN_PROGRESS'; + case ExecutionStatus.executeComplete: + return 'EXECUTE_COMPLETE'; + case ExecutionStatus.executeFailed: + return 'EXECUTE_FAILED'; + case ExecutionStatus.obsolete: + return 'OBSOLETE'; + } + } +} + +extension ExecutionStatusFromString on String { + ExecutionStatus toExecutionStatus() { + switch (this) { + case 'UNAVAILABLE': + return ExecutionStatus.unavailable; + case 'AVAILABLE': + return ExecutionStatus.available; + case 'EXECUTE_IN_PROGRESS': + return ExecutionStatus.executeInProgress; + case 'EXECUTE_COMPLETE': + return ExecutionStatus.executeComplete; + case 'EXECUTE_FAILED': + return ExecutionStatus.executeFailed; + case 'OBSOLETE': + return ExecutionStatus.obsolete; + } + throw Exception('$this is not known in enum ExecutionStatus'); + } +} + +/// The Export structure describes the exported output values for a +/// stack. +class Export { + /// The stack that contains the exported output name and value. + final String? exportingStackId; + + /// The name of exported output value. Use this name and the + /// Fn::ImportValue function to import the associated value into + /// other stacks. The name is defined in the Export field in the + /// associated stack's Outputs section. + final String? name; + + /// The value of the exported output, such as a resource physical ID. This value + /// is defined in the Export field in the associated stack's + /// Outputs section. + final String? value; + + Export({ + this.exportingStackId, + this.name, + this.value, + }); + factory Export.fromXml(_s.XmlElement elem) { + return Export( + exportingStackId: _s.extractXmlStringValue(elem, 'ExportingStackId'), + name: _s.extractXmlStringValue(elem, 'Name'), + value: _s.extractXmlStringValue(elem, 'Value'), + ); + } + + Map toJson() { + final exportingStackId = this.exportingStackId; + final name = this.name; + final value = this.value; + return { + if (exportingStackId != null) 'ExportingStackId': exportingStackId, + if (name != null) 'Name': name, + if (value != null) 'Value': value, + }; + } +} + +enum GeneratedTemplateDeletionPolicy { + delete, + retain, +} + +extension GeneratedTemplateDeletionPolicyValueExtension + on GeneratedTemplateDeletionPolicy { + String toValue() { + switch (this) { + case GeneratedTemplateDeletionPolicy.delete: + return 'DELETE'; + case GeneratedTemplateDeletionPolicy.retain: + return 'RETAIN'; + } + } +} + +extension GeneratedTemplateDeletionPolicyFromString on String { + GeneratedTemplateDeletionPolicy toGeneratedTemplateDeletionPolicy() { + switch (this) { + case 'DELETE': + return GeneratedTemplateDeletionPolicy.delete; + case 'RETAIN': + return GeneratedTemplateDeletionPolicy.retain; + } + throw Exception( + '$this is not known in enum GeneratedTemplateDeletionPolicy'); + } +} + +enum GeneratedTemplateResourceStatus { + pending, + inProgress, + failed, + complete, +} + +extension GeneratedTemplateResourceStatusValueExtension + on GeneratedTemplateResourceStatus { + String toValue() { + switch (this) { + case GeneratedTemplateResourceStatus.pending: + return 'PENDING'; + case GeneratedTemplateResourceStatus.inProgress: + return 'IN_PROGRESS'; + case GeneratedTemplateResourceStatus.failed: + return 'FAILED'; + case GeneratedTemplateResourceStatus.complete: + return 'COMPLETE'; + } + } +} + +extension GeneratedTemplateResourceStatusFromString on String { + GeneratedTemplateResourceStatus toGeneratedTemplateResourceStatus() { + switch (this) { + case 'PENDING': + return GeneratedTemplateResourceStatus.pending; + case 'IN_PROGRESS': + return GeneratedTemplateResourceStatus.inProgress; + case 'FAILED': + return GeneratedTemplateResourceStatus.failed; + case 'COMPLETE': + return GeneratedTemplateResourceStatus.complete; + } + throw Exception( + '$this is not known in enum GeneratedTemplateResourceStatus'); + } +} + +enum GeneratedTemplateStatus { + createPending, + updatePending, + deletePending, + createInProgress, + updateInProgress, + deleteInProgress, + failed, + complete, +} + +extension GeneratedTemplateStatusValueExtension on GeneratedTemplateStatus { + String toValue() { + switch (this) { + case GeneratedTemplateStatus.createPending: + return 'CREATE_PENDING'; + case GeneratedTemplateStatus.updatePending: + return 'UPDATE_PENDING'; + case GeneratedTemplateStatus.deletePending: + return 'DELETE_PENDING'; + case GeneratedTemplateStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case GeneratedTemplateStatus.updateInProgress: + return 'UPDATE_IN_PROGRESS'; + case GeneratedTemplateStatus.deleteInProgress: + return 'DELETE_IN_PROGRESS'; + case GeneratedTemplateStatus.failed: + return 'FAILED'; + case GeneratedTemplateStatus.complete: + return 'COMPLETE'; + } + } +} + +extension GeneratedTemplateStatusFromString on String { + GeneratedTemplateStatus toGeneratedTemplateStatus() { switch (this) { - case 'Static': - return EvaluationType.static; - case 'Dynamic': - return EvaluationType.dynamic; + case 'CREATE_PENDING': + return GeneratedTemplateStatus.createPending; + case 'UPDATE_PENDING': + return GeneratedTemplateStatus.updatePending; + case 'DELETE_PENDING': + return GeneratedTemplateStatus.deletePending; + case 'CREATE_IN_PROGRESS': + return GeneratedTemplateStatus.createInProgress; + case 'UPDATE_IN_PROGRESS': + return GeneratedTemplateStatus.updateInProgress; + case 'DELETE_IN_PROGRESS': + return GeneratedTemplateStatus.deleteInProgress; + case 'FAILED': + return GeneratedTemplateStatus.failed; + case 'COMPLETE': + return GeneratedTemplateStatus.complete; } - throw Exception('$this is not known in enum EvaluationType'); - } -} - -/// The output for the ExecuteChangeSet action. -class ExecuteChangeSetOutput { - ExecuteChangeSetOutput(); - factory ExecuteChangeSetOutput.fromXml( - // ignore: avoid_unused_constructor_parameters - _s.XmlElement elem) { - return ExecuteChangeSetOutput(); - } - - Map toJson() { - return {}; + throw Exception('$this is not known in enum GeneratedTemplateStatus'); } } -enum ExecutionStatus { - unavailable, - available, - executeInProgress, - executeComplete, - executeFailed, - obsolete, +enum GeneratedTemplateUpdateReplacePolicy { + delete, + retain, } -extension ExecutionStatusValueExtension on ExecutionStatus { +extension GeneratedTemplateUpdateReplacePolicyValueExtension + on GeneratedTemplateUpdateReplacePolicy { String toValue() { switch (this) { - case ExecutionStatus.unavailable: - return 'UNAVAILABLE'; - case ExecutionStatus.available: - return 'AVAILABLE'; - case ExecutionStatus.executeInProgress: - return 'EXECUTE_IN_PROGRESS'; - case ExecutionStatus.executeComplete: - return 'EXECUTE_COMPLETE'; - case ExecutionStatus.executeFailed: - return 'EXECUTE_FAILED'; - case ExecutionStatus.obsolete: - return 'OBSOLETE'; + case GeneratedTemplateUpdateReplacePolicy.delete: + return 'DELETE'; + case GeneratedTemplateUpdateReplacePolicy.retain: + return 'RETAIN'; } } } -extension ExecutionStatusFromString on String { - ExecutionStatus toExecutionStatus() { +extension GeneratedTemplateUpdateReplacePolicyFromString on String { + GeneratedTemplateUpdateReplacePolicy + toGeneratedTemplateUpdateReplacePolicy() { switch (this) { - case 'UNAVAILABLE': - return ExecutionStatus.unavailable; - case 'AVAILABLE': - return ExecutionStatus.available; - case 'EXECUTE_IN_PROGRESS': - return ExecutionStatus.executeInProgress; - case 'EXECUTE_COMPLETE': - return ExecutionStatus.executeComplete; - case 'EXECUTE_FAILED': - return ExecutionStatus.executeFailed; - case 'OBSOLETE': - return ExecutionStatus.obsolete; + case 'DELETE': + return GeneratedTemplateUpdateReplacePolicy.delete; + case 'RETAIN': + return GeneratedTemplateUpdateReplacePolicy.retain; } - throw Exception('$this is not known in enum ExecutionStatus'); + throw Exception( + '$this is not known in enum GeneratedTemplateUpdateReplacePolicy'); } } -/// The Export structure describes the exported output values for a -/// stack. -class Export { - /// The stack that contains the exported output name and value. - final String? exportingStackId; - - /// The name of exported output value. Use this name and the - /// Fn::ImportValue function to import the associated value into - /// other stacks. The name is defined in the Export field in the - /// associated stack's Outputs section. - final String? name; +class GetGeneratedTemplateOutput { + /// The status of the template generation. Supported values are: + /// + ///
      + ///
    • + /// CreatePending - the creation of the template is pending. + ///
    • + ///
    • + /// CreateInProgress - the creation of the template is in progress. + ///
    • + ///
    • + /// DeletePending - the deletion of the template is pending. + ///
    • + ///
    • + /// DeleteInProgress - the deletion of the template is in progress. + ///
    • + ///
    • + /// UpdatePending - the update of the template is pending. + ///
    • + ///
    • + /// UpdateInProgress - the update of the template is in progress. + ///
    • + ///
    • + /// Failed - the template operation failed. + ///
    • + ///
    • + /// Complete - the template operation is complete. + ///
    • + ///
    + final GeneratedTemplateStatus? status; - /// The value of the exported output, such as a resource physical ID. This value - /// is defined in the Export field in the associated stack's - /// Outputs section. - final String? value; + /// The template body of the generated template, in the language specified by + /// the Language parameter. + final String? templateBody; - Export({ - this.exportingStackId, - this.name, - this.value, + GetGeneratedTemplateOutput({ + this.status, + this.templateBody, }); - factory Export.fromXml(_s.XmlElement elem) { - return Export( - exportingStackId: _s.extractXmlStringValue(elem, 'ExportingStackId'), - name: _s.extractXmlStringValue(elem, 'Name'), - value: _s.extractXmlStringValue(elem, 'Value'), + factory GetGeneratedTemplateOutput.fromXml(_s.XmlElement elem) { + return GetGeneratedTemplateOutput( + status: + _s.extractXmlStringValue(elem, 'Status')?.toGeneratedTemplateStatus(), + templateBody: _s.extractXmlStringValue(elem, 'TemplateBody'), ); } Map toJson() { - final exportingStackId = this.exportingStackId; - final name = this.name; - final value = this.value; + final status = this.status; + final templateBody = this.templateBody; return { - if (exportingStackId != null) 'ExportingStackId': exportingStackId, - if (name != null) 'Name': name, - if (value != null) 'Value': value, + if (status != null) 'Status': status.toValue(), + if (templateBody != null) 'TemplateBody': templateBody, }; } } @@ -8637,7 +10298,8 @@ class Export { class GetStackPolicyOutput { /// Structure containing the stack policy body. (For more information, go to - /// Prevent Updates to Stack Resources in the CloudFormation User Guide.) + /// Prevent Updates to Stack Resources in the CloudFormation User + /// Guide.) final String? stackPolicyBody; GetStackPolicyOutput({ @@ -8668,7 +10330,7 @@ class GetTemplateOutput { /// Structure containing the template body. (For more information, go to Template - /// Anatomy in the CloudFormation User Guide.) + /// Anatomy in the CloudFormation User Guide.) /// /// CloudFormation returns the same template that was used when the stack was /// created. @@ -8748,6 +10410,9 @@ class GetTemplateSummaryOutput { /// capabilities of the template. final String? version; + /// An object containing any warnings returned. + final Warnings? warnings; + GetTemplateSummaryOutput({ this.capabilities, this.capabilitiesReason, @@ -8758,6 +10423,7 @@ class GetTemplateSummaryOutput { this.resourceIdentifierSummaries, this.resourceTypes, this.version, + this.warnings, }); factory GetTemplateSummaryOutput.fromXml(_s.XmlElement elem) { return GetTemplateSummaryOutput( @@ -8785,6 +10451,7 @@ class GetTemplateSummaryOutput { .extractXmlChild(elem, 'ResourceTypes') ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), version: _s.extractXmlStringValue(elem, 'Version'), + warnings: _s.extractXmlChild(elem, 'Warnings')?.let(Warnings.fromXml), ); } @@ -8798,6 +10465,7 @@ class GetTemplateSummaryOutput { final resourceIdentifierSummaries = this.resourceIdentifierSummaries; final resourceTypes = this.resourceTypes; final version = this.version; + final warnings = this.warnings; return { if (capabilities != null) 'Capabilities': capabilities.map((e) => e.toValue()).toList(), @@ -8810,6 +10478,7 @@ class GetTemplateSummaryOutput { 'ResourceIdentifierSummaries': resourceIdentifierSummaries, if (resourceTypes != null) 'ResourceTypes': resourceTypes, if (version != null) 'Version': version, + if (warnings != null) 'Warnings': warnings, }; } } @@ -9110,80 +10779,259 @@ class ListChangeSetsOutput { factory ListChangeSetsOutput.fromXml(_s.XmlElement elem) { return ListChangeSetsOutput( nextToken: _s.extractXmlStringValue(elem, 'NextToken'), - summaries: _s.extractXmlChild(elem, 'Summaries')?.let((elem) => - elem.findElements('member').map(ChangeSetSummary.fromXml).toList()), + summaries: _s.extractXmlChild(elem, 'Summaries')?.let((elem) => + elem.findElements('member').map(ChangeSetSummary.fromXml).toList()), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final summaries = this.summaries; + return { + if (nextToken != null) 'NextToken': nextToken, + if (summaries != null) 'Summaries': summaries, + }; + } +} + +class ListExportsOutput { + /// The output for the ListExports action. + final List? exports; + + /// If the output exceeds 100 exported output values, a string that identifies + /// the next page of exports. If there is no additional page, this value is + /// null. + final String? nextToken; + + ListExportsOutput({ + this.exports, + this.nextToken, + }); + factory ListExportsOutput.fromXml(_s.XmlElement elem) { + return ListExportsOutput( + exports: _s.extractXmlChild(elem, 'Exports')?.let( + (elem) => elem.findElements('member').map(Export.fromXml).toList()), + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + ); + } + + Map toJson() { + final exports = this.exports; + final nextToken = this.nextToken; + return { + if (exports != null) 'Exports': exports, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListGeneratedTemplatesOutput { + /// If the request doesn't return all the remaining results, + /// NextToken is set to a token. To retrieve the next set of + /// results, call ListGeneratedTemplates again and use that value + /// for the NextToken parameter. If the request returns all + /// results, NextToken is set to an empty string. + final String? nextToken; + + /// A list of summaries of the generated templates. + final List? summaries; + + ListGeneratedTemplatesOutput({ + this.nextToken, + this.summaries, + }); + factory ListGeneratedTemplatesOutput.fromXml(_s.XmlElement elem) { + return ListGeneratedTemplatesOutput( + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + summaries: _s.extractXmlChild(elem, 'Summaries')?.let((elem) => + elem.findElements('member').map(TemplateSummary.fromXml).toList()), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final summaries = this.summaries; + return { + if (nextToken != null) 'NextToken': nextToken, + if (summaries != null) 'Summaries': summaries, + }; + } +} + +class ListImportsOutput { + /// A list of stack names that are importing the specified exported output + /// value. + final List? imports; + + /// A string that identifies the next page of exports. If there is no additional + /// page, this value is null. + final String? nextToken; + + ListImportsOutput({ + this.imports, + this.nextToken, + }); + factory ListImportsOutput.fromXml(_s.XmlElement elem) { + return ListImportsOutput( + imports: _s + .extractXmlChild(elem, 'Imports') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + ); + } + + Map toJson() { + final imports = this.imports; + final nextToken = this.nextToken; + return { + if (imports != null) 'Imports': imports, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListResourceScanRelatedResourcesOutput { + /// If the request doesn't return all the remaining results, + /// NextToken is set to a token. To retrieve the next set of + /// results, call ListResourceScanRelatedResources again and use + /// that value for the NextToken parameter. If the request returns + /// all results, NextToken is set to an empty string. + final String? nextToken; + + /// List of up to MaxResults resources in the specified resource + /// scan related to the specified resources. + final List? relatedResources; + + ListResourceScanRelatedResourcesOutput({ + this.nextToken, + this.relatedResources, + }); + factory ListResourceScanRelatedResourcesOutput.fromXml(_s.XmlElement elem) { + return ListResourceScanRelatedResourcesOutput( + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + relatedResources: _s.extractXmlChild(elem, 'RelatedResources')?.let( + (elem) => elem + .findElements('member') + .map(ScannedResource.fromXml) + .toList()), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final relatedResources = this.relatedResources; + return { + if (nextToken != null) 'NextToken': nextToken, + if (relatedResources != null) 'RelatedResources': relatedResources, + }; + } +} + +class ListResourceScanResourcesOutput { + /// If the request doesn't return all the remaining results, + /// NextToken is set to a token. To retrieve the next set of + /// results, call ListResourceScanResources again and use that + /// value for the NextToken parameter. If the request returns all + /// results, NextToken is set to an empty string. + final String? nextToken; + + /// List of up to MaxResults resources in the specified resource + /// scan that match all of the specified filters. + final List? resources; + + ListResourceScanResourcesOutput({ + this.nextToken, + this.resources, + }); + factory ListResourceScanResourcesOutput.fromXml(_s.XmlElement elem) { + return ListResourceScanResourcesOutput( + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + resources: _s.extractXmlChild(elem, 'Resources')?.let((elem) => + elem.findElements('member').map(ScannedResource.fromXml).toList()), ); } Map toJson() { final nextToken = this.nextToken; - final summaries = this.summaries; + final resources = this.resources; return { if (nextToken != null) 'NextToken': nextToken, - if (summaries != null) 'Summaries': summaries, + if (resources != null) 'Resources': resources, }; } } -class ListExportsOutput { - /// The output for the ListExports action. - final List? exports; - - /// If the output exceeds 100 exported output values, a string that identifies - /// the next page of exports. If there is no additional page, this value is - /// null. +class ListResourceScansOutput { + /// If the request doesn't return all the remaining results, + /// NextToken is set to a token. To retrieve the next set of + /// results, call ListResourceScans again and use that value for + /// the NextToken parameter. If the request returns all results, + /// NextToken is set to an empty string. final String? nextToken; - ListExportsOutput({ - this.exports, + /// The list of scans returned. + final List? resourceScanSummaries; + + ListResourceScansOutput({ this.nextToken, + this.resourceScanSummaries, }); - factory ListExportsOutput.fromXml(_s.XmlElement elem) { - return ListExportsOutput( - exports: _s.extractXmlChild(elem, 'Exports')?.let( - (elem) => elem.findElements('member').map(Export.fromXml).toList()), + factory ListResourceScansOutput.fromXml(_s.XmlElement elem) { + return ListResourceScansOutput( nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + resourceScanSummaries: _s + .extractXmlChild(elem, 'ResourceScanSummaries') + ?.let((elem) => elem + .findElements('member') + .map(ResourceScanSummary.fromXml) + .toList()), ); } Map toJson() { - final exports = this.exports; final nextToken = this.nextToken; + final resourceScanSummaries = this.resourceScanSummaries; return { - if (exports != null) 'Exports': exports, if (nextToken != null) 'NextToken': nextToken, + if (resourceScanSummaries != null) + 'ResourceScanSummaries': resourceScanSummaries, }; } } -class ListImportsOutput { - /// A list of stack names that are importing the specified exported output - /// value. - final List? imports; - - /// A string that identifies the next page of exports. If there is no additional - /// page, this value is null. +class ListStackInstanceResourceDriftsOutput { + /// If the previous paginated request didn't return all of the remaining + /// results, the response object's NextToken parameter value is set + /// to a token. To retrieve the next set of results, call this action again and + /// assign that token to the request object's NextToken parameter. + /// If there are no remaining results, the previous response object's + /// NextToken parameter is set to null. final String? nextToken; - ListImportsOutput({ - this.imports, + /// A list of StackInstanceResourceDriftsSummary structures that + /// contain information about the specified stack instances. + final List? summaries; + + ListStackInstanceResourceDriftsOutput({ this.nextToken, + this.summaries, }); - factory ListImportsOutput.fromXml(_s.XmlElement elem) { - return ListImportsOutput( - imports: _s - .extractXmlChild(elem, 'Imports') - ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + factory ListStackInstanceResourceDriftsOutput.fromXml(_s.XmlElement elem) { + return ListStackInstanceResourceDriftsOutput( nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + summaries: _s.extractXmlChild(elem, 'Summaries')?.let((elem) => elem + .findElements('member') + .map(StackInstanceResourceDriftsSummary.fromXml) + .toList()), ); } Map toJson() { - final imports = this.imports; final nextToken = this.nextToken; + final summaries = this.summaries; return { - if (imports != null) 'Imports': imports, if (nextToken != null) 'NextToken': nextToken, + if (summaries != null) 'Summaries': summaries, }; } } @@ -9260,6 +11108,43 @@ class ListStackResourcesOutput { } } +class ListStackSetAutoDeploymentTargetsOutput { + /// If the request doesn't return all the remaining results, + /// NextToken is set to a token. To retrieve the next set of + /// results, call ListStackSetAutoDeploymentTargets + /// again and use that value for the NextToken parameter. If the + /// request returns all results, NextToken is set to an empty + /// string. + final String? nextToken; + + /// An array of summaries of the deployment targets for the stack set. + final List? summaries; + + ListStackSetAutoDeploymentTargetsOutput({ + this.nextToken, + this.summaries, + }); + factory ListStackSetAutoDeploymentTargetsOutput.fromXml(_s.XmlElement elem) { + return ListStackSetAutoDeploymentTargetsOutput( + nextToken: _s.extractXmlStringValue(elem, 'NextToken'), + summaries: _s.extractXmlChild(elem, 'Summaries')?.let((elem) => elem + .findElements('member') + .map(StackSetAutoDeploymentTargetSummary.fromXml) + .toList()), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final summaries = this.summaries; + return { + if (nextToken != null) 'NextToken': nextToken, + if (summaries != null) 'Summaries': summaries, + }; + } +} + class ListStackSetOperationResultsOutput { /// If the request doesn't return all results, NextToken is set to /// a token. To retrieve the next set of results, call @@ -9409,8 +11294,8 @@ class ListTypeRegistrationsOutput { /// A list of extension registration tokens. /// - /// Use DescribeTypeRegistration to return detailed - /// information about a type registration request. + /// Use DescribeTypeRegistration to return detailed information about a + /// type registration request. final List? registrationTokenList; ListTypeRegistrationsOutput({ @@ -9579,9 +11464,9 @@ class ManagedExecution { /// if the resource was created from a module included in the stack template. /// /// For more information about modules, see Using modules to -/// encapsulate and reuse resource configurations in the CloudFormation -/// User Guide. +/// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html">Using +/// modules to encapsulate and reuse resource configurations in the +/// CloudFormation User Guide. class ModuleInfo { /// A concatenated list of the logical IDs of the module or modules containing /// the resource. Modules are listed starting with the inner-most nested module, @@ -9594,7 +11479,7 @@ class ModuleInfo { /// moduleA/moduleB /// /// For more information, see Referencing + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html#module-ref-resources">Referencing /// resources in a module in the CloudFormation User Guide. final String? logicalIdHierarchy; @@ -9663,6 +11548,39 @@ extension OnFailureFromString on String { } } +enum OnStackFailure { + doNothing, + rollback, + delete, +} + +extension OnStackFailureValueExtension on OnStackFailure { + String toValue() { + switch (this) { + case OnStackFailure.doNothing: + return 'DO_NOTHING'; + case OnStackFailure.rollback: + return 'ROLLBACK'; + case OnStackFailure.delete: + return 'DELETE'; + } + } +} + +extension OnStackFailureFromString on String { + OnStackFailure toOnStackFailure() { + switch (this) { + case 'DO_NOTHING': + return OnStackFailure.doNothing; + case 'ROLLBACK': + return OnStackFailure.rollback; + case 'DELETE': + return OnStackFailure.delete; + } + throw Exception('$this is not known in enum OnStackFailure'); + } +} + /// The status that operation results are filtered by. class OperationResultFilter { /// The type of filter to apply. @@ -9747,6 +11665,39 @@ extension OperationStatusFromString on String { } } +enum OrganizationStatus { + enabled, + disabled, + disabledPermanently, +} + +extension OrganizationStatusValueExtension on OrganizationStatus { + String toValue() { + switch (this) { + case OrganizationStatus.enabled: + return 'ENABLED'; + case OrganizationStatus.disabled: + return 'DISABLED'; + case OrganizationStatus.disabledPermanently: + return 'DISABLED_PERMANENTLY'; + } + } +} + +extension OrganizationStatusFromString on String { + OrganizationStatus toOrganizationStatus() { + switch (this) { + case 'ENABLED': + return OrganizationStatus.enabled; + case 'DISABLED': + return OrganizationStatus.disabled; + case 'DISABLED_PERMANENTLY': + return OrganizationStatus.disabledPermanently; + } + throw Exception('$this is not known in enum OrganizationStatus'); + } +} + /// The Output data type. class Output { /// User defined description associated with the output. @@ -9803,7 +11754,7 @@ class Parameter { /// Read-only. The value that corresponds to a SSM parameter key. This field is /// returned only for - /// SSM parameter types in the template. + /// SSM parameter types in the template. final String? resolvedValue; /// During a stack update, use the existing parameter value that the stack is @@ -9988,6 +11939,54 @@ class PhysicalResourceIdContextKeyValuePair { } } +enum PolicyAction { + delete, + retain, + snapshot, + replaceAndDelete, + replaceAndRetain, + replaceAndSnapshot, +} + +extension PolicyActionValueExtension on PolicyAction { + String toValue() { + switch (this) { + case PolicyAction.delete: + return 'Delete'; + case PolicyAction.retain: + return 'Retain'; + case PolicyAction.snapshot: + return 'Snapshot'; + case PolicyAction.replaceAndDelete: + return 'ReplaceAndDelete'; + case PolicyAction.replaceAndRetain: + return 'ReplaceAndRetain'; + case PolicyAction.replaceAndSnapshot: + return 'ReplaceAndSnapshot'; + } + } +} + +extension PolicyActionFromString on String { + PolicyAction toPolicyAction() { + switch (this) { + case 'Delete': + return PolicyAction.delete; + case 'Retain': + return PolicyAction.retain; + case 'Snapshot': + return PolicyAction.snapshot; + case 'ReplaceAndDelete': + return PolicyAction.replaceAndDelete; + case 'ReplaceAndRetain': + return PolicyAction.replaceAndRetain; + case 'ReplaceAndSnapshot': + return PolicyAction.replaceAndSnapshot; + } + throw Exception('$this is not known in enum PolicyAction'); + } +} + /// Information about a resource property whose actual value differs from its /// expected value, as defined in the stack template and any values specified as /// template parameters. These will be present only for resources whose @@ -10203,9 +12202,9 @@ class RegisterPublisherOutput { class RegisterTypeOutput { /// The identifier for this registration request. /// - /// Use this registration token when calling - /// DescribeTypeRegistration , which returns information about the - /// status and IDs of the extension registration. + /// Use this registration token when calling DescribeTypeRegistration, + /// which returns information about the status and IDs of the extension + /// registration. final String? registrationToken; RegisterTypeOutput({ @@ -10335,8 +12334,8 @@ class RequiredActivatedType { /// The type name of the public extension. /// /// If you specified a TypeNameAlias when enabling the extension in - /// this account and region, CloudFormation treats that alias as the extension's - /// type name within the account and region, not the type name of the public + /// this account and Region, CloudFormation treats that alias as the extension's + /// type name within the account and Region, not the type name of the public /// extension. For more information, see Specifying /// aliases to refer to extensions in the CloudFormation User Guide. @@ -10348,9 +12347,9 @@ class RequiredActivatedType { /// A list of the major versions of the extension type that the macro supports. final List? supportedMajorVersions; - /// An alias assigned to the public extension, in this account and region. If + /// An alias assigned to the public extension, in this account and Region. If /// you specify an alias for the extension, CloudFormation treats the alias as - /// the extension type name within this account and region. You must use the + /// the extension type name within this account and Region. You must use the /// alias to refer to the extension in your templates, API calls, and /// CloudFormation console. final String? typeNameAlias; @@ -10426,6 +12425,7 @@ enum ResourceAttribute { creationPolicy, updatePolicy, deletionPolicy, + updateReplacePolicy, tags, } @@ -10442,6 +12442,8 @@ extension ResourceAttributeValueExtension on ResourceAttribute { return 'UpdatePolicy'; case ResourceAttribute.deletionPolicy: return 'DeletionPolicy'; + case ResourceAttribute.updateReplacePolicy: + return 'UpdateReplacePolicy'; case ResourceAttribute.tags: return 'Tags'; } @@ -10461,6 +12463,8 @@ extension ResourceAttributeFromString on String { return ResourceAttribute.updatePolicy; case 'DeletionPolicy': return ResourceAttribute.deletionPolicy; + case 'UpdateReplacePolicy': + return ResourceAttribute.updateReplacePolicy; case 'Tags': return ResourceAttribute.tags; } @@ -10479,6 +12483,14 @@ class ResourceChange { /// can't be determined). final ChangeAction? action; + /// An encoded JSON string containing the context of the resource after the + /// change is executed. + final String? afterContext; + + /// An encoded JSON string containing the context of the resource before the + /// change is executed. + final String? beforeContext; + /// The change set ID of the nested change set. final String? changeSetId; @@ -10498,6 +12510,34 @@ class ResourceChange { /// don't have physical IDs because they haven't been created. final String? physicalResourceId; + /// The action that will be taken on the physical resource when the change set + /// is executed. + /// + ///
      + ///
    • + /// Delete The resource will be deleted. + ///
    • + ///
    • + /// Retain The resource will be retained. + ///
    • + ///
    • + /// Snapshot The resource will have a snapshot taken. + ///
    • + ///
    • + /// ReplaceAndDelete The resource will be replaced and then + /// deleted. + ///
    • + ///
    • + /// ReplaceAndRetain The resource will be replaced and then + /// retained. + ///
    • + ///
    • + /// ReplaceAndSnapshot The resource will be replaced and then have + /// a snapshot taken. + ///
    • + ///
    + final PolicyAction? policyAction; + /// For the Modify action, indicates whether CloudFormation will /// replace the resource by creating a new one and deleting the old one. This /// value depends on the value of the RequiresRecreation property @@ -10526,11 +12566,14 @@ class ResourceChange { ResourceChange({ this.action, + this.afterContext, + this.beforeContext, this.changeSetId, this.details, this.logicalResourceId, this.moduleInfo, this.physicalResourceId, + this.policyAction, this.replacement, this.resourceType, this.scope, @@ -10538,6 +12581,8 @@ class ResourceChange { factory ResourceChange.fromXml(_s.XmlElement elem) { return ResourceChange( action: _s.extractXmlStringValue(elem, 'Action')?.toChangeAction(), + afterContext: _s.extractXmlStringValue(elem, 'AfterContext'), + beforeContext: _s.extractXmlStringValue(elem, 'BeforeContext'), changeSetId: _s.extractXmlStringValue(elem, 'ChangeSetId'), details: _s.extractXmlChild(elem, 'Details')?.let((elem) => elem .findElements('member') @@ -10547,6 +12592,8 @@ class ResourceChange { moduleInfo: _s.extractXmlChild(elem, 'ModuleInfo')?.let(ModuleInfo.fromXml), physicalResourceId: _s.extractXmlStringValue(elem, 'PhysicalResourceId'), + policyAction: + _s.extractXmlStringValue(elem, 'PolicyAction')?.toPolicyAction(), replacement: _s.extractXmlStringValue(elem, 'Replacement')?.toReplacement(), resourceType: _s.extractXmlStringValue(elem, 'ResourceType'), @@ -10559,21 +12606,27 @@ class ResourceChange { Map toJson() { final action = this.action; + final afterContext = this.afterContext; + final beforeContext = this.beforeContext; final changeSetId = this.changeSetId; final details = this.details; final logicalResourceId = this.logicalResourceId; final moduleInfo = this.moduleInfo; final physicalResourceId = this.physicalResourceId; + final policyAction = this.policyAction; final replacement = this.replacement; final resourceType = this.resourceType; final scope = this.scope; return { if (action != null) 'Action': action.toValue(), + if (afterContext != null) 'AfterContext': afterContext, + if (beforeContext != null) 'BeforeContext': beforeContext, if (changeSetId != null) 'ChangeSetId': changeSetId, if (details != null) 'Details': details, if (logicalResourceId != null) 'LogicalResourceId': logicalResourceId, if (moduleInfo != null) 'ModuleInfo': moduleInfo, if (physicalResourceId != null) 'PhysicalResourceId': physicalResourceId, + if (policyAction != null) 'PolicyAction': policyAction.toValue(), if (replacement != null) 'Replacement': replacement.toValue(), if (resourceType != null) 'ResourceType': resourceType, if (scope != null) 'Scope': scope.map((e) => e.toValue()).toList(), @@ -10686,6 +12739,145 @@ class ResourceChangeDetail { } } +/// A resource included in a generated template. This data type is used with the +/// CreateGeneratedTemplate and +/// UpdateGeneratedTemplate API actions. +class ResourceDefinition { + /// A list of up to 256 key-value pairs that identifies the scanned resource. + /// The key is the name of one of the primary identifiers for the resource. + /// (Primary identifiers are specified in the primaryIdentifier + /// list in the resource schema.) The value is the value of that primary + /// identifier. For example, for a AWS::DynamoDB::Table resource, + /// the primary identifiers is TableName so the key-value pair + /// could be "TableName": "MyDDBTable". For more information, see + /// primaryIdentifier + /// in the CloudFormation Command Line Interface User guide for extension + /// development. + final Map resourceIdentifier; + + /// The type of the resource, such as AWS::DynamoDB::Table. For the + /// list of supported resources, see IaC + /// generator supported resource types in the CloudFormation User + /// Guide + final String resourceType; + + /// The logical resource id for this resource in the generated template. + final String? logicalResourceId; + + ResourceDefinition({ + required this.resourceIdentifier, + required this.resourceType, + this.logicalResourceId, + }); + + Map toJson() { + final resourceIdentifier = this.resourceIdentifier; + final resourceType = this.resourceType; + final logicalResourceId = this.logicalResourceId; + return { + 'ResourceIdentifier': resourceIdentifier, + 'ResourceType': resourceType, + if (logicalResourceId != null) 'LogicalResourceId': logicalResourceId, + }; + } +} + +/// Details about a resource in a generated template +class ResourceDetail { + /// The logical id for this resource in the final generated template. + final String? logicalResourceId; + + /// A list of up to 256 key-value pairs that identifies the resource in the + /// generated template. The key is the name of one of the primary identifiers + /// for the resource. (Primary identifiers are specified in the + /// primaryIdentifier list in the resource schema.) The value is + /// the value of that primary identifier. For example, for a + /// AWS::DynamoDB::Table resource, the primary identifiers is + /// TableName so the key-value pair could be "TableName": + /// "MyDDBTable". For more information, see primaryIdentifier + /// in the CloudFormation Command Line Interface User guide for extension + /// development. + final Map? resourceIdentifier; + + /// Status of the processing of a resource in a generated template. + ///
    InProgress
    + /// The resource processing is still in progress. + ///
    Complete
    + /// The resource processing is complete. + ///
    Pending
    + /// The resource processing is pending. + ///
    Failed
    + /// The resource processing has failed. + ///
    + final GeneratedTemplateResourceStatus? resourceStatus; + + /// The reason for the resource detail, providing more information if a failure + /// happened. + final String? resourceStatusReason; + + /// The type of the resource, such as AWS::DynamoDB::Table. For the + /// list of supported resources, see IaC + /// generator supported resource types In the CloudFormation User + /// Guide + final String? resourceType; + + /// The warnings generated for this resource. + final List? warnings; + + ResourceDetail({ + this.logicalResourceId, + this.resourceIdentifier, + this.resourceStatus, + this.resourceStatusReason, + this.resourceType, + this.warnings, + }); + factory ResourceDetail.fromXml(_s.XmlElement elem) { + return ResourceDetail( + logicalResourceId: _s.extractXmlStringValue(elem, 'LogicalResourceId'), + resourceIdentifier: Map.fromEntries( + elem.getElement('ResourceIdentifier')?.findElements('entry').map( + (c) => MapEntry( + _s.extractXmlStringValue(c, 'key')!, + _s.extractXmlStringValue(c, 'value')!, + ), + ) ?? + {}, + ), + resourceStatus: _s + .extractXmlStringValue(elem, 'ResourceStatus') + ?.toGeneratedTemplateResourceStatus(), + resourceStatusReason: + _s.extractXmlStringValue(elem, 'ResourceStatusReason'), + resourceType: _s.extractXmlStringValue(elem, 'ResourceType'), + warnings: _s.extractXmlChild(elem, 'Warnings')?.let((elem) => + elem.findElements('member').map(WarningDetail.fromXml).toList()), + ); + } + + Map toJson() { + final logicalResourceId = this.logicalResourceId; + final resourceIdentifier = this.resourceIdentifier; + final resourceStatus = this.resourceStatus; + final resourceStatusReason = this.resourceStatusReason; + final resourceType = this.resourceType; + final warnings = this.warnings; + return { + if (logicalResourceId != null) 'LogicalResourceId': logicalResourceId, + if (resourceIdentifier != null) 'ResourceIdentifier': resourceIdentifier, + if (resourceStatus != null) 'ResourceStatus': resourceStatus.toValue(), + if (resourceStatusReason != null) + 'ResourceStatusReason': resourceStatusReason, + if (resourceType != null) 'ResourceType': resourceType, + if (warnings != null) 'Warnings': warnings, + }; + } +} + /// Describes the target resources of a specific type in your import template /// (for example, all AWS::S3::Bucket resources) and the properties /// you can provide during the import to identify resources of that type. @@ -10703,32 +12895,140 @@ class ResourceIdentifierSummary { /// AWS::S3::Bucket. final String? resourceType; - ResourceIdentifierSummary({ - this.logicalResourceIds, - this.resourceIdentifiers, - this.resourceType, + ResourceIdentifierSummary({ + this.logicalResourceIds, + this.resourceIdentifiers, + this.resourceType, + }); + factory ResourceIdentifierSummary.fromXml(_s.XmlElement elem) { + return ResourceIdentifierSummary( + logicalResourceIds: _s + .extractXmlChild(elem, 'LogicalResourceIds') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + resourceIdentifiers: _s + .extractXmlChild(elem, 'ResourceIdentifiers') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + resourceType: _s.extractXmlStringValue(elem, 'ResourceType'), + ); + } + + Map toJson() { + final logicalResourceIds = this.logicalResourceIds; + final resourceIdentifiers = this.resourceIdentifiers; + final resourceType = this.resourceType; + return { + if (logicalResourceIds != null) 'LogicalResourceIds': logicalResourceIds, + if (resourceIdentifiers != null) + 'ResourceIdentifiers': resourceIdentifiers, + if (resourceType != null) 'ResourceType': resourceType, + }; + } +} + +enum ResourceScanStatus { + inProgress, + failed, + complete, + expired, +} + +extension ResourceScanStatusValueExtension on ResourceScanStatus { + String toValue() { + switch (this) { + case ResourceScanStatus.inProgress: + return 'IN_PROGRESS'; + case ResourceScanStatus.failed: + return 'FAILED'; + case ResourceScanStatus.complete: + return 'COMPLETE'; + case ResourceScanStatus.expired: + return 'EXPIRED'; + } + } +} + +extension ResourceScanStatusFromString on String { + ResourceScanStatus toResourceScanStatus() { + switch (this) { + case 'IN_PROGRESS': + return ResourceScanStatus.inProgress; + case 'FAILED': + return ResourceScanStatus.failed; + case 'COMPLETE': + return ResourceScanStatus.complete; + case 'EXPIRED': + return ResourceScanStatus.expired; + } + throw Exception('$this is not known in enum ResourceScanStatus'); + } +} + +/// A summary of the resource scan. This is returned by the +/// ListResourceScan API action. +class ResourceScanSummary { + /// The time that the resource scan was finished. + final DateTime? endTime; + + /// The percentage of the resource scan that has been completed. + final double? percentageCompleted; + + /// The Amazon Resource Name (ARN) of the resource scan. + final String? resourceScanId; + + /// The time that the resource scan was started. + final DateTime? startTime; + + /// Status of the resource scan. + ///
    INPROGRESS
    + /// The resource scan is still in progress. + ///
    COMPLETE
    + /// The resource scan is complete. + ///
    EXPIRED
    + /// The resource scan has expired. + ///
    FAILED
    + /// The resource scan has failed. + ///
    + final ResourceScanStatus? status; + + /// The reason for the resource scan status, providing more information if a + /// failure happened. + final String? statusReason; + + ResourceScanSummary({ + this.endTime, + this.percentageCompleted, + this.resourceScanId, + this.startTime, + this.status, + this.statusReason, }); - factory ResourceIdentifierSummary.fromXml(_s.XmlElement elem) { - return ResourceIdentifierSummary( - logicalResourceIds: _s - .extractXmlChild(elem, 'LogicalResourceIds') - ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), - resourceIdentifiers: _s - .extractXmlChild(elem, 'ResourceIdentifiers') - ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), - resourceType: _s.extractXmlStringValue(elem, 'ResourceType'), + factory ResourceScanSummary.fromXml(_s.XmlElement elem) { + return ResourceScanSummary( + endTime: _s.extractXmlDateTimeValue(elem, 'EndTime'), + percentageCompleted: + _s.extractXmlDoubleValue(elem, 'PercentageCompleted'), + resourceScanId: _s.extractXmlStringValue(elem, 'ResourceScanId'), + startTime: _s.extractXmlDateTimeValue(elem, 'StartTime'), + status: _s.extractXmlStringValue(elem, 'Status')?.toResourceScanStatus(), + statusReason: _s.extractXmlStringValue(elem, 'StatusReason'), ); } Map toJson() { - final logicalResourceIds = this.logicalResourceIds; - final resourceIdentifiers = this.resourceIdentifiers; - final resourceType = this.resourceType; + final endTime = this.endTime; + final percentageCompleted = this.percentageCompleted; + final resourceScanId = this.resourceScanId; + final startTime = this.startTime; + final status = this.status; + final statusReason = this.statusReason; return { - if (logicalResourceIds != null) 'LogicalResourceIds': logicalResourceIds, - if (resourceIdentifiers != null) - 'ResourceIdentifiers': resourceIdentifiers, - if (resourceType != null) 'ResourceType': resourceType, + if (endTime != null) 'EndTime': iso8601ToJson(endTime), + if (percentageCompleted != null) + 'PercentageCompleted': percentageCompleted, + if (resourceScanId != null) 'ResourceScanId': resourceScanId, + if (startTime != null) 'StartTime': iso8601ToJson(startTime), + if (status != null) 'Status': status.toValue(), + if (statusReason != null) 'StatusReason': statusReason, }; } } @@ -10892,34 +13192,70 @@ extension ResourceStatusFromString on String { /// The field that CloudFormation will change, such as the name of a resource's /// property, and whether the resource will be recreated. class ResourceTargetDefinition { + /// The value of the property after the change is executed. Large values can be + /// truncated. + final String? afterValue; + /// Indicates which resource attribute is triggering this update, such as a /// change in the resource attribute's Metadata, /// Properties, or Tags. final ResourceAttribute? attribute; + /// The type of change to be made to the property if the change is executed. + /// + ///
      + ///
    • + /// Add The item will be added. + ///
    • + ///
    • + /// Remove The item will be removed. + ///
    • + ///
    • + /// Modify The item will be modified. + ///
    • + ///
    + final AttributeChangeType? attributeChangeType; + + /// The value of the property before the change is executed. Large values can be + /// truncated. + final String? beforeValue; + /// If the Attribute value is Properties, the name of /// the property. For all other attributes, the value is null. final String? name; + /// The property path of the property. + final String? path; + /// If the Attribute value is Properties, indicates /// whether a change to this property causes the resource to be recreated. The /// value can be Never, Always, or /// Conditionally. To determine the conditions for a /// Conditionally recreation, see the update behavior for that property - /// in the CloudFormation User Guide. + /// in the CloudFormation User Guide. final RequiresRecreation? requiresRecreation; ResourceTargetDefinition({ + this.afterValue, this.attribute, + this.attributeChangeType, + this.beforeValue, this.name, + this.path, this.requiresRecreation, }); factory ResourceTargetDefinition.fromXml(_s.XmlElement elem) { return ResourceTargetDefinition( + afterValue: _s.extractXmlStringValue(elem, 'AfterValue'), attribute: _s.extractXmlStringValue(elem, 'Attribute')?.toResourceAttribute(), + attributeChangeType: _s + .extractXmlStringValue(elem, 'AttributeChangeType') + ?.toAttributeChangeType(), + beforeValue: _s.extractXmlStringValue(elem, 'BeforeValue'), name: _s.extractXmlStringValue(elem, 'Name'), + path: _s.extractXmlStringValue(elem, 'Path'), requiresRecreation: _s .extractXmlStringValue(elem, 'RequiresRecreation') ?.toRequiresRecreation(), @@ -10927,12 +13263,21 @@ class ResourceTargetDefinition { } Map toJson() { + final afterValue = this.afterValue; final attribute = this.attribute; + final attributeChangeType = this.attributeChangeType; + final beforeValue = this.beforeValue; final name = this.name; + final path = this.path; final requiresRecreation = this.requiresRecreation; return { + if (afterValue != null) 'AfterValue': afterValue, if (attribute != null) 'Attribute': attribute.toValue(), + if (attributeChangeType != null) + 'AttributeChangeType': attributeChangeType.toValue(), + if (beforeValue != null) 'BeforeValue': beforeValue, if (name != null) 'Name': name, + if (path != null) 'Path': path, if (requiresRecreation != null) 'RequiresRecreation': requiresRecreation.toValue(), }; @@ -10953,7 +13298,7 @@ class ResourceToImport { /// The type of resource to import into your stack, such as /// AWS::S3::Bucket. For a list of supported resource types, see Resources - /// that support import operations in the CloudFormation User Guide. + /// that support import operations in the CloudFormation User Guide. final String resourceType; ResourceToImport({ @@ -10982,7 +13327,7 @@ class ResourceToImport { /// your application during stack creation and updating, and to roll back that /// operation if the application breaches the threshold of any of the alarms /// you've specified. For more information, see Monitor +/// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-rollback-triggers.html">Monitor /// and Roll Back Stack Operations. class RollbackConfiguration { /// The amount of time, in minutes, during which CloudFormation should monitor @@ -11121,9 +13466,105 @@ class RollbackTrigger { } } +/// A scanned resource returned by ListResourceScanResources or +/// ListResourceScanRelatedResources. +class ScannedResource { + /// If true, the resource is managed by a CloudFormation stack. + final bool? managedByStack; + + /// A list of up to 256 key-value pairs that identifies for the scanned + /// resource. The key is the name of one of the primary identifiers for the + /// resource. (Primary identifiers are specified in the + /// primaryIdentifier list in the resource schema.) The value is + /// the value of that primary identifier. For example, for a + /// AWS::DynamoDB::Table resource, the primary identifiers is + /// TableName so the key-value pair could be "TableName": + /// "MyDDBTable". For more information, see primaryIdentifier + /// in the CloudFormation Command Line Interface User guide for extension + /// development. + final Map? resourceIdentifier; + + /// The type of the resource, such as AWS::DynamoDB::Table. For the + /// list of supported resources, see Resource + /// type support In the CloudFormation User Guide + final String? resourceType; + + ScannedResource({ + this.managedByStack, + this.resourceIdentifier, + this.resourceType, + }); + factory ScannedResource.fromXml(_s.XmlElement elem) { + return ScannedResource( + managedByStack: _s.extractXmlBoolValue(elem, 'ManagedByStack'), + resourceIdentifier: Map.fromEntries( + elem.getElement('ResourceIdentifier')?.findElements('entry').map( + (c) => MapEntry( + _s.extractXmlStringValue(c, 'key')!, + _s.extractXmlStringValue(c, 'value')!, + ), + ) ?? + {}, + ), + resourceType: _s.extractXmlStringValue(elem, 'ResourceType'), + ); + } + + Map toJson() { + final managedByStack = this.managedByStack; + final resourceIdentifier = this.resourceIdentifier; + final resourceType = this.resourceType; + return { + if (managedByStack != null) 'ManagedByStack': managedByStack, + if (resourceIdentifier != null) 'ResourceIdentifier': resourceIdentifier, + if (resourceType != null) 'ResourceType': resourceType, + }; + } +} + +/// Identifies a scanned resource. This is used with the +/// ListResourceScanRelatedResources API action. +class ScannedResourceIdentifier { + /// A list of up to 256 key-value pairs that identifies the scanned resource. + /// The key is the name of one of the primary identifiers for the resource. + /// (Primary identifiers are specified in the primaryIdentifier + /// list in the resource schema.) The value is the value of that primary + /// identifier. For example, for a AWS::DynamoDB::Table resource, + /// the primary identifiers is TableName so the key-value pair + /// could be "TableName": "MyDDBTable". For more information, see + /// primaryIdentifier + /// in the CloudFormation Command Line Interface User guide for extension + /// development. + final Map resourceIdentifier; + + /// The type of the resource, such as AWS::DynamoDB::Table. For the + /// list of supported resources, see IaC + /// generator supported resource types In the CloudFormation User + /// Guide. + final String resourceType; + + ScannedResourceIdentifier({ + required this.resourceIdentifier, + required this.resourceType, + }); + + Map toJson() { + final resourceIdentifier = this.resourceIdentifier; + final resourceType = this.resourceType; + return { + 'ResourceIdentifier': resourceIdentifier, + 'ResourceType': resourceType, + }; + } +} + class SetTypeConfigurationOutput { /// The Amazon Resource Name (ARN) for the configuration data, in this account - /// and region. + /// and Region. /// /// Conditional: You must specify ConfigurationArn, or /// Type and TypeName. @@ -11176,12 +13617,36 @@ class Stack { /// The unique ID of the change set. final String? changeSetId; + /// Specifies the deletion mode for the stack. Possible values are: + /// + ///
      + ///
    • + /// STANDARD - Use the standard behavior. Specifying this value is + /// the same as not specifying this parameter. + ///
    • + ///
    • + /// FORCE_DELETE_STACK - Delete the stack if it's stuck in a + /// DELETE_FAILED state due to resource deletion failure. + ///
    • + ///
    + final DeletionMode? deletionMode; + /// The time the stack was deleted. final DateTime? deletionTime; /// A user-defined description associated with the stack. final String? description; + /// The detailed status of the resource or stack. If + /// CONFIGURATION_COMPLETE is present, the resource or resource + /// configuration phase has completed and the stabilization of the resources is + /// in progress. The stack sets CONFIGURATION_COMPLETE when all of + /// the resources in the stack have reached that event. For more information, + /// see CloudFormation + /// stack deployment in the CloudFormation User Guide. + final DetailedStatus? detailedStatus; + /// Boolean to enable or disable rollback on stack creation failures: /// ///
      @@ -11195,20 +13660,20 @@ class Stack { final bool? disableRollback; /// Information about whether a stack's actual configuration differs, or has - /// drifted, from it's expected configuration, as defined in the stack + /// drifted, from its expected configuration, as defined in the stack /// template and any values specified as template parameters. For more /// information, see Detecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting /// Unregulated Configuration Changes to Stacks and Resources. final StackDriftInformation? driftInformation; /// Whether termination protection is enabled for the stack. /// /// For nested + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">nested /// stacks, termination protection is set on the root stack and can't be /// changed directly on the nested stack. For more information, see Protecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html">Protecting /// a Stack From Being Deleted in the CloudFormation User Guide. final bool? enableTerminationProtection; @@ -11231,10 +13696,17 @@ class Stack { /// the root stack is also the parent stack. /// /// For more information, see Working + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">Working /// with Nested Stacks in the CloudFormation User Guide. final String? parentId; + /// When set to true, newly created resources are deleted when the + /// operation rolls back. This includes newly created resources marked with a + /// deletion policy of Retain. + /// + /// Default: false + final bool? retainExceptOnCreate; + /// The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) /// role that's associated with the stack. During a stack operation, /// CloudFormation uses this role's credentials to make calls on your behalf. @@ -11248,7 +13720,7 @@ class Stack { /// ID of the top-level stack to which the nested stack ultimately belongs. /// /// For more information, see Working + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">Working /// with Nested Stacks in the CloudFormation User Guide. final String? rootId; @@ -11270,8 +13742,10 @@ class Stack { required this.stackStatus, this.capabilities, this.changeSetId, + this.deletionMode, this.deletionTime, this.description, + this.detailedStatus, this.disableRollback, this.driftInformation, this.enableTerminationProtection, @@ -11280,6 +13754,7 @@ class Stack { this.outputs, this.parameters, this.parentId, + this.retainExceptOnCreate, this.roleARN, this.rollbackConfiguration, this.rootId, @@ -11299,8 +13774,12 @@ class Stack { .map((s) => s.toCapability()) .toList()), changeSetId: _s.extractXmlStringValue(elem, 'ChangeSetId'), + deletionMode: + _s.extractXmlStringValue(elem, 'DeletionMode')?.toDeletionMode(), deletionTime: _s.extractXmlDateTimeValue(elem, 'DeletionTime'), description: _s.extractXmlStringValue(elem, 'Description'), + detailedStatus: + _s.extractXmlStringValue(elem, 'DetailedStatus')?.toDetailedStatus(), disableRollback: _s.extractXmlBoolValue(elem, 'DisableRollback'), driftInformation: _s .extractXmlChild(elem, 'DriftInformation') @@ -11316,6 +13795,8 @@ class Stack { parameters: _s.extractXmlChild(elem, 'Parameters')?.let((elem) => elem.findElements('member').map(Parameter.fromXml).toList()), parentId: _s.extractXmlStringValue(elem, 'ParentId'), + retainExceptOnCreate: + _s.extractXmlBoolValue(elem, 'RetainExceptOnCreate'), roleARN: _s.extractXmlStringValue(elem, 'RoleARN'), rollbackConfiguration: _s .extractXmlChild(elem, 'RollbackConfiguration') @@ -11335,8 +13816,10 @@ class Stack { final stackStatus = this.stackStatus; final capabilities = this.capabilities; final changeSetId = this.changeSetId; + final deletionMode = this.deletionMode; final deletionTime = this.deletionTime; final description = this.description; + final detailedStatus = this.detailedStatus; final disableRollback = this.disableRollback; final driftInformation = this.driftInformation; final enableTerminationProtection = this.enableTerminationProtection; @@ -11345,6 +13828,7 @@ class Stack { final outputs = this.outputs; final parameters = this.parameters; final parentId = this.parentId; + final retainExceptOnCreate = this.retainExceptOnCreate; final roleARN = this.roleARN; final rollbackConfiguration = this.rollbackConfiguration; final rootId = this.rootId; @@ -11359,8 +13843,10 @@ class Stack { if (capabilities != null) 'Capabilities': capabilities.map((e) => e.toValue()).toList(), if (changeSetId != null) 'ChangeSetId': changeSetId, + if (deletionMode != null) 'DeletionMode': deletionMode.toValue(), if (deletionTime != null) 'DeletionTime': iso8601ToJson(deletionTime), if (description != null) 'Description': description, + if (detailedStatus != null) 'DetailedStatus': detailedStatus.toValue(), if (disableRollback != null) 'DisableRollback': disableRollback, if (driftInformation != null) 'DriftInformation': driftInformation, if (enableTerminationProtection != null) @@ -11371,6 +13857,8 @@ class Stack { if (outputs != null) 'Outputs': outputs, if (parameters != null) 'Parameters': parameters, if (parentId != null) 'ParentId': parentId, + if (retainExceptOnCreate != null) + 'RetainExceptOnCreate': retainExceptOnCreate, if (roleARN != null) 'RoleARN': roleARN, if (rollbackConfiguration != null) 'RollbackConfiguration': rollbackConfiguration, @@ -11600,6 +14088,26 @@ class StackEvent { /// Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002. final String? clientRequestToken; + /// An optional field containing information about the detailed status of the + /// stack event. + /// + ///
        + ///
      • + /// CONFIGURATION_COMPLETE - all of the resources in the stack have + /// reached that event. For more information, see CloudFormation + /// stack deployment in the CloudFormation User Guide. + ///
      • + ///
      + ///
        + ///
      • + /// VALIDATION_FAILED - template validation failed because of + /// invalid properties in the template. The ResourceStatusReason + /// field shows what properties are defined incorrectly. + ///
      • + ///
      + final DetailedStatus? detailedStatus; + /// Specify the hook failure mode for non-compliant resources in the followings /// ways. /// @@ -11644,7 +14152,8 @@ class StackEvent { /// Type of resource. (For more information, go to Amazon - /// Web Services Resource Types Reference in the CloudFormation User Guide.) + /// Web Services Resource Types Reference in the CloudFormation User + /// Guide.) final String? resourceType; StackEvent({ @@ -11653,6 +14162,7 @@ class StackEvent { required this.stackName, required this.timestamp, this.clientRequestToken, + this.detailedStatus, this.hookFailureMode, this.hookInvocationPoint, this.hookStatus, @@ -11672,6 +14182,8 @@ class StackEvent { stackName: _s.extractXmlStringValue(elem, 'StackName')!, timestamp: _s.extractXmlDateTimeValue(elem, 'Timestamp')!, clientRequestToken: _s.extractXmlStringValue(elem, 'ClientRequestToken'), + detailedStatus: + _s.extractXmlStringValue(elem, 'DetailedStatus')?.toDetailedStatus(), hookFailureMode: _s .extractXmlStringValue(elem, 'HookFailureMode') ?.toHookFailureMode(), @@ -11698,6 +14210,7 @@ class StackEvent { final stackName = this.stackName; final timestamp = this.timestamp; final clientRequestToken = this.clientRequestToken; + final detailedStatus = this.detailedStatus; final hookFailureMode = this.hookFailureMode; final hookInvocationPoint = this.hookInvocationPoint; final hookStatus = this.hookStatus; @@ -11715,6 +14228,7 @@ class StackEvent { 'StackName': stackName, 'Timestamp': iso8601ToJson(timestamp), if (clientRequestToken != null) 'ClientRequestToken': clientRequestToken, + if (detailedStatus != null) 'DetailedStatus': detailedStatus.toValue(), if (hookFailureMode != null) 'HookFailureMode': hookFailureMode.toValue(), if (hookInvocationPoint != null) 'HookInvocationPoint': hookInvocationPoint.toValue(), @@ -11809,7 +14323,12 @@ class StackInstance { /// excluded from further UpdateStackSet operations. You might need /// to perform a DeleteStackInstances operation, with /// RetainStacks set to true, to delete the stack - /// instance, and then delete the stack manually. + /// instance, and then delete the stack manually. INOPERABLE can be + /// returned here when the cause is a failed import. If it's due to a failed + /// import, the operation can be retried once the failures are fixed. To see if + /// this is due to a failed import, look at the DetailedStatus + /// member in the StackInstanceSummary member that is a peer to + /// this Status member. /// ///
    • /// OUTDATED: The stack isn't currently up to date with the stack @@ -11923,6 +14442,14 @@ class StackInstanceComprehensiveStatus { /// exceeded. ///
    • ///
    • + /// FAILED_IMPORT: The import of the stack instance in the + /// specified account and Region failed and left the stack in an unstable state. + /// Once the issues causing the failure are fixed, the import operation can be + /// retried. If enough stack set operations fail in enough accounts within a + /// Region, the failure tolerance for the stack set operation as a whole might + /// be exceeded. + ///
    • + ///
    • /// INOPERABLE: A DeleteStackInstances operation has /// failed and left the stack in an unstable state. Stacks in this state are /// excluded from further UpdateStackSet operations. You might need @@ -11939,6 +14466,11 @@ class StackInstanceComprehensiveStatus { /// currently in progress. ///
    • ///
    • + /// SKIPPED_SUSPENDED_ACCOUNT: The operation in the specified + /// account and Region has been skipped because the account was suspended at the + /// time of the operation. + ///
    • + ///
    • /// SUCCEEDED: The operation in the specified account and Region /// completed successfully. ///
    • @@ -11971,6 +14503,8 @@ enum StackInstanceDetailedStatus { failed, cancelled, inoperable, + skippedSuspendedAccount, + failedImport, } extension StackInstanceDetailedStatusValueExtension @@ -11989,6 +14523,10 @@ extension StackInstanceDetailedStatusValueExtension return 'CANCELLED'; case StackInstanceDetailedStatus.inoperable: return 'INOPERABLE'; + case StackInstanceDetailedStatus.skippedSuspendedAccount: + return 'SKIPPED_SUSPENDED_ACCOUNT'; + case StackInstanceDetailedStatus.failedImport: + return 'FAILED_IMPORT'; } } } @@ -12008,6 +14546,10 @@ extension StackInstanceDetailedStatusFromString on String { return StackInstanceDetailedStatus.cancelled; case 'INOPERABLE': return StackInstanceDetailedStatus.inoperable; + case 'SKIPPED_SUSPENDED_ACCOUNT': + return StackInstanceDetailedStatus.skippedSuspendedAccount; + case 'FAILED_IMPORT': + return StackInstanceDetailedStatus.failedImport; } throw Exception('$this is not known in enum StackInstanceDetailedStatus'); } @@ -12039,6 +14581,7 @@ class StackInstanceFilter { enum StackInstanceFilterName { detailedStatus, lastOperationId, + driftStatus, } extension StackInstanceFilterNameValueExtension on StackInstanceFilterName { @@ -12048,6 +14591,8 @@ extension StackInstanceFilterNameValueExtension on StackInstanceFilterName { return 'DETAILED_STATUS'; case StackInstanceFilterName.lastOperationId: return 'LAST_OPERATION_ID'; + case StackInstanceFilterName.driftStatus: + return 'DRIFT_STATUS'; } } } @@ -12059,11 +14604,127 @@ extension StackInstanceFilterNameFromString on String { return StackInstanceFilterName.detailedStatus; case 'LAST_OPERATION_ID': return StackInstanceFilterName.lastOperationId; + case 'DRIFT_STATUS': + return StackInstanceFilterName.driftStatus; } throw Exception('$this is not known in enum StackInstanceFilterName'); } } +/// The structure containing summary information about resource drifts for a +/// stack instance. +class StackInstanceResourceDriftsSummary { + /// The logical name of the resource specified in the template. + final String logicalResourceId; + + /// Type of resource. For more information, go to Amazon + /// Web Services Resource Types Reference in the CloudFormation User + /// Guide. + final String resourceType; + + /// The ID of the stack instance. + final String stackId; + + /// The drift status of the resource in a stack instance. + /// + ///
        + ///
      • + /// DELETED: The resource differs from its expected template + /// configuration in that the resource has been deleted. + ///
      • + ///
      • + /// MODIFIED: One or more resource properties differ from their + /// expected template values. + ///
      • + ///
      • + /// IN_SYNC: The resource's actual configuration matches its + /// expected template configuration. + ///
      • + ///
      • + /// NOT_CHECKED: CloudFormation doesn't currently return this + /// value. + ///
      • + ///
      + final StackResourceDriftStatus stackResourceDriftStatus; + + /// Time at which the stack instance drift detection operation was initiated. + final DateTime timestamp; + + /// The name or unique identifier that corresponds to a physical instance ID of + /// a resource supported by CloudFormation. + final String? physicalResourceId; + + /// Context information that enables CloudFormation to uniquely identify a + /// resource. CloudFormation uses context key-value pairs in cases where a + /// resource's logical and physical IDs aren't enough to uniquely identify that + /// resource. Each context key-value pair specifies a unique resource that + /// contains the targeted resource. + final List? physicalResourceIdContext; + + /// Status of the actual configuration of the resource compared to its expected + /// configuration. These will be present only for resources whose + /// StackInstanceResourceDriftStatus is MODIFIED. + final List? propertyDifferences; + + StackInstanceResourceDriftsSummary({ + required this.logicalResourceId, + required this.resourceType, + required this.stackId, + required this.stackResourceDriftStatus, + required this.timestamp, + this.physicalResourceId, + this.physicalResourceIdContext, + this.propertyDifferences, + }); + factory StackInstanceResourceDriftsSummary.fromXml(_s.XmlElement elem) { + return StackInstanceResourceDriftsSummary( + logicalResourceId: _s.extractXmlStringValue(elem, 'LogicalResourceId')!, + resourceType: _s.extractXmlStringValue(elem, 'ResourceType')!, + stackId: _s.extractXmlStringValue(elem, 'StackId')!, + stackResourceDriftStatus: _s + .extractXmlStringValue(elem, 'StackResourceDriftStatus')! + .toStackResourceDriftStatus(), + timestamp: _s.extractXmlDateTimeValue(elem, 'Timestamp')!, + physicalResourceId: _s.extractXmlStringValue(elem, 'PhysicalResourceId'), + physicalResourceIdContext: _s + .extractXmlChild(elem, 'PhysicalResourceIdContext') + ?.let((elem) => elem + .findElements('member') + .map(PhysicalResourceIdContextKeyValuePair.fromXml) + .toList()), + propertyDifferences: _s.extractXmlChild(elem, 'PropertyDifferences')?.let( + (elem) => elem + .findElements('member') + .map(PropertyDifference.fromXml) + .toList()), + ); + } + + Map toJson() { + final logicalResourceId = this.logicalResourceId; + final resourceType = this.resourceType; + final stackId = this.stackId; + final stackResourceDriftStatus = this.stackResourceDriftStatus; + final timestamp = this.timestamp; + final physicalResourceId = this.physicalResourceId; + final physicalResourceIdContext = this.physicalResourceIdContext; + final propertyDifferences = this.propertyDifferences; + return { + 'LogicalResourceId': logicalResourceId, + 'ResourceType': resourceType, + 'StackId': stackId, + 'StackResourceDriftStatus': stackResourceDriftStatus.toValue(), + 'Timestamp': iso8601ToJson(timestamp), + if (physicalResourceId != null) 'PhysicalResourceId': physicalResourceId, + if (physicalResourceIdContext != null) + 'PhysicalResourceIdContext': physicalResourceIdContext, + if (propertyDifferences != null) + 'PropertyDifferences': propertyDifferences, + }; + } +} + enum StackInstanceStatus { current, outdated, @@ -12164,7 +14825,12 @@ class StackInstanceSummary { /// excluded from further UpdateStackSet operations. You might need /// to perform a DeleteStackInstances operation, with /// RetainStacks set to true, to delete the stack - /// instance, and then delete the stack manually. + /// instance, and then delete the stack manually. INOPERABLE can be + /// returned here when the cause is a failed import. If it's due to a failed + /// import, the operation can be retried once the failures are fixed. To see if + /// this is due to a failed import, call the DescribeStackInstance API + /// operation, look at the DetailedStatus member returned in the + /// StackInstanceSummary member. /// ///
    • /// OUTDATED: The stack isn't currently up to date with the stack @@ -12266,7 +14932,8 @@ class StackResource { /// Type of resource. For more information, go to Amazon - /// Web Services Resource Types Reference in the CloudFormation User Guide. + /// Web Services Resource Types Reference in the CloudFormation User + /// Guide. final String resourceType; /// Time the status was updated. @@ -12279,7 +14946,7 @@ class StackResource { /// has drifted, from its expected configuration, as defined in the stack /// template and any values specified as template parameters. For more /// information, see Detecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting /// Unregulated Configuration Changes to Stacks and Resources. final StackResourceDriftInformation? driftInformation; @@ -12376,7 +15043,8 @@ class StackResourceDetail { /// Type of resource. For more information, go to Amazon - /// Web Services Resource Types Reference in the CloudFormation User Guide. + /// Web Services Resource Types Reference in the CloudFormation User + /// Guide. final String resourceType; /// User defined description associated with the resource. @@ -12386,14 +15054,14 @@ class StackResourceDetail { /// has drifted, from its expected configuration, as defined in the stack /// template and any values specified as template parameters. For more /// information, see Detecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting /// Unregulated Configuration Changes to Stacks and Resources. final StackResourceDriftInformation? driftInformation; /// The content of the Metadata attribute declared for the /// resource. For more information, see Metadata - /// Attribute in the CloudFormation User Guide. + /// Attribute in the CloudFormation User Guide. final String? metadata; /// Contains information about the module from which the resource was created, @@ -12491,7 +15159,7 @@ class StackResourceDetail { /// /// Resources that don't currently support drift detection can't be checked. For /// a list of resources that support drift detection, see Resources +/// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html">Resources /// that Support Drift Detection. /// /// Use DetectStackResourceDrift to detect drift on individual resources, @@ -12816,14 +15484,15 @@ class StackResourceSummary { /// Type of resource. (For more information, go to Amazon - /// Web Services Resource Types Reference in the CloudFormation User Guide.) + /// Web Services Resource Types Reference in the CloudFormation User + /// Guide.) final String resourceType; /// Information about whether the resource's actual configuration differs, or /// has drifted, from its expected configuration, as defined in the stack /// template and any values specified as template parameters. For more /// information, see Detecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting /// Unregulated Configuration Changes to Stacks and Resources. final StackResourceDriftInformationSummary? driftInformation; @@ -12902,7 +15571,7 @@ class StackSet { /// Use customized administrator roles to control which users or groups can /// manage specific stack sets within the same administrator account. For more /// information, see Prerequisites: + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html">Prerequisites: /// Granting Permissions for Stack Set Operations in the CloudFormation /// User Guide. final String? administrationRoleARN; @@ -12961,6 +15630,10 @@ class StackSet { ///
    • ///
    final PermissionModels? permissionModel; + + /// Returns a list of all Amazon Web Services Regions the given StackSet has + /// stack instances deployed in. The Amazon Web Services Regions list output is + /// in no particular order. final List? regions; /// The Amazon Resource Name (ARN) of the stack set. @@ -13093,6 +15766,42 @@ class StackSet { } } +/// One of the targets for the stack set. Returned by the ListStackSetAutoDeploymentTargets +/// API operation. +class StackSetAutoDeploymentTargetSummary { + /// The organization root ID or organizational unit (OU) IDs where the stack set + /// is targeted. + final String? organizationalUnitId; + + /// The list of Regions targeted for this organization or OU. + final List? regions; + + StackSetAutoDeploymentTargetSummary({ + this.organizationalUnitId, + this.regions, + }); + factory StackSetAutoDeploymentTargetSummary.fromXml(_s.XmlElement elem) { + return StackSetAutoDeploymentTargetSummary( + organizationalUnitId: + _s.extractXmlStringValue(elem, 'OrganizationalUnitId'), + regions: _s + .extractXmlChild(elem, 'Regions') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + ); + } + + Map toJson() { + final organizationalUnitId = this.organizationalUnitId; + final regions = this.regions; + return { + if (organizationalUnitId != null) + 'OrganizationalUnitId': organizationalUnitId, + if (regions != null) 'Regions': regions, + }; + } +} + /// Detailed information about the drift status of the stack set. /// /// For stack sets, contains information about the last completed drift @@ -13350,7 +16059,7 @@ class StackSetOperation { /// Use customized administrator roles to control which users or groups can /// manage specific stack sets within the same administrator account. For more /// information, see Define + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html">Define /// Permissions for Multiple Administrators in the CloudFormation User /// Guide. final String? administrationRoleARN; @@ -13398,7 +16107,7 @@ class StackSetOperation { /// /// For more information, see Detecting - /// Unmanaged Changes in Stack Sets in the CloudFormation User Guide. + /// Unmanaged Changes in Stack Sets in the CloudFormation User Guide. final StackSetDriftDetectionDetails? stackSetDriftDetectionDetails; /// The ID of the stack set. @@ -13421,7 +16130,7 @@ class StackSetOperation { /// that require a sequence of operations, the operation is queued to be /// performed. For more information, see the stack - /// set operation status codes in the CloudFormation User Guide. + /// set operation status codes in the CloudFormation User Guide. ///
  • ///
  • /// RUNNING: The operation is currently being performed. @@ -13576,6 +16285,32 @@ extension StackSetOperationActionFromString on String { /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options">Stack /// set operation options. class StackSetOperationPreferences { + /// Specifies how the concurrency level behaves during the operation execution. + /// + ///
      + ///
    • + /// STRICT_FAILURE_TOLERANCE: This option dynamically lowers the + /// concurrency level to ensure the number of failed accounts never exceeds the + /// value of FailureToleranceCount +1. The initial actual + /// concurrency is set to the lower of either the value of the + /// MaxConcurrentCount, or the value of + /// FailureToleranceCount +1. The actual concurrency is then + /// reduced proportionally by the number of failures. This is the default + /// behavior. + /// + /// If failure tolerance or Maximum concurrent accounts are set to percentages, + /// the behavior is similar. + ///
    • + ///
    • + /// SOFT_FAILURE_TOLERANCE: This option decouples + /// FailureToleranceCount from the actual concurrency. This allows + /// stack set operations to run at the concurrency level set by the + /// MaxConcurrentCount value, or + /// MaxConcurrentPercentage, regardless of the number of failures. + ///
    • + ///
    + final ConcurrencyMode? concurrencyMode; + /// The number of accounts, per Region, for which this operation can fail before /// CloudFormation stops the operation in that Region. If the operation is /// stopped in a Region, CloudFormation doesn't attempt the operation in any @@ -13602,9 +16337,11 @@ class StackSetOperationPreferences { final int? failureTolerancePercentage; /// The maximum number of accounts in which to perform this operation at one - /// time. This is dependent on the value of - /// FailureToleranceCount.MaxConcurrentCount is at - /// most one more than the FailureToleranceCount. + /// time. This can depend on the value of FailureToleranceCount + /// depending on your ConcurrencyMode. + /// MaxConcurrentCount is at most one more than the + /// FailureToleranceCount if you're using + /// STRICT_FAILURE_TOLERANCE. /// /// Note that this setting lets you specify the maximum for operations. /// For large deployments, under certain circumstances the actual number of @@ -13638,10 +16375,15 @@ class StackSetOperationPreferences { /// in parallel or one Region at a time. final RegionConcurrencyType? regionConcurrencyType; - /// The order of the Regions in where you want to perform the stack operation. + /// The order of the Regions where you want to perform the stack operation. + /// + /// RegionOrder isn't followed if AutoDeployment is + /// enabled. + /// final List? regionOrder; StackSetOperationPreferences({ + this.concurrencyMode, this.failureToleranceCount, this.failureTolerancePercentage, this.maxConcurrentCount, @@ -13651,6 +16393,9 @@ class StackSetOperationPreferences { }); factory StackSetOperationPreferences.fromXml(_s.XmlElement elem) { return StackSetOperationPreferences( + concurrencyMode: _s + .extractXmlStringValue(elem, 'ConcurrencyMode') + ?.toConcurrencyMode(), failureToleranceCount: _s.extractXmlIntValue(elem, 'FailureToleranceCount'), failureTolerancePercentage: @@ -13668,6 +16413,7 @@ class StackSetOperationPreferences { } Map toJson() { + final concurrencyMode = this.concurrencyMode; final failureToleranceCount = this.failureToleranceCount; final failureTolerancePercentage = this.failureTolerancePercentage; final maxConcurrentCount = this.maxConcurrentCount; @@ -13675,6 +16421,7 @@ class StackSetOperationPreferences { final regionConcurrencyType = this.regionConcurrencyType; final regionOrder = this.regionOrder; return { + if (concurrencyMode != null) 'ConcurrencyMode': concurrencyMode.toValue(), if (failureToleranceCount != null) 'FailureToleranceCount': failureToleranceCount, if (failureTolerancePercentage != null) @@ -13926,6 +16673,14 @@ class StackSetOperationSummary { /// The unique ID of the stack set operation. final String? operationId; + + /// The user-specified preferences for how CloudFormation performs a stack set + /// operation. + /// + /// For more information about maximum concurrent accounts and failure + /// tolerance, see Stack + /// set operation options. final StackSetOperationPreferences? operationPreferences; /// The overall status of the operation. @@ -13945,7 +16700,7 @@ class StackSetOperationSummary { /// that require a sequence of operations, the operation is queued to be /// performed. For more information, see the stack - /// set operation status codes in the CloudFormation User Guide. + /// set operation status codes in the CloudFormation User Guide. ///
  • ///
  • /// RUNNING: The operation is currently being performed. @@ -14333,10 +17088,10 @@ class StackSummary { final DateTime? deletionTime; /// Summarizes information about whether a stack's actual configuration differs, - /// or has drifted, from it's expected configuration, as defined in the + /// or has drifted, from its expected configuration, as defined in the /// stack template and any values specified as template parameters. For more /// information, see Detecting + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html">Detecting /// Unregulated Configuration Changes to Stacks and Resources. final StackDriftInformationSummary? driftInformation; @@ -14349,7 +17104,7 @@ class StackSummary { /// the root stack is also the parent stack. /// /// For more information, see Working + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">Working /// with Nested Stacks in the CloudFormation User Guide. final String? parentId; @@ -14357,7 +17112,7 @@ class StackSummary { /// ID of the top-level stack to which the nested stack ultimately belongs. /// /// For more information, see Working + /// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html">Working /// with Nested Stacks in the CloudFormation User Guide. final String? rootId; @@ -14433,6 +17188,31 @@ class StackSummary { } } +class StartResourceScanOutput { + /// The Amazon Resource Name (ARN) of the resource scan. The format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}. + /// An example is + /// arn:aws:cloudformation:us-east-1:123456789012:resourceScan/f5b490f7-7ed4-428a-aa06-31ff25db0772 + /// . + final String? resourceScanId; + + StartResourceScanOutput({ + this.resourceScanId, + }); + factory StartResourceScanOutput.fromXml(_s.XmlElement elem) { + return StartResourceScanOutput( + resourceScanId: _s.extractXmlStringValue(elem, 'ResourceScanId'), + ); + } + + Map toJson() { + final resourceScanId = this.resourceScanId; + return { + if (resourceScanId != null) 'ResourceScanId': resourceScanId, + }; + } +} + class StopStackSetOperationOutput { StopStackSetOperationOutput(); factory StopStackSetOperationOutput.fromXml( @@ -14479,6 +17259,96 @@ class Tag { } } +/// The configuration details of a generated template. +class TemplateConfiguration { + /// The DeletionPolicy assigned to resources in the generated + /// template. Supported values are: + /// + ///
      + ///
    • + /// DELETE - delete all resources when the stack is deleted. + ///
    • + ///
    • + /// RETAIN - retain all resources when the stack is deleted. + ///
    • + ///
    + /// For more information, see DeletionPolicy + /// attribute in the CloudFormation User Guide. + final GeneratedTemplateDeletionPolicy? deletionPolicy; + + /// The UpdateReplacePolicy assigned to resources in the generated + /// template. Supported values are: + /// + ///
      + ///
    • + /// DELETE - delete all resources when the resource is replaced + /// during an update operation. + ///
    • + ///
    • + /// RETAIN - retain all resources when the resource is replaced + /// during an update operation. + ///
    • + ///
    + /// For more information, see UpdateReplacePolicy + /// attribute in the CloudFormation User Guide. + final GeneratedTemplateUpdateReplacePolicy? updateReplacePolicy; + + TemplateConfiguration({ + this.deletionPolicy, + this.updateReplacePolicy, + }); + factory TemplateConfiguration.fromXml(_s.XmlElement elem) { + return TemplateConfiguration( + deletionPolicy: _s + .extractXmlStringValue(elem, 'DeletionPolicy') + ?.toGeneratedTemplateDeletionPolicy(), + updateReplacePolicy: _s + .extractXmlStringValue(elem, 'UpdateReplacePolicy') + ?.toGeneratedTemplateUpdateReplacePolicy(), + ); + } + + Map toJson() { + final deletionPolicy = this.deletionPolicy; + final updateReplacePolicy = this.updateReplacePolicy; + return { + if (deletionPolicy != null) 'DeletionPolicy': deletionPolicy.toValue(), + if (updateReplacePolicy != null) + 'UpdateReplacePolicy': updateReplacePolicy.toValue(), + }; + } +} + +enum TemplateFormat { + json, + yaml, +} + +extension TemplateFormatValueExtension on TemplateFormat { + String toValue() { + switch (this) { + case TemplateFormat.json: + return 'JSON'; + case TemplateFormat.yaml: + return 'YAML'; + } + } +} + +extension TemplateFormatFromString on String { + TemplateFormat toTemplateFormat() { + switch (this) { + case 'JSON': + return TemplateFormat.json; + case 'YAML': + return TemplateFormat.yaml; + } + throw Exception('$this is not known in enum TemplateFormat'); + } +} + /// The TemplateParameter data type. class TemplateParameter { /// The default value associated with the parameter. @@ -14523,6 +17393,50 @@ class TemplateParameter { } } +/// A summary of the progress of the template generation. +class TemplateProgress { + /// The number of resources that failed the template generation. + final int? resourcesFailed; + + /// The number of resources that are still pending the template generation. + final int? resourcesPending; + + /// The number of resources that are in-process for the template generation. + final int? resourcesProcessing; + + /// The number of resources that succeeded the template generation. + final int? resourcesSucceeded; + + TemplateProgress({ + this.resourcesFailed, + this.resourcesPending, + this.resourcesProcessing, + this.resourcesSucceeded, + }); + factory TemplateProgress.fromXml(_s.XmlElement elem) { + return TemplateProgress( + resourcesFailed: _s.extractXmlIntValue(elem, 'ResourcesFailed'), + resourcesPending: _s.extractXmlIntValue(elem, 'ResourcesPending'), + resourcesProcessing: _s.extractXmlIntValue(elem, 'ResourcesProcessing'), + resourcesSucceeded: _s.extractXmlIntValue(elem, 'ResourcesSucceeded'), + ); + } + + Map toJson() { + final resourcesFailed = this.resourcesFailed; + final resourcesPending = this.resourcesPending; + final resourcesProcessing = this.resourcesProcessing; + final resourcesSucceeded = this.resourcesSucceeded; + return { + if (resourcesFailed != null) 'ResourcesFailed': resourcesFailed, + if (resourcesPending != null) 'ResourcesPending': resourcesPending, + if (resourcesProcessing != null) + 'ResourcesProcessing': resourcesProcessing, + if (resourcesSucceeded != null) 'ResourcesSucceeded': resourcesSucceeded, + }; + } +} + enum TemplateStage { original, processed, @@ -14551,6 +17465,131 @@ extension TemplateStageFromString on String { } } +/// The summary of a generated template. +class TemplateSummary { + /// The time the generated template was created. + final DateTime? creationTime; + + /// The Amazon Resource Name (ARN) of the generated template. The format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. + /// For example, + /// arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc + /// . + final String? generatedTemplateId; + + /// The name of the generated template. + final String? generatedTemplateName; + + /// The time the generated template was last updated. + final DateTime? lastUpdatedTime; + + /// The number of resources in the generated template. This is a total of + /// resources in pending, in-progress, completed, and failed states. + final int? numberOfResources; + + /// The status of the template generation. Supported values are: + /// + ///
      + ///
    • + /// CreatePending - the creation of the template is pending. + ///
    • + ///
    • + /// CreateInProgress - the creation of the template is in progress. + ///
    • + ///
    • + /// DeletePending - the deletion of the template is pending. + ///
    • + ///
    • + /// DeleteInProgress - the deletion of the template is in progress. + ///
    • + ///
    • + /// UpdatePending - the update of the template is pending. + ///
    • + ///
    • + /// UpdateInProgress - the update of the template is in progress. + ///
    • + ///
    • + /// Failed - the template operation failed. + ///
    • + ///
    • + /// Complete - the template operation is complete. + ///
    • + ///
    + final GeneratedTemplateStatus? status; + + /// The reason for the current template generation status. This will provide + /// more details if a failure happened. + final String? statusReason; + + TemplateSummary({ + this.creationTime, + this.generatedTemplateId, + this.generatedTemplateName, + this.lastUpdatedTime, + this.numberOfResources, + this.status, + this.statusReason, + }); + factory TemplateSummary.fromXml(_s.XmlElement elem) { + return TemplateSummary( + creationTime: _s.extractXmlDateTimeValue(elem, 'CreationTime'), + generatedTemplateId: + _s.extractXmlStringValue(elem, 'GeneratedTemplateId'), + generatedTemplateName: + _s.extractXmlStringValue(elem, 'GeneratedTemplateName'), + lastUpdatedTime: _s.extractXmlDateTimeValue(elem, 'LastUpdatedTime'), + numberOfResources: _s.extractXmlIntValue(elem, 'NumberOfResources'), + status: + _s.extractXmlStringValue(elem, 'Status')?.toGeneratedTemplateStatus(), + statusReason: _s.extractXmlStringValue(elem, 'StatusReason'), + ); + } + + Map toJson() { + final creationTime = this.creationTime; + final generatedTemplateId = this.generatedTemplateId; + final generatedTemplateName = this.generatedTemplateName; + final lastUpdatedTime = this.lastUpdatedTime; + final numberOfResources = this.numberOfResources; + final status = this.status; + final statusReason = this.statusReason; + return { + if (creationTime != null) 'CreationTime': iso8601ToJson(creationTime), + if (generatedTemplateId != null) + 'GeneratedTemplateId': generatedTemplateId, + if (generatedTemplateName != null) + 'GeneratedTemplateName': generatedTemplateName, + if (lastUpdatedTime != null) + 'LastUpdatedTime': iso8601ToJson(lastUpdatedTime), + if (numberOfResources != null) 'NumberOfResources': numberOfResources, + if (status != null) 'Status': status.toValue(), + if (statusReason != null) 'StatusReason': statusReason, + }; + } +} + +/// Options for the GetTemplateSummary API action. +class TemplateSummaryConfig { + /// If set to True, any unrecognized resource types generate + /// warnings and not an error. Any unrecognized resource types are returned in + /// the Warnings output parameter. + final bool? treatUnrecognizedResourceTypesAsWarnings; + + TemplateSummaryConfig({ + this.treatUnrecognizedResourceTypesAsWarnings, + }); + + Map toJson() { + final treatUnrecognizedResourceTypesAsWarnings = + this.treatUnrecognizedResourceTypesAsWarnings; + return { + if (treatUnrecognizedResourceTypesAsWarnings != null) + 'TreatUnrecognizedResourceTypesAsWarnings': + treatUnrecognizedResourceTypesAsWarnings, + }; + } +} + class TestTypeOutput { /// The Amazon Resource Name (ARN) of the extension. final String? typeVersionArn; @@ -14606,10 +17645,10 @@ extension ThirdPartyTypeFromString on String { } /// Detailed information concerning the specification of a CloudFormation -/// extension in a given account and region. +/// extension in a given account and Region. /// /// For more information, see Configuring +/// href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-private.html#registry-set-configuration">Configuring /// extensions at the account level in the CloudFormation User Guide. class TypeConfigurationDetails { /// The alias specified for this configuration, if one was specified when the @@ -14617,11 +17656,11 @@ class TypeConfigurationDetails { final String? alias; /// The Amazon Resource Name (ARN) for the configuration data, in this account - /// and region. + /// and Region. final String? arn; /// A JSON string specifying the configuration data for the extension, in this - /// account and region. + /// account and Region. /// /// If a configuration hasn't been set for a specified extension, CloudFormation /// returns {}. @@ -14638,14 +17677,14 @@ class TypeConfigurationDetails { final DateTime? lastUpdated; /// The Amazon Resource Name (ARN) for the extension, in this account and - /// region. - /// - /// For public extensions, this will be the ARN assigned when you activate - /// the type in this account and region. For private extensions, this will - /// be the ARN assigned when you register - /// the type in this account and region. + /// Region. + /// + /// For public extensions, this will be the ARN assigned when you call the ActivateType + /// API operation in this account and Region. For private extensions, this will + /// be the ARN assigned when you call the RegisterType + /// API operation in this account and Region. final String? typeArn; /// The name of the extension. @@ -14700,14 +17739,14 @@ class TypeConfigurationIdentifier { final ThirdPartyType? type; /// The Amazon Resource Name (ARN) for the extension, in this account and - /// region. - /// - /// For public extensions, this will be the ARN assigned when you activate - /// the type in this account and region. For private extensions, this will - /// be the ARN assigned when you register - /// the type in this account and region. + /// Region. + /// + /// For public extensions, this will be the ARN assigned when you call the ActivateType + /// API operation in this account and Region. For private extensions, this will + /// be the ARN assigned when you call the RegisterType + /// API operation in this account and Region. final String? typeArn; /// The alias specified for this configuration, if one was specified when the @@ -14715,7 +17754,7 @@ class TypeConfigurationIdentifier { final String? typeConfigurationAlias; /// The Amazon Resource Name (ARN) for the configuration, in this account and - /// region. + /// Region. final String? typeConfigurationArn; /// The name of the extension type to which this configuration applies. @@ -14765,11 +17804,11 @@ class TypeFilters { ///
      ///
    • /// REGISTERED: Private extensions that have been registered for - /// this account and region. + /// this account and Region. ///
    • ///
    • /// ACTIVATED: Public extensions that have been activated for this - /// account and region. + /// account and Region. ///
    • ///
    • /// THIRD_PARTY: Extensions available for use from publishers other @@ -14829,14 +17868,14 @@ class TypeSummary { /// RegisterType. /// - /// To set the default version of an extension, use - /// SetTypeDefaultVersion . + /// To set the default version of an extension, use + /// SetTypeDefaultVersion. final String? defaultVersionId; /// The description of the extension. final String? description; - /// Whether the extension is activated for this account and region. + /// Whether the extension is activated for this account and Region. /// /// This applies only to third-party public extensions. Extensions published by /// Amazon are activated by default. @@ -14859,38 +17898,38 @@ class TypeSummary { /// For all other extension types, CloudFormation returns null. final DateTime? lastUpdated; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the latest version of the public extension that is available. For any /// extensions other than activated third-arty extensions, CloudFormation /// returns null. /// /// How you specified AutoUpdate when enabling the extension /// affects whether CloudFormation automatically updates the extension in this - /// account and region when a new version is released. For more information, see + /// account and Region when a new version is released. For more information, see /// Setting /// CloudFormation to automatically use new versions of extensions in the /// CloudFormation User Guide. final String? latestPublicVersion; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the type name of the public extension. /// /// If you specified a TypeNameAlias when enabling the extension in - /// this account and region, CloudFormation treats that alias as the extension's - /// type name within the account and region, not the type name of the public + /// this account and Region, CloudFormation treats that alias as the extension's + /// type name within the account and Region, not the type name of the public /// extension. For more information, see Specifying /// aliases to refer to extensions in the CloudFormation User Guide. final String? originalTypeName; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the version of the public extension to be used for CloudFormation operations /// in this account and Region. /// /// How you specified AutoUpdate when enabling the extension /// affects whether CloudFormation automatically updates the extension in this - /// account and region when a new version is released. For more information, see + /// account and Region when a new version is released. For more information, see /// Setting /// CloudFormation to automatically use new versions of extensions in the @@ -14921,9 +17960,9 @@ class TypeSummary { /// The name of the extension. /// - /// If you specified a TypeNameAlias when you activate - /// this extension in your account and region, CloudFormation considers that + /// If you specified a TypeNameAlias when you call the ActivateType + /// API operation in your account and Region, CloudFormation considers that /// alias as the type name. final String? typeName; @@ -15053,14 +18092,14 @@ class TypeVersionSummary { /// CloudFormation returns null. final bool? isDefaultVersion; - /// For public extensions that have been activated for this account and region, + /// For public extensions that have been activated for this account and Region, /// the version of the public extension to be used for CloudFormation operations - /// in this account and region. For any extensions other than activated + /// in this account and Region. For any extensions other than activated /// third-arty extensions, CloudFormation returns null. /// /// How you specified AutoUpdate when enabling the extension /// affects whether CloudFormation automatically updates the extension in this - /// account and region when a new version is released. For more information, see + /// account and Region when a new version is released. For more information, see /// Setting /// CloudFormation to automatically use new versions of extensions in the @@ -15128,6 +18167,33 @@ class TypeVersionSummary { } } +class UpdateGeneratedTemplateOutput { + /// The Amazon Resource Name (ARN) of the generated template. The format is + /// arn:${Partition}:cloudformation:${Region}:${Account}:generatedtemplate/${Id}. + /// For example, + /// arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/2e8465c1-9a80-43ea-a3a3-4f2d692fe6dc + /// . + final String? generatedTemplateId; + + UpdateGeneratedTemplateOutput({ + this.generatedTemplateId, + }); + factory UpdateGeneratedTemplateOutput.fromXml(_s.XmlElement elem) { + return UpdateGeneratedTemplateOutput( + generatedTemplateId: + _s.extractXmlStringValue(elem, 'GeneratedTemplateId'), + ); + } + + Map toJson() { + final generatedTemplateId = this.generatedTemplateId; + return { + if (generatedTemplateId != null) + 'GeneratedTemplateId': generatedTemplateId, + }; + } +} + class UpdateStackInstancesOutput { /// The unique identifier for this stack set operation. final String? operationId; @@ -15335,6 +18401,165 @@ extension VisibilityFromString on String { } } +/// The warnings generated for a specific resource for this generated template. +class WarningDetail { + /// The properties of the resource that are impacted by this warning. + final List? properties; + + /// The type of this warning. For more information, see IaC + /// generator and write-only properties in the CloudFormation User + /// Guide. + /// + ///
        + ///
      • + /// MUTUALLY_EXCLUSIVE_PROPERTIES - The resource requires + /// mutually-exclusive write-only properties. The IaC generator selects one set + /// of mutually exclusive properties and converts the included properties into + /// parameters. The parameter names have a suffix OneOf and the + /// parameter descriptions indicate that the corresponding property can be + /// replaced with other exclusive properties. + ///
      • + ///
      • + /// UNSUPPORTED_PROPERTIES - Unsupported properties are present in + /// the resource. One example of unsupported properties would be a required + /// write-only property that is an array, because a parameter cannot be an + /// array. Another example is an optional write-only property. + ///
      • + ///
      • + /// MUTUALLY_EXCLUSIVE_TYPES - One or more required write-only + /// properties are found in the resource, and the type of that property can be + /// any of several types. + ///
      • + ///
      + /// Currently the resource and property reference documentation does not + /// indicate if a property uses a type of oneOf or + /// anyOf. You need to look at the resource provider schema. + /// + final WarningType? type; + + WarningDetail({ + this.properties, + this.type, + }); + factory WarningDetail.fromXml(_s.XmlElement elem) { + return WarningDetail( + properties: _s.extractXmlChild(elem, 'Properties')?.let((elem) => + elem.findElements('member').map(WarningProperty.fromXml).toList()), + type: _s.extractXmlStringValue(elem, 'Type')?.toWarningType(), + ); + } + + Map toJson() { + final properties = this.properties; + final type = this.type; + return { + if (properties != null) 'Properties': properties, + if (type != null) 'Type': type.toValue(), + }; + } +} + +/// A specific property that is impacted by a warning. +class WarningProperty { + /// The description of the property from the resource provider schema. + final String? description; + + /// The path of the property. For example, if this is for the + /// S3Bucket member of the Code property, the property + /// path would be Code/S3Bucket. + final String? propertyPath; + + /// If true, the specified property is required. + final bool? required; + + WarningProperty({ + this.description, + this.propertyPath, + this.required, + }); + factory WarningProperty.fromXml(_s.XmlElement elem) { + return WarningProperty( + description: _s.extractXmlStringValue(elem, 'Description'), + propertyPath: _s.extractXmlStringValue(elem, 'PropertyPath'), + required: _s.extractXmlBoolValue(elem, 'Required'), + ); + } + + Map toJson() { + final description = this.description; + final propertyPath = this.propertyPath; + final required = this.required; + return { + if (description != null) 'Description': description, + if (propertyPath != null) 'PropertyPath': propertyPath, + if (required != null) 'Required': required, + }; + } +} + +enum WarningType { + mutuallyExclusiveProperties, + unsupportedProperties, + mutuallyExclusiveTypes, +} + +extension WarningTypeValueExtension on WarningType { + String toValue() { + switch (this) { + case WarningType.mutuallyExclusiveProperties: + return 'MUTUALLY_EXCLUSIVE_PROPERTIES'; + case WarningType.unsupportedProperties: + return 'UNSUPPORTED_PROPERTIES'; + case WarningType.mutuallyExclusiveTypes: + return 'MUTUALLY_EXCLUSIVE_TYPES'; + } + } +} + +extension WarningTypeFromString on String { + WarningType toWarningType() { + switch (this) { + case 'MUTUALLY_EXCLUSIVE_PROPERTIES': + return WarningType.mutuallyExclusiveProperties; + case 'UNSUPPORTED_PROPERTIES': + return WarningType.unsupportedProperties; + case 'MUTUALLY_EXCLUSIVE_TYPES': + return WarningType.mutuallyExclusiveTypes; + } + throw Exception('$this is not known in enum WarningType'); + } +} + +/// Contains any warnings returned by the GetTemplateSummary API +/// action. +class Warnings { + /// A list of all of the unrecognized resource types. This is only returned if + /// the TemplateSummaryConfig parameter has the + /// TreatUnrecognizedResourceTypesAsWarning configuration set to + /// True. + final List? unrecognizedResourceTypes; + + Warnings({ + this.unrecognizedResourceTypes, + }); + factory Warnings.fromXml(_s.XmlElement elem) { + return Warnings( + unrecognizedResourceTypes: _s + .extractXmlChild(elem, 'UnrecognizedResourceTypes') + ?.let((elem) => _s.extractXmlStringListValues(elem, 'member')), + ); + } + + Map toJson() { + final unrecognizedResourceTypes = this.unrecognizedResourceTypes; + return { + if (unrecognizedResourceTypes != null) + 'UnrecognizedResourceTypes': unrecognizedResourceTypes, + }; + } +} + class AlreadyExistsException extends _s.GenericAwsException { AlreadyExistsException({String? type, String? message}) : super(type: type, code: 'AlreadyExistsException', message: message); @@ -15350,12 +18575,28 @@ class ChangeSetNotFoundException extends _s.GenericAwsException { : super(type: type, code: 'ChangeSetNotFoundException', message: message); } +class ConcurrentResourcesLimitExceededException extends _s.GenericAwsException { + ConcurrentResourcesLimitExceededException({String? type, String? message}) + : super( + type: type, + code: 'ConcurrentResourcesLimitExceededException', + message: message); +} + class CreatedButModifiedException extends _s.GenericAwsException { CreatedButModifiedException({String? type, String? message}) : super( type: type, code: 'CreatedButModifiedException', message: message); } +class GeneratedTemplateNotFoundException extends _s.GenericAwsException { + GeneratedTemplateNotFoundException({String? type, String? message}) + : super( + type: type, + code: 'GeneratedTemplateNotFoundException', + message: message); +} + class InsufficientCapabilitiesException extends _s.GenericAwsException { InsufficientCapabilitiesException({String? type, String? message}) : super( @@ -15422,6 +18663,30 @@ class OperationStatusCheckFailedException extends _s.GenericAwsException { message: message); } +class ResourceScanInProgressException extends _s.GenericAwsException { + ResourceScanInProgressException({String? type, String? message}) + : super( + type: type, + code: 'ResourceScanInProgressException', + message: message); +} + +class ResourceScanLimitExceededException extends _s.GenericAwsException { + ResourceScanLimitExceededException({String? type, String? message}) + : super( + type: type, + code: 'ResourceScanLimitExceededException', + message: message); +} + +class ResourceScanNotFoundException extends _s.GenericAwsException { + ResourceScanNotFoundException({String? type, String? message}) + : super( + type: type, + code: 'ResourceScanNotFoundException', + message: message); +} + class StackInstanceNotFoundException extends _s.GenericAwsException { StackInstanceNotFoundException({String? type, String? message}) : super( @@ -15476,8 +18741,12 @@ final _exceptionFns = { CFNRegistryException(type: type, message: message), 'ChangeSetNotFoundException': (type, message) => ChangeSetNotFoundException(type: type, message: message), + 'ConcurrentResourcesLimitExceededException': (type, message) => + ConcurrentResourcesLimitExceededException(type: type, message: message), 'CreatedButModifiedException': (type, message) => CreatedButModifiedException(type: type, message: message), + 'GeneratedTemplateNotFoundException': (type, message) => + GeneratedTemplateNotFoundException(type: type, message: message), 'InsufficientCapabilitiesException': (type, message) => InsufficientCapabilitiesException(type: type, message: message), 'InvalidChangeSetStatusException': (type, message) => @@ -15498,6 +18767,12 @@ final _exceptionFns = { OperationNotFoundException(type: type, message: message), 'OperationStatusCheckFailedException': (type, message) => OperationStatusCheckFailedException(type: type, message: message), + 'ResourceScanInProgressException': (type, message) => + ResourceScanInProgressException(type: type, message: message), + 'ResourceScanLimitExceededException': (type, message) => + ResourceScanLimitExceededException(type: type, message: message), + 'ResourceScanNotFoundException': (type, message) => + ResourceScanNotFoundException(type: type, message: message), 'StackInstanceNotFoundException': (type, message) => StackInstanceNotFoundException(type: type, message: message), 'StackNotFoundException': (type, message) => diff --git a/aws_client/lib/src/generated/cloud_formation/v2010_05_15.meta.dart b/aws_client/lib/src/generated/cloud_formation/v2010_05_15.meta.dart index f5634d299..03d467c8c 100644 --- a/aws_client/lib/src/generated/cloud_formation/v2010_05_15.meta.dart +++ b/aws_client/lib/src/generated/cloud_formation/v2010_05_15.meta.dart @@ -32,6 +32,16 @@ const Map> shapesJson = { "flattened": false }, "AccountsUrl": {"type": "string", "flattened": false}, + "ActivateOrganizationsAccessInput": { + "type": "structure", + "members": {}, + "flattened": false + }, + "ActivateOrganizationsAccessOutput": { + "type": "structure", + "members": {}, + "flattened": false + }, "ActivateTypeInput": { "type": "structure", "members": { @@ -55,6 +65,8 @@ const Map> shapesJson = { }, "flattened": false }, + "AfterContext": {"type": "string", "flattened": false}, + "AfterValue": {"type": "string", "flattened": false}, "AllowedValue": {"type": "string", "flattened": false}, "AllowedValues": { "type": "list", @@ -62,6 +74,7 @@ const Map> shapesJson = { "flattened": false }, "Arn": {"type": "string", "flattened": false}, + "AttributeChangeType": {"type": "string", "flattened": false}, "AutoDeployment": { "type": "structure", "members": { @@ -120,6 +133,8 @@ const Map> shapesJson = { }, "flattened": false }, + "BeforeContext": {"type": "string", "flattened": false}, + "BeforeValue": {"type": "string", "flattened": false}, "BoxedInteger": {"type": "integer", "flattened": false}, "BoxedMaxResults": {"type": "integer", "flattened": false}, "CallAs": {"type": "string", "flattened": false}, @@ -224,7 +239,11 @@ const Map> shapesJson = { "flattened": false }, "ParentChangeSetId": {"shape": "ChangeSetId", "flattened": false}, - "RootChangeSetId": {"shape": "ChangeSetId", "flattened": false} + "RootChangeSetId": {"shape": "ChangeSetId", "flattened": false}, + "ImportExistingResources": { + "shape": "ImportExistingResources", + "flattened": false + } }, "flattened": false }, @@ -238,6 +257,7 @@ const Map> shapesJson = { }, "ClientRequestToken": {"type": "string", "flattened": false}, "ClientToken": {"type": "string", "flattened": false}, + "ConcurrencyMode": {"type": "string", "flattened": false}, "ConfigurationSchema": {"type": "string", "flattened": false}, "ConnectionArn": {"type": "string", "flattened": false}, "ContinueUpdateRollbackInput": { @@ -283,6 +303,11 @@ const Map> shapesJson = { "IncludeNestedStacks": { "shape": "IncludeNestedStacks", "flattened": false + }, + "OnStackFailure": {"shape": "OnStackFailure", "flattened": false}, + "ImportExistingResources": { + "shape": "ImportExistingResources", + "flattened": false } }, "flattened": false @@ -295,6 +320,32 @@ const Map> shapesJson = { }, "flattened": false }, + "CreateGeneratedTemplateInput": { + "type": "structure", + "members": { + "Resources": {"shape": "ResourceDefinitions", "flattened": false}, + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + }, + "StackName": {"shape": "StackName", "flattened": false}, + "TemplateConfiguration": { + "shape": "TemplateConfiguration", + "flattened": false + } + }, + "flattened": false + }, + "CreateGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "shape": "GeneratedTemplateId", + "flattened": false + } + }, + "flattened": false + }, "CreateStackInput": { "type": "structure", "members": { @@ -320,6 +371,10 @@ const Map> shapesJson = { "EnableTerminationProtection": { "shape": "EnableTerminationProtection", "flattened": false + }, + "RetainExceptOnCreate": { + "shape": "RetainExceptOnCreate", + "flattened": false } }, "flattened": false @@ -384,6 +439,16 @@ const Map> shapesJson = { "flattened": false }, "CreationTime": {"type": "timestamp", "flattened": false}, + "DeactivateOrganizationsAccessInput": { + "type": "structure", + "members": {}, + "flattened": false + }, + "DeactivateOrganizationsAccessOutput": { + "type": "structure", + "members": {}, + "flattened": false + }, "DeactivateTypeInput": { "type": "structure", "members": { @@ -411,13 +476,24 @@ const Map> shapesJson = { "members": {}, "flattened": false }, + "DeleteGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + } + }, + "flattened": false + }, "DeleteStackInput": { "type": "structure", "members": { "StackName": {"shape": "StackName", "flattened": false}, "RetainResources": {"shape": "RetainResources", "flattened": false}, "RoleARN": {"shape": "RoleARN", "flattened": false}, - "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false} + "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false}, + "DeletionMode": {"shape": "DeletionMode", "flattened": false} }, "flattened": false }, @@ -458,6 +534,7 @@ const Map> shapesJson = { "members": {}, "flattened": false }, + "DeletionMode": {"type": "string", "flattened": false}, "DeletionTime": {"type": "timestamp", "flattened": false}, "DeploymentTargets": { "type": "structure", @@ -531,7 +608,11 @@ const Map> shapesJson = { "members": { "ChangeSetName": {"shape": "ChangeSetNameOrId", "flattened": false}, "StackName": {"shape": "StackNameOrId", "flattened": false}, - "NextToken": {"shape": "NextToken", "flattened": false} + "NextToken": {"shape": "NextToken", "flattened": false}, + "IncludePropertyValues": { + "shape": "IncludePropertyValues", + "flattened": false + } }, "flattened": false }, @@ -562,7 +643,62 @@ const Map> shapesJson = { "flattened": false }, "ParentChangeSetId": {"shape": "ChangeSetId", "flattened": false}, - "RootChangeSetId": {"shape": "ChangeSetId", "flattened": false} + "RootChangeSetId": {"shape": "ChangeSetId", "flattened": false}, + "OnStackFailure": {"shape": "OnStackFailure", "flattened": false}, + "ImportExistingResources": { + "shape": "ImportExistingResources", + "flattened": false + } + }, + "flattened": false + }, + "DescribeGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + } + }, + "flattened": false + }, + "DescribeGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "shape": "GeneratedTemplateId", + "flattened": false + }, + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + }, + "Resources": {"shape": "ResourceDetails", "flattened": false}, + "Status": {"shape": "GeneratedTemplateStatus", "flattened": false}, + "StatusReason": {"shape": "TemplateStatusReason", "flattened": false}, + "CreationTime": {"shape": "CreationTime", "flattened": false}, + "LastUpdatedTime": {"shape": "LastUpdatedTime", "flattened": false}, + "Progress": {"shape": "TemplateProgress", "flattened": false}, + "StackId": {"shape": "StackId", "flattened": false}, + "TemplateConfiguration": { + "shape": "TemplateConfiguration", + "flattened": false + }, + "TotalWarnings": {"shape": "TotalWarnings", "flattened": false} + }, + "flattened": false + }, + "DescribeOrganizationsAccessInput": { + "type": "structure", + "members": { + "CallAs": {"shape": "CallAs", "flattened": false} + }, + "flattened": false + }, + "DescribeOrganizationsAccessOutput": { + "type": "structure", + "members": { + "Status": {"shape": "OrganizationStatus", "flattened": false} }, "flattened": false }, @@ -583,6 +719,31 @@ const Map> shapesJson = { }, "flattened": false }, + "DescribeResourceScanInput": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false} + }, + "flattened": false + }, + "DescribeResourceScanOutput": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false}, + "Status": {"shape": "ResourceScanStatus", "flattened": false}, + "StatusReason": {"shape": "ResourceScanStatusReason", "flattened": false}, + "StartTime": {"shape": "Timestamp", "flattened": false}, + "EndTime": {"shape": "Timestamp", "flattened": false}, + "PercentageCompleted": { + "shape": "PercentageCompleted", + "flattened": false + }, + "ResourceTypes": {"shape": "ResourceTypes", "flattened": false}, + "ResourcesScanned": {"shape": "ResourcesScanned", "flattened": false}, + "ResourcesRead": {"shape": "ResourcesRead", "flattened": false} + }, + "flattened": false + }, "DescribeStackDriftDetectionStatusInput": { "type": "structure", "members": { @@ -837,6 +998,7 @@ const Map> shapesJson = { "flattened": false }, "Description": {"type": "string", "flattened": false}, + "DetailedStatus": {"type": "string", "flattened": false}, "DetectStackDriftInput": { "type": "structure", "members": { @@ -920,7 +1082,11 @@ const Map> shapesJson = { "ChangeSetName": {"shape": "ChangeSetNameOrId", "flattened": false}, "StackName": {"shape": "StackNameOrId", "flattened": false}, "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false}, - "DisableRollback": {"shape": "DisableRollback", "flattened": false} + "DisableRollback": {"shape": "DisableRollback", "flattened": false}, + "RetainExceptOnCreate": { + "shape": "RetainExceptOnCreate", + "flattened": false + } }, "flattened": false }, @@ -950,6 +1116,34 @@ const Map> shapesJson = { "FailedStackInstancesCount": {"type": "integer", "flattened": false}, "FailureToleranceCount": {"type": "integer", "flattened": false}, "FailureTolerancePercentage": {"type": "integer", "flattened": false}, + "GeneratedTemplateDeletionPolicy": {"type": "string", "flattened": false}, + "GeneratedTemplateId": {"type": "string", "flattened": false}, + "GeneratedTemplateName": {"type": "string", "flattened": false}, + "GeneratedTemplateResourceStatus": {"type": "string", "flattened": false}, + "GeneratedTemplateStatus": {"type": "string", "flattened": false}, + "GeneratedTemplateUpdateReplacePolicy": { + "type": "string", + "flattened": false + }, + "GetGeneratedTemplateInput": { + "type": "structure", + "members": { + "Format": {"shape": "TemplateFormat", "flattened": false}, + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + } + }, + "flattened": false + }, + "GetGeneratedTemplateOutput": { + "type": "structure", + "members": { + "Status": {"shape": "GeneratedTemplateStatus", "flattened": false}, + "TemplateBody": {"shape": "TemplateBody", "flattened": false} + }, + "flattened": false + }, "GetStackPolicyInput": { "type": "structure", "members": { @@ -988,7 +1182,11 @@ const Map> shapesJson = { "TemplateURL": {"shape": "TemplateURL", "flattened": false}, "StackName": {"shape": "StackNameOrId", "flattened": false}, "StackSetName": {"shape": "StackSetNameOrId", "flattened": false}, - "CallAs": {"shape": "CallAs", "flattened": false} + "CallAs": {"shape": "CallAs", "flattened": false}, + "TemplateSummaryConfig": { + "shape": "TemplateSummaryConfig", + "flattened": false + } }, "flattened": false }, @@ -1006,7 +1204,8 @@ const Map> shapesJson = { "ResourceIdentifierSummaries": { "shape": "ResourceIdentifierSummaries", "flattened": false - } + }, + "Warnings": {"shape": "Warnings", "flattened": false} }, "flattened": false }, @@ -1023,6 +1222,7 @@ const Map> shapesJson = { "HookTypeName": {"type": "string", "flattened": false}, "HookTypeVersionId": {"type": "string", "flattened": false}, "IdentityProvider": {"type": "string", "flattened": false}, + "ImportExistingResources": {"type": "boolean", "flattened": false}, "ImportStacksToStackSetInput": { "type": "structure", "members": { @@ -1057,9 +1257,23 @@ const Map> shapesJson = { "InProgressStackInstancesCount": {"type": "integer", "flattened": false}, "InSyncStackInstancesCount": {"type": "integer", "flattened": false}, "IncludeNestedStacks": {"type": "boolean", "flattened": false}, + "IncludePropertyValues": {"type": "boolean", "flattened": false}, "IsActivated": {"type": "boolean", "flattened": false}, "IsDefaultConfiguration": {"type": "boolean", "flattened": false}, "IsDefaultVersion": {"type": "boolean", "flattened": false}, + "JazzLogicalResourceIds": { + "type": "list", + "member": {"shape": "LogicalResourceId"}, + "flattened": false + }, + "JazzResourceIdentifierProperties": { + "type": "map", + "key": {"shape": "JazzResourceIdentifierPropertyKey"}, + "value": {"shape": "JazzResourceIdentifierPropertyValue"}, + "flattened": false + }, + "JazzResourceIdentifierPropertyKey": {"type": "string", "flattened": false}, + "JazzResourceIdentifierPropertyValue": {"type": "string", "flattened": false}, "Key": {"type": "string", "flattened": false}, "LastUpdatedTime": {"type": "timestamp", "flattened": false}, "LimitName": {"type": "string", "flattened": false}, @@ -1095,6 +1309,22 @@ const Map> shapesJson = { }, "flattened": false }, + "ListGeneratedTemplatesInput": { + "type": "structure", + "members": { + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "MaxResults", "flattened": false} + }, + "flattened": false + }, + "ListGeneratedTemplatesOutput": { + "type": "structure", + "members": { + "Summaries": {"shape": "TemplateSummaries", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, "ListImportsInput": { "type": "structure", "members": { @@ -1111,6 +1341,92 @@ const Map> shapesJson = { }, "flattened": false }, + "ListResourceScanRelatedResourcesInput": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false}, + "Resources": {"shape": "ScannedResourceIdentifiers", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "BoxedMaxResults", "flattened": false} + }, + "flattened": false + }, + "ListResourceScanRelatedResourcesOutput": { + "type": "structure", + "members": { + "RelatedResources": {"shape": "RelatedResources", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, + "ListResourceScanResourcesInput": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false}, + "ResourceIdentifier": {"shape": "ResourceIdentifier", "flattened": false}, + "ResourceTypePrefix": {"shape": "ResourceTypePrefix", "flattened": false}, + "TagKey": {"shape": "TagKey", "flattened": false}, + "TagValue": {"shape": "TagValue", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "ResourceScannerMaxResults", "flattened": false} + }, + "flattened": false + }, + "ListResourceScanResourcesOutput": { + "type": "structure", + "members": { + "Resources": {"shape": "ScannedResources", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, + "ListResourceScansInput": { + "type": "structure", + "members": { + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "ResourceScannerMaxResults", "flattened": false} + }, + "flattened": false + }, + "ListResourceScansOutput": { + "type": "structure", + "members": { + "ResourceScanSummaries": { + "shape": "ResourceScanSummaries", + "flattened": false + }, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, + "ListStackInstanceResourceDriftsInput": { + "type": "structure", + "members": { + "StackSetName": {"shape": "StackSetNameOrId", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "MaxResults", "flattened": false}, + "StackInstanceResourceDriftStatuses": { + "shape": "StackResourceDriftStatusFilters", + "flattened": false + }, + "StackInstanceAccount": {"shape": "Account", "flattened": false}, + "StackInstanceRegion": {"shape": "Region", "flattened": false}, + "OperationId": {"shape": "ClientRequestToken", "flattened": false}, + "CallAs": {"shape": "CallAs", "flattened": false} + }, + "flattened": false + }, + "ListStackInstanceResourceDriftsOutput": { + "type": "structure", + "members": { + "Summaries": { + "shape": "StackInstanceResourceDriftsSummaries", + "flattened": false + }, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, "ListStackInstancesInput": { "type": "structure", "members": { @@ -1151,6 +1467,27 @@ const Map> shapesJson = { }, "flattened": false }, + "ListStackSetAutoDeploymentTargetsInput": { + "type": "structure", + "members": { + "StackSetName": {"shape": "StackSetNameOrId", "flattened": false}, + "NextToken": {"shape": "NextToken", "flattened": false}, + "MaxResults": {"shape": "MaxResults", "flattened": false}, + "CallAs": {"shape": "CallAs", "flattened": false} + }, + "flattened": false + }, + "ListStackSetAutoDeploymentTargetsOutput": { + "type": "structure", + "members": { + "Summaries": { + "shape": "StackSetAutoDeploymentTargetSummaries", + "flattened": false + }, + "NextToken": {"shape": "NextToken", "flattened": false} + }, + "flattened": false + }, "ListStackSetOperationResultsInput": { "type": "structure", "members": { @@ -1314,6 +1651,7 @@ const Map> shapesJson = { "flattened": false }, "MajorVersion": {"type": "long", "flattened": false}, + "ManagedByStack": {"type": "boolean", "flattened": false}, "ManagedExecution": { "type": "structure", "members": { @@ -1343,7 +1681,9 @@ const Map> shapesJson = { "member": {"shape": "NotificationARN"}, "flattened": false }, + "NumberOfResources": {"type": "integer", "flattened": false}, "OnFailure": {"type": "string", "flattened": false}, + "OnStackFailure": {"type": "string", "flattened": false}, "OperationResultFilter": { "type": "structure", "members": { @@ -1361,6 +1701,7 @@ const Map> shapesJson = { }, "OperationStatus": {"type": "string", "flattened": false}, "OptionalSecureUrl": {"type": "string", "flattened": false}, + "OrganizationStatus": {"type": "string", "flattened": false}, "OrganizationalUnitId": {"type": "string", "flattened": false}, "OrganizationalUnitIdList": { "type": "list", @@ -1429,6 +1770,7 @@ const Map> shapesJson = { "member": {"shape": "Parameter"}, "flattened": false }, + "PercentageCompleted": {"type": "double", "flattened": false}, "PermissionModels": {"type": "string", "flattened": false}, "PhysicalResourceId": {"type": "string", "flattened": false}, "PhysicalResourceIdContext": { @@ -1444,8 +1786,10 @@ const Map> shapesJson = { }, "flattened": false }, + "PolicyAction": {"type": "string", "flattened": false}, "PrivateTypeArn": {"type": "string", "flattened": false}, "Properties": {"type": "string", "flattened": false}, + "PropertyDescription": {"type": "string", "flattened": false}, "PropertyDifference": { "type": "structure", "members": { @@ -1512,6 +1856,7 @@ const Map> shapesJson = { "members": {}, "flattened": false }, + "RefreshAllResources": {"type": "boolean", "flattened": false}, "Region": {"type": "string", "flattened": false}, "RegionConcurrencyType": {"type": "string", "flattened": false}, "RegionList": { @@ -1564,6 +1909,11 @@ const Map> shapesJson = { "flattened": false }, "RegistryType": {"type": "string", "flattened": false}, + "RelatedResources": { + "type": "list", + "member": {"shape": "ScannedResource"}, + "flattened": false + }, "Replacement": {"type": "string", "flattened": false}, "RequestToken": {"type": "string", "flattened": false}, "RequiredActivatedType": { @@ -1584,11 +1934,13 @@ const Map> shapesJson = { "member": {"shape": "RequiredActivatedType"}, "flattened": false }, + "RequiredProperty": {"type": "boolean", "flattened": false}, "RequiresRecreation": {"type": "string", "flattened": false}, "ResourceAttribute": {"type": "string", "flattened": false}, "ResourceChange": { "type": "structure", "members": { + "PolicyAction": {"shape": "PolicyAction", "flattened": false}, "Action": {"shape": "ChangeAction", "flattened": false}, "LogicalResourceId": {"shape": "LogicalResourceId", "flattened": false}, "PhysicalResourceId": {"shape": "PhysicalResourceId", "flattened": false}, @@ -1597,7 +1949,9 @@ const Map> shapesJson = { "Scope": {"shape": "Scope", "flattened": false}, "Details": {"shape": "ResourceChangeDetails", "flattened": false}, "ChangeSetId": {"shape": "ChangeSetId", "flattened": false}, - "ModuleInfo": {"shape": "ModuleInfo", "flattened": false} + "ModuleInfo": {"shape": "ModuleInfo", "flattened": false}, + "BeforeContext": {"shape": "BeforeContext", "flattened": false}, + "AfterContext": {"shape": "AfterContext", "flattened": false} }, "flattened": false }, @@ -1616,6 +1970,50 @@ const Map> shapesJson = { "member": {"shape": "ResourceChangeDetail"}, "flattened": false }, + "ResourceDefinition": { + "type": "structure", + "members": { + "ResourceType": {"shape": "ResourceType", "flattened": false}, + "LogicalResourceId": {"shape": "LogicalResourceId", "flattened": false}, + "ResourceIdentifier": { + "shape": "ResourceIdentifierProperties", + "flattened": false + } + }, + "flattened": false + }, + "ResourceDefinitions": { + "type": "list", + "member": {"shape": "ResourceDefinition"}, + "flattened": false + }, + "ResourceDetail": { + "type": "structure", + "members": { + "ResourceType": {"shape": "ResourceType", "flattened": false}, + "LogicalResourceId": {"shape": "LogicalResourceId", "flattened": false}, + "ResourceIdentifier": { + "shape": "ResourceIdentifierProperties", + "flattened": false + }, + "ResourceStatus": { + "shape": "GeneratedTemplateResourceStatus", + "flattened": false + }, + "ResourceStatusReason": { + "shape": "ResourceStatusReason", + "flattened": false + }, + "Warnings": {"shape": "WarningDetails", "flattened": false} + }, + "flattened": false + }, + "ResourceDetails": { + "type": "list", + "member": {"shape": "ResourceDetail"}, + "flattened": false + }, + "ResourceIdentifier": {"type": "string", "flattened": false}, "ResourceIdentifierProperties": { "type": "map", "key": {"shape": "ResourceIdentifierPropertyKey"}, @@ -1648,6 +2046,31 @@ const Map> shapesJson = { }, "ResourceModel": {"type": "string", "flattened": false}, "ResourceProperties": {"type": "string", "flattened": false}, + "ResourcePropertyPath": {"type": "string", "flattened": false}, + "ResourceScanId": {"type": "string", "flattened": false}, + "ResourceScanStatus": {"type": "string", "flattened": false}, + "ResourceScanStatusReason": {"type": "string", "flattened": false}, + "ResourceScanSummaries": { + "type": "list", + "member": {"shape": "ResourceScanSummary"}, + "flattened": false + }, + "ResourceScanSummary": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false}, + "Status": {"shape": "ResourceScanStatus", "flattened": false}, + "StatusReason": {"shape": "ResourceScanStatusReason", "flattened": false}, + "StartTime": {"shape": "Timestamp", "flattened": false}, + "EndTime": {"shape": "Timestamp", "flattened": false}, + "PercentageCompleted": { + "shape": "PercentageCompleted", + "flattened": false + } + }, + "flattened": false + }, + "ResourceScannerMaxResults": {"type": "integer", "flattened": false}, "ResourceSignalStatus": {"type": "string", "flattened": false}, "ResourceSignalUniqueId": {"type": "string", "flattened": false}, "ResourceStatus": {"type": "string", "flattened": false}, @@ -1657,7 +2080,14 @@ const Map> shapesJson = { "members": { "Attribute": {"shape": "ResourceAttribute", "flattened": false}, "Name": {"shape": "PropertyName", "flattened": false}, - "RequiresRecreation": {"shape": "RequiresRecreation", "flattened": false} + "RequiresRecreation": {"shape": "RequiresRecreation", "flattened": false}, + "Path": {"shape": "ResourcePropertyPath", "flattened": false}, + "BeforeValue": {"shape": "BeforeValue", "flattened": false}, + "AfterValue": {"shape": "AfterValue", "flattened": false}, + "AttributeChangeType": { + "shape": "AttributeChangeType", + "flattened": false + } }, "flattened": false }, @@ -1675,11 +2105,18 @@ const Map> shapesJson = { }, "ResourceToSkip": {"type": "string", "flattened": false}, "ResourceType": {"type": "string", "flattened": false}, + "ResourceTypePrefix": {"type": "string", "flattened": false}, "ResourceTypes": { "type": "list", "member": {"shape": "ResourceType"}, "flattened": false }, + "ResourcesFailed": {"type": "integer", "flattened": false}, + "ResourcesPending": {"type": "integer", "flattened": false}, + "ResourcesProcessing": {"type": "integer", "flattened": false}, + "ResourcesRead": {"type": "integer", "flattened": false}, + "ResourcesScanned": {"type": "integer", "flattened": false}, + "ResourcesSucceeded": {"type": "integer", "flattened": false}, "ResourcesToImport": { "type": "list", "member": {"shape": "ResourceToImport"}, @@ -1690,6 +2127,7 @@ const Map> shapesJson = { "member": {"shape": "ResourceToSkip"}, "flattened": false }, + "RetainExceptOnCreate": {"type": "boolean", "flattened": false}, "RetainResources": { "type": "list", "member": {"shape": "LogicalResourceId"}, @@ -1719,7 +2157,11 @@ const Map> shapesJson = { "members": { "StackName": {"shape": "StackNameOrId", "flattened": false}, "RoleARN": {"shape": "RoleARN", "flattened": false}, - "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false} + "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false}, + "RetainExceptOnCreate": { + "shape": "RetainExceptOnCreate", + "flattened": false + } }, "flattened": false }, @@ -1745,6 +2187,39 @@ const Map> shapesJson = { }, "S3Bucket": {"type": "string", "flattened": false}, "S3Url": {"type": "string", "flattened": false}, + "ScannedResource": { + "type": "structure", + "members": { + "ResourceType": {"shape": "ResourceType", "flattened": false}, + "ResourceIdentifier": { + "shape": "JazzResourceIdentifierProperties", + "flattened": false + }, + "ManagedByStack": {"shape": "ManagedByStack", "flattened": false} + }, + "flattened": false + }, + "ScannedResourceIdentifier": { + "type": "structure", + "members": { + "ResourceType": {"shape": "ResourceType", "flattened": false}, + "ResourceIdentifier": { + "shape": "JazzResourceIdentifierProperties", + "flattened": false + } + }, + "flattened": false + }, + "ScannedResourceIdentifiers": { + "type": "list", + "member": {"shape": "ScannedResourceIdentifier"}, + "flattened": false + }, + "ScannedResources": { + "type": "list", + "member": {"shape": "ScannedResource"}, + "flattened": false + }, "Scope": { "type": "list", "member": {"shape": "ResourceAttribute"}, @@ -1835,7 +2310,16 @@ const Map> shapesJson = { }, "ParentId": {"shape": "StackId", "flattened": false}, "RootId": {"shape": "StackId", "flattened": false}, - "DriftInformation": {"shape": "StackDriftInformation", "flattened": false} + "DriftInformation": { + "shape": "StackDriftInformation", + "flattened": false + }, + "RetainExceptOnCreate": { + "shape": "RetainExceptOnCreate", + "flattened": false + }, + "DeletionMode": {"shape": "DeletionMode", "flattened": false}, + "DetailedStatus": {"shape": "DetailedStatus", "flattened": false} }, "flattened": false }, @@ -1883,7 +2367,8 @@ const Map> shapesJson = { "shape": "HookInvocationPoint", "flattened": false }, - "HookFailureMode": {"shape": "HookFailureMode", "flattened": false} + "HookFailureMode": {"shape": "HookFailureMode", "flattened": false}, + "DetailedStatus": {"shape": "DetailedStatus", "flattened": false} }, "flattened": false }, @@ -1949,6 +2434,34 @@ const Map> shapesJson = { "member": {"shape": "StackInstanceFilter"}, "flattened": false }, + "StackInstanceResourceDriftsSummaries": { + "type": "list", + "member": {"shape": "StackInstanceResourceDriftsSummary"}, + "flattened": false + }, + "StackInstanceResourceDriftsSummary": { + "type": "structure", + "members": { + "StackId": {"shape": "StackId", "flattened": false}, + "LogicalResourceId": {"shape": "LogicalResourceId", "flattened": false}, + "PhysicalResourceId": {"shape": "PhysicalResourceId", "flattened": false}, + "PhysicalResourceIdContext": { + "shape": "PhysicalResourceIdContext", + "flattened": false + }, + "ResourceType": {"shape": "ResourceType", "flattened": false}, + "PropertyDifferences": { + "shape": "PropertyDifferences", + "flattened": false + }, + "StackResourceDriftStatus": { + "shape": "StackResourceDriftStatus", + "flattened": false + }, + "Timestamp": {"shape": "Timestamp", "flattened": false} + }, + "flattened": false + }, "StackInstanceStatus": {"type": "string", "flattened": false}, "StackInstanceSummaries": { "type": "list", @@ -2150,6 +2663,22 @@ const Map> shapesJson = { "flattened": false }, "StackSetARN": {"type": "string", "flattened": false}, + "StackSetAutoDeploymentTargetSummaries": { + "type": "list", + "member": {"shape": "StackSetAutoDeploymentTargetSummary"}, + "flattened": false + }, + "StackSetAutoDeploymentTargetSummary": { + "type": "structure", + "members": { + "OrganizationalUnitId": { + "shape": "OrganizationalUnitId", + "flattened": false + }, + "Regions": {"shape": "RegionList", "flattened": false} + }, + "flattened": false + }, "StackSetDriftDetectionDetails": { "type": "structure", "members": { @@ -2240,7 +2769,8 @@ const Map> shapesJson = { "MaxConcurrentPercentage": { "shape": "MaxConcurrentPercentage", "flattened": false - } + }, + "ConcurrencyMode": {"shape": "ConcurrencyMode", "flattened": false} }, "flattened": false }, @@ -2371,6 +2901,20 @@ const Map> shapesJson = { "member": {"shape": "TemplateStage"}, "flattened": false }, + "StartResourceScanInput": { + "type": "structure", + "members": { + "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false} + }, + "flattened": false + }, + "StartResourceScanOutput": { + "type": "structure", + "members": { + "ResourceScanId": {"shape": "ResourceScanId", "flattened": false} + }, + "flattened": false + }, "StatusMessage": {"type": "string", "flattened": false}, "StopStackSetOperationInput": { "type": "structure", @@ -2408,7 +2952,22 @@ const Map> shapesJson = { "flattened": false }, "TemplateBody": {"type": "string", "flattened": false}, + "TemplateConfiguration": { + "type": "structure", + "members": { + "DeletionPolicy": { + "shape": "GeneratedTemplateDeletionPolicy", + "flattened": false + }, + "UpdateReplacePolicy": { + "shape": "GeneratedTemplateUpdateReplacePolicy", + "flattened": false + } + }, + "flattened": false + }, "TemplateDescription": {"type": "string", "flattened": false}, + "TemplateFormat": {"type": "string", "flattened": false}, "TemplateParameter": { "type": "structure", "members": { @@ -2424,7 +2983,55 @@ const Map> shapesJson = { "member": {"shape": "TemplateParameter"}, "flattened": false }, + "TemplateProgress": { + "type": "structure", + "members": { + "ResourcesSucceeded": {"shape": "ResourcesSucceeded", "flattened": false}, + "ResourcesFailed": {"shape": "ResourcesFailed", "flattened": false}, + "ResourcesProcessing": { + "shape": "ResourcesProcessing", + "flattened": false + }, + "ResourcesPending": {"shape": "ResourcesPending", "flattened": false} + }, + "flattened": false + }, "TemplateStage": {"type": "string", "flattened": false}, + "TemplateStatusReason": {"type": "string", "flattened": false}, + "TemplateSummaries": { + "type": "list", + "member": {"shape": "TemplateSummary"}, + "flattened": false + }, + "TemplateSummary": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "shape": "GeneratedTemplateId", + "flattened": false + }, + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + }, + "Status": {"shape": "GeneratedTemplateStatus", "flattened": false}, + "StatusReason": {"shape": "TemplateStatusReason", "flattened": false}, + "CreationTime": {"shape": "CreationTime", "flattened": false}, + "LastUpdatedTime": {"shape": "LastUpdatedTime", "flattened": false}, + "NumberOfResources": {"shape": "NumberOfResources", "flattened": false} + }, + "flattened": false + }, + "TemplateSummaryConfig": { + "type": "structure", + "members": { + "TreatUnrecognizedResourceTypesAsWarnings": { + "shape": "TreatUnrecognizedResourceTypesAsWarnings", + "flattened": false + } + }, + "flattened": false + }, "TemplateURL": {"type": "string", "flattened": false}, "TestTypeInput": { "type": "structure", @@ -2449,12 +3056,17 @@ const Map> shapesJson = { "TimeoutMinutes": {"type": "integer", "flattened": false}, "Timestamp": {"type": "timestamp", "flattened": false}, "TotalStackInstancesCount": {"type": "integer", "flattened": false}, + "TotalWarnings": {"type": "integer", "flattened": false}, "TransformName": {"type": "string", "flattened": false}, "TransformsList": { "type": "list", "member": {"shape": "TransformName"}, "flattened": false }, + "TreatUnrecognizedResourceTypesAsWarnings": { + "type": "boolean", + "flattened": false + }, "Type": {"type": "string", "flattened": false}, "TypeArn": {"type": "string", "flattened": false}, "TypeConfiguration": {"type": "string", "flattened": false}, @@ -2576,6 +3188,43 @@ const Map> shapesJson = { "member": {"shape": "TypeConfigurationIdentifier"}, "flattened": false }, + "UpdateGeneratedTemplateInput": { + "type": "structure", + "members": { + "GeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + }, + "NewGeneratedTemplateName": { + "shape": "GeneratedTemplateName", + "flattened": false + }, + "AddResources": {"shape": "ResourceDefinitions", "flattened": false}, + "RemoveResources": { + "shape": "JazzLogicalResourceIds", + "flattened": false + }, + "RefreshAllResources": { + "shape": "RefreshAllResources", + "flattened": false + }, + "TemplateConfiguration": { + "shape": "TemplateConfiguration", + "flattened": false + } + }, + "flattened": false + }, + "UpdateGeneratedTemplateOutput": { + "type": "structure", + "members": { + "GeneratedTemplateId": { + "shape": "GeneratedTemplateId", + "flattened": false + } + }, + "flattened": false + }, "UpdateStackInput": { "type": "structure", "members": { @@ -2607,7 +3256,11 @@ const Map> shapesJson = { "NotificationARNs": {"shape": "NotificationARNs", "flattened": false}, "Tags": {"shape": "Tags", "flattened": false}, "DisableRollback": {"shape": "DisableRollback", "flattened": false}, - "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false} + "ClientRequestToken": {"shape": "ClientRequestToken", "flattened": false}, + "RetainExceptOnCreate": { + "shape": "RetainExceptOnCreate", + "flattened": false + } }, "flattened": false }, @@ -2723,5 +3376,43 @@ const Map> shapesJson = { "Value": {"type": "string", "flattened": false}, "Version": {"type": "string", "flattened": false}, "VersionBump": {"type": "string", "flattened": false}, - "Visibility": {"type": "string", "flattened": false} + "Visibility": {"type": "string", "flattened": false}, + "WarningDetail": { + "type": "structure", + "members": { + "Type": {"shape": "WarningType", "flattened": false}, + "Properties": {"shape": "WarningProperties", "flattened": false} + }, + "flattened": false + }, + "WarningDetails": { + "type": "list", + "member": {"shape": "WarningDetail"}, + "flattened": false + }, + "WarningProperties": { + "type": "list", + "member": {"shape": "WarningProperty"}, + "flattened": false + }, + "WarningProperty": { + "type": "structure", + "members": { + "PropertyPath": {"shape": "PropertyPath", "flattened": false}, + "Required": {"shape": "RequiredProperty", "flattened": false}, + "Description": {"shape": "PropertyDescription", "flattened": false} + }, + "flattened": false + }, + "WarningType": {"type": "string", "flattened": false}, + "Warnings": { + "type": "structure", + "members": { + "UnrecognizedResourceTypes": { + "shape": "ResourceTypes", + "flattened": false + } + }, + "flattened": false + } }; diff --git a/aws_client/lib/src/generated/cloud_front/v2020_05_31.dart b/aws_client/lib/src/generated/cloud_front/v2020_05_31.dart index a71b6d94e..78bc8b5a8 100644 --- a/aws_client/lib/src/generated/cloud_front/v2020_05_31.dart +++ b/aws_client/lib/src/generated/cloud_front/v2020_05_31.dart @@ -22,7 +22,9 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// This is the Amazon CloudFront API Reference. This guide is for /// developers who need detailed information about CloudFront API actions, data /// types, and errors. For detailed information about CloudFront features, see -/// the Amazon CloudFront Developer Guide. +/// the Amazon +/// CloudFront Developer Guide. class CloudFront { final _s.RestXmlProtocol _protocol; CloudFront({ @@ -106,6 +108,23 @@ class CloudFront { /// CreateContinuousDeploymentPolicy to incrementally move /// traffic to the staging distribution. /// + /// This API operation requires the following IAM permissions: + /// + /// + /// /// May throw [CNAMEAlreadyExists]. /// May throw [DistributionAlreadyExists]. /// May throw [InvalidOrigin]. @@ -160,6 +179,7 @@ class CloudFront { /// May throw [TooManyDistributionsAssociatedToFieldLevelEncryptionConfig]. /// May throw [NoSuchCachePolicy]. /// May throw [TooManyDistributionsAssociatedToCachePolicy]. + /// May throw [TooManyDistributionsAssociatedToOriginAccessControl]. /// May throw [NoSuchResponseHeadersPolicy]. /// May throw [TooManyDistributionsAssociatedToResponseHeadersPolicy]. /// May throw [NoSuchOriginRequestPolicy]. @@ -179,6 +199,14 @@ class CloudFront { /// The identifier of the primary distribution whose configuration you are /// copying. To get a distribution ID, use ListDistributions. /// + /// Parameter [enabled] : + /// A Boolean flag to specify the state of the staging distribution when it's + /// created. When you set this value to True, the staging + /// distribution is enabled. When you set this value to False, + /// the staging distribution is disabled. + /// + /// If you omit this field, the default value is True. + /// /// Parameter [ifMatch] : /// The version identifier of the primary distribution whose configuration you /// are copying. This is the ETag value returned in the response @@ -191,6 +219,7 @@ class CloudFront { Future copyDistribution2020_05_31({ required String callerReference, required String primaryDistributionId, + bool? enabled, String? ifMatch, bool? staging, }) async { @@ -206,6 +235,7 @@ class CloudFront { payload: CopyDistributionRequest( callerReference: callerReference, primaryDistributionId: primaryDistributionId, + enabled: enabled, ifMatch: ifMatch, staging: staging) .toXml( @@ -448,13 +478,26 @@ class CloudFront { ); } - /// Create a new distribution with tags. + /// Create a new distribution with tags. This API operation requires the + /// following IAM permissions: + /// + /// /// /// May throw [CNAMEAlreadyExists]. /// May throw [DistributionAlreadyExists]. /// May throw [InvalidOrigin]. /// May throw [InvalidOriginAccessIdentity]. /// May throw [InvalidOriginAccessControl]. + /// May throw [IllegalOriginAccessConfiguration]. /// May throw [AccessDenied]. /// May throw [TooManyTrustedSigners]. /// May throw [TrustedSignerDoesNotExist]. @@ -502,6 +545,7 @@ class CloudFront { /// May throw [TooManyDistributionsAssociatedToFieldLevelEncryptionConfig]. /// May throw [NoSuchCachePolicy]. /// May throw [TooManyDistributionsAssociatedToCachePolicy]. + /// May throw [TooManyDistributionsAssociatedToOriginAccessControl]. /// May throw [NoSuchResponseHeadersPolicy]. /// May throw [TooManyDistributionsAssociatedToResponseHeadersPolicy]. /// May throw [NoSuchOriginRequestPolicy]. @@ -663,7 +707,9 @@ class CloudFront { ); } - /// Create a new invalidation. + /// Create a new invalidation. For more information, see Invalidating + /// files in the Amazon CloudFront Developer Guide. /// /// May throw [AccessDenied]. /// May throw [MissingBody]. @@ -735,6 +781,55 @@ class CloudFront { ); } + /// Specifies the key value store resource to add to your account. In your + /// account, the key value store names must be unique. You can also import key + /// value store data in JSON format from an S3 bucket by providing a valid + /// ImportSource that you own. + /// + /// May throw [AccessDenied]. + /// May throw [EntityLimitExceeded]. + /// May throw [EntityAlreadyExists]. + /// May throw [EntitySizeLimitExceeded]. + /// May throw [InvalidArgument]. + /// May throw [UnsupportedOperation]. + /// + /// Parameter [name] : + /// The name of the key value store. The minimum length is 1 character and the + /// maximum length is 64 characters. + /// + /// Parameter [comment] : + /// The comment of the key value store. + /// + /// Parameter [importSource] : + /// The S3 bucket that provides the source for the import. The source must be + /// in a valid JSON format. + Future createKeyValueStore2020_05_31({ + required String name, + String? comment, + ImportSource? importSource, + }) async { + final $result = await _protocol.sendRaw( + method: 'POST', + requestUri: '/2020-05-31/key-value-store/', + payload: CreateKeyValueStoreRequest( + name: name, comment: comment, importSource: importSource) + .toXml( + 'CreateKeyValueStoreRequest', + attributes: [ + _s.XmlAttribute(_s.XmlName('xmlns'), + 'http://cloudfront.amazonaws.com/doc/2020-05-31/'), + ], + ), + exceptionFnMap: _exceptionFns, + ); + final $elem = await _s.xmlFromResponse($result); + return CreateKeyValueStoreResult( + keyValueStore: KeyValueStore.fromXml($elem), + eTag: _s.extractHeaderStringValue($result.headers, 'ETag'), + location: _s.extractHeaderStringValue($result.headers, 'Location'), + ); + } + /// Enables additional CloudWatch metrics for the specified CloudFront /// distribution. The additional metrics incur an additional cost. /// @@ -931,10 +1026,9 @@ class CloudFront { /// A unique name to identify this real-time log configuration. /// /// Parameter [samplingRate] : - /// The sampling rate for this real-time log configuration. The sampling rate - /// determines the percentage of viewer requests that are represented in the - /// real-time log data. You must provide an integer between 1 and 100, - /// inclusive. + /// The sampling rate for this real-time log configuration. You can specify a + /// whole number between 1 and 100 (inclusive) to determine the percentage of + /// viewer requests that are represented in the real-time log data. Future createRealtimeLogConfig2020_05_31({ required List endPoints, required List fields, @@ -1365,6 +1459,35 @@ class CloudFront { ); } + /// Specifies the key value store to delete. + /// + /// May throw [AccessDenied]. + /// May throw [InvalidIfMatchVersion]. + /// May throw [EntityNotFound]. + /// May throw [CannotDeleteEntityWhileInUse]. + /// May throw [PreconditionFailed]. + /// May throw [UnsupportedOperation]. + /// + /// Parameter [ifMatch] : + /// The key value store to delete, if a match occurs. + /// + /// Parameter [name] : + /// The name of the key value store. + Future deleteKeyValueStore2020_05_31({ + required String ifMatch, + required String name, + }) async { + final headers = { + 'If-Match': ifMatch.toString(), + }; + await _protocol.send( + method: 'DELETE', + requestUri: '/2020-05-31/key-value-store/${Uri.encodeComponent(name)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + /// Disables additional CloudWatch metrics for the specified CloudFront /// distribution. /// @@ -1698,6 +1821,30 @@ class CloudFront { ); } + /// Specifies the key value store and its configuration. + /// + /// May throw [AccessDenied]. + /// May throw [InvalidArgument]. + /// May throw [EntityNotFound]. + /// May throw [UnsupportedOperation]. + /// + /// Parameter [name] : + /// The name of the key value store. + Future describeKeyValueStore2020_05_31({ + required String name, + }) async { + final $result = await _protocol.sendRaw( + method: 'GET', + requestUri: '/2020-05-31/key-value-store/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + final $elem = await _s.xmlFromResponse($result); + return DescribeKeyValueStoreResult( + keyValueStore: KeyValueStore.fromXml($elem), + eTag: _s.extractHeaderStringValue($result.headers, 'ETag'), + ); + } + /// Gets a cache policy, including the following metadata: /// ///
        @@ -3027,6 +3174,12 @@ class CloudFront { /// distributions. If you specify "null" for the ID, the request returns a /// list of the distributions that aren't associated with a web ACL. /// + /// For WAFV2, this is the ARN of the web ACL, such as + /// arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. + /// + /// For WAF Classic, this is the ID of the web ACL, such as + /// a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. + /// /// Parameter [marker] : /// Use Marker and MaxItems to control pagination of /// results. If you have more than MaxItems distributions that @@ -3268,6 +3421,42 @@ class CloudFront { ); } + /// Specifies the key value stores to list. + /// + /// May throw [AccessDenied]. + /// May throw [InvalidArgument]. + /// May throw [UnsupportedOperation]. + /// + /// Parameter [marker] : + /// The marker associated with the key value stores list. + /// + /// Parameter [maxItems] : + /// The maximum number of items in the key value stores list. + /// + /// Parameter [status] : + /// The status of the request for the key value stores list. + Future listKeyValueStores2020_05_31({ + String? marker, + String? maxItems, + String? status, + }) async { + final $query = >{ + if (marker != null) 'Marker': [marker], + if (maxItems != null) 'MaxItems': [maxItems], + if (status != null) 'Status': [status], + }; + final $result = await _protocol.sendRaw( + method: 'GET', + requestUri: '/2020-05-31/key-value-store', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + final $elem = await _s.xmlFromResponse($result); + return ListKeyValueStoresResult( + keyValueStoreList: KeyValueStoreList.fromXml($elem), + ); + } + /// Gets the list of CloudFront origin access controls in this Amazon Web /// Services account. /// @@ -4011,6 +4200,7 @@ class CloudFront { /// May throw [TooManyDistributionsAssociatedToFieldLevelEncryptionConfig]. /// May throw [NoSuchCachePolicy]. /// May throw [TooManyDistributionsAssociatedToCachePolicy]. + /// May throw [TooManyDistributionsAssociatedToOriginAccessControl]. /// May throw [NoSuchResponseHeadersPolicy]. /// May throw [TooManyDistributionsAssociatedToResponseHeadersPolicy]. /// May throw [NoSuchOriginRequestPolicy]. @@ -4073,6 +4263,19 @@ class CloudFront { /// continuous deployment policy and move your domain's traffic back to the /// primary distribution. /// + /// This API operation requires the following IAM permissions: + /// + /// + /// /// May throw [AccessDenied]. /// May throw [CNAMEAlreadyExists]. /// May throw [IllegalUpdate]. @@ -4124,6 +4327,7 @@ class CloudFront { /// May throw [TooManyDistributionsAssociatedToFieldLevelEncryptionConfig]. /// May throw [NoSuchCachePolicy]. /// May throw [TooManyDistributionsAssociatedToCachePolicy]. + /// May throw [TooManyDistributionsAssociatedToOriginAccessControl]. /// May throw [NoSuchResponseHeadersPolicy]. /// May throw [TooManyDistributionsAssociatedToResponseHeadersPolicy]. /// May throw [NoSuchOriginRequestPolicy]. @@ -4398,6 +4602,53 @@ class CloudFront { ); } + /// Specifies the key value store to update. + /// + /// May throw [AccessDenied]. + /// May throw [InvalidArgument]. + /// May throw [EntityNotFound]. + /// May throw [InvalidIfMatchVersion]. + /// May throw [PreconditionFailed]. + /// May throw [UnsupportedOperation]. + /// + /// Parameter [comment] : + /// The comment of the key value store to update. + /// + /// Parameter [ifMatch] : + /// The key value store to update, if a match occurs. + /// + /// Parameter [name] : + /// The name of the key value store to update. + Future updateKeyValueStore2020_05_31({ + required String comment, + required String ifMatch, + required String name, + }) async { + final headers = { + 'If-Match': ifMatch.toString(), + }; + final $result = await _protocol.sendRaw( + method: 'PUT', + requestUri: '/2020-05-31/key-value-store/${Uri.encodeComponent(name)}', + headers: headers, + payload: UpdateKeyValueStoreRequest( + comment: comment, ifMatch: ifMatch, name: name) + .toXml( + 'UpdateKeyValueStoreRequest', + attributes: [ + _s.XmlAttribute(_s.XmlName('xmlns'), + 'http://cloudfront.amazonaws.com/doc/2020-05-31/'), + ], + ), + exceptionFnMap: _exceptionFns, + ); + final $elem = await _s.xmlFromResponse($result); + return UpdateKeyValueStoreResult( + keyValueStore: KeyValueStore.fromXml($elem), + eTag: _s.extractHeaderStringValue($result.headers, 'ETag'), + ); + } + /// Updates a CloudFront origin access control. /// /// May throw [AccessDenied]. @@ -4795,9 +5046,8 @@ class ActiveTrustedKeyGroups { /// URLs and signed cookies. class ActiveTrustedSigners { /// This field is true if any of the Amazon Web Services accounts - /// in the list have active CloudFront key pairs that CloudFront can use to - /// verify the signatures of signed URLs and signed cookies. If not, this field - /// is false. + /// in the list are configured as trusted signers. If not, this field is + /// false. final bool enabled; /// The number of Amazon Web Services accounts in the list. @@ -5053,8 +5303,10 @@ class AllowedMethods { /// in the Amazon CloudFront Developer Guide. /// /// If you don't want to specify any cache behaviors, include only an empty -/// CacheBehaviors element. Don't include an empty -/// CacheBehavior element because this is invalid. +/// CacheBehaviors element. For more information, see CacheBehaviors. +/// Don't include an empty CacheBehavior element because this is +/// invalid. /// /// To delete all cache behaviors in an existing distribution, update the /// distribution configuration and include only an empty @@ -7025,7 +7277,8 @@ class ContinuousDeploymentSingleHeaderConfig { /// Contains the percentage of traffic to send to a staging distribution. class ContinuousDeploymentSingleWeightConfig { /// The percentage of traffic to send to a staging distribution, expressed as a - /// decimal number between 0 and .15. + /// decimal number between 0 and 0.15. For example, a value of 0.10 means 10% of + /// traffic is sent to the staging distribution. final double weight; final SessionStickinessConfig? sessionStickinessConfig; @@ -7241,6 +7494,14 @@ class CopyDistributionRequest { /// copying. To get a distribution ID, use ListDistributions. final String primaryDistributionId; + /// A Boolean flag to specify the state of the staging distribution when it's + /// created. When you set this value to True, the staging + /// distribution is enabled. When you set this value to False, the + /// staging distribution is disabled. + /// + /// If you omit this field, the default value is True. + final bool? enabled; + /// The version identifier of the primary distribution whose configuration you /// are copying. This is the ETag value returned in the response to /// GetDistribution and GetDistributionConfig. @@ -7254,6 +7515,7 @@ class CopyDistributionRequest { CopyDistributionRequest({ required this.callerReference, required this.primaryDistributionId, + this.enabled, this.ifMatch, this.staging, }); @@ -7261,20 +7523,24 @@ class CopyDistributionRequest { Map toJson() { final callerReference = this.callerReference; final primaryDistributionId = this.primaryDistributionId; + final enabled = this.enabled; final ifMatch = this.ifMatch; final staging = this.staging; return { 'CallerReference': callerReference, + if (enabled != null) 'Enabled': enabled, }; } _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { final callerReference = this.callerReference; final primaryDistributionId = this.primaryDistributionId; + final enabled = this.enabled; final ifMatch = this.ifMatch; final staging = this.staging; final $children = <_s.XmlNode>[ _s.encodeXmlStringValue('CallerReference', callerReference), + if (enabled != null) _s.encodeXmlBoolValue('Enabled', enabled), ]; final $attributes = <_s.XmlAttribute>[ ...?attributes, @@ -7632,6 +7898,81 @@ class CreateKeyGroupResult { } } +class CreateKeyValueStoreRequest { + /// The name of the key value store. The minimum length is 1 character and the + /// maximum length is 64 characters. + final String name; + + /// The comment of the key value store. + final String? comment; + + /// The S3 bucket that provides the source for the import. The source must be in + /// a valid JSON format. + final ImportSource? importSource; + + CreateKeyValueStoreRequest({ + required this.name, + this.comment, + this.importSource, + }); + + Map toJson() { + final name = this.name; + final comment = this.comment; + final importSource = this.importSource; + return { + 'Name': name, + if (comment != null) 'Comment': comment, + if (importSource != null) 'ImportSource': importSource, + }; + } + + _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { + final name = this.name; + final comment = this.comment; + final importSource = this.importSource; + final $children = <_s.XmlNode>[ + _s.encodeXmlStringValue('Name', name), + if (comment != null) _s.encodeXmlStringValue('Comment', comment), + if (importSource != null) importSource.toXml('ImportSource'), + ]; + final $attributes = <_s.XmlAttribute>[ + ...?attributes, + ]; + return _s.XmlElement( + _s.XmlName(elemName), + $attributes, + $children, + ); + } +} + +class CreateKeyValueStoreResult { + /// The ETag in the resulting key value store. + final String? eTag; + + /// The resulting key value store. + final KeyValueStore? keyValueStore; + + /// The location of the resulting key value store. + final String? location; + + CreateKeyValueStoreResult({ + this.eTag, + this.keyValueStore, + this.location, + }); + + Map toJson() { + final eTag = this.eTag; + final keyValueStore = this.keyValueStore; + final location = this.location; + return { + if (keyValueStore != null) 'KeyValueStore': keyValueStore, + }; + } +} + class CreateMonitoringSubscriptionResult { /// A monitoring subscription. This structure contains information about whether /// additional CloudWatch metrics are enabled for a given CloudFront @@ -7747,10 +8088,9 @@ class CreateRealtimeLogConfigRequest { /// A unique name to identify this real-time log configuration. final String name; - /// The sampling rate for this real-time log configuration. The sampling rate - /// determines the percentage of viewer requests that are represented in the - /// real-time log data. You must provide an integer between 1 and 100, - /// inclusive. + /// The sampling rate for this real-time log configuration. You can specify a + /// whole number between 1 and 100 (inclusive) to determine the percentage of + /// viewer requests that are represented in the real-time log data. final int samplingRate; CreateRealtimeLogConfigRequest({ @@ -8420,8 +8760,8 @@ class DefaultCacheBehavior { final ForwardedValues? forwardedValues; /// A list of CloudFront functions that are associated with this cache behavior. - /// CloudFront functions must be published to the LIVE stage to - /// associate them with a cache behavior. + /// Your functions must be published to the LIVE stage to associate + /// them with a cache behavior. final FunctionAssociations? functionAssociations; /// A complex type that contains zero or more Lambda@Edge function associations @@ -8767,6 +9107,27 @@ class DescribeFunctionResult { } } +class DescribeKeyValueStoreResult { + /// The ETag of the resulting key value store. + final String? eTag; + + /// The resulting key value store. + final KeyValueStore? keyValueStore; + + DescribeKeyValueStoreResult({ + this.eTag, + this.keyValueStore, + }); + + Map toJson() { + final eTag = this.eTag; + final keyValueStore = this.keyValueStore; + return { + if (keyValueStore != null) 'KeyValueStore': keyValueStore, + }; + } +} + /// A distribution tells CloudFront where you want content to be delivered from, /// and the details about how to track and manage content delivery. class Distribution { @@ -8969,10 +9330,10 @@ class DistributionConfig { /// a Default Root Object in the Amazon CloudFront Developer Guide. final String? defaultRootObject; - /// (Optional) Specify the maximum HTTP version(s) that you want viewers to use - /// to communicate with CloudFront. The default value for new web distributions - /// is http2. Viewers that don't support HTTP/2 automatically use - /// an earlier HTTP version. + /// (Optional) Specify the HTTP version(s) that you want viewers to use to + /// communicate with CloudFront. The default value for new web distributions is + /// http2. Viewers that don't support HTTP/2 automatically use an + /// earlier HTTP version. /// /// For viewers and CloudFront to use HTTP/2, viewers must support TLSv1.2 or /// later, and must support Server Name Indication (SNI). @@ -9080,9 +9441,9 @@ class DistributionConfig { /// A unique identifier that specifies the WAF web ACL, if any, to associate /// with this distribution. To specify a web ACL created using the latest /// version of WAF, use the ACL ARN, for example - /// arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. + /// arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. /// To specify a web ACL created using WAF Classic, use the ACL ID, for example - /// 473e64fd-f30b-4765-81a0-62ad96dd167a. + /// a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. /// /// WAF is a web application firewall that lets you monitor the HTTP and HTTPS /// requests that are forwarded to CloudFront, and lets you control access to @@ -9492,7 +9853,9 @@ class DistributionSummary { /// distribution of your content. final Restrictions restrictions; - /// Whether the primary distribution has a staging distribution enabled. + /// A Boolean that indicates whether this is a staging distribution. When this + /// value is true, this is a staging distribution. When this value + /// is false, this is not a staging distribution. final bool staging; /// The current status of the distribution. When the status is @@ -9959,7 +10322,7 @@ class FieldLevelEncryptionConfig { } } -/// List of field-level encrpytion configurations. +/// List of field-level encryption configurations. class FieldLevelEncryptionList { /// The maximum number of elements you want in the response body. final int maxItems; @@ -10176,8 +10539,7 @@ class FieldLevelEncryptionProfileSummary { /// ID for the field-level encryption profile summary. final String id; - /// The time when the the field-level encryption profile summary was last - /// updated. + /// The time when the field-level encryption profile summary was last updated. final DateTime lastModifiedTime; /// Name for the field-level encryption profile summary. @@ -10605,14 +10967,14 @@ class FunctionAssociation { } /// A list of CloudFront functions that are associated with a cache behavior in -/// a CloudFront distribution. CloudFront functions must be published to the +/// a CloudFront distribution. Your functions must be published to the /// LIVE stage to associate them with a cache behavior. class FunctionAssociations { /// The number of CloudFront functions in the list. final int quantity; /// The CloudFront functions that are associated with a cache behavior in a - /// CloudFront distribution. CloudFront functions must be published to the + /// CloudFront distribution. Your functions must be published to the /// LIVE stage to associate them with a cache behavior. final List? items; @@ -10664,36 +11026,48 @@ class FunctionConfig { /// A comment to describe the function. final String comment; - /// The function's runtime environment. The only valid value is - /// cloudfront-js-1.0. + /// The function's runtime environment version. final FunctionRuntime runtime; + /// The configuration for the key value store associations. + final KeyValueStoreAssociations? keyValueStoreAssociations; + FunctionConfig({ required this.comment, required this.runtime, + this.keyValueStoreAssociations, }); factory FunctionConfig.fromXml(_s.XmlElement elem) { return FunctionConfig( comment: _s.extractXmlStringValue(elem, 'Comment')!, runtime: _s.extractXmlStringValue(elem, 'Runtime')!.toFunctionRuntime(), + keyValueStoreAssociations: _s + .extractXmlChild(elem, 'KeyValueStoreAssociations') + ?.let(KeyValueStoreAssociations.fromXml), ); } Map toJson() { final comment = this.comment; final runtime = this.runtime; + final keyValueStoreAssociations = this.keyValueStoreAssociations; return { 'Comment': comment, 'Runtime': runtime.toValue(), + if (keyValueStoreAssociations != null) + 'KeyValueStoreAssociations': keyValueStoreAssociations, }; } _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { final comment = this.comment; final runtime = this.runtime; + final keyValueStoreAssociations = this.keyValueStoreAssociations; final $children = <_s.XmlNode>[ _s.encodeXmlStringValue('Comment', comment), _s.encodeXmlStringValue('Runtime', runtime.toValue()), + if (keyValueStoreAssociations != null) + keyValueStoreAssociations.toXml('KeyValueStoreAssociations'), ]; final $attributes = <_s.XmlAttribute>[ ...?attributes, @@ -10809,6 +11183,7 @@ class FunctionMetadata { enum FunctionRuntime { cloudfrontJs_1_0, + cloudfrontJs_2_0, } extension FunctionRuntimeValueExtension on FunctionRuntime { @@ -10816,6 +11191,8 @@ extension FunctionRuntimeValueExtension on FunctionRuntime { switch (this) { case FunctionRuntime.cloudfrontJs_1_0: return 'cloudfront-js-1.0'; + case FunctionRuntime.cloudfrontJs_2_0: + return 'cloudfront-js-2.0'; } } } @@ -10825,6 +11202,8 @@ extension FunctionRuntimeFromString on String { switch (this) { case 'cloudfront-js-1.0': return FunctionRuntime.cloudfrontJs_1_0; + case 'cloudfront-js-2.0': + return FunctionRuntime.cloudfrontJs_2_0; } throw Exception('$this is not known in enum FunctionRuntime'); } @@ -11823,6 +12202,69 @@ extension ICPRecordalStatusFromString on String { } } +/// The import source for the key value store. +class ImportSource { + /// The Amazon Resource Name (ARN) of the import source for the key value store. + final String sourceARN; + + /// The source type of the import source for the key value store. + final ImportSourceType sourceType; + + ImportSource({ + required this.sourceARN, + required this.sourceType, + }); + + Map toJson() { + final sourceARN = this.sourceARN; + final sourceType = this.sourceType; + return { + 'SourceARN': sourceARN, + 'SourceType': sourceType.toValue(), + }; + } + + _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { + final sourceARN = this.sourceARN; + final sourceType = this.sourceType; + final $children = <_s.XmlNode>[ + _s.encodeXmlStringValue('SourceType', sourceType.toValue()), + _s.encodeXmlStringValue('SourceARN', sourceARN), + ]; + final $attributes = <_s.XmlAttribute>[ + ...?attributes, + ]; + return _s.XmlElement( + _s.XmlName(elemName), + $attributes, + $children, + ); + } +} + +enum ImportSourceType { + s3, +} + +extension ImportSourceTypeValueExtension on ImportSourceType { + String toValue() { + switch (this) { + case ImportSourceType.s3: + return 'S3'; + } + } +} + +extension ImportSourceTypeFromString on String { + ImportSourceType toImportSourceType() { + switch (this) { + case 'S3': + return ImportSourceType.s3; + } + throw Exception('$this is not known in enum ImportSourceType'); + } +} + /// An invalidation. class Invalidation { /// The date and time the invalidation request was first made. @@ -12311,6 +12753,199 @@ class KeyPairIds { } } +/// The key value store. Use this to separate data from function code, allowing +/// you to update data without having to publish a new version of a function. +/// The key value store holds keys and their corresponding values. +class KeyValueStore { + /// The Amazon Resource Name (ARN) of the key value store. + final String arn; + + /// A comment for the key value store. + final String comment; + + /// The unique Id for the key value store. + final String id; + + /// The last-modified time of the key value store. + final DateTime lastModifiedTime; + + /// The name of the key value store. + final String name; + + /// The status of the key value store. + final String? status; + + KeyValueStore({ + required this.arn, + required this.comment, + required this.id, + required this.lastModifiedTime, + required this.name, + this.status, + }); + factory KeyValueStore.fromXml(_s.XmlElement elem) { + return KeyValueStore( + arn: _s.extractXmlStringValue(elem, 'ARN')!, + comment: _s.extractXmlStringValue(elem, 'Comment')!, + id: _s.extractXmlStringValue(elem, 'Id')!, + lastModifiedTime: _s.extractXmlDateTimeValue(elem, 'LastModifiedTime')!, + name: _s.extractXmlStringValue(elem, 'Name')!, + status: _s.extractXmlStringValue(elem, 'Status'), + ); + } + + Map toJson() { + final arn = this.arn; + final comment = this.comment; + final id = this.id; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final status = this.status; + return { + 'ARN': arn, + 'Comment': comment, + 'Id': id, + 'LastModifiedTime': iso8601ToJson(lastModifiedTime), + 'Name': name, + if (status != null) 'Status': status, + }; + } +} + +/// The key value store association. +class KeyValueStoreAssociation { + /// The Amazon Resource Name (ARN) of the key value store association. + final String keyValueStoreARN; + + KeyValueStoreAssociation({ + required this.keyValueStoreARN, + }); + factory KeyValueStoreAssociation.fromXml(_s.XmlElement elem) { + return KeyValueStoreAssociation( + keyValueStoreARN: _s.extractXmlStringValue(elem, 'KeyValueStoreARN')!, + ); + } + + Map toJson() { + final keyValueStoreARN = this.keyValueStoreARN; + return { + 'KeyValueStoreARN': keyValueStoreARN, + }; + } + + _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { + final keyValueStoreARN = this.keyValueStoreARN; + final $children = <_s.XmlNode>[ + _s.encodeXmlStringValue('KeyValueStoreARN', keyValueStoreARN), + ]; + final $attributes = <_s.XmlAttribute>[ + ...?attributes, + ]; + return _s.XmlElement( + _s.XmlName(elemName), + $attributes, + $children, + ); + } +} + +/// The key value store associations. +class KeyValueStoreAssociations { + /// The quantity of key value store associations. + final int quantity; + + /// The items of the key value store association. + final List? items; + + KeyValueStoreAssociations({ + required this.quantity, + this.items, + }); + factory KeyValueStoreAssociations.fromXml(_s.XmlElement elem) { + return KeyValueStoreAssociations( + quantity: _s.extractXmlIntValue(elem, 'Quantity')!, + items: _s.extractXmlChild(elem, 'Items')?.let((elem) => elem + .findElements('KeyValueStoreAssociation') + .map(KeyValueStoreAssociation.fromXml) + .toList()), + ); + } + + Map toJson() { + final quantity = this.quantity; + final items = this.items; + return { + 'Quantity': quantity, + if (items != null) 'Items': items, + }; + } + + _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { + final quantity = this.quantity; + final items = this.items; + final $children = <_s.XmlNode>[ + _s.encodeXmlIntValue('Quantity', quantity), + if (items != null) + _s.XmlElement(_s.XmlName('Items'), [], + items.map((e) => e.toXml('KeyValueStoreAssociation'))), + ]; + final $attributes = <_s.XmlAttribute>[ + ...?attributes, + ]; + return _s.XmlElement( + _s.XmlName(elemName), + $attributes, + $children, + ); + } +} + +/// The key value store list. +class KeyValueStoreList { + /// The maximum number of items in the key value store list. + final int maxItems; + + /// The quantity of the key value store list. + final int quantity; + + /// The items of the key value store list. + final List? items; + + /// The next marker associated with the key value store list. + final String? nextMarker; + + KeyValueStoreList({ + required this.maxItems, + required this.quantity, + this.items, + this.nextMarker, + }); + factory KeyValueStoreList.fromXml(_s.XmlElement elem) { + return KeyValueStoreList( + maxItems: _s.extractXmlIntValue(elem, 'MaxItems')!, + quantity: _s.extractXmlIntValue(elem, 'Quantity')!, + items: _s.extractXmlChild(elem, 'Items')?.let((elem) => elem + .findElements('KeyValueStore') + .map(KeyValueStore.fromXml) + .toList()), + nextMarker: _s.extractXmlStringValue(elem, 'NextMarker'), + ); + } + + Map toJson() { + final maxItems = this.maxItems; + final quantity = this.quantity; + final items = this.items; + final nextMarker = this.nextMarker; + return { + 'MaxItems': maxItems, + 'Quantity': quantity, + if (items != null) 'Items': items, + if (nextMarker != null) 'NextMarker': nextMarker, + }; + } +} + /// Contains information about the Amazon Kinesis data stream where you are /// sending real-time log data. class KinesisStreamConfig { @@ -12854,6 +13489,22 @@ class ListKeyGroupsResult { } } +class ListKeyValueStoresResult { + /// The resulting key value stores list. + final KeyValueStoreList? keyValueStoreList; + + ListKeyValueStoresResult({ + this.keyValueStoreList, + }); + + Map toJson() { + final keyValueStoreList = this.keyValueStoreList; + return { + if (keyValueStoreList != null) 'KeyValueStoreList': keyValueStoreList, + }; + } +} + class ListOriginAccessControlsResult { /// A list of origin access controls. final OriginAccessControlList? originAccessControlList; @@ -13230,10 +13881,10 @@ class MonitoringSubscription { /// An Elastic Load Balancing load balancer /// ///
      • -/// An AWS Elemental MediaPackage endpoint +/// An Elemental MediaPackage endpoint ///
      • ///
      • -/// An AWS Elemental MediaStore container +/// An Elemental MediaStore container ///
      • ///
      • /// Any other HTTP server, running on an Amazon EC2 instance or any other kind @@ -13462,7 +14113,8 @@ class OriginAccessControl { /// A CloudFront origin access control configuration. class OriginAccessControlConfig { - /// A name to identify the origin access control. + /// A name to identify the origin access control. You can specify up to 64 + /// characters. final String name; /// The type of origin that this origin access control is for. @@ -13640,6 +14292,8 @@ class OriginAccessControlList { enum OriginAccessControlOriginTypes { s3, mediastore, + mediapackagev2, + lambda, } extension OriginAccessControlOriginTypesValueExtension @@ -13650,6 +14304,10 @@ extension OriginAccessControlOriginTypesValueExtension return 's3'; case OriginAccessControlOriginTypes.mediastore: return 'mediastore'; + case OriginAccessControlOriginTypes.mediapackagev2: + return 'mediapackagev2'; + case OriginAccessControlOriginTypes.lambda: + return 'lambda'; } } } @@ -13661,6 +14319,10 @@ extension OriginAccessControlOriginTypesFromString on String { return OriginAccessControlOriginTypes.s3; case 'mediastore': return OriginAccessControlOriginTypes.mediastore; + case 'mediapackagev2': + return OriginAccessControlOriginTypes.mediapackagev2; + case 'lambda': + return OriginAccessControlOriginTypes.lambda; } throw Exception( '$this is not known in enum OriginAccessControlOriginTypes'); @@ -13865,7 +14527,7 @@ class OriginCustomHeader { /// An origin group includes two origins (a primary origin and a second origin /// to failover to) and a failover criteria that you specify. You create an /// origin group to support origin failover in CloudFront. When you create or -/// update a distribution, you can specifiy the origin group instead of a single +/// update a distribution, you can specify the origin group instead of a single /// origin, and CloudFront will failover from the primary origin to the second /// origin under the failover conditions that you've chosen. class OriginGroup { @@ -17167,6 +17829,8 @@ class ResponseHeadersPolicySecurityHeadersConfig { /// /// For more information about the Strict-Transport-Security HTTP /// response header, see Security + /// headers in the Amazon CloudFront Developer Guide and Strict-Transport-Security /// in the MDN Web Docs. final ResponseHeadersPolicyStrictTransportSecurity? strictTransportSecurity; @@ -17678,14 +18342,22 @@ class S3Origin { /// origin is a custom origin or an S3 bucket that is configured as a website /// endpoint, use the CustomOriginConfig element instead. class S3OriginConfig { + /// + /// If you're using origin access control (OAC) instead of origin access + /// identity, specify an empty OriginAccessIdentity element. For + /// more information, see Restricting + /// access to an Amazon Web Services in the Amazon CloudFront Developer + /// Guide. + /// /// The CloudFront origin access identity to associate with the origin. Use an /// origin access identity to configure the origin so that viewers can /// only access objects in an Amazon S3 bucket through CloudFront. The /// format of the value is: /// - /// origin-access-identity/cloudfront/ID-of-origin-access-identity + /// origin-access-identity/cloudfront/ID-of-origin-access-identity /// - /// where ID-of-origin-access-identity is the value that + /// The ID-of-origin-access-identity is the value that /// CloudFront returned in the ID element when you created the /// origin access identity. /// @@ -17788,7 +18460,7 @@ class SessionStickinessConfig { /// part of the same session. Allowed values are 300–3600 seconds (5–60 /// minutes). /// - /// The value must be less than or equal to IdleTTL. + /// The value must be greater than or equal to IdleTTL. final int maximumTTL; SessionStickinessConfig({ @@ -18914,8 +19586,8 @@ class TrustedKeyGroups { /// to verify the signatures of signed URLs and signed cookies. class TrustedSigners { /// This field is true if any of the Amazon Web Services accounts - /// have public keys that CloudFront can use to verify the signatures of signed - /// URLs and signed cookies. If not, this field is false. + /// in the list are configured as trusted signers. If not, this field is + /// false. final bool enabled; /// The number of Amazon Web Services accounts in the list. @@ -19225,6 +19897,70 @@ class UpdateKeyGroupResult { } } +class UpdateKeyValueStoreRequest { + /// The comment of the key value store to update. + final String comment; + + /// The key value store to update, if a match occurs. + final String ifMatch; + + /// The name of the key value store to update. + final String name; + + UpdateKeyValueStoreRequest({ + required this.comment, + required this.ifMatch, + required this.name, + }); + + Map toJson() { + final comment = this.comment; + final ifMatch = this.ifMatch; + final name = this.name; + return { + 'Comment': comment, + }; + } + + _s.XmlElement toXml(String elemName, {List<_s.XmlAttribute>? attributes}) { + final comment = this.comment; + final ifMatch = this.ifMatch; + final name = this.name; + final $children = <_s.XmlNode>[ + _s.encodeXmlStringValue('Comment', comment), + ]; + final $attributes = <_s.XmlAttribute>[ + ...?attributes, + ]; + return _s.XmlElement( + _s.XmlName(elemName), + $attributes, + $children, + ); + } +} + +class UpdateKeyValueStoreResult { + /// The ETag of the resulting key value store. + final String? eTag; + + /// The resulting key value store to update. + final KeyValueStore? keyValueStore; + + UpdateKeyValueStoreResult({ + this.eTag, + this.keyValueStore, + }); + + Map toJson() { + final eTag = this.eTag; + final keyValueStore = this.keyValueStore; + return { + if (keyValueStore != null) 'KeyValueStore': keyValueStore, + }; + } +} + class UpdateOriginAccessControlResult { /// The new version of the origin access control after it has been updated. final String? eTag; @@ -19798,6 +20534,12 @@ class CannotChangeImmutablePublicKeyFields extends _s.GenericAwsException { message: message); } +class CannotDeleteEntityWhileInUse extends _s.GenericAwsException { + CannotDeleteEntityWhileInUse({String? type, String? message}) + : super( + type: type, code: 'CannotDeleteEntityWhileInUse', message: message); +} + class CloudFrontOriginAccessIdentityAlreadyExists extends _s.GenericAwsException { CloudFrontOriginAccessIdentityAlreadyExists({String? type, String? message}) @@ -19841,6 +20583,26 @@ class DistributionNotDisabled extends _s.GenericAwsException { : super(type: type, code: 'DistributionNotDisabled', message: message); } +class EntityAlreadyExists extends _s.GenericAwsException { + EntityAlreadyExists({String? type, String? message}) + : super(type: type, code: 'EntityAlreadyExists', message: message); +} + +class EntityLimitExceeded extends _s.GenericAwsException { + EntityLimitExceeded({String? type, String? message}) + : super(type: type, code: 'EntityLimitExceeded', message: message); +} + +class EntityNotFound extends _s.GenericAwsException { + EntityNotFound({String? type, String? message}) + : super(type: type, code: 'EntityNotFound', message: message); +} + +class EntitySizeLimitExceeded extends _s.GenericAwsException { + EntitySizeLimitExceeded({String? type, String? message}) + : super(type: type, code: 'EntitySizeLimitExceeded', message: message); +} + class FieldLevelEncryptionConfigAlreadyExists extends _s.GenericAwsException { FieldLevelEncryptionConfigAlreadyExists({String? type, String? message}) : super( @@ -20717,6 +21479,8 @@ final _exceptionFns = { CachePolicyInUse(type: type, message: message), 'CannotChangeImmutablePublicKeyFields': (type, message) => CannotChangeImmutablePublicKeyFields(type: type, message: message), + 'CannotDeleteEntityWhileInUse': (type, message) => + CannotDeleteEntityWhileInUse(type: type, message: message), 'CloudFrontOriginAccessIdentityAlreadyExists': (type, message) => CloudFrontOriginAccessIdentityAlreadyExists(type: type, message: message), 'CloudFrontOriginAccessIdentityInUse': (type, message) => @@ -20729,6 +21493,14 @@ final _exceptionFns = { DistributionAlreadyExists(type: type, message: message), 'DistributionNotDisabled': (type, message) => DistributionNotDisabled(type: type, message: message), + 'EntityAlreadyExists': (type, message) => + EntityAlreadyExists(type: type, message: message), + 'EntityLimitExceeded': (type, message) => + EntityLimitExceeded(type: type, message: message), + 'EntityNotFound': (type, message) => + EntityNotFound(type: type, message: message), + 'EntitySizeLimitExceeded': (type, message) => + EntitySizeLimitExceeded(type: type, message: message), 'FieldLevelEncryptionConfigAlreadyExists': (type, message) => FieldLevelEncryptionConfigAlreadyExists(type: type, message: message), 'FieldLevelEncryptionConfigInUse': (type, message) => diff --git a/aws_client/lib/src/generated/cloud_hsm/v2014_05_30.dart b/aws_client/lib/src/generated/cloud_hsm/v2014_05_30.dart index a7d88c4f6..93ef7a707 100644 --- a/aws_client/lib/src/generated/cloud_hsm/v2014_05_30.dart +++ b/aws_client/lib/src/generated/cloud_hsm/v2014_05_30.dart @@ -85,6 +85,7 @@ class CloudHsm { /// /// Parameter [tagList] : /// One or more tags. + @Deprecated('This API is deprecated.') Future addTagsToResource({ required String resourceArn, required List tagList, @@ -133,6 +134,7 @@ class CloudHsm { /// /// Parameter [label] : /// The label of the new high-availability partition group. + @Deprecated('This API is deprecated.') Future createHapg({ required String label, }) async { @@ -215,6 +217,7 @@ class CloudHsm { /// Parameter [syslogIp] : /// The IP address for the syslog monitoring server. The AWS CloudHSM service /// only supports one syslog monitoring server. + @Deprecated('This API is deprecated.') Future createHsm({ required String iamRoleArn, required String sshKey, @@ -278,6 +281,7 @@ class CloudHsm { /// /// Parameter [label] : /// The label for the client. + @Deprecated('This API is deprecated.') Future createLunaClient({ required String certificate, String? label, @@ -325,6 +329,7 @@ class CloudHsm { /// /// Parameter [hapgArn] : /// The ARN of the high-availability partition group to delete. + @Deprecated('This API is deprecated.') Future deleteHapg({ required String hapgArn, }) async { @@ -371,6 +376,7 @@ class CloudHsm { /// /// Parameter [hsmArn] : /// The ARN of the HSM to delete. + @Deprecated('This API is deprecated.') Future deleteHsm({ required String hsmArn, }) async { @@ -416,6 +422,7 @@ class CloudHsm { /// /// Parameter [clientArn] : /// The ARN of the client to delete. + @Deprecated('This API is deprecated.') Future deleteLunaClient({ required String clientArn, }) async { @@ -461,6 +468,7 @@ class CloudHsm { /// /// Parameter [hapgArn] : /// The ARN of the high-availability partition group to describe. + @Deprecated('This API is deprecated.') Future describeHapg({ required String hapgArn, }) async { @@ -512,6 +520,7 @@ class CloudHsm { /// Parameter [hsmSerialNumber] : /// The serial number of the HSM. Either the HsmArn or the /// HsmSerialNumber parameter must be specified. + @Deprecated('This API is deprecated.') Future describeHsm({ String? hsmArn, String? hsmSerialNumber, @@ -562,6 +571,7 @@ class CloudHsm { /// /// Parameter [clientArn] : /// The ARN of the client. + @Deprecated('This API is deprecated.') Future describeLunaClient({ String? certificateFingerprint, String? clientArn, @@ -618,6 +628,7 @@ class CloudHsm { /// Parameter [hapgList] : /// A list of ARNs that identify the high-availability partition groups that /// are associated with the client. + @Deprecated('This API is deprecated.') Future getConfig({ required String clientArn, required ClientVersion clientVersion, @@ -664,6 +675,7 @@ class CloudHsm { /// May throw [CloudHsmServiceException]. /// May throw [CloudHsmInternalException]. /// May throw [InvalidRequestException]. + @Deprecated('This API is deprecated.') Future listAvailableZones() async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -711,6 +723,7 @@ class CloudHsm { /// Parameter [nextToken] : /// The NextToken value from a previous call to /// ListHapgs. Pass null if this is the first call. + @Deprecated('This API is deprecated.') Future listHapgs({ String? nextToken, }) async { @@ -764,6 +777,7 @@ class CloudHsm { /// Parameter [nextToken] : /// The NextToken value from a previous call to /// ListHsms. Pass null if this is the first call. + @Deprecated('This API is deprecated.') Future listHsms({ String? nextToken, }) async { @@ -816,6 +830,7 @@ class CloudHsm { /// Parameter [nextToken] : /// The NextToken value from a previous call to /// ListLunaClients. Pass null if this is the first call. + @Deprecated('This API is deprecated.') Future listLunaClients({ String? nextToken, }) async { @@ -861,6 +876,7 @@ class CloudHsm { /// /// Parameter [resourceArn] : /// The Amazon Resource Name (ARN) of the AWS CloudHSM resource. + @Deprecated('This API is deprecated.') Future listTagsForResource({ required String resourceArn, }) async { @@ -913,6 +929,7 @@ class CloudHsm { /// Parameter [partitionSerialList] : /// The list of partition serial numbers to make members of the /// high-availability partition group. + @Deprecated('This API is deprecated.') Future modifyHapg({ required String hapgArn, String? label, @@ -992,6 +1009,7 @@ class CloudHsm { /// Parameter [syslogIp] : /// The new IP address for the syslog monitoring server. The AWS CloudHSM /// service only supports one syslog monitoring server. + @Deprecated('This API is deprecated.') Future modifyHsm({ required String hsmArn, String? eniIp, @@ -1051,6 +1069,7 @@ class CloudHsm { /// /// Parameter [clientArn] : /// The ARN of the client. + @Deprecated('This API is deprecated.') Future modifyLunaClient({ required String certificate, required String clientArn, @@ -1107,6 +1126,7 @@ class CloudHsm { /// /// Specify only the tag key to remove (not the value). To overwrite the value /// for an existing tag, use AddTagsToResource. + @Deprecated('This API is deprecated.') Future removeTagsFromResource({ required String resourceArn, required List tagKeyList, diff --git a/aws_client/lib/src/generated/cloud_trail/v2013_11_01.dart b/aws_client/lib/src/generated/cloud_trail/v2013_11_01.dart index 3b5f5526a..40c1a02d3 100644 --- a/aws_client/lib/src/generated/cloud_trail/v2013_11_01.dart +++ b/aws_client/lib/src/generated/cloud_trail/v2013_11_01.dart @@ -56,7 +56,7 @@ class CloudTrail { /// specify a key without a value, the tag will be created with the specified /// key and a value of null. You can tag a trail or event data store that /// applies to all Amazon Web Services Regions only from the Region in which - /// the trail or event data store was created (also known as its home region). + /// the trail or event data store was created (also known as its home Region). /// /// May throw [ResourceNotFoundException]. /// May throw [CloudTrailARNInvalidException]. @@ -83,7 +83,7 @@ class CloudTrail { /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail /// /// The format of an event data store ARN is: - /// arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + /// arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE /// /// The format of a channel ARN is: /// arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 @@ -260,16 +260,46 @@ class CloudTrail { /// /// For more information about how to use advanced event selectors to include /// Config configuration items in your event data store, see Create + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-eds-cli.html#lake-cli-create-eds-config">Create /// an event data store for Config configuration items in the CloudTrail /// User Guide. /// /// For more information about how to use advanced event selectors to include - /// non-Amazon Web Services events in your event data store, see Create + /// events outside of Amazon Web Services events in your event data store, see + /// Create /// an integration to log events from outside Amazon Web Services in the /// CloudTrail User Guide. /// + /// Parameter [billingMode] : + /// The billing mode for the event data store determines the cost for + /// ingesting events and the default and maximum retention period for the + /// event data store. + /// + /// The following are the possible values: + /// + ///
          + ///
        • + /// EXTENDABLE_RETENTION_PRICING - This billing mode is generally + /// recommended if you want a flexible retention period of up to 3653 days + /// (about 10 years). The default retention period for this billing mode is + /// 366 days. + ///
        • + ///
        • + /// FIXED_RETENTION_PRICING - This billing mode is recommended if + /// you expect to ingest more than 25 TB of event data per month and need a + /// retention period of up to 2557 days (about 7 years). The default retention + /// period for this billing mode is 2557 days. + ///
        • + ///
        + /// The default value is EXTENDABLE_RETENTION_PRICING. + /// + /// For more information about CloudTrail pricing, see CloudTrail Pricing + /// and Managing + /// CloudTrail Lake costs. + /// /// Parameter [kmsKeyId] : /// Specifies the KMS key ID to use to encrypt the events delivered by /// CloudTrail. The value can be an alias name prefixed by @@ -308,16 +338,38 @@ class CloudTrail { ///
      /// /// Parameter [multiRegionEnabled] : - /// Specifies whether the event data store includes events from all regions, - /// or only from the region in which the event data store is created. + /// Specifies whether the event data store includes events from all Regions, + /// or only from the Region in which the event data store is created. /// /// Parameter [organizationEnabled] : /// Specifies whether an event data store collects events logged for an /// organization in Organizations. /// /// Parameter [retentionPeriod] : - /// The retention period of the event data store, in days. You can set a - /// retention period of up to 2557 days, the equivalent of seven years. + /// The retention period of the event data store, in days. If + /// BillingMode is set to + /// EXTENDABLE_RETENTION_PRICING, you can set a retention period + /// of up to 3653 days, the equivalent of 10 years. If + /// BillingMode is set to FIXED_RETENTION_PRICING, + /// you can set a retention period of up to 2557 days, the equivalent of seven + /// years. + /// + /// CloudTrail Lake determines whether to retain an event by checking if the + /// eventTime of the event is within the specified retention + /// period. For example, if you set a retention period of 90 days, CloudTrail + /// will remove events when the eventTime is older than 90 days. + /// + /// If you plan to copy trail events to this event data store, we recommend + /// that you consider both the age of the events that you want to copy as well + /// as how long you want to keep the copied events in your event data store. + /// For example, if you copy trail events that are 5 years old and specify a + /// retention period of 7 years, the event data store will retain those events + /// for two years. + /// + /// + /// Parameter [startIngestion] : + /// Specifies whether the event data store should start ingesting live events. + /// The default is true. /// /// Parameter [terminationProtectionEnabled] : /// Specifies whether termination protection is enabled for the event data @@ -326,10 +378,12 @@ class CloudTrail { Future createEventDataStore({ required String name, List? advancedEventSelectors, + BillingMode? billingMode, String? kmsKeyId, bool? multiRegionEnabled, bool? organizationEnabled, int? retentionPeriod, + bool? startIngestion, List? tagsList, bool? terminationProtectionEnabled, }) async { @@ -337,7 +391,7 @@ class CloudTrail { 'retentionPeriod', retentionPeriod, 7, - 2557, + 3653, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -354,12 +408,14 @@ class CloudTrail { 'Name': name, if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (kmsKeyId != null) 'KmsKeyId': kmsKeyId, if (multiRegionEnabled != null) 'MultiRegionEnabled': multiRegionEnabled, if (organizationEnabled != null) 'OrganizationEnabled': organizationEnabled, if (retentionPeriod != null) 'RetentionPeriod': retentionPeriod, + if (startIngestion != null) 'StartIngestion': startIngestion, if (tagsList != null) 'TagsList': tagsList, if (terminationProtectionEnabled != null) 'TerminationProtectionEnabled': terminationProtectionEnabled, @@ -386,6 +442,7 @@ class CloudTrail { /// May throw [TrailNotProvidedException]. /// May throw [TagsLimitExceededException]. /// May throw [InvalidParameterCombinationException]. + /// May throw [InvalidParameterException]. /// May throw [KmsKeyNotFoundException]. /// May throw [KmsKeyDisabledException]. /// May throw [KmsException]. @@ -403,6 +460,7 @@ class CloudTrail { /// May throw [NoManagementAccountSLRExistsException]. /// May throw [CloudTrailInvalidClientTokenIdException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// /// Parameter [name] : /// Specifies the name of the trail. The name must meet the following @@ -430,9 +488,9 @@ class CloudTrail { /// /// Parameter [s3BucketName] : /// Specifies the name of the Amazon S3 bucket designated for publishing log - /// files. See Amazon - /// S3 Bucket Naming Requirements. + /// files. For information about bucket naming rules, see Bucket + /// naming rules in the Amazon Simple Storage Service User Guide. /// /// Parameter [cloudWatchLogsLogGroupArn] : /// Specifies a log group name using an Amazon Resource Name (ARN), a unique @@ -464,10 +522,10 @@ class CloudTrail { /// as IAM to the log files. /// /// Parameter [isMultiRegionTrail] : - /// Specifies whether the trail is created in the current region or in all - /// regions. The default is false, which creates a trail only in the region + /// Specifies whether the trail is created in the current Region or in all + /// Regions. The default is false, which creates a trail only in the Region /// where you are signed in. As a best practice, consider creating trails that - /// log events in all regions. + /// log events in all Regions. /// /// Parameter [isOrganizationTrail] : /// Specifies whether the trail is created for all accounts in an organization @@ -508,7 +566,7 @@ class CloudTrail { /// Parameter [s3KeyPrefix] : /// Specifies the Amazon S3 key prefix that comes after the name of the bucket /// you have designated for log file delivery. For more information, see Finding + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding /// Your CloudTrail Log Files. The maximum length is 200 characters. /// /// Parameter [snsTopicName] : @@ -599,9 +657,11 @@ class CloudTrail { /// DeleteEventDataStore, the event data store enters a /// PENDING_DELETION state, and is automatically deleted after a /// wait period of seven days. TerminationProtectionEnabled must - /// be set to False on the event data store; this operation - /// cannot work if TerminationProtectionEnabled is - /// True. + /// be set to False on the event data store and the + /// FederationStatus must be DISABLED. You cannot + /// delete an event data store if TerminationProtectionEnabled is + /// True or the FederationStatus is + /// ENABLED. /// /// After you run DeleteEventDataStore on an event data store, /// you cannot run ListQueries, DescribeQuery, or @@ -621,6 +681,8 @@ class CloudTrail { /// May throw [NoManagementAccountSLRExistsException]. /// May throw [ChannelExistsForEDSException]. /// May throw [InsufficientDependencyServiceAccessPermissionException]. + /// May throw [ConflictException]. + /// May throw [EventDataStoreFederationEnabledException]. /// /// Parameter [eventDataStore] : /// The ARN (or the ID suffix of the ARN) of the event data store to delete. @@ -678,15 +740,16 @@ class CloudTrail { ); } - /// Deletes a trail. This operation must be called from the region in which + /// Deletes a trail. This operation must be called from the Region in which /// the trail was created. DeleteTrail cannot be called on the - /// shadow trails (replicated trails in other regions) of a trail that is - /// enabled in all regions. + /// shadow trails (replicated trails in other Regions) of a trail that is + /// enabled in all Regions. /// /// May throw [TrailNotFoundException]. /// May throw [InvalidTrailNameException]. /// May throw [CloudTrailARNInvalidException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// May throw [InvalidHomeRegionException]. /// May throw [UnsupportedOperationException]. /// May throw [OperationNotPermittedException]. @@ -757,9 +820,13 @@ class CloudTrail { } /// Returns metadata about a query, including query run time in milliseconds, - /// number of events scanned and matched, and query status. You must specify - /// an ARN for EventDataStore, and a value for - /// QueryID. + /// number of events scanned and matched, and query status. If the query + /// results were delivered to an S3 bucket, the response also provides the S3 + /// URI and the delivery status. + /// + /// You must specify either a QueryID or a + /// QueryAlias. Specifying the QueryAlias parameter + /// returns information about the last query run for the alias. /// /// May throw [EventDataStoreARNInvalidException]. /// May throw [EventDataStoreNotFoundException]. @@ -770,15 +837,19 @@ class CloudTrail { /// May throw [UnsupportedOperationException]. /// May throw [NoManagementAccountSLRExistsException]. /// - /// Parameter [queryId] : - /// The query ID. - /// /// Parameter [eventDataStore] : /// The ARN (or the ID suffix of the ARN) of an event data store on which the /// specified query was run. + /// + /// Parameter [queryAlias] : + /// The alias that identifies a query template. + /// + /// Parameter [queryId] : + /// The query ID. Future describeQuery({ - required String queryId, String? eventDataStore, + String? queryAlias, + String? queryId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -792,8 +863,9 @@ class CloudTrail { // TODO queryParams headers: headers, payload: { - 'QueryId': queryId, if (eventDataStore != null) 'EventDataStore': eventDataStore, + if (queryAlias != null) 'QueryAlias': queryAlias, + if (queryId != null) 'QueryId': queryId, }, ); @@ -801,19 +873,20 @@ class CloudTrail { } /// Retrieves settings for one or more trails associated with the current - /// region for your account. + /// Region for your account. /// /// May throw [UnsupportedOperationException]. /// May throw [OperationNotPermittedException]. /// May throw [InvalidTrailNameException]. + /// May throw [CloudTrailARNInvalidException]. /// May throw [NoManagementAccountSLRExistsException]. /// /// Parameter [includeShadowTrails] : /// Specifies whether to include shadow trails in the response. A shadow trail - /// is the replication in a region of a trail that was created in a different - /// region, or in the case of an organization trail, the replication of an + /// is the replication in a Region of a trail that was created in a different + /// Region, or in the case of an organization trail, the replication of an /// organization trail in member accounts. If you do not include shadow - /// trails, organization trails in a member account and region replication + /// trails, organization trails in a member account and Region replication /// trails will not be returned. The default is true. /// /// Parameter [trailNameList] : @@ -823,23 +896,23 @@ class CloudTrail { /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail /// /// If an empty list is specified, information for the trail in the current - /// region is returned. + /// Region is returned. /// ///
        ///
      • /// If an empty list is specified and IncludeShadowTrails is - /// false, then information for all trails in the current region is returned. + /// false, then information for all trails in the current Region is returned. ///
      • ///
      • /// If an empty list is specified and IncludeShadowTrails is null or true, - /// then information for all trails in the current region and any associated - /// shadow trails in other regions is returned. + /// then information for all trails in the current Region and any associated + /// shadow trails in other Regions is returned. ///
      • ///
      /// If one or more trail names are specified, information is returned only if - /// the names match the names of trails belonging only to the current region + /// the names match the names of trails belonging only to the current Region /// and current account. To return information about a trail in another - /// region, you must specify its trail ARN. + /// Region, you must specify its trail ARN. /// Future describeTrails({ bool? includeShadowTrails, @@ -866,6 +939,127 @@ class CloudTrail { return DescribeTrailsResponse.fromJson(jsonResponse.body); } + /// Disables Lake query federation on the specified event data store. When you + /// disable federation, CloudTrail disables the integration with Glue, Lake + /// Formation, and Amazon Athena. After disabling Lake query federation, you + /// can no longer query your event data in Amazon Athena. + /// + /// No CloudTrail Lake data is deleted when you disable federation and you can + /// continue to run queries in CloudTrail Lake. + /// + /// May throw [EventDataStoreARNInvalidException]. + /// May throw [EventDataStoreNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InactiveEventDataStoreException]. + /// May throw [OperationNotPermittedException]. + /// May throw [UnsupportedOperationException]. + /// May throw [CloudTrailAccessNotEnabledException]. + /// May throw [InsufficientDependencyServiceAccessPermissionException]. + /// May throw [NotOrganizationMasterAccountException]. + /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [OrganizationsNotInUseException]. + /// May throw [OrganizationNotInAllFeaturesModeException]. + /// May throw [ConcurrentModificationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [eventDataStore] : + /// The ARN (or ID suffix of the ARN) of the event data store for which you + /// want to disable Lake query federation. + Future disableFederation({ + required String eventDataStore, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.DisableFederation' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EventDataStore': eventDataStore, + }, + ); + + return DisableFederationResponse.fromJson(jsonResponse.body); + } + + /// Enables Lake query federation on the specified event data store. + /// Federating an event data store lets you view the metadata associated with + /// the event data store in the Glue Data + /// Catalog and run SQL queries against your event data using Amazon + /// Athena. The table metadata stored in the Glue Data Catalog lets the Athena + /// query engine know how to find, read, and process the data that you want to + /// query. + /// + /// When you enable Lake query federation, CloudTrail creates a managed + /// database named aws:cloudtrail (if the database doesn't + /// already exist) and a managed federated table in the Glue Data Catalog. The + /// event data store ID is used for the table name. CloudTrail registers the + /// role ARN and event data store in Lake + /// Formation, the service responsible for allowing fine-grained access + /// control of the federated resources in the Glue Data Catalog. + /// + /// For more information about Lake query federation, see Federate + /// an event data store. + /// + /// May throw [EventDataStoreARNInvalidException]. + /// May throw [EventDataStoreNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [InactiveEventDataStoreException]. + /// May throw [OperationNotPermittedException]. + /// May throw [UnsupportedOperationException]. + /// May throw [CloudTrailAccessNotEnabledException]. + /// May throw [InsufficientDependencyServiceAccessPermissionException]. + /// May throw [NotOrganizationMasterAccountException]. + /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [OrganizationsNotInUseException]. + /// May throw [OrganizationNotInAllFeaturesModeException]. + /// May throw [ConcurrentModificationException]. + /// May throw [AccessDeniedException]. + /// May throw [EventDataStoreFederationEnabledException]. + /// + /// Parameter [eventDataStore] : + /// The ARN (or ID suffix of the ARN) of the event data store for which you + /// want to enable Lake query federation. + /// + /// Parameter [federationRoleArn] : + /// The ARN of the federation role to use for the event data store. Amazon Web + /// Services services like Lake Formation use this federation role to access + /// data for the federated event data store. The federation role must exist in + /// your account and provide the required + /// minimum permissions. + Future enableFederation({ + required String eventDataStore, + required String federationRoleArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.EnableFederation' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EventDataStore': eventDataStore, + 'FederationRoleArn': federationRoleArn, + }, + ); + + return EnableFederationResponse.fromJson(jsonResponse.body); + } + /// Returns information about a specific channel. /// /// May throw [ChannelARNInvalidException]. @@ -1052,18 +1246,24 @@ class CloudTrail { } /// Describes the settings for the Insights event selectors that you - /// configured for your trail. GetInsightSelectors shows if - /// CloudTrail Insights event logging is enabled on the trail, and if it is, - /// which insight types are enabled. If you run - /// GetInsightSelectors on a trail that does not have Insights - /// events enabled, the operation throws the exception - /// InsightNotEnabledException + /// configured for your trail or event data store. + /// GetInsightSelectors shows if CloudTrail Insights event + /// logging is enabled on the trail or event data store, and if it is, which + /// Insights types are enabled. If you run GetInsightSelectors on + /// a trail or event data store that does not have Insights events enabled, + /// the operation throws the exception InsightNotEnabledException + /// + /// Specify either the EventDataStore parameter to get Insights + /// event selectors for an event data store, or the TrailName + /// parameter to the get Insights event selectors for a trail. You cannot + /// specify these parameters together. /// /// For more information, see Logging - /// CloudTrail Insights Events for Trails in the CloudTrail User - /// Guide. + /// CloudTrail Insights events in the CloudTrail User Guide. /// + /// May throw [InvalidParameterException]. + /// May throw [InvalidParameterCombinationException]. /// May throw [TrailNotFoundException]. /// May throw [InvalidTrailNameException]. /// May throw [CloudTrailARNInvalidException]. @@ -1071,6 +1271,13 @@ class CloudTrail { /// May throw [OperationNotPermittedException]. /// May throw [InsightNotEnabledException]. /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [eventDataStore] : + /// Specifies the ARN (or ID suffix of the ARN) of the event data store for + /// which you want to get Insights selectors. + /// + /// You cannot use this parameter with the TrailName parameter. /// /// Parameter [trailName] : /// Specifies the name of the trail or trail ARN. If you specify a trail name, @@ -1098,8 +1305,12 @@ class CloudTrail { /// If you specify a trail ARN, it must be in the format: /// /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + /// + /// You cannot use this parameter with the EventDataStore + /// parameter. Future getInsightSelectors({ - required String trailName, + String? eventDataStore, + String? trailName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1113,7 +1324,8 @@ class CloudTrail { // TODO queryParams headers: headers, payload: { - 'TrailName': trailName, + if (eventDataStore != null) 'EventDataStore': eventDataStore, + if (trailName != null) 'TrailName': trailName, }, ); @@ -1122,7 +1334,7 @@ class CloudTrail { /// Gets event data results of a query. You must specify the /// QueryID value returned by the StartQuery - /// operation, and an ARN for EventDataStore. + /// operation. /// /// May throw [EventDataStoreARNInvalidException]. /// May throw [EventDataStoreNotFoundException]. @@ -1254,8 +1466,8 @@ class CloudTrail { /// Returns a JSON-formatted list of information about the specified trail. /// Fields include information on delivery errors, Amazon SNS and Amazon S3 /// errors, and start and stop logging times for each trail. This operation - /// returns trail status from a single region. To return trail status from all - /// regions, you must call the operation on each region. + /// returns trail status from a single Region. To return trail status from all + /// Regions, you must call the operation on each Region. /// /// May throw [CloudTrailARNInvalidException]. /// May throw [TrailNotFoundException]. @@ -1266,7 +1478,7 @@ class CloudTrail { /// Parameter [name] : /// Specifies the name or the CloudTrail ARN of the trail for which you are /// requesting status. To get the status of a shadow trail (a replication of - /// the trail in another region), you must specify its ARN. The following is + /// the trail in another Region), you must specify its ARN. The following is /// the format of a trail ARN. /// /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail @@ -1338,7 +1550,7 @@ class CloudTrail { } /// Returns information about all event data stores in the account, in the - /// current region. + /// current Region. /// /// May throw [InvalidMaxResultsException]. /// May throw [InvalidNextTokenException]. @@ -1386,6 +1598,7 @@ class CloudTrail { /// May throw [InvalidNextTokenException]. /// May throw [OperationNotPermittedException]. /// May throw [UnsupportedOperationException]. + /// May throw [InvalidParameterException]. /// /// Parameter [importId] : /// The ID of the import. @@ -1481,14 +1694,156 @@ class CloudTrail { return ListImportsResponse.fromJson(jsonResponse.body); } + /// Returns Insights metrics data for trails that have enabled Insights. The + /// request must include the EventSource, EventName, + /// and InsightType parameters. + /// + /// If the InsightType is set to + /// ApiErrorRateInsight, the request must also include the + /// ErrorCode parameter. + /// + /// The following are the available time periods for + /// ListInsightsMetricData. Each cutoff is inclusive. + /// + ///
        + ///
      • + /// Data points with a period of 60 seconds (1-minute) are available for 15 + /// days. + ///
      • + ///
      • + /// Data points with a period of 300 seconds (5-minute) are available for 63 + /// days. + ///
      • + ///
      • + /// Data points with a period of 3600 seconds (1 hour) are available for 90 + /// days. + ///
      • + ///
      + /// Access to the ListInsightsMetricData API operation is linked + /// to the cloudtrail:LookupEvents action. To use this operation, + /// you must have permissions to perform the + /// cloudtrail:LookupEvents action. + /// + /// May throw [InvalidParameterException]. + /// May throw [OperationNotPermittedException]. + /// May throw [UnsupportedOperationException]. + /// + /// Parameter [eventName] : + /// The name of the event, typically the Amazon Web Services API on which + /// unusual levels of activity were recorded. + /// + /// Parameter [eventSource] : + /// The Amazon Web Services service to which the request was made, such as + /// iam.amazonaws.com or s3.amazonaws.com. + /// + /// Parameter [insightType] : + /// The type of CloudTrail Insights event, which is either + /// ApiCallRateInsight or ApiErrorRateInsight. The + /// ApiCallRateInsight Insights type analyzes write-only + /// management API calls that are aggregated per minute against a baseline API + /// call volume. The ApiErrorRateInsight Insights type analyzes + /// management API calls that result in error codes. + /// + /// Parameter [dataType] : + /// Type of datapoints to return. Valid values are NonZeroData + /// and FillWithZeros. The default is NonZeroData. + /// + /// Parameter [endTime] : + /// Specifies, in UTC, the end time for time-series data. The value specified + /// is exclusive; results include data points up to the specified time stamp. + /// + /// The default is the time of request. + /// + /// Parameter [errorCode] : + /// Conditionally required if the InsightType parameter is set to + /// ApiErrorRateInsight. + /// + /// If returning metrics for the ApiErrorRateInsight Insights + /// type, this is the error to retrieve data for. For example, + /// AccessDenied. + /// + /// Parameter [maxResults] : + /// The maximum number of datapoints to return. Valid values are integers from + /// 1 to 21600. The default value is 21600. + /// + /// Parameter [nextToken] : + /// Returned if all datapoints can't be returned in a single call. For + /// example, due to reaching MaxResults. + /// + /// Add this parameter to the request to continue retrieving results starting + /// from the last evaluated point. + /// + /// Parameter [period] : + /// Granularity of data to retrieve, in seconds. Valid values are + /// 60, 300, and 3600. If you specify + /// any other value, you will get an error. The default is 3600 seconds. + /// + /// Parameter [startTime] : + /// Specifies, in UTC, the start time for time-series data. The value + /// specified is inclusive; results include data points with the specified + /// time stamp. + /// + /// The default is 90 days before the time of request. + Future listInsightsMetricData({ + required String eventName, + required String eventSource, + required InsightType insightType, + InsightsMetricDataType? dataType, + DateTime? endTime, + String? errorCode, + int? maxResults, + String? nextToken, + int? period, + DateTime? startTime, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 21600, + ); + _s.validateNumRange( + 'period', + period, + 60, + 3600, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.ListInsightsMetricData' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EventName': eventName, + 'EventSource': eventSource, + 'InsightType': insightType.toValue(), + if (dataType != null) 'DataType': dataType.toValue(), + if (endTime != null) 'EndTime': unixTimestampToJson(endTime), + if (errorCode != null) 'ErrorCode': errorCode, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (period != null) 'Period': period, + if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + }, + ); + + return ListInsightsMetricDataResponse.fromJson(jsonResponse.body); + } + /// Returns all public keys whose private keys were used to sign the digest /// files within the specified time range. The public key is needed to /// validate digest files that were signed with its corresponding private key. /// - /// CloudTrail uses different private and public key pairs per region. Each - /// digest file is signed with a private key unique to its region. When you - /// validate a digest file from a specific region, you must look in the same - /// region for its corresponding public key. + /// CloudTrail uses different private and public key pairs per Region. Each + /// digest file is signed with a private key unique to its Region. When you + /// validate a digest file from a specific Region, you must look in the same + /// Region for its corresponding public key. /// /// /// May throw [InvalidTimeRangeException]. @@ -1618,8 +1973,8 @@ class CloudTrail { return ListQueriesResponse.fromJson(jsonResponse.body); } - /// Lists the tags for the trail, event data store, or channel in the current - /// region. + /// Lists the tags for the specified trails, event data stores, or channels in + /// the current Region. /// /// May throw [ResourceNotFoundException]. /// May throw [CloudTrailARNInvalidException]. @@ -1638,6 +1993,15 @@ class CloudTrail { /// Specifies a list of trail, event data store, or channel ARNs whose tags /// will be listed. The list has a limit of 20 ARNs. /// + /// Example trail ARN format: + /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + /// + /// Example event data store ARN format: + /// arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + /// + /// Example channel ARN format: + /// arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 + /// /// Parameter [nextToken] : /// Reserved for future use. Future listTags({ @@ -1702,8 +2066,14 @@ class CloudTrail { /// events or CloudTrail /// Insights events that are captured by CloudTrail. You can look up - /// events that occurred in a region within the last 90 days. Lookup supports - /// the following attributes for management events: + /// events that occurred in a Region within the last 90 days. + /// + /// LookupEvents returns recent Insights events for trails that + /// enable Insights. To view Insights events for an event data store, you can + /// run queries on your Insights event data store, and you can also view the + /// Lake dashboard for Insights. + /// + /// Lookup supports the following attributes for management events: /// ///
        ///
      • @@ -1749,7 +2119,7 @@ class CloudTrail { /// use to get the next page of results. /// /// The rate of lookup requests is limited to two per second, per account, per - /// region. If this limit is exceeded, a throttling error occurs. + /// Region. If this limit is exceeded, a throttling error occurs. /// /// /// May throw [InvalidLookupAttributesException]. @@ -1835,9 +2205,9 @@ class CloudTrail { /// types you want configured for your trail. For more information about /// logging Insights events, see Logging - /// Insights events for trails in the CloudTrail User Guide. By - /// default, trails created without specific event selectors are configured to - /// log all read and write management events, and no data events. + /// Insights events in the CloudTrail User Guide. By default, + /// trails created without specific event selectors are configured to log all + /// read and write management events, and no data events. /// /// When an event occurs in your account, CloudTrail evaluates the event /// selectors or advanced event selectors in all trails. For each trail, if @@ -1867,7 +2237,7 @@ class CloudTrail { /// your event selector. The trail doesn't log the event. ///
      • /// The PutEventSelectors operation must be called from the - /// region in which the trail was created; otherwise, an + /// Region in which the trail was created; otherwise, an /// InvalidHomeRegionException exception is thrown. /// /// You can configure up to five event selectors for each trail. For more @@ -1895,6 +2265,7 @@ class CloudTrail { /// May throw [InvalidHomeRegionException]. /// May throw [InvalidEventSelectorsException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// May throw [UnsupportedOperationException]. /// May throw [OperationNotPermittedException]. /// May throw [NotOrganizationMasterAccountException]. @@ -1975,18 +2346,40 @@ class CloudTrail { } /// Lets you enable Insights event logging by specifying the Insights - /// selectors that you want to enable on an existing trail. You also use - /// PutInsightSelectors to turn off Insights event logging, by - /// passing an empty list of insight types. The valid Insights event types in - /// this release are ApiErrorRateInsight and + /// selectors that you want to enable on an existing trail or event data + /// store. You also use PutInsightSelectors to turn off Insights + /// event logging, by passing an empty list of Insights types. The valid + /// Insights event types are ApiErrorRateInsight and /// ApiCallRateInsight. /// - /// To log CloudTrail Insights events on API call volume, the trail must log - /// write management events. To log CloudTrail Insights events on - /// API error rate, the trail must log read or write - /// management events. You can call GetEventSelectors on a trail - /// to check whether the trail logs management events. + /// To enable Insights on an event data store, you must specify the ARNs (or + /// ID suffix of the ARNs) for the source event data store + /// (EventDataStore) and the destination event data store + /// (InsightsDestination). The source event data store logs + /// management events and enables Insights. The destination event data store + /// logs Insights events based upon the management event activity of the + /// source event data store. The source and destination event data stores must + /// belong to the same Amazon Web Services account. + /// + /// To log Insights events for a trail, you must specify the name + /// (TrailName) of the CloudTrail trail for which you want to + /// change or add Insights selectors. + /// + /// To log CloudTrail Insights events on API call volume, the trail or event + /// data store must log write management events. To log + /// CloudTrail Insights events on API error rate, the trail or event data + /// store must log read or write management events. + /// You can call GetEventSelectors on a trail to check whether + /// the trail logs management events. You can call + /// GetEventDataStore on an event data store to check whether the + /// event data store logs management events. + /// + /// For more information, see Logging + /// CloudTrail Insights events in the CloudTrail User Guide. /// + /// May throw [InvalidParameterException]. + /// May throw [InvalidParameterCombinationException]. /// May throw [TrailNotFoundException]. /// May throw [InvalidTrailNameException]. /// May throw [CloudTrailARNInvalidException]. @@ -2000,11 +2393,12 @@ class CloudTrail { /// May throw [OperationNotPermittedException]. /// May throw [NotOrganizationMasterAccountException]. /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [ThrottlingException]. /// /// Parameter [insightSelectors] : - /// A JSON string that contains the insight types you want to log on a trail. - /// ApiCallRateInsight and ApiErrorRateInsight are - /// valid Insight types. + /// A JSON string that contains the Insights types you want to log on a trail + /// or event data store. ApiCallRateInsight and + /// ApiErrorRateInsight are valid Insight types. /// /// The ApiCallRateInsight Insights type analyzes write-only /// management API calls that are aggregated per minute against a baseline API @@ -2014,12 +2408,33 @@ class CloudTrail { /// calls that result in error codes. The error is shown if the API call is /// unsuccessful. /// + /// Parameter [eventDataStore] : + /// The ARN (or ID suffix of the ARN) of the source event data store for which + /// you want to change or add Insights selectors. To enable Insights on an + /// event data store, you must provide both the EventDataStore + /// and InsightsDestination parameters. + /// + /// You cannot use this parameter with the TrailName parameter. + /// + /// Parameter [insightsDestination] : + /// The ARN (or ID suffix of the ARN) of the destination event data store that + /// logs Insights events. To enable Insights on an event data store, you must + /// provide both the EventDataStore and + /// InsightsDestination parameters. + /// + /// You cannot use this parameter with the TrailName parameter. + /// /// Parameter [trailName] : /// The name of the CloudTrail trail for which you want to change or add /// Insights selectors. + /// + /// You cannot use this parameter with the EventDataStore and + /// InsightsDestination parameters. Future putInsightSelectors({ required List insightSelectors, - required String trailName, + String? eventDataStore, + String? insightsDestination, + String? trailName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2034,7 +2449,10 @@ class CloudTrail { headers: headers, payload: { 'InsightSelectors': insightSelectors, - 'TrailName': trailName, + if (eventDataStore != null) 'EventDataStore': eventDataStore, + if (insightsDestination != null) + 'InsightsDestination': insightsDestination, + if (trailName != null) 'TrailName': trailName, }, ); @@ -2101,8 +2519,9 @@ class CloudTrail { return PutResourcePolicyResponse.fromJson(jsonResponse.body); } - /// Registers an organization’s member account as the CloudTrail delegated - /// administrator. + /// Registers an organization’s member account as the CloudTrail delegated + /// administrator. /// /// May throw [AccountRegisteredException]. /// May throw [AccountNotFoundException]. @@ -2166,7 +2585,7 @@ class CloudTrail { /// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail /// /// Example event data store ARN format: - /// arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + /// arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE /// /// Example channel ARN format: /// arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 @@ -2240,6 +2659,46 @@ class CloudTrail { return RestoreEventDataStoreResponse.fromJson(jsonResponse.body); } + /// Starts the ingestion of live events on an event data store specified as + /// either an ARN or the ID portion of the ARN. To start ingestion, the event + /// data store Status must be STOPPED_INGESTION and + /// the eventCategory must be Management, + /// Data, or ConfigurationItem. + /// + /// May throw [EventDataStoreARNInvalidException]. + /// May throw [EventDataStoreNotFoundException]. + /// May throw [InvalidEventDataStoreStatusException]. + /// May throw [InvalidParameterException]. + /// May throw [InvalidEventDataStoreCategoryException]. + /// May throw [OperationNotPermittedException]. + /// May throw [UnsupportedOperationException]. + /// May throw [NotOrganizationMasterAccountException]. + /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [InsufficientDependencyServiceAccessPermissionException]. + /// + /// Parameter [eventDataStore] : + /// The ARN (or ID suffix of the ARN) of the event data store for which you + /// want to start ingestion. + Future startEventDataStoreIngestion({ + required String eventDataStore, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.StartEventDataStoreIngestion' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EventDataStore': eventDataStore, + }, + ); + } + /// Starts an import of logged trail events from a source S3 bucket to a /// destination event data store. By default, CloudTrail only imports events /// contained in the S3 bucket's CloudTrail prefix and the @@ -2248,7 +2707,8 @@ class CloudTrail { /// CloudTrail events contained in another prefix, you must include the prefix /// in the S3LocationUri. For more considerations about importing /// trail events, see Considerations. + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-copy-trail-to-lake.html#cloudtrail-trail-copy-considerations">Considerations + /// for copying trail events in the CloudTrail User Guide. /// /// When you start a new import, the Destinations and /// ImportSource parameters are required. Before starting a new @@ -2337,13 +2797,14 @@ class CloudTrail { } /// Starts the recording of Amazon Web Services API calls and log file - /// delivery for a trail. For a trail that is enabled in all regions, this - /// operation must be called from the region in which the trail was created. + /// delivery for a trail. For a trail that is enabled in all Regions, this + /// operation must be called from the Region in which the trail was created. /// This operation cannot be called on the shadow trails (replicated trails in - /// other regions) of a trail that is enabled in all regions. + /// other Regions) of a trail that is enabled in all Regions. /// /// May throw [CloudTrailARNInvalidException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// May throw [TrailNotFoundException]. /// May throw [InvalidTrailNameException]. /// May throw [InvalidHomeRegionException]. @@ -2379,11 +2840,17 @@ class CloudTrail { ); } - /// Starts a CloudTrail Lake query. The required QueryStatement - /// parameter provides your SQL query, enclosed in single quotation marks. Use - /// the optional DeliveryS3Uri parameter to deliver the query + /// Starts a CloudTrail Lake query. Use the QueryStatement + /// parameter to provide your SQL query, enclosed in single quotation marks. + /// Use the optional DeliveryS3Uri parameter to deliver the query /// results to an S3 bucket. /// + /// StartQuery requires you specify either the + /// QueryStatement parameter, or a QueryAlias and + /// any QueryParameters. In the current release, the + /// QueryAlias and QueryParameters parameters are + /// used only for the queries that populate the CloudTrail Lake dashboards. + /// /// May throw [EventDataStoreARNInvalidException]. /// May throw [EventDataStoreNotFoundException]. /// May throw [InactiveEventDataStoreException]. @@ -2399,14 +2866,22 @@ class CloudTrail { /// May throw [UnsupportedOperationException]. /// May throw [NoManagementAccountSLRExistsException]. /// - /// Parameter [queryStatement] : - /// The SQL code of your query. - /// /// Parameter [deliveryS3Uri] : /// The URI for the S3 bucket where CloudTrail delivers the query results. + /// + /// Parameter [queryAlias] : + /// The alias that identifies a query template. + /// + /// Parameter [queryParameters] : + /// The query parameters for the specified QueryAlias. + /// + /// Parameter [queryStatement] : + /// The SQL code of your query. Future startQuery({ - required String queryStatement, String? deliveryS3Uri, + String? queryAlias, + List? queryParameters, + String? queryStatement, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2420,24 +2895,66 @@ class CloudTrail { // TODO queryParams headers: headers, payload: { - 'QueryStatement': queryStatement, if (deliveryS3Uri != null) 'DeliveryS3Uri': deliveryS3Uri, + if (queryAlias != null) 'QueryAlias': queryAlias, + if (queryParameters != null) 'QueryParameters': queryParameters, + if (queryStatement != null) 'QueryStatement': queryStatement, }, ); return StartQueryResponse.fromJson(jsonResponse.body); } - /// Stops a specified import. + /// Stops the ingestion of live events on an event data store specified as + /// either an ARN or the ID portion of the ARN. To stop ingestion, the event + /// data store Status must be ENABLED and the + /// eventCategory must be Management, + /// Data, or ConfigurationItem. /// - /// May throw [ImportNotFoundException]. + /// May throw [EventDataStoreARNInvalidException]. + /// May throw [EventDataStoreNotFoundException]. + /// May throw [InvalidEventDataStoreStatusException]. /// May throw [InvalidParameterException]. + /// May throw [InvalidEventDataStoreCategoryException]. /// May throw [OperationNotPermittedException]. /// May throw [UnsupportedOperationException]. + /// May throw [NotOrganizationMasterAccountException]. + /// May throw [NoManagementAccountSLRExistsException]. + /// May throw [InsufficientDependencyServiceAccessPermissionException]. /// - /// Parameter [importId] : - /// The ID of the import. - Future stopImport({ + /// Parameter [eventDataStore] : + /// The ARN (or ID suffix of the ARN) of the event data store for which you + /// want to stop ingestion. + Future stopEventDataStoreIngestion({ + required String eventDataStore, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.StopEventDataStoreIngestion' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EventDataStore': eventDataStore, + }, + ); + } + + /// Stops a specified import. + /// + /// May throw [ImportNotFoundException]. + /// May throw [InvalidParameterException]. + /// May throw [OperationNotPermittedException]. + /// May throw [UnsupportedOperationException]. + /// + /// Parameter [importId] : + /// The ID of the import. + Future stopImport({ required String importId, }) async { final headers = { @@ -2463,15 +2980,16 @@ class CloudTrail { /// delivery for the specified trail. Under most circumstances, there is no /// need to use this action. You can update a trail without stopping it first. /// This action is the only way to stop recording. For a trail enabled in all - /// regions, this operation must be called from the region in which the trail + /// Regions, this operation must be called from the Region in which the trail /// was created, or an InvalidHomeRegionException will occur. /// This operation cannot be called on the shadow trails (replicated trails in - /// other regions) of a trail enabled in all regions. + /// other Regions) of a trail enabled in all Regions. /// /// May throw [TrailNotFoundException]. /// May throw [InvalidTrailNameException]. /// May throw [CloudTrailARNInvalidException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// May throw [InvalidHomeRegionException]. /// May throw [UnsupportedOperationException]. /// May throw [OperationNotPermittedException]. @@ -2557,23 +3075,28 @@ class CloudTrail { /// value is an ARN or the ID portion of the ARN. Other parameters are /// optional, but at least one optional parameter must be specified, or /// CloudTrail throws an error. RetentionPeriod is in days, and - /// valid values are integers between 90 and 2557. By default, - /// TerminationProtection is enabled. + /// valid values are integers between 7 and 3653 if the + /// BillingMode is set to + /// EXTENDABLE_RETENTION_PRICING, or between 7 and 2557 if + /// BillingMode is set to FIXED_RETENTION_PRICING. + /// By default, TerminationProtection is enabled. /// /// For event data stores for CloudTrail events, - /// AdvancedEventSelectors includes or excludes management and + /// AdvancedEventSelectors includes or excludes management or /// data events in your event data store. For more information about - /// AdvancedEventSelectors, see - /// PutEventSelectorsRequest$AdvancedEventSelectors. + /// AdvancedEventSelectors, see AdvancedEventSelectors. /// - /// For event data stores for Config configuration items, Audit Manager - /// evidence, or non-Amazon Web Services events, + /// For event data stores for CloudTrail Insights events, Config configuration + /// items, Audit Manager evidence, or non-Amazon Web Services events, /// AdvancedEventSelectors includes events of that type in your /// event data store. /// + /// May throw [EventDataStoreAlreadyExistsException]. /// May throw [EventDataStoreARNInvalidException]. /// May throw [EventDataStoreNotFoundException]. /// May throw [InvalidEventSelectorsException]. + /// May throw [InvalidInsightSelectorsException]. /// May throw [EventDataStoreHasOngoingImportException]. /// May throw [InactiveEventDataStoreException]. /// May throw [InvalidParameterException]. @@ -2599,6 +3122,42 @@ class CloudTrail { /// store. You can configure up to five advanced event selectors for each /// event data store. /// + /// Parameter [billingMode] : + /// + /// You can't change the billing mode from + /// EXTENDABLE_RETENTION_PRICING to + /// FIXED_RETENTION_PRICING. If BillingMode is set + /// to EXTENDABLE_RETENTION_PRICING and you want to use + /// FIXED_RETENTION_PRICING instead, you'll need to stop + /// ingestion on the event data store and create a new event data store that + /// uses FIXED_RETENTION_PRICING. + /// + /// The billing mode for the event data store determines the cost for + /// ingesting events and the default and maximum retention period for the + /// event data store. + /// + /// The following are the possible values: + /// + ///
          + ///
        • + /// EXTENDABLE_RETENTION_PRICING - This billing mode is generally + /// recommended if you want a flexible retention period of up to 3653 days + /// (about 10 years). The default retention period for this billing mode is + /// 366 days. + ///
        • + ///
        • + /// FIXED_RETENTION_PRICING - This billing mode is recommended if + /// you expect to ingest more than 25 TB of event data per month and need a + /// retention period of up to 2557 days (about 7 years). The default retention + /// period for this billing mode is 2557 days. + ///
        • + ///
        + /// For more information about CloudTrail pricing, see CloudTrail Pricing + /// and Managing + /// CloudTrail Lake costs. + /// /// Parameter [kmsKeyId] : /// Specifies the KMS key ID to use to encrypt the events delivered by /// CloudTrail. The value can be an alias name prefixed by @@ -2637,8 +3196,8 @@ class CloudTrail { ///
      /// /// Parameter [multiRegionEnabled] : - /// Specifies whether an event data store collects events from all regions, or - /// only from the region in which it was created. + /// Specifies whether an event data store collects events from all Regions, or + /// only from the Region in which it was created. /// /// Parameter [name] : /// The event data store name. @@ -2646,9 +3205,33 @@ class CloudTrail { /// Parameter [organizationEnabled] : /// Specifies whether an event data store collects events logged for an /// organization in Organizations. + /// + /// Only the management account for the organization can convert an + /// organization event data store to a non-organization event data store, or + /// convert a non-organization event data store to an organization event data + /// store. + /// /// /// Parameter [retentionPeriod] : - /// The retention period, in days. + /// The retention period of the event data store, in days. If + /// BillingMode is set to + /// EXTENDABLE_RETENTION_PRICING, you can set a retention period + /// of up to 3653 days, the equivalent of 10 years. If + /// BillingMode is set to FIXED_RETENTION_PRICING, + /// you can set a retention period of up to 2557 days, the equivalent of seven + /// years. + /// + /// CloudTrail Lake determines whether to retain an event by checking if the + /// eventTime of the event is within the specified retention + /// period. For example, if you set a retention period of 90 days, CloudTrail + /// will remove events when the eventTime is older than 90 days. + /// + /// If you decrease the retention period of an event data store, CloudTrail + /// will remove any events with an eventTime older than the new + /// retention period. For example, if the previous retention period was 365 + /// days and you decrease it to 100 days, CloudTrail will remove events with + /// an eventTime older than 100 days. + /// /// /// Parameter [terminationProtectionEnabled] : /// Indicates that termination protection is enabled and the event data store @@ -2656,6 +3239,7 @@ class CloudTrail { Future updateEventDataStore({ required String eventDataStore, List? advancedEventSelectors, + BillingMode? billingMode, String? kmsKeyId, bool? multiRegionEnabled, String? name, @@ -2667,7 +3251,7 @@ class CloudTrail { 'retentionPeriod', retentionPeriod, 7, - 2557, + 3653, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2684,6 +3268,7 @@ class CloudTrail { 'EventDataStore': eventDataStore, if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (kmsKeyId != null) 'KmsKeyId': kmsKeyId, if (multiRegionEnabled != null) 'MultiRegionEnabled': multiRegionEnabled, @@ -2704,7 +3289,7 @@ class CloudTrail { /// CloudTrail service. Use this action to designate an existing bucket for /// log delivery. If the existing bucket has previously been a target for /// CloudTrail log files, an IAM policy exists for the bucket. - /// UpdateTrail must be called from the region in which the trail + /// UpdateTrail must be called from the Region in which the trail /// was created; otherwise, an InvalidHomeRegionException is /// thrown. /// @@ -2722,6 +3307,7 @@ class CloudTrail { /// May throw [InvalidEventSelectorsException]. /// May throw [CloudTrailARNInvalidException]. /// May throw [ConflictException]. + /// May throw [ThrottlingException]. /// May throw [InvalidParameterCombinationException]. /// May throw [InvalidHomeRegionException]. /// May throw [KmsKeyNotFoundException]. @@ -2797,27 +3383,31 @@ class CloudTrail { /// as IAM to the log files. /// /// Parameter [isMultiRegionTrail] : - /// Specifies whether the trail applies only to the current region or to all - /// regions. The default is false. If the trail exists only in the current - /// region and this value is set to true, shadow trails (replications of the - /// trail) will be created in the other regions. If the trail exists in all - /// regions and this value is set to false, the trail will remain in the - /// region where it was created, and its shadow trails in other regions will + /// Specifies whether the trail applies only to the current Region or to all + /// Regions. The default is false. If the trail exists only in the current + /// Region and this value is set to true, shadow trails (replications of the + /// trail) will be created in the other Regions. If the trail exists in all + /// Regions and this value is set to false, the trail will remain in the + /// Region where it was created, and its shadow trails in other Regions will /// be deleted. As a best practice, consider using trails that log events in - /// all regions. + /// all Regions. /// /// Parameter [isOrganizationTrail] : /// Specifies whether the trail is applied to all accounts in an organization /// in Organizations, or only for the current Amazon Web Services account. The /// default is false, and cannot be true unless the call is made on behalf of - /// an Amazon Web Services account that is the management account or delegated - /// administrator account for an organization in Organizations. If the trail - /// is not an organization trail and this is set to true, the - /// trail will be created in all Amazon Web Services accounts that belong to - /// the organization. If the trail is an organization trail and this is set to - /// false, the trail will remain in the current Amazon Web - /// Services account but be deleted from all member accounts in the - /// organization. + /// an Amazon Web Services account that is the management account for an + /// organization in Organizations. If the trail is not an organization trail + /// and this is set to true, the trail will be created in all + /// Amazon Web Services accounts that belong to the organization. If the trail + /// is an organization trail and this is set to false, the trail + /// will remain in the current Amazon Web Services account but be deleted from + /// all member accounts in the organization. + /// + /// Only the management account for the organization can convert an + /// organization trail to a non-organization trail, or convert a + /// non-organization trail to an organization trail. + /// /// /// Parameter [kmsKeyId] : /// Specifies the KMS key ID to use to encrypt the logs delivered by @@ -2851,13 +3441,13 @@ class CloudTrail { /// Parameter [s3BucketName] : /// Specifies the name of the Amazon S3 bucket designated for publishing log /// files. See Amazon - /// S3 Bucket Naming Requirements. + /// href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon + /// S3 Bucket naming rules. /// /// Parameter [s3KeyPrefix] : /// Specifies the Amazon S3 key prefix that comes after the name of the bucket /// you have designated for log file delivery. For more information, see Finding + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding /// Your CloudTrail Log Files. The maximum length is 200 characters. /// /// Parameter [snsTopicName] : @@ -2925,35 +3515,54 @@ class AddTagsResponse { } } -/// Advanced event selectors let you create fine-grained selectors for the -/// following CloudTrail event record fields. They help you control costs by +/// Advanced event selectors let you create fine-grained selectors for +/// CloudTrail management and data events. They help you control costs by /// logging only those events that are important to you. For more information /// about advanced event selectors, see Logging +/// management events and Logging /// data events in the CloudTrail User Guide. /// +/// You cannot apply both event selectors and advanced event selectors to a +/// trail. +/// +/// Supported CloudTrail event record fields for management events +/// ///
        ///
      • -/// readOnly +/// eventCategory (required) ///
      • ///
      • /// eventSource ///
      • ///
      • -/// eventName +/// readOnly +///
      • +///
      +/// Supported CloudTrail event record fields for data events +/// +///
        +///
      • +/// eventCategory (required) +///
      • +///
      • +/// resources.type (required) ///
      • ///
      • -/// eventCategory +/// readOnly ///
      • ///
      • -/// resources.type +/// eventName ///
      • ///
      • /// resources.ARN ///
      • -///
      -/// You cannot apply both event selectors and advanced event selectors to a -/// trail. +///
    +/// For event data stores for CloudTrail Insights events, Config configuration +/// items, Audit Manager evidence, or events outside of Amazon Web Services, the +/// only supported field is eventCategory. +/// class AdvancedEventSelector { /// Contains all selector statements in an advanced event selector. final List fieldSelectors; @@ -2990,18 +3599,21 @@ class AdvancedEventSelector { /// A single selector statement in an advanced event selector. class AdvancedFieldSelector { /// A field in a CloudTrail event record on which to filter events to be logged. - /// For event data stores for Config configuration items, Audit Manager - /// evidence, or non-Amazon Web Services events, the field is used only for - /// selecting events as filtering is not supported. + /// For event data stores for CloudTrail Insights events, Config configuration + /// items, Audit Manager evidence, or events outside of Amazon Web Services, the + /// field is used only for selecting events as filtering is not supported. + /// + /// For CloudTrail management events, supported fields include + /// readOnly, eventCategory, and + /// eventSource. /// - /// For CloudTrail event records, supported fields include - /// readOnly, eventCategory, eventSource - /// (for management events), eventName, + /// For CloudTrail data events, supported fields include readOnly, + /// eventCategory, eventName, /// resources.type, and resources.ARN. /// - /// For event data stores for Config configuration items, Audit Manager - /// evidence, or non-Amazon Web Services events, the only supported field is - /// eventCategory. + /// For event data stores for CloudTrail Insights events, Config configuration + /// items, Audit Manager evidence, or events outside of Amazon Web Services, the + /// only supported field is eventCategory. /// ///
      ///
    • @@ -3013,8 +3625,8 @@ class AdvancedFieldSelector { ///
    • ///
    • /// eventSource - For filtering management events only. - /// This can be set only to NotEquals - /// kms.amazonaws.com. + /// This can be set to NotEquals kms.amazonaws.com or + /// NotEquals rdsdata.amazonaws.com. ///
    • ///
    • /// eventName - Can use any operator. You can use it to @@ -3028,8 +3640,17 @@ class AdvancedFieldSelector { /// ///
        ///
      • - /// For CloudTrail event records, the value must be Management or - /// Data. + /// For CloudTrail management events, the value must be Management. + ///
      • + ///
      • + /// For CloudTrail data events, the value must be Data. + ///
      • + ///
      + /// The following are used only for event data stores: + /// + ///
        + ///
      • + /// For CloudTrail Insights events, the value must be Insight. ///
      • ///
      • /// For Config configuration items, the value must be @@ -3059,9 +3680,33 @@ class AdvancedFieldSelector { /// AWS::S3::Object ///
      • ///
      • + /// AWS::AppConfig::Configuration + ///
      • + ///
      • + /// AWS::B2BI::Transformer + ///
      • + ///
      • + /// AWS::Bedrock::AgentAlias + ///
      • + ///
      • + /// AWS::Bedrock::KnowledgeBase + ///
      • + ///
      • + /// AWS::Cassandra::Table + ///
      • + ///
      • + /// AWS::CloudFront::KeyValueStore + ///
      • + ///
      • /// AWS::CloudTrail::Channel ///
      • ///
      • + /// AWS::CodeWhisperer::Customization + ///
      • + ///
      • + /// AWS::CodeWhisperer::Profile + ///
      • + ///
      • /// AWS::Cognito::IdentityPool ///
      • ///
      • @@ -3071,25 +3716,79 @@ class AdvancedFieldSelector { /// AWS::EC2::Snapshot ///
      • ///
      • + /// AWS::EMRWAL::Workspace + ///
      • + ///
      • /// AWS::FinSpace::Environment ///
      • ///
      • /// AWS::Glue::Table ///
      • ///
      • + /// AWS::GreengrassV2::ComponentVersion + ///
      • + ///
      • + /// AWS::GreengrassV2::Deployment + ///
      • + ///
      • /// AWS::GuardDuty::Detector ///
      • ///
      • + /// AWS::IoT::Certificate + ///
      • + ///
      • + /// AWS::IoT::Thing + ///
      • + ///
      • + /// AWS::IoTSiteWise::Asset + ///
      • + ///
      • + /// AWS::IoTSiteWise::TimeSeries + ///
      • + ///
      • + /// AWS::IoTTwinMaker::Entity + ///
      • + ///
      • + /// AWS::IoTTwinMaker::Workspace + ///
      • + ///
      • /// AWS::KendraRanking::ExecutionPlan ///
      • ///
      • + /// AWS::KinesisVideo::Stream + ///
      • + ///
      • + /// AWS::ManagedBlockchain::Network + ///
      • + ///
      • /// AWS::ManagedBlockchain::Node ///
      • ///
      • - /// AWS::SageMaker::ExperimentTrialComponent + /// AWS::MedicalImaging::Datastore ///
      • ///
      • - /// AWS::SageMaker::FeatureGroup + /// AWS::NeptuneGraph::Graph + ///
      • + ///
      • + /// AWS::PCAConnectorAD::Connector + ///
      • + ///
      • + /// AWS::QApps:QApp + ///
      • + ///
      • + /// AWS::QBusiness::Application + ///
      • + ///
      • + /// AWS::QBusiness::DataSource + ///
      • + ///
      • + /// AWS::QBusiness::Index + ///
      • + ///
      • + /// AWS::QBusiness::WebExperience + ///
      • + ///
      • + /// AWS::RDS::DBCluster ///
      • ///
      • /// AWS::S3::AccessPoint @@ -3100,6 +3799,60 @@ class AdvancedFieldSelector { ///
      • /// AWS::S3Outposts::Object ///
      • + ///
      • + /// AWS::SageMaker::Endpoint + ///
      • + ///
      • + /// AWS::SageMaker::ExperimentTrialComponent + ///
      • + ///
      • + /// AWS::SageMaker::FeatureGroup + ///
      • + ///
      • + /// AWS::ServiceDiscovery::Namespace + ///
      • + ///
      • + /// AWS::ServiceDiscovery::Service + ///
      • + ///
      • + /// AWS::SCN::Instance + ///
      • + ///
      • + /// AWS::SNS::PlatformEndpoint + ///
      • + ///
      • + /// AWS::SNS::Topic + ///
      • + ///
      • + /// AWS::SQS::Queue + ///
      • + ///
      • + /// AWS::SSM::ManagedNode + ///
      • + ///
      • + /// AWS::SSMMessages::ControlChannel + ///
      • + ///
      • + /// AWS::SWF::Domain + ///
      • + ///
      • + /// AWS::ThinClient::Device + ///
      • + ///
      • + /// AWS::ThinClient::Environment + ///
      • + ///
      • + /// AWS::Timestream::Database + ///
      • + ///
      • + /// AWS::Timestream::Table + ///
      • + ///
      • + /// AWS::VerifiedPermissions::PolicyStore + ///
      • + ///
      • + /// AWS::XRay::Trace + ///
      • ///
      /// You can have only one resources.type field per selector. To log /// data events on more than one resource type, add another selector. @@ -3109,11 +3862,17 @@ class AdvancedFieldSelector { /// resources.ARN, but if you use Equals or /// NotEquals, the value must exactly match the ARN of a valid /// resource of the type you've specified in the template as the value of - /// resources.type. For example, if resources.type equals - /// AWS::S3::Object, the ARN must be in one of the following - /// formats. To log all data events for all objects in a specific S3 bucket, use - /// the StartsWith operator, and include only the bucket ARN as the - /// matching value. + /// resources.type. + /// + /// You can't use the resources.ARN field to filter resource types + /// that do not have ARNs. + /// + /// The resources.ARN field can be set one of the following. + /// + /// If resources.type equals AWS::S3::Object, the ARN must be in + /// one of the following formats. To log all data events for all objects in a + /// specific S3 bucket, use the StartsWith operator, and include + /// only the bucket ARN as the matching value. /// /// The trailing slash is intentional; do not exclude it. Replace the text /// between less than and greater than symbols (<>) with resource-specific @@ -3145,6 +3904,60 @@ class AdvancedFieldSelector { /// arn:<partition>:lambda:<region>:<account_ID>:function:<function_name> ///
    • ///
    + /// When resources.type equals AWS::AppConfig::Configuration, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:appconfig:<region>:<account_ID>:application/<application_ID>/environment/<environment_ID>/configuration/<configuration_profile_ID> + ///
    • + ///
    + /// When resources.type equals AWS::B2BI::Transformer, and the + /// operator is set to Equals or NotEquals, the ARN + /// must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:b2bi:<region>:<account_ID>:transformer/<transformer_ID> + ///
    • + ///
    + /// When resources.type equals AWS::Bedrock::AgentAlias, and the + /// operator is set to Equals or NotEquals, the ARN + /// must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:bedrock:<region>:<account_ID>:agent-alias/<agent_ID>/<alias_ID> + ///
    • + ///
    + /// When resources.type equals AWS::Bedrock::KnowledgeBase, and the + /// operator is set to Equals or NotEquals, the ARN + /// must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:bedrock:<region>:<account_ID>:knowledge-base/<knowledge_base_ID> + ///
    • + ///
    + /// When resources.type equals AWS::Cassandra::Table, and the + /// operator is set to Equals or NotEquals, the ARN + /// must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:cassandra:<region>:<account_ID>:/keyspace/<keyspace_name>/table/<table_name> + ///
    • + ///
    + /// When resources.type equals AWS::CloudFront::KeyValueStore, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:cloudfront:<region>:<account_ID>:key-value-store/<KVS_name> + ///
    • + ///
    /// When resources.type equals AWS::CloudTrail::Channel, and the /// operator is set to Equals or NotEquals, the ARN /// must be in the following format: @@ -3154,6 +3967,24 @@ class AdvancedFieldSelector { /// arn:<partition>:cloudtrail:<region>:<account_ID>:channel/<channel_UUID> ///
  • /// + /// When resources.type equals AWS::CodeWhisperer::Customization, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:codewhisperer:<region>:<account_ID>:customization/<customization_ID> + ///
    • + ///
    + /// When resources.type equals AWS::CodeWhisperer::Profile, and the + /// operator is set to Equals or NotEquals, the ARN + /// must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:codewhisperer:<region>:<account_ID>:profile/<profile_ID> + ///
    • + ///
    /// When resources.type equals AWS::Cognito::IdentityPool, and the /// operator is set to Equals or NotEquals, the ARN /// must be in the following format: @@ -3181,6 +4012,15 @@ class AdvancedFieldSelector { /// arn:<partition>:ec2:<region>::snapshot/<snapshot_ID> /// /// + /// When resources.type equals AWS::EMRWAL::Workspace, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:emrwal:<region>:<account_ID>:workspace/<workspace_name> + ///
    • + ///
    /// When resources.type equals /// AWS::FinSpace::Environment, and the operator is set to /// Equals or NotEquals, the ARN must be in the @@ -3201,6 +4041,26 @@ class AdvancedFieldSelector { /// /// /// When resources.type equals + /// AWS::GreengrassV2::ComponentVersion, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:greengrass:<region>:<account_ID>:components/<component_name> + ///
    • + ///
    + /// When resources.type equals + /// AWS::GreengrassV2::Deployment, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:greengrass:<region>:<account_ID>:deployments/<deployment_ID + ///
    • + ///
    + /// When resources.type equals /// AWS::GuardDuty::Detector, and the operator is set to /// Equals or NotEquals, the ARN must be in the /// following format: @@ -3210,6 +4070,64 @@ class AdvancedFieldSelector { /// arn:<partition>:guardduty:<region>:<account_ID>:detector/<detector_ID> /// /// + /// When resources.type equals AWS::IoT::Certificate, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:iot:<region>:<account_ID>:cert/<certificate_ID> + ///
    • + ///
    + /// When resources.type equals AWS::IoT::Thing, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:iot:<region>:<account_ID>:thing/<thing_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::IoTSiteWise::Asset, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:iotsitewise:<region>:<account_ID>:asset/<asset_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::IoTSiteWise::TimeSeries, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:iotsitewise:<region>:<account_ID>:timeseries/<timeseries_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::IoTTwinMaker::Entity, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:iottwinmaker:<region>:<account_ID>:workspace/<workspace_ID>/entity/<entity_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::IoTTwinMaker::Workspace, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:iottwinmaker:<region>:<account_ID>:workspace/<workspace_ID> + ///
    • + ///
    /// When resources.type equals /// AWS::KendraRanking::ExecutionPlan, and the operator is set to /// Equals or NotEquals, the ARN must be in the @@ -3221,6 +4139,26 @@ class AdvancedFieldSelector { /// /// /// When resources.type equals + /// AWS::KinesisVideo::Stream, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:kinesisvideo:<region>:<account_ID>:stream/<stream_name>/<creation_time> + ///
    • + ///
    + /// When resources.type equals + /// AWS::ManagedBlockchain::Network, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:managedblockchain:::networks/<network_name> + ///
    • + ///
    + /// When resources.type equals /// AWS::ManagedBlockchain::Node, and the operator is set to /// Equals or NotEquals, the ARN must be in the /// following format: @@ -3231,23 +4169,90 @@ class AdvancedFieldSelector { /// /// /// When resources.type equals - /// AWS::SageMaker::ExperimentTrialComponent, and the operator is - /// set to Equals or NotEquals, the ARN must be in the + /// AWS::MedicalImaging::Datastore, and the operator is set to + /// Equals or NotEquals, the ARN must be in the /// following format: /// ///
      ///
    • - /// arn:<partition>:sagemaker:<region>:<account_ID>:experiment-trial-component/<experiment_trial_component_name> + /// arn:<partition>:medical-imaging:<region>:<account_ID>:datastore/<data_store_ID> ///
    • ///
    /// When resources.type equals - /// AWS::SageMaker::FeatureGroup, and the operator is set to + /// AWS::NeptuneGraph::Graph, and the operator is set to /// Equals or NotEquals, the ARN must be in the /// following format: /// ///
      ///
    • - /// arn:<partition>:sagemaker:<region>:<account_ID>:feature-group/<feature_group_name> + /// arn:<partition>:neptune-graph:<region>:<account_ID>:graph/<graph_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::PCAConnectorAD::Connector, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:pca-connector-ad:<region>:<account_ID>:connector/<connector_ID> + ///
    • + ///
    + /// When resources.type equals AWS::QApps:QApp, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:qapps:<region>:<account_ID>:application/<application_UUID>/qapp/<qapp_UUID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::QBusiness::Application, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:qbusiness:<region>:<account_ID>:application/<application_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::QBusiness::DataSource, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:qbusiness:<region>:<account_ID>:application/<application_ID>/index/<index_ID>/data-source/<datasource_ID> + ///
    • + ///
    + /// When resources.type equals AWS::QBusiness::Index, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:qbusiness:<region>:<account_ID>:application/<application_ID>/index/<index_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::QBusiness::WebExperience, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:qbusiness:<region>:<account_ID>:application/<application_ID>/web-experience/<web_experience_ID> + ///
    • + ///
    + /// When resources.type equals AWS::RDS::DBCluster, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:rds:<region>:<account_ID>:cluster/<cluster_name> ///
    • ///
    /// When resources.type equals AWS::S3::AccessPoint, @@ -3284,6 +4289,173 @@ class AdvancedFieldSelector { ///
  • /// arn:<partition>:s3-outposts:<region>:<account_ID>:<object_path> ///
  • + /// + /// When resources.type equals + /// AWS::SageMaker::Endpoint, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:sagemaker:<region>:<account_ID>:endpoint/<endpoint_name> + ///
    • + ///
    + /// When resources.type equals + /// AWS::SageMaker::ExperimentTrialComponent, and the operator is + /// set to Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:sagemaker:<region>:<account_ID>:experiment-trial-component/<experiment_trial_component_name> + ///
    • + ///
    + /// When resources.type equals + /// AWS::SageMaker::FeatureGroup, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:sagemaker:<region>:<account_ID>:feature-group/<feature_group_name> + ///
    • + ///
    + /// When resources.type equals AWS::SCN::Instance, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:scn:<region>:<account_ID>:instance/<instance_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::ServiceDiscovery::Namespace, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:servicediscovery:<region>:<account_ID>:namespace/<namespace_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::ServiceDiscovery::Service, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:servicediscovery:<region>:<account_ID>:service/<service_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::SNS::PlatformEndpoint, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:sns:<region>:<account_ID>:endpoint/<endpoint_type>/<endpoint_name>/<endpoint_ID> + ///
    • + ///
    + /// When resources.type equals AWS::SNS::Topic, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:sns:<region>:<account_ID>:<topic_name> + ///
    • + ///
    + /// When resources.type equals AWS::SQS::Queue, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:sqs:<region>:<account_ID>:<queue_name> + ///
    • + ///
    + /// When resources.type equals AWS::SSM::ManagedNode, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in one of the following formats: + /// + ///
      + ///
    • + /// arn:<partition>:ssm:<region>:<account_ID>:managed-instance/<instance_ID> + ///
    • + ///
    • + /// arn:<partition>:ec2:<region>:<account_ID>:instance/<instance_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::SSMMessages::ControlChannel, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:ssmmessages:<region>:<account_ID>:control-channel/<channel_ID> + ///
    • + ///
    + /// When resources.type equals AWS::SWF::Domain, and + /// the operator is set to Equals or NotEquals, the + /// ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:swf:<region>:<account_ID>:domain/<domain_name> + ///
    • + ///
    + /// When resources.type equals + /// AWS::ThinClient::Device, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:thinclient:<region>:<account_ID>:device/<device_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::ThinClient::Environment, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:thinclient:<region>:<account_ID>:environment/<environment_ID> + ///
    • + ///
    + /// When resources.type equals + /// AWS::Timestream::Database, and the operator is set to + /// Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:timestream:<region>:<account_ID>:database/<database_name> + ///
    • + ///
    + /// When resources.type equals AWS::Timestream::Table, + /// and the operator is set to Equals or NotEquals, + /// the ARN must be in the following format: + /// + ///
      + ///
    • + /// arn:<partition>:timestream:<region>:<account_ID>:database/<database_name>/table/<table_name> + ///
    • + ///
    + /// When resources.type equals + /// AWS::VerifiedPermissions::PolicyStore, and the operator is set + /// to Equals or NotEquals, the ARN must be in the + /// following format: + /// + ///
      + ///
    • + /// arn:<partition>:verifiedpermissions:<region>:<account_ID>:policy-store/<policy_store_UUID> + ///
    • ///
    /// final String field; @@ -3374,6 +4546,34 @@ class AdvancedFieldSelector { } } +enum BillingMode { + extendableRetentionPricing, + fixedRetentionPricing, +} + +extension BillingModeValueExtension on BillingMode { + String toValue() { + switch (this) { + case BillingMode.extendableRetentionPricing: + return 'EXTENDABLE_RETENTION_PRICING'; + case BillingMode.fixedRetentionPricing: + return 'FIXED_RETENTION_PRICING'; + } + } +} + +extension BillingModeFromString on String { + BillingMode toBillingMode() { + switch (this) { + case 'EXTENDABLE_RETENTION_PRICING': + return BillingMode.extendableRetentionPricing; + case 'FIXED_RETENTION_PRICING': + return BillingMode.fixedRetentionPricing; + } + throw Exception('$this is not known in enum BillingMode'); + } +} + class CancelQueryResponse { /// The ID of the canceled query. final String queryId; @@ -3498,6 +4698,9 @@ class CreateEventDataStoreResponse { /// data store. final List? advancedEventSelectors; + /// The billing mode for the event data store. + final BillingMode? billingMode; + /// The timestamp that shows when the event data store was created. final DateTime? createdTimestamp; @@ -3510,8 +4713,8 @@ class CreateEventDataStoreResponse { /// arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 final String? kmsKeyId; - /// Indicates whether the event data store collects events from all regions, or - /// only from the region in which it was created. + /// Indicates whether the event data store collects events from all Regions, or + /// only from the Region in which it was created. final bool? multiRegionEnabled; /// The name of the event data store. @@ -3539,6 +4742,7 @@ class CreateEventDataStoreResponse { CreateEventDataStoreResponse({ this.advancedEventSelectors, + this.billingMode, this.createdTimestamp, this.eventDataStoreArn, this.kmsKeyId, @@ -3558,6 +4762,7 @@ class CreateEventDataStoreResponse { ?.whereNotNull() .map((e) => AdvancedEventSelector.fromJson(e as Map)) .toList(), + billingMode: (json['BillingMode'] as String?)?.toBillingMode(), createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), eventDataStoreArn: json['EventDataStoreArn'] as String?, kmsKeyId: json['KmsKeyId'] as String?, @@ -3578,6 +4783,7 @@ class CreateEventDataStoreResponse { Map toJson() { final advancedEventSelectors = this.advancedEventSelectors; + final billingMode = this.billingMode; final createdTimestamp = this.createdTimestamp; final eventDataStoreArn = this.eventDataStoreArn; final kmsKeyId = this.kmsKeyId; @@ -3592,6 +4798,7 @@ class CreateEventDataStoreResponse { return { if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (createdTimestamp != null) 'CreatedTimestamp': unixTimestampToJson(createdTimestamp), if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, @@ -3626,7 +4833,7 @@ class CreateTrailResponse { /// as IAM to the log files. final bool? includeGlobalServiceEvents; - /// Specifies whether the trail exists in one region or in all regions. + /// Specifies whether the trail exists in one Region or in all Regions. final bool? isMultiRegionTrail; /// Specifies whether the trail is an organization trail. @@ -3650,7 +4857,7 @@ class CreateTrailResponse { /// Specifies the Amazon S3 key prefix that comes after the name of the bucket /// you have designated for log file delivery. For more information, see Finding + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding /// Your CloudTrail Log Files. final String? s3KeyPrefix; @@ -3660,7 +4867,7 @@ class CreateTrailResponse { /// arn:aws:sns:us-east-2:123456789012:MyTopic final String? snsTopicARN; - /// This field is no longer in use. Use SnsTopicARN. + /// This field is no longer in use. Use SnsTopicARN. final String? snsTopicName; /// Specifies the ARN of the trail that was created. The format of a trail ARN @@ -3740,12 +4947,27 @@ class CreateTrailResponse { } } -/// The Amazon S3 buckets, Lambda functions, or Amazon DynamoDB tables that you -/// specify in your event selectors for your trail to log data events. Data -/// events provide information about the resource operations performed on or -/// within a resource itself. These are also known as data plane operations. You -/// can specify up to 250 data resources for a trail. -/// +/// Data events provide information about the resource operations performed on +/// or within a resource itself. These are also known as data plane operations. +/// You can specify up to 250 data resources for a trail. +/// +/// Configure the DataResource to specify the resource type and +/// resource ARNs for which you want to log data events. +/// +/// You can specify the following resource types in your event selectors for +/// your trail: +/// +///
      +///
    • +/// AWS::DynamoDB::Table +///
    • +///
    • +/// AWS::Lambda::Function +///
    • +///
    • +/// AWS::S3::Object +///
    • +///
    /// The total number of allowed data resources is 250. This number can be /// distributed between 1 and 5 event selectors, but the total cannot exceed 250 /// across all selectors for the trail. @@ -3814,60 +5036,14 @@ class DataResource { /// AWS::S3::Object /// /// - /// The following resource types are also available through advanced - /// event selectors. Basic event selector resource types are valid in advanced - /// event selectors, but advanced event selector resource types are not valid in - /// basic event selectors. For more information, see - /// AdvancedFieldSelector$Field. - /// - ///
      - ///
    • - /// AWS::CloudTrail::Channel - ///
    • - ///
    • - /// AWS::Cognito::IdentityPool - ///
    • - ///
    • - /// AWS::DynamoDB::Stream - ///
    • - ///
    • - /// AWS::EC2::Snapshot - ///
    • - ///
    • - /// AWS::FinSpace::Environment - ///
    • - ///
    • - /// AWS::Glue::Table - ///
    • - ///
    • - /// AWS::GuardDuty::Detector - ///
    • - ///
    • - /// AWS::KendraRanking::ExecutionPlan - ///
    • - ///
    • - /// AWS::ManagedBlockchain::Node - ///
    • - ///
    • - /// AWS::SageMaker::ExperimentTrialComponent - ///
    • - ///
    • - /// AWS::SageMaker::FeatureGroup - ///
    • - ///
    • - /// AWS::S3::AccessPoint - ///
    • - ///
    • - /// AWS::S3ObjectLambda::AccessPoint - ///
    • - ///
    • - /// AWS::S3Outposts::Object - ///
    • - ///
    + /// Additional resource types are available through advanced event + /// selectors. For more information about these additional resource types, see + /// AdvancedFieldSelector. final String? type; /// An array of Amazon Resource Name (ARN) strings or partial ARN strings for - /// the specified objects. + /// the specified resource type. /// ///
      ///
    • @@ -4179,7 +5355,7 @@ class Destination { /// The type of destination for events arriving from a channel. For channels /// used for a CloudTrail Lake integration, the value is - /// EventDataStore. For service-linked channels, the value is + /// EVENT_DATA_STORE. For service-linked channels, the value is /// AWS_SERVICE. final DestinationType type; @@ -4233,6 +5409,76 @@ extension DestinationTypeFromString on String { } } +class DisableFederationResponse { + /// The ARN of the event data store for which you disabled Lake query + /// federation. + final String? eventDataStoreArn; + + /// The federation status. + final FederationStatus? federationStatus; + + DisableFederationResponse({ + this.eventDataStoreArn, + this.federationStatus, + }); + + factory DisableFederationResponse.fromJson(Map json) { + return DisableFederationResponse( + eventDataStoreArn: json['EventDataStoreArn'] as String?, + federationStatus: + (json['FederationStatus'] as String?)?.toFederationStatus(), + ); + } + + Map toJson() { + final eventDataStoreArn = this.eventDataStoreArn; + final federationStatus = this.federationStatus; + return { + if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, + if (federationStatus != null) + 'FederationStatus': federationStatus.toValue(), + }; + } +} + +class EnableFederationResponse { + /// The ARN of the event data store for which you enabled Lake query federation. + final String? eventDataStoreArn; + + /// The ARN of the federation role. + final String? federationRoleArn; + + /// The federation status. + final FederationStatus? federationStatus; + + EnableFederationResponse({ + this.eventDataStoreArn, + this.federationRoleArn, + this.federationStatus, + }); + + factory EnableFederationResponse.fromJson(Map json) { + return EnableFederationResponse( + eventDataStoreArn: json['EventDataStoreArn'] as String?, + federationRoleArn: json['FederationRoleArn'] as String?, + federationStatus: + (json['FederationStatus'] as String?)?.toFederationStatus(), + ); + } + + Map toJson() { + final eventDataStoreArn = this.eventDataStoreArn; + final federationRoleArn = this.federationRoleArn; + final federationStatus = this.federationStatus; + return { + if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, + if (federationRoleArn != null) 'FederationRoleArn': federationRoleArn, + if (federationStatus != null) + 'FederationStatus': federationStatus.toValue(), + }; + } +} + /// Contains information about an event that was returned by a lookup request. /// The result includes a representation of a CloudTrail event. class Event { @@ -4344,9 +5590,8 @@ extension EventCategoryFromString on String { /// A storage lake of event data against which you can run complex SQL-based /// queries. An event data store can include events that you have logged on your -/// account from the last 90 to 2557 days (about three months to up to seven -/// years). To select events for an event data store, use advanced +/// account. To select events for an event data store, use advanced /// event selectors. class EventDataStore { /// The advanced event selectors that were used to select events for the data @@ -4359,8 +5604,8 @@ class EventDataStore { /// The ARN of the event data store. final String? eventDataStoreArn; - /// Indicates whether the event data store includes events from all regions, or - /// only from the region in which it was created. + /// Indicates whether the event data store includes events from all Regions, or + /// only from the Region in which it was created. final bool? multiRegionEnabled; /// The name of the event data store. @@ -4373,8 +5618,7 @@ class EventDataStore { /// The retention period, in days. final int? retentionPeriod; - /// The status of an event data store. Values are ENABLED and - /// PENDING_DELETION. + /// The status of an event data store. final EventDataStoreStatus? status; /// Indicates whether the event data store is protected from termination. @@ -4452,6 +5696,9 @@ enum EventDataStoreStatus { created, enabled, pendingDeletion, + startingIngestion, + stoppingIngestion, + stoppedIngestion, } extension EventDataStoreStatusValueExtension on EventDataStoreStatus { @@ -4463,6 +5710,12 @@ extension EventDataStoreStatusValueExtension on EventDataStoreStatus { return 'ENABLED'; case EventDataStoreStatus.pendingDeletion: return 'PENDING_DELETION'; + case EventDataStoreStatus.startingIngestion: + return 'STARTING_INGESTION'; + case EventDataStoreStatus.stoppingIngestion: + return 'STOPPING_INGESTION'; + case EventDataStoreStatus.stoppedIngestion: + return 'STOPPED_INGESTION'; } } } @@ -4476,6 +5729,12 @@ extension EventDataStoreStatusFromString on String { return EventDataStoreStatus.enabled; case 'PENDING_DELETION': return EventDataStoreStatus.pendingDeletion; + case 'STARTING_INGESTION': + return EventDataStoreStatus.startingIngestion; + case 'STOPPING_INGESTION': + return EventDataStoreStatus.stoppingIngestion; + case 'STOPPED_INGESTION': + return EventDataStoreStatus.stoppedIngestion; } throw Exception('$this is not known in enum EventDataStoreStatus'); } @@ -4515,7 +5774,7 @@ class EventSelector { /// or rdsdata.amazonaws.com. By default, /// ExcludeManagementEventSources is empty, and KMS and Amazon RDS /// Data API events are logged to your trail. You can exclude management event - /// sources only in regions that support the event source. + /// sources only in Regions that support the event source. final List? excludeManagementEventSources; /// Specify if you want your event selector to include management events for @@ -4529,7 +5788,7 @@ class EventSelector { /// /// The first copy of management events is free. You are charged for additional /// copies of management events that you are logging on any subsequent trail in - /// the same region. For more information about CloudTrail pricing, see CloudTrail Pricing. final bool? includeManagementEvents; @@ -4579,6 +5838,44 @@ class EventSelector { } } +enum FederationStatus { + enabling, + enabled, + disabling, + disabled, +} + +extension FederationStatusValueExtension on FederationStatus { + String toValue() { + switch (this) { + case FederationStatus.enabling: + return 'ENABLING'; + case FederationStatus.enabled: + return 'ENABLED'; + case FederationStatus.disabling: + return 'DISABLING'; + case FederationStatus.disabled: + return 'DISABLED'; + } + } +} + +extension FederationStatusFromString on String { + FederationStatus toFederationStatus() { + switch (this) { + case 'ENABLING': + return FederationStatus.enabling; + case 'ENABLED': + return FederationStatus.enabled; + case 'DISABLING': + return FederationStatus.disabling; + case 'DISABLED': + return FederationStatus.disabled; + } + throw Exception('$this is not known in enum FederationStatus'); + } +} + class GetChannelResponse { /// The ARN of an channel returned by a GetChannel request. final String? channelArn; @@ -4604,7 +5901,7 @@ class GetChannelResponse { final String? source; /// Provides information about the advanced event selectors configured for the - /// channel, and whether the channel applies to all regions or a single region. + /// channel, and whether the channel applies to all Regions or a single Region. final SourceConfig? sourceConfig; GetChannelResponse({ @@ -4657,20 +5954,35 @@ class GetEventDataStoreResponse { /// The advanced event selectors used to select events for the data store. final List? advancedEventSelectors; + /// The billing mode for the event data store. + final BillingMode? billingMode; + /// The timestamp of the event data store's creation. final DateTime? createdTimestamp; /// The event data store Amazon Resource Number (ARN). final String? eventDataStoreArn; + /// If Lake query federation is enabled, provides the ARN of the federation role + /// used to access the resources for the federated event data store. + final String? federationRoleArn; + + /// Indicates the Lake + /// query federation status. The status is ENABLED if Lake + /// query federation is enabled, or DISABLED if Lake query + /// federation is disabled. You cannot delete an event data store if the + /// FederationStatus is ENABLED. + final FederationStatus? federationStatus; + /// Specifies the KMS key ID that encrypts the events delivered by CloudTrail. /// The value is a fully specified ARN to a KMS key in the following format. /// /// arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 final String? kmsKeyId; - /// Indicates whether the event data store includes events from all regions, or - /// only from the region in which it was created. + /// Indicates whether the event data store includes events from all Regions, or + /// only from the Region in which it was created. final bool? multiRegionEnabled; /// The name of the event data store. @@ -4680,11 +5992,15 @@ class GetEventDataStoreResponse { /// organization in Organizations. final bool? organizationEnabled; + /// The partition keys for the event data store. To improve query performance + /// and efficiency, CloudTrail Lake organizes event data into partitions based + /// on values derived from partition keys. + final List? partitionKeys; + /// The retention period of the event data store, in days. final int? retentionPeriod; - /// The status of an event data store. Values can be ENABLED and - /// PENDING_DELETION. + /// The status of an event data store. final EventDataStoreStatus? status; /// Indicates that termination protection is enabled. @@ -4697,12 +6013,16 @@ class GetEventDataStoreResponse { GetEventDataStoreResponse({ this.advancedEventSelectors, + this.billingMode, this.createdTimestamp, this.eventDataStoreArn, + this.federationRoleArn, + this.federationStatus, this.kmsKeyId, this.multiRegionEnabled, this.name, this.organizationEnabled, + this.partitionKeys, this.retentionPeriod, this.status, this.terminationProtectionEnabled, @@ -4715,12 +6035,20 @@ class GetEventDataStoreResponse { ?.whereNotNull() .map((e) => AdvancedEventSelector.fromJson(e as Map)) .toList(), + billingMode: (json['BillingMode'] as String?)?.toBillingMode(), createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), eventDataStoreArn: json['EventDataStoreArn'] as String?, + federationRoleArn: json['FederationRoleArn'] as String?, + federationStatus: + (json['FederationStatus'] as String?)?.toFederationStatus(), kmsKeyId: json['KmsKeyId'] as String?, multiRegionEnabled: json['MultiRegionEnabled'] as bool?, name: json['Name'] as String?, organizationEnabled: json['OrganizationEnabled'] as bool?, + partitionKeys: (json['PartitionKeys'] as List?) + ?.whereNotNull() + .map((e) => PartitionKey.fromJson(e as Map)) + .toList(), retentionPeriod: json['RetentionPeriod'] as int?, status: (json['Status'] as String?)?.toEventDataStoreStatus(), terminationProtectionEnabled: @@ -4731,12 +6059,16 @@ class GetEventDataStoreResponse { Map toJson() { final advancedEventSelectors = this.advancedEventSelectors; + final billingMode = this.billingMode; final createdTimestamp = this.createdTimestamp; final eventDataStoreArn = this.eventDataStoreArn; + final federationRoleArn = this.federationRoleArn; + final federationStatus = this.federationStatus; final kmsKeyId = this.kmsKeyId; final multiRegionEnabled = this.multiRegionEnabled; final name = this.name; final organizationEnabled = this.organizationEnabled; + final partitionKeys = this.partitionKeys; final retentionPeriod = this.retentionPeriod; final status = this.status; final terminationProtectionEnabled = this.terminationProtectionEnabled; @@ -4744,14 +6076,19 @@ class GetEventDataStoreResponse { return { if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (createdTimestamp != null) 'CreatedTimestamp': unixTimestampToJson(createdTimestamp), if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, + if (federationRoleArn != null) 'FederationRoleArn': federationRoleArn, + if (federationStatus != null) + 'FederationStatus': federationStatus.toValue(), if (kmsKeyId != null) 'KmsKeyId': kmsKeyId, if (multiRegionEnabled != null) 'MultiRegionEnabled': multiRegionEnabled, if (name != null) 'Name': name, if (organizationEnabled != null) 'OrganizationEnabled': organizationEnabled, + if (partitionKeys != null) 'PartitionKeys': partitionKeys, if (retentionPeriod != null) 'RetentionPeriod': retentionPeriod, if (status != null) 'Status': status.toValue(), if (terminationProtectionEnabled != null) @@ -4903,35 +6240,50 @@ class GetImportResponse { } class GetInsightSelectorsResponse { - /// A JSON string that contains the insight types you want to log on a trail. In - /// this release, ApiErrorRateInsight and - /// ApiCallRateInsight are supported as insight types. + /// The ARN of the source event data store that enabled Insights events. + final String? eventDataStoreArn; + + /// A JSON string that contains the Insight types you want to log on a trail or + /// event data store. ApiErrorRateInsight and + /// ApiCallRateInsight are supported as Insights types. final List? insightSelectors; + /// The ARN of the destination event data store that logs Insights events. + final String? insightsDestination; + /// The Amazon Resource Name (ARN) of a trail for which you want to get Insights /// selectors. final String? trailARN; GetInsightSelectorsResponse({ + this.eventDataStoreArn, this.insightSelectors, + this.insightsDestination, this.trailARN, }); factory GetInsightSelectorsResponse.fromJson(Map json) { return GetInsightSelectorsResponse( + eventDataStoreArn: json['EventDataStoreArn'] as String?, insightSelectors: (json['InsightSelectors'] as List?) ?.whereNotNull() .map((e) => InsightSelector.fromJson(e as Map)) .toList(), + insightsDestination: json['InsightsDestination'] as String?, trailARN: json['TrailARN'] as String?, ); } Map toJson() { + final eventDataStoreArn = this.eventDataStoreArn; final insightSelectors = this.insightSelectors; + final insightsDestination = this.insightsDestination; final trailARN = this.trailARN; return { + if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, if (insightSelectors != null) 'InsightSelectors': insightSelectors, + if (insightsDestination != null) + 'InsightsDestination': insightsDestination, if (trailARN != null) 'TrailARN': trailARN, }; } @@ -5081,9 +6433,10 @@ class GetTrailStatusResponse { /// /// This error occurs only when there is a problem with the destination S3 /// bucket, and does not occur for requests that time out. To resolve the issue, - /// create a new bucket, and then call UpdateTrail to specify the - /// new bucket; or fix the existing objects so that CloudTrail can again write - /// to the bucket. + /// fix the bucket + /// policy so that CloudTrail can write to the bucket; or create a new + /// bucket and call UpdateTrail to specify the new bucket. /// final String? latestDeliveryError; @@ -5098,9 +6451,10 @@ class GetTrailStatusResponse { /// /// This error occurs only when there is a problem with the destination S3 /// bucket, and does not occur for requests that time out. To resolve the issue, - /// create a new bucket, and then call UpdateTrail to specify the - /// new bucket; or fix the existing objects so that CloudTrail can again write - /// to the bucket. + /// fix the bucket + /// policy so that CloudTrail can write to the bucket; or create a new + /// bucket and call UpdateTrail to specify the new bucket. /// final String? latestDigestDeliveryError; @@ -5573,9 +6927,9 @@ class IngestionStatus { } /// A JSON string that contains a list of Insights types that are logged on a -/// trail. +/// trail or event data store. class InsightSelector { - /// The type of Insights events to log on a trail. + /// The type of Insights events to log on a trail or event data store. /// ApiCallRateInsight and ApiErrorRateInsight are /// valid Insight types. /// @@ -5634,6 +6988,34 @@ extension InsightTypeFromString on String { } } +enum InsightsMetricDataType { + fillWithZeros, + nonZeroData, +} + +extension InsightsMetricDataTypeValueExtension on InsightsMetricDataType { + String toValue() { + switch (this) { + case InsightsMetricDataType.fillWithZeros: + return 'FillWithZeros'; + case InsightsMetricDataType.nonZeroData: + return 'NonZeroData'; + } + } +} + +extension InsightsMetricDataTypeFromString on String { + InsightsMetricDataType toInsightsMetricDataType() { + switch (this) { + case 'FillWithZeros': + return InsightsMetricDataType.fillWithZeros; + case 'NonZeroData': + return InsightsMetricDataType.nonZeroData; + } + throw Exception('$this is not known in enum InsightsMetricDataType'); + } +} + class ListChannelsResponse { /// The list of channels in the account. final List? channels; @@ -5668,7 +7050,7 @@ class ListChannelsResponse { class ListEventDataStoresResponse { /// Contains information about event data stores in the account, in the current - /// region. + /// Region. final List? eventDataStores; /// A token you can use to get the next page of results. @@ -5763,6 +7145,92 @@ class ListImportsResponse { } } +class ListInsightsMetricDataResponse { + /// Only returned if InsightType parameter was set to + /// ApiErrorRateInsight. + /// + /// If returning metrics for the ApiErrorRateInsight Insights type, + /// this is the error to retrieve data for. For example, + /// AccessDenied. + final String? errorCode; + + /// The name of the event, typically the Amazon Web Services API on which + /// unusual levels of activity were recorded. + final String? eventName; + + /// The Amazon Web Services service to which the request was made, such as + /// iam.amazonaws.com or s3.amazonaws.com. + final String? eventSource; + + /// The type of CloudTrail Insights event, which is either + /// ApiCallRateInsight or ApiErrorRateInsight. The + /// ApiCallRateInsight Insights type analyzes write-only management + /// API calls that are aggregated per minute against a baseline API call volume. + /// The ApiErrorRateInsight Insights type analyzes management API + /// calls that result in error codes. + final InsightType? insightType; + + /// Only returned if the full results could not be returned in a single query. + /// You can set the NextToken parameter in the next request to this + /// value to continue retrieval. + final String? nextToken; + + /// List of timestamps at intervals corresponding to the specified time period. + final List? timestamps; + + /// List of values representing the API call rate or error rate at each + /// timestamp. The number of values is equal to the number of timestamps. + final List? values; + + ListInsightsMetricDataResponse({ + this.errorCode, + this.eventName, + this.eventSource, + this.insightType, + this.nextToken, + this.timestamps, + this.values, + }); + + factory ListInsightsMetricDataResponse.fromJson(Map json) { + return ListInsightsMetricDataResponse( + errorCode: json['ErrorCode'] as String?, + eventName: json['EventName'] as String?, + eventSource: json['EventSource'] as String?, + insightType: (json['InsightType'] as String?)?.toInsightType(), + nextToken: json['NextToken'] as String?, + timestamps: (json['Timestamps'] as List?) + ?.whereNotNull() + .map(nonNullableTimeStampFromJson) + .toList(), + values: (json['Values'] as List?) + ?.whereNotNull() + .map((e) => e as double) + .toList(), + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final eventName = this.eventName; + final eventSource = this.eventSource; + final insightType = this.insightType; + final nextToken = this.nextToken; + final timestamps = this.timestamps; + final values = this.values; + return { + if (errorCode != null) 'ErrorCode': errorCode, + if (eventName != null) 'EventName': eventName, + if (eventSource != null) 'EventSource': eventSource, + if (insightType != null) 'InsightType': insightType.toValue(), + if (nextToken != null) 'NextToken': nextToken, + if (timestamps != null) + 'Timestamps': timestamps.map(unixTimestampToJson).toList(), + if (values != null) 'Values': values, + }; + } +} + /// Returns the objects or data listed below if successful. Otherwise, returns /// an error. class ListPublicKeysResponse { @@ -5876,7 +7344,7 @@ class ListTrailsResponse { /// parameters. final String? nextToken; - /// Returns the name, ARN, and home region of trails in the current account. + /// Returns the name, ARN, and home Region of trails in the current account. final List? trails; ListTrailsResponse({ @@ -5909,7 +7377,12 @@ class LookupAttribute { /// Specifies an attribute on which to filter the events returned. final LookupAttributeKey attributeKey; - /// Specifies a value for the specified AttributeKey. + /// Specifies a value for the specified AttributeKey. + /// + /// The maximum length for the AttributeValue is 2000 characters. + /// The following characters ('_', ' ', + /// ',', '\\n') count as two characters towards the + /// 2000 character limit. final String attributeValue; LookupAttribute({ @@ -6025,6 +7498,37 @@ class LookupEventsResponse { } } +/// Contains information about a partition key for an event data store. +class PartitionKey { + /// The name of the partition key. + final String name; + + /// The data type of the partition key. For example, bigint or + /// string. + final String type; + + PartitionKey({ + required this.name, + required this.type, + }); + + factory PartitionKey.fromJson(Map json) { + return PartitionKey( + name: json['Name'] as String, + type: json['Type'] as String, + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + return { + 'Name': name, + 'Type': type, + }; + } +} + /// Contains information about a returned public key. class PublicKey { /// The fingerprint of the public key. @@ -6118,35 +7622,51 @@ class PutEventSelectorsResponse { } class PutInsightSelectorsResponse { + /// The Amazon Resource Name (ARN) of the source event data store for which you + /// want to change or add Insights selectors. + final String? eventDataStoreArn; + /// A JSON string that contains the Insights event types that you want to log on - /// a trail. The valid Insights types in this release are + /// a trail or event data store. The valid Insights types are /// ApiErrorRateInsight and ApiCallRateInsight. final List? insightSelectors; + /// The ARN of the destination event data store that logs Insights events. + final String? insightsDestination; + /// The Amazon Resource Name (ARN) of a trail for which you want to change or /// add Insights selectors. final String? trailARN; PutInsightSelectorsResponse({ + this.eventDataStoreArn, this.insightSelectors, + this.insightsDestination, this.trailARN, }); factory PutInsightSelectorsResponse.fromJson(Map json) { return PutInsightSelectorsResponse( + eventDataStoreArn: json['EventDataStoreArn'] as String?, insightSelectors: (json['InsightSelectors'] as List?) ?.whereNotNull() .map((e) => InsightSelector.fromJson(e as Map)) .toList(), + insightsDestination: json['InsightsDestination'] as String?, trailARN: json['TrailARN'] as String?, ); } Map toJson() { + final eventDataStoreArn = this.eventDataStoreArn; final insightSelectors = this.insightSelectors; + final insightsDestination = this.insightsDestination; final trailARN = this.trailARN; return { + if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, if (insightSelectors != null) 'InsightSelectors': insightSelectors, + if (insightsDestination != null) + 'InsightsDestination': insightsDestination, if (trailARN != null) 'TrailARN': trailARN, }; } @@ -6506,6 +8026,9 @@ class RestoreEventDataStoreResponse { /// The advanced event selectors that were used to select events. final List? advancedEventSelectors; + /// The billing mode for the event data store. + final BillingMode? billingMode; + /// The timestamp of an event data store's creation. final DateTime? createdTimestamp; @@ -6519,7 +8042,7 @@ class RestoreEventDataStoreResponse { final String? kmsKeyId; /// Indicates whether the event data store is collecting events from all - /// regions, or only from the region in which the event data store was created. + /// Regions, or only from the Region in which the event data store was created. final bool? multiRegionEnabled; /// The name of the event data store. @@ -6546,6 +8069,7 @@ class RestoreEventDataStoreResponse { RestoreEventDataStoreResponse({ this.advancedEventSelectors, + this.billingMode, this.createdTimestamp, this.eventDataStoreArn, this.kmsKeyId, @@ -6564,6 +8088,7 @@ class RestoreEventDataStoreResponse { ?.whereNotNull() .map((e) => AdvancedEventSelector.fromJson(e as Map)) .toList(), + billingMode: (json['BillingMode'] as String?)?.toBillingMode(), createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), eventDataStoreArn: json['EventDataStoreArn'] as String?, kmsKeyId: json['KmsKeyId'] as String?, @@ -6580,6 +8105,7 @@ class RestoreEventDataStoreResponse { Map toJson() { final advancedEventSelectors = this.advancedEventSelectors; + final billingMode = this.billingMode; final createdTimestamp = this.createdTimestamp; final eventDataStoreArn = this.eventDataStoreArn; final kmsKeyId = this.kmsKeyId; @@ -6593,6 +8119,7 @@ class RestoreEventDataStoreResponse { return { if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (createdTimestamp != null) 'CreatedTimestamp': unixTimestampToJson(createdTimestamp), if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, @@ -6616,7 +8143,7 @@ class S3ImportSource { /// The IAM ARN role used to access the source S3 bucket. final String s3BucketAccessRoleArn; - /// The region associated with the source S3 bucket. + /// The Region associated with the source S3 bucket. final String s3BucketRegion; /// The URI for the source S3 bucket. @@ -6653,7 +8180,7 @@ class SourceConfig { /// The advanced event selectors that are configured for the channel. final List? advancedEventSelectors; - /// Specifies whether the channel applies to a single region or to all regions. + /// Specifies whether the channel applies to a single Region or to all Regions. final bool? applyToAllRegions; SourceConfig({ @@ -6682,6 +8209,19 @@ class SourceConfig { } } +class StartEventDataStoreIngestionResponse { + StartEventDataStoreIngestionResponse(); + + factory StartEventDataStoreIngestionResponse.fromJson( + Map _) { + return StartEventDataStoreIngestionResponse(); + } + + Map toJson() { + return {}; + } +} + class StartImportResponse { /// The timestamp for the import's creation. final DateTime? createdTimestamp; @@ -6804,6 +8344,18 @@ class StartQueryResponse { } } +class StopEventDataStoreIngestionResponse { + StopEventDataStoreIngestionResponse(); + + factory StopEventDataStoreIngestionResponse.fromJson(Map _) { + return StopEventDataStoreIngestionResponse(); + } + + Map toJson() { + return {}; + } +} + class StopImportResponse { /// The timestamp of the import's creation. final DateTime? createdTimestamp; @@ -6963,15 +8515,15 @@ class Trail { /// InsightSelector list. final bool? hasInsightSelectors; - /// The region in which the trail was created. + /// The Region in which the trail was created. final String? homeRegion; /// Set to True to include Amazon Web Services API calls from Amazon Web /// Services global services such as IAM. Otherwise, False. final bool? includeGlobalServiceEvents; - /// Specifies whether the trail exists only in one region or exists in all - /// regions. + /// Specifies whether the trail exists only in one Region or exists in all + /// Regions. final bool? isMultiRegionTrail; /// Specifies whether the trail is an organization trail. @@ -6992,13 +8544,13 @@ class Trail { /// Name of the Amazon S3 bucket into which CloudTrail delivers your trail /// files. See Amazon - /// S3 Bucket Naming Requirements. + /// href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon + /// S3 Bucket naming rules. final String? s3BucketName; /// Specifies the Amazon S3 key prefix that comes after the name of the bucket /// you have designated for log file delivery. For more information, see Finding + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding /// Your CloudTrail Log Files. The maximum length is 200 characters. final String? s3KeyPrefix; @@ -7009,7 +8561,7 @@ class Trail { /// arn:aws:sns:us-east-2:123456789012:MyTopic final String? snsTopicARN; - /// This field is no longer in use. Use SnsTopicARN. + /// This field is no longer in use. Use SnsTopicARN. final String? snsTopicName; /// Specifies the ARN of the trail. The following is the format of a trail ARN. @@ -7103,7 +8655,7 @@ class Trail { } /// Information about a CloudTrail trail, including the trail's name, home -/// region, and Amazon Resource Name (ARN). +/// Region, and Amazon Resource Name (ARN). class TrailInfo { /// The Amazon Web Services Region in which a trail was created. final String? homeRegion; @@ -7190,20 +8742,35 @@ class UpdateEventDataStoreResponse { /// The advanced event selectors that are applied to the event data store. final List? advancedEventSelectors; + /// The billing mode for the event data store. + final BillingMode? billingMode; + /// The timestamp that shows when an event data store was first created. final DateTime? createdTimestamp; /// The ARN of the event data store. final String? eventDataStoreArn; + /// If Lake query federation is enabled, provides the ARN of the federation role + /// used to access the resources for the federated event data store. + final String? federationRoleArn; + + /// Indicates the Lake + /// query federation status. The status is ENABLED if Lake + /// query federation is enabled, or DISABLED if Lake query + /// federation is disabled. You cannot delete an event data store if the + /// FederationStatus is ENABLED. + final FederationStatus? federationStatus; + /// Specifies the KMS key ID that encrypts the events delivered by CloudTrail. /// The value is a fully specified ARN to a KMS key in the following format. /// /// arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 final String? kmsKeyId; - /// Indicates whether the event data store includes events from all regions, or - /// only from the region in which it was created. + /// Indicates whether the event data store includes events from all Regions, or + /// only from the Region in which it was created. final bool? multiRegionEnabled; /// The name of the event data store. @@ -7216,8 +8783,7 @@ class UpdateEventDataStoreResponse { /// The retention period, in days. final int? retentionPeriod; - /// The status of an event data store. Values can be ENABLED and - /// PENDING_DELETION. + /// The status of an event data store. final EventDataStoreStatus? status; /// Indicates whether termination protection is enabled for the event data @@ -7231,8 +8797,11 @@ class UpdateEventDataStoreResponse { UpdateEventDataStoreResponse({ this.advancedEventSelectors, + this.billingMode, this.createdTimestamp, this.eventDataStoreArn, + this.federationRoleArn, + this.federationStatus, this.kmsKeyId, this.multiRegionEnabled, this.name, @@ -7249,8 +8818,12 @@ class UpdateEventDataStoreResponse { ?.whereNotNull() .map((e) => AdvancedEventSelector.fromJson(e as Map)) .toList(), + billingMode: (json['BillingMode'] as String?)?.toBillingMode(), createdTimestamp: timeStampFromJson(json['CreatedTimestamp']), eventDataStoreArn: json['EventDataStoreArn'] as String?, + federationRoleArn: json['FederationRoleArn'] as String?, + federationStatus: + (json['FederationStatus'] as String?)?.toFederationStatus(), kmsKeyId: json['KmsKeyId'] as String?, multiRegionEnabled: json['MultiRegionEnabled'] as bool?, name: json['Name'] as String?, @@ -7265,8 +8838,11 @@ class UpdateEventDataStoreResponse { Map toJson() { final advancedEventSelectors = this.advancedEventSelectors; + final billingMode = this.billingMode; final createdTimestamp = this.createdTimestamp; final eventDataStoreArn = this.eventDataStoreArn; + final federationRoleArn = this.federationRoleArn; + final federationStatus = this.federationStatus; final kmsKeyId = this.kmsKeyId; final multiRegionEnabled = this.multiRegionEnabled; final name = this.name; @@ -7278,9 +8854,13 @@ class UpdateEventDataStoreResponse { return { if (advancedEventSelectors != null) 'AdvancedEventSelectors': advancedEventSelectors, + if (billingMode != null) 'BillingMode': billingMode.toValue(), if (createdTimestamp != null) 'CreatedTimestamp': unixTimestampToJson(createdTimestamp), if (eventDataStoreArn != null) 'EventDataStoreArn': eventDataStoreArn, + if (federationRoleArn != null) 'FederationRoleArn': federationRoleArn, + if (federationStatus != null) + 'FederationStatus': federationStatus.toValue(), if (kmsKeyId != null) 'KmsKeyId': kmsKeyId, if (multiRegionEnabled != null) 'MultiRegionEnabled': multiRegionEnabled, if (name != null) 'Name': name, @@ -7311,7 +8891,7 @@ class UpdateTrailResponse { /// as IAM to the log files. final bool? includeGlobalServiceEvents; - /// Specifies whether the trail exists in one region or in all regions. + /// Specifies whether the trail exists in one Region or in all Regions. final bool? isMultiRegionTrail; /// Specifies whether the trail is an organization trail. @@ -7335,7 +8915,7 @@ class UpdateTrailResponse { /// Specifies the Amazon S3 key prefix that comes after the name of the bucket /// you have designated for log file delivery. For more information, see Finding + /// href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding /// Your IAM Log Files. final String? s3KeyPrefix; @@ -7346,7 +8926,7 @@ class UpdateTrailResponse { /// arn:aws:sns:us-east-2:123456789012:MyTopic final String? snsTopicARN; - /// This field is no longer in use. Use UpdateTrailResponse$SnsTopicARN. + /// This field is no longer in use. Use SnsTopicARN. final String? snsTopicName; /// Specifies the ARN of the trail that was updated. The following is the format @@ -7426,6 +9006,11 @@ class UpdateTrailResponse { } } +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + class AccountHasOngoingImportException extends _s.GenericAwsException { AccountHasOngoingImportException({String? type, String? message}) : super( @@ -7525,6 +9110,14 @@ class CloudWatchLogsDeliveryUnavailableException message: message); } +class ConcurrentModificationException extends _s.GenericAwsException { + ConcurrentModificationException({String? type, String? message}) + : super( + type: type, + code: 'ConcurrentModificationException', + message: message); +} + class ConflictException extends _s.GenericAwsException { ConflictException({String? type, String? message}) : super(type: type, code: 'ConflictException', message: message); @@ -7555,6 +9148,14 @@ class EventDataStoreAlreadyExistsException extends _s.GenericAwsException { message: message); } +class EventDataStoreFederationEnabledException extends _s.GenericAwsException { + EventDataStoreFederationEnabledException({String? type, String? message}) + : super( + type: type, + code: 'EventDataStoreFederationEnabledException', + message: message); +} + class EventDataStoreHasOngoingImportException extends _s.GenericAwsException { EventDataStoreHasOngoingImportException({String? type, String? message}) : super( @@ -7942,6 +9543,11 @@ class TagsLimitExceededException extends _s.GenericAwsException { : super(type: type, code: 'TagsLimitExceededException', message: message); } +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + class TrailAlreadyExistsException extends _s.GenericAwsException { TrailAlreadyExistsException({String? type, String? message}) : super( @@ -7967,6 +9573,8 @@ class UnsupportedOperationException extends _s.GenericAwsException { } final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), 'AccountHasOngoingImportException': (type, message) => AccountHasOngoingImportException(type: type, message: message), 'AccountNotFoundException': (type, message) => @@ -7995,6 +9603,8 @@ final _exceptionFns = { CloudTrailInvalidClientTokenIdException(type: type, message: message), 'CloudWatchLogsDeliveryUnavailableException': (type, message) => CloudWatchLogsDeliveryUnavailableException(type: type, message: message), + 'ConcurrentModificationException': (type, message) => + ConcurrentModificationException(type: type, message: message), 'ConflictException': (type, message) => ConflictException(type: type, message: message), 'DelegatedAdminAccountLimitExceededException': (type, message) => @@ -8003,6 +9613,8 @@ final _exceptionFns = { EventDataStoreARNInvalidException(type: type, message: message), 'EventDataStoreAlreadyExistsException': (type, message) => EventDataStoreAlreadyExistsException(type: type, message: message), + 'EventDataStoreFederationEnabledException': (type, message) => + EventDataStoreFederationEnabledException(type: type, message: message), 'EventDataStoreHasOngoingImportException': (type, message) => EventDataStoreHasOngoingImportException(type: type, message: message), 'EventDataStoreMaxLimitExceededException': (type, message) => @@ -8117,6 +9729,8 @@ final _exceptionFns = { S3BucketDoesNotExistException(type: type, message: message), 'TagsLimitExceededException': (type, message) => TagsLimitExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), 'TrailAlreadyExistsException': (type, message) => TrailAlreadyExistsException(type: type, message: message), 'TrailNotFoundException': (type, message) => diff --git a/aws_client/lib/src/generated/cloud_watch/v2010_08_01.dart b/aws_client/lib/src/generated/cloud_watch/v2010_08_01.dart index 0b0b5668c..9e64a8754 100644 --- a/aws_client/lib/src/generated/cloud_watch/v2010_08_01.dart +++ b/aws_client/lib/src/generated/cloud_watch/v2010_08_01.dart @@ -425,7 +425,15 @@ class CloudWatch { /// Parameter [alarmTypes] : /// Use this parameter to specify whether you want the operation to return /// metric alarms or composite alarms. If you omit this parameter, only metric - /// alarms are returned. + /// alarms are returned, even if composite alarms exist in the account. + /// + /// For example, if you omit this parameter or specify + /// MetricAlarms, the operation returns only a list of metric + /// alarms. It does not return any composite alarms, even if composite alarms + /// exist in the account. + /// + /// If you specify CompositeAlarms, the operation returns only a + /// list of composite alarms, and does not return any metric alarms. /// /// Parameter [childrenOfAlarmName] : /// If you use this parameter and specify the name of a composite alarm, the @@ -954,7 +962,7 @@ class CloudWatch { /// /// Parameter [orderBy] : /// Determines what statistic to use to rank the contributors. Valid values - /// are SUM and MAXIMUM. + /// are Sum and Maximum. Future getInsightRuleReport({ required DateTime endTime, required int period, @@ -1149,6 +1157,9 @@ class CloudWatch { /// paginates when the MaxDatapoints limit is reached. /// TimestampAscending returns the oldest data first and /// paginates when the MaxDatapoints limit is reached. + /// + /// If you omit this parameter, the default of + /// TimestampDescending is used. Future getMetricData({ required DateTime endTime, required List metricDataQueries, @@ -1774,7 +1785,7 @@ class CloudWatch { /// /// /// The ARN format of a Contributor Insights rule is - /// arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name + /// arn:aws:cloudwatch:Region:account-id:insight-rule/insight-rule-name /// /// /// For more information about ARN format, see SingleMetricAnomalyDetector parameter. + /// /// For more information, see CloudWatch /// Anomaly Detection. @@ -1824,6 +1840,11 @@ class CloudWatch { /// Parameter [dimensions] : /// The metric dimensions to create the anomaly detection model for. /// + /// Parameter [metricCharacteristics] : + /// Use this object to include parameters to provide information about your + /// metric to CloudWatch to help it build more accurate anomaly detection + /// models. Currently, it includes the PeriodicSpikes parameter. + /// /// Parameter [metricMathAnomalyDetector] : /// The metric math anomaly detector to be created. /// @@ -1877,7 +1898,7 @@ class CloudWatch { /// Stat ///
    • ///
    • - /// the MetricMatchAnomalyDetector parameters of + /// the MetricMathAnomalyDetector parameters of /// PutAnomalyDetectorInput ///
    • ///
    @@ -1889,6 +1910,7 @@ class CloudWatch { Future putAnomalyDetector({ AnomalyDetectorConfiguration? configuration, List? dimensions, + MetricCharacteristics? metricCharacteristics, MetricMathAnomalyDetector? metricMathAnomalyDetector, String? metricName, String? namespace, @@ -1898,6 +1920,8 @@ class CloudWatch { final $request = {}; configuration?.also((arg) => $request['Configuration'] = arg); dimensions?.also((arg) => $request['Dimensions'] = arg); + metricCharacteristics + ?.also((arg) => $request['MetricCharacteristics'] = arg); metricMathAnomalyDetector ?.also((arg) => $request['MetricMathAnomalyDetector'] = arg); metricName?.also((arg) => $request['MetricName'] = arg); @@ -1935,9 +1959,22 @@ class CloudWatch { /// that goes into ALARM state only when more than one of the underlying /// metric alarms are in ALARM state. /// - /// Currently, the only alarm actions that can be taken by composite alarms - /// are notifying SNS topics. - /// + /// Composite alarms can take the following actions: + /// + ///
      + ///
    • + /// Notify Amazon SNS topics. + ///
    • + ///
    • + /// Invoke Lambda functions. + ///
    • + ///
    • + /// Create OpsItems in Systems Manager Ops Center. + ///
    • + ///
    • + /// Create incidents in Systems Manager Incident Manager. + ///
    • + ///
    /// It is possible to create a loop or cycle of composite alarms, where /// composite alarm A depends on composite alarm B, and composite alarm B also /// depends on composite alarm A. In this scenario, you can't delete any @@ -2079,9 +2116,34 @@ class CloudWatch { /// ALARM state from any other state. Each action is specified as /// an Amazon Resource Name (ARN). /// - /// Valid Values: + /// Valid Values: ] + /// + /// Amazon SNS actions: + /// /// arn:aws:sns:region:account-id:sns-topic-name - /// | + /// + /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    + /// Systems Manager actions: + /// /// arn:aws:ssm:region:account-id:opsitem:severity /// /// @@ -2093,26 +2155,81 @@ class CloudWatch { /// INSUFFICIENT_DATA state from any other state. Each action is /// specified as an Amazon Resource Name (ARN). /// - /// Valid Values: + /// Valid Values: ] + /// + /// Amazon SNS actions: + /// /// arn:aws:sns:region:account-id:sns-topic-name /// /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    + /// /// Parameter [oKActions] : /// The actions to execute when this alarm transitions to an OK /// state from any other state. Each action is specified as an Amazon Resource /// Name (ARN). /// - /// Valid Values: + /// Valid Values: ] + /// + /// Amazon SNS actions: + /// /// arn:aws:sns:region:account-id:sns-topic-name /// /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    + /// /// Parameter [tags] : - /// A list of key-value pairs to associate with the composite alarm. You can - /// associate as many as 50 tags with an alarm. + /// A list of key-value pairs to associate with the alarm. You can associate + /// as many as 50 tags with an alarm. To be able to associate tags with the + /// alarm when you create the alarm, you must have the + /// cloudwatch:TagResource permission. /// /// Tags can help you organize and categorize your resources. You can also use - /// them to scope user permissions, by granting a user permission to access or + /// them to scope user permissions by granting a user permission to access or /// change only resources with certain tag values. + /// + /// If you are using this operation to update an existing alarm, any tags you + /// specify in this parameter are ignored. To change the tags of an existing + /// alarm, use TagResource + /// or UntagResource. Future putCompositeAlarm({ required String alarmName, required String alarmRule, @@ -2458,11 +2575,30 @@ class CloudWatch { /// /// /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    /// SNS notification action: /// ///
      ///
    • - /// arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + /// arn:aws:sns:region:account-id:sns-topic-name /// ///
    • ///
    @@ -2505,11 +2641,56 @@ class CloudWatch { /// Valid Values: evaluate | ignore /// /// Parameter [extendedStatistic] : - /// The percentile statistic for the metric specified in - /// MetricName. Specify a value between p0.0 and p100. When you - /// call PutMetricAlarm and specify a MetricName, - /// you must specify either Statistic or - /// ExtendedStatistic, but not both. + /// The extended statistic for the metric specified in + /// MetricName. When you call PutMetricAlarm and + /// specify a MetricName, you must specify either + /// Statistic or ExtendedStatistic but not both. + /// + /// If you specify ExtendedStatistic, the following are valid + /// values: + /// + ///
      + ///
    • + /// p90 + ///
    • + ///
    • + /// tm90 + ///
    • + ///
    • + /// tc90 + ///
    • + ///
    • + /// ts90 + ///
    • + ///
    • + /// wm90 + ///
    • + ///
    • + /// IQM + ///
    • + ///
    • + /// PR(n:m) where n and m are values of the metric + ///
    • + ///
    • + /// TC(X%:X%) where X is between 10 and 90 + /// inclusive. + ///
    • + ///
    • + /// TM(X%:X%) where X is between 10 and 90 + /// inclusive. + ///
    • + ///
    • + /// TS(X%:X%) where X is between 10 and 90 + /// inclusive. + ///
    • + ///
    • + /// WM(X%:X%) where X is between 10 and 90 + /// inclusive. + ///
    • + ///
    + /// For more information about these extended statistics, see CloudWatch + /// statistics definitions. /// /// Parameter [insufficientDataActions] : /// The actions to execute when this alarm transitions to the @@ -2552,11 +2733,30 @@ class CloudWatch { ///
    /// /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    /// SNS notification action: /// ///
      ///
    • - /// arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + /// arn:aws:sns:region:account-id:sns-topic-name /// ///
    • ///
    @@ -2579,10 +2779,11 @@ class CloudWatch { /// MetricName or a Metrics array. /// /// If you are creating an alarm based on a math expression, you cannot - /// specify this parameter, or any of the Dimensions, - /// Period, Namespace, Statistic, or - /// ExtendedStatistic parameters. Instead, you specify all this - /// information in the Metrics array. + /// specify this parameter, or any of the Namespace, + /// Dimensions, Period, Unit, + /// Statistic, or ExtendedStatistic parameters. + /// Instead, you specify all this information in the Metrics + /// array. /// /// Parameter [metrics] : /// An array of MetricDataQuery structures that enable you to @@ -2600,8 +2801,8 @@ class CloudWatch { /// href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery. /// /// If you use the Metrics parameter, you cannot include the - /// MetricName, Dimensions, Period, - /// Namespace, Statistic, or + /// Namespace, MetricName, Dimensions, + /// Period, Unit, Statistic, or /// ExtendedStatistic parameters of PutMetricAlarm /// in the same operation. Instead, you retrieve the metrics you are using in /// your math expression as part of the Metrics array. @@ -2651,11 +2852,30 @@ class CloudWatch { /// /// /// + /// Lambda actions: + /// + ///
      + ///
    • + /// Invoke the latest version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name + /// + ///
    • + ///
    • + /// Invoke a specific version of a Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:version-number + /// + ///
    • + ///
    • + /// Invoke a function by using an alias Lambda function: + /// arn:aws:lambda:region:account-id:function:function-name:alias-name + /// + ///
    • + ///
    /// SNS notification action: /// ///
      ///
    • - /// arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + /// arn:aws:sns:region:account-id:sns-topic-name /// ///
    • ///
    @@ -2707,7 +2927,9 @@ class CloudWatch { /// /// Parameter [tags] : /// A list of key-value pairs to associate with the alarm. You can associate - /// as many as 50 tags with an alarm. + /// as many as 50 tags with an alarm. To be able to associate tags with the + /// alarm when you create the alarm, you must have the + /// cloudwatch:TagResource permission. /// /// Tags can help you organize and categorize your resources. You can also use /// them to scope user permissions by granting a user permission to access or @@ -2757,7 +2979,10 @@ class CloudWatch { /// of bytes that an instance receives on all network interfaces. You can also /// specify a unit when you create a custom metric. Units help provide /// conceptual meaning to your data. Metric data points that specify a unit of - /// measure, such as Percent, are aggregated separately. + /// measure, such as Percent, are aggregated separately. If you are creating + /// an alarm based on a metric math expression, you can specify the unit for + /// each metric (if needed) within the objects in the Metrics + /// array. /// /// If you don't specify Unit, CloudWatch retrieves all unit /// types that have been published for the metric and attempts to evaluate the @@ -2861,7 +3086,7 @@ class CloudWatch { /// You can publish either individual data points in the Value /// field, or arrays of values and the number of times each value occurred /// during the period by using the Values and Counts - /// fields in the MetricDatum structure. Using the + /// fields in the MetricData structure. Using the /// Values and Counts method enables you to publish /// up to 150 values per metric with one PutMetricData request, /// and supports retrieving percentile statistics on this data. @@ -3016,9 +3241,9 @@ class CloudWatch { /// Valid characters are A-Z, a-z, 0-9, "-" and "_". /// /// Parameter [outputFormat] : - /// The output format for the stream. Valid values are json and - /// opentelemetry0.7. For more information about metric stream - /// output formats, see json, + /// opentelemetry1.0, and opentelemetry0.7. For more + /// information about metric stream output formats, see /// Metric streams output formats. /// @@ -3071,8 +3296,8 @@ class CloudWatch { /// supported by CloudWatch, listed in /// CloudWatch statistics definitions. If the OutputFormat is - /// opentelemetry0.7, you can stream percentile statistics such - /// as p95, p99.9, and so on. + /// opentelemetry1.0 or opentelemetry0.7, you can + /// stream percentile statistics such as p95, p99.9, and so on. /// /// Parameter [tags] : /// A list of key-value pairs to associate with the metric stream. You can @@ -3280,7 +3505,7 @@ class CloudWatch { /// /// /// The ARN format of a Contributor Insights rule is - /// arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name + /// arn:aws:cloudwatch:Region:account-id:insight-rule/insight-rule-name /// /// /// For more information about ARN format, see /// /// The ARN format of a Contributor Insights rule is - /// arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name + /// arn:aws:cloudwatch:Region:account-id:insight-rule/insight-rule-name /// /// /// For more information about ARN format, see ? dimensions; + /// This object includes parameters that you can use to provide information + /// about your metric to CloudWatch to help it build more accurate anomaly + /// detection models. Currently, it includes the PeriodicSpikes + /// parameter. + final MetricCharacteristics? metricCharacteristics; + /// The CloudWatch metric math expression for this anomaly detector. final MetricMathAnomalyDetector? metricMathAnomalyDetector; @@ -3503,13 +3738,13 @@ class AnomalyDetector { /// The statistic associated with the anomaly detection model. final String? stat; - /// The current status of the anomaly detector's training. The possible values - /// are TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA + /// The current status of the anomaly detector's training. final AnomalyDetectorStateValue? stateValue; AnomalyDetector({ this.configuration, this.dimensions, + this.metricCharacteristics, this.metricMathAnomalyDetector, this.metricName, this.namespace, @@ -3524,6 +3759,9 @@ class AnomalyDetector { ?.let(AnomalyDetectorConfiguration.fromXml), dimensions: _s.extractXmlChild(elem, 'Dimensions')?.let((elem) => elem.findElements('member').map(Dimension.fromXml).toList()), + metricCharacteristics: _s + .extractXmlChild(elem, 'MetricCharacteristics') + ?.let(MetricCharacteristics.fromXml), metricMathAnomalyDetector: _s .extractXmlChild(elem, 'MetricMathAnomalyDetector') ?.let(MetricMathAnomalyDetector.fromXml), @@ -3542,6 +3780,7 @@ class AnomalyDetector { Map toJson() { final configuration = this.configuration; final dimensions = this.dimensions; + final metricCharacteristics = this.metricCharacteristics; final metricMathAnomalyDetector = this.metricMathAnomalyDetector; final metricName = this.metricName; final namespace = this.namespace; @@ -3551,6 +3790,8 @@ class AnomalyDetector { return { if (configuration != null) 'Configuration': configuration, if (dimensions != null) 'Dimensions': dimensions, + if (metricCharacteristics != null) + 'MetricCharacteristics': metricCharacteristics, if (metricMathAnomalyDetector != null) 'MetricMathAnomalyDetector': metricMathAnomalyDetector, if (metricName != null) 'MetricName': metricName, @@ -4651,9 +4892,9 @@ class GetMetricStreamOutput { /// The name of the metric stream. final String? name; - /// The output format for the stream. Valid values are json and - /// opentelemetry0.7. For more information about metric stream - /// output formats, see json, + /// opentelemetry1.0, and opentelemetry0.7. For more + /// information about metric stream output formats, see Metric /// streams output formats. final MetricStreamOutputFormat? outputFormat; @@ -5705,6 +5946,33 @@ class MetricAlarm { } } +/// This object includes parameters that you can use to provide information to +/// CloudWatch to help it build more accurate anomaly detection models. +class MetricCharacteristics { + /// Set this parameter to true if values for this metric + /// consistently include spikes that should not be considered to be anomalies. + /// With this set to true, CloudWatch will expect to see spikes + /// that occurred consistently during the model training period, and won't flag + /// future similar spikes as anomalies. + final bool? periodicSpikes; + + MetricCharacteristics({ + this.periodicSpikes, + }); + factory MetricCharacteristics.fromXml(_s.XmlElement elem) { + return MetricCharacteristics( + periodicSpikes: _s.extractXmlBoolValue(elem, 'PeriodicSpikes'), + ); + } + + Map toJson() { + final periodicSpikes = this.periodicSpikes; + return { + if (periodicSpikes != null) 'PeriodicSpikes': periodicSpikes, + }; + } +} + /// This structure is used in both GetMetricData and /// PutMetricAlarm. The supported use of this structure is /// different for those two operations. @@ -6168,8 +6436,8 @@ class MetricStreamEntry { /// The name of the metric stream. final String? name; - /// The output format of this metric stream. Valid values are json - /// and opentelemetry0.7. + /// The output format of this metric stream. Valid values are json, + /// opentelemetry1.0, and opentelemetry0.7. final MetricStreamOutputFormat? outputFormat; /// The current state of this stream. Valid values are running and @@ -6272,6 +6540,7 @@ class MetricStreamFilter { enum MetricStreamOutputFormat { json, opentelemetry0_7, + opentelemetry1_0, } extension MetricStreamOutputFormatValueExtension on MetricStreamOutputFormat { @@ -6281,6 +6550,8 @@ extension MetricStreamOutputFormatValueExtension on MetricStreamOutputFormat { return 'json'; case MetricStreamOutputFormat.opentelemetry0_7: return 'opentelemetry0.7'; + case MetricStreamOutputFormat.opentelemetry1_0: + return 'opentelemetry1.0'; } } } @@ -6292,6 +6563,8 @@ extension MetricStreamOutputFormatFromString on String { return MetricStreamOutputFormat.json; case 'opentelemetry0.7': return MetricStreamOutputFormat.opentelemetry0_7; + case 'opentelemetry1.0': + return MetricStreamOutputFormat.opentelemetry1_0; } throw Exception('$this is not known in enum MetricStreamOutputFormat'); } @@ -6310,9 +6583,9 @@ class MetricStreamStatisticsConfiguration { /// can include as many as 20 statistics. /// /// If the OutputFormat for the stream is - /// opentelemetry0.7, the only valid values are p?? - /// percentile statistics such as p90, p99 and - /// so on. + /// opentelemetry1.0 or opentelemetry0.7, the only + /// valid values are p?? percentile statistics such as + /// p90, p99 and so on. /// /// If the OutputFormat for the stream is json, the /// valid values include the abbreviations for all of the statistics listed in @@ -6621,8 +6894,15 @@ extension ScanByFromString on String { } /// Designates the CloudWatch metric and statistic that provides the time series -/// the anomaly detector uses as input. +/// the anomaly detector uses as input. If you have enabled unified +/// cross-account observability, and this account is a monitoring account, the +/// metric can be in the same account or a source account. class SingleMetricAnomalyDetector { + /// If the CloudWatch metric that provides the time series that the anomaly + /// detector uses as input is in another account, specify that account ID here. + /// If you omit this parameter, the current account is used. + final String? accountId; + /// The metric dimensions to create the anomaly detection model for. final List? dimensions; @@ -6636,6 +6916,7 @@ class SingleMetricAnomalyDetector { final String? stat; SingleMetricAnomalyDetector({ + this.accountId, this.dimensions, this.metricName, this.namespace, @@ -6643,6 +6924,7 @@ class SingleMetricAnomalyDetector { }); factory SingleMetricAnomalyDetector.fromXml(_s.XmlElement elem) { return SingleMetricAnomalyDetector( + accountId: _s.extractXmlStringValue(elem, 'AccountId'), dimensions: _s.extractXmlChild(elem, 'Dimensions')?.let((elem) => elem.findElements('member').map(Dimension.fromXml).toList()), metricName: _s.extractXmlStringValue(elem, 'MetricName'), @@ -6652,11 +6934,13 @@ class SingleMetricAnomalyDetector { } Map toJson() { + final accountId = this.accountId; final dimensions = this.dimensions; final metricName = this.metricName; final namespace = this.namespace; final stat = this.stat; return { + if (accountId != null) 'AccountId': accountId, if (dimensions != null) 'Dimensions': dimensions, if (metricName != null) 'MetricName': metricName, if (namespace != null) 'Namespace': namespace, diff --git a/aws_client/lib/src/generated/cloud_watch/v2010_08_01.meta.dart b/aws_client/lib/src/generated/cloud_watch/v2010_08_01.meta.dart index 37b0e7e29..1bcb255ef 100644 --- a/aws_client/lib/src/generated/cloud_watch/v2010_08_01.meta.dart +++ b/aws_client/lib/src/generated/cloud_watch/v2010_08_01.meta.dart @@ -51,6 +51,10 @@ const Map> shapesJson = { "flattened": false }, "StateValue": {"shape": "AnomalyDetectorStateValue", "flattened": false}, + "MetricCharacteristics": { + "shape": "MetricCharacteristics", + "flattened": false + }, "SingleMetricAnomalyDetector": { "shape": "SingleMetricAnomalyDetector", "flattened": false @@ -952,6 +956,13 @@ const Map> shapesJson = { "member": {"shape": "MetricAlarm"}, "flattened": false }, + "MetricCharacteristics": { + "type": "structure", + "members": { + "PeriodicSpikes": {"shape": "PeriodicSpikes", "flattened": false} + }, + "flattened": false + }, "MetricData": { "type": "list", "member": {"shape": "MetricDatum"}, @@ -1144,6 +1155,7 @@ const Map> shapesJson = { "flattened": false }, "Period": {"type": "integer", "flattened": false}, + "PeriodicSpikes": {"type": "boolean", "flattened": false}, "PutAnomalyDetectorInput": { "type": "structure", "members": { @@ -1155,6 +1167,10 @@ const Map> shapesJson = { "shape": "AnomalyDetectorConfiguration", "flattened": false }, + "MetricCharacteristics": { + "shape": "MetricCharacteristics", + "flattened": false + }, "SingleMetricAnomalyDetector": { "shape": "SingleMetricAnomalyDetector", "flattened": false @@ -1338,6 +1354,7 @@ const Map> shapesJson = { "SingleMetricAnomalyDetector": { "type": "structure", "members": { + "AccountId": {"shape": "AccountId", "flattened": false}, "Namespace": {"shape": "Namespace", "flattened": false}, "MetricName": {"shape": "MetricName", "flattened": false}, "Dimensions": {"shape": "Dimensions", "flattened": false}, diff --git a/aws_client/lib/src/generated/cloud_watch_events/v2015_10_07.dart b/aws_client/lib/src/generated/cloud_watch_events/v2015_10_07.dart index 55b58d0c1..5fd272de5 100644 --- a/aws_client/lib/src/generated/cloud_watch_events/v2015_10_07.dart +++ b/aws_client/lib/src/generated/cloud_watch_events/v2015_10_07.dart @@ -2039,11 +2039,11 @@ class CloudWatchEvents { /// Step Functions state machines /// /// - /// Creating rules with built-in targets is supported only in the Management - /// Console. The built-in targets are EC2 CreateSnapshot API - /// call, EC2 RebootInstances API call, EC2 - /// StopInstances API call, and EC2 TerminateInstances API - /// call. + /// Creating rules with built-in targets is supported only in the Amazon Web + /// Services Management Console. The built-in targets are EC2 + /// CreateSnapshot API call, EC2 RebootInstances API call, + /// EC2 StopInstances API call, and EC2 TerminateInstances + /// API call. /// /// For some target types, PutTargets provides target-specific /// parameters. If the target is a Kinesis data stream, you can optionally diff --git a/aws_client/lib/src/generated/cloud_watch_logs/v2014_03_28.dart b/aws_client/lib/src/generated/cloud_watch_logs/v2014_03_28.dart index d67f173e6..6898e81b5 100644 --- a/aws_client/lib/src/generated/cloud_watch_logs/v2014_03_28.dart +++ b/aws_client/lib/src/generated/cloud_watch_logs/v2014_03_28.dart @@ -84,20 +84,61 @@ class CloudWatchLogs { _protocol.close(); } - /// Associates the specified KMS key with the specified log group. + /// Associates the specified KMS key with either one log group in the account, + /// or with all stored CloudWatch Logs query insights results in the account. + /// + /// When you use AssociateKmsKey, you specify either the + /// logGroupName parameter or the resourceIdentifier + /// parameter. You can't specify both of those parameters in the same + /// operation. + /// + ///
      + ///
    • + /// Specify the logGroupName parameter to cause all log events + /// stored in the log group to be encrypted with that key. Only the log events + /// ingested after the key is associated are encrypted with that key. /// /// Associating a KMS key with a log group overrides any existing associations /// between the log group and a KMS key. After a KMS key is associated with a /// log group, all newly ingested data for the log group is encrypted using /// the KMS key. This association is stored as long as the data encrypted with - /// the KMS keyis still within CloudWatch Logs. This enables CloudWatch Logs + /// the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs /// to decrypt this data whenever it is requested. - /// + /// + /// Associating a key with a log group does not cause the results of queries + /// of that log group to be encrypted with that key. To have query results + /// encrypted with a KMS key, you must use an AssociateKmsKey + /// operation with the resourceIdentifier parameter that + /// specifies a query-result resource. + ///
    • + ///
    • + /// Specify the resourceIdentifier parameter with a + /// query-result resource, to use that key to encrypt the stored + /// results of all future StartQuery + /// operations in the account. The response from a GetQueryResults + /// operation will still return the query results in plain text. + /// + /// Even if you have not associated a key with your query results, the query + /// results are encrypted when stored, using the default CloudWatch Logs + /// method. + /// + /// If you run a query from a monitoring account that queries logs in a source + /// account, the query results key from the monitoring account, if any, is + /// used. + ///
    • + ///
    + /// If you delete the key that is used to encrypt log events or log group + /// query results, then all the associated stored log events or query results + /// that were encrypted with that key will be unencryptable and unusable. + /// /// CloudWatch Logs supports only symmetric KMS keys. Do not use an associate - /// an asymmetric KMS key with your log group. For more information, see Using /// Symmetric and Asymmetric Keys. - /// + /// /// It can take up to 5 minutes for this operation to take effect. /// /// If you attempt to associate a KMS key with a log group but the KMS key @@ -119,9 +160,42 @@ class CloudWatchLogs { /// /// Parameter [logGroupName] : /// The name of the log group. + /// + /// In your AssociateKmsKey operation, you must specify either + /// the resourceIdentifier parameter or the logGroup + /// parameter, but you can't specify both. + /// + /// Parameter [resourceIdentifier] : + /// Specifies the target for this operation. You must specify one of the + /// following: + /// + ///
      + ///
    • + /// Specify the following ARN to have future GetQueryResults + /// operations in this account encrypt the results with the specified KMS key. + /// Replace REGION and ACCOUNT_ID with your Region and account + /// ID. + /// + /// arn:aws:logs:REGION:ACCOUNT_ID:query-result:* + ///
    • + ///
    • + /// Specify the ARN of a log group to have CloudWatch Logs use the KMS key to + /// encrypt log events that are ingested and stored by that log group. The log + /// group ARN must be in the following format. Replace REGION and + /// ACCOUNT_ID with your Region and account ID. + /// + /// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME + /// + ///
    • + ///
    + /// In your AssociateKmsKey operation, you must specify either + /// the resourceIdentifier parameter or the logGroup + /// parameter, but you can't specify both. Future associateKmsKey({ required String kmsKeyId, - required String logGroupName, + String? logGroupName, + String? resourceIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -135,7 +209,9 @@ class CloudWatchLogs { headers: headers, payload: { 'kmsKeyId': kmsKeyId, - 'logGroupName': logGroupName, + if (logGroupName != null) 'logGroupName': logGroupName, + if (resourceIdentifier != null) + 'resourceIdentifier': resourceIdentifier, }, ); } @@ -171,6 +247,97 @@ class CloudWatchLogs { ); } + /// Creates a delivery. A delivery is a connection between a logical + /// delivery source and a logical delivery destination that you + /// have already created. + /// + /// Only some Amazon Web Services services support being configured as a + /// delivery source using this operation. These services are listed as + /// Supported [V2 Permissions] in the table at Enabling + /// logging from Amazon Web Services services. + /// + /// A delivery destination can represent a log group in CloudWatch Logs, an + /// Amazon S3 bucket, or a delivery stream in Firehose. + /// + /// To configure logs delivery between a supported Amazon Web Services service + /// and a destination, you must do the following: + /// + ///
      + ///
    • + /// Create a delivery source, which is a logical object that represents the + /// resource that is actually sending the logs. For more information, see PutDeliverySource. + ///
    • + ///
    • + /// Create a delivery destination, which is a logical object that + /// represents the actual delivery destination. For more information, see PutDeliveryDestination. + ///
    • + ///
    • + /// If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy + /// in the destination account to assign an IAM policy to the destination. + /// This policy allows delivery to that destination. + ///
    • + ///
    • + /// Use CreateDelivery to create a delivery by pairing + /// exactly one delivery source and one delivery destination. + ///
    • + ///
    + /// You can configure a single delivery source to send logs to multiple + /// destinations by creating multiple deliveries. You can also create multiple + /// deliveries to configure multiple delivery sources to send logs to the same + /// delivery destination. + /// + /// You can't update an existing delivery. You can only create and delete + /// deliveries. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [deliveryDestinationArn] : + /// The ARN of the delivery destination to use for this delivery. + /// + /// Parameter [deliverySourceName] : + /// The name of the delivery source to use for this delivery. + /// + /// Parameter [tags] : + /// An optional list of key-value pairs to associate with the resource. + /// + /// For more information about tagging, see Tagging + /// Amazon Web Services resources + Future createDelivery({ + required String deliveryDestinationArn, + required String deliverySourceName, + Map? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.CreateDelivery' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'deliveryDestinationArn': deliveryDestinationArn, + 'deliverySourceName': deliverySourceName, + if (tags != null) 'tags': tags, + }, + ); + + return CreateDeliveryResponse.fromJson(jsonResponse.body); + } + /// Creates an export task so that you can efficiently export data from a log /// group to an Amazon S3 bucket. When you perform a /// CreateExportTask operation, you must use credentials that @@ -286,8 +453,137 @@ class CloudWatchLogs { return CreateExportTaskResponse.fromJson(jsonResponse.body); } - /// Creates a log group with the specified name. You can create up to 20,000 - /// log groups per account. + /// Creates an anomaly detector that regularly scans one or more log + /// groups and look for patterns and anomalies in the logs. + /// + /// An anomaly detector can help surface issues by automatically discovering + /// anomalies in your log event traffic. An anomaly detector uses machine + /// learning algorithms to scan log events and find patterns. A pattern + /// is a shared text structure that recurs among your log fields. Patterns + /// provide a useful tool for analyzing large sets of logs because a large + /// number of log events can often be compressed into a few patterns. + /// + /// The anomaly detector uses pattern recognition to find + /// anomalies, which are unusual log events. It uses the + /// evaluationFrequency to compare current log events and + /// patterns with trained baselines. + /// + /// Fields within a pattern are called tokens. Fields that vary within + /// a pattern, such as a request ID or timestamp, are referred to as + /// dynamic tokens and represented by <*>. + /// + /// The following is an example of a pattern: + /// + /// [INFO] Request time: <*> ms + /// + /// This pattern represents log events like [INFO] Request time: 327 + /// ms and other similar log events that differ only by the number, in + /// this csse 327. When the pattern is displayed, the different numbers are + /// replaced by <*> + /// + /// Any parts of log events that are masked as sensitive data are not scanned + /// for anomalies. For more information about masking sensitive data, see Help + /// protect sensitive log data with masking. + /// + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// May throw [LimitExceededException]. + /// + /// Parameter [logGroupArnList] : + /// An array containing the ARN of the log group that this anomaly detector + /// will watch. You can specify only one log group ARN. + /// + /// Parameter [anomalyVisibilityTime] : + /// The number of days to have visibility on an anomaly. After this time + /// period has elapsed for an anomaly, it will be automatically baselined and + /// the anomaly detector will treat new occurrences of a similar anomaly as + /// normal. Therefore, if you do not correct the cause of an anomaly during + /// the time period specified in anomalyVisibilityTime, it will + /// be considered normal going forward and will not be detected as an anomaly. + /// + /// Parameter [detectorName] : + /// A name for this anomaly detector. + /// + /// Parameter [evaluationFrequency] : + /// Specifies how often the anomaly detector is to run and look for anomalies. + /// Set this value according to the frequency that the log group receives new + /// logs. For example, if the log group receives new log events every 10 + /// minutes, then 15 minutes might be a good setting for + /// evaluationFrequency . + /// + /// Parameter [filterPattern] : + /// You can use this parameter to limit the anomaly detection model to examine + /// only log events that match the pattern you specify here. For more + /// information, see Filter + /// and Pattern Syntax. + /// + /// Parameter [kmsKeyId] : + /// Optionally assigns a KMS key to secure this anomaly detector and its + /// findings. If a key is assigned, the anomalies found and the model used by + /// this detector are encrypted at rest with the key. If a key is assigned to + /// an anomaly detector, a user must have permissions for both this key and + /// for the anomaly detector to retrieve information about the anomalies that + /// it finds. + /// + /// For more information about using a KMS key and to see the required IAM + /// policy, see Use + /// a KMS key with an anomaly detector. + /// + /// Parameter [tags] : + /// An optional list of key-value pairs to associate with the resource. + /// + /// For more information about tagging, see Tagging + /// Amazon Web Services resources + Future createLogAnomalyDetector({ + required List logGroupArnList, + int? anomalyVisibilityTime, + String? detectorName, + EvaluationFrequency? evaluationFrequency, + String? filterPattern, + String? kmsKeyId, + Map? tags, + }) async { + _s.validateNumRange( + 'anomalyVisibilityTime', + anomalyVisibilityTime, + 7, + 90, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.CreateLogAnomalyDetector' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logGroupArnList': logGroupArnList, + if (anomalyVisibilityTime != null) + 'anomalyVisibilityTime': anomalyVisibilityTime, + if (detectorName != null) 'detectorName': detectorName, + if (evaluationFrequency != null) + 'evaluationFrequency': evaluationFrequency.toValue(), + if (filterPattern != null) 'filterPattern': filterPattern, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (tags != null) 'tags': tags, + }, + ); + + return CreateLogAnomalyDetectorResponse.fromJson(jsonResponse.body); + } + + /// Creates a log group with the specified name. You can create up to + /// 1,000,000 log groups per Region per account. /// /// You must use the following guidelines when naming a log group: /// @@ -304,6 +600,9 @@ class CloudWatchLogs { /// (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '#' /// (number sign) /// + ///
  • + /// Log group names can't start with the string aws/ + ///
  • /// /// When you create a log group, by default the log events in the log group do /// not expire. To set a retention policy so that events expire and are @@ -315,8 +614,8 @@ class CloudWatchLogs { /// encrypted with the KMS key is still within CloudWatch Logs. This enables /// CloudWatch Logs to decrypt this data whenever it is requested. /// - /// If you attempt to associate a KMS key with the log group but the KMS - /// keydoes not exist or the KMS key is disabled, you receive an + /// If you attempt to associate a KMS key with the log group but the KMS key + /// does not exist or the KMS key is disabled, you receive an /// InvalidParameterException error. /// /// CloudWatch Logs supports only symmetric KMS keys. Do not associate an @@ -332,7 +631,7 @@ class CloudWatchLogs { /// May throw [ServiceUnavailableException]. /// /// Parameter [logGroupName] : - /// The name of the log group. + /// A name for the log group. /// /// Parameter [kmsKeyId] : /// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log @@ -340,6 +639,28 @@ class CloudWatchLogs { /// href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms">Amazon /// Resource Names. /// + /// Parameter [logGroupClass] : + /// Use this parameter to specify the log group class for this log group. + /// There are two classes: + /// + ///
      + ///
    • + /// The Standard log class supports all CloudWatch Logs features. + ///
    • + ///
    • + /// The Infrequent Access log class supports a subset of + /// CloudWatch Logs features and incurs lower costs. + ///
    • + ///
    + /// If you omit this parameter, the default of STANDARD is used. + /// + /// The value of logGroupClass can't be changed after a log group + /// is created. + /// + /// For details about the features supported by each class, see Log + /// classes + /// /// Parameter [tags] : /// The key-value pairs to use for the tags. /// @@ -357,6 +678,7 @@ class CloudWatchLogs { Future createLogGroup({ required String logGroupName, String? kmsKeyId, + LogGroupClass? logGroupClass, Map? tags, }) async { final headers = { @@ -372,6 +694,7 @@ class CloudWatchLogs { payload: { 'logGroupName': logGroupName, if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (logGroupClass != null) 'logGroupClass': logGroupClass.toValue(), if (tags != null) 'tags': tags, }, ); @@ -430,25 +753,43 @@ class CloudWatchLogs { ); } - /// Deletes the data protection policy from the specified log group. + /// Deletes a CloudWatch Logs account policy. This stops the policy from + /// applying to all log groups or a subset of log groups in the account. + /// Log-group level policies will still be in effect. /// - /// For more information about data protection policies, see PutDataProtectionPolicy. + /// To use this operation, you must be signed on with the correct permissions + /// depending on the type of policy that you are deleting. + /// + ///
      + ///
    • + /// To delete a data protection policy, you must have the + /// logs:DeleteDataProtectionPolicy and + /// logs:DeleteAccountPolicy permissions. + ///
    • + ///
    • + /// To delete a subscription filter policy, you must have the + /// logs:DeleteSubscriptionFilter and + /// logs:DeleteAccountPolicy permissions. + ///
    • + ///
    /// /// May throw [InvalidParameterException]. - /// May throw [OperationAbortedException]. /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. /// - /// Parameter [logGroupIdentifier] : - /// The name or ARN of the log group that you want to delete the data - /// protection policy for. - Future deleteDataProtectionPolicy({ - required String logGroupIdentifier, + /// Parameter [policyName] : + /// The name of the policy to delete. + /// + /// Parameter [policyType] : + /// The type of policy to delete. + Future deleteAccountPolicy({ + required String policyName, + required PolicyType policyType, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteDataProtectionPolicy' + 'X-Amz-Target': 'Logs_20140328.DeleteAccountPolicy' }; await _protocol.send( method: 'POST', @@ -457,28 +798,31 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'logGroupIdentifier': logGroupIdentifier, + 'policyName': policyName, + 'policyType': policyType.toValue(), }, ); } - /// Deletes the specified destination, and eventually disables all the - /// subscription filters that publish to it. This operation does not delete - /// the physical resource encapsulated by the destination. + /// Deletes the data protection policy from the specified log group. + /// + /// For more information about data protection policies, see PutDataProtectionPolicy. /// /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. /// May throw [OperationAbortedException]. + /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. /// - /// Parameter [destinationName] : - /// The name of the destination. - Future deleteDestination({ - required String destinationName, + /// Parameter [logGroupIdentifier] : + /// The name or ARN of the log group that you want to delete the data + /// protection policy for. + Future deleteDataProtectionPolicy({ + required String logGroupIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteDestination' + 'X-Amz-Target': 'Logs_20140328.DeleteDataProtectionPolicy' }; await _protocol.send( method: 'POST', @@ -487,27 +831,35 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'destinationName': destinationName, + 'logGroupIdentifier': logGroupIdentifier, }, ); } - /// Deletes the specified log group and permanently deletes all the archived - /// log events associated with the log group. + /// Deletes s delivery. A delivery is a connection between a logical + /// delivery source and a logical delivery destination. Deleting + /// a delivery only deletes the connection between the delivery source and + /// delivery destination. It does not delete the delivery destination or the + /// delivery source. /// - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [OperationAbortedException]. /// May throw [ServiceUnavailableException]. - /// - /// Parameter [logGroupName] : - /// The name of the log group. - Future deleteLogGroup({ - required String logGroupName, + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [id] : + /// The unique ID of the delivery to delete. You can find the ID of a delivery + /// with the DescribeDeliveries + /// operation. + Future deleteDelivery({ + required String id, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteLogGroup' + 'X-Amz-Target': 'Logs_20140328.DeleteDelivery' }; await _protocol.send( method: 'POST', @@ -516,31 +868,40 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'logGroupName': logGroupName, + 'id': id, }, ); } - /// Deletes the specified log stream and permanently deletes all the archived - /// log events associated with the log stream. + /// Deletes a delivery destination. A delivery is a connection between + /// a logical delivery source and a logical delivery + /// destination. + /// + /// You can't delete a delivery destination if any current deliveries are + /// associated with it. To find whether any deliveries are associated with + /// this delivery destination, use the DescribeDeliveries + /// operation and check the deliveryDestinationArn field in the + /// results. /// - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [OperationAbortedException]. /// May throw [ServiceUnavailableException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. /// - /// Parameter [logGroupName] : - /// The name of the log group. - /// - /// Parameter [logStreamName] : - /// The name of the log stream. - Future deleteLogStream({ - required String logGroupName, - required String logStreamName, + /// Parameter [name] : + /// The name of the delivery destination that you want to delete. You can find + /// a list of delivery destionation names by using the DescribeDeliveryDestinations + /// operation. + Future deleteDeliveryDestination({ + required String name, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteLogStream' + 'X-Amz-Target': 'Logs_20140328.DeleteDeliveryDestination' }; await _protocol.send( method: 'POST', @@ -549,31 +910,29 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'logGroupName': logGroupName, - 'logStreamName': logStreamName, + 'name': name, }, ); } - /// Deletes the specified metric filter. + /// Deletes a delivery destination policy. For more information about these + /// policies, see PutDeliveryDestinationPolicy. /// - /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. - /// May throw [OperationAbortedException]. /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. /// - /// Parameter [filterName] : - /// The name of the metric filter. - /// - /// Parameter [logGroupName] : - /// The name of the log group. - Future deleteMetricFilter({ - required String filterName, - required String logGroupName, + /// Parameter [deliveryDestinationName] : + /// The name of the delivery destination that you want to delete the policy + /// for. + Future deleteDeliveryDestinationPolicy({ + required String deliveryDestinationName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteMetricFilter' + 'X-Amz-Target': 'Logs_20140328.DeleteDeliveryDestinationPolicy' }; await _protocol.send( method: 'POST', @@ -582,48 +941,242 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'filterName': filterName, - 'logGroupName': logGroupName, + 'deliveryDestinationName': deliveryDestinationName, }, ); } - /// Deletes a saved CloudWatch Logs Insights query definition. A query - /// definition contains details about a saved CloudWatch Logs Insights query. - /// - /// Each DeleteQueryDefinition operation can delete one query - /// definition. + /// Deletes a delivery source. A delivery is a connection between a + /// logical delivery source and a logical delivery destination. /// - /// You must have the logs:DeleteQueryDefinition permission to be - /// able to perform this operation. + /// You can't delete a delivery source if any current deliveries are + /// associated with it. To find whether any deliveries are associated with + /// this delivery source, use the DescribeDeliveries + /// operation and check the deliverySourceName field in the + /// results. /// - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. /// - /// Parameter [queryDefinitionId] : - /// The ID of the query definition that you want to delete. You can use DescribeQueryDefinitions - /// to retrieve the IDs of your saved query definitions. - Future deleteQueryDefinition({ - required String queryDefinitionId, + /// Parameter [name] : + /// The name of the delivery source that you want to delete. + Future deleteDeliverySource({ + required String name, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DeleteQueryDefinition' + 'X-Amz-Target': 'Logs_20140328.DeleteDeliverySource' }; - final jsonResponse = await _protocol.send( + await _protocol.send( method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, payload: { - 'queryDefinitionId': queryDefinitionId, + 'name': name, }, ); - - return DeleteQueryDefinitionResponse.fromJson(jsonResponse.body); + } + + /// Deletes the specified destination, and eventually disables all the + /// subscription filters that publish to it. This operation does not delete + /// the physical resource encapsulated by the destination. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [OperationAbortedException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [destinationName] : + /// The name of the destination. + Future deleteDestination({ + required String destinationName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteDestination' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'destinationName': destinationName, + }, + ); + } + + /// Deletes the specified CloudWatch Logs anomaly detector. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [anomalyDetectorArn] : + /// The ARN of the anomaly detector to delete. You can find the ARNs of log + /// anomaly detectors in your account by using the ListLogAnomalyDetectors + /// operation. + Future deleteLogAnomalyDetector({ + required String anomalyDetectorArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteLogAnomalyDetector' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'anomalyDetectorArn': anomalyDetectorArn, + }, + ); + } + + /// Deletes the specified log group and permanently deletes all the archived + /// log events associated with the log group. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [OperationAbortedException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [logGroupName] : + /// The name of the log group. + Future deleteLogGroup({ + required String logGroupName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteLogGroup' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logGroupName': logGroupName, + }, + ); + } + + /// Deletes the specified log stream and permanently deletes all the archived + /// log events associated with the log stream. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [OperationAbortedException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [logGroupName] : + /// The name of the log group. + /// + /// Parameter [logStreamName] : + /// The name of the log stream. + Future deleteLogStream({ + required String logGroupName, + required String logStreamName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteLogStream' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logGroupName': logGroupName, + 'logStreamName': logStreamName, + }, + ); + } + + /// Deletes the specified metric filter. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [OperationAbortedException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [filterName] : + /// The name of the metric filter. + /// + /// Parameter [logGroupName] : + /// The name of the log group. + Future deleteMetricFilter({ + required String filterName, + required String logGroupName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteMetricFilter' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'filterName': filterName, + 'logGroupName': logGroupName, + }, + ); + } + + /// Deletes a saved CloudWatch Logs Insights query definition. A query + /// definition contains details about a saved CloudWatch Logs Insights query. + /// + /// Each DeleteQueryDefinition operation can delete one query + /// definition. + /// + /// You must have the logs:DeleteQueryDefinition permission to be + /// able to perform this operation. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [queryDefinitionId] : + /// The ID of the query definition that you want to delete. You can use DescribeQueryDefinitions + /// to retrieve the IDs of your saved query definitions. + Future deleteQueryDefinition({ + required String queryDefinitionId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DeleteQueryDefinition' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'queryDefinitionId': queryDefinitionId, + }, + ); + + return DeleteQueryDefinitionResponse.fromJson(jsonResponse.body); } /// Deletes a resource policy from this account. This revokes the access of @@ -718,25 +1271,81 @@ class CloudWatchLogs { ); } - /// Lists all your destinations. The results are ASCII-sorted by destination - /// name. + /// Returns a list of all CloudWatch Logs account policies in the account. /// /// May throw [InvalidParameterException]. + /// May throw [OperationAbortedException]. + /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. /// - /// Parameter [destinationNamePrefix] : - /// The prefix to match. If you don't specify a value, no prefix filter is - /// applied. + /// Parameter [policyType] : + /// Use this parameter to limit the returned policies to only the policies + /// that match the policy type that you specify. /// - /// Parameter [limit] : - /// The maximum number of items returned. If you don't specify a value, the - /// default maximum value of 50 items is used. + /// Parameter [accountIdentifiers] : + /// If you are using an account that is set up as a monitoring account for + /// CloudWatch unified cross-account observability, you can use this to + /// specify the account ID of a source account. If you do, the operation + /// returns the account policy for the specified account. Currently, you can + /// specify only one account ID in this parameter. /// - /// Parameter [nextToken] : - /// The token for the next set of items to return. (You received this token - /// from a previous call.) - Future describeDestinations({ - String? destinationNamePrefix, + /// If you omit this parameter, only the policy in the current account is + /// returned. + /// + /// Parameter [policyName] : + /// Use this parameter to limit the returned policies to only the policy with + /// the name that you specify. + Future describeAccountPolicies({ + required PolicyType policyType, + List? accountIdentifiers, + String? policyName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeAccountPolicies' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'policyType': policyType.toValue(), + if (accountIdentifiers != null) + 'accountIdentifiers': accountIdentifiers, + if (policyName != null) 'policyName': policyName, + }, + ); + + return DescribeAccountPoliciesResponse.fromJson(jsonResponse.body); + } + + /// Retrieves a list of the deliveries that have been created in the account. + /// + /// A delivery is a connection between a + /// delivery source and a + /// delivery destination . + /// + /// A delivery source represents an Amazon Web Services resource that sends + /// logs to an logs delivery destination. The destination can be CloudWatch + /// Logs, Amazon S3, or Firehose. Only some Amazon Web Services services + /// support being configured as a delivery source. These services are listed + /// in Enable + /// logging from Amazon Web Services services. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [limit] : + /// Optionally specify the maximum number of deliveries to return in the + /// response. + Future describeDeliveries({ int? limit, String? nextToken, }) async { @@ -748,7 +1357,7 @@ class CloudWatchLogs { ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DescribeDestinations' + 'X-Amz-Target': 'Logs_20140328.DescribeDeliveries' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -757,42 +1366,28 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - if (destinationNamePrefix != null) - 'DestinationNamePrefix': destinationNamePrefix, if (limit != null) 'limit': limit, if (nextToken != null) 'nextToken': nextToken, }, ); - return DescribeDestinationsResponse.fromJson(jsonResponse.body); + return DescribeDeliveriesResponse.fromJson(jsonResponse.body); } - /// Lists the specified export tasks. You can list all your export tasks or - /// filter the results based on task ID or task status. + /// Retrieves a list of the delivery destinations that have been created in + /// the account. /// - /// May throw [InvalidParameterException]. /// May throw [ServiceUnavailableException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. /// /// Parameter [limit] : - /// The maximum number of items returned. If you don't specify a value, the - /// default is up to 50 items. - /// - /// Parameter [nextToken] : - /// The token for the next set of items to return. (You received this token - /// from a previous call.) - /// - /// Parameter [statusCode] : - /// The status code of the export task. Specifying a status code filters the - /// results to zero or more export tasks. - /// - /// Parameter [taskId] : - /// The ID of the export task. Specifying a task ID filters the results to one - /// or zero export tasks. - Future describeExportTasks({ + /// Optionally specify the maximum number of delivery destinations to return + /// in the response. + Future describeDeliveryDestinations({ int? limit, String? nextToken, - ExportTaskStatusCode? statusCode, - String? taskId, }) async { _s.validateNumRange( 'limit', @@ -802,7 +1397,148 @@ class CloudWatchLogs { ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.DescribeExportTasks' + 'X-Amz-Target': 'Logs_20140328.DescribeDeliveryDestinations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (limit != null) 'limit': limit, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return DescribeDeliveryDestinationsResponse.fromJson(jsonResponse.body); + } + + /// Retrieves a list of the delivery sources that have been created in the + /// account. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [limit] : + /// Optionally specify the maximum number of delivery sources to return in the + /// response. + Future describeDeliverySources({ + int? limit, + String? nextToken, + }) async { + _s.validateNumRange( + 'limit', + limit, + 1, + 50, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeDeliverySources' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (limit != null) 'limit': limit, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return DescribeDeliverySourcesResponse.fromJson(jsonResponse.body); + } + + /// Lists all your destinations. The results are ASCII-sorted by destination + /// name. + /// + /// May throw [InvalidParameterException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [destinationNamePrefix] : + /// The prefix to match. If you don't specify a value, no prefix filter is + /// applied. + /// + /// Parameter [limit] : + /// The maximum number of items returned. If you don't specify a value, the + /// default maximum value of 50 items is used. + /// + /// Parameter [nextToken] : + /// The token for the next set of items to return. (You received this token + /// from a previous call.) + Future describeDestinations({ + String? destinationNamePrefix, + int? limit, + String? nextToken, + }) async { + _s.validateNumRange( + 'limit', + limit, + 1, + 50, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeDestinations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (destinationNamePrefix != null) + 'DestinationNamePrefix': destinationNamePrefix, + if (limit != null) 'limit': limit, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return DescribeDestinationsResponse.fromJson(jsonResponse.body); + } + + /// Lists the specified export tasks. You can list all your export tasks or + /// filter the results based on task ID or task status. + /// + /// May throw [InvalidParameterException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [limit] : + /// The maximum number of items returned. If you don't specify a value, the + /// default is up to 50 items. + /// + /// Parameter [nextToken] : + /// The token for the next set of items to return. (You received this token + /// from a previous call.) + /// + /// Parameter [statusCode] : + /// The status code of the export task. Specifying a status code filters the + /// results to zero or more export tasks. + /// + /// Parameter [taskId] : + /// The ID of the export task. Specifying a task ID filters the results to one + /// or zero export tasks. + Future describeExportTasks({ + int? limit, + String? nextToken, + ExportTaskStatusCode? statusCode, + String? taskId, + }) async { + _s.validateNumRange( + 'limit', + limit, + 1, + 50, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeExportTasks' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -856,16 +1592,27 @@ class CloudWatchLogs { /// accountIdentifiers contains a null value, the operation /// returns all log groups in the monitoring account and all log groups in all /// source accounts that are linked to the monitoring account. - /// - /// If you specify includeLinkedAccounts in your request, then - /// metricFilterCount, retentionInDays, and - /// storedBytes are not included in the response. - /// /// /// Parameter [limit] : /// The maximum number of items returned. If you don't specify a value, the /// default is up to 50 items. /// + /// Parameter [logGroupClass] : + /// Specifies the log group class for this log group. There are two classes: + /// + ///
      + ///
    • + /// The Standard log class supports all CloudWatch Logs features. + ///
    • + ///
    • + /// The Infrequent Access log class supports a subset of + /// CloudWatch Logs features and incurs lower costs. + ///
    • + ///
    + /// For details about the features supported by each class, see Log + /// classes + /// /// Parameter [logGroupNamePattern] : /// If you specify a string for this parameter, the operation returns only log /// groups that have names that match the string based on a case-sensitive @@ -873,6 +1620,10 @@ class CloudWatchLogs { /// named FooBar, aws/Foo, and GroupFoo /// would match, but foo, F/o/o and /// Froo would not match. + /// + /// If you specify logGroupNamePattern in your request, then only + /// arn, creationTime, and logGroupName + /// are included in the response. /// /// logGroupNamePattern and logGroupNamePrefix are /// mutually exclusive. Only one of these parameters can be passed. @@ -892,6 +1643,7 @@ class CloudWatchLogs { List? accountIdentifiers, bool? includeLinkedAccounts, int? limit, + LogGroupClass? logGroupClass, String? logGroupNamePattern, String? logGroupNamePrefix, String? nextToken, @@ -918,6 +1670,7 @@ class CloudWatchLogs { if (includeLinkedAccounts != null) 'includeLinkedAccounts': includeLinkedAccounts, if (limit != null) 'limit': limit, + if (logGroupClass != null) 'logGroupClass': logGroupClass.toValue(), if (logGroupNamePattern != null) 'logGroupNamePattern': logGroupNamePattern, if (logGroupNamePrefix != null) @@ -1164,7 +1917,9 @@ class CloudWatchLogs { } /// This operation returns a paginated list of your saved CloudWatch Logs - /// Insights query definitions. + /// Insights query definitions. You can retrieve query definitions from the + /// current account or from a source account that is linked to the current + /// account. /// /// You can use the queryDefinitionNamePrefix parameter to limit /// the results to only the query definitions that have names that start with @@ -1303,14 +2058,36 @@ class CloudWatchLogs { return DescribeSubscriptionFiltersResponse.fromJson(jsonResponse.body); } - /// Disassociates the associated KMS key from the specified log group. + /// Disassociates the specified KMS key from the specified log group or from + /// all CloudWatch Logs Insights query results in the account. /// - /// After the KMS key is disassociated from the log group, CloudWatch Logs - /// stops encrypting newly ingested data for the log group. All previously - /// ingested data remains encrypted, and CloudWatch Logs requires permissions - /// for the KMS key whenever the encrypted data is requested. + /// When you use DisassociateKmsKey, you specify either the + /// logGroupName parameter or the resourceIdentifier + /// parameter. You can't specify both of those parameters in the same + /// operation. /// - /// Note that it can take up to 5 minutes for this operation to take effect. + ///
      + ///
    • + /// Specify the logGroupName parameter to stop using the KMS key + /// to encrypt future log events ingested and stored in the log group. + /// Instead, they will be encrypted with the default CloudWatch Logs method. + /// The log events that were ingested while the key was associated with the + /// log group are still encrypted with that key. Therefore, CloudWatch Logs + /// will need permissions for the key whenever that data is accessed. + ///
    • + ///
    • + /// Specify the resourceIdentifier parameter with the + /// query-result resource to stop using the KMS key to encrypt + /// the results of all future StartQuery + /// operations in the account. They will instead be encrypted with the default + /// CloudWatch Logs method. The results from queries that ran while the key + /// was associated with the account are still encrypted with that key. + /// Therefore, CloudWatch Logs will need permissions for the key whenever that + /// data is accessed. + ///
    • + ///
    + /// It can take up to 5 minutes for this operation to take effect. /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1319,8 +2096,43 @@ class CloudWatchLogs { /// /// Parameter [logGroupName] : /// The name of the log group. + /// + /// In your DisassociateKmsKey operation, you must specify either + /// the resourceIdentifier parameter or the logGroup + /// parameter, but you can't specify both. + /// + /// Parameter [resourceIdentifier] : + /// Specifies the target for this operation. You must specify one of the + /// following: + /// + ///
      + ///
    • + /// Specify the ARN of a log group to stop having CloudWatch Logs use the KMS + /// key to encrypt log events that are ingested and stored by that log group. + /// After you run this operation, CloudWatch Logs encrypts ingested log events + /// with the default CloudWatch Logs method. The log group ARN must be in the + /// following format. Replace REGION and ACCOUNT_ID with your + /// Region and account ID. + /// + /// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME + /// + ///
    • + ///
    • + /// Specify the following ARN to stop using this key to encrypt the results of + /// future StartQuery + /// operations in this account. Replace REGION and ACCOUNT_ID + /// with your Region and account ID. + /// + /// arn:aws:logs:REGION:ACCOUNT_ID:query-result:* + ///
    • + ///
    + /// In your DisssociateKmsKey operation, you must specify either + /// the resourceIdentifier parameter or the logGroup + /// parameter, but you can't specify both. Future disassociateKmsKey({ - required String logGroupName, + String? logGroupName, + String? resourceIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1333,7 +2145,9 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'logGroupName': logGroupName, + if (logGroupName != null) 'logGroupName': logGroupName, + if (resourceIdentifier != null) + 'resourceIdentifier': resourceIdentifier, }, ); } @@ -1342,7 +2156,7 @@ class CloudWatchLogs { /// events or filter the results using a filter pattern, a time range, and the /// name of the log stream. /// - /// You must have the logs;FilterLogEvents permission to perform + /// You must have the logs:FilterLogEvents permission to perform /// this operation. /// /// You can specify the log group to search by using either @@ -1536,48 +2350,225 @@ class CloudWatchLogs { return GetDataProtectionPolicyResponse.fromJson(jsonResponse.body); } - /// Lists log events from the specified log stream. You can list all of the - /// log events or filter using a time range. - /// - /// By default, this operation returns as many log events as can fit in a - /// response size of 1MB (up to 10,000 log events). You can get additional log - /// events by specifying one of the tokens in a subsequent call. This - /// operation can return empty results while there are more log events - /// available through the token. - /// - /// If you are using CloudWatch cross-account observability, you can use this - /// operation in a monitoring account and view data from the linked source - /// accounts. For more information, see CloudWatch - /// cross-account observability. + /// Returns complete information about one logical delivery. A delivery + /// is a connection between a + /// delivery source and a + /// delivery destination . + /// + /// A delivery source represents an Amazon Web Services resource that sends + /// logs to an logs delivery destination. The destination can be CloudWatch + /// Logs, Amazon S3, or Firehose. Only some Amazon Web Services services + /// support being configured as a delivery source. These services are listed + /// in Enable + /// logging from Amazon Web Services services. + /// + /// You need to specify the delivery id in this operation. You + /// can find the IDs of the deliveries in your account with the DescribeDeliveries + /// operation. /// - /// You can specify the log group to search by using either - /// logGroupIdentifier or logGroupName. You must - /// include one of these two parameters, but you can't include both. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [id] : + /// The ID of the delivery that you want to retrieve. + Future getDelivery({ + required String id, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.GetDelivery' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'id': id, + }, + ); + + return GetDeliveryResponse.fromJson(jsonResponse.body); + } + + /// Retrieves complete information about one delivery destination. /// - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. /// - /// Parameter [logStreamName] : - /// The name of the log stream. + /// Parameter [name] : + /// The name of the delivery destination that you want to retrieve. + Future getDeliveryDestination({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.GetDeliveryDestination' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'name': name, + }, + ); + + return GetDeliveryDestinationResponse.fromJson(jsonResponse.body); + } + + /// Retrieves the delivery destination policy assigned to the delivery + /// destination that you specify. For more information about delivery + /// destinations and their policies, see PutDeliveryDestinationPolicy. /// - /// Parameter [endTime] : - /// The end of the time range, expressed as the number of milliseconds after - /// Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to or - /// later than this time are not included. + /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. /// - /// Parameter [limit] : - /// The maximum number of log events returned. If you don't specify a limit, - /// the default is as many log events as can fit in a response size of 1 MB - /// (up to 10,000 log events). + /// Parameter [deliveryDestinationName] : + /// The name of the delivery destination that you want to retrieve the policy + /// of. + Future getDeliveryDestinationPolicy({ + required String deliveryDestinationName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.GetDeliveryDestinationPolicy' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'deliveryDestinationName': deliveryDestinationName, + }, + ); + + return GetDeliveryDestinationPolicyResponse.fromJson(jsonResponse.body); + } + + /// Retrieves complete information about one delivery source. /// - /// Parameter [logGroupIdentifier] : - /// Specify either the name or ARN of the log group to view events from. If - /// the log group is in a source account and you are using a monitoring - /// account, you must use the log group ARN. - /// - /// You must include either logGroupIdentifier or + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [name] : + /// The name of the delivery source that you want to retrieve. + Future getDeliverySource({ + required String name, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.GetDeliverySource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'name': name, + }, + ); + + return GetDeliverySourceResponse.fromJson(jsonResponse.body); + } + + /// Retrieves information about the log anomaly detector that you specify. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [anomalyDetectorArn] : + /// The ARN of the anomaly detector to retrieve information about. You can + /// find the ARNs of log anomaly detectors in your account by using the ListLogAnomalyDetectors + /// operation. + Future getLogAnomalyDetector({ + required String anomalyDetectorArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.GetLogAnomalyDetector' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'anomalyDetectorArn': anomalyDetectorArn, + }, + ); + + return GetLogAnomalyDetectorResponse.fromJson(jsonResponse.body); + } + + /// Lists log events from the specified log stream. You can list all of the + /// log events or filter using a time range. + /// + /// By default, this operation returns as many log events as can fit in a + /// response size of 1MB (up to 10,000 log events). You can get additional log + /// events by specifying one of the tokens in a subsequent call. This + /// operation can return empty results while there are more log events + /// available through the token. + /// + /// If you are using CloudWatch cross-account observability, you can use this + /// operation in a monitoring account and view data from the linked source + /// accounts. For more information, see CloudWatch + /// cross-account observability. + /// + /// You can specify the log group to search by using either + /// logGroupIdentifier or logGroupName. You must + /// include one of these two parameters, but you can't include both. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [logStreamName] : + /// The name of the log stream. + /// + /// Parameter [endTime] : + /// The end of the time range, expressed as the number of milliseconds after + /// Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to or + /// later than this time are not included. + /// + /// Parameter [limit] : + /// The maximum number of log events returned. If you don't specify a limit, + /// the default is as many log events as can fit in a response size of 1 MB + /// (up to 10,000 log events). + /// + /// Parameter [logGroupIdentifier] : + /// Specify either the name or ARN of the log group to view events from. If + /// the log group is in a source account and you are using a monitoring + /// account, you must use the log group ARN. + /// + /// You must include either logGroupIdentifier or /// logGroupName, but not both. /// /// @@ -1716,9 +2707,9 @@ class CloudWatchLogs { /// /// Parameter [time] : /// The time to set as the center of the query. If you specify - /// time, the 15 minutes before this time are queries. If you - /// omit time, the 8 minutes before and 8 minutes after this time - /// are searched. + /// time, the 8 minutes before and 8 minutes after this time are + /// searched. If you omit time, the most recent 15 minutes up to + /// the current time are searched. /// /// The time value is specified as epoch time, which is the /// number of seconds since January 1, 1970, 00:00:00 UTC. @@ -1813,6 +2804,10 @@ class CloudWatchLogs { /// GetQueryResults does not start running a query. To run a /// query, use StartQuery. + /// For more information about how long results of previous queries are + /// available, see CloudWatch + /// Logs quotas. /// /// If the value of the Status field in the output is /// Running, this operation returns only partial results. If you @@ -1852,6 +2847,106 @@ class CloudWatchLogs { return GetQueryResultsResponse.fromJson(jsonResponse.body); } + /// Returns a list of anomalies that log anomaly detectors have found. For + /// details about the structure format of each anomaly object that is + /// returned, see the example in this section. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [anomalyDetectorArn] : + /// Use this to optionally limit the results to only the anomalies found by a + /// certain anomaly detector. + /// + /// Parameter [limit] : + /// The maximum number of items to return. If you don't specify a value, the + /// default maximum value of 50 items is used. + /// + /// Parameter [suppressionState] : + /// You can specify this parameter if you want to the operation to return only + /// anomalies that are currently either suppressed or unsuppressed. + Future listAnomalies({ + String? anomalyDetectorArn, + int? limit, + String? nextToken, + SuppressionState? suppressionState, + }) async { + _s.validateNumRange( + 'limit', + limit, + 1, + 50, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.ListAnomalies' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (anomalyDetectorArn != null) + 'anomalyDetectorArn': anomalyDetectorArn, + if (limit != null) 'limit': limit, + if (nextToken != null) 'nextToken': nextToken, + if (suppressionState != null) + 'suppressionState': suppressionState.toValue(), + }, + ); + + return ListAnomaliesResponse.fromJson(jsonResponse.body); + } + + /// Retrieves a list of the log anomaly detectors in the account. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [filterLogGroupArn] : + /// Use this to optionally filter the results to only include anomaly + /// detectors that are associated with the specified log group. + /// + /// Parameter [limit] : + /// The maximum number of items to return. If you don't specify a value, the + /// default maximum value of 50 items is used. + Future listLogAnomalyDetectors({ + String? filterLogGroupArn, + int? limit, + String? nextToken, + }) async { + _s.validateNumRange( + 'limit', + limit, + 1, + 50, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.ListLogAnomalyDetectors' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filterLogGroupArn != null) 'filterLogGroupArn': filterLogGroupArn, + if (limit != null) 'limit': limit, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListLogAnomalyDetectorsResponse.fromJson(jsonResponse.body); + } + /// Displays the tags associated with a CloudWatch Logs resource. Currently, /// log groups and destinations support tagging. /// @@ -1929,14 +3024,27 @@ class CloudWatchLogs { return ListTagsLogGroupResponse.fromJson(jsonResponse.body); } - /// Creates a data protection policy for the specified log group. A data - /// protection policy can help safeguard sensitive data that's ingested by the - /// log group by auditing and masking the sensitive log data. + /// Creates an account-level data protection policy or subscription filter + /// policy that applies to all log groups or a subset of log groups in the + /// account. + /// + /// Data protection policy + /// + /// A data protection policy can help safeguard sensitive data that's ingested + /// by your log groups by auditing and masking the sensitive log data. Each + /// account can have only one account-level data protection policy. /// - /// Sensitive data is detected and masked when it is ingested into the log + /// Sensitive data is detected and masked when it is ingested into a log /// group. When you set a data protection policy, log events ingested into the - /// log group before that time are not masked. + /// log groups before that time are not masked. /// + /// If you use PutAccountPolicy to create a data protection + /// policy for your whole account, it applies to both existing log groups and + /// all log groups that are created later in this account. The account-level + /// policy is applied to existing log groups with eventual consistency. It + /// might take up to 5 minutes before sensitive data in existing log groups + /// begins to be masked. + /// /// By default, when a user views a log event that includes masked data, the /// sensitive data is replaced by asterisks. A user who has the /// logs:Unmask permission can use a Protect /// sensitive log data with masking. /// + /// To use the PutAccountPolicy operation for a data protection + /// policy, you must be signed on with the + /// logs:PutDataProtectionPolicy and + /// logs:PutAccountPolicy permissions. + /// + /// The PutAccountPolicy operation applies to all log groups in + /// the account. You can use PutDataProtectionPolicy + /// to create a data protection policy that applies to just one log group. If + /// a log group has its own data protection policy and the account also has an + /// account-level data protection policy, then the two policies are + /// cumulative. Any sensitive term specified in either policy is masked. + /// + /// Subscription filter policy + /// + /// A subscription filter policy sets up a real-time feed of log events from + /// CloudWatch Logs to other Amazon Web Services services. Account-level + /// subscription filter policies apply to both existing log groups and log + /// groups that are created later in this account. Supported destinations are + /// Kinesis Data Streams, Firehose, and Lambda. When log events are sent to + /// the receiving service, they are Base64 encoded and compressed with the + /// GZIP format. + /// + /// The following destinations are supported for subscription filters: + /// + ///
      + ///
    • + /// An Kinesis Data Streams data stream in the same account as the + /// subscription policy, for same-account delivery. + ///
    • + ///
    • + /// An Firehose data stream in the same account as the subscription policy, + /// for same-account delivery. + ///
    • + ///
    • + /// A Lambda function in the same account as the subscription policy, for + /// same-account delivery. + ///
    • + ///
    • + /// A logical destination in a different account created with PutDestination, + /// for cross-account delivery. Kinesis Data Streams and Firehose are + /// supported as logical destinations. + ///
    • + ///
    + /// Each account can have one account-level subscription filter policy. If you + /// are updating an existing filter, you must specify the correct name in + /// PolicyName. To perform a PutAccountPolicy + /// subscription filter operation for any destination except a Lambda + /// function, you must also have the iam:PassRole permission. + /// /// May throw [InvalidParameterException]. - /// May throw [LimitExceededException]. /// May throw [OperationAbortedException]. - /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. - /// - /// Parameter [logGroupIdentifier] : - /// Specify either the log group name or log group ARN. + /// May throw [LimitExceededException]. /// /// Parameter [policyDocument] : - /// Specify the data protection policy, in JSON. + /// Specify the policy, in JSON. /// - /// This policy must include two JSON blocks: + /// Data protection policy + /// + /// A data protection policy must include two JSON blocks: /// ///
      ///
    • @@ -1981,8 +3138,7 @@ class CloudWatchLogs { /// must contain a FindingsDestination object. You can optionally /// use that FindingsDestination object to list one or more /// destinations to send audit findings to. If you specify destinations such - /// as log groups, Kinesis Data Firehose streams, and S3 buckets, they must - /// already exist. + /// as log groups, Firehose streams, and S3 buckets, they must already exist. ///
    • ///
    • /// The second block must include both a DataIdentifer array and @@ -1999,15 +3155,103 @@ class CloudWatchLogs { /// For an example data protection policy, see the Examples section on /// this page. /// - /// The contents of two DataIdentifer arrays must match exactly. + /// The contents of the two DataIdentifer arrays must match + /// exactly. /// - Future putDataProtectionPolicy({ - required String logGroupIdentifier, + /// In addition to the two JSON blocks, the policyDocument can + /// also include Name, Description, and + /// Version fields. The Name is different than the + /// operation's policyName parameter, and is used as a dimension + /// when CloudWatch Logs reports audit findings metrics to CloudWatch. + /// + /// The JSON specified in policyDocument can be up to 30,720 + /// characters long. + /// + /// Subscription filter policy + /// + /// A subscription filter policy can include the following attributes in a + /// JSON block: + /// + ///
        + ///
      • + /// DestinationArn The ARN of the destination to deliver log events to. + /// Supported destinations are: + /// + ///
          + ///
        • + /// An Kinesis Data Streams data stream in the same account as the + /// subscription policy, for same-account delivery. + ///
        • + ///
        • + /// An Firehose data stream in the same account as the subscription policy, + /// for same-account delivery. + ///
        • + ///
        • + /// A Lambda function in the same account as the subscription policy, for + /// same-account delivery. + ///
        • + ///
        • + /// A logical destination in a different account created with PutDestination, + /// for cross-account delivery. Kinesis Data Streams and Firehose are + /// supported as logical destinations. + ///
        • + ///
      • + ///
      • + /// RoleArn The ARN of an IAM role that grants CloudWatch Logs + /// permissions to deliver ingested log events to the destination stream. You + /// don't need to provide the ARN when you are working with a logical + /// destination for cross-account delivery. + ///
      • + ///
      • + /// FilterPattern A filter pattern for subscribing to a filtered stream + /// of log events. + ///
      • + ///
      • + /// DistributionThe method used to distribute log data to the + /// destination. By default, log data is grouped by log stream, but the + /// grouping can be set to Random for a more even distribution. + /// This property is only applicable when the destination is an Kinesis Data + /// Streams data stream. + ///
      • + ///
      + /// + /// Parameter [policyName] : + /// A name for the policy. This must be unique within the account. + /// + /// Parameter [policyType] : + /// The type of policy that you're creating or updating. + /// + /// Parameter [scope] : + /// Currently the only valid value for this parameter is ALL, + /// which specifies that the data protection policy applies to all log groups + /// in the account. If you omit this parameter, the default of + /// ALL is used. + /// + /// Parameter [selectionCriteria] : + /// Use this parameter to apply the subscription filter policy to a subset of + /// log groups in the account. Currently, the only supported filter is + /// LogGroupName NOT IN []. The selectionCriteria + /// string can be up to 25KB in length. The length is determined by using its + /// UTF-8 bytes. + /// + /// Using the selectionCriteria parameter is useful to help + /// prevent infinite loops. For more information, see Log + /// recursion prevention. + /// + /// Specifing selectionCriteria is valid only when you specify + /// SUBSCRIPTION_FILTER_POLICY for policyType. + Future putAccountPolicy({ required String policyDocument, + required String policyName, + required PolicyType policyType, + Scope? scope, + String? selectionCriteria, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'Logs_20140328.PutDataProtectionPolicy' + 'X-Amz-Target': 'Logs_20140328.PutAccountPolicy' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2016,30 +3260,429 @@ class CloudWatchLogs { // TODO queryParams headers: headers, payload: { - 'logGroupIdentifier': logGroupIdentifier, 'policyDocument': policyDocument, + 'policyName': policyName, + 'policyType': policyType.toValue(), + if (scope != null) 'scope': scope.toValue(), + if (selectionCriteria != null) 'selectionCriteria': selectionCriteria, }, ); - return PutDataProtectionPolicyResponse.fromJson(jsonResponse.body); + return PutAccountPolicyResponse.fromJson(jsonResponse.body); } - /// Creates or updates a destination. This operation is used only to create - /// destinations for cross-account subscriptions. + /// Creates a data protection policy for the specified log group. A data + /// protection policy can help safeguard sensitive data that's ingested by the + /// log group by auditing and masking the sensitive log data. + /// + /// Sensitive data is detected and masked when it is ingested into the log + /// group. When you set a data protection policy, log events ingested into the + /// log group before that time are not masked. + /// + /// By default, when a user views a log event that includes masked data, the + /// sensitive data is replaced by asterisks. A user who has the + /// logs:Unmask permission can use a GetLogEvents + /// or FilterLogEvents + /// operation with the unmask parameter set to true + /// to view the unmasked log events. Users with the logs:Unmask + /// can also view unmasked data in the CloudWatch Logs console by running a + /// CloudWatch Logs Insights query with the unmask query command. /// - /// A destination encapsulates a physical resource (such as an Amazon Kinesis - /// stream). With a destination, you can subscribe to a real-time stream of - /// log events for a different account, ingested using PutLogEvents. + /// For more information, including a list of types of data that can be + /// audited and masked, see Protect + /// sensitive log data with masking. /// - /// Through an access policy, a destination controls what is written to it. By - /// default, PutDestination does not set any access policy with - /// the destination, which means a cross-account user cannot call PutSubscriptionFilter - /// against this destination. To enable this, the destination owner must call - /// PutDestinationPolicy - /// after PutDestination. + /// The PutDataProtectionPolicy operation applies to only the + /// specified log group. You can also use PutAccountPolicy + /// to create an account-level data protection policy that applies to all log + /// groups in the account, including both existing log groups and log groups + /// that are created level. If a log group has its own data protection policy + /// and the account also has an account-level data protection policy, then the + /// two policies are cumulative. Any sensitive term specified in either policy + /// is masked. + /// + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. + /// May throw [OperationAbortedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// + /// Parameter [logGroupIdentifier] : + /// Specify either the log group name or log group ARN. + /// + /// Parameter [policyDocument] : + /// Specify the data protection policy, in JSON. + /// + /// This policy must include two JSON blocks: + /// + ///
        + ///
      • + /// The first block must include both a DataIdentifer array and + /// an Operation property with an Audit action. The + /// DataIdentifer array lists the types of sensitive data that + /// you want to mask. For more information about the available options, see Types + /// of data that you can mask. + /// + /// The Operation property with an Audit action is + /// required to find the sensitive data terms. This Audit action + /// must contain a FindingsDestination object. You can optionally + /// use that FindingsDestination object to list one or more + /// destinations to send audit findings to. If you specify destinations such + /// as log groups, Firehose streams, and S3 buckets, they must already exist. + ///
      • + ///
      • + /// The second block must include both a DataIdentifer array and + /// an Operation property with an Deidentify action. + /// The DataIdentifer array must exactly match the + /// DataIdentifer array in the first block of the policy. + /// + /// The Operation property with the Deidentify + /// action is what actually masks the data, and it must contain the + /// "MaskConfig": {} object. The "MaskConfig": {} object + /// must be empty. + ///
      • + ///
      + /// For an example data protection policy, see the Examples section on + /// this page. + /// + /// The contents of the two DataIdentifer arrays must match + /// exactly. + /// + /// In addition to the two JSON blocks, the policyDocument can + /// also include Name, Description, and + /// Version fields. The Name is used as a dimension + /// when CloudWatch Logs reports audit findings metrics to CloudWatch. + /// + /// The JSON specified in policyDocument can be up to 30,720 + /// characters. + Future putDataProtectionPolicy({ + required String logGroupIdentifier, + required String policyDocument, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.PutDataProtectionPolicy' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logGroupIdentifier': logGroupIdentifier, + 'policyDocument': policyDocument, + }, + ); + + return PutDataProtectionPolicyResponse.fromJson(jsonResponse.body); + } + + /// Creates or updates a logical delivery destination. A delivery + /// destination is an Amazon Web Services resource that represents an Amazon + /// Web Services service that logs can be sent to. CloudWatch Logs, Amazon S3, + /// and Firehose are supported as logs delivery destinations. + /// + /// To configure logs delivery between a supported Amazon Web Services service + /// and a destination, you must do the following: + /// + ///
        + ///
      • + /// Create a delivery source, which is a logical object that represents the + /// resource that is actually sending the logs. For more information, see PutDeliverySource. + ///
      • + ///
      • + /// Use PutDeliveryDestination to create a delivery + /// destination, which is a logical object that represents the actual + /// delivery destination. + ///
      • + ///
      • + /// If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy + /// in the destination account to assign an IAM policy to the destination. + /// This policy allows delivery to that destination. + ///
      • + ///
      • + /// Use CreateDelivery to create a delivery by pairing + /// exactly one delivery source and one delivery destination. For more + /// information, see CreateDelivery. + ///
      • + ///
      + /// You can configure a single delivery source to send logs to multiple + /// destinations by creating multiple deliveries. You can also create multiple + /// deliveries to configure multiple delivery sources to send logs to the same + /// delivery destination. + /// + /// Only some Amazon Web Services services support being configured as a + /// delivery source. These services are listed as Supported [V2 + /// Permissions] in the table at Enabling + /// logging from Amazon Web Services services. + /// + /// If you use this operation to update an existing delivery destination, all + /// the current delivery destination parameters are overwritten with the new + /// parameter values that you specify. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [deliveryDestinationConfiguration] : + /// A structure that contains the ARN of the Amazon Web Services resource that + /// will receive the logs. + /// + /// Parameter [name] : + /// A name for this delivery destination. This name must be unique for all + /// delivery destinations in your account. + /// + /// Parameter [outputFormat] : + /// The format for the logs that this delivery destination will receive. + /// + /// Parameter [tags] : + /// An optional list of key-value pairs to associate with the resource. + /// + /// For more information about tagging, see Tagging + /// Amazon Web Services resources + Future putDeliveryDestination({ + required DeliveryDestinationConfiguration deliveryDestinationConfiguration, + required String name, + OutputFormat? outputFormat, + Map? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.PutDeliveryDestination' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'deliveryDestinationConfiguration': deliveryDestinationConfiguration, + 'name': name, + if (outputFormat != null) 'outputFormat': outputFormat.toValue(), + if (tags != null) 'tags': tags, + }, + ); + + return PutDeliveryDestinationResponse.fromJson(jsonResponse.body); + } + + /// Creates and assigns an IAM policy that grants permissions to CloudWatch + /// Logs to deliver logs cross-account to a specified destination in this + /// account. To configure the delivery of logs from an Amazon Web Services + /// service in another account to a logs delivery destination in the current + /// account, you must do the following: + /// + ///
        + ///
      • + /// Create a delivery source, which is a logical object that represents the + /// resource that is actually sending the logs. For more information, see PutDeliverySource. + ///
      • + ///
      • + /// Create a delivery destination, which is a logical object that + /// represents the actual delivery destination. For more information, see PutDeliveryDestination. + ///
      • + ///
      • + /// Use this operation in the destination account to assign an IAM policy to + /// the destination. This policy allows delivery to that destination. + ///
      • + ///
      • + /// Create a delivery by pairing exactly one delivery source and one + /// delivery destination. For more information, see CreateDelivery. + ///
      • + ///
      + /// Only some Amazon Web Services services support being configured as a + /// delivery source. These services are listed as Supported [V2 + /// Permissions] in the table at Enabling + /// logging from Amazon Web Services services. + /// + /// The contents of the policy must include two statements. One statement + /// enables general logs delivery, and the other allows delivery to the chosen + /// destination. See the examples for the needed policies. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ConflictException]. + /// + /// Parameter [deliveryDestinationName] : + /// The name of the delivery destination to assign this policy to. + /// + /// Parameter [deliveryDestinationPolicy] : + /// The contents of the policy. + Future putDeliveryDestinationPolicy({ + required String deliveryDestinationName, + required String deliveryDestinationPolicy, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.PutDeliveryDestinationPolicy' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'deliveryDestinationName': deliveryDestinationName, + 'deliveryDestinationPolicy': deliveryDestinationPolicy, + }, + ); + + return PutDeliveryDestinationPolicyResponse.fromJson(jsonResponse.body); + } + + /// Creates or updates a logical delivery source. A delivery source + /// represents an Amazon Web Services resource that sends logs to an logs + /// delivery destination. The destination can be CloudWatch Logs, Amazon S3, + /// or Firehose. + /// + /// To configure logs delivery between a delivery destination and an Amazon + /// Web Services service that is supported as a delivery source, you must do + /// the following: + /// + ///
        + ///
      • + /// Use PutDeliverySource to create a delivery source, which is a + /// logical object that represents the resource that is actually sending the + /// logs. + ///
      • + ///
      • + /// Use PutDeliveryDestination to create a delivery + /// destination, which is a logical object that represents the actual + /// delivery destination. For more information, see PutDeliveryDestination. + ///
      • + ///
      • + /// If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy + /// in the destination account to assign an IAM policy to the destination. + /// This policy allows delivery to that destination. + ///
      • + ///
      • + /// Use CreateDelivery to create a delivery by pairing + /// exactly one delivery source and one delivery destination. For more + /// information, see CreateDelivery. + ///
      • + ///
      + /// You can configure a single delivery source to send logs to multiple + /// destinations by creating multiple deliveries. You can also create multiple + /// deliveries to configure multiple delivery sources to send logs to the same + /// delivery destination. + /// + /// Only some Amazon Web Services services support being configured as a + /// delivery source. These services are listed as Supported [V2 + /// Permissions] in the table at Enabling + /// logging from Amazon Web Services services. + /// + /// If you use this operation to update an existing delivery source, all the + /// current delivery source parameters are overwritten with the new parameter + /// values that you specify. + /// + /// May throw [ServiceUnavailableException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [logType] : + /// Defines the type of log that the source is sending. + /// + ///
        + ///
      • + /// For Amazon CodeWhisperer, the valid value is EVENT_LOGS. + ///
      • + ///
      • + /// For IAM Identity Centerr, the valid value is ERROR_LOGS. + ///
      • + ///
      • + /// For Amazon WorkMail, the valid values are + /// ACCESS_CONTROL_LOGS, AUTHENTICATION_LOGS, + /// WORKMAIL_AVAILABILITY_PROVIDER_LOGS, and + /// WORKMAIL_MAILBOX_ACCESS_LOGS. + ///
      • + ///
      + /// + /// Parameter [name] : + /// A name for this delivery source. This name must be unique for all delivery + /// sources in your account. + /// + /// Parameter [resourceArn] : + /// The ARN of the Amazon Web Services resource that is generating and sending + /// logs. For example, + /// arn:aws:workmail:us-east-1:123456789012:organization/m-1234EXAMPLEabcd1234abcd1234abcd1234 + /// + /// Parameter [tags] : + /// An optional list of key-value pairs to associate with the resource. + /// + /// For more information about tagging, see Tagging + /// Amazon Web Services resources + Future putDeliverySource({ + required String logType, + required String name, + required String resourceArn, + Map? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.PutDeliverySource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logType': logType, + 'name': name, + 'resourceArn': resourceArn, + if (tags != null) 'tags': tags, + }, + ); + + return PutDeliverySourceResponse.fromJson(jsonResponse.body); + } + + /// Creates or updates a destination. This operation is used only to create + /// destinations for cross-account subscriptions. + /// + /// A destination encapsulates a physical resource (such as an Amazon Kinesis + /// stream). With a destination, you can subscribe to a real-time stream of + /// log events for a different account, ingested using PutLogEvents. + /// + /// Through an access policy, a destination controls what is written to it. By + /// default, PutDestination does not set any access policy with + /// the destination, which means a cross-account user cannot call PutSubscriptionFilter + /// against this destination. To enable this, the destination owner must call + /// PutDestinationPolicy + /// after PutDestination. /// /// To perform a PutDestination operation, you must also have the /// iam:PassRole permission. @@ -2113,12 +3756,12 @@ class CloudWatchLogs { /// Parameter [forceUpdate] : /// Specify true if you are updating an existing destination policy to grant /// permission to an organization ID instead of granting permission to - /// individual AWS accounts. Before you update a destination policy this way, - /// you must first update the subscription filters in the accounts that send - /// logs to this destination. If you do not, the subscription filters might - /// stop working. By specifying true for - /// forceUpdate, you are affirming that you have already updated - /// the subscription filters. For more information, see true
      + /// for forceUpdate, you are affirming that you have already + /// updated the subscription filters. For more information, see /// Updating an existing cross-account subscription /// @@ -2185,6 +3828,9 @@ class CloudWatchLogs { /// Otherwise, the operation fails. ///
    • ///
    • + /// Each log event can be no larger than 256 KB. + ///
    • + ///
    • /// The maximum number of log events in a batch is 10,000. ///
    • ///
    • @@ -2268,9 +3914,8 @@ class CloudWatchLogs { /// Each different value found for a dimension is treated as a separate metric /// and accrues charges as a separate custom metric. /// - /// CloudWatch Logs disables a metric filter if it generates 1,000 different - /// name/value pairs for your specified dimensions within a certain amount of - /// time. This helps to prevent accidental high charges. + /// CloudWatch Logs might disable a metric filter if it generates 1,000 + /// different name/value pairs for your specified dimensions within one hour. /// /// You can also set up a billing alarm to alert you if your charges are /// higher than expected. For more information, see CloudWatch /// Logs Insights Query Syntax. /// + /// Parameter [clientToken] : + /// Used as an idempotency token, to avoid returning an exception if the + /// service receives the same request twice because of a network error. + /// /// Parameter [logGroupNames] : /// Use this parameter to include specific log groups as part of your query /// definition. @@ -2374,6 +4023,7 @@ class CloudWatchLogs { Future putQueryDefinition({ required String name, required String queryString, + String? clientToken, List? logGroupNames, String? queryDefinitionId, }) async { @@ -2390,6 +4040,7 @@ class CloudWatchLogs { payload: { 'name': name, 'queryString': queryString, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), if (logGroupNames != null) 'logGroupNames': logGroupNames, if (queryDefinitionId != null) 'queryDefinitionId': queryDefinitionId, }, @@ -2477,6 +4128,13 @@ class CloudWatchLogs { /// setting until 72 hours after the previous retention period ends. /// Alternatively, wait to change the retention setting until you confirm that /// the earlier log events are deleted. + /// + /// When log events reach their retention setting they are marked for + /// deletion. After they are marked for deletion, they do not add to your + /// archival storage costs anymore, even if they are not actually deleted + /// until later. These log events marked for deletion are also not included + /// when you use an API to retrieve the storedBytes value to see + /// how many bytes a log group is storing. /// /// /// May throw [InvalidParameterException]. @@ -2523,8 +4181,11 @@ class CloudWatchLogs { /// subscription filter, for same-account delivery. ///
    • ///
    • - /// A logical destination that belongs to a different account, for - /// cross-account delivery. + /// A logical destination created with PutDestination + /// that belongs to a different account, for cross-account delivery. We + /// currently support Kinesis Data Streams and Firehose as logical + /// destinations. ///
    • ///
    • /// An Amazon Kinesis Data Firehose delivery stream that belongs to the same @@ -2539,8 +4200,9 @@ class CloudWatchLogs { /// If you are updating an existing filter, you must specify the correct name /// in filterName. /// - /// To perform a PutSubscriptionFilter operation, you must also - /// have the iam:PassRole permission. + /// To perform a PutSubscriptionFilter operation for any + /// destination except a Lambda function, you must also have the + /// iam:PassRole permission. /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -2628,30 +4290,181 @@ class CloudWatchLogs { ); } - /// Schedules a query of a log group using CloudWatch Logs Insights. You - /// specify the log group and time range to query and the query string to use. + /// Starts a Live Tail streaming session for one or more log groups. A Live + /// Tail session returns a stream of log events that have been recently + /// ingested in the log groups. For more information, see Use + /// Live Tail to view logs in near real time. /// - /// For more information, see CloudWatch - /// Logs Insights Query Syntax. + /// The response to this operation is a response stream, over which the server + /// sends live log events and the client receives them. /// - /// Queries time out after 15 minutes of runtime. If your queries are timing - /// out, reduce the time range being searched or partition your query into a - /// number of queries. + /// The following objects are sent over the stream: /// - /// If you are using CloudWatch cross-account observability, you can use this - /// operation in a monitoring account to start a query in a linked source - /// account. For more information, see CloudWatch - /// cross-account observability. For a cross-account - /// StartQuery operation, the query definition must be defined in - /// the monitoring account. + ///
        + ///
      • + /// A single LiveTailSessionStart + /// object is sent at the start of the session. + ///
      • + ///
      • + /// Every second, a LiveTailSessionUpdate + /// object is sent. Each of these objects contains an array of the actual log + /// events. /// - /// You can have up to 20 concurrent CloudWatch Logs insights queries, - /// including queries that have been added to dashboards. + /// If no new log events were ingested in the past second, the + /// LiveTailSessionUpdate object will contain an empty array. /// - /// May throw [MalformedQueryException]. - /// May throw [InvalidParameterException]. + /// The array of log events contained in a LiveTailSessionUpdate + /// can include as many as 500 log events. If the number of log events + /// matching the request exceeds 500 per second, the log events are sampled + /// down to 500 log events to be included in each + /// LiveTailSessionUpdate object. + /// + /// If your client consumes the log events slower than the server produces + /// them, CloudWatch Logs buffers up to 10 LiveTailSessionUpdate + /// events or 5000 log events, after which it starts dropping the oldest + /// events. + ///
      • + ///
      • + /// A SessionStreamingException + /// object is returned if an unknown error occurs on the server side. + ///
      • + ///
      • + /// A SessionTimeoutException + /// object is returned when the session times out, after it has been kept open + /// for three hours. + ///
      • + ///
      + /// You can end a session before it times out by closing the session stream or + /// by closing the client that is receiving the stream. The session also ends + /// if the established connection between the client and the server breaks. + /// + /// For examples of using an SDK to start a Live Tail session, see + /// Start a Live Tail session using an Amazon Web Services SDK. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. + /// May throw [InvalidOperationException]. + /// + /// Parameter [logGroupIdentifiers] : + /// An array where each item in the array is a log group to include in the + /// Live Tail session. + /// + /// Specify each log group by its ARN. + /// + /// If you specify an ARN, the ARN can't end with an asterisk (*). + /// + /// You can include up to 10 log groups. + /// + /// + /// Parameter [logEventFilterPattern] : + /// An optional pattern to use to filter the results to include only log + /// events that match the pattern. For example, a filter pattern of + /// error 404 causes only log events that include both + /// error and 404 to be included in the Live Tail + /// stream. + /// + /// Regular expression filter patterns are supported. + /// + /// For more information about filter pattern syntax, see Filter + /// and Pattern Syntax. + /// + /// Parameter [logStreamNamePrefixes] : + /// If you specify this parameter, then only log events in the log streams + /// that have names that start with the prefixes that you specify here are + /// included in the Live Tail session. + /// + /// If you specify this field, you can't also specify the + /// logStreamNames field. + /// + /// You can specify this parameter only if you specify only one log group in + /// logGroupIdentifiers. + /// + /// + /// Parameter [logStreamNames] : + /// If you specify this parameter, then only log events in the log streams + /// that you specify here are included in the Live Tail session. + /// + /// If you specify this field, you can't also specify the + /// logStreamNamePrefixes field. + /// + /// You can specify this parameter only if you specify only one log group in + /// logGroupIdentifiers. + /// + Future startLiveTail({ + required List logGroupIdentifiers, + String? logEventFilterPattern, + List? logStreamNamePrefixes, + List? logStreamNames, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.StartLiveTail' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'logGroupIdentifiers': logGroupIdentifiers, + if (logEventFilterPattern != null) + 'logEventFilterPattern': logEventFilterPattern, + if (logStreamNamePrefixes != null) + 'logStreamNamePrefixes': logStreamNamePrefixes, + if (logStreamNames != null) 'logStreamNames': logStreamNames, + }, + ); + + return StartLiveTailResponse.fromJson(jsonResponse.body); + } + + /// Schedules a query of a log group using CloudWatch Logs Insights. You + /// specify the log group and time range to query and the query string to use. + /// + /// For more information, see CloudWatch + /// Logs Insights Query Syntax. + /// + /// After you run a query using StartQuery, the query results are + /// stored by CloudWatch Logs. You can use GetQueryResults + /// to retrieve the results of a query, using the queryId that + /// StartQuery returns. + /// + /// If you have associated a KMS key with the query results in this account, + /// then StartQuery + /// uses that key to encrypt the results when it stores them. If no key is + /// associated with query results, the query results are encrypted with the + /// default CloudWatch Logs encryption method. + /// + /// Queries time out after 60 minutes of runtime. If your queries are timing + /// out, reduce the time range being searched or partition your query into a + /// number of queries. + /// + /// If you are using CloudWatch cross-account observability, you can use this + /// operation in a monitoring account to start a query in a linked source + /// account. For more information, see CloudWatch + /// cross-account observability. For a cross-account + /// StartQuery operation, the query definition must be defined in + /// the monitoring account. + /// + /// You can have up to 30 concurrent CloudWatch Logs insights queries, + /// including queries that have been added to dashboards. + /// + /// May throw [MalformedQueryException]. + /// May throw [InvalidParameterException]. /// May throw [LimitExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [ServiceUnavailableException]. @@ -2688,14 +4501,14 @@ class CloudWatchLogs { /// /// A StartQuery operation must include exactly one of the /// following parameters: logGroupName, - /// logGroupNames or logGroupIdentifiers. + /// logGroupNames, or logGroupIdentifiers. /// /// Parameter [logGroupName] : /// The log group on which to perform the query. /// /// A StartQuery operation must include exactly one of the /// following parameters: logGroupName, - /// logGroupNames or logGroupIdentifiers. + /// logGroupNames, or logGroupIdentifiers. /// /// /// Parameter [logGroupNames] : @@ -2703,7 +4516,7 @@ class CloudWatchLogs { /// /// A StartQuery operation must include exactly one of the /// following parameters: logGroupName, - /// logGroupNames or logGroupIdentifiers. + /// logGroupNames, or logGroupIdentifiers. /// Future startQuery({ required int endTime, @@ -3031,87 +4844,1136 @@ class CloudWatchLogs { }, ); } + + /// Use this operation to suppress anomaly detection for a specified + /// anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won’t + /// report new occurrences of that anomaly and won't update that anomaly with + /// new data. If you suppress a pattern, CloudWatch Logs won’t report any + /// anomalies related to that pattern. + /// + /// You must specify either anomalyId or patternId, + /// but you can't specify both parameters in the same operation. + /// + /// If you have previously used this operation to suppress detection of a + /// pattern or anomaly, you can use it again to cause CloudWatch Logs to end + /// the suppression. To do this, use this operation and specify the anomaly or + /// pattern to stop suppressing, and omit the suppressionType and + /// suppressionPeriod parameters. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [anomalyDetectorArn] : + /// The ARN of the anomaly detector that this operation is to act on. + /// + /// Parameter [anomalyId] : + /// If you are suppressing or unsuppressing an anomaly, specify its unique ID + /// here. You can find anomaly IDs by using the ListAnomalies + /// operation. + /// + /// Parameter [patternId] : + /// If you are suppressing or unsuppressing an pattern, specify its unique ID + /// here. You can find pattern IDs by using the ListAnomalies + /// operation. + /// + /// Parameter [suppressionPeriod] : + /// If you are temporarily suppressing an anomaly or pattern, use this + /// structure to specify how long the suppression is to last. + /// + /// Parameter [suppressionType] : + /// Use this to specify whether the suppression to be temporary or infinite. + /// If you specify LIMITED, you must also specify a + /// suppressionPeriod. If you specify INFINITE, any + /// value for suppressionPeriod is ignored. + Future updateAnomaly({ + required String anomalyDetectorArn, + String? anomalyId, + String? patternId, + SuppressionPeriod? suppressionPeriod, + SuppressionType? suppressionType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.UpdateAnomaly' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'anomalyDetectorArn': anomalyDetectorArn, + if (anomalyId != null) 'anomalyId': anomalyId, + if (patternId != null) 'patternId': patternId, + if (suppressionPeriod != null) 'suppressionPeriod': suppressionPeriod, + if (suppressionType != null) + 'suppressionType': suppressionType.toValue(), + }, + ); + } + + /// Updates an existing log anomaly detector. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ServiceUnavailableException]. + /// May throw [OperationAbortedException]. + /// + /// Parameter [anomalyDetectorArn] : + /// The ARN of the anomaly detector that you want to update. + /// + /// Parameter [enabled] : + /// Use this parameter to pause or restart the anomaly detector. + /// + /// Parameter [anomalyVisibilityTime] : + /// The number of days to use as the life cycle of anomalies. After this time, + /// anomalies are automatically baselined and the anomaly detector model will + /// treat new occurrences of similar event as normal. Therefore, if you do not + /// correct the cause of an anomaly during this time, it will be considered + /// normal going forward and will not be detected. + /// + /// Parameter [evaluationFrequency] : + /// Specifies how often the anomaly detector runs and look for anomalies. Set + /// this value according to the frequency that the log group receives new + /// logs. For example, if the log group receives new log events every 10 + /// minutes, then setting evaluationFrequency to + /// FIFTEEN_MIN might be appropriate. + Future updateLogAnomalyDetector({ + required String anomalyDetectorArn, + required bool enabled, + int? anomalyVisibilityTime, + EvaluationFrequency? evaluationFrequency, + String? filterPattern, + }) async { + _s.validateNumRange( + 'anomalyVisibilityTime', + anomalyVisibilityTime, + 7, + 90, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.UpdateLogAnomalyDetector' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'anomalyDetectorArn': anomalyDetectorArn, + 'enabled': enabled, + if (anomalyVisibilityTime != null) + 'anomalyVisibilityTime': anomalyVisibilityTime, + if (evaluationFrequency != null) + 'evaluationFrequency': evaluationFrequency.toValue(), + if (filterPattern != null) 'filterPattern': filterPattern, + }, + ); + } +} + +/// A structure that contains information about one CloudWatch Logs account +/// policy. +class AccountPolicy { + /// The Amazon Web Services account ID that the policy applies to. + final String? accountId; + + /// The date and time that this policy was most recently updated. + final int? lastUpdatedTime; + + /// The policy document for this account policy. + /// + /// The JSON specified in policyDocument can be up to 30,720 + /// characters. + final String? policyDocument; + + /// The name of the account policy. + final String? policyName; + + /// The type of policy for this account policy. + final PolicyType? policyType; + + /// The scope of the account policy. + final Scope? scope; + + /// The log group selection criteria for this subscription filter policy. + final String? selectionCriteria; + + AccountPolicy({ + this.accountId, + this.lastUpdatedTime, + this.policyDocument, + this.policyName, + this.policyType, + this.scope, + this.selectionCriteria, + }); + + factory AccountPolicy.fromJson(Map json) { + return AccountPolicy( + accountId: json['accountId'] as String?, + lastUpdatedTime: json['lastUpdatedTime'] as int?, + policyDocument: json['policyDocument'] as String?, + policyName: json['policyName'] as String?, + policyType: (json['policyType'] as String?)?.toPolicyType(), + scope: (json['scope'] as String?)?.toScope(), + selectionCriteria: json['selectionCriteria'] as String?, + ); + } + + Map toJson() { + final accountId = this.accountId; + final lastUpdatedTime = this.lastUpdatedTime; + final policyDocument = this.policyDocument; + final policyName = this.policyName; + final policyType = this.policyType; + final scope = this.scope; + final selectionCriteria = this.selectionCriteria; + return { + if (accountId != null) 'accountId': accountId, + if (lastUpdatedTime != null) 'lastUpdatedTime': lastUpdatedTime, + if (policyDocument != null) 'policyDocument': policyDocument, + if (policyName != null) 'policyName': policyName, + if (policyType != null) 'policyType': policyType.toValue(), + if (scope != null) 'scope': scope.toValue(), + if (selectionCriteria != null) 'selectionCriteria': selectionCriteria, + }; + } +} + +/// This structure represents one anomaly that has been found by a logs anomaly +/// detector. +/// +/// For more information about patterns and anomalies, see CreateLogAnomalyDetector. +class Anomaly { + /// Specifies whether this anomaly is still ongoing. + final bool active; + + /// The ARN of the anomaly detector that identified this anomaly. + final String anomalyDetectorArn; + + /// The unique ID that CloudWatch Logs assigned to this anomaly. + final String anomalyId; + + /// A human-readable description of the anomaly. This description is generated + /// by CloudWatch Logs. + final String description; + + /// The date and time when the anomaly detector first saw this anomaly. It is + /// specified as epoch time, which is the number of seconds since January + /// 1, 1970, 00:00:00 UTC. + final int firstSeen; + + /// A map showing times when the anomaly detector ran, and the number of + /// occurrences of this anomaly that were detected at each of those runs. The + /// times are specified in epoch time, which is the number of seconds since + /// January 1, 1970, 00:00:00 UTC. + final Map histogram; + + /// The date and time when the anomaly detector most recently saw this anomaly. + /// It is specified as epoch time, which is the number of seconds since + /// January 1, 1970, 00:00:00 UTC. + final int lastSeen; + + /// An array of ARNS of the log groups that contained log events considered to + /// be part of this anomaly. + final List logGroupArnList; + + /// An array of sample log event messages that are considered to be part of this + /// anomaly. + final List logSamples; + + /// The ID of the pattern used to help identify this anomaly. + final String patternId; + + /// The pattern used to help identify this anomaly, in string format. + final String patternString; + + /// An array of structures where each structure contains information about one + /// token that makes up the pattern. + final List patternTokens; + + /// Indicates the current state of this anomaly. If it is still being treated as + /// an anomaly, the value is Active. If you have suppressed this + /// anomaly by using the UpdateAnomaly + /// operation, the value is Suppressed. If this behavior is now + /// considered to be normal, the value is Baseline. + final State state; + + /// If this anomaly is suppressed, this field is true if the + /// suppression is because the pattern is suppressed. If false, + /// then only this particular anomaly is suppressed. + final bool? isPatternLevelSuppression; + + /// The pattern used to help identify this anomaly, in regular expression + /// format. + final String? patternRegex; + + /// The priority level of this anomaly, as determined by CloudWatch Logs. + /// Priority is computed based on log severity labels such as FATAL + /// and ERROR and the amount of deviation from the baseline. + /// Possible values are HIGH, MEDIUM, and + /// LOW. + final String? priority; + + /// Indicates whether this anomaly is currently suppressed. To suppress an + /// anomaly, use UpdateAnomaly. + final bool? suppressed; + + /// If the anomaly is suppressed, this indicates when it was suppressed. + final int? suppressedDate; + + /// If the anomaly is suppressed, this indicates when the suppression will end. + /// If this value is 0, the anomaly was suppressed with no + /// expiration, with the INFINITE value. + final int? suppressedUntil; + + Anomaly({ + required this.active, + required this.anomalyDetectorArn, + required this.anomalyId, + required this.description, + required this.firstSeen, + required this.histogram, + required this.lastSeen, + required this.logGroupArnList, + required this.logSamples, + required this.patternId, + required this.patternString, + required this.patternTokens, + required this.state, + this.isPatternLevelSuppression, + this.patternRegex, + this.priority, + this.suppressed, + this.suppressedDate, + this.suppressedUntil, + }); + + factory Anomaly.fromJson(Map json) { + return Anomaly( + active: json['active'] as bool, + anomalyDetectorArn: json['anomalyDetectorArn'] as String, + anomalyId: json['anomalyId'] as String, + description: json['description'] as String, + firstSeen: json['firstSeen'] as int, + histogram: (json['histogram'] as Map) + .map((k, e) => MapEntry(k, e as int)), + lastSeen: json['lastSeen'] as int, + logGroupArnList: (json['logGroupArnList'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + logSamples: (json['logSamples'] as List) + .whereNotNull() + .map((e) => LogEvent.fromJson(e as Map)) + .toList(), + patternId: json['patternId'] as String, + patternString: json['patternString'] as String, + patternTokens: (json['patternTokens'] as List) + .whereNotNull() + .map((e) => PatternToken.fromJson(e as Map)) + .toList(), + state: (json['state'] as String).toState(), + isPatternLevelSuppression: json['isPatternLevelSuppression'] as bool?, + patternRegex: json['patternRegex'] as String?, + priority: json['priority'] as String?, + suppressed: json['suppressed'] as bool?, + suppressedDate: json['suppressedDate'] as int?, + suppressedUntil: json['suppressedUntil'] as int?, + ); + } + + Map toJson() { + final active = this.active; + final anomalyDetectorArn = this.anomalyDetectorArn; + final anomalyId = this.anomalyId; + final description = this.description; + final firstSeen = this.firstSeen; + final histogram = this.histogram; + final lastSeen = this.lastSeen; + final logGroupArnList = this.logGroupArnList; + final logSamples = this.logSamples; + final patternId = this.patternId; + final patternString = this.patternString; + final patternTokens = this.patternTokens; + final state = this.state; + final isPatternLevelSuppression = this.isPatternLevelSuppression; + final patternRegex = this.patternRegex; + final priority = this.priority; + final suppressed = this.suppressed; + final suppressedDate = this.suppressedDate; + final suppressedUntil = this.suppressedUntil; + return { + 'active': active, + 'anomalyDetectorArn': anomalyDetectorArn, + 'anomalyId': anomalyId, + 'description': description, + 'firstSeen': firstSeen, + 'histogram': histogram, + 'lastSeen': lastSeen, + 'logGroupArnList': logGroupArnList, + 'logSamples': logSamples, + 'patternId': patternId, + 'patternString': patternString, + 'patternTokens': patternTokens, + 'state': state.toValue(), + if (isPatternLevelSuppression != null) + 'isPatternLevelSuppression': isPatternLevelSuppression, + if (patternRegex != null) 'patternRegex': patternRegex, + if (priority != null) 'priority': priority, + if (suppressed != null) 'suppressed': suppressed, + if (suppressedDate != null) 'suppressedDate': suppressedDate, + if (suppressedUntil != null) 'suppressedUntil': suppressedUntil, + }; + } +} + +/// Contains information about one anomaly detector in the account. +class AnomalyDetector { + /// The ARN of the anomaly detector. + final String? anomalyDetectorArn; + + /// Specifies the current status of the anomaly detector. To pause an anomaly + /// detector, use the enabled parameter in the UpdateLogAnomalyDetector + /// operation. + final AnomalyDetectorStatus? anomalyDetectorStatus; + + /// The number of days used as the life cycle of anomalies. After this time, + /// anomalies are automatically baselined and the anomaly detector model will + /// treat new occurrences of similar event as normal. + final int? anomalyVisibilityTime; + + /// The date and time when this anomaly detector was created. + final int? creationTimeStamp; + + /// The name of the anomaly detector. + final String? detectorName; + + /// Specifies how often the anomaly detector runs and look for anomalies. + final EvaluationFrequency? evaluationFrequency; + final String? filterPattern; + + /// The ID of the KMS key assigned to this anomaly detector, if any. + final String? kmsKeyId; + + /// The date and time when this anomaly detector was most recently modified. + final int? lastModifiedTimeStamp; + + /// A list of the ARNs of the log groups that this anomaly detector watches. + final List? logGroupArnList; + + AnomalyDetector({ + this.anomalyDetectorArn, + this.anomalyDetectorStatus, + this.anomalyVisibilityTime, + this.creationTimeStamp, + this.detectorName, + this.evaluationFrequency, + this.filterPattern, + this.kmsKeyId, + this.lastModifiedTimeStamp, + this.logGroupArnList, + }); + + factory AnomalyDetector.fromJson(Map json) { + return AnomalyDetector( + anomalyDetectorArn: json['anomalyDetectorArn'] as String?, + anomalyDetectorStatus: + (json['anomalyDetectorStatus'] as String?)?.toAnomalyDetectorStatus(), + anomalyVisibilityTime: json['anomalyVisibilityTime'] as int?, + creationTimeStamp: json['creationTimeStamp'] as int?, + detectorName: json['detectorName'] as String?, + evaluationFrequency: + (json['evaluationFrequency'] as String?)?.toEvaluationFrequency(), + filterPattern: json['filterPattern'] as String?, + kmsKeyId: json['kmsKeyId'] as String?, + lastModifiedTimeStamp: json['lastModifiedTimeStamp'] as int?, + logGroupArnList: (json['logGroupArnList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final anomalyDetectorArn = this.anomalyDetectorArn; + final anomalyDetectorStatus = this.anomalyDetectorStatus; + final anomalyVisibilityTime = this.anomalyVisibilityTime; + final creationTimeStamp = this.creationTimeStamp; + final detectorName = this.detectorName; + final evaluationFrequency = this.evaluationFrequency; + final filterPattern = this.filterPattern; + final kmsKeyId = this.kmsKeyId; + final lastModifiedTimeStamp = this.lastModifiedTimeStamp; + final logGroupArnList = this.logGroupArnList; + return { + if (anomalyDetectorArn != null) 'anomalyDetectorArn': anomalyDetectorArn, + if (anomalyDetectorStatus != null) + 'anomalyDetectorStatus': anomalyDetectorStatus.toValue(), + if (anomalyVisibilityTime != null) + 'anomalyVisibilityTime': anomalyVisibilityTime, + if (creationTimeStamp != null) 'creationTimeStamp': creationTimeStamp, + if (detectorName != null) 'detectorName': detectorName, + if (evaluationFrequency != null) + 'evaluationFrequency': evaluationFrequency.toValue(), + if (filterPattern != null) 'filterPattern': filterPattern, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (lastModifiedTimeStamp != null) + 'lastModifiedTimeStamp': lastModifiedTimeStamp, + if (logGroupArnList != null) 'logGroupArnList': logGroupArnList, + }; + } +} + +enum AnomalyDetectorStatus { + initializing, + training, + analyzing, + failed, + deleted, + paused, +} + +extension AnomalyDetectorStatusValueExtension on AnomalyDetectorStatus { + String toValue() { + switch (this) { + case AnomalyDetectorStatus.initializing: + return 'INITIALIZING'; + case AnomalyDetectorStatus.training: + return 'TRAINING'; + case AnomalyDetectorStatus.analyzing: + return 'ANALYZING'; + case AnomalyDetectorStatus.failed: + return 'FAILED'; + case AnomalyDetectorStatus.deleted: + return 'DELETED'; + case AnomalyDetectorStatus.paused: + return 'PAUSED'; + } + } +} + +extension AnomalyDetectorStatusFromString on String { + AnomalyDetectorStatus toAnomalyDetectorStatus() { + switch (this) { + case 'INITIALIZING': + return AnomalyDetectorStatus.initializing; + case 'TRAINING': + return AnomalyDetectorStatus.training; + case 'ANALYZING': + return AnomalyDetectorStatus.analyzing; + case 'FAILED': + return AnomalyDetectorStatus.failed; + case 'DELETED': + return AnomalyDetectorStatus.deleted; + case 'PAUSED': + return AnomalyDetectorStatus.paused; + } + throw Exception('$this is not known in enum AnomalyDetectorStatus'); + } +} + +class CreateDeliveryResponse { + /// A structure that contains information about the delivery that you just + /// created. + final Delivery? delivery; + + CreateDeliveryResponse({ + this.delivery, + }); + + factory CreateDeliveryResponse.fromJson(Map json) { + return CreateDeliveryResponse( + delivery: json['delivery'] != null + ? Delivery.fromJson(json['delivery'] as Map) + : null, + ); + } + + Map toJson() { + final delivery = this.delivery; + return { + if (delivery != null) 'delivery': delivery, + }; + } +} + +class CreateExportTaskResponse { + /// The ID of the export task. + final String? taskId; + + CreateExportTaskResponse({ + this.taskId, + }); + + factory CreateExportTaskResponse.fromJson(Map json) { + return CreateExportTaskResponse( + taskId: json['taskId'] as String?, + ); + } + + Map toJson() { + final taskId = this.taskId; + return { + if (taskId != null) 'taskId': taskId, + }; + } +} + +class CreateLogAnomalyDetectorResponse { + /// The ARN of the log anomaly detector that you just created. + final String? anomalyDetectorArn; + + CreateLogAnomalyDetectorResponse({ + this.anomalyDetectorArn, + }); + + factory CreateLogAnomalyDetectorResponse.fromJson(Map json) { + return CreateLogAnomalyDetectorResponse( + anomalyDetectorArn: json['anomalyDetectorArn'] as String?, + ); + } + + Map toJson() { + final anomalyDetectorArn = this.anomalyDetectorArn; + return { + if (anomalyDetectorArn != null) 'anomalyDetectorArn': anomalyDetectorArn, + }; + } +} + +enum DataProtectionStatus { + activated, + deleted, + archived, + disabled, +} + +extension DataProtectionStatusValueExtension on DataProtectionStatus { + String toValue() { + switch (this) { + case DataProtectionStatus.activated: + return 'ACTIVATED'; + case DataProtectionStatus.deleted: + return 'DELETED'; + case DataProtectionStatus.archived: + return 'ARCHIVED'; + case DataProtectionStatus.disabled: + return 'DISABLED'; + } + } +} + +extension DataProtectionStatusFromString on String { + DataProtectionStatus toDataProtectionStatus() { + switch (this) { + case 'ACTIVATED': + return DataProtectionStatus.activated; + case 'DELETED': + return DataProtectionStatus.deleted; + case 'ARCHIVED': + return DataProtectionStatus.archived; + case 'DISABLED': + return DataProtectionStatus.disabled; + } + throw Exception('$this is not known in enum DataProtectionStatus'); + } +} + +class DeleteQueryDefinitionResponse { + /// A value of TRUE indicates that the operation succeeded. FALSE indicates that + /// the operation failed. + final bool? success; + + DeleteQueryDefinitionResponse({ + this.success, + }); + + factory DeleteQueryDefinitionResponse.fromJson(Map json) { + return DeleteQueryDefinitionResponse( + success: json['success'] as bool?, + ); + } + + Map toJson() { + final success = this.success; + return { + if (success != null) 'success': success, + }; + } +} + +/// This structure contains information about one delivery in your +/// account. +/// +/// A delivery is a connection between a logical delivery source and a +/// logical delivery destination. +/// +/// For more information, see CreateDelivery. +/// +/// You can't update an existing delivery. You can only create and delete +/// deliveries. +class Delivery { + /// The Amazon Resource Name (ARN) that uniquely identifies this delivery. + final String? arn; + + /// The ARN of the delivery destination that is associated with this delivery. + final String? deliveryDestinationArn; + + /// Displays whether the delivery destination associated with this delivery is + /// CloudWatch Logs, Amazon S3, or Firehose. + final DeliveryDestinationType? deliveryDestinationType; + + /// The name of the delivery source that is associated with this delivery. + final String? deliverySourceName; + + /// The unique ID that identifies this delivery in your account. + final String? id; + + /// The tags that have been assigned to this delivery. + final Map? tags; + + Delivery({ + this.arn, + this.deliveryDestinationArn, + this.deliveryDestinationType, + this.deliverySourceName, + this.id, + this.tags, + }); + + factory Delivery.fromJson(Map json) { + return Delivery( + arn: json['arn'] as String?, + deliveryDestinationArn: json['deliveryDestinationArn'] as String?, + deliveryDestinationType: (json['deliveryDestinationType'] as String?) + ?.toDeliveryDestinationType(), + deliverySourceName: json['deliverySourceName'] as String?, + id: json['id'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final deliveryDestinationArn = this.deliveryDestinationArn; + final deliveryDestinationType = this.deliveryDestinationType; + final deliverySourceName = this.deliverySourceName; + final id = this.id; + final tags = this.tags; + return { + if (arn != null) 'arn': arn, + if (deliveryDestinationArn != null) + 'deliveryDestinationArn': deliveryDestinationArn, + if (deliveryDestinationType != null) + 'deliveryDestinationType': deliveryDestinationType.toValue(), + if (deliverySourceName != null) 'deliverySourceName': deliverySourceName, + if (id != null) 'id': id, + if (tags != null) 'tags': tags, + }; + } +} + +/// This structure contains information about one delivery destination in +/// your account. A delivery destination is an Amazon Web Services resource that +/// represents an Amazon Web Services service that logs can be sent to. +/// CloudWatch Logs, Amazon S3, are supported as Firehose delivery destinations. +/// +/// To configure logs delivery between a supported Amazon Web Services service +/// and a destination, you must do the following: +/// +///
        +///
      • +/// Create a delivery source, which is a logical object that represents the +/// resource that is actually sending the logs. For more information, see PutDeliverySource. +///
      • +///
      • +/// Create a delivery destination, which is a logical object that +/// represents the actual delivery destination. +///
      • +///
      • +/// If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy +/// in the destination account to assign an IAM policy to the destination. This +/// policy allows delivery to that destination. +///
      • +///
      • +/// Create a delivery by pairing exactly one delivery source and one +/// delivery destination. For more information, see CreateDelivery. +///
      • +///
      +/// You can configure a single delivery source to send logs to multiple +/// destinations by creating multiple deliveries. You can also create multiple +/// deliveries to configure multiple delivery sources to send logs to the same +/// delivery destination. +class DeliveryDestination { + /// The Amazon Resource Name (ARN) that uniquely identifies this delivery + /// destination. + final String? arn; + + /// A structure that contains the ARN of the Amazon Web Services resource that + /// will receive the logs. + final DeliveryDestinationConfiguration? deliveryDestinationConfiguration; + + /// Displays whether this delivery destination is CloudWatch Logs, Amazon S3, or + /// Firehose. + final DeliveryDestinationType? deliveryDestinationType; + + /// The name of this delivery destination. + final String? name; + + /// The format of the logs that are sent to this delivery destination. + final OutputFormat? outputFormat; + + /// The tags that have been assigned to this delivery destination. + final Map? tags; + + DeliveryDestination({ + this.arn, + this.deliveryDestinationConfiguration, + this.deliveryDestinationType, + this.name, + this.outputFormat, + this.tags, + }); + + factory DeliveryDestination.fromJson(Map json) { + return DeliveryDestination( + arn: json['arn'] as String?, + deliveryDestinationConfiguration: + json['deliveryDestinationConfiguration'] != null + ? DeliveryDestinationConfiguration.fromJson( + json['deliveryDestinationConfiguration'] + as Map) + : null, + deliveryDestinationType: (json['deliveryDestinationType'] as String?) + ?.toDeliveryDestinationType(), + name: json['name'] as String?, + outputFormat: (json['outputFormat'] as String?)?.toOutputFormat(), + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final deliveryDestinationConfiguration = + this.deliveryDestinationConfiguration; + final deliveryDestinationType = this.deliveryDestinationType; + final name = this.name; + final outputFormat = this.outputFormat; + final tags = this.tags; + return { + if (arn != null) 'arn': arn, + if (deliveryDestinationConfiguration != null) + 'deliveryDestinationConfiguration': deliveryDestinationConfiguration, + if (deliveryDestinationType != null) + 'deliveryDestinationType': deliveryDestinationType.toValue(), + if (name != null) 'name': name, + if (outputFormat != null) 'outputFormat': outputFormat.toValue(), + if (tags != null) 'tags': tags, + }; + } } -class CreateExportTaskResponse { - /// The ID of the export task. - final String? taskId; +/// A structure that contains information about one logs delivery destination. +class DeliveryDestinationConfiguration { + /// The ARN of the Amazon Web Services destination that this delivery + /// destination represents. That Amazon Web Services destination can be a log + /// group in CloudWatch Logs, an Amazon S3 bucket, or a delivery stream in + /// Firehose. + final String destinationResourceArn; - CreateExportTaskResponse({ - this.taskId, + DeliveryDestinationConfiguration({ + required this.destinationResourceArn, }); - factory CreateExportTaskResponse.fromJson(Map json) { - return CreateExportTaskResponse( - taskId: json['taskId'] as String?, + factory DeliveryDestinationConfiguration.fromJson(Map json) { + return DeliveryDestinationConfiguration( + destinationResourceArn: json['destinationResourceArn'] as String, ); } Map toJson() { - final taskId = this.taskId; + final destinationResourceArn = this.destinationResourceArn; return { - if (taskId != null) 'taskId': taskId, + 'destinationResourceArn': destinationResourceArn, }; } } -enum DataProtectionStatus { - activated, - deleted, - archived, - disabled, +enum DeliveryDestinationType { + s3, + cwl, + fh, } -extension DataProtectionStatusValueExtension on DataProtectionStatus { +extension DeliveryDestinationTypeValueExtension on DeliveryDestinationType { String toValue() { switch (this) { - case DataProtectionStatus.activated: - return 'ACTIVATED'; - case DataProtectionStatus.deleted: - return 'DELETED'; - case DataProtectionStatus.archived: - return 'ARCHIVED'; - case DataProtectionStatus.disabled: - return 'DISABLED'; + case DeliveryDestinationType.s3: + return 'S3'; + case DeliveryDestinationType.cwl: + return 'CWL'; + case DeliveryDestinationType.fh: + return 'FH'; } } } -extension DataProtectionStatusFromString on String { - DataProtectionStatus toDataProtectionStatus() { +extension DeliveryDestinationTypeFromString on String { + DeliveryDestinationType toDeliveryDestinationType() { switch (this) { - case 'ACTIVATED': - return DataProtectionStatus.activated; - case 'DELETED': - return DataProtectionStatus.deleted; - case 'ARCHIVED': - return DataProtectionStatus.archived; - case 'DISABLED': - return DataProtectionStatus.disabled; + case 'S3': + return DeliveryDestinationType.s3; + case 'CWL': + return DeliveryDestinationType.cwl; + case 'FH': + return DeliveryDestinationType.fh; } - throw Exception('$this is not known in enum DataProtectionStatus'); + throw Exception('$this is not known in enum DeliveryDestinationType'); } } -class DeleteQueryDefinitionResponse { - /// A value of TRUE indicates that the operation succeeded. FALSE indicates that - /// the operation failed. - final bool? success; +/// This structure contains information about one delivery source in your +/// account. A delivery source is an Amazon Web Services resource that sends +/// logs to an Amazon Web Services destination. The destination can be +/// CloudWatch Logs, Amazon S3, or Firehose. +/// +/// Only some Amazon Web Services services support being configured as a +/// delivery source. These services are listed as Supported [V2 +/// Permissions] in the table at Enabling +/// logging from Amazon Web Services services. +/// +/// To configure logs delivery between a supported Amazon Web Services service +/// and a destination, you must do the following: +/// +///
        +///
      • +/// Create a delivery source, which is a logical object that represents the +/// resource that is actually sending the logs. For more information, see PutDeliverySource. +///
      • +///
      • +/// Create a delivery destination, which is a logical object that +/// represents the actual delivery destination. For more information, see PutDeliveryDestination. +///
      • +///
      • +/// If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy +/// in the destination account to assign an IAM policy to the destination. This +/// policy allows delivery to that destination. +///
      • +///
      • +/// Create a delivery by pairing exactly one delivery source and one +/// delivery destination. For more information, see CreateDelivery. +///
      • +///
      +/// You can configure a single delivery source to send logs to multiple +/// destinations by creating multiple deliveries. You can also create multiple +/// deliveries to configure multiple delivery sources to send logs to the same +/// delivery destination. +class DeliverySource { + /// The Amazon Resource Name (ARN) that uniquely identifies this delivery + /// source. + final String? arn; - DeleteQueryDefinitionResponse({ - this.success, + /// The type of log that the source is sending. For valid values for this + /// parameter, see the documentation for the source service. + final String? logType; + + /// The unique name of the delivery source. + final String? name; + + /// This array contains the ARN of the Amazon Web Services resource that sends + /// logs and is represented by this delivery source. Currently, only one ARN can + /// be in the array. + final List? resourceArns; + + /// The Amazon Web Services service that is sending logs. + final String? service; + + /// The tags that have been assigned to this delivery source. + final Map? tags; + + DeliverySource({ + this.arn, + this.logType, + this.name, + this.resourceArns, + this.service, + this.tags, }); - factory DeleteQueryDefinitionResponse.fromJson(Map json) { - return DeleteQueryDefinitionResponse( - success: json['success'] as bool?, + factory DeliverySource.fromJson(Map json) { + return DeliverySource( + arn: json['arn'] as String?, + logType: json['logType'] as String?, + name: json['name'] as String?, + resourceArns: (json['resourceArns'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + service: json['service'] as String?, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final success = this.success; + final arn = this.arn; + final logType = this.logType; + final name = this.name; + final resourceArns = this.resourceArns; + final service = this.service; + final tags = this.tags; return { - if (success != null) 'success': success, + if (arn != null) 'arn': arn, + if (logType != null) 'logType': logType, + if (name != null) 'name': name, + if (resourceArns != null) 'resourceArns': resourceArns, + if (service != null) 'service': service, + if (tags != null) 'tags': tags, + }; + } +} + +class DescribeAccountPoliciesResponse { + /// An array of structures that contain information about the CloudWatch Logs + /// account policies that match the specified filters. + final List? accountPolicies; + + DescribeAccountPoliciesResponse({ + this.accountPolicies, + }); + + factory DescribeAccountPoliciesResponse.fromJson(Map json) { + return DescribeAccountPoliciesResponse( + accountPolicies: (json['accountPolicies'] as List?) + ?.whereNotNull() + .map((e) => AccountPolicy.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final accountPolicies = this.accountPolicies; + return { + if (accountPolicies != null) 'accountPolicies': accountPolicies, + }; + } +} + +class DescribeDeliveriesResponse { + /// An array of structures. Each structure contains information about one + /// delivery in the account. + final List? deliveries; + final String? nextToken; + + DescribeDeliveriesResponse({ + this.deliveries, + this.nextToken, + }); + + factory DescribeDeliveriesResponse.fromJson(Map json) { + return DescribeDeliveriesResponse( + deliveries: (json['deliveries'] as List?) + ?.whereNotNull() + .map((e) => Delivery.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final deliveries = this.deliveries; + final nextToken = this.nextToken; + return { + if (deliveries != null) 'deliveries': deliveries, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class DescribeDeliveryDestinationsResponse { + /// An array of structures. Each structure contains information about one + /// delivery destination in the account. + final List? deliveryDestinations; + final String? nextToken; + + DescribeDeliveryDestinationsResponse({ + this.deliveryDestinations, + this.nextToken, + }); + + factory DescribeDeliveryDestinationsResponse.fromJson( + Map json) { + return DescribeDeliveryDestinationsResponse( + deliveryDestinations: (json['deliveryDestinations'] as List?) + ?.whereNotNull() + .map((e) => DeliveryDestination.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final deliveryDestinations = this.deliveryDestinations; + final nextToken = this.nextToken; + return { + if (deliveryDestinations != null) + 'deliveryDestinations': deliveryDestinations, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class DescribeDeliverySourcesResponse { + /// An array of structures. Each structure contains information about one + /// delivery source in the account. + final List? deliverySources; + final String? nextToken; + + DescribeDeliverySourcesResponse({ + this.deliverySources, + this.nextToken, + }); + + factory DescribeDeliverySourcesResponse.fromJson(Map json) { + return DescribeDeliverySourcesResponse( + deliverySources: (json['deliverySources'] as List?) + ?.whereNotNull() + .map((e) => DeliverySource.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final deliverySources = this.deliverySources; + final nextToken = this.nextToken; + return { + if (deliverySources != null) 'deliverySources': deliverySources, + if (nextToken != null) 'nextToken': nextToken, }; } } @@ -3487,6 +6349,54 @@ extension DistributionFromString on String { } } +enum EvaluationFrequency { + oneMin, + fiveMin, + tenMin, + fifteenMin, + thirtyMin, + oneHour, +} + +extension EvaluationFrequencyValueExtension on EvaluationFrequency { + String toValue() { + switch (this) { + case EvaluationFrequency.oneMin: + return 'ONE_MIN'; + case EvaluationFrequency.fiveMin: + return 'FIVE_MIN'; + case EvaluationFrequency.tenMin: + return 'TEN_MIN'; + case EvaluationFrequency.fifteenMin: + return 'FIFTEEN_MIN'; + case EvaluationFrequency.thirtyMin: + return 'THIRTY_MIN'; + case EvaluationFrequency.oneHour: + return 'ONE_HOUR'; + } + } +} + +extension EvaluationFrequencyFromString on String { + EvaluationFrequency toEvaluationFrequency() { + switch (this) { + case 'ONE_MIN': + return EvaluationFrequency.oneMin; + case 'FIVE_MIN': + return EvaluationFrequency.fiveMin; + case 'TEN_MIN': + return EvaluationFrequency.tenMin; + case 'FIFTEEN_MIN': + return EvaluationFrequency.fifteenMin; + case 'THIRTY_MIN': + return EvaluationFrequency.thirtyMin; + case 'ONE_HOUR': + return EvaluationFrequency.oneHour; + } + throw Exception('$this is not known in enum EvaluationFrequency'); + } +} + /// Represents an export task. class ExportTask { /// The name of the S3 bucket to which the log data was exported. @@ -3802,22 +6712,217 @@ class GetDataProtectionPolicyResponse { this.policyDocument, }); - factory GetDataProtectionPolicyResponse.fromJson(Map json) { - return GetDataProtectionPolicyResponse( - lastUpdatedTime: json['lastUpdatedTime'] as int?, - logGroupIdentifier: json['logGroupIdentifier'] as String?, - policyDocument: json['policyDocument'] as String?, + factory GetDataProtectionPolicyResponse.fromJson(Map json) { + return GetDataProtectionPolicyResponse( + lastUpdatedTime: json['lastUpdatedTime'] as int?, + logGroupIdentifier: json['logGroupIdentifier'] as String?, + policyDocument: json['policyDocument'] as String?, + ); + } + + Map toJson() { + final lastUpdatedTime = this.lastUpdatedTime; + final logGroupIdentifier = this.logGroupIdentifier; + final policyDocument = this.policyDocument; + return { + if (lastUpdatedTime != null) 'lastUpdatedTime': lastUpdatedTime, + if (logGroupIdentifier != null) 'logGroupIdentifier': logGroupIdentifier, + if (policyDocument != null) 'policyDocument': policyDocument, + }; + } +} + +class GetDeliveryDestinationPolicyResponse { + /// The IAM policy for this delivery destination. + final Policy? policy; + + GetDeliveryDestinationPolicyResponse({ + this.policy, + }); + + factory GetDeliveryDestinationPolicyResponse.fromJson( + Map json) { + return GetDeliveryDestinationPolicyResponse( + policy: json['policy'] != null + ? Policy.fromJson(json['policy'] as Map) + : null, + ); + } + + Map toJson() { + final policy = this.policy; + return { + if (policy != null) 'policy': policy, + }; + } +} + +class GetDeliveryDestinationResponse { + /// A structure containing information about the delivery destination. + final DeliveryDestination? deliveryDestination; + + GetDeliveryDestinationResponse({ + this.deliveryDestination, + }); + + factory GetDeliveryDestinationResponse.fromJson(Map json) { + return GetDeliveryDestinationResponse( + deliveryDestination: json['deliveryDestination'] != null + ? DeliveryDestination.fromJson( + json['deliveryDestination'] as Map) + : null, + ); + } + + Map toJson() { + final deliveryDestination = this.deliveryDestination; + return { + if (deliveryDestination != null) + 'deliveryDestination': deliveryDestination, + }; + } +} + +class GetDeliveryResponse { + /// A structure that contains information about the delivery. + final Delivery? delivery; + + GetDeliveryResponse({ + this.delivery, + }); + + factory GetDeliveryResponse.fromJson(Map json) { + return GetDeliveryResponse( + delivery: json['delivery'] != null + ? Delivery.fromJson(json['delivery'] as Map) + : null, + ); + } + + Map toJson() { + final delivery = this.delivery; + return { + if (delivery != null) 'delivery': delivery, + }; + } +} + +class GetDeliverySourceResponse { + /// A structure containing information about the delivery source. + final DeliverySource? deliverySource; + + GetDeliverySourceResponse({ + this.deliverySource, + }); + + factory GetDeliverySourceResponse.fromJson(Map json) { + return GetDeliverySourceResponse( + deliverySource: json['deliverySource'] != null + ? DeliverySource.fromJson( + json['deliverySource'] as Map) + : null, + ); + } + + Map toJson() { + final deliverySource = this.deliverySource; + return { + if (deliverySource != null) 'deliverySource': deliverySource, + }; + } +} + +class GetLogAnomalyDetectorResponse { + /// Specifies whether the anomaly detector is currently active. To change its + /// status, use the enabled parameter in the UpdateLogAnomalyDetector + /// operation. + final AnomalyDetectorStatus? anomalyDetectorStatus; + + /// The number of days used as the life cycle of anomalies. After this time, + /// anomalies are automatically baselined and the anomaly detector model will + /// treat new occurrences of similar event as normal. + final int? anomalyVisibilityTime; + + /// The date and time when this anomaly detector was created. + final int? creationTimeStamp; + + /// The name of the log anomaly detector + final String? detectorName; + + /// Specifies how often the anomaly detector runs and look for anomalies. Set + /// this value according to the frequency that the log group receives new logs. + /// For example, if the log group receives new log events every 10 minutes, then + /// setting evaluationFrequency to FIFTEEN_MIN might + /// be appropriate. + final EvaluationFrequency? evaluationFrequency; + final String? filterPattern; + + /// The ID of the KMS key assigned to this anomaly detector, if any. + final String? kmsKeyId; + + /// The date and time when this anomaly detector was most recently modified. + final int? lastModifiedTimeStamp; + + /// An array of structures, where each structure contains the ARN of a log group + /// associated with this anomaly detector. + final List? logGroupArnList; + + GetLogAnomalyDetectorResponse({ + this.anomalyDetectorStatus, + this.anomalyVisibilityTime, + this.creationTimeStamp, + this.detectorName, + this.evaluationFrequency, + this.filterPattern, + this.kmsKeyId, + this.lastModifiedTimeStamp, + this.logGroupArnList, + }); + + factory GetLogAnomalyDetectorResponse.fromJson(Map json) { + return GetLogAnomalyDetectorResponse( + anomalyDetectorStatus: + (json['anomalyDetectorStatus'] as String?)?.toAnomalyDetectorStatus(), + anomalyVisibilityTime: json['anomalyVisibilityTime'] as int?, + creationTimeStamp: json['creationTimeStamp'] as int?, + detectorName: json['detectorName'] as String?, + evaluationFrequency: + (json['evaluationFrequency'] as String?)?.toEvaluationFrequency(), + filterPattern: json['filterPattern'] as String?, + kmsKeyId: json['kmsKeyId'] as String?, + lastModifiedTimeStamp: json['lastModifiedTimeStamp'] as int?, + logGroupArnList: (json['logGroupArnList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), ); } Map toJson() { - final lastUpdatedTime = this.lastUpdatedTime; - final logGroupIdentifier = this.logGroupIdentifier; - final policyDocument = this.policyDocument; + final anomalyDetectorStatus = this.anomalyDetectorStatus; + final anomalyVisibilityTime = this.anomalyVisibilityTime; + final creationTimeStamp = this.creationTimeStamp; + final detectorName = this.detectorName; + final evaluationFrequency = this.evaluationFrequency; + final filterPattern = this.filterPattern; + final kmsKeyId = this.kmsKeyId; + final lastModifiedTimeStamp = this.lastModifiedTimeStamp; + final logGroupArnList = this.logGroupArnList; return { - if (lastUpdatedTime != null) 'lastUpdatedTime': lastUpdatedTime, - if (logGroupIdentifier != null) 'logGroupIdentifier': logGroupIdentifier, - if (policyDocument != null) 'policyDocument': policyDocument, + if (anomalyDetectorStatus != null) + 'anomalyDetectorStatus': anomalyDetectorStatus.toValue(), + if (anomalyVisibilityTime != null) + 'anomalyVisibilityTime': anomalyVisibilityTime, + if (creationTimeStamp != null) 'creationTimeStamp': creationTimeStamp, + if (detectorName != null) 'detectorName': detectorName, + if (evaluationFrequency != null) + 'evaluationFrequency': evaluationFrequency.toValue(), + if (filterPattern != null) 'filterPattern': filterPattern, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (lastModifiedTimeStamp != null) + 'lastModifiedTimeStamp': lastModifiedTimeStamp, + if (logGroupArnList != null) 'logGroupArnList': logGroupArnList, }; } } @@ -3916,6 +7021,13 @@ class GetLogRecordResponse { } class GetQueryResultsResponse { + /// If you associated an KMS key with the CloudWatch Logs Insights query results + /// in this account, this field displays the ARN of the key that's used to + /// encrypt the query results when StartQuery + /// stores them. + final String? encryptionKey; + /// The log events that matched the query criteria during the most recent time /// it ran. /// @@ -3926,8 +7038,7 @@ class GetQueryResultsResponse { /// Includes the number of log events scanned by the query, the number of log /// events that matched the query criteria, and the total number of bytes in the - /// log events that were scanned. These values reflect the full raw results of - /// the query. + /// scanned log events. These values reflect the full raw results of the query. final QueryStatistics? statistics; /// The status of the most recent running of the query. Possible values are @@ -3935,12 +7046,13 @@ class GetQueryResultsResponse { /// Running, Scheduled, Timeout, and /// Unknown. /// - /// Queries time out after 15 minutes of runtime. To avoid having your queries + /// Queries time out after 60 minutes of runtime. To avoid having your queries /// time out, reduce the time range being searched or partition your query into /// a number of queries. final QueryStatus? status; GetQueryResultsResponse({ + this.encryptionKey, this.results, this.statistics, this.status, @@ -3948,6 +7060,7 @@ class GetQueryResultsResponse { factory GetQueryResultsResponse.fromJson(Map json) { return GetQueryResultsResponse( + encryptionKey: json['encryptionKey'] as String?, results: (json['results'] as List?) ?.whereNotNull() .map((e) => (e as List) @@ -3963,10 +7076,12 @@ class GetQueryResultsResponse { } Map toJson() { + final encryptionKey = this.encryptionKey; final results = this.results; final statistics = this.statistics; final status = this.status; return { + if (encryptionKey != null) 'encryptionKey': encryptionKey, if (results != null) 'results': results, if (statistics != null) 'statistics': statistics, if (status != null) 'status': status.toValue(), @@ -3974,10 +7089,33 @@ class GetQueryResultsResponse { } } +enum InheritedProperty { + accountDataProtection, +} + +extension InheritedPropertyValueExtension on InheritedProperty { + String toValue() { + switch (this) { + case InheritedProperty.accountDataProtection: + return 'ACCOUNT_DATA_PROTECTION'; + } + } +} + +extension InheritedPropertyFromString on String { + InheritedProperty toInheritedProperty() { + switch (this) { + case 'ACCOUNT_DATA_PROTECTION': + return InheritedProperty.accountDataProtection; + } + throw Exception('$this is not known in enum InheritedProperty'); + } +} + /// Represents a log event, which is a record of activity that was recorded by /// the application or resource being monitored. class InputLogEvent { - /// The raw event message. + /// The raw event message. Each log event can be no larger than 256 KB. final String message; /// The time the event occurred, expressed as the number of milliseconds after @@ -3999,6 +7137,68 @@ class InputLogEvent { } } +class ListAnomaliesResponse { + /// An array of structures, where each structure contains information about one + /// anomaly that a log anomaly detector has found. + final List? anomalies; + final String? nextToken; + + ListAnomaliesResponse({ + this.anomalies, + this.nextToken, + }); + + factory ListAnomaliesResponse.fromJson(Map json) { + return ListAnomaliesResponse( + anomalies: (json['anomalies'] as List?) + ?.whereNotNull() + .map((e) => Anomaly.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final anomalies = this.anomalies; + final nextToken = this.nextToken; + return { + if (anomalies != null) 'anomalies': anomalies, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListLogAnomalyDetectorsResponse { + /// An array of structures, where each structure in the array contains + /// information about one anomaly detector. + final List? anomalyDetectors; + final String? nextToken; + + ListLogAnomalyDetectorsResponse({ + this.anomalyDetectors, + this.nextToken, + }); + + factory ListLogAnomalyDetectorsResponse.fromJson(Map json) { + return ListLogAnomalyDetectorsResponse( + anomalyDetectors: (json['anomalyDetectors'] as List?) + ?.whereNotNull() + .map((e) => AnomalyDetector.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final anomalyDetectors = this.anomalyDetectors; + final nextToken = this.nextToken; + return { + if (anomalyDetectors != null) 'anomalyDetectors': anomalyDetectors, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListTagsForResourceResponse { /// The list of tags associated with the requested resource.> final Map? tags; @@ -4047,9 +7247,267 @@ class ListTagsLogGroupResponse { } } +/// This object contains the information for one log event returned in a Live +/// Tail stream. +class LiveTailSessionLogEvent { + /// The timestamp specifying when this log event was ingested into the log + /// group. + final int? ingestionTime; + + /// The name or ARN of the log group that ingested this log event. + final String? logGroupIdentifier; + + /// The name of the log stream that ingested this log event. + final String? logStreamName; + + /// The log event message text. + final String? message; + + /// The timestamp specifying when this log event was created. + final int? timestamp; + + LiveTailSessionLogEvent({ + this.ingestionTime, + this.logGroupIdentifier, + this.logStreamName, + this.message, + this.timestamp, + }); + + factory LiveTailSessionLogEvent.fromJson(Map json) { + return LiveTailSessionLogEvent( + ingestionTime: json['ingestionTime'] as int?, + logGroupIdentifier: json['logGroupIdentifier'] as String?, + logStreamName: json['logStreamName'] as String?, + message: json['message'] as String?, + timestamp: json['timestamp'] as int?, + ); + } + + Map toJson() { + final ingestionTime = this.ingestionTime; + final logGroupIdentifier = this.logGroupIdentifier; + final logStreamName = this.logStreamName; + final message = this.message; + final timestamp = this.timestamp; + return { + if (ingestionTime != null) 'ingestionTime': ingestionTime, + if (logGroupIdentifier != null) 'logGroupIdentifier': logGroupIdentifier, + if (logStreamName != null) 'logStreamName': logStreamName, + if (message != null) 'message': message, + if (timestamp != null) 'timestamp': timestamp, + }; + } +} + +/// This object contains the metadata for one LiveTailSessionUpdate +/// structure. It indicates whether that update includes only a sample of 500 +/// log events out of a larger number of ingested log events, or if it contains +/// all of the matching log events ingested during that second of time. +class LiveTailSessionMetadata { + /// If this is true, then more than 500 log events matched the + /// request for this update, and the sessionResults includes a + /// sample of 500 of those events. + /// + /// If this is false, then 500 or fewer log events matched the + /// request for this update, so no sampling was necessary. In this case, the + /// sessionResults array includes all log events that matched your + /// request during this time. + final bool? sampled; + + LiveTailSessionMetadata({ + this.sampled, + }); + + factory LiveTailSessionMetadata.fromJson(Map json) { + return LiveTailSessionMetadata( + sampled: json['sampled'] as bool?, + ); + } + + Map toJson() { + final sampled = this.sampled; + return { + if (sampled != null) 'sampled': sampled, + }; + } +} + +/// This object contains information about this Live Tail session, including the +/// log groups included and the log stream filters, if any. +class LiveTailSessionStart { + /// An optional pattern to filter the results to include only log events that + /// match the pattern. For example, a filter pattern of error 404 + /// displays only log events that include both error and + /// 404. + /// + /// For more information about filter pattern syntax, see Filter + /// and Pattern Syntax. + final String? logEventFilterPattern; + + /// An array of the names and ARNs of the log groups included in this Live Tail + /// session. + final List? logGroupIdentifiers; + + /// If your StartLiveTail operation request included a + /// logStreamNamePrefixes parameter that filtered the session to + /// only include log streams that have names that start with certain prefixes, + /// these prefixes are listed here. + final List? logStreamNamePrefixes; + + /// If your StartLiveTail operation request included a + /// logStreamNames parameter that filtered the session to only + /// include certain log streams, these streams are listed here. + final List? logStreamNames; + + /// The unique ID generated by CloudWatch Logs to identify this Live Tail + /// session request. + final String? requestId; + + /// The unique ID generated by CloudWatch Logs to identify this Live Tail + /// session. + final String? sessionId; + + LiveTailSessionStart({ + this.logEventFilterPattern, + this.logGroupIdentifiers, + this.logStreamNamePrefixes, + this.logStreamNames, + this.requestId, + this.sessionId, + }); + + factory LiveTailSessionStart.fromJson(Map json) { + return LiveTailSessionStart( + logEventFilterPattern: json['logEventFilterPattern'] as String?, + logGroupIdentifiers: (json['logGroupIdentifiers'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + logStreamNamePrefixes: (json['logStreamNamePrefixes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + logStreamNames: (json['logStreamNames'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + requestId: json['requestId'] as String?, + sessionId: json['sessionId'] as String?, + ); + } + + Map toJson() { + final logEventFilterPattern = this.logEventFilterPattern; + final logGroupIdentifiers = this.logGroupIdentifiers; + final logStreamNamePrefixes = this.logStreamNamePrefixes; + final logStreamNames = this.logStreamNames; + final requestId = this.requestId; + final sessionId = this.sessionId; + return { + if (logEventFilterPattern != null) + 'logEventFilterPattern': logEventFilterPattern, + if (logGroupIdentifiers != null) + 'logGroupIdentifiers': logGroupIdentifiers, + if (logStreamNamePrefixes != null) + 'logStreamNamePrefixes': logStreamNamePrefixes, + if (logStreamNames != null) 'logStreamNames': logStreamNames, + if (requestId != null) 'requestId': requestId, + if (sessionId != null) 'sessionId': sessionId, + }; + } +} + +/// This object contains the log events and metadata for a Live Tail session. +class LiveTailSessionUpdate { + /// This object contains the session metadata for a Live Tail session. + final LiveTailSessionMetadata? sessionMetadata; + + /// An array, where each member of the array includes the information for one + /// log event in the Live Tail session. + /// + /// A sessionResults array can include as many as 500 log events. + /// If the number of log events matching the request exceeds 500 per second, the + /// log events are sampled down to 500 log events to be included in each + /// sessionUpdate structure. + final List? sessionResults; + + LiveTailSessionUpdate({ + this.sessionMetadata, + this.sessionResults, + }); + + factory LiveTailSessionUpdate.fromJson(Map json) { + return LiveTailSessionUpdate( + sessionMetadata: json['sessionMetadata'] != null + ? LiveTailSessionMetadata.fromJson( + json['sessionMetadata'] as Map) + : null, + sessionResults: (json['sessionResults'] as List?) + ?.whereNotNull() + .map((e) => + LiveTailSessionLogEvent.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final sessionMetadata = this.sessionMetadata; + final sessionResults = this.sessionResults; + return { + if (sessionMetadata != null) 'sessionMetadata': sessionMetadata, + if (sessionResults != null) 'sessionResults': sessionResults, + }; + } +} + +/// This structure contains the information for one sample log event that is +/// associated with an anomaly found by a log anomaly detector. +class LogEvent { + /// The message content of the log event. + final String? message; + + /// The time stamp of the log event. + final int? timestamp; + + LogEvent({ + this.message, + this.timestamp, + }); + + factory LogEvent.fromJson(Map json) { + return LogEvent( + message: json['message'] as String?, + timestamp: json['timestamp'] as int?, + ); + } + + Map toJson() { + final message = this.message; + final timestamp = this.timestamp; + return { + if (message != null) 'message': message, + if (timestamp != null) 'timestamp': timestamp, + }; + } +} + /// Represents a log group. class LogGroup { - /// The Amazon Resource Name (ARN) of the log group. + /// The Amazon Resource Name (ARN) of the log group. This version of the ARN + /// includes a trailing :* after the log group name. + /// + /// Use this version to refer to the ARN in IAM policies when specifying + /// permissions for most API actions. The exception is when specifying + /// permissions for TagResource, + /// UntagResource, + /// and ListTagsForResource. + /// The permissions for those three actions require the ARN version that doesn't + /// include a trailing :*. final String? arn; /// The creation time of the log group, expressed as the number of milliseconds @@ -4061,10 +7519,55 @@ class LogGroup { /// href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html">PutDataProtectionPolicy. final DataProtectionStatus? dataProtectionStatus; + /// Displays all the properties that this log group has inherited from + /// account-level settings. + final List? inheritedProperties; + /// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log /// data. final String? kmsKeyId; + /// The Amazon Resource Name (ARN) of the log group. This version of the ARN + /// doesn't include a trailing :* after the log group name. + /// + /// Use this version to refer to the ARN in the following situations: + /// + ///
        + ///
      • + /// In the logGroupIdentifier input field in many CloudWatch Logs + /// APIs. + ///
      • + ///
      • + /// In the resourceArn field in tagging APIs + ///
      • + ///
      • + /// In IAM policies, when specifying permissions for TagResource, + /// UntagResource, + /// and ListTagsForResource. + ///
      • + ///
      + final String? logGroupArn; + + /// This specifies the log group class for this log group. There are two + /// classes: + /// + ///
        + ///
      • + /// The Standard log class supports all CloudWatch Logs features. + ///
      • + ///
      • + /// The Infrequent Access log class supports a subset of CloudWatch + /// Logs features and incurs lower costs. + ///
      • + ///
      + /// For details about the features supported by each class, see Log + /// classes + final LogGroupClass? logGroupClass; + /// The name of the log group. final String? logGroupName; @@ -4079,7 +7582,10 @@ class LogGroup { this.arn, this.creationTime, this.dataProtectionStatus, + this.inheritedProperties, this.kmsKeyId, + this.logGroupArn, + this.logGroupClass, this.logGroupName, this.metricFilterCount, this.retentionInDays, @@ -4092,7 +7598,13 @@ class LogGroup { creationTime: json['creationTime'] as int?, dataProtectionStatus: (json['dataProtectionStatus'] as String?)?.toDataProtectionStatus(), + inheritedProperties: (json['inheritedProperties'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toInheritedProperty()) + .toList(), kmsKeyId: json['kmsKeyId'] as String?, + logGroupArn: json['logGroupArn'] as String?, + logGroupClass: (json['logGroupClass'] as String?)?.toLogGroupClass(), logGroupName: json['logGroupName'] as String?, metricFilterCount: json['metricFilterCount'] as int?, retentionInDays: json['retentionInDays'] as int?, @@ -4104,7 +7616,10 @@ class LogGroup { final arn = this.arn; final creationTime = this.creationTime; final dataProtectionStatus = this.dataProtectionStatus; + final inheritedProperties = this.inheritedProperties; final kmsKeyId = this.kmsKeyId; + final logGroupArn = this.logGroupArn; + final logGroupClass = this.logGroupClass; final logGroupName = this.logGroupName; final metricFilterCount = this.metricFilterCount; final retentionInDays = this.retentionInDays; @@ -4114,7 +7629,12 @@ class LogGroup { if (creationTime != null) 'creationTime': creationTime, if (dataProtectionStatus != null) 'dataProtectionStatus': dataProtectionStatus.toValue(), + if (inheritedProperties != null) + 'inheritedProperties': + inheritedProperties.map((e) => e.toValue()).toList(), if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (logGroupArn != null) 'logGroupArn': logGroupArn, + if (logGroupClass != null) 'logGroupClass': logGroupClass.toValue(), if (logGroupName != null) 'logGroupName': logGroupName, if (metricFilterCount != null) 'metricFilterCount': metricFilterCount, if (retentionInDays != null) 'retentionInDays': retentionInDays, @@ -4123,6 +7643,34 @@ class LogGroup { } } +enum LogGroupClass { + standard, + infrequentAccess, +} + +extension LogGroupClassValueExtension on LogGroupClass { + String toValue() { + switch (this) { + case LogGroupClass.standard: + return 'STANDARD'; + case LogGroupClass.infrequentAccess: + return 'INFREQUENT_ACCESS'; + } + } +} + +extension LogGroupClassFromString on String { + LogGroupClass toLogGroupClass() { + switch (this) { + case 'STANDARD': + return LogGroupClass.standard; + case 'INFREQUENT_ACCESS': + return LogGroupClass.infrequentAccess; + } + throw Exception('$this is not known in enum LogGroupClass'); + } +} + /// The fields contained in log events found by a GetLogGroupFields /// operation, along with the percentage of queried log events in which each /// field appears. @@ -4432,26 +7980,69 @@ enum OrderBy { lastEventTime, } -extension OrderByValueExtension on OrderBy { +extension OrderByValueExtension on OrderBy { + String toValue() { + switch (this) { + case OrderBy.logStreamName: + return 'LogStreamName'; + case OrderBy.lastEventTime: + return 'LastEventTime'; + } + } +} + +extension OrderByFromString on String { + OrderBy toOrderBy() { + switch (this) { + case 'LogStreamName': + return OrderBy.logStreamName; + case 'LastEventTime': + return OrderBy.lastEventTime; + } + throw Exception('$this is not known in enum OrderBy'); + } +} + +enum OutputFormat { + json, + plain, + w3c, + raw, + parquet, +} + +extension OutputFormatValueExtension on OutputFormat { String toValue() { switch (this) { - case OrderBy.logStreamName: - return 'LogStreamName'; - case OrderBy.lastEventTime: - return 'LastEventTime'; + case OutputFormat.json: + return 'json'; + case OutputFormat.plain: + return 'plain'; + case OutputFormat.w3c: + return 'w3c'; + case OutputFormat.raw: + return 'raw'; + case OutputFormat.parquet: + return 'parquet'; } } } -extension OrderByFromString on String { - OrderBy toOrderBy() { +extension OutputFormatFromString on String { + OutputFormat toOutputFormat() { switch (this) { - case 'LogStreamName': - return OrderBy.logStreamName; - case 'LastEventTime': - return OrderBy.lastEventTime; + case 'json': + return OutputFormat.json; + case 'plain': + return OutputFormat.plain; + case 'w3c': + return OutputFormat.w3c; + case 'raw': + return OutputFormat.raw; + case 'parquet': + return OutputFormat.parquet; } - throw Exception('$this is not known in enum OrderBy'); + throw Exception('$this is not known in enum OutputFormat'); } } @@ -4494,6 +8085,138 @@ class OutputLogEvent { } } +/// A tructures that contains information about one pattern token related to an +/// anomaly. +/// +/// For more information about patterns and tokens, see CreateLogAnomalyDetector. +class PatternToken { + /// For a dynamic token, this indicates where in the pattern that this token + /// appears, related to other dynamic tokens. The dynamic token that appears + /// first has a value of 1, the one that appears second is + /// 2, and so on. + final int? dynamicTokenPosition; + + /// Contains the values found for a dynamic token, and the number of times each + /// value was found. + final Map? enumerations; + + /// Specifies whether this is a dynamic token. + final bool? isDynamic; + + /// The string represented by this token. If this is a dynamic token, the value + /// will be <*> + final String? tokenString; + + PatternToken({ + this.dynamicTokenPosition, + this.enumerations, + this.isDynamic, + this.tokenString, + }); + + factory PatternToken.fromJson(Map json) { + return PatternToken( + dynamicTokenPosition: json['dynamicTokenPosition'] as int?, + enumerations: (json['enumerations'] as Map?) + ?.map((k, e) => MapEntry(k, e as int)), + isDynamic: json['isDynamic'] as bool?, + tokenString: json['tokenString'] as String?, + ); + } + + Map toJson() { + final dynamicTokenPosition = this.dynamicTokenPosition; + final enumerations = this.enumerations; + final isDynamic = this.isDynamic; + final tokenString = this.tokenString; + return { + if (dynamicTokenPosition != null) + 'dynamicTokenPosition': dynamicTokenPosition, + if (enumerations != null) 'enumerations': enumerations, + if (isDynamic != null) 'isDynamic': isDynamic, + if (tokenString != null) 'tokenString': tokenString, + }; + } +} + +/// A structure that contains information about one delivery destination policy. +class Policy { + /// The contents of the delivery destination policy. + final String? deliveryDestinationPolicy; + + Policy({ + this.deliveryDestinationPolicy, + }); + + factory Policy.fromJson(Map json) { + return Policy( + deliveryDestinationPolicy: json['deliveryDestinationPolicy'] as String?, + ); + } + + Map toJson() { + final deliveryDestinationPolicy = this.deliveryDestinationPolicy; + return { + if (deliveryDestinationPolicy != null) + 'deliveryDestinationPolicy': deliveryDestinationPolicy, + }; + } +} + +enum PolicyType { + dataProtectionPolicy, + subscriptionFilterPolicy, +} + +extension PolicyTypeValueExtension on PolicyType { + String toValue() { + switch (this) { + case PolicyType.dataProtectionPolicy: + return 'DATA_PROTECTION_POLICY'; + case PolicyType.subscriptionFilterPolicy: + return 'SUBSCRIPTION_FILTER_POLICY'; + } + } +} + +extension PolicyTypeFromString on String { + PolicyType toPolicyType() { + switch (this) { + case 'DATA_PROTECTION_POLICY': + return PolicyType.dataProtectionPolicy; + case 'SUBSCRIPTION_FILTER_POLICY': + return PolicyType.subscriptionFilterPolicy; + } + throw Exception('$this is not known in enum PolicyType'); + } +} + +class PutAccountPolicyResponse { + /// The account policy that you created. + final AccountPolicy? accountPolicy; + + PutAccountPolicyResponse({ + this.accountPolicy, + }); + + factory PutAccountPolicyResponse.fromJson(Map json) { + return PutAccountPolicyResponse( + accountPolicy: json['accountPolicy'] != null + ? AccountPolicy.fromJson( + json['accountPolicy'] as Map) + : null, + ); + } + + Map toJson() { + final accountPolicy = this.accountPolicy; + return { + if (accountPolicy != null) 'accountPolicy': accountPolicy, + }; + } +} + class PutDataProtectionPolicyResponse { /// The date and time that this policy was most recently updated. final int? lastUpdatedTime; @@ -4530,6 +8253,84 @@ class PutDataProtectionPolicyResponse { } } +class PutDeliveryDestinationPolicyResponse { + /// The contents of the policy that you just created. + final Policy? policy; + + PutDeliveryDestinationPolicyResponse({ + this.policy, + }); + + factory PutDeliveryDestinationPolicyResponse.fromJson( + Map json) { + return PutDeliveryDestinationPolicyResponse( + policy: json['policy'] != null + ? Policy.fromJson(json['policy'] as Map) + : null, + ); + } + + Map toJson() { + final policy = this.policy; + return { + if (policy != null) 'policy': policy, + }; + } +} + +class PutDeliveryDestinationResponse { + /// A structure containing information about the delivery destination that you + /// just created or updated. + final DeliveryDestination? deliveryDestination; + + PutDeliveryDestinationResponse({ + this.deliveryDestination, + }); + + factory PutDeliveryDestinationResponse.fromJson(Map json) { + return PutDeliveryDestinationResponse( + deliveryDestination: json['deliveryDestination'] != null + ? DeliveryDestination.fromJson( + json['deliveryDestination'] as Map) + : null, + ); + } + + Map toJson() { + final deliveryDestination = this.deliveryDestination; + return { + if (deliveryDestination != null) + 'deliveryDestination': deliveryDestination, + }; + } +} + +class PutDeliverySourceResponse { + /// A structure containing information about the delivery source that was just + /// created or updated. + final DeliverySource? deliverySource; + + PutDeliverySourceResponse({ + this.deliverySource, + }); + + factory PutDeliverySourceResponse.fromJson(Map json) { + return PutDeliverySourceResponse( + deliverySource: json['deliverySource'] != null + ? DeliverySource.fromJson( + json['deliverySource'] as Map) + : null, + ); + } + + Map toJson() { + final deliverySource = this.deliverySource; + return { + if (deliverySource != null) 'deliverySource': deliverySource, + }; + } +} + class PutDestinationResponse { /// The destination. final Destination? destination; @@ -4853,10 +8654,10 @@ class RejectedLogEventsInfo { /// The expired log events. final int? expiredLogEventEndIndex; - /// The log events that are too new. + /// The index of the first log event that is too new. This field is inclusive. final int? tooNewLogEventStartIndex; - /// The log events that are dated too far in the past. + /// The index of the last log event that is too old. This field is exclusive. final int? tooOldLogEventEndIndex; RejectedLogEventsInfo({ @@ -4963,6 +8764,29 @@ class ResultField { } } +enum Scope { + all, +} + +extension ScopeValueExtension on Scope { + String toValue() { + switch (this) { + case Scope.all: + return 'ALL'; + } + } +} + +extension ScopeFromString on String { + Scope toScope() { + switch (this) { + case 'ALL': + return Scope.all; + } + throw Exception('$this is not known in enum Scope'); + } +} + /// Represents the search status of a log stream. class SearchedLogStream { /// The name of the log stream. @@ -4993,6 +8817,52 @@ class SearchedLogStream { } } +/// his exception is returned if an unknown error occurs during a Live Tail +/// session. +class SessionStreamingException implements _s.AwsException { + final String? message; + + SessionStreamingException({ + this.message, + }); + + factory SessionStreamingException.fromJson(Map json) { + return SessionStreamingException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// This exception is returned in a Live Tail stream when the Live Tail session +/// times out. Live Tail sessions time out after three hours. +class SessionTimeoutException implements _s.AwsException { + final String? message; + + SessionTimeoutException({ + this.message, + }); + + factory SessionTimeoutException.fromJson(Map json) { + return SessionTimeoutException( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + enum StandardUnit { seconds, microseconds, @@ -5146,6 +9016,94 @@ extension StandardUnitFromString on String { } } +class StartLiveTailResponse { + /// An object that includes the stream returned by your request. It can include + /// both log events and exceptions. + final StartLiveTailResponseStream? responseStream; + + StartLiveTailResponse({ + this.responseStream, + }); + + factory StartLiveTailResponse.fromJson(Map json) { + return StartLiveTailResponse( + responseStream: json['responseStream'] != null + ? StartLiveTailResponseStream.fromJson( + json['responseStream'] as Map) + : null, + ); + } + + Map toJson() { + final responseStream = this.responseStream; + return { + if (responseStream != null) 'responseStream': responseStream, + }; + } +} + +/// This object includes the stream returned by your StartLiveTail +/// request. +class StartLiveTailResponseStream { + /// This exception is returned if an unknown error occurs. + final SessionStreamingException? sessionStreamingException; + + /// This exception is returned in the stream when the Live Tail session times + /// out. Live Tail sessions time out after three hours. + final SessionTimeoutException? sessionTimeoutException; + + /// This object contains information about this Live Tail session, including the + /// log groups included and the log stream filters, if any. + final LiveTailSessionStart? sessionStart; + + /// This object contains the log events and session metadata. + final LiveTailSessionUpdate? sessionUpdate; + + StartLiveTailResponseStream({ + this.sessionStreamingException, + this.sessionTimeoutException, + this.sessionStart, + this.sessionUpdate, + }); + + factory StartLiveTailResponseStream.fromJson(Map json) { + return StartLiveTailResponseStream( + sessionStreamingException: json['SessionStreamingException'] != null + ? SessionStreamingException.fromJson( + json['SessionStreamingException'] as Map) + : null, + sessionTimeoutException: json['SessionTimeoutException'] != null + ? SessionTimeoutException.fromJson( + json['SessionTimeoutException'] as Map) + : null, + sessionStart: json['sessionStart'] != null + ? LiveTailSessionStart.fromJson( + json['sessionStart'] as Map) + : null, + sessionUpdate: json['sessionUpdate'] != null + ? LiveTailSessionUpdate.fromJson( + json['sessionUpdate'] as Map) + : null, + ); + } + + Map toJson() { + final sessionStreamingException = this.sessionStreamingException; + final sessionTimeoutException = this.sessionTimeoutException; + final sessionStart = this.sessionStart; + final sessionUpdate = this.sessionUpdate; + return { + if (sessionStreamingException != null) + 'SessionStreamingException': sessionStreamingException, + if (sessionTimeoutException != null) + 'SessionTimeoutException': sessionTimeoutException, + if (sessionStart != null) 'sessionStart': sessionStart, + if (sessionUpdate != null) 'sessionUpdate': sessionUpdate, + }; + } +} + class StartQueryResponse { /// The unique ID of the query. final String? queryId; @@ -5168,6 +9126,39 @@ class StartQueryResponse { } } +enum State { + active, + suppressed, + baseline, +} + +extension StateValueExtension on State { + String toValue() { + switch (this) { + case State.active: + return 'Active'; + case State.suppressed: + return 'Suppressed'; + case State.baseline: + return 'Baseline'; + } + } +} + +extension StateFromString on String { + State toState() { + switch (this) { + case 'Active': + return State.active; + case 'Suppressed': + return State.suppressed; + case 'Baseline': + return State.baseline; + } + throw Exception('$this is not known in enum State'); + } +} + class StopQueryResponse { /// This is true if the query was stopped by the StopQuery /// operation. @@ -5253,6 +9244,121 @@ class SubscriptionFilter { } } +/// If you are suppressing an anomaly temporariliy, this structure defines how +/// long the suppression period is to be. +class SuppressionPeriod { + /// Specifies whether the value of value is in seconds, minutes, or + /// hours. + final SuppressionUnit? suppressionUnit; + + /// Specifies the number of seconds, minutes or hours to suppress this anomaly. + /// There is no maximum. + final int? value; + + SuppressionPeriod({ + this.suppressionUnit, + this.value, + }); + + Map toJson() { + final suppressionUnit = this.suppressionUnit; + final value = this.value; + return { + if (suppressionUnit != null) 'suppressionUnit': suppressionUnit.toValue(), + if (value != null) 'value': value, + }; + } +} + +enum SuppressionState { + suppressed, + unsuppressed, +} + +extension SuppressionStateValueExtension on SuppressionState { + String toValue() { + switch (this) { + case SuppressionState.suppressed: + return 'SUPPRESSED'; + case SuppressionState.unsuppressed: + return 'UNSUPPRESSED'; + } + } +} + +extension SuppressionStateFromString on String { + SuppressionState toSuppressionState() { + switch (this) { + case 'SUPPRESSED': + return SuppressionState.suppressed; + case 'UNSUPPRESSED': + return SuppressionState.unsuppressed; + } + throw Exception('$this is not known in enum SuppressionState'); + } +} + +enum SuppressionType { + limited, + infinite, +} + +extension SuppressionTypeValueExtension on SuppressionType { + String toValue() { + switch (this) { + case SuppressionType.limited: + return 'LIMITED'; + case SuppressionType.infinite: + return 'INFINITE'; + } + } +} + +extension SuppressionTypeFromString on String { + SuppressionType toSuppressionType() { + switch (this) { + case 'LIMITED': + return SuppressionType.limited; + case 'INFINITE': + return SuppressionType.infinite; + } + throw Exception('$this is not known in enum SuppressionType'); + } +} + +enum SuppressionUnit { + seconds, + minutes, + hours, +} + +extension SuppressionUnitValueExtension on SuppressionUnit { + String toValue() { + switch (this) { + case SuppressionUnit.seconds: + return 'SECONDS'; + case SuppressionUnit.minutes: + return 'MINUTES'; + case SuppressionUnit.hours: + return 'HOURS'; + } + } +} + +extension SuppressionUnitFromString on String { + SuppressionUnit toSuppressionUnit() { + switch (this) { + case 'SECONDS': + return SuppressionUnit.seconds; + case 'MINUTES': + return SuppressionUnit.minutes; + case 'HOURS': + return SuppressionUnit.hours; + } + throw Exception('$this is not known in enum SuppressionUnit'); + } +} + class TestMetricFilterResponse { /// The matched events. final List? matches; @@ -5279,6 +9385,16 @@ class TestMetricFilterResponse { } } +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + class DataAlreadyAcceptedException extends _s.GenericAwsException { DataAlreadyAcceptedException({String? type, String? message}) : super( @@ -5331,12 +9447,25 @@ class ResourceNotFoundException extends _s.GenericAwsException { : super(type: type, code: 'ResourceNotFoundException', message: message); } +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + class ServiceUnavailableException extends _s.GenericAwsException { ServiceUnavailableException({String? type, String? message}) : super( type: type, code: 'ServiceUnavailableException', message: message); } +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + class TooManyTagsException extends _s.GenericAwsException { TooManyTagsException({String? type, String? message}) : super(type: type, code: 'TooManyTagsException', message: message); @@ -5348,7 +9477,16 @@ class UnrecognizedClientException extends _s.GenericAwsException { type: type, code: 'UnrecognizedClientException', message: message); } +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), 'DataAlreadyAcceptedException': (type, message) => DataAlreadyAcceptedException(type: type, message: message), 'InvalidOperationException': (type, message) => @@ -5367,10 +9505,20 @@ final _exceptionFns = { ResourceAlreadyExistsException(type: type, message: message), 'ResourceNotFoundException': (type, message) => ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), 'ServiceUnavailableException': (type, message) => ServiceUnavailableException(type: type, message: message), + 'SessionStreamingException': (type, message) => + SessionStreamingException(message: message), + 'SessionTimeoutException': (type, message) => + SessionTimeoutException(message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), 'TooManyTagsException': (type, message) => TooManyTagsException(type: type, message: message), 'UnrecognizedClientException': (type, message) => UnrecognizedClientException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/code_build/v2016_10_06.dart b/aws_client/lib/src/generated/code_build/v2016_10_06.dart index 97fc6b91d..4c7f1e03b 100644 --- a/aws_client/lib/src/generated/code_build/v2016_10_06.dart +++ b/aws_client/lib/src/generated/code_build/v2016_10_06.dart @@ -139,6 +139,33 @@ class CodeBuild { return BatchGetBuildsOutput.fromJson(jsonResponse.body); } + /// Gets information about one or more compute fleets. + /// + /// May throw [InvalidInputException]. + /// + /// Parameter [names] : + /// The names or ARNs of the compute fleets. + Future batchGetFleets({ + required List names, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeBuild_20161006.BatchGetFleets' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'names': names, + }, + ); + + return BatchGetFleetsOutput.fromJson(jsonResponse.body); + } + /// Gets information about one or more build projects. /// /// May throw [InvalidInputException]. @@ -222,6 +249,206 @@ class CodeBuild { return BatchGetReportsOutput.fromJson(jsonResponse.body); } + /// Creates a compute fleet. + /// + /// May throw [InvalidInputException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [AccountLimitExceededException]. + /// + /// Parameter [baseCapacity] : + /// The initial number of machines allocated to the fleet, which defines the + /// number of builds that can run in parallel. + /// + /// Parameter [computeType] : + /// Information about the compute resources the compute fleet uses. Available + /// values include: + /// + ///
        + ///
      • + /// BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for + /// builds. + ///
      • + ///
      • + /// BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for + /// builds. + ///
      • + ///
      • + /// BUILD_GENERAL1_LARGE: Use up to 16 GB memory and 8 vCPUs for + /// builds, depending on your environment type. + ///
      • + ///
      • + /// BUILD_GENERAL1_XLARGE: Use up to 70 GB memory and 36 vCPUs + /// for builds, depending on your environment type. + ///
      • + ///
      • + /// BUILD_GENERAL1_2XLARGE: Use up to 145 GB memory, 72 vCPUs, + /// and 824 GB of SSD storage for builds. This compute type supports Docker + /// images up to 100 GB uncompressed. + ///
      • + ///
      + /// If you use BUILD_GENERAL1_SMALL: + /// + ///
        + ///
      • + /// For environment type LINUX_CONTAINER, you can use up to 3 GB + /// memory and 2 vCPUs for builds. + ///
      • + ///
      • + /// For environment type LINUX_GPU_CONTAINER, you can use up to + /// 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + ///
      • + ///
      • + /// For environment type ARM_CONTAINER, you can use up to 4 GB + /// memory and 2 vCPUs on ARM-based processors for builds. + ///
      • + ///
      + /// If you use BUILD_GENERAL1_LARGE: + /// + ///
        + ///
      • + /// For environment type LINUX_CONTAINER, you can use up to 15 GB + /// memory and 8 vCPUs for builds. + ///
      • + ///
      • + /// For environment type LINUX_GPU_CONTAINER, you can use up to + /// 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + ///
      • + ///
      • + /// For environment type ARM_CONTAINER, you can use up to 16 GB + /// memory and 8 vCPUs on ARM-based processors for builds. + ///
      • + ///
      + /// For more information, see Build + /// environment compute types in the CodeBuild User Guide. + /// + /// Parameter [environmentType] : + /// The environment type of the compute fleet. + /// + ///
        + ///
      • + /// The environment type ARM_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific + /// (Singapore), Asia Pacific (Sydney), EU (Frankfurt), and South America (São + /// Paulo). + ///
      • + ///
      • + /// The environment type LINUX_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), + /// Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific + /// (Mumbai). + ///
      • + ///
      • + /// The environment type LINUX_GPU_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific + /// (Sydney). + ///
      • + ///
      • + /// The environment type WINDOWS_SERVER_2019_CONTAINER is + /// available only in regions US East (N. Virginia), US East (Ohio), US West + /// (Oregon), Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific + /// (Mumbai) and EU (Ireland). + ///
      • + ///
      • + /// The environment type WINDOWS_SERVER_2022_CONTAINER is + /// available only in regions US East (N. Virginia), US East (Ohio), US West + /// (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Sydney), Asia + /// Pacific (Singapore), Asia Pacific (Tokyo), South America (São Paulo) and + /// Asia Pacific (Mumbai). + ///
      • + ///
      + /// For more information, see Build + /// environment compute types in the CodeBuild user guide. + /// + /// Parameter [name] : + /// The name of the compute fleet. + /// + /// Parameter [fleetServiceRole] : + /// The service role associated with the compute fleet. For more information, + /// see + /// Allow a user to add a permission policy for a fleet service role in + /// the CodeBuild User Guide. + /// + /// Parameter [overflowBehavior] : + /// The compute fleet overflow behavior. + /// + /// + /// + /// Parameter [scalingConfiguration] : + /// The scaling configuration of the compute fleet. + /// + /// Parameter [tags] : + /// A list of tag key and value pairs associated with this compute fleet. + /// + /// These tags are available for use by Amazon Web Services services that + /// support CodeBuild build project tags. + Future createFleet({ + required int baseCapacity, + required ComputeType computeType, + required EnvironmentType environmentType, + required String name, + String? fleetServiceRole, + FleetOverflowBehavior? overflowBehavior, + ScalingConfigurationInput? scalingConfiguration, + List? tags, + VpcConfig? vpcConfig, + }) async { + _s.validateNumRange( + 'baseCapacity', + baseCapacity, + 1, + 1152921504606846976, + isRequired: true, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeBuild_20161006.CreateFleet' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'baseCapacity': baseCapacity, + 'computeType': computeType.toValue(), + 'environmentType': environmentType.toValue(), + 'name': name, + if (fleetServiceRole != null) 'fleetServiceRole': fleetServiceRole, + if (overflowBehavior != null) + 'overflowBehavior': overflowBehavior.toValue(), + if (scalingConfiguration != null) + 'scalingConfiguration': scalingConfiguration, + if (tags != null) 'tags': tags, + if (vpcConfig != null) 'vpcConfig': vpcConfig, + }, + ); + + return CreateFleetOutput.fromJson(jsonResponse.body); + } + /// Creates a build project. /// /// May throw [InvalidInputException]. @@ -320,6 +547,9 @@ class CodeBuild { /// specified, the default branch's HEAD commit ID is used. ///
    • ///
    • + /// For GitLab: the commit ID, branch, or Git tag to use. + ///
    • + ///
    • /// For Bitbucket: the commit ID, branch name, or tag name that corresponds to /// the version of the source code you want to build. If a branch name is /// specified, the branch's HEAD commit ID is used. If not specified, the @@ -345,12 +575,16 @@ class CodeBuild { /// support CodeBuild build project tags. /// /// Parameter [timeoutInMinutes] : - /// How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait + /// How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait /// before it times out any build that has not been marked as completed. The /// default is 60 minutes. /// /// Parameter [vpcConfig] : /// VpcConfig enables CodeBuild to access resources in an Amazon VPC. + /// + /// If you're using compute fleets during project creation, do not provide + /// vpcConfig. + /// Future createProject({ required ProjectArtifacts artifacts, required ProjectEnvironment environment, @@ -384,7 +618,7 @@ class CodeBuild { 'timeoutInMinutes', timeoutInMinutes, 5, - 480, + 2160, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -521,11 +755,22 @@ class CodeBuild { /// For a build to be triggered, at least one filter group in the /// filterGroups array must pass. For a filter group to pass, /// each of its filters must pass. + /// + /// Parameter [manualCreation] : + /// If manualCreation is true, CodeBuild doesn't create a webhook in GitHub + /// and instead returns payloadUrl and secret values + /// for the webhook. The payloadUrl and secret + /// values in the output can be used to manually create a webhook within + /// GitHub. + /// + /// manualCreation is only available for GitHub webhooks. + /// Future createWebhook({ required String projectName, String? branchFilter, WebhookBuildType? buildType, List>? filterGroups, + bool? manualCreation, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -542,6 +787,7 @@ class CodeBuild { if (branchFilter != null) 'branchFilter': branchFilter, if (buildType != null) 'buildType': buildType.toValue(), if (filterGroups != null) 'filterGroups': filterGroups, + if (manualCreation != null) 'manualCreation': manualCreation, }, ); @@ -575,6 +821,32 @@ class CodeBuild { return DeleteBuildBatchOutput.fromJson(jsonResponse.body); } + /// Deletes a compute fleet. When you delete a compute fleet, its builds are + /// not deleted. + /// + /// May throw [InvalidInputException]. + /// + /// Parameter [arn] : + /// The ARN of the compute fleet. + Future deleteFleet({ + required String arn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeBuild_20161006.DeleteFleet' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'arn': arn, + }, + ); + } + /// Deletes a build project. When you delete a project, its builds are not /// deleted. /// @@ -998,15 +1270,19 @@ class CodeBuild { /// /// Parameter [authType] : /// The type of authentication used to connect to a GitHub, GitHub Enterprise, - /// or Bitbucket repository. An OAUTH connection is not supported by the API - /// and must be created using the CodeBuild console. + /// GitLab, GitLab Self Managed, or Bitbucket repository. An OAUTH connection + /// is not supported by the API and must be created using the CodeBuild + /// console. Note that CODECONNECTIONS is only valid for GitLab and GitLab + /// Self Managed. /// /// Parameter [serverType] : /// The source provider used for this project. /// /// Parameter [token] : /// For GitHub or GitHub Enterprise, this is the personal access token. For - /// Bitbucket, this is the app password. + /// Bitbucket, this is either the access token or the app password. For the + /// authType CODECONNECTIONS, this is the + /// connectionArn. /// /// Parameter [shouldOverwrite] : /// Set to false to prevent overwriting the repository source @@ -1327,6 +1603,90 @@ class CodeBuild { return ListCuratedEnvironmentImagesOutput.fromJson(jsonResponse.body); } + /// Gets a list of compute fleet names with each compute fleet name + /// representing a single compute fleet. + /// + /// May throw [InvalidInputException]. + /// + /// Parameter [maxResults] : + /// The maximum number of paginated compute fleets returned per response. Use + /// nextToken to iterate pages in the list of returned compute + /// fleets. + /// + /// Parameter [nextToken] : + /// During a previous call, if there are more than 100 items in the list, only + /// the first 100 items are returned, along with a unique string called a + /// nextToken. To get the next batch of items in the list, call this + /// operation again, adding the next token to the call. To get all of the + /// items in the list, keep calling this operation with each subsequent next + /// token that is returned, until no more next tokens are returned. + /// + /// Parameter [sortBy] : + /// The criterion to be used to list compute fleet names. Valid values + /// include: + /// + ///
        + ///
      • + /// CREATED_TIME: List based on when each compute fleet was + /// created. + ///
      • + ///
      • + /// LAST_MODIFIED_TIME: List based on when information about each + /// compute fleet was last changed. + ///
      • + ///
      • + /// NAME: List based on each compute fleet's name. + ///
      • + ///
      + /// Use sortOrder to specify in what order to list the compute + /// fleet names based on the preceding criteria. + /// + /// Parameter [sortOrder] : + /// The order in which to list compute fleets. Valid values include: + /// + ///
        + ///
      • + /// ASCENDING: List in ascending order. + ///
      • + ///
      • + /// DESCENDING: List in descending order. + ///
      • + ///
      + /// Use sortBy to specify the criterion to be used to list + /// compute fleet names. + Future listFleets({ + int? maxResults, + String? nextToken, + FleetSortByType? sortBy, + SortOrderType? sortOrder, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeBuild_20161006.ListFleets' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (sortBy != null) 'sortBy': sortBy.toValue(), + if (sortOrder != null) 'sortOrder': sortOrder.toValue(), + }, + ); + + return ListFleetsOutput.fromJson(jsonResponse.body); + } + /// Gets a list of build project names, with each build project name /// representing a single build project. /// @@ -1897,7 +2257,14 @@ class CodeBuild { return RetryBuildBatchOutput.fromJson(jsonResponse.body); } - /// Starts running a build. + /// Starts running a build with the settings defined in the project. These + /// setting include: how to run a build, where to get the source code, which + /// build environment to use, which build commands to run, and where to store + /// the build output. + /// + /// You can also start a build run by overriding some of the build settings in + /// the project. The overrides only apply for that specific start build + /// request. The settings in the project are unaltered. /// /// May throw [InvalidInputException]. /// May throw [ResourceNotFoundException]. @@ -1917,8 +2284,9 @@ class CodeBuild { /// BITBUCKET. /// /// Parameter [buildspecOverride] : - /// A buildspec file declaration that overrides, for this build only, the - /// latest one already defined in the build project. + /// A buildspec file declaration that overrides the latest one defined in the + /// build project, for this build only. The buildspec defined on the project + /// is not changed. /// /// If this value is set, it can be either an inline buildspec definition, the /// path to an alternate buildspec file relative to the value of the built-in @@ -1931,6 +2299,13 @@ class CodeBuild { /// Buildspec /// File Name and Storage Location. + /// + /// Since this property allows you to change the build commands that will run + /// in the container, you should note that an IAM principal with the ability + /// to call this API and set this parameter can override the default settings. + /// Moreover, we encourage that you use a trustworthy buildspec location like + /// a file in your source repository or a Amazon S3 bucket. + /// /// /// Parameter [cacheOverride] : /// A ProjectCache object specified for this build that overrides the one @@ -1970,6 +2345,10 @@ class CodeBuild { /// A set of environment variables that overrides, for this build only, the /// latest ones already defined in the build project. /// + /// Parameter [fleetOverride] : + /// A ProjectFleet object specified for this build that overrides the one + /// defined in the build project. + /// /// Parameter [gitCloneDepthOverride] : /// The user-defined depth of history, with a minimum value of 0, that /// overrides, for this build only, any previous depth of history defined in @@ -2057,7 +2436,7 @@ class CodeBuild { /// Parameter [sourceAuthOverride] : /// An authorization type for this build that overrides the one defined in the /// build project. This override applies only if the build project's source is - /// BitBucket or GitHub. + /// BitBucket, GitHub, GitLab, or GitLab Self Managed. /// /// Parameter [sourceLocationOverride] : /// A location that overrides, for this build, the source location for the one @@ -2080,6 +2459,8 @@ class CodeBuild { /// example pr/25). If a branch name is specified, the branch's /// HEAD commit ID is used. If not specified, the default branch's HEAD commit /// ID is used. + ///
      GitLab
      + /// The commit ID, branch, or Git tag to use. ///
      Bitbucket
      /// The commit ID, branch name, or tag name that corresponds to the version of /// the source code you want to build. If a branch name is specified, the @@ -2097,7 +2478,7 @@ class CodeBuild { /// Version Sample with CodeBuild in the CodeBuild User Guide. /// /// Parameter [timeoutInMinutesOverride] : - /// The number of build timeout minutes, from 5 to 480 (8 hours), that + /// The number of build timeout minutes, from 5 to 2160 (36 hours), that /// overrides, for this build only, the latest setting already defined in the /// build project. Future startBuild({ @@ -2112,6 +2493,7 @@ class CodeBuild { String? encryptionKeyOverride, EnvironmentType? environmentTypeOverride, List? environmentVariablesOverride, + ProjectFleet? fleetOverride, int? gitCloneDepthOverride, GitSubmodulesConfig? gitSubmodulesConfigOverride, String? idempotencyToken, @@ -2149,7 +2531,7 @@ class CodeBuild { 'timeoutInMinutesOverride', timeoutInMinutesOverride, 5, - 480, + 2160, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2180,6 +2562,7 @@ class CodeBuild { 'environmentTypeOverride': environmentTypeOverride.toValue(), if (environmentVariablesOverride != null) 'environmentVariablesOverride': environmentVariablesOverride, + if (fleetOverride != null) 'fleetOverride': fleetOverride, if (gitCloneDepthOverride != null) 'gitCloneDepthOverride': gitCloneDepthOverride, if (gitSubmodulesConfigOverride != null) @@ -2456,7 +2839,7 @@ class CodeBuild { 'buildTimeoutInMinutesOverride', buildTimeoutInMinutesOverride, 5, - 480, + 2160, ); _s.validateNumRange( 'gitCloneDepthOverride', @@ -2599,24 +2982,224 @@ class CodeBuild { return StopBuildBatchOutput.fromJson(jsonResponse.body); } - /// Changes the settings of a build project. + /// Updates a compute fleet. /// /// May throw [InvalidInputException]. /// May throw [ResourceNotFoundException]. + /// May throw [AccountLimitExceededException]. /// - /// Parameter [name] : - /// The name of the build project. - /// - /// You cannot change a build project's name. - /// + /// Parameter [arn] : + /// The ARN of the compute fleet. /// - /// Parameter [artifacts] : - /// Information to be changed about the build output artifacts for the build - /// project. + /// Parameter [baseCapacity] : + /// The initial number of machines allocated to the compute fleet, which defines + /// the number of builds that can run in parallel. /// - /// Parameter [badgeEnabled] : - /// Set this to true to generate a publicly accessible URL for your project's - /// build badge. + /// Parameter [computeType] : + /// Information about the compute resources the compute fleet uses. Available + /// values include: + /// + ///
        + ///
      • + /// BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for + /// builds. + ///
      • + ///
      • + /// BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for + /// builds. + ///
      • + ///
      • + /// BUILD_GENERAL1_LARGE: Use up to 16 GB memory and 8 vCPUs for + /// builds, depending on your environment type. + ///
      • + ///
      • + /// BUILD_GENERAL1_XLARGE: Use up to 70 GB memory and 36 vCPUs + /// for builds, depending on your environment type. + ///
      • + ///
      • + /// BUILD_GENERAL1_2XLARGE: Use up to 145 GB memory, 72 vCPUs, + /// and 824 GB of SSD storage for builds. This compute type supports Docker + /// images up to 100 GB uncompressed. + ///
      • + ///
      + /// If you use BUILD_GENERAL1_SMALL: + /// + ///
        + ///
      • + /// For environment type LINUX_CONTAINER, you can use up to 3 GB + /// memory and 2 vCPUs for builds. + ///
      • + ///
      • + /// For environment type LINUX_GPU_CONTAINER, you can use up to + /// 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + ///
      • + ///
      • + /// For environment type ARM_CONTAINER, you can use up to 4 GB + /// memory and 2 vCPUs on ARM-based processors for builds. + ///
      • + ///
      + /// If you use BUILD_GENERAL1_LARGE: + /// + ///
        + ///
      • + /// For environment type LINUX_CONTAINER, you can use up to 15 GB + /// memory and 8 vCPUs for builds. + ///
      • + ///
      • + /// For environment type LINUX_GPU_CONTAINER, you can use up to + /// 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + ///
      • + ///
      • + /// For environment type ARM_CONTAINER, you can use up to 16 GB + /// memory and 8 vCPUs on ARM-based processors for builds. + ///
      • + ///
      + /// For more information, see Build + /// environment compute types in the CodeBuild User Guide. + /// + /// Parameter [environmentType] : + /// The environment type of the compute fleet. + /// + ///
        + ///
      • + /// The environment type ARM_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific + /// (Singapore), Asia Pacific (Sydney), EU (Frankfurt), and South America (São + /// Paulo). + ///
      • + ///
      • + /// The environment type LINUX_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), + /// Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific + /// (Mumbai). + ///
      • + ///
      • + /// The environment type LINUX_GPU_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific + /// (Sydney). + ///
      • + ///
      • + /// The environment type WINDOWS_SERVER_2019_CONTAINER is + /// available only in regions US East (N. Virginia), US East (Ohio), US West + /// (Oregon), Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific + /// (Mumbai) and EU (Ireland). + ///
      • + ///
      • + /// The environment type WINDOWS_SERVER_2022_CONTAINER is + /// available only in regions US East (N. Virginia), US East (Ohio), US West + /// (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Sydney), Asia + /// Pacific (Singapore), Asia Pacific (Tokyo), South America (São Paulo) and + /// Asia Pacific (Mumbai). + ///
      • + ///
      + /// For more information, see Build + /// environment compute types in the CodeBuild user guide. + /// + /// Parameter [fleetServiceRole] : + /// The service role associated with the compute fleet. For more information, + /// see + /// Allow a user to add a permission policy for a fleet service role in + /// the CodeBuild User Guide. + /// + /// Parameter [overflowBehavior] : + /// The compute fleet overflow behavior. + /// + /// + /// + /// Parameter [scalingConfiguration] : + /// The scaling configuration of the compute fleet. + /// + /// Parameter [tags] : + /// A list of tag key and value pairs associated with this compute fleet. + /// + /// These tags are available for use by Amazon Web Services services that + /// support CodeBuild build project tags. + Future updateFleet({ + required String arn, + int? baseCapacity, + ComputeType? computeType, + EnvironmentType? environmentType, + String? fleetServiceRole, + FleetOverflowBehavior? overflowBehavior, + ScalingConfigurationInput? scalingConfiguration, + List? tags, + VpcConfig? vpcConfig, + }) async { + _s.validateNumRange( + 'baseCapacity', + baseCapacity, + 1, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeBuild_20161006.UpdateFleet' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'arn': arn, + if (baseCapacity != null) 'baseCapacity': baseCapacity, + if (computeType != null) 'computeType': computeType.toValue(), + if (environmentType != null) + 'environmentType': environmentType.toValue(), + if (fleetServiceRole != null) 'fleetServiceRole': fleetServiceRole, + if (overflowBehavior != null) + 'overflowBehavior': overflowBehavior.toValue(), + if (scalingConfiguration != null) + 'scalingConfiguration': scalingConfiguration, + if (tags != null) 'tags': tags, + if (vpcConfig != null) 'vpcConfig': vpcConfig, + }, + ); + + return UpdateFleetOutput.fromJson(jsonResponse.body); + } + + /// Changes the settings of a build project. + /// + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [name] : + /// The name of the build project. + /// + /// You cannot change a build project's name. + /// + /// + /// Parameter [artifacts] : + /// Information to be changed about the build output artifacts for the build + /// project. + /// + /// Parameter [badgeEnabled] : + /// Set this to true to generate a publicly accessible URL for your project's + /// build badge. /// /// Parameter [cache] : /// Stores recently used information so that it can be quickly accessed at a @@ -2701,6 +3284,9 @@ class CodeBuild { /// specified, the default branch's HEAD commit ID is used. ///
    • ///
    • + /// For GitLab: the commit ID, branch, or Git tag to use. + ///
    • + ///
    • /// For Bitbucket: the commit ID, branch name, or tag name that corresponds to /// the version of the source code you want to build. If a branch name is /// specified, the branch's HEAD commit ID is used. If not specified, the @@ -2727,7 +3313,7 @@ class CodeBuild { /// support CodeBuild build project tags. /// /// Parameter [timeoutInMinutes] : - /// The replacement value in minutes, from 5 to 480 (8 hours), for CodeBuild + /// The replacement value in minutes, from 5 to 2160 (36 hours), for CodeBuild /// to wait before timing out any related build that did not get marked as /// completed. /// @@ -2766,7 +3352,7 @@ class CodeBuild { 'timeoutInMinutes', timeoutInMinutes, 5, - 480, + 2160, ); final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2833,8 +3419,7 @@ class CodeBuild { /// ///
        ///
      • - /// Do not store sensitive values, especially Amazon Web Services access key - /// IDs and secret access keys, in environment variables. We recommend that + /// Do not store sensitive values in environment variables. We recommend that /// you use an Amazon EC2 Systems Manager Parameter Store or Secrets Manager /// to store sensitive values. ///
      • @@ -3100,6 +3685,7 @@ enum AuthType { oauth, basicAuth, personalAccessToken, + codeconnections, } extension AuthTypeValueExtension on AuthType { @@ -3111,6 +3697,8 @@ extension AuthTypeValueExtension on AuthType { return 'BASIC_AUTH'; case AuthType.personalAccessToken: return 'PERSONAL_ACCESS_TOKEN'; + case AuthType.codeconnections: + return 'CODECONNECTIONS'; } } } @@ -3124,6 +3712,8 @@ extension AuthTypeFromString on String { return AuthType.basicAuth; case 'PERSONAL_ACCESS_TOKEN': return AuthType.personalAccessToken; + case 'CODECONNECTIONS': + return AuthType.codeconnections; } throw Exception('$this is not known in enum AuthType'); } @@ -3237,6 +3827,41 @@ class BatchGetBuildsOutput { } } +class BatchGetFleetsOutput { + /// Information about the requested compute fleets. + final List? fleets; + + /// The names of compute fleets for which information could not be found. + final List? fleetsNotFound; + + BatchGetFleetsOutput({ + this.fleets, + this.fleetsNotFound, + }); + + factory BatchGetFleetsOutput.fromJson(Map json) { + return BatchGetFleetsOutput( + fleets: (json['fleets'] as List?) + ?.whereNotNull() + .map((e) => Fleet.fromJson(e as Map)) + .toList(), + fleetsNotFound: (json['fleetsNotFound'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final fleets = this.fleets; + final fleetsNotFound = this.fleetsNotFound; + return { + if (fleets != null) 'fleets': fleets, + if (fleetsNotFound != null) 'fleetsNotFound': fleetsNotFound, + }; + } +} + class BatchGetProjectsOutput { /// Information about the requested build projects. final List? projects; @@ -3577,7 +4202,7 @@ class Build { /// codepipeline/my-demo-pipeline). /// ///
      • - /// If an IAM user started the build, the user's name (for example, + /// If a user started the build, the user's name (for example, /// MyUserName). ///
      • ///
      • @@ -3673,8 +4298,8 @@ class Build { /// When the build process started, expressed in Unix time format. final DateTime? startTime; - /// How long, in minutes, for CodeBuild to wait before timing out this build if - /// it does not get marked as completed. + /// How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait + /// before timing out this build if it does not get marked as completed. final int? timeoutInMinutes; /// If your CodeBuild project accesses resources in an Amazon VPC, you provide @@ -4030,7 +4655,7 @@ class BuildBatch { /// codepipeline/my-demo-pipeline). ///
      • ///
      • - /// If an IAM user started the build, the user's name. + /// If a user started the build, the user's name. ///
      • ///
      • /// If the Jenkins plugin for CodeBuild started the build, the string @@ -5134,7 +5759,13 @@ enum ComputeType { buildGeneral1Small, buildGeneral1Medium, buildGeneral1Large, + buildGeneral1Xlarge, buildGeneral1_2xlarge, + buildLambda_1gb, + buildLambda_2gb, + buildLambda_4gb, + buildLambda_8gb, + buildLambda_10gb, } extension ComputeTypeValueExtension on ComputeType { @@ -5146,8 +5777,20 @@ extension ComputeTypeValueExtension on ComputeType { return 'BUILD_GENERAL1_MEDIUM'; case ComputeType.buildGeneral1Large: return 'BUILD_GENERAL1_LARGE'; + case ComputeType.buildGeneral1Xlarge: + return 'BUILD_GENERAL1_XLARGE'; case ComputeType.buildGeneral1_2xlarge: return 'BUILD_GENERAL1_2XLARGE'; + case ComputeType.buildLambda_1gb: + return 'BUILD_LAMBDA_1GB'; + case ComputeType.buildLambda_2gb: + return 'BUILD_LAMBDA_2GB'; + case ComputeType.buildLambda_4gb: + return 'BUILD_LAMBDA_4GB'; + case ComputeType.buildLambda_8gb: + return 'BUILD_LAMBDA_8GB'; + case ComputeType.buildLambda_10gb: + return 'BUILD_LAMBDA_10GB'; } } } @@ -5161,13 +5804,49 @@ extension ComputeTypeFromString on String { return ComputeType.buildGeneral1Medium; case 'BUILD_GENERAL1_LARGE': return ComputeType.buildGeneral1Large; + case 'BUILD_GENERAL1_XLARGE': + return ComputeType.buildGeneral1Xlarge; case 'BUILD_GENERAL1_2XLARGE': return ComputeType.buildGeneral1_2xlarge; + case 'BUILD_LAMBDA_1GB': + return ComputeType.buildLambda_1gb; + case 'BUILD_LAMBDA_2GB': + return ComputeType.buildLambda_2gb; + case 'BUILD_LAMBDA_4GB': + return ComputeType.buildLambda_4gb; + case 'BUILD_LAMBDA_8GB': + return ComputeType.buildLambda_8gb; + case 'BUILD_LAMBDA_10GB': + return ComputeType.buildLambda_10gb; } throw Exception('$this is not known in enum ComputeType'); } } +class CreateFleetOutput { + /// Information about the compute fleet + final Fleet? fleet; + + CreateFleetOutput({ + this.fleet, + }); + + factory CreateFleetOutput.fromJson(Map json) { + return CreateFleetOutput( + fleet: json['fleet'] != null + ? Fleet.fromJson(json['fleet'] as Map) + : null, + ); + } + + Map toJson() { + final fleet = this.fleet; + return { + if (fleet != null) 'fleet': fleet, + }; + } +} + class CreateProjectOutput { /// Information about the build project that was created. final Project? project; @@ -5343,6 +6022,18 @@ class DeleteBuildBatchOutput { } } +class DeleteFleetOutput { + DeleteFleetOutput(); + + factory DeleteFleetOutput.fromJson(Map _) { + return DeleteFleetOutput(); + } + + Map toJson() { + return {}; + } +} + class DeleteProjectOutput { DeleteProjectOutput(); @@ -5613,6 +6304,8 @@ enum EnvironmentType { linuxGpuContainer, armContainer, windowsServer_2019Container, + linuxLambdaContainer, + armLambdaContainer, } extension EnvironmentTypeValueExtension on EnvironmentType { @@ -5628,6 +6321,10 @@ extension EnvironmentTypeValueExtension on EnvironmentType { return 'ARM_CONTAINER'; case EnvironmentType.windowsServer_2019Container: return 'WINDOWS_SERVER_2019_CONTAINER'; + case EnvironmentType.linuxLambdaContainer: + return 'LINUX_LAMBDA_CONTAINER'; + case EnvironmentType.armLambdaContainer: + return 'ARM_LAMBDA_CONTAINER'; } } } @@ -5645,6 +6342,10 @@ extension EnvironmentTypeFromString on String { return EnvironmentType.armContainer; case 'WINDOWS_SERVER_2019_CONTAINER': return EnvironmentType.windowsServer_2019Container; + case 'LINUX_LAMBDA_CONTAINER': + return EnvironmentType.linuxLambdaContainer; + case 'ARM_LAMBDA_CONTAINER': + return EnvironmentType.armLambdaContainer; } throw Exception('$this is not known in enum EnvironmentType'); } @@ -5659,9 +6360,9 @@ class EnvironmentVariable { /// /// We strongly discourage the use of PLAINTEXT environment /// variables to store sensitive values, especially Amazon Web Services secret - /// key IDs and secret access keys. PLAINTEXT environment variables - /// can be displayed in plain text using the CodeBuild console and the CLI. For - /// sensitive values, we recommend you use an environment variable of type + /// key IDs. PLAINTEXT environment variables can be displayed in + /// plain text using the CodeBuild console and the CLI. For sensitive values, we + /// recommend you use an environment variable of type /// PARAMETER_STORE or SECRETS_MANAGER. /// final String value; @@ -5671,8 +6372,11 @@ class EnvironmentVariable { ///
          ///
        • /// PARAMETER_STORE: An environment variable stored in Systems - /// Manager Parameter Store. To learn how to specify a parameter store - /// environment variable, see value of the EnvironmentVariable. + /// The parameter value will be substituted for the name at runtime. You can + /// also define Parameter Store environment variables in the buildspec. To learn + /// how to do so, see env/parameter-store /// in the CodeBuild User Guide. ///
        • @@ -5682,8 +6386,11 @@ class EnvironmentVariable { /// ///
        • /// SECRETS_MANAGER: An environment variable stored in Secrets - /// Manager. To learn how to specify a secrets manager environment variable, see - /// value of the EnvironmentVariable. The secret + /// value will be substituted for the name at runtime. You can also define + /// Secrets Manager environment variables in the buildspec. To learn how to do + /// so, see env/secrets-manager /// in the CodeBuild User Guide. ///
        • @@ -5770,48 +6477,568 @@ class ExportedEnvironmentVariable { /// The value assigned to the exported environment variable. final String? value; - ExportedEnvironmentVariable({ - this.name, - this.value, + ExportedEnvironmentVariable({ + this.name, + this.value, + }); + + factory ExportedEnvironmentVariable.fromJson(Map json) { + return ExportedEnvironmentVariable( + name: json['name'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final value = this.value; + return { + if (name != null) 'name': name, + if (value != null) 'value': value, + }; + } +} + +enum FileSystemType { + efs, +} + +extension FileSystemTypeValueExtension on FileSystemType { + String toValue() { + switch (this) { + case FileSystemType.efs: + return 'EFS'; + } + } +} + +extension FileSystemTypeFromString on String { + FileSystemType toFileSystemType() { + switch (this) { + case 'EFS': + return FileSystemType.efs; + } + throw Exception('$this is not known in enum FileSystemType'); + } +} + +/// A set of dedicated instances for your build environment. +class Fleet { + /// The ARN of the compute fleet. + final String? arn; + + /// The initial number of machines allocated to the compute fleet, which defines + /// the number of builds that can run in parallel. + final int? baseCapacity; + + /// Information about the compute resources the compute fleet uses. Available + /// values include: + /// + ///
            + ///
          • + /// BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for + /// builds. + ///
          • + ///
          • + /// BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for + /// builds. + ///
          • + ///
          • + /// BUILD_GENERAL1_LARGE: Use up to 16 GB memory and 8 vCPUs for + /// builds, depending on your environment type. + ///
          • + ///
          • + /// BUILD_GENERAL1_XLARGE: Use up to 70 GB memory and 36 vCPUs for + /// builds, depending on your environment type. + ///
          • + ///
          • + /// BUILD_GENERAL1_2XLARGE: Use up to 145 GB memory, 72 vCPUs, and + /// 824 GB of SSD storage for builds. This compute type supports Docker images + /// up to 100 GB uncompressed. + ///
          • + ///
          + /// If you use BUILD_GENERAL1_SMALL: + /// + ///
            + ///
          • + /// For environment type LINUX_CONTAINER, you can use up to 3 GB + /// memory and 2 vCPUs for builds. + ///
          • + ///
          • + /// For environment type LINUX_GPU_CONTAINER, you can use up to 16 + /// GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + ///
          • + ///
          • + /// For environment type ARM_CONTAINER, you can use up to 4 GB + /// memory and 2 vCPUs on ARM-based processors for builds. + ///
          • + ///
          + /// If you use BUILD_GENERAL1_LARGE: + /// + ///
            + ///
          • + /// For environment type LINUX_CONTAINER, you can use up to 15 GB + /// memory and 8 vCPUs for builds. + ///
          • + ///
          • + /// For environment type LINUX_GPU_CONTAINER, you can use up to 255 + /// GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + ///
          • + ///
          • + /// For environment type ARM_CONTAINER, you can use up to 16 GB + /// memory and 8 vCPUs on ARM-based processors for builds. + ///
          • + ///
          + /// For more information, see Build + /// environment compute types in the CodeBuild User Guide. + final ComputeType? computeType; + + /// The time at which the compute fleet was created. + final DateTime? created; + + /// The environment type of the compute fleet. + /// + ///
            + ///
          • + /// The environment type ARM_CONTAINER is available only in regions + /// US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia + /// Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia + /// Pacific (Sydney), EU (Frankfurt), and South America (São Paulo). + ///
          • + ///
          • + /// The environment type LINUX_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), + /// Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai). + ///
          • + ///
          • + /// The environment type LINUX_GPU_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney). + ///
          • + ///
          • + /// The environment type WINDOWS_SERVER_2019_CONTAINER is available + /// only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), + /// Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU + /// (Ireland). + ///
          • + ///
          • + /// The environment type WINDOWS_SERVER_2022_CONTAINER is available + /// only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU + /// (Ireland), EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), + /// Asia Pacific (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai). + ///
          • + ///
          + /// For more information, see Build + /// environment compute types in the CodeBuild user guide. + final EnvironmentType? environmentType; + + /// The service role associated with the compute fleet. For more information, + /// see + /// Allow a user to add a permission policy for a fleet service role in the + /// CodeBuild User Guide. + final String? fleetServiceRole; + + /// The ID of the compute fleet. + final String? id; + + /// The time at which the compute fleet was last modified. + final DateTime? lastModified; + + /// The name of the compute fleet. + final String? name; + + /// The compute fleet overflow behavior. + /// + /// + final FleetOverflowBehavior? overflowBehavior; + + /// The scaling configuration of the compute fleet. + final ScalingConfigurationOutput? scalingConfiguration; + + /// The status of the compute fleet. + final FleetStatus? status; + + /// A list of tag key and value pairs associated with this compute fleet. + /// + /// These tags are available for use by Amazon Web Services services that + /// support CodeBuild build project tags. + final List? tags; + final VpcConfig? vpcConfig; + + Fleet({ + this.arn, + this.baseCapacity, + this.computeType, + this.created, + this.environmentType, + this.fleetServiceRole, + this.id, + this.lastModified, + this.name, + this.overflowBehavior, + this.scalingConfiguration, + this.status, + this.tags, + this.vpcConfig, + }); + + factory Fleet.fromJson(Map json) { + return Fleet( + arn: json['arn'] as String?, + baseCapacity: json['baseCapacity'] as int?, + computeType: (json['computeType'] as String?)?.toComputeType(), + created: timeStampFromJson(json['created']), + environmentType: + (json['environmentType'] as String?)?.toEnvironmentType(), + fleetServiceRole: json['fleetServiceRole'] as String?, + id: json['id'] as String?, + lastModified: timeStampFromJson(json['lastModified']), + name: json['name'] as String?, + overflowBehavior: + (json['overflowBehavior'] as String?)?.toFleetOverflowBehavior(), + scalingConfiguration: json['scalingConfiguration'] != null + ? ScalingConfigurationOutput.fromJson( + json['scalingConfiguration'] as Map) + : null, + status: json['status'] != null + ? FleetStatus.fromJson(json['status'] as Map) + : null, + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + vpcConfig: json['vpcConfig'] != null + ? VpcConfig.fromJson(json['vpcConfig'] as Map) + : null, + ); + } + + Map toJson() { + final arn = this.arn; + final baseCapacity = this.baseCapacity; + final computeType = this.computeType; + final created = this.created; + final environmentType = this.environmentType; + final fleetServiceRole = this.fleetServiceRole; + final id = this.id; + final lastModified = this.lastModified; + final name = this.name; + final overflowBehavior = this.overflowBehavior; + final scalingConfiguration = this.scalingConfiguration; + final status = this.status; + final tags = this.tags; + final vpcConfig = this.vpcConfig; + return { + if (arn != null) 'arn': arn, + if (baseCapacity != null) 'baseCapacity': baseCapacity, + if (computeType != null) 'computeType': computeType.toValue(), + if (created != null) 'created': unixTimestampToJson(created), + if (environmentType != null) 'environmentType': environmentType.toValue(), + if (fleetServiceRole != null) 'fleetServiceRole': fleetServiceRole, + if (id != null) 'id': id, + if (lastModified != null) + 'lastModified': unixTimestampToJson(lastModified), + if (name != null) 'name': name, + if (overflowBehavior != null) + 'overflowBehavior': overflowBehavior.toValue(), + if (scalingConfiguration != null) + 'scalingConfiguration': scalingConfiguration, + if (status != null) 'status': status, + if (tags != null) 'tags': tags, + if (vpcConfig != null) 'vpcConfig': vpcConfig, + }; + } +} + +enum FleetContextCode { + createFailed, + updateFailed, + actionRequired, +} + +extension FleetContextCodeValueExtension on FleetContextCode { + String toValue() { + switch (this) { + case FleetContextCode.createFailed: + return 'CREATE_FAILED'; + case FleetContextCode.updateFailed: + return 'UPDATE_FAILED'; + case FleetContextCode.actionRequired: + return 'ACTION_REQUIRED'; + } + } +} + +extension FleetContextCodeFromString on String { + FleetContextCode toFleetContextCode() { + switch (this) { + case 'CREATE_FAILED': + return FleetContextCode.createFailed; + case 'UPDATE_FAILED': + return FleetContextCode.updateFailed; + case 'ACTION_REQUIRED': + return FleetContextCode.actionRequired; + } + throw Exception('$this is not known in enum FleetContextCode'); + } +} + +enum FleetOverflowBehavior { + queue, + onDemand, +} + +extension FleetOverflowBehaviorValueExtension on FleetOverflowBehavior { + String toValue() { + switch (this) { + case FleetOverflowBehavior.queue: + return 'QUEUE'; + case FleetOverflowBehavior.onDemand: + return 'ON_DEMAND'; + } + } +} + +extension FleetOverflowBehaviorFromString on String { + FleetOverflowBehavior toFleetOverflowBehavior() { + switch (this) { + case 'QUEUE': + return FleetOverflowBehavior.queue; + case 'ON_DEMAND': + return FleetOverflowBehavior.onDemand; + } + throw Exception('$this is not known in enum FleetOverflowBehavior'); + } +} + +enum FleetScalingMetricType { + fleetUtilizationRate, +} + +extension FleetScalingMetricTypeValueExtension on FleetScalingMetricType { + String toValue() { + switch (this) { + case FleetScalingMetricType.fleetUtilizationRate: + return 'FLEET_UTILIZATION_RATE'; + } + } +} + +extension FleetScalingMetricTypeFromString on String { + FleetScalingMetricType toFleetScalingMetricType() { + switch (this) { + case 'FLEET_UTILIZATION_RATE': + return FleetScalingMetricType.fleetUtilizationRate; + } + throw Exception('$this is not known in enum FleetScalingMetricType'); + } +} + +enum FleetScalingType { + targetTrackingScaling, +} + +extension FleetScalingTypeValueExtension on FleetScalingType { + String toValue() { + switch (this) { + case FleetScalingType.targetTrackingScaling: + return 'TARGET_TRACKING_SCALING'; + } + } +} + +extension FleetScalingTypeFromString on String { + FleetScalingType toFleetScalingType() { + switch (this) { + case 'TARGET_TRACKING_SCALING': + return FleetScalingType.targetTrackingScaling; + } + throw Exception('$this is not known in enum FleetScalingType'); + } +} + +enum FleetSortByType { + name, + createdTime, + lastModifiedTime, +} + +extension FleetSortByTypeValueExtension on FleetSortByType { + String toValue() { + switch (this) { + case FleetSortByType.name: + return 'NAME'; + case FleetSortByType.createdTime: + return 'CREATED_TIME'; + case FleetSortByType.lastModifiedTime: + return 'LAST_MODIFIED_TIME'; + } + } +} + +extension FleetSortByTypeFromString on String { + FleetSortByType toFleetSortByType() { + switch (this) { + case 'NAME': + return FleetSortByType.name; + case 'CREATED_TIME': + return FleetSortByType.createdTime; + case 'LAST_MODIFIED_TIME': + return FleetSortByType.lastModifiedTime; + } + throw Exception('$this is not known in enum FleetSortByType'); + } +} + +/// The status of the compute fleet. +class FleetStatus { + /// Additional information about a compute fleet. Valid values include: + /// + ///
            + ///
          • + /// CREATE_FAILED: The compute fleet has failed to create. + ///
          • + ///
          • + /// UPDATE_FAILED: The compute fleet has failed to update. + ///
          • + ///
          + final FleetContextCode? context; + + /// A message associated with the status of a compute fleet. + final String? message; + + /// The status code of the compute fleet. Valid values include: + /// + ///
            + ///
          • + /// CREATING: The compute fleet is being created. + ///
          • + ///
          • + /// UPDATING: The compute fleet is being updated. + ///
          • + ///
          • + /// ROTATING: The compute fleet is being rotated. + ///
          • + ///
          • + /// PENDING_DELETION: The compute fleet is pending deletion. + ///
          • + ///
          • + /// DELETING: The compute fleet is being deleted. + ///
          • + ///
          • + /// CREATE_FAILED: The compute fleet has failed to create. + ///
          • + ///
          • + /// UPDATE_ROLLBACK_FAILED: The compute fleet has failed to update + /// and could not rollback to previous state. + ///
          • + ///
          • + /// ACTIVE: The compute fleet has succeeded and is active. + ///
          • + ///
          + final FleetStatusCode? statusCode; + + FleetStatus({ + this.context, + this.message, + this.statusCode, }); - factory ExportedEnvironmentVariable.fromJson(Map json) { - return ExportedEnvironmentVariable( - name: json['name'] as String?, - value: json['value'] as String?, + factory FleetStatus.fromJson(Map json) { + return FleetStatus( + context: (json['context'] as String?)?.toFleetContextCode(), + message: json['message'] as String?, + statusCode: (json['statusCode'] as String?)?.toFleetStatusCode(), ); } Map toJson() { - final name = this.name; - final value = this.value; + final context = this.context; + final message = this.message; + final statusCode = this.statusCode; return { - if (name != null) 'name': name, - if (value != null) 'value': value, + if (context != null) 'context': context.toValue(), + if (message != null) 'message': message, + if (statusCode != null) 'statusCode': statusCode.toValue(), }; } } -enum FileSystemType { - efs, +enum FleetStatusCode { + creating, + updating, + rotating, + pendingDeletion, + deleting, + createFailed, + updateRollbackFailed, + active, } -extension FileSystemTypeValueExtension on FileSystemType { +extension FleetStatusCodeValueExtension on FleetStatusCode { String toValue() { switch (this) { - case FileSystemType.efs: - return 'EFS'; + case FleetStatusCode.creating: + return 'CREATING'; + case FleetStatusCode.updating: + return 'UPDATING'; + case FleetStatusCode.rotating: + return 'ROTATING'; + case FleetStatusCode.pendingDeletion: + return 'PENDING_DELETION'; + case FleetStatusCode.deleting: + return 'DELETING'; + case FleetStatusCode.createFailed: + return 'CREATE_FAILED'; + case FleetStatusCode.updateRollbackFailed: + return 'UPDATE_ROLLBACK_FAILED'; + case FleetStatusCode.active: + return 'ACTIVE'; } } } -extension FileSystemTypeFromString on String { - FileSystemType toFileSystemType() { +extension FleetStatusCodeFromString on String { + FleetStatusCode toFleetStatusCode() { switch (this) { - case 'EFS': - return FileSystemType.efs; + case 'CREATING': + return FleetStatusCode.creating; + case 'UPDATING': + return FleetStatusCode.updating; + case 'ROTATING': + return FleetStatusCode.rotating; + case 'PENDING_DELETION': + return FleetStatusCode.pendingDeletion; + case 'DELETING': + return FleetStatusCode.deleting; + case 'CREATE_FAILED': + return FleetStatusCode.createFailed; + case 'UPDATE_ROLLBACK_FAILED': + return FleetStatusCode.updateRollbackFailed; + case 'ACTIVE': + return FleetStatusCode.active; } - throw Exception('$this is not known in enum FileSystemType'); + throw Exception('$this is not known in enum FleetStatusCode'); } } @@ -6192,6 +7419,41 @@ class ListCuratedEnvironmentImagesOutput { } } +class ListFleetsOutput { + /// The list of compute fleet names. + final List? fleets; + + /// If there are more than 100 items in the list, only the first 100 items are + /// returned, along with a unique string called a nextToken. To get the + /// next batch of items in the list, call this operation again, adding the next + /// token to the call. + final String? nextToken; + + ListFleetsOutput({ + this.fleets, + this.nextToken, + }); + + factory ListFleetsOutput.fromJson(Map json) { + return ListFleetsOutput( + fleets: (json['fleets'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final fleets = this.fleets; + final nextToken = this.nextToken; + return { + if (fleets != null) 'fleets': fleets, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListProjectsOutput { /// If there are more than 100 items in the list, only the first 100 items are /// returned, along with a unique string called a nextToken. To get the @@ -6521,14 +7783,18 @@ class LogsLocation { /// Information about CloudWatch Logs for a build project. final CloudWatchLogsConfig? cloudWatchLogs; - /// The ARN of CloudWatch Logs for a build project. Its format is + /// The ARN of the CloudWatch Logs stream for a build execution. Its format is /// arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}. - /// For more information, see Resources /// Defined by CloudWatch Logs. final String? cloudWatchLogsArn; - /// The URL to an individual build log in CloudWatch Logs. + /// The URL to an individual build log in CloudWatch Logs. The log stream is + /// created during the PROVISIONING phase of a build and the + /// deeplink will not be valid until it is created. final String? deepLink; /// The name of the CloudWatch Logs group for the build logs. @@ -6812,6 +8078,9 @@ class Project { /// specified, the default branch's HEAD commit ID is used. /// ///
        • + /// For GitLab: the commit ID, branch, or Git tag to use. + ///
        • + ///
        • /// For Bitbucket: the commit ID, branch name, or tag name that corresponds to /// the version of the source code you want to build. If a branch name is /// specified, the branch's HEAD commit ID is used. If not specified, the @@ -6837,9 +8106,9 @@ class Project { /// support CodeBuild build project tags. final List? tags; - /// How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before - /// timing out any related build that did not get marked as completed. The - /// default is 60 minutes. + /// How long, in minutes, from 5 to 2160 (36 hours), for CodeBuild to wait + /// before timing out any related build that did not get marked as completed. + /// The default is 60 minutes. final int? timeoutInMinutes; /// Information about the VPC configuration that CodeBuild accesses. @@ -7488,10 +8757,55 @@ class ProjectEnvironment { /// builds, depending on your environment type. ///
        • ///
        • + /// BUILD_GENERAL1_XLARGE: Use up to 70 GB memory and 36 vCPUs for + /// builds, depending on your environment type. + ///
        • + ///
        • /// BUILD_GENERAL1_2XLARGE: Use up to 145 GB memory, 72 vCPUs, and /// 824 GB of SSD storage for builds. This compute type supports Docker images /// up to 100 GB uncompressed. ///
        • + ///
        • + /// BUILD_LAMBDA_1GB: Use up to 1 GB memory for builds. Only + /// available for environment type LINUX_LAMBDA_CONTAINER and + /// ARM_LAMBDA_CONTAINER. + ///
        • + ///
        • + /// BUILD_LAMBDA_2GB: Use up to 2 GB memory for builds. Only + /// available for environment type LINUX_LAMBDA_CONTAINER and + /// ARM_LAMBDA_CONTAINER. + ///
        • + ///
        • + /// BUILD_LAMBDA_4GB: Use up to 4 GB memory for builds. Only + /// available for environment type LINUX_LAMBDA_CONTAINER and + /// ARM_LAMBDA_CONTAINER. + ///
        • + ///
        • + /// BUILD_LAMBDA_8GB: Use up to 8 GB memory for builds. Only + /// available for environment type LINUX_LAMBDA_CONTAINER and + /// ARM_LAMBDA_CONTAINER. + ///
        • + ///
        • + /// BUILD_LAMBDA_10GB: Use up to 10 GB memory for builds. Only + /// available for environment type LINUX_LAMBDA_CONTAINER and + /// ARM_LAMBDA_CONTAINER. + ///
        • + ///
        + /// If you use BUILD_GENERAL1_SMALL: + /// + ///
          + ///
        • + /// For environment type LINUX_CONTAINER, you can use up to 3 GB + /// memory and 2 vCPUs for builds. + ///
        • + ///
        • + /// For environment type LINUX_GPU_CONTAINER, you can use up to 16 + /// GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + ///
        • + ///
        • + /// For environment type ARM_CONTAINER, you can use up to 4 GB + /// memory and 2 vCPUs on ARM-based processors for builds. + ///
        • ///
        /// If you use BUILD_GENERAL1_LARGE: /// @@ -7508,7 +8822,10 @@ class ProjectEnvironment { /// For environment type ARM_CONTAINER, you can use up to 16 GB /// memory and 8 vCPUs on ARM-based processors for builds. ///
      • - ///
      + ///
    + /// If you're using compute fleets during project creation, + /// computeType will be ignored. + /// /// For more information, see Build /// Environment Compute Types in the CodeBuild User Guide. @@ -7548,12 +8865,11 @@ class ProjectEnvironment { /// (Frankfurt). /// ///
  • - /// The environment type LINUX_CONTAINER with compute type - /// build.general1.2xlarge is available only in regions US East (N. - /// Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), - /// EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), - /// Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China - /// (Ningxia). + /// The environment type LINUX_CONTAINER is available only in + /// regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada + /// (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), + /// Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China + /// (Beijing), and China (Ningxia). ///
  • ///
  • /// The environment type LINUX_GPU_CONTAINER is available only in @@ -7565,11 +8881,23 @@ class ProjectEnvironment { /// ///
      ///
    • + /// The environment types ARM_LAMBDA_CONTAINER and + /// LINUX_LAMBDA_CONTAINER are available only in regions US East + /// (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia + /// Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU + /// (Frankfurt), EU (Ireland), and South America (São Paulo). + ///
    • + ///
    + ///
      + ///
    • /// The environment types WINDOWS_CONTAINER and /// WINDOWS_SERVER_2019_CONTAINER are available only in regions US /// East (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland). ///
    • - ///
    + /// + /// If you're using compute fleets during project creation, type + /// will be ignored. + /// /// For more information, see Build /// environment compute types in the CodeBuild user guide. @@ -7586,6 +8914,9 @@ class ProjectEnvironment { /// project. final List? environmentVariables; + /// A ProjectFleet object to use for this build project. + final ProjectFleet? fleet; + /// The type of credentials CodeBuild uses to pull images in your build. There /// are two valid values: /// @@ -7642,6 +8973,7 @@ class ProjectEnvironment { required this.type, this.certificate, this.environmentVariables, + this.fleet, this.imagePullCredentialsType, this.privilegedMode, this.registryCredential, @@ -7657,6 +8989,9 @@ class ProjectEnvironment { ?.whereNotNull() .map((e) => EnvironmentVariable.fromJson(e as Map)) .toList(), + fleet: json['fleet'] != null + ? ProjectFleet.fromJson(json['fleet'] as Map) + : null, imagePullCredentialsType: (json['imagePullCredentialsType'] as String?) ?.toImagePullCredentialsType(), privilegedMode: json['privilegedMode'] as bool?, @@ -7673,6 +9008,7 @@ class ProjectEnvironment { final type = this.type; final certificate = this.certificate; final environmentVariables = this.environmentVariables; + final fleet = this.fleet; final imagePullCredentialsType = this.imagePullCredentialsType; final privilegedMode = this.privilegedMode; final registryCredential = this.registryCredential; @@ -7683,6 +9019,7 @@ class ProjectEnvironment { if (certificate != null) 'certificate': certificate, if (environmentVariables != null) 'environmentVariables': environmentVariables, + if (fleet != null) 'fleet': fleet, if (imagePullCredentialsType != null) 'imagePullCredentialsType': imagePullCredentialsType.toValue(), if (privilegedMode != null) 'privilegedMode': privilegedMode, @@ -7768,6 +9105,32 @@ class ProjectFileSystemLocation { } } +/// Information about the compute fleet of the build project. For more +/// information, see Working +/// with reserved capacity in CodeBuild. +class ProjectFleet { + /// Specifies the compute fleet ARN for the build project. + final String? fleetArn; + + ProjectFleet({ + this.fleetArn, + }); + + factory ProjectFleet.fromJson(Map json) { + return ProjectFleet( + fleetArn: json['fleetArn'] as String?, + ); + } + + Map toJson() { + final fleetArn = this.fleetArn; + return { + if (fleetArn != null) 'fleetArn': fleetArn, + }; + } +} + enum ProjectSortByType { name, createdTime, @@ -7818,14 +9181,20 @@ class ProjectSource { /// source action of a pipeline in CodePipeline. ///
  • ///
  • - /// GITHUB: The source code is in a GitHub or GitHub Enterprise - /// Cloud repository. + /// GITHUB: The source code is in a GitHub repository. ///
  • ///
  • /// GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise /// Server repository. ///
  • ///
  • + /// GITLAB: The source code is in a GitLab repository. + ///
  • + ///
  • + /// GITLAB_SELF_MANAGED: The source code is in a self-managed + /// GitLab repository. + ///
  • + ///
  • /// NO_SOURCE: The project does not have input source code. ///
  • ///
  • @@ -7915,6 +9284,21 @@ class ProjectSource { /// auth object's type value to OAUTH. ///
  • ///
  • + /// For source code in an GitLab or self-managed GitLab repository, the HTTPS + /// clone URL to the repository that contains the source and the buildspec file. + /// You must connect your Amazon Web Services account to your GitLab account. + /// Use the CodeBuild console to start creating a build project. When you use + /// the console to connect (or reconnect) with GitLab, on the Connections + /// Authorize application page, choose Authorize. Then on the + /// CodeConnections Create GitLab connection page, choose Connect to + /// GitLab. (After you have connected to your GitLab account, you do not + /// need to finish creating the build project. You can leave the CodeBuild + /// console.) To instruct CodeBuild to override the default connection and use + /// this connection instead, set the auth object's + /// type value to CODECONNECTIONS in the + /// source object. + ///
  • + ///
  • /// For source code in a Bitbucket repository, the HTTPS clone URL to the /// repository that contains the source and the buildspec file. You must connect /// your Amazon Web Services account to your Bitbucket account. Use the @@ -7935,8 +9319,9 @@ class ProjectSource { /// Set to true to report the status of a build's start and finish to your /// source provider. This option is valid only when your source provider is - /// GitHub, GitHub Enterprise, or Bitbucket. If this is set and you use a - /// different source provider, an invalidInputException is thrown. + /// GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket. If + /// this is set and you use a different source provider, an + /// invalidInputException is thrown. /// /// To be able to report the build status to the source provider, the user /// associated with the source provider must have write access to the repo. If @@ -8043,6 +9428,9 @@ class ProjectSourceVersion { /// specified, the default branch's HEAD commit ID is used. ///
  • ///
  • + /// For GitLab: the commit ID, branch, or Git tag to use. + ///
  • + ///
  • /// For Bitbucket: the commit ID, branch name, or tag name that corresponds to /// the version of the source code you want to build. If a branch name is /// specified, the branch's HEAD commit ID is used. If not specified, the @@ -9063,10 +10451,92 @@ class S3ReportExportConfig { } } +/// The scaling configuration input of a compute fleet. +class ScalingConfigurationInput { + /// The maximum number of instances in the fleet when auto-scaling. + final int? maxCapacity; + + /// The scaling type for a compute fleet. + final FleetScalingType? scalingType; + + /// A list of TargetTrackingScalingConfiguration objects. + final List? targetTrackingScalingConfigs; + + ScalingConfigurationInput({ + this.maxCapacity, + this.scalingType, + this.targetTrackingScalingConfigs, + }); + + Map toJson() { + final maxCapacity = this.maxCapacity; + final scalingType = this.scalingType; + final targetTrackingScalingConfigs = this.targetTrackingScalingConfigs; + return { + if (maxCapacity != null) 'maxCapacity': maxCapacity, + if (scalingType != null) 'scalingType': scalingType.toValue(), + if (targetTrackingScalingConfigs != null) + 'targetTrackingScalingConfigs': targetTrackingScalingConfigs, + }; + } +} + +/// The scaling configuration output of a compute fleet. +class ScalingConfigurationOutput { + /// The desired number of instances in the fleet when auto-scaling. + final int? desiredCapacity; + + /// The maximum number of instances in the fleet when auto-scaling. + final int? maxCapacity; + + /// The scaling type for a compute fleet. + final FleetScalingType? scalingType; + + /// A list of TargetTrackingScalingConfiguration objects. + final List? targetTrackingScalingConfigs; + + ScalingConfigurationOutput({ + this.desiredCapacity, + this.maxCapacity, + this.scalingType, + this.targetTrackingScalingConfigs, + }); + + factory ScalingConfigurationOutput.fromJson(Map json) { + return ScalingConfigurationOutput( + desiredCapacity: json['desiredCapacity'] as int?, + maxCapacity: json['maxCapacity'] as int?, + scalingType: (json['scalingType'] as String?)?.toFleetScalingType(), + targetTrackingScalingConfigs: + (json['targetTrackingScalingConfigs'] as List?) + ?.whereNotNull() + .map((e) => TargetTrackingScalingConfiguration.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final desiredCapacity = this.desiredCapacity; + final maxCapacity = this.maxCapacity; + final scalingType = this.scalingType; + final targetTrackingScalingConfigs = this.targetTrackingScalingConfigs; + return { + if (desiredCapacity != null) 'desiredCapacity': desiredCapacity, + if (maxCapacity != null) 'maxCapacity': maxCapacity, + if (scalingType != null) 'scalingType': scalingType.toValue(), + if (targetTrackingScalingConfigs != null) + 'targetTrackingScalingConfigs': targetTrackingScalingConfigs, + }; + } +} + enum ServerType { github, bitbucket, githubEnterprise, + gitlab, + gitlabSelfManaged, } extension ServerTypeValueExtension on ServerType { @@ -9078,6 +10548,10 @@ extension ServerTypeValueExtension on ServerType { return 'BITBUCKET'; case ServerType.githubEnterprise: return 'GITHUB_ENTERPRISE'; + case ServerType.gitlab: + return 'GITLAB'; + case ServerType.gitlabSelfManaged: + return 'GITLAB_SELF_MANAGED'; } } } @@ -9091,6 +10565,10 @@ extension ServerTypeFromString on String { return ServerType.bitbucket; case 'GITHUB_ENTERPRISE': return ServerType.githubEnterprise; + case 'GITLAB': + return ServerType.gitlab; + case 'GITLAB_SELF_MANAGED': + return ServerType.gitlabSelfManaged; } throw Exception('$this is not known in enum ServerType'); } @@ -9158,11 +10636,7 @@ extension SortOrderTypeFromString on String { /// This information is for the CodeBuild console's use only. Your code should /// not get or set this information directly. class SourceAuth { - /// - /// This data type is deprecated and is no longer accurate or used. - /// - /// The authorization type to use. The only valid value is OAUTH, - /// which represents the OAuth authorization type. + /// The authorization type to use. Valid options are OAUTH or CODECONNECTIONS. final SourceAuthType type; /// The resource value that applies to the specified authorization type. @@ -9192,6 +10666,7 @@ class SourceAuth { enum SourceAuthType { oauth, + codeconnections, } extension SourceAuthTypeValueExtension on SourceAuthType { @@ -9199,6 +10674,8 @@ extension SourceAuthTypeValueExtension on SourceAuthType { switch (this) { case SourceAuthType.oauth: return 'OAUTH'; + case SourceAuthType.codeconnections: + return 'CODECONNECTIONS'; } } } @@ -9208,28 +10685,35 @@ extension SourceAuthTypeFromString on String { switch (this) { case 'OAUTH': return SourceAuthType.oauth; + case 'CODECONNECTIONS': + return SourceAuthType.codeconnections; } throw Exception('$this is not known in enum SourceAuthType'); } } -/// Information about the credentials for a GitHub, GitHub Enterprise, or -/// Bitbucket repository. +/// Information about the credentials for a GitHub, GitHub Enterprise, GitLab, +/// GitLab Self Managed, or Bitbucket repository. class SourceCredentialsInfo { /// The Amazon Resource Name (ARN) of the token. final String? arn; /// The type of authentication used by the credentials. Valid options are OAUTH, - /// BASIC_AUTH, or PERSONAL_ACCESS_TOKEN. + /// BASIC_AUTH, PERSONAL_ACCESS_TOKEN, or CODECONNECTIONS. final AuthType? authType; + /// The connection ARN if your serverType type is GITLAB or GITLAB_SELF_MANAGED + /// and your authType is CODECONNECTIONS. + final String? resource; + /// The type of source provider. The valid options are GITHUB, - /// GITHUB_ENTERPRISE, or BITBUCKET. + /// GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET. final ServerType? serverType; SourceCredentialsInfo({ this.arn, this.authType, + this.resource, this.serverType, }); @@ -9237,6 +10721,7 @@ class SourceCredentialsInfo { return SourceCredentialsInfo( arn: json['arn'] as String?, authType: (json['authType'] as String?)?.toAuthType(), + resource: json['resource'] as String?, serverType: (json['serverType'] as String?)?.toServerType(), ); } @@ -9244,10 +10729,12 @@ class SourceCredentialsInfo { Map toJson() { final arn = this.arn; final authType = this.authType; + final resource = this.resource; final serverType = this.serverType; return { if (arn != null) 'arn': arn, if (authType != null) 'authType': authType.toValue(), + if (resource != null) 'resource': resource, if (serverType != null) 'serverType': serverType.toValue(), }; } @@ -9257,6 +10744,8 @@ enum SourceType { codecommit, codepipeline, github, + gitlab, + gitlabSelfManaged, s3, bitbucket, githubEnterprise, @@ -9272,6 +10761,10 @@ extension SourceTypeValueExtension on SourceType { return 'CODEPIPELINE'; case SourceType.github: return 'GITHUB'; + case SourceType.gitlab: + return 'GITLAB'; + case SourceType.gitlabSelfManaged: + return 'GITLAB_SELF_MANAGED'; case SourceType.s3: return 'S3'; case SourceType.bitbucket: @@ -9293,6 +10786,10 @@ extension SourceTypeFromString on String { return SourceType.codepipeline; case 'GITHUB': return SourceType.github; + case 'GITLAB': + return SourceType.gitlab; + case 'GITLAB_SELF_MANAGED': + return SourceType.gitlabSelfManaged; case 'S3': return SourceType.s3; case 'BITBUCKET': @@ -9483,6 +10980,37 @@ class Tag { } } +/// Defines when a new instance is auto-scaled into the compute fleet. +class TargetTrackingScalingConfiguration { + /// The metric type to determine auto-scaling. + final FleetScalingMetricType? metricType; + + /// The value of metricType when to start scaling. + final double? targetValue; + + TargetTrackingScalingConfiguration({ + this.metricType, + this.targetValue, + }); + + factory TargetTrackingScalingConfiguration.fromJson( + Map json) { + return TargetTrackingScalingConfiguration( + metricType: (json['metricType'] as String?)?.toFleetScalingMetricType(), + targetValue: json['targetValue'] as double?, + ); + } + + Map toJson() { + final metricType = this.metricType; + final targetValue = this.targetValue; + return { + if (metricType != null) 'metricType': metricType.toValue(), + if (targetValue != null) 'targetValue': targetValue, + }; + } +} + /// Information about a test case created using a framework such as NUnit or /// Cucumber. A test case might be a unit test or a configuration test. class TestCase { @@ -9650,6 +11178,30 @@ class TestReportSummary { } } +class UpdateFleetOutput { + /// A Fleet object. + final Fleet? fleet; + + UpdateFleetOutput({ + this.fleet, + }); + + factory UpdateFleetOutput.fromJson(Map json) { + return UpdateFleetOutput( + fleet: json['fleet'] != null + ? Fleet.fromJson(json['fleet'] as Map) + : null, + ); + } + + Map toJson() { + final fleet = this.fleet; + return { + if (fleet != null) 'fleet': fleet, + }; + } +} + class UpdateProjectOutput { /// Information about the build project that was changed. final Project? project; @@ -9831,6 +11383,15 @@ class Webhook { /// modified. final DateTime? lastModifiedSecret; + /// If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and + /// instead returns payloadUrl and secret values for + /// the webhook. The payloadUrl and secret values in + /// the output can be used to manually create a webhook within GitHub. + /// + /// manualCreation is only available for GitHub webhooks. + /// + final bool? manualCreation; + /// The CodeBuild endpoint where webhook events are sent. final String? payloadUrl; @@ -9848,6 +11409,7 @@ class Webhook { this.buildType, this.filterGroups, this.lastModifiedSecret, + this.manualCreation, this.payloadUrl, this.secret, this.url, @@ -9865,6 +11427,7 @@ class Webhook { .toList()) .toList(), lastModifiedSecret: timeStampFromJson(json['lastModifiedSecret']), + manualCreation: json['manualCreation'] as bool?, payloadUrl: json['payloadUrl'] as String?, secret: json['secret'] as String?, url: json['url'] as String?, @@ -9876,6 +11439,7 @@ class Webhook { final buildType = this.buildType; final filterGroups = this.filterGroups; final lastModifiedSecret = this.lastModifiedSecret; + final manualCreation = this.manualCreation; final payloadUrl = this.payloadUrl; final secret = this.secret; final url = this.url; @@ -9885,6 +11449,7 @@ class Webhook { if (filterGroups != null) 'filterGroups': filterGroups, if (lastModifiedSecret != null) 'lastModifiedSecret': unixTimestampToJson(lastModifiedSecret), + if (manualCreation != null) 'manualCreation': manualCreation, if (payloadUrl != null) 'payloadUrl': payloadUrl, if (secret != null) 'secret': secret, if (url != null) 'url': url, @@ -9935,52 +11500,128 @@ class WebhookFilter { /// branch with a reference name refs/heads/branch-name. final String pattern; - /// The type of webhook filter. There are six webhook filter types: + /// The type of webhook filter. There are nine webhook filter types: /// EVENT, ACTOR_ACCOUNT_ID, HEAD_REF, - /// BASE_REF, FILE_PATH, and - /// COMMIT_MESSAGE. - ///
    EVENT
    + /// BASE_REF, FILE_PATH, COMMIT_MESSAGE, + /// TAG_NAME, RELEASE_NAME, and + /// WORKFLOW_NAME. + /// + ///
      + ///
    • + /// EVENT + /// + ///
        + ///
      • /// A webhook event triggers a build when the provided pattern - /// matches one of five event types: PUSH, + /// matches one of nine event types: PUSH, /// PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, - /// PULL_REQUEST_REOPENED, and PULL_REQUEST_MERGED. - /// The EVENT patterns are specified as a comma-separated string. - /// For example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED + /// PULL_REQUEST_CLOSED, PULL_REQUEST_REOPENED, + /// PULL_REQUEST_MERGED, RELEASED, + /// PRERELEASED, and WORKFLOW_JOB_QUEUED. The + /// EVENT patterns are specified as a comma-separated string. For + /// example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED /// filters all push, pull request created, and pull request updated events. /// - /// The PULL_REQUEST_REOPENED works with GitHub and GitHub - /// Enterprise only. - ///
    ACTOR_ACCOUNT_ID
    + /// Types PULL_REQUEST_REOPENED and + /// WORKFLOW_JOB_QUEUED work with GitHub and GitHub Enterprise + /// only. Types RELEASED and PRERELEASED work with + /// GitHub only. + ///
  • + /// + ///
  • + /// ACTOR_ACCOUNT_ID + /// + ///
      + ///
    • /// A webhook event triggers a build when a GitHub, GitHub Enterprise, or /// Bitbucket account ID matches the regular expression pattern. - ///
      HEAD_REF
      + ///
    • + ///
  • + ///
  • + /// HEAD_REF + /// + ///
      + ///
    • /// A webhook event triggers a build when the head reference matches the regular /// expression pattern. For example, /// refs/heads/branch-name and refs/tags/tag-name. - /// + /// /// Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise /// pull request, Bitbucket push, and Bitbucket pull request events. - ///
      BASE_REF
      + ///
    • + ///
  • + ///
  • + /// BASE_REF + /// + ///
      + ///
    • /// A webhook event triggers a build when the base reference matches the regular /// expression pattern. For example, /// refs/heads/branch-name. /// /// Works with pull request events only. - ///
      FILE_PATH
      + ///
    • + ///
  • + ///
  • + /// FILE_PATH + /// + ///
      + ///
    • /// A webhook triggers a build when the path of a changed file matches the /// regular expression pattern. /// /// Works with GitHub and Bitbucket events push and pull requests events. Also /// works with GitHub Enterprise push events, but does not work with GitHub /// Enterprise pull request events. - ///
      COMMIT_MESSAGE
      + ///
    • + ///
  • + ///
  • + /// COMMIT_MESSAGE + /// + ///
      + ///
    • /// A webhook triggers a build when the head commit message matches the regular /// expression pattern. /// /// Works with GitHub and Bitbucket events push and pull requests events. Also /// works with GitHub Enterprise push events, but does not work with GitHub /// Enterprise pull request events. - /// + ///
    • + ///
  • + ///
  • + /// TAG_NAME + /// + ///
      + ///
    • + /// A webhook triggers a build when the tag name of the release matches the + /// regular expression pattern. + /// + /// Works with RELEASED and PRERELEASED events only. + ///
    • + ///
  • + ///
  • + /// RELEASE_NAME + /// + ///
      + ///
    • + /// A webhook triggers a build when the release name matches the regular + /// expression pattern. + /// + /// Works with RELEASED and PRERELEASED events only. + ///
    • + ///
  • + ///
  • + /// WORKFLOW_NAME + /// + ///
      + ///
    • + /// A webhook triggers a build when the workflow name matches the regular + /// expression pattern. + /// + /// Works with WORKFLOW_JOB_QUEUED events only. + ///
    • + ///
  • + /// final WebhookFilterType type; /// Used to indicate that the pattern determines which webhook @@ -10023,6 +11664,9 @@ enum WebhookFilterType { actorAccountId, filePath, commitMessage, + workflowName, + tagName, + releaseName, } extension WebhookFilterTypeValueExtension on WebhookFilterType { @@ -10040,6 +11684,12 @@ extension WebhookFilterTypeValueExtension on WebhookFilterType { return 'FILE_PATH'; case WebhookFilterType.commitMessage: return 'COMMIT_MESSAGE'; + case WebhookFilterType.workflowName: + return 'WORKFLOW_NAME'; + case WebhookFilterType.tagName: + return 'TAG_NAME'; + case WebhookFilterType.releaseName: + return 'RELEASE_NAME'; } } } @@ -10059,6 +11709,12 @@ extension WebhookFilterTypeFromString on String { return WebhookFilterType.filePath; case 'COMMIT_MESSAGE': return WebhookFilterType.commitMessage; + case 'WORKFLOW_NAME': + return WebhookFilterType.workflowName; + case 'TAG_NAME': + return WebhookFilterType.tagName; + case 'RELEASE_NAME': + return WebhookFilterType.releaseName; } throw Exception('$this is not known in enum WebhookFilterType'); } diff --git a/aws_client/lib/src/generated/code_catalyst/v2022_09_28.dart b/aws_client/lib/src/generated/code_catalyst/v2022_09_28.dart index 325acf40c..23cfb672b 100644 --- a/aws_client/lib/src/generated/code_catalyst/v2022_09_28.dart +++ b/aws_client/lib/src/generated/code_catalyst/v2022_09_28.dart @@ -23,60 +23,69 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// descriptions of operations and data types for Amazon CodeCatalyst. You can /// use the Amazon CodeCatalyst API to work with the following objects. /// -/// Dev Environments and the Amazon Web Services Toolkits, by calling the -/// following: +/// Spaces, by calling the following: /// ///
      ///
    • -/// CreateAccessToken, which creates a personal access token (PAT) for -/// the current user. +/// DeleteSpace, which deletes a space. ///
    • ///
    • -/// CreateDevEnvironment, which creates a Dev Environment, where you can -/// quickly work on the code stored in the source repositories of your project. +/// GetSpace, which returns information about a space. ///
    • ///
    • -/// CreateProject which creates a project in a specified space. +/// GetSubscription, which returns information about the Amazon Web +/// Services account used for billing purposes and the billing plan for the +/// space. ///
    • ///
    • -/// CreateSourceRepositoryBranch, which creates a branch in a specified -/// repository where you can work on code. +/// ListSpaces, which retrieves a list of spaces. ///
    • ///
    • -/// DeleteDevEnvironment, which deletes a Dev Environment. +/// UpdateSpace, which changes one or more values for a space. ///
    • +///
    +/// Projects, by calling the following: +/// +///
      ///
    • -/// GetDevEnvironment, which returns information about a Dev Environment. +/// CreateProject which creates a project in a specified space. ///
    • ///
    • /// GetProject, which returns information about a project. ///
    • ///
    • -/// GetSourceRepositoryCloneUrls, which returns information about the -/// URLs that can be used with a Git client to clone a source repository. +/// ListProjects, which retrieves a list of projects in a space. ///
    • +///
    +/// Users, by calling the following: +/// +///
      ///
    • -/// GetSpace, which returns information about a space. +/// GetUserDetails, which returns information about a user in Amazon +/// CodeCatalyst. ///
    • +///
    +/// Source repositories, by calling the following: +/// +///
      ///
    • -/// GetSubscription, which returns information about the Amazon Web -/// Services account used for billing purposes and the billing plan for the -/// space. +/// CreateSourceRepository, which creates an empty Git-based source +/// repository in a specified project. ///
    • ///
    • -/// GetUserDetails, which returns information about a user in Amazon -/// CodeCatalyst. +/// CreateSourceRepositoryBranch, which creates a branch in a specified +/// repository where you can work on code. ///
    • ///
    • -/// ListDevEnvironments, which retrieves a list of Dev Environments in a -/// project. +/// DeleteSourceRepository, which deletes a source repository. ///
    • ///
    • -/// ListDevEnvironmentSessions, which retrieves a list of active Dev -/// Environment sessions in a project. +/// GetSourceRepository, which returns information about a source +/// repository. ///
    • ///
    • -/// ListProjects, which retrieves a list of projects in a space. +/// GetSourceRepositoryCloneUrls, which returns information about the +/// URLs that can be used with a Git client to clone a source repository. ///
    • ///
    • /// ListSourceRepositories, which retrieves a list of source repositories @@ -86,8 +95,28 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// ListSourceRepositoryBranches, which retrieves a list of branches in a /// source repository. ///
    • +///
    +/// Dev Environments and the Amazon Web Services Toolkits, by calling the +/// following: +/// +///
      +///
    • +/// CreateDevEnvironment, which creates a Dev Environment, where you can +/// quickly work on the code stored in the source repositories of your project. +///
    • ///
    • -/// ListSpaces, which retrieves a list of spaces. +/// DeleteDevEnvironment, which deletes a Dev Environment. +///
    • +///
    • +/// GetDevEnvironment, which returns information about a Dev Environment. +///
    • +///
    • +/// ListDevEnvironments, which retrieves a list of Dev Environments in a +/// project. +///
    • +///
    • +/// ListDevEnvironmentSessions, which retrieves a list of active Dev +/// Environment sessions in a project. ///
    • ///
    • /// StartDevEnvironment, which starts a specified Dev Environment and @@ -109,9 +138,27 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// UpdateDevEnvironment, which changes one or more values for a Dev /// Environment. ///
    • +///
    +/// Workflows, by calling the following: +/// +///
      ///
    • -/// VerifySession, which verifies whether the calling user has a valid -/// Amazon CodeCatalyst login and session. +/// GetWorkflow, which returns information about a workflow. +///
    • +///
    • +/// GetWorkflowRun, which returns information about a specified run of a +/// workflow. +///
    • +///
    • +/// ListWorkflowRuns, which retrieves a list of runs of a specified +/// workflow. +///
    • +///
    • +/// ListWorkflows, which retrieves a list of workflows in a specified +/// project. +///
    • +///
    • +/// StartWorkflowRun, which starts a run of a specified workflow. ///
    • ///
    /// Security, activity, and resource management in Amazon CodeCatalyst, by @@ -119,6 +166,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// ///
      ///
    • +/// CreateAccessToken, which creates a personal access token (PAT) for +/// the current user. +///
    • +///
    • /// DeleteAccessToken, which deletes a specified personal access token /// (PAT). ///
    • @@ -130,6 +181,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// ListEventLogs, which retrieves a list of events that occurred during /// a specified time period in a space. /// +///
    • +/// VerifySession, which verifies whether the calling user has a valid +/// Amazon CodeCatalyst login and session. +///
    • ///
    /// If you are using the Amazon CodeCatalyst APIs with an SDK or the CLI, you /// must configure your computer to work with Amazon CodeCatalyst and single @@ -270,6 +325,10 @@ class CodeCatalyst { /// Parameter [repositories] : /// The source repository that contains the branch to clone into the Dev /// Environment. + /// + /// Parameter [vpcConnectionName] : + /// The name of the connection that will be used to connect to Amazon VPC, if + /// any. Future createDevEnvironment({ required InstanceType instanceType, required PersistentStorageConfiguration persistentStorage, @@ -280,6 +339,7 @@ class CodeCatalyst { List? ides, int? inactivityTimeoutMinutes, List? repositories, + String? vpcConnectionName, }) async { _s.validateNumRange( 'inactivityTimeoutMinutes', @@ -296,6 +356,7 @@ class CodeCatalyst { if (inactivityTimeoutMinutes != null) 'inactivityTimeoutMinutes': inactivityTimeoutMinutes, if (repositories != null) 'repositories': repositories, + if (vpcConnectionName != null) 'vpcConnectionName': vpcConnectionName, }; final response = await _protocol.send( payload: $payload, @@ -344,6 +405,50 @@ class CodeCatalyst { return CreateProjectResponse.fromJson(response); } + /// Creates an empty Git-based source repository in a specified project. The + /// repository is created with an initial empty commit with a default branch + /// named main. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the source repository. For more information about name + /// requirements, see Quotas + /// for source repositories. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + /// + /// Parameter [description] : + /// The description of the source repository. + Future createSourceRepository({ + required String name, + required String projectName, + required String spaceName, + String? description, + }) async { + final $payload = { + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/sourceRepositories/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return CreateSourceRepositoryResponse.fromJson(response); + } + /// Creates a branch in a specified source repository in Amazon CodeCatalyst. /// /// This API only creates a branch in a source repository hosted in Amazon @@ -451,6 +556,98 @@ class CodeCatalyst { return DeleteDevEnvironmentResponse.fromJson(response); } + /// Deletes a project in a space. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the project in the space. To retrieve a list of project names, + /// use ListProjects. + /// + /// Parameter [spaceName] : + /// The name of the space. + Future deleteProject({ + required String name, + required String spaceName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteProjectResponse.fromJson(response); + } + + /// Deletes a source repository in Amazon CodeCatalyst. You cannot use this + /// API to delete a linked repository. It can only be used to delete a Amazon + /// CodeCatalyst source repository. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the source repository. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + Future deleteSourceRepository({ + required String name, + required String projectName, + required String spaceName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/sourceRepositories/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteSourceRepositoryResponse.fromJson(response); + } + + /// Deletes a space. + /// + /// Deleting a space cannot be undone. Additionally, since space names must be + /// unique across Amazon CodeCatalyst, you cannot reuse names of deleted + /// spaces. + /// + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the space. To retrieve a list of space names, use + /// ListSpaces. + Future deleteSpace({ + required String name, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/v1/spaces/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteSpaceResponse.fromJson(response); + } + /// Returns information about a Dev Environment for a source repository in a /// project. Dev Environments are specific to the user who creates them. /// @@ -514,6 +711,38 @@ class CodeCatalyst { return GetProjectResponse.fromJson(response); } + /// Returns information about a source repository. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the source repository. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + Future getSourceRepository({ + required String name, + required String projectName, + required String spaceName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/sourceRepositories/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return GetSourceRepositoryResponse.fromJson(response); + } + /// Returns information about the URLs that can be used with a Git client to /// clone a source repository. /// @@ -626,9 +855,7 @@ class CodeCatalyst { return GetUserDetailsResponse.fromJson(response); } - /// Lists all personal access tokens (PATs) associated with the user who calls - /// the API. You can only list PATs associated with your Amazon Web Services - /// Builder ID. + /// Returns information about a workflow. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -637,29 +864,97 @@ class CodeCatalyst { /// May throw [ResourceNotFoundException]. /// May throw [AccessDeniedException]. /// - /// Parameter [maxResults] : - /// The maximum number of results to show in a single call to this API. If the - /// number of results is larger than the number you specified, the response - /// will include a NextToken element, which you can use to obtain - /// additional results. + /// Parameter [id] : + /// The ID of the workflow. To rerieve a list of workflow IDs, use + /// ListWorkflows. /// - /// Parameter [nextToken] : - /// A token returned from a call to this API to indicate the next batch of - /// results to return, if any. - Future listAccessTokens({ - int? maxResults, - String? nextToken, + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + Future getWorkflow({ + required String id, + required String projectName, + required String spaceName, }) async { - _s.validateNumRange( - 'maxResults', - maxResults, - 0, - 10, - ); - final $payload = { - if (maxResults != null) 'maxResults': maxResults, - if (nextToken != null) 'nextToken': nextToken, - }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/workflows/${Uri.encodeComponent(id)}', + exceptionFnMap: _exceptionFns, + ); + return GetWorkflowResponse.fromJson(response); + } + + /// Returns information about a specified run of a workflow. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [id] : + /// The ID of the workflow run. To retrieve a list of workflow run IDs, use + /// ListWorkflowRuns. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + Future getWorkflowRun({ + required String id, + required String projectName, + required String spaceName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/workflowRuns/${Uri.encodeComponent(id)}', + exceptionFnMap: _exceptionFns, + ); + return GetWorkflowRunResponse.fromJson(response); + } + + /// Lists all personal access tokens (PATs) associated with the user who calls + /// the API. You can only list PATs associated with your Amazon Web Services + /// Builder ID. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to show in a single call to this API. If the + /// number of results is larger than the number you specified, the response + /// will include a NextToken element, which you can use to obtain + /// additional results. + /// + /// Parameter [nextToken] : + /// A token returned from a call to this API to indicate the next batch of + /// results to return, if any. + Future listAccessTokens({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 10, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; final response = await _protocol.send( payload: $payload, method: 'POST', @@ -732,9 +1027,6 @@ class CodeCatalyst { /// May throw [ResourceNotFoundException]. /// May throw [AccessDeniedException]. /// - /// Parameter [projectName] : - /// The name of the project in the space. - /// /// Parameter [spaceName] : /// The name of the space. /// @@ -751,12 +1043,15 @@ class CodeCatalyst { /// Parameter [nextToken] : /// A token returned from a call to this API to indicate the next batch of /// results to return, if any. + /// + /// Parameter [projectName] : + /// The name of the project in the space. Future listDevEnvironments({ - required String projectName, required String spaceName, List? filters, int? maxResults, String? nextToken, + String? projectName, }) async { _s.validateNumRange( 'maxResults', @@ -768,20 +1063,34 @@ class CodeCatalyst { if (filters != null) 'filters': filters, if (maxResults != null) 'maxResults': maxResults, if (nextToken != null) 'nextToken': nextToken, + if (projectName != null) 'projectName': projectName, }; final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/devEnvironments', + '/v1/spaces/${Uri.encodeComponent(spaceName)}/devEnvironments', exceptionFnMap: _exceptionFns, ); return ListDevEnvironmentsResponse.fromJson(response); } - /// Retrieves a list of events that occurred during a specified time period in - /// a space. You can use these events to audit user and system activity in a - /// space. + /// Retrieves a list of events that occurred during a specific time in a + /// space. You can use these events to audit user and system activity in a + /// space. For more information, see Monitoring + /// in the Amazon CodeCatalyst User Guide. + /// + /// ListEventLogs guarantees events for the last 30 days in a given space. You + /// can also view and retrieve a list of management events over the last 90 + /// days for Amazon CodeCatalyst in the CloudTrail console by viewing Event + /// history, or by creating a trail to create and maintain a record of events + /// that extends past 90 days. For more information, see Working + /// with CloudTrail Event History and Working + /// with CloudTrail trails. + /// /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -1027,6 +1336,128 @@ class CodeCatalyst { return ListSpacesResponse.fromJson(response); } + /// Retrieves a list of workflow runs of a specified workflow. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + /// + /// Parameter [maxResults] : + /// The maximum number of results to show in a single call to this API. If the + /// number of results is larger than the number you specified, the response + /// will include a NextToken element, which you can use to obtain + /// additional results. + /// + /// Parameter [nextToken] : + /// A token returned from a call to this API to indicate the next batch of + /// results to return, if any. + /// + /// Parameter [sortBy] : + /// Information used to sort the items in the returned list. + /// + /// Parameter [workflowId] : + /// The ID of the workflow. To retrieve a list of workflow IDs, use + /// ListWorkflows. + Future listWorkflowRuns({ + required String projectName, + required String spaceName, + int? maxResults, + String? nextToken, + List? sortBy, + String? workflowId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (workflowId != null) 'workflowId': [workflowId], + }; + final $payload = { + if (sortBy != null) 'sortBy': sortBy, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/workflowRuns', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListWorkflowRunsResponse.fromJson(response); + } + + /// Retrieves a list of workflows in a specified project. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + /// + /// Parameter [maxResults] : + /// The maximum number of results to show in a single call to this API. If the + /// number of results is larger than the number you specified, the response + /// will include a NextToken element, which you can use to obtain + /// additional results. + /// + /// Parameter [nextToken] : + /// A token returned from a call to this API to indicate the next batch of + /// results to return, if any. + /// + /// Parameter [sortBy] : + /// Information used to sort the items in the returned list. + Future listWorkflows({ + required String projectName, + required String spaceName, + int? maxResults, + String? nextToken, + List? sortBy, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final $payload = { + if (sortBy != null) 'sortBy': sortBy, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/workflows', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListWorkflowsResponse.fromJson(response); + } + /// Starts a specified Dev Environment and puts it into an active state. /// /// May throw [ThrottlingException]. @@ -1122,6 +1553,53 @@ class CodeCatalyst { return StartDevEnvironmentSessionResponse.fromJson(response); } + /// Begins a run of a specified workflow. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [projectName] : + /// The name of the project in the space. + /// + /// Parameter [spaceName] : + /// The name of the space. + /// + /// Parameter [workflowId] : + /// The system-generated unique ID of the workflow. To retrieve a list of + /// workflow IDs, use ListWorkflows. + /// + /// Parameter [clientToken] : + /// A user-specified idempotency token. Idempotency ensures that an API + /// request completes only once. With an idempotent request, if the original + /// request completes successfully, the subsequent retries return the result + /// from the original successful request and have no additional effect. + Future startWorkflowRun({ + required String projectName, + required String spaceName, + required String workflowId, + String? clientToken, + }) async { + final $query = >{ + 'workflowId': [workflowId], + }; + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/workflowRuns', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return StartWorkflowRunResponse.fromJson(response); + } + /// Pauses a specified Dev Environment and places it in a non-running state. /// Stopped Dev Environments do not consume compute minutes. /// @@ -1275,9 +1753,7 @@ class CodeCatalyst { return UpdateDevEnvironmentResponse.fromJson(response); } - /// Verifies whether the calling user has a valid Amazon CodeCatalyst login - /// and session. If successful, this returns the ID of the user in Amazon - /// CodeCatalyst. + /// Changes one or more values for a project. /// /// May throw [ThrottlingException]. /// May throw [ConflictException]. @@ -1285,29 +1761,96 @@ class CodeCatalyst { /// May throw [ServiceQuotaExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [AccessDeniedException]. - Future verifySession() async { + /// + /// Parameter [name] : + /// The name of the project. + /// + /// Parameter [spaceName] : + /// The name of the space. + /// + /// Parameter [description] : + /// The description of the project. + Future updateProject({ + required String name, + required String spaceName, + String? description, + }) async { + final $payload = { + if (description != null) 'description': description, + }; final response = await _protocol.send( - payload: null, - method: 'GET', - requestUri: '/session', + payload: $payload, + method: 'PATCH', + requestUri: + '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(name)}', exceptionFnMap: _exceptionFns, ); - return VerifySessionResponse.fromJson(response); + return UpdateProjectResponse.fromJson(response); } -} - -/// Information about a specified personal access token (PAT). -class AccessTokenSummary { - /// The system-generated ID of the personal access token. - final String id; - - /// The friendly name of the personal access token. - final String name; - - /// The date and time when the personal access token will expire, in coordinated - /// universal time (UTC) timestamp format as specified in RFC 3339. - final DateTime? expiresTime; + + /// Changes one or more values for a space. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [name] : + /// The name of the space. + /// + /// Parameter [description] : + /// The description of the space. + Future updateSpace({ + required String name, + String? description, + }) async { + final $payload = { + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/v1/spaces/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateSpaceResponse.fromJson(response); + } + + /// Verifies whether the calling user has a valid Amazon CodeCatalyst login + /// and session. If successful, this returns the ID of the user in Amazon + /// CodeCatalyst. + /// + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + Future verifySession() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/session', + exceptionFnMap: _exceptionFns, + ); + return VerifySessionResponse.fromJson(response); + } +} + +/// Information about a specified personal access token (PAT). +class AccessTokenSummary { + /// The system-generated ID of the personal access token. + final String id; + + /// The friendly name of the personal access token. + final String name; + + /// The date and time when the personal access token will expire, in coordinated + /// universal time (UTC) timestamp format as specified in RFC 3339. + final DateTime? expiresTime; AccessTokenSummary({ required this.id, @@ -1341,6 +1884,7 @@ enum ComparisonOperator { ge, lt, le, + beginsWith, } extension ComparisonOperatorValueExtension on ComparisonOperator { @@ -1356,6 +1900,8 @@ extension ComparisonOperatorValueExtension on ComparisonOperator { return 'LT'; case ComparisonOperator.le: return 'LE'; + case ComparisonOperator.beginsWith: + return 'BEGINS_WITH'; } } } @@ -1373,6 +1919,8 @@ extension ComparisonOperatorFromString on String { return ComparisonOperator.lt; case 'LE': return ComparisonOperator.le; + case 'BEGINS_WITH': + return ComparisonOperator.beginsWith; } throw Exception('$this is not known in enum ComparisonOperator'); } @@ -1434,10 +1982,15 @@ class CreateDevEnvironmentResponse { /// The name of the space. final String spaceName; + /// The name of the connection used to connect to Amazon VPC used when the Dev + /// Environment was created, if any. + final String? vpcConnectionName; + CreateDevEnvironmentResponse({ required this.id, required this.projectName, required this.spaceName, + this.vpcConnectionName, }); factory CreateDevEnvironmentResponse.fromJson(Map json) { @@ -1445,6 +1998,7 @@ class CreateDevEnvironmentResponse { id: json['id'] as String, projectName: json['projectName'] as String, spaceName: json['spaceName'] as String, + vpcConnectionName: json['vpcConnectionName'] as String?, ); } @@ -1452,10 +2006,12 @@ class CreateDevEnvironmentResponse { final id = this.id; final projectName = this.projectName; final spaceName = this.spaceName; + final vpcConnectionName = this.vpcConnectionName; return { 'id': id, 'projectName': projectName, 'spaceName': spaceName, + if (vpcConnectionName != null) 'vpcConnectionName': vpcConnectionName, }; } } @@ -1550,6 +2106,49 @@ class CreateSourceRepositoryBranchResponse { } } +class CreateSourceRepositoryResponse { + /// The name of the source repository. + final String name; + + /// The name of the project in the space. + final String projectName; + + /// The name of the space. + final String spaceName; + + /// The description of the source repository. + final String? description; + + CreateSourceRepositoryResponse({ + required this.name, + required this.projectName, + required this.spaceName, + this.description, + }); + + factory CreateSourceRepositoryResponse.fromJson(Map json) { + return CreateSourceRepositoryResponse( + name: json['name'] as String, + projectName: json['projectName'] as String, + spaceName: json['spaceName'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final projectName = this.projectName; + final spaceName = this.spaceName; + final description = this.description; + return { + 'name': name, + 'projectName': projectName, + 'spaceName': spaceName, + if (description != null) 'description': description, + }; + } +} + class DeleteAccessTokenResponse { DeleteAccessTokenResponse(); @@ -1598,6 +2197,108 @@ class DeleteDevEnvironmentResponse { } } +class DeleteProjectResponse { + /// The name of the project in the space. + final String name; + + /// The name of the space. + final String spaceName; + + /// The friendly name displayed to users of the project in Amazon CodeCatalyst. + final String? displayName; + + DeleteProjectResponse({ + required this.name, + required this.spaceName, + this.displayName, + }); + + factory DeleteProjectResponse.fromJson(Map json) { + return DeleteProjectResponse( + name: json['name'] as String, + spaceName: json['spaceName'] as String, + displayName: json['displayName'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final spaceName = this.spaceName; + final displayName = this.displayName; + return { + 'name': name, + 'spaceName': spaceName, + if (displayName != null) 'displayName': displayName, + }; + } +} + +class DeleteSourceRepositoryResponse { + /// The name of the repository. + final String name; + + /// The name of the project in the space. + final String projectName; + + /// The name of the space. + final String spaceName; + + DeleteSourceRepositoryResponse({ + required this.name, + required this.projectName, + required this.spaceName, + }); + + factory DeleteSourceRepositoryResponse.fromJson(Map json) { + return DeleteSourceRepositoryResponse( + name: json['name'] as String, + projectName: json['projectName'] as String, + spaceName: json['spaceName'] as String, + ); + } + + Map toJson() { + final name = this.name; + final projectName = this.projectName; + final spaceName = this.spaceName; + return { + 'name': name, + 'projectName': projectName, + 'spaceName': spaceName, + }; + } +} + +class DeleteSpaceResponse { + /// The name of the space. + final String name; + + /// The friendly name of the space displayed to users of the space in Amazon + /// CodeCatalyst. + final String? displayName; + + DeleteSpaceResponse({ + required this.name, + this.displayName, + }); + + factory DeleteSpaceResponse.fromJson(Map json) { + return DeleteSpaceResponse( + name: json['name'] as String, + displayName: json['displayName'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final displayName = this.displayName; + return { + 'name': name, + if (displayName != null) 'displayName': displayName, + }; + } +} + /// Information about connection details for a Dev Environment. class DevEnvironmentAccessDetails { /// The URL used to send commands to and from the Dev Environment. @@ -1874,6 +2575,10 @@ class DevEnvironmentSummary { /// The reason for the status. final String? statusReason; + /// The name of the connection used to connect to Amazon VPC used when the Dev + /// Environment was created, if any. + final String? vpcConnectionName; + DevEnvironmentSummary({ required this.creatorId, required this.id, @@ -1888,6 +2593,7 @@ class DevEnvironmentSummary { this.projectName, this.spaceName, this.statusReason, + this.vpcConnectionName, }); factory DevEnvironmentSummary.fromJson(Map json) { @@ -1914,6 +2620,7 @@ class DevEnvironmentSummary { projectName: json['projectName'] as String?, spaceName: json['spaceName'] as String?, statusReason: json['statusReason'] as String?, + vpcConnectionName: json['vpcConnectionName'] as String?, ); } @@ -1931,6 +2638,7 @@ class DevEnvironmentSummary { final projectName = this.projectName; final spaceName = this.spaceName; final statusReason = this.statusReason; + final vpcConnectionName = this.vpcConnectionName; return { 'creatorId': creatorId, 'id': id, @@ -1945,6 +2653,7 @@ class DevEnvironmentSummary { if (projectName != null) 'projectName': projectName, if (spaceName != null) 'spaceName': spaceName, if (statusReason != null) 'statusReason': statusReason, + if (vpcConnectionName != null) 'vpcConnectionName': vpcConnectionName, }; } } @@ -2026,7 +2735,7 @@ class EventLogEntry { /// The IP address of the user whose actions are recorded in the event. final String? sourceIpAddress; - ///

    + /// The user agent whose actions are recorded in the event. final String? userAgent; EventLogEntry({ @@ -2168,15 +2877,15 @@ class ExecuteCommandSessionConfiguration { } } -///

    +/// Information about a filter used to limit results of a query. class Filter { - ///

    + /// A key that can be used to sort results. final String key; - ///

    + /// The values of the key. final List values; - ///

    + /// The operator used to compare the fields. final String? comparisonOperator; Filter({ @@ -2199,6 +2908,7 @@ class Filter { enum FilterKey { hasAccessTo, + name, } extension FilterKeyValueExtension on FilterKey { @@ -2206,6 +2916,8 @@ extension FilterKeyValueExtension on FilterKey { switch (this) { case FilterKey.hasAccessTo: return 'hasAccessTo'; + case FilterKey.name: + return 'name'; } } } @@ -2215,6 +2927,8 @@ extension FilterKeyFromString on String { switch (this) { case 'hasAccessTo': return FilterKey.hasAccessTo; + case 'name': + return FilterKey.name; } throw Exception('$this is not known in enum FilterKey'); } @@ -2266,6 +2980,10 @@ class GetDevEnvironmentResponse { /// The reason for the status. final String? statusReason; + /// The name of the connection used to connect to Amazon VPC used when the Dev + /// Environment was created, if any. + final String? vpcConnectionName; + GetDevEnvironmentResponse({ required this.creatorId, required this.id, @@ -2280,6 +2998,7 @@ class GetDevEnvironmentResponse { this.alias, this.ides, this.statusReason, + this.vpcConnectionName, }); factory GetDevEnvironmentResponse.fromJson(Map json) { @@ -2306,6 +3025,7 @@ class GetDevEnvironmentResponse { .map((e) => Ide.fromJson(e as Map)) .toList(), statusReason: json['statusReason'] as String?, + vpcConnectionName: json['vpcConnectionName'] as String?, ); } @@ -2323,6 +3043,7 @@ class GetDevEnvironmentResponse { final alias = this.alias; final ides = this.ides; final statusReason = this.statusReason; + final vpcConnectionName = this.vpcConnectionName; return { 'creatorId': creatorId, 'id': id, @@ -2337,6 +3058,7 @@ class GetDevEnvironmentResponse { if (alias != null) 'alias': alias, if (ides != null) 'ides': ides, if (statusReason != null) 'statusReason': statusReason, + if (vpcConnectionName != null) 'vpcConnectionName': vpcConnectionName, }; } } @@ -2407,6 +3129,68 @@ class GetSourceRepositoryCloneUrlsResponse { } } +class GetSourceRepositoryResponse { + /// The time the source repository was created, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339. + final DateTime createdTime; + + /// The time the source repository was last updated, in coordinated universal + /// time (UTC) timestamp format as specified in RFC 3339. + final DateTime lastUpdatedTime; + + /// The name of the source repository. + final String name; + + /// The name of the project in the space. + final String projectName; + + /// The name of the space. + final String spaceName; + + /// The description of the source repository. + final String? description; + + GetSourceRepositoryResponse({ + required this.createdTime, + required this.lastUpdatedTime, + required this.name, + required this.projectName, + required this.spaceName, + this.description, + }); + + factory GetSourceRepositoryResponse.fromJson(Map json) { + return GetSourceRepositoryResponse( + createdTime: nonNullableTimeStampFromJson(json['createdTime'] as Object), + lastUpdatedTime: + nonNullableTimeStampFromJson(json['lastUpdatedTime'] as Object), + name: json['name'] as String, + projectName: json['projectName'] as String, + spaceName: json['spaceName'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final createdTime = this.createdTime; + final lastUpdatedTime = this.lastUpdatedTime; + final name = this.name; + final projectName = this.projectName; + final spaceName = this.spaceName; + final description = this.description; + return { + 'createdTime': iso8601ToJson(createdTime), + 'lastUpdatedTime': iso8601ToJson(lastUpdatedTime), + 'name': name, + 'projectName': projectName, + 'spaceName': spaceName, + if (description != null) 'description': description, + }; + } +} + class GetSpaceResponse { /// The name of the space. final String name; @@ -2455,26 +3239,50 @@ class GetSubscriptionResponse { /// space. final String? awsAccountName; + /// The day and time the pending change will be applied to the space, in + /// coordinated universal time (UTC) timestamp format as specified in RFC 3339. + final DateTime? pendingSubscriptionStartTime; + + /// The type of the billing plan that the space will be changed to at the start + /// of the next billing cycle. This applies only to changes that reduce the + /// functionality available for the space. Billing plan changes that increase + /// functionality are applied immediately. For more information, see Pricing. + final String? pendingSubscriptionType; + /// The type of the billing plan for the space. final String? subscriptionType; GetSubscriptionResponse({ this.awsAccountName, + this.pendingSubscriptionStartTime, + this.pendingSubscriptionType, this.subscriptionType, }); factory GetSubscriptionResponse.fromJson(Map json) { return GetSubscriptionResponse( awsAccountName: json['awsAccountName'] as String?, + pendingSubscriptionStartTime: + timeStampFromJson(json['pendingSubscriptionStartTime']), + pendingSubscriptionType: json['pendingSubscriptionType'] as String?, subscriptionType: json['subscriptionType'] as String?, ); } Map toJson() { final awsAccountName = this.awsAccountName; + final pendingSubscriptionStartTime = this.pendingSubscriptionStartTime; + final pendingSubscriptionType = this.pendingSubscriptionType; final subscriptionType = this.subscriptionType; return { if (awsAccountName != null) 'awsAccountName': awsAccountName, + if (pendingSubscriptionStartTime != null) + 'pendingSubscriptionStartTime': + iso8601ToJson(pendingSubscriptionStartTime), + if (pendingSubscriptionType != null) + 'pendingSubscriptionType': pendingSubscriptionType, if (subscriptionType != null) 'subscriptionType': subscriptionType, }; } @@ -2532,6 +3340,197 @@ class GetUserDetailsResponse { } } +class GetWorkflowResponse { + /// The date and time the workflow was created, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339 + final DateTime createdTime; + + /// Information about the workflow definition file for the workflow. + final WorkflowDefinition definition; + + /// The ID of the workflow. + final String id; + + /// The date and time the workflow was last updated, in coordinated universal + /// time (UTC) timestamp format as specified in RFC 3339 + final DateTime lastUpdatedTime; + + /// The name of the workflow. + final String name; + + /// The name of the project in the space. + final String projectName; + + /// The behavior to use when multiple workflows occur at the same time. For more + /// information, see https://docs.aws.amazon.com/codecatalyst/latest/userguide/workflows-configure-runs.html + /// in the Amazon CodeCatalyst User Guide. + final WorkflowRunMode runMode; + + /// The name of the space. + final String spaceName; + + /// The status of the workflow. + final WorkflowStatus status; + + /// The name of the branch that contains the workflow YAML. + final String? sourceBranchName; + + /// The name of the source repository where the workflow YAML is stored. + final String? sourceRepositoryName; + + GetWorkflowResponse({ + required this.createdTime, + required this.definition, + required this.id, + required this.lastUpdatedTime, + required this.name, + required this.projectName, + required this.runMode, + required this.spaceName, + required this.status, + this.sourceBranchName, + this.sourceRepositoryName, + }); + + factory GetWorkflowResponse.fromJson(Map json) { + return GetWorkflowResponse( + createdTime: nonNullableTimeStampFromJson(json['createdTime'] as Object), + definition: WorkflowDefinition.fromJson( + json['definition'] as Map), + id: json['id'] as String, + lastUpdatedTime: + nonNullableTimeStampFromJson(json['lastUpdatedTime'] as Object), + name: json['name'] as String, + projectName: json['projectName'] as String, + runMode: (json['runMode'] as String).toWorkflowRunMode(), + spaceName: json['spaceName'] as String, + status: (json['status'] as String).toWorkflowStatus(), + sourceBranchName: json['sourceBranchName'] as String?, + sourceRepositoryName: json['sourceRepositoryName'] as String?, + ); + } + + Map toJson() { + final createdTime = this.createdTime; + final definition = this.definition; + final id = this.id; + final lastUpdatedTime = this.lastUpdatedTime; + final name = this.name; + final projectName = this.projectName; + final runMode = this.runMode; + final spaceName = this.spaceName; + final status = this.status; + final sourceBranchName = this.sourceBranchName; + final sourceRepositoryName = this.sourceRepositoryName; + return { + 'createdTime': iso8601ToJson(createdTime), + 'definition': definition, + 'id': id, + 'lastUpdatedTime': iso8601ToJson(lastUpdatedTime), + 'name': name, + 'projectName': projectName, + 'runMode': runMode.toValue(), + 'spaceName': spaceName, + 'status': status.toValue(), + if (sourceBranchName != null) 'sourceBranchName': sourceBranchName, + if (sourceRepositoryName != null) + 'sourceRepositoryName': sourceRepositoryName, + }; + } +} + +class GetWorkflowRunResponse { + /// The ID of the workflow run. + final String id; + + /// The date and time the workflow run status was last updated, in coordinated + /// universal time (UTC) timestamp format as specified in RFC 3339 + final DateTime lastUpdatedTime; + + /// The name of the project in the space. + final String projectName; + + /// The name of the space. + final String spaceName; + + /// The date and time the workflow run began, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339 + final DateTime startTime; + + /// The status of the workflow run. + final WorkflowRunStatus status; + + /// The ID of the workflow. + final String workflowId; + + /// The date and time the workflow run ended, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339. + final DateTime? endTime; + + /// Information about the reasons for the status of the workflow run. + final List? statusReasons; + + GetWorkflowRunResponse({ + required this.id, + required this.lastUpdatedTime, + required this.projectName, + required this.spaceName, + required this.startTime, + required this.status, + required this.workflowId, + this.endTime, + this.statusReasons, + }); + + factory GetWorkflowRunResponse.fromJson(Map json) { + return GetWorkflowRunResponse( + id: json['id'] as String, + lastUpdatedTime: + nonNullableTimeStampFromJson(json['lastUpdatedTime'] as Object), + projectName: json['projectName'] as String, + spaceName: json['spaceName'] as String, + startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), + status: (json['status'] as String).toWorkflowRunStatus(), + workflowId: json['workflowId'] as String, + endTime: timeStampFromJson(json['endTime']), + statusReasons: (json['statusReasons'] as List?) + ?.whereNotNull() + .map((e) => + WorkflowRunStatusReason.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final id = this.id; + final lastUpdatedTime = this.lastUpdatedTime; + final projectName = this.projectName; + final spaceName = this.spaceName; + final startTime = this.startTime; + final status = this.status; + final workflowId = this.workflowId; + final endTime = this.endTime; + final statusReasons = this.statusReasons; + return { + 'id': id, + 'lastUpdatedTime': iso8601ToJson(lastUpdatedTime), + 'projectName': projectName, + 'spaceName': spaceName, + 'startTime': iso8601ToJson(startTime), + 'status': status.toValue(), + 'workflowId': workflowId, + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (statusReasons != null) 'statusReasons': statusReasons, + }; + } +} + /// Information about an integrated development environment (IDE) used in a Dev /// Environment. class Ide { @@ -3013,6 +4012,72 @@ class ListSpacesResponse { } } +class ListWorkflowRunsResponse { + /// Information about the runs of a workflow. + final List? items; + + /// A token returned from a call to this API to indicate the next batch of + /// results to return, if any. + final String? nextToken; + + ListWorkflowRunsResponse({ + this.items, + this.nextToken, + }); + + factory ListWorkflowRunsResponse.fromJson(Map json) { + return ListWorkflowRunsResponse( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => WorkflowRunSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListWorkflowsResponse { + /// Information about the workflows in a project. + final List? items; + + /// A token returned from a call to this API to indicate the next batch of + /// results to return, if any. + final String? nextToken; + + ListWorkflowsResponse({ + this.items, + this.nextToken, + }); + + factory ListWorkflowsResponse.fromJson(Map json) { + return ListWorkflowsResponse( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => WorkflowSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + enum OperationType { readonly, mutation, @@ -3126,7 +4191,7 @@ class ProjectListFilter { /// A key that can be used to sort results. final FilterKey key; - /// The value of the key. + /// The values of the key. final List values; /// The operator used to compare the fields. @@ -3349,6 +4414,49 @@ class StartDevEnvironmentSessionResponse { } } +class StartWorkflowRunResponse { + /// The system-generated unique ID of the workflow run. + final String id; + + /// The name of the project in the space. + final String projectName; + + /// The name of the space. + final String spaceName; + + /// The system-generated unique ID of the workflow. + final String workflowId; + + StartWorkflowRunResponse({ + required this.id, + required this.projectName, + required this.spaceName, + required this.workflowId, + }); + + factory StartWorkflowRunResponse.fromJson(Map json) { + return StartWorkflowRunResponse( + id: json['id'] as String, + projectName: json['projectName'] as String, + spaceName: json['spaceName'] as String, + workflowId: json['workflowId'] as String, + ); + } + + Map toJson() { + final id = this.id; + final projectName = this.projectName; + final spaceName = this.spaceName; + final workflowId = this.workflowId; + return { + 'id': id, + 'projectName': projectName, + 'spaceName': spaceName, + 'workflowId': workflowId, + }; + } +} + class StopDevEnvironmentResponse { /// The system-generated unique ID of the Dev Environment. final String id; @@ -3516,9 +4624,88 @@ class UpdateDevEnvironmentResponse { } } +class UpdateProjectResponse { + /// The description of the project. + final String? description; + + /// The friendly name of the project displayed to users in Amazon CodeCatalyst. + final String? displayName; + + /// The name of the project. + final String? name; + + /// The name of the space. + final String? spaceName; + + UpdateProjectResponse({ + this.description, + this.displayName, + this.name, + this.spaceName, + }); + + factory UpdateProjectResponse.fromJson(Map json) { + return UpdateProjectResponse( + description: json['description'] as String?, + displayName: json['displayName'] as String?, + name: json['name'] as String?, + spaceName: json['spaceName'] as String?, + ); + } + + Map toJson() { + final description = this.description; + final displayName = this.displayName; + final name = this.name; + final spaceName = this.spaceName; + return { + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + if (name != null) 'name': name, + if (spaceName != null) 'spaceName': spaceName, + }; + } +} + +class UpdateSpaceResponse { + /// The description of the space. + final String? description; + + /// The friendly name of the space displayed to users in Amazon CodeCatalyst. + final String? displayName; + + /// The name of the space. + final String? name; + + UpdateSpaceResponse({ + this.description, + this.displayName, + this.name, + }); + + factory UpdateSpaceResponse.fromJson(Map json) { + return UpdateSpaceResponse( + description: json['description'] as String?, + displayName: json['displayName'] as String?, + name: json['name'] as String?, + ); + } + + Map toJson() { + final description = this.description; + final displayName = this.displayName; + final name = this.name; + return { + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + if (name != null) 'name': name, + }; + } +} + /// Information about a user whose activity is recorded in an event for a space. class UserIdentity { - ///

    + /// The ID of the Amazon CodeCatalyst service principal. final String principalId; /// The role assigned to the user in a Amazon CodeCatalyst space or project when @@ -3617,6 +4804,389 @@ class VerifySessionResponse { } } +/// Information about a workflow definition file. +class WorkflowDefinition { + /// The path to the workflow definition file stored in the source repository for + /// the project, including the file name. + final String path; + + WorkflowDefinition({ + required this.path, + }); + + factory WorkflowDefinition.fromJson(Map json) { + return WorkflowDefinition( + path: json['path'] as String, + ); + } + + Map toJson() { + final path = this.path; + return { + 'path': path, + }; + } +} + +/// Information about a workflow definition. +class WorkflowDefinitionSummary { + /// The path to the workflow definition file stored in the source repository for + /// the project, including the file name. + final String path; + + WorkflowDefinitionSummary({ + required this.path, + }); + + factory WorkflowDefinitionSummary.fromJson(Map json) { + return WorkflowDefinitionSummary( + path: json['path'] as String, + ); + } + + Map toJson() { + final path = this.path; + return { + 'path': path, + }; + } +} + +enum WorkflowRunMode { + queued, + parallel, + superseded, +} + +extension WorkflowRunModeValueExtension on WorkflowRunMode { + String toValue() { + switch (this) { + case WorkflowRunMode.queued: + return 'QUEUED'; + case WorkflowRunMode.parallel: + return 'PARALLEL'; + case WorkflowRunMode.superseded: + return 'SUPERSEDED'; + } + } +} + +extension WorkflowRunModeFromString on String { + WorkflowRunMode toWorkflowRunMode() { + switch (this) { + case 'QUEUED': + return WorkflowRunMode.queued; + case 'PARALLEL': + return WorkflowRunMode.parallel; + case 'SUPERSEDED': + return WorkflowRunMode.superseded; + } + throw Exception('$this is not known in enum WorkflowRunMode'); + } +} + +/// Information used to sort workflow runs in the returned list. +class WorkflowRunSortCriteria { + WorkflowRunSortCriteria(); + + Map toJson() { + return {}; + } +} + +enum WorkflowRunStatus { + succeeded, + failed, + stopped, + superseded, + cancelled, + notRun, + validating, + provisioning, + inProgress, + stopping, + abandoned, +} + +extension WorkflowRunStatusValueExtension on WorkflowRunStatus { + String toValue() { + switch (this) { + case WorkflowRunStatus.succeeded: + return 'SUCCEEDED'; + case WorkflowRunStatus.failed: + return 'FAILED'; + case WorkflowRunStatus.stopped: + return 'STOPPED'; + case WorkflowRunStatus.superseded: + return 'SUPERSEDED'; + case WorkflowRunStatus.cancelled: + return 'CANCELLED'; + case WorkflowRunStatus.notRun: + return 'NOT_RUN'; + case WorkflowRunStatus.validating: + return 'VALIDATING'; + case WorkflowRunStatus.provisioning: + return 'PROVISIONING'; + case WorkflowRunStatus.inProgress: + return 'IN_PROGRESS'; + case WorkflowRunStatus.stopping: + return 'STOPPING'; + case WorkflowRunStatus.abandoned: + return 'ABANDONED'; + } + } +} + +extension WorkflowRunStatusFromString on String { + WorkflowRunStatus toWorkflowRunStatus() { + switch (this) { + case 'SUCCEEDED': + return WorkflowRunStatus.succeeded; + case 'FAILED': + return WorkflowRunStatus.failed; + case 'STOPPED': + return WorkflowRunStatus.stopped; + case 'SUPERSEDED': + return WorkflowRunStatus.superseded; + case 'CANCELLED': + return WorkflowRunStatus.cancelled; + case 'NOT_RUN': + return WorkflowRunStatus.notRun; + case 'VALIDATING': + return WorkflowRunStatus.validating; + case 'PROVISIONING': + return WorkflowRunStatus.provisioning; + case 'IN_PROGRESS': + return WorkflowRunStatus.inProgress; + case 'STOPPING': + return WorkflowRunStatus.stopping; + case 'ABANDONED': + return WorkflowRunStatus.abandoned; + } + throw Exception('$this is not known in enum WorkflowRunStatus'); + } +} + +/// Information about the status of a workflow run. +class WorkflowRunStatusReason { + WorkflowRunStatusReason(); + + factory WorkflowRunStatusReason.fromJson(Map _) { + return WorkflowRunStatusReason(); + } + + Map toJson() { + return {}; + } +} + +/// Information about a workflow run. +class WorkflowRunSummary { + /// The system-generated unique ID of the workflow run. + final String id; + + /// The date and time the workflow was last updated, in coordinated universal + /// time (UTC) timestamp format as specified in RFC 3339 + final DateTime lastUpdatedTime; + + /// The date and time the workflow run began, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339. + final DateTime startTime; + + /// The status of the workflow run. + final WorkflowRunStatus status; + + /// The system-generated unique ID of the workflow. + final String workflowId; + + /// The name of the workflow. + final String workflowName; + + /// The date and time the workflow run ended, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339 + final DateTime? endTime; + + /// The reasons for the workflow run status. + final List? statusReasons; + + WorkflowRunSummary({ + required this.id, + required this.lastUpdatedTime, + required this.startTime, + required this.status, + required this.workflowId, + required this.workflowName, + this.endTime, + this.statusReasons, + }); + + factory WorkflowRunSummary.fromJson(Map json) { + return WorkflowRunSummary( + id: json['id'] as String, + lastUpdatedTime: + nonNullableTimeStampFromJson(json['lastUpdatedTime'] as Object), + startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), + status: (json['status'] as String).toWorkflowRunStatus(), + workflowId: json['workflowId'] as String, + workflowName: json['workflowName'] as String, + endTime: timeStampFromJson(json['endTime']), + statusReasons: (json['statusReasons'] as List?) + ?.whereNotNull() + .map((e) => + WorkflowRunStatusReason.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final id = this.id; + final lastUpdatedTime = this.lastUpdatedTime; + final startTime = this.startTime; + final status = this.status; + final workflowId = this.workflowId; + final workflowName = this.workflowName; + final endTime = this.endTime; + final statusReasons = this.statusReasons; + return { + 'id': id, + 'lastUpdatedTime': iso8601ToJson(lastUpdatedTime), + 'startTime': iso8601ToJson(startTime), + 'status': status.toValue(), + 'workflowId': workflowId, + 'workflowName': workflowName, + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (statusReasons != null) 'statusReasons': statusReasons, + }; + } +} + +/// Information used to sort workflows in the returned list. +class WorkflowSortCriteria { + WorkflowSortCriteria(); + + Map toJson() { + return {}; + } +} + +enum WorkflowStatus { + invalid, + active, +} + +extension WorkflowStatusValueExtension on WorkflowStatus { + String toValue() { + switch (this) { + case WorkflowStatus.invalid: + return 'INVALID'; + case WorkflowStatus.active: + return 'ACTIVE'; + } + } +} + +extension WorkflowStatusFromString on String { + WorkflowStatus toWorkflowStatus() { + switch (this) { + case 'INVALID': + return WorkflowStatus.invalid; + case 'ACTIVE': + return WorkflowStatus.active; + } + throw Exception('$this is not known in enum WorkflowStatus'); + } +} + +/// Information about a workflow. +class WorkflowSummary { + /// The date and time the workflow was created, in coordinated universal time + /// (UTC) timestamp format as specified in RFC 3339 + final DateTime createdTime; + + /// Information about the workflow definition file. + final WorkflowDefinitionSummary definition; + + /// The system-generated unique ID of a workflow. + final String id; + + /// The date and time the workflow was last updated, in coordinated universal + /// time (UTC) timestamp format as specified in RFC 3339 + final DateTime lastUpdatedTime; + + /// The name of the workflow. + final String name; + + /// The run mode of the workflow. + final WorkflowRunMode runMode; + + /// The name of the branch of the source repository where the workflow + /// definition file is stored. + final String sourceBranchName; + + /// The name of the source repository where the workflow definition file is + /// stored. + final String sourceRepositoryName; + + /// The status of the workflow. + final WorkflowStatus status; + + WorkflowSummary({ + required this.createdTime, + required this.definition, + required this.id, + required this.lastUpdatedTime, + required this.name, + required this.runMode, + required this.sourceBranchName, + required this.sourceRepositoryName, + required this.status, + }); + + factory WorkflowSummary.fromJson(Map json) { + return WorkflowSummary( + createdTime: nonNullableTimeStampFromJson(json['createdTime'] as Object), + definition: WorkflowDefinitionSummary.fromJson( + json['definition'] as Map), + id: json['id'] as String, + lastUpdatedTime: + nonNullableTimeStampFromJson(json['lastUpdatedTime'] as Object), + name: json['name'] as String, + runMode: (json['runMode'] as String).toWorkflowRunMode(), + sourceBranchName: json['sourceBranchName'] as String, + sourceRepositoryName: json['sourceRepositoryName'] as String, + status: (json['status'] as String).toWorkflowStatus(), + ); + } + + Map toJson() { + final createdTime = this.createdTime; + final definition = this.definition; + final id = this.id; + final lastUpdatedTime = this.lastUpdatedTime; + final name = this.name; + final runMode = this.runMode; + final sourceBranchName = this.sourceBranchName; + final sourceRepositoryName = this.sourceRepositoryName; + final status = this.status; + return { + 'createdTime': iso8601ToJson(createdTime), + 'definition': definition, + 'id': id, + 'lastUpdatedTime': iso8601ToJson(lastUpdatedTime), + 'name': name, + 'runMode': runMode.toValue(), + 'sourceBranchName': sourceBranchName, + 'sourceRepositoryName': sourceRepositoryName, + 'status': status.toValue(), + }; + } +} + class AccessDeniedException extends _s.GenericAwsException { AccessDeniedException({String? type, String? message}) : super(type: type, code: 'AccessDeniedException', message: message); diff --git a/aws_client/lib/src/generated/code_commit/v2015_04_13.dart b/aws_client/lib/src/generated/code_commit/v2015_04_13.dart index 917ed5758..ae2a00da2 100644 --- a/aws_client/lib/src/generated/code_commit/v2015_04_13.dart +++ b/aws_client/lib/src/generated/code_commit/v2015_04_13.dart @@ -19,9 +19,9 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// This is the AWS CodeCommit API Reference. This reference provides -/// descriptions of the operations and data types for AWS CodeCommit API along -/// with usage examples. +/// This is the CodeCommit API Reference. This reference provides +/// descriptions of the operations and data types for CodeCommit API along with +/// usage examples. class CodeCommit { final _s.JsonProtocol _protocol; CodeCommit({ @@ -401,10 +401,10 @@ class CodeCommit { } /// Creates a template for approval rules that can then be associated with one - /// or more repositories in your AWS account. When you associate a template - /// with a repository, AWS CodeCommit creates an approval rule that matches - /// the conditions of the template for all pull requests that meet the - /// conditions of the template. For more information, see + /// or more repositories in your Amazon Web Services account. When you + /// associate a template with a repository, CodeCommit creates an approval + /// rule that matches the conditions of the template for all pull requests + /// that meet the conditions of the template. For more information, see /// AssociateApprovalRuleTemplateWithRepository. /// /// May throw [ApprovalRuleTemplateNameRequiredException]. @@ -427,12 +427,13 @@ class CodeCommit { /// ///

      ///
    • - /// CodeCommitApprovers: This option only requires an AWS account and a - /// resource. It can be used for both IAM users and federated access users - /// whose name matches the provided resource name. This is a very powerful - /// option that offers a great deal of flexibility. For example, if you - /// specify the AWS account 123456789012 and Mary_Major, all of - /// the following are counted as approvals coming from that user: + /// CodeCommitApprovers: This option only requires an Amazon Web + /// Services account and a resource. It can be used for both IAM users and + /// federated access users whose name matches the provided resource name. This + /// is a very powerful option that offers a great deal of flexibility. For + /// example, if you specify the Amazon Web Services account + /// 123456789012 and Mary_Major, all of the following are + /// counted as approvals coming from that user: /// ///
        ///
      • @@ -706,8 +707,8 @@ class CodeCommit { /// the request returns information about the initial request that used that /// token. /// - /// The AWS SDKs prepopulate client request tokens. If you are using an AWS - /// SDK, an idempotency token is created for you. + /// The Amazon Web ServicesSDKs prepopulate client request tokens. If you are + /// using an Amazon Web ServicesSDK, an idempotency token is created for you. /// /// /// Parameter [description] : @@ -761,19 +762,20 @@ class CodeCommit { /// Parameter [approvalRuleContent] : /// The content of the approval rule, including the number of approvals needed /// and the structure of an approval pool defined for approvals, if any. For - /// more information about approval pools, see the AWS CodeCommit User Guide. + /// more information about approval pools, see the CodeCommit User Guide. /// /// When you create the content of the approval rule, you can specify /// approvers in an approval pool in one of two ways: /// ///
          ///
        • - /// CodeCommitApprovers: This option only requires an AWS account and a - /// resource. It can be used for both IAM users and federated access users - /// whose name matches the provided resource name. This is a very powerful - /// option that offers a great deal of flexibility. For example, if you - /// specify the AWS account 123456789012 and Mary_Major, all of - /// the following would be counted as approvals coming from that user: + /// CodeCommitApprovers: This option only requires an Amazon Web + /// Services account and a resource. It can be used for both IAM users and + /// federated access users whose name matches the provided resource name. This + /// is a very powerful option that offers a great deal of flexibility. For + /// example, if you specify the Amazon Web Services account + /// 123456789012 and Mary_Major, all of the following would be + /// counted as approvals coming from that user: /// ///
            ///
          • @@ -843,6 +845,8 @@ class CodeCommit { /// May throw [EncryptionKeyDisabledException]. /// May throw [EncryptionKeyNotFoundException]. /// May throw [EncryptionKeyUnavailableException]. + /// May throw [EncryptionKeyInvalidIdException]. + /// May throw [EncryptionKeyInvalidUsageException]. /// May throw [InvalidTagsMapException]. /// May throw [TooManyTagsException]. /// May throw [InvalidSystemTagUsageException]. @@ -851,14 +855,25 @@ class CodeCommit { /// Parameter [repositoryName] : /// The name of the new repository to be created. /// - /// The repository name must be unique across the calling AWS account. - /// Repository names are limited to 100 alphanumeric, dash, and underscore - /// characters, and cannot include certain characters. For more information - /// about the limits on repository names, see Limits - /// in the AWS CodeCommit User Guide. The suffix .git is prohibited. + /// The repository name must be unique across the calling Amazon Web Services + /// account. Repository names are limited to 100 alphanumeric, dash, and + /// underscore characters, and cannot include certain characters. For more + /// information about the limits on repository names, see Quotas + /// in the CodeCommit User Guide. The suffix .git is prohibited. /// /// + /// Parameter [kmsKeyId] : + /// The ID of the encryption key. You can view the ID of an encryption key in + /// the KMS console, or use the KMS APIs to programmatically retrieve a key + /// ID. For more information about acceptable values for kmsKeyID, see KeyId + /// in the Decrypt API description in the Key Management Service API + /// Reference. + /// + /// If no key is specified, the default aws/codecommit Amazon Web + /// Services managed key is used. + /// /// Parameter [repositoryDescription] : /// A comment or description about the new repository. /// @@ -874,6 +889,7 @@ class CodeCommit { /// One or more tag key-value pairs to use when tagging this repository. Future createRepository({ required String repositoryName, + String? kmsKeyId, String? repositoryDescription, Map? tags, }) async { @@ -889,6 +905,7 @@ class CodeCommit { headers: headers, payload: { 'repositoryName': repositoryName, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, if (repositoryDescription != null) 'repositoryDescription': repositoryDescription, if (tags != null) 'tags': tags, @@ -1902,11 +1919,15 @@ class CodeCommit { /// /// Parameter [afterCommitId] : /// The full commit ID of the commit in the source branch that was the tip of - /// the branch at the time the comment was made. + /// the branch at the time the comment was made. Requirement is conditional: + /// afterCommitId must be specified when + /// repositoryName is included. /// /// Parameter [beforeCommitId] : /// The full commit ID of the commit in the destination branch that was the - /// tip of the branch at the time the pull request was created. + /// tip of the branch at the time the pull request was created. Requirement is + /// conditional: beforeCommitId must be specified when + /// repositoryName is included. /// /// Parameter [maxResults] : /// A non-zero, non-negative integer used to limit the number of returned @@ -1918,7 +1939,9 @@ class CodeCommit { /// batch of the results. /// /// Parameter [repositoryName] : - /// The name of the repository that contains the pull request. + /// The name of the repository that contains the pull request. Requirement is + /// conditional: repositoryName must be specified when + /// beforeCommitId and afterCommitId are included. Future getCommentsForPullRequest({ required String pullRequestId, String? afterCommitId, @@ -2109,7 +2132,7 @@ class CodeCommit { /// Parameter [commitSpecifier] : /// The fully quaified reference that identifies the commit that contains the /// file. For example, you can specify a full commit ID, a tag, a branch name, - /// or a reference such as refs/heads/master. If none is provided, the head + /// or a reference such as refs/heads/main. If none is provided, the head /// commit is used. Future getFile({ required String filePath, @@ -2635,8 +2658,9 @@ class CodeCommit { return GetRepositoryTriggersOutput.fromJson(jsonResponse.body); } - /// Lists all approval rule templates in the specified AWS Region in your AWS - /// account. If an AWS Region is not specified, the AWS Region where you are + /// Lists all approval rule templates in the specified Amazon Web Services + /// Region in your Amazon Web Services account. If an Amazon Web Services + /// Region is not specified, the Amazon Web Services Region where you are /// signed in is used. /// /// May throw [InvalidMaxResultsException]. @@ -2765,6 +2789,71 @@ class CodeCommit { return ListBranchesOutput.fromJson(jsonResponse.body); } + /// Retrieves a list of commits and changes to a specified file. + /// + /// May throw [RepositoryNameRequiredException]. + /// May throw [InvalidRepositoryNameException]. + /// May throw [RepositoryDoesNotExistException]. + /// May throw [InvalidContinuationTokenException]. + /// May throw [InvalidMaxResultsException]. + /// May throw [TipsDivergenceExceededException]. + /// May throw [CommitRequiredException]. + /// May throw [InvalidCommitException]. + /// May throw [CommitDoesNotExistException]. + /// May throw [EncryptionIntegrityChecksFailedException]. + /// May throw [EncryptionKeyAccessDeniedException]. + /// May throw [EncryptionKeyDisabledException]. + /// May throw [EncryptionKeyNotFoundException]. + /// May throw [EncryptionKeyUnavailableException]. + /// + /// Parameter [filePath] : + /// The full path of the file whose history you want to retrieve, including + /// the name of the file. + /// + /// Parameter [repositoryName] : + /// The name of the repository that contains the file. + /// + /// Parameter [commitSpecifier] : + /// The fully quaified reference that identifies the commit that contains the + /// file. For example, you can specify a full commit ID, a tag, a branch name, + /// or a reference such as refs/heads/main. If none is provided, + /// the head commit is used. + /// + /// Parameter [maxResults] : + /// A non-zero, non-negative integer used to limit the number of returned + /// results. + /// + /// Parameter [nextToken] : + /// An enumeration token that allows the operation to batch the results. + Future listFileCommitHistory({ + required String filePath, + required String repositoryName, + String? commitSpecifier, + int? maxResults, + String? nextToken, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeCommit_20150413.ListFileCommitHistory' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'filePath': filePath, + 'repositoryName': repositoryName, + if (commitSpecifier != null) 'commitSpecifier': commitSpecifier, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListFileCommitHistoryResponse.fromJson(jsonResponse.body); + } + /// Returns a list of pull requests for a specified repository. The return /// list can be refined by pull request status or pull request author ARN. /// @@ -2840,8 +2929,8 @@ class CodeCommit { /// Parameter [nextToken] : /// An enumeration token that allows the operation to batch the results of the /// operation. Batch sizes are 1,000 for list repository operations. When the - /// client sends the token back to AWS CodeCommit, another page of 1,000 - /// records is retrieved. + /// client sends the token back to CodeCommit, another page of 1,000 records + /// is retrieved. /// /// Parameter [order] : /// The order in which to sort the results of a list repositories operation. @@ -2926,10 +3015,11 @@ class CodeCommit { jsonResponse.body); } - /// Gets information about AWS tags for a specified Amazon Resource Name (ARN) - /// in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit - /// Resources and Operations in the AWS CodeCommit User Guide. + /// Resources and Operations in the CodeCommit User Guide. /// /// May throw [RepositoryDoesNotExistException]. /// May throw [InvalidRepositoryNameException]. @@ -3923,10 +4013,10 @@ class CodeCommit { /// Parameter [reactionValue] : /// The emoji reaction you want to add or update. To remove a reaction, /// provide a value of blank or null. You can also provide the value of none. - /// For information about emoji reaction values supported in AWS CodeCommit, - /// see the AWS - /// CodeCommit User Guide. + /// For information about emoji reaction values supported in CodeCommit, see + /// the CodeCommit + /// User Guide. Future putCommentReaction({ required String commentId, required String reactionValue, @@ -3948,7 +4038,7 @@ class CodeCommit { ); } - /// Adds or updates a file in a branch in an AWS CodeCommit repository, and + /// Adds or updates a file in a branch in an CodeCommit repository, and /// generates a commit for the addition in the specified branch. /// /// May throw [RepositoryNameRequiredException]. @@ -4113,10 +4203,10 @@ class CodeCommit { return PutRepositoryTriggersOutput.fromJson(jsonResponse.body); } - /// Adds or updates tags for a resource in AWS CodeCommit. For a list of valid - /// resources in AWS CodeCommit, see CodeCommit - /// Resources and Operations in the AWS CodeCommit User Guide. + /// Resources and Operations in the CodeCommit User Guide. /// /// May throw [RepositoryDoesNotExistException]. /// May throw [InvalidRepositoryNameException]. @@ -4210,10 +4300,10 @@ class CodeCommit { return TestRepositoryTriggersOutput.fromJson(jsonResponse.body); } - /// Removes tags for a resource in AWS CodeCommit. For a list of valid - /// resources in AWS CodeCommit, see CodeCommit - /// Resources and Operations in the AWS CodeCommit User Guide. + /// Resources and Operations in the CodeCommit User Guide. /// /// May throw [RepositoryDoesNotExistException]. /// May throw [InvalidRepositoryNameException]. @@ -4434,10 +4524,11 @@ class CodeCommit { /// May throw [EncryptionKeyUnavailableException]. /// /// Parameter [defaultBranchName] : - /// The name of the branch to set as the default. + /// The name of the branch to set as the default branch. /// /// Parameter [repositoryName] : - /// The name of the repository to set or change the default branch for. + /// The name of the repository for which you want to set or change the default + /// branch. Future updateDefaultBranch({ required String defaultBranchName, required String repositoryName, @@ -4491,12 +4582,13 @@ class CodeCommit { /// ///
              ///
            • - /// CodeCommitApprovers: This option only requires an AWS account and a - /// resource. It can be used for both IAM users and federated access users - /// whose name matches the provided resource name. This is a very powerful - /// option that offers a great deal of flexibility. For example, if you - /// specify the AWS account 123456789012 and Mary_Major, all of - /// the following are counted as approvals coming from that user: + /// CodeCommitApprovers: This option only requires an Amazon Web + /// Services account and a resource. It can be used for both IAM users and + /// federated access users whose name matches the provided resource name. This + /// is a very powerful option that offers a great deal of flexibility. For + /// example, if you specify the Amazon Web Services account + /// 123456789012 and Mary_Major, all of the following are + /// counted as approvals coming from that user: /// ///
                ///
              • @@ -4780,13 +4872,62 @@ class CodeCommit { ); } + /// Updates the Key Management Service encryption key used to encrypt and + /// decrypt a CodeCommit repository. + /// + /// May throw [RepositoryNameRequiredException]. + /// May throw [RepositoryDoesNotExistException]. + /// May throw [InvalidRepositoryNameException]. + /// May throw [EncryptionKeyRequiredException]. + /// May throw [EncryptionIntegrityChecksFailedException]. + /// May throw [EncryptionKeyAccessDeniedException]. + /// May throw [EncryptionKeyInvalidIdException]. + /// May throw [EncryptionKeyInvalidUsageException]. + /// May throw [EncryptionKeyDisabledException]. + /// May throw [EncryptionKeyNotFoundException]. + /// May throw [EncryptionKeyUnavailableException]. + /// + /// Parameter [kmsKeyId] : + /// The ID of the encryption key. You can view the ID of an encryption key in + /// the KMS console, or use the KMS APIs to programmatically retrieve a key + /// ID. For more information about acceptable values for keyID, see KeyId + /// in the Decrypt API description in the Key Management Service API + /// Reference. + /// + /// Parameter [repositoryName] : + /// The name of the repository for which you want to update the KMS encryption + /// key used to encrypt and decrypt the repository. + Future updateRepositoryEncryptionKey({ + required String kmsKeyId, + required String repositoryName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeCommit_20150413.UpdateRepositoryEncryptionKey' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'kmsKeyId': kmsKeyId, + 'repositoryName': repositoryName, + }, + ); + + return UpdateRepositoryEncryptionKeyOutput.fromJson(jsonResponse.body); + } + /// Renames a repository. The repository name must be unique across the - /// calling AWS account. Repository names are limited to 100 alphanumeric, - /// dash, and underscore characters, and cannot include certain characters. - /// The suffix .git is prohibited. For more information about the limits on - /// repository names, see Limits - /// in the AWS CodeCommit User Guide. + /// calling Amazon Web Services account. Repository names are limited to 100 + /// alphanumeric, dash, and underscore characters, and cannot include certain + /// characters. The suffix .git is prohibited. For more information about the + /// limits on repository names, see Quotas + /// in the CodeCommit User Guide. /// /// May throw [RepositoryDoesNotExistException]. /// May throw [RepositoryNameExistsException]. @@ -5490,8 +5631,115 @@ class BatchGetCommitsOutput { } } +/// Returns information about errors in a BatchGetRepositories operation. +class BatchGetRepositoriesError { + /// An error code that specifies the type of failure. + final BatchGetRepositoriesErrorCodeEnum? errorCode; + + /// An error message that provides detail about why the repository either was + /// not found or was not in a valid state. + final String? errorMessage; + + /// The ID of a repository that either could not be found or was not in a valid + /// state. + final String? repositoryId; + + /// The name of a repository that either could not be found or was not in a + /// valid state. + final String? repositoryName; + + BatchGetRepositoriesError({ + this.errorCode, + this.errorMessage, + this.repositoryId, + this.repositoryName, + }); + + factory BatchGetRepositoriesError.fromJson(Map json) { + return BatchGetRepositoriesError( + errorCode: + (json['errorCode'] as String?)?.toBatchGetRepositoriesErrorCodeEnum(), + errorMessage: json['errorMessage'] as String?, + repositoryId: json['repositoryId'] as String?, + repositoryName: json['repositoryName'] as String?, + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; + final repositoryId = this.repositoryId; + final repositoryName = this.repositoryName; + return { + if (errorCode != null) 'errorCode': errorCode.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (repositoryId != null) 'repositoryId': repositoryId, + if (repositoryName != null) 'repositoryName': repositoryName, + }; + } +} + +enum BatchGetRepositoriesErrorCodeEnum { + encryptionIntegrityChecksFailedException, + encryptionKeyAccessDeniedException, + encryptionKeyDisabledException, + encryptionKeyNotFoundException, + encryptionKeyUnavailableException, + repositoryDoesNotExistException, +} + +extension BatchGetRepositoriesErrorCodeEnumValueExtension + on BatchGetRepositoriesErrorCodeEnum { + String toValue() { + switch (this) { + case BatchGetRepositoriesErrorCodeEnum + .encryptionIntegrityChecksFailedException: + return 'EncryptionIntegrityChecksFailedException'; + case BatchGetRepositoriesErrorCodeEnum.encryptionKeyAccessDeniedException: + return 'EncryptionKeyAccessDeniedException'; + case BatchGetRepositoriesErrorCodeEnum.encryptionKeyDisabledException: + return 'EncryptionKeyDisabledException'; + case BatchGetRepositoriesErrorCodeEnum.encryptionKeyNotFoundException: + return 'EncryptionKeyNotFoundException'; + case BatchGetRepositoriesErrorCodeEnum.encryptionKeyUnavailableException: + return 'EncryptionKeyUnavailableException'; + case BatchGetRepositoriesErrorCodeEnum.repositoryDoesNotExistException: + return 'RepositoryDoesNotExistException'; + } + } +} + +extension BatchGetRepositoriesErrorCodeEnumFromString on String { + BatchGetRepositoriesErrorCodeEnum toBatchGetRepositoriesErrorCodeEnum() { + switch (this) { + case 'EncryptionIntegrityChecksFailedException': + return BatchGetRepositoriesErrorCodeEnum + .encryptionIntegrityChecksFailedException; + case 'EncryptionKeyAccessDeniedException': + return BatchGetRepositoriesErrorCodeEnum + .encryptionKeyAccessDeniedException; + case 'EncryptionKeyDisabledException': + return BatchGetRepositoriesErrorCodeEnum.encryptionKeyDisabledException; + case 'EncryptionKeyNotFoundException': + return BatchGetRepositoriesErrorCodeEnum.encryptionKeyNotFoundException; + case 'EncryptionKeyUnavailableException': + return BatchGetRepositoriesErrorCodeEnum + .encryptionKeyUnavailableException; + case 'RepositoryDoesNotExistException': + return BatchGetRepositoriesErrorCodeEnum + .repositoryDoesNotExistException; + } + throw Exception( + '$this is not known in enum BatchGetRepositoriesErrorCodeEnum'); + } +} + /// Represents the output of a batch get repositories operation. class BatchGetRepositoriesOutput { + /// Returns information about any errors returned when attempting to retrieve + /// information about the repositories. + final List? errors; + /// A list of repositories returned by the batch get repositories operation. final List? repositories; @@ -5499,12 +5747,18 @@ class BatchGetRepositoriesOutput { final List? repositoriesNotFound; BatchGetRepositoriesOutput({ + this.errors, this.repositories, this.repositoriesNotFound, }); factory BatchGetRepositoriesOutput.fromJson(Map json) { return BatchGetRepositoriesOutput( + errors: (json['errors'] as List?) + ?.whereNotNull() + .map((e) => + BatchGetRepositoriesError.fromJson(e as Map)) + .toList(), repositories: (json['repositories'] as List?) ?.whereNotNull() .map((e) => RepositoryMetadata.fromJson(e as Map)) @@ -5517,9 +5771,11 @@ class BatchGetRepositoriesOutput { } Map toJson() { + final errors = this.errors; final repositories = this.repositories; final repositoriesNotFound = this.repositoriesNotFound; return { + if (errors != null) 'errors': errors, if (repositories != null) 'repositories': repositories, if (repositoriesNotFound != null) 'repositoriesNotFound': repositoriesNotFound, @@ -7013,6 +7269,57 @@ class FileSizes { } } +/// Information about a version of a file. +class FileVersion { + /// The blob ID of the object that represents the content of the file in this + /// version. + final String? blobId; + final Commit? commit; + + /// The name and path of the file at which this blob is indexed which contains + /// the data for this version of the file. This value will vary between file + /// versions if a file is renamed or if its path changes. + final String? path; + + /// An array of commit IDs that contain more recent versions of this file. If + /// there are no additional versions of the file, this array will be empty. + final List? revisionChildren; + + FileVersion({ + this.blobId, + this.commit, + this.path, + this.revisionChildren, + }); + + factory FileVersion.fromJson(Map json) { + return FileVersion( + blobId: json['blobId'] as String?, + commit: json['commit'] != null + ? Commit.fromJson(json['commit'] as Map) + : null, + path: json['path'] as String?, + revisionChildren: (json['revisionChildren'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final blobId = this.blobId; + final commit = this.commit; + final path = this.path; + final revisionChildren = this.revisionChildren; + return { + if (blobId != null) 'blobId': blobId, + if (commit != null) 'commit': commit, + if (path != null) 'path': path, + if (revisionChildren != null) 'revisionChildren': revisionChildren, + }; + } +} + /// Returns information about a folder in a repository. class Folder { /// The fully qualified path of the folder in the repository. @@ -7798,8 +8105,8 @@ class IsBinaryFile { } class ListApprovalRuleTemplatesOutput { - /// The names of all the approval rule templates found in the AWS Region for - /// your AWS account. + /// The names of all the approval rule templates found in the Amazon Web + /// Services Region for your Amazon Web Services account. final List? approvalRuleTemplateNames; /// An enumeration token that allows the operation to batch the next results of @@ -7900,6 +8207,39 @@ class ListBranchesOutput { } } +class ListFileCommitHistoryResponse { + /// An array of FileVersion objects that form a directed acyclic graph (DAG) of + /// the changes to the file made by the commits that changed the file. + final List revisionDag; + + /// An enumeration token that can be used to return the next batch of results. + final String? nextToken; + + ListFileCommitHistoryResponse({ + required this.revisionDag, + this.nextToken, + }); + + factory ListFileCommitHistoryResponse.fromJson(Map json) { + return ListFileCommitHistoryResponse( + revisionDag: (json['revisionDag'] as List) + .whereNotNull() + .map((e) => FileVersion.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final revisionDag = this.revisionDag; + final nextToken = this.nextToken; + return { + 'revisionDag': revisionDag, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + class ListPullRequestsOutput { /// The system-generated IDs of the pull requests. final List pullRequestIds; @@ -7972,8 +8312,8 @@ class ListRepositoriesForApprovalRuleTemplateOutput { class ListRepositoriesOutput { /// An enumeration token that allows the operation to batch the results of the /// operation. Batch sizes are 1,000 for list repository operations. When the - /// client sends the token back to AWS CodeCommit, another page of 1,000 records - /// is retrieved. + /// client sends the token back to CodeCommit, another page of 1,000 records is + /// retrieved. final String? nextToken; /// Lists the repositories called by the list repositories operation. @@ -9524,8 +9864,8 @@ class ReactionForComment { } } -/// Information about the values for reactions to a comment. AWS CodeCommit -/// supports a limited set of reactions. +/// Information about the values for reactions to a comment. CodeCommit supports +/// a limited set of reactions. class ReactionValueFormats { /// The Emoji Version 1.0 graphic of the reaction. These graphics are /// interpreted slightly differently on different operating systems. @@ -9672,7 +10012,7 @@ class RepositoryMetadata { /// The Amazon Resource Name (ARN) of the repository. final String? arn; - /// The ID of the AWS account associated with the repository. + /// The ID of the Amazon Web Services account associated with the repository. final String? accountId; /// The URL to use for cloning the repository over HTTPS. @@ -9687,6 +10027,10 @@ class RepositoryMetadata { /// The repository's default branch name. final String? defaultBranch; + /// The ID of the Key Management Service encryption key used to encrypt and + /// decrypt the repository. + final String? kmsKeyId; + /// The date and time the repository was last modified, in timestamp format. final DateTime? lastModifiedDate; @@ -9706,6 +10050,7 @@ class RepositoryMetadata { this.cloneUrlSsh, this.creationDate, this.defaultBranch, + this.kmsKeyId, this.lastModifiedDate, this.repositoryDescription, this.repositoryId, @@ -9720,6 +10065,7 @@ class RepositoryMetadata { cloneUrlSsh: json['cloneUrlSsh'] as String?, creationDate: timeStampFromJson(json['creationDate']), defaultBranch: json['defaultBranch'] as String?, + kmsKeyId: json['kmsKeyId'] as String?, lastModifiedDate: timeStampFromJson(json['lastModifiedDate']), repositoryDescription: json['repositoryDescription'] as String?, repositoryId: json['repositoryId'] as String?, @@ -9734,6 +10080,7 @@ class RepositoryMetadata { final cloneUrlSsh = this.cloneUrlSsh; final creationDate = this.creationDate; final defaultBranch = this.defaultBranch; + final kmsKeyId = this.kmsKeyId; final lastModifiedDate = this.lastModifiedDate; final repositoryDescription = this.repositoryDescription; final repositoryId = this.repositoryId; @@ -9746,6 +10093,7 @@ class RepositoryMetadata { if (creationDate != null) 'creationDate': unixTimestampToJson(creationDate), if (defaultBranch != null) 'defaultBranch': defaultBranch, + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, if (lastModifiedDate != null) 'lastModifiedDate': unixTimestampToJson(lastModifiedDate), if (repositoryDescription != null) @@ -9787,6 +10135,12 @@ class RepositoryNameIdPair { } /// Information about a trigger for a repository. +/// +/// If you want to receive notifications about repository events, consider using +/// notifications instead of triggers. For more information, see Configuring +/// notifications for repository events. +/// class RepositoryTrigger { /// The ARN of the resource that is the target for a trigger (for example, the /// ARN of a topic in Amazon SNS). @@ -10344,6 +10698,44 @@ class UpdatePullRequestTitleOutput { } } +class UpdateRepositoryEncryptionKeyOutput { + /// The ID of the encryption key. + final String? kmsKeyId; + + /// The ID of the encryption key formerly used to encrypt and decrypt the + /// repository. + final String? originalKmsKeyId; + + /// The ID of the repository. + final String? repositoryId; + + UpdateRepositoryEncryptionKeyOutput({ + this.kmsKeyId, + this.originalKmsKeyId, + this.repositoryId, + }); + + factory UpdateRepositoryEncryptionKeyOutput.fromJson( + Map json) { + return UpdateRepositoryEncryptionKeyOutput( + kmsKeyId: json['kmsKeyId'] as String?, + originalKmsKeyId: json['originalKmsKeyId'] as String?, + repositoryId: json['repositoryId'] as String?, + ); + } + + Map toJson() { + final kmsKeyId = this.kmsKeyId; + final originalKmsKeyId = this.originalKmsKeyId; + final repositoryId = this.repositoryId; + return { + if (kmsKeyId != null) 'kmsKeyId': kmsKeyId, + if (originalKmsKeyId != null) 'originalKmsKeyId': originalKmsKeyId, + if (repositoryId != null) 'repositoryId': repositoryId, + }; + } +} + /// Information about the user who made a specified commit. class UserInfo { /// The date when the specified commit was commited, in timestamp format with @@ -10683,6 +11075,22 @@ class EncryptionKeyDisabledException extends _s.GenericAwsException { message: message); } +class EncryptionKeyInvalidIdException extends _s.GenericAwsException { + EncryptionKeyInvalidIdException({String? type, String? message}) + : super( + type: type, + code: 'EncryptionKeyInvalidIdException', + message: message); +} + +class EncryptionKeyInvalidUsageException extends _s.GenericAwsException { + EncryptionKeyInvalidUsageException({String? type, String? message}) + : super( + type: type, + code: 'EncryptionKeyInvalidUsageException', + message: message); +} + class EncryptionKeyNotFoundException extends _s.GenericAwsException { EncryptionKeyNotFoundException({String? type, String? message}) : super( @@ -10691,6 +11099,14 @@ class EncryptionKeyNotFoundException extends _s.GenericAwsException { message: message); } +class EncryptionKeyRequiredException extends _s.GenericAwsException { + EncryptionKeyRequiredException({String? type, String? message}) + : super( + type: type, + code: 'EncryptionKeyRequiredException', + message: message); +} + class EncryptionKeyUnavailableException extends _s.GenericAwsException { EncryptionKeyUnavailableException({String? type, String? message}) : super( @@ -11818,8 +12234,14 @@ final _exceptionFns = { EncryptionKeyAccessDeniedException(type: type, message: message), 'EncryptionKeyDisabledException': (type, message) => EncryptionKeyDisabledException(type: type, message: message), + 'EncryptionKeyInvalidIdException': (type, message) => + EncryptionKeyInvalidIdException(type: type, message: message), + 'EncryptionKeyInvalidUsageException': (type, message) => + EncryptionKeyInvalidUsageException(type: type, message: message), 'EncryptionKeyNotFoundException': (type, message) => EncryptionKeyNotFoundException(type: type, message: message), + 'EncryptionKeyRequiredException': (type, message) => + EncryptionKeyRequiredException(type: type, message: message), 'EncryptionKeyUnavailableException': (type, message) => EncryptionKeyUnavailableException(type: type, message: message), 'FileContentAndSourceFileSpecifiedException': (type, message) => diff --git a/aws_client/lib/src/generated/code_connections/v2023_12_01.dart b/aws_client/lib/src/generated/code_connections/v2023_12_01.dart new file mode 100644 index 000000000..8ba33b635 --- /dev/null +++ b/aws_client/lib/src/generated/code_connections/v2023_12_01.dart @@ -0,0 +1,3272 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// This Amazon Web Services CodeConnections API Reference provides descriptions +/// and usage examples of the operations and data types for the Amazon Web +/// Services CodeConnections API. You can use the connections API to work with +/// connections and installations. +class CodeConnections { + final _s.JsonProtocol _protocol; + CodeConnections({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.JsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'codeconnections', + signingName: 'codeconnections', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Creates a connection that can then be given to other Amazon Web Services + /// services like CodePipeline so that it can access third-party code + /// repositories. The connection is in pending status until the third-party + /// connection handshake is completed from the console. + /// + /// May throw [LimitExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceUnavailableException]. + /// + /// Parameter [connectionName] : + /// The name of the connection to be created. + /// + /// Parameter [hostArn] : + /// The Amazon Resource Name (ARN) of the host associated with the connection + /// to be created. + /// + /// Parameter [providerType] : + /// The name of the external provider where your third-party code repository + /// is configured. + /// + /// Parameter [tags] : + /// The key-value pair to use when tagging the resource. + Future createConnection({ + required String connectionName, + String? hostArn, + ProviderType? providerType, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.CreateConnection' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConnectionName': connectionName, + if (hostArn != null) 'HostArn': hostArn, + if (providerType != null) 'ProviderType': providerType.toValue(), + if (tags != null) 'Tags': tags, + }, + ); + + return CreateConnectionOutput.fromJson(jsonResponse.body); + } + + /// Creates a resource that represents the infrastructure where a third-party + /// provider is installed. The host is used when you create connections to an + /// installed third-party provider type, such as GitHub Enterprise Server. You + /// create one host for all connections to that provider. + /// + /// A host created through the CLI or the SDK is in `PENDING` status by + /// default. You can make its status `AVAILABLE` by setting up the host in the + /// console. + /// + /// + /// May throw [LimitExceededException]. + /// + /// Parameter [name] : + /// The name of the host to be created. + /// + /// Parameter [providerEndpoint] : + /// The endpoint of the infrastructure to be represented by the host after it + /// is created. + /// + /// Parameter [providerType] : + /// The name of the installed provider to be associated with your connection. + /// The host resource represents the infrastructure where your provider type + /// is installed. The valid provider type is GitHub Enterprise Server. + /// + /// Parameter [tags] : + /// Tags for the host to be created. + /// + /// Parameter [vpcConfiguration] : + /// The VPC configuration to be provisioned for the host. A VPC must be + /// configured and the infrastructure to be represented by the host must + /// already be connected to the VPC. + Future createHost({ + required String name, + required String providerEndpoint, + required ProviderType providerType, + List? tags, + VpcConfiguration? vpcConfiguration, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.CreateHost' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Name': name, + 'ProviderEndpoint': providerEndpoint, + 'ProviderType': providerType.toValue(), + if (tags != null) 'Tags': tags, + if (vpcConfiguration != null) 'VpcConfiguration': vpcConfiguration, + }, + ); + + return CreateHostOutput.fromJson(jsonResponse.body); + } + + /// Creates a link to a specified external Git repository. A repository link + /// allows Git sync to monitor and sync changes to files in a specified Git + /// repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of the connection to be associated with the + /// repository link. + /// + /// Parameter [ownerId] : + /// The owner ID for the repository associated with a specific sync + /// configuration, such as the owner ID in GitHub. + /// + /// Parameter [repositoryName] : + /// The name of the repository to be associated with the repository link. + /// + /// Parameter [encryptionKeyArn] : + /// The Amazon Resource Name (ARN) encryption key for the repository to be + /// associated with the repository link. + /// + /// Parameter [tags] : + /// The tags for the repository to be associated with the repository link. + Future createRepositoryLink({ + required String connectionArn, + required String ownerId, + required String repositoryName, + String? encryptionKeyArn, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.CreateRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConnectionArn': connectionArn, + 'OwnerId': ownerId, + 'RepositoryName': repositoryName, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Creates a sync configuration which allows Amazon Web Services to sync + /// content from a Git repository to update a specified Amazon Web Services + /// resource. Parameters for the sync configuration are determined by the sync + /// type. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [branch] : + /// The branch in the repository from which changes will be synced. + /// + /// Parameter [configFile] : + /// The file name of the configuration file that manages syncing between the + /// connection and the repository. This configuration file is stored in the + /// repository. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link created for the connection. A repository + /// link allows Git sync to monitor and sync changes to files in a specified + /// Git repository. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource (for example, a + /// CloudFormation stack in the case of CFN_STACK_SYNC) that will be + /// synchronized from the linked repository. + /// + /// Parameter [roleArn] : + /// The ARN of the IAM role that grants permission for Amazon Web Services to + /// use Git sync to update a given Amazon Web Services resource on your + /// behalf. + /// + /// Parameter [syncType] : + /// The type of sync configuration. + /// + /// Parameter [publishDeploymentStatus] : + /// Whether to enable or disable publishing of deployment status to source + /// providers. + /// + /// Parameter [triggerResourceUpdateOn] : + /// When to trigger Git sync to begin the stack update. + Future createSyncConfiguration({ + required String branch, + required String configFile, + required String repositoryLinkId, + required String resourceName, + required String roleArn, + required SyncConfigurationType syncType, + PublishDeploymentStatus? publishDeploymentStatus, + TriggerResourceUpdateOn? triggerResourceUpdateOn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.CreateSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Branch': branch, + 'ConfigFile': configFile, + 'RepositoryLinkId': repositoryLinkId, + 'ResourceName': resourceName, + 'RoleArn': roleArn, + 'SyncType': syncType.toValue(), + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }, + ); + + return CreateSyncConfigurationOutput.fromJson(jsonResponse.body); + } + + /// The connection to be deleted. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of the connection to be deleted. + /// + /// The ARN is never reused if the connection is deleted. + /// + Future deleteConnection({ + required String connectionArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.DeleteConnection' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConnectionArn': connectionArn, + }, + ); + } + + /// The host to be deleted. Before you delete a host, all connections + /// associated to the host must be deleted. + /// + /// A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or + /// VPC_CONFIG_DELETING state. + /// + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceUnavailableException]. + /// + /// Parameter [hostArn] : + /// The Amazon Resource Name (ARN) of the host to be deleted. + Future deleteHost({ + required String hostArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.DeleteHost' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'HostArn': hostArn, + }, + ); + } + + /// Deletes the association between your connection and a specified external + /// Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [SyncConfigurationStillExistsException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UnsupportedProviderTypeException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to be deleted. + Future deleteRepositoryLink({ + required String repositoryLinkId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.DeleteRepositoryLink' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + }, + ); + } + + /// Deletes the sync configuration for a specified repository and connection. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource associated with the sync + /// configuration to be deleted. + /// + /// Parameter [syncType] : + /// The type of sync configuration to be deleted. + Future deleteSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.DeleteSyncConfiguration' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + } + + /// Returns the connection ARN and details such as status, owner, and provider + /// type. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceUnavailableException]. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of a connection. + Future getConnection({ + required String connectionArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetConnection' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConnectionArn': connectionArn, + }, + ); + + return GetConnectionOutput.fromJson(jsonResponse.body); + } + + /// Returns the host ARN and details such as status, provider type, endpoint, + /// and, if applicable, the VPC configuration. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceUnavailableException]. + /// + /// Parameter [hostArn] : + /// The Amazon Resource Name (ARN) of the requested host. + Future getHost({ + required String hostArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetHost' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'HostArn': hostArn, + }, + ); + + return GetHostOutput.fromJson(jsonResponse.body); + } + + /// Returns details about a repository link. A repository link allows Git sync + /// to monitor and sync changes from files in a specified Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to get. + Future getRepositoryLink({ + required String repositoryLinkId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + }, + ); + + return GetRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Returns details about the sync status for a repository. A repository sync + /// uses Git sync to push and pull changes from your remote repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [branch] : + /// The branch of the repository link for the requested repository sync + /// status. + /// + /// Parameter [repositoryLinkId] : + /// The repository link ID for the requested repository sync status. + /// + /// Parameter [syncType] : + /// The sync type of the requested sync status. + Future getRepositorySyncStatus({ + required String branch, + required String repositoryLinkId, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetRepositorySyncStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Branch': branch, + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), + }, + ); + + return GetRepositorySyncStatusOutput.fromJson(jsonResponse.body); + } + + /// Returns the status of the sync with the Git repository for a specific + /// Amazon Web Services resource. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync status with the + /// Git repository. + /// + /// Parameter [syncType] : + /// The sync type for the sync status with the Git repository. + Future getResourceSyncStatus({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetResourceSyncStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetResourceSyncStatusOutput.fromJson(jsonResponse.body); + } + + /// Returns a list of the most recent sync blockers. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource currently blocked from + /// automatically being synced from a Git repository. + /// + /// Parameter [syncType] : + /// The sync type for the sync blocker summary. + Future getSyncBlockerSummary({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetSyncBlockerSummary' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetSyncBlockerSummaryOutput.fromJson(jsonResponse.body); + } + + /// Returns details about a sync configuration, including the sync type and + /// resource name. A sync configuration allows the configuration to sync (push + /// and pull) changes from the remote repository for a specified branch in a + /// Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync configuration + /// for which you want to retrieve information. + /// + /// Parameter [syncType] : + /// The sync type for the sync configuration for which you want to retrieve + /// information. + Future getSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.GetSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetSyncConfigurationOutput.fromJson(jsonResponse.body); + } + + /// Lists the connections associated with your account. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [hostArnFilter] : + /// Filters the list of connections to those associated with a specified host. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call. To retrieve the + /// remaining results, make another call with the returned + /// nextToken value. + /// + /// Parameter [nextToken] : + /// The token that was returned from the previous ListConnections + /// call, which can be used to return the next set of connections in the list. + /// + /// Parameter [providerTypeFilter] : + /// Filters the list of connections to those associated with a specified + /// provider, such as Bitbucket. + Future listConnections({ + String? hostArnFilter, + int? maxResults, + String? nextToken, + ProviderType? providerTypeFilter, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListConnections' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (hostArnFilter != null) 'HostArnFilter': hostArnFilter, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (providerTypeFilter != null) + 'ProviderTypeFilter': providerTypeFilter.toValue(), + }, + ); + + return ListConnectionsOutput.fromJson(jsonResponse.body); + } + + /// Lists the hosts associated with your account. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call. To retrieve the + /// remaining results, make another call with the returned + /// nextToken value. + /// + /// Parameter [nextToken] : + /// The token that was returned from the previous ListHosts call, + /// which can be used to return the next set of hosts in the list. + Future listHosts({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListHosts' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListHostsOutput.fromJson(jsonResponse.body); + } + + /// Lists the repository links created for connections in your account. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [maxResults] : + /// A non-zero, non-negative integer used to limit the number of returned + /// results. + /// + /// Parameter [nextToken] : + /// An enumeration token that, when provided in a request, returns the next + /// batch of the results. + Future listRepositoryLinks({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListRepositoryLinks' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListRepositoryLinksOutput.fromJson(jsonResponse.body); + } + + /// Lists the repository sync definitions for repository links in your + /// account. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the sync definition for which you want + /// to retrieve information. + /// + /// Parameter [syncType] : + /// The sync type of the repository link for the the sync definition for which + /// you want to retrieve information. + Future listRepositorySyncDefinitions({ + required String repositoryLinkId, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListRepositorySyncDefinitions' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), + }, + ); + + return ListRepositorySyncDefinitionsOutput.fromJson(jsonResponse.body); + } + + /// Returns a list of sync configurations for a specified repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the requested list of sync + /// configurations. + /// + /// Parameter [syncType] : + /// The sync type for the requested list of sync configurations. + /// + /// Parameter [maxResults] : + /// A non-zero, non-negative integer used to limit the number of returned + /// results. + /// + /// Parameter [nextToken] : + /// An enumeration token that allows the operation to batch the results of the + /// operation. + Future listSyncConfigurations({ + required String repositoryLinkId, + required SyncConfigurationType syncType, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListSyncConfigurations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListSyncConfigurationsOutput.fromJson(jsonResponse.body); + } + + /// Gets the set of key-value pairs (metadata) that are used to manage the + /// resource. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource for which you want to get + /// information about tags, if any. + Future listTagsForResource({ + required String resourceArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + }, + ); + + return ListTagsForResourceOutput.fromJson(jsonResponse.body); + } + + /// Adds to or modifies the tags of the given resource. Tags are metadata that + /// can be used to manage a resource. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to which you want to add or + /// update tags. + /// + /// Parameter [tags] : + /// The tags you want to modify or add to the resource. + Future tagResource({ + required String resourceArn, + required List tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'Tags': tags, + }, + ); + } + + /// Removes tags from an Amazon Web Services resource. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to remove tags from. + /// + /// Parameter [tagKeys] : + /// The list of keys for the tags to be removed from the resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.UntagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'TagKeys': tagKeys, + }, + ); + } + + /// Updates a specified host with the provided configurations. + /// + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceUnavailableException]. + /// May throw [UnsupportedOperationException]. + /// + /// Parameter [hostArn] : + /// The Amazon Resource Name (ARN) of the host to be updated. + /// + /// Parameter [providerEndpoint] : + /// The URL or endpoint of the host to be updated. + /// + /// Parameter [vpcConfiguration] : + /// The VPC configuration of the host to be updated. A VPC must be configured + /// and the infrastructure to be represented by the host must already be + /// connected to the VPC. + Future updateHost({ + required String hostArn, + String? providerEndpoint, + VpcConfiguration? vpcConfiguration, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.UpdateHost' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'HostArn': hostArn, + if (providerEndpoint != null) 'ProviderEndpoint': providerEndpoint, + if (vpcConfiguration != null) 'VpcConfiguration': vpcConfiguration, + }, + ); + } + + /// Updates the association between your connection and a specified external + /// Git repository. A repository link allows Git sync to monitor and sync + /// changes to files in a specified Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConditionalCheckFailedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UpdateOutOfSyncException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to be updated. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of the connection for the repository link + /// to be updated. The updated connection ARN must have the same providerType + /// (such as GitHub) as the original connection ARN for the repo link. + /// + /// Parameter [encryptionKeyArn] : + /// The Amazon Resource Name (ARN) of the encryption key for the repository + /// link to be updated. + Future updateRepositoryLink({ + required String repositoryLinkId, + String? connectionArn, + String? encryptionKeyArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.UpdateRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + if (connectionArn != null) 'ConnectionArn': connectionArn, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + }, + ); + + return UpdateRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Allows you to update the status of a sync blocker, resolving the blocker + /// and allowing syncing to continue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [RetryLatestCommitFailedException]. + /// May throw [SyncBlockerDoesNotExistException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [id] : + /// The ID of the sync blocker to be updated. + /// + /// Parameter [resolvedReason] : + /// The reason for resolving the sync blocker. + /// + /// Parameter [resourceName] : + /// The name of the resource for the sync blocker to be updated. + /// + /// Parameter [syncType] : + /// The sync type of the sync blocker to be updated. + Future updateSyncBlocker({ + required String id, + required String resolvedReason, + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.UpdateSyncBlocker' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Id': id, + 'ResolvedReason': resolvedReason, + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return UpdateSyncBlockerOutput.fromJson(jsonResponse.body); + } + + /// Updates the sync configuration for your connection and a specified + /// external Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UpdateOutOfSyncException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync configuration to + /// be updated. + /// + /// Parameter [syncType] : + /// The sync type for the sync configuration to be updated. + /// + /// Parameter [branch] : + /// The branch for the sync configuration to be updated. + /// + /// Parameter [configFile] : + /// The configuration file for the sync configuration to be updated. + /// + /// Parameter [publishDeploymentStatus] : + /// Whether to enable or disable publishing of deployment status to source + /// providers. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the sync configuration to be updated. + /// + /// Parameter [roleArn] : + /// The ARN of the IAM role for the sync configuration to be updated. + /// + /// Parameter [triggerResourceUpdateOn] : + /// When to trigger Git sync to begin the stack update. + Future updateSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + String? branch, + String? configFile, + PublishDeploymentStatus? publishDeploymentStatus, + String? repositoryLinkId, + String? roleArn, + TriggerResourceUpdateOn? triggerResourceUpdateOn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codeconnections.CodeConnections_20231201.UpdateSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + if (branch != null) 'Branch': branch, + if (configFile != null) 'ConfigFile': configFile, + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (repositoryLinkId != null) 'RepositoryLinkId': repositoryLinkId, + if (roleArn != null) 'RoleArn': roleArn, + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }, + ); + + return UpdateSyncConfigurationOutput.fromJson(jsonResponse.body); + } +} + +enum BlockerStatus { + active, + resolved, +} + +extension BlockerStatusValueExtension on BlockerStatus { + String toValue() { + switch (this) { + case BlockerStatus.active: + return 'ACTIVE'; + case BlockerStatus.resolved: + return 'RESOLVED'; + } + } +} + +extension BlockerStatusFromString on String { + BlockerStatus toBlockerStatus() { + switch (this) { + case 'ACTIVE': + return BlockerStatus.active; + case 'RESOLVED': + return BlockerStatus.resolved; + } + throw Exception('$this is not known in enum BlockerStatus'); + } +} + +enum BlockerType { + automated, +} + +extension BlockerTypeValueExtension on BlockerType { + String toValue() { + switch (this) { + case BlockerType.automated: + return 'AUTOMATED'; + } + } +} + +extension BlockerTypeFromString on String { + BlockerType toBlockerType() { + switch (this) { + case 'AUTOMATED': + return BlockerType.automated; + } + throw Exception('$this is not known in enum BlockerType'); + } +} + +/// A resource that is used to connect third-party source providers with +/// services like CodePipeline. +/// +/// Note: A connection created through CloudFormation, the CLI, or the SDK is in +/// `PENDING` status by default. You can make its status `AVAILABLE` by updating +/// the connection in the console. +class Connection { + /// The Amazon Resource Name (ARN) of the connection. The ARN is used as the + /// connection reference when the connection is shared between Amazon Web + /// Services. + /// + /// The ARN is never reused if the connection is deleted. + /// + final String? connectionArn; + + /// The name of the connection. Connection names must be unique in an Amazon Web + /// Services account. + final String? connectionName; + + /// The current status of the connection. + final ConnectionStatus? connectionStatus; + + /// The Amazon Resource Name (ARN) of the host associated with the connection. + final String? hostArn; + + /// The identifier of the external provider where your third-party code + /// repository is configured. For Bitbucket, this is the account ID of the owner + /// of the Bitbucket repository. + final String? ownerAccountId; + + /// The name of the external provider where your third-party code repository is + /// configured. + final ProviderType? providerType; + + Connection({ + this.connectionArn, + this.connectionName, + this.connectionStatus, + this.hostArn, + this.ownerAccountId, + this.providerType, + }); + + factory Connection.fromJson(Map json) { + return Connection( + connectionArn: json['ConnectionArn'] as String?, + connectionName: json['ConnectionName'] as String?, + connectionStatus: + (json['ConnectionStatus'] as String?)?.toConnectionStatus(), + hostArn: json['HostArn'] as String?, + ownerAccountId: json['OwnerAccountId'] as String?, + providerType: (json['ProviderType'] as String?)?.toProviderType(), + ); + } + + Map toJson() { + final connectionArn = this.connectionArn; + final connectionName = this.connectionName; + final connectionStatus = this.connectionStatus; + final hostArn = this.hostArn; + final ownerAccountId = this.ownerAccountId; + final providerType = this.providerType; + return { + if (connectionArn != null) 'ConnectionArn': connectionArn, + if (connectionName != null) 'ConnectionName': connectionName, + if (connectionStatus != null) + 'ConnectionStatus': connectionStatus.toValue(), + if (hostArn != null) 'HostArn': hostArn, + if (ownerAccountId != null) 'OwnerAccountId': ownerAccountId, + if (providerType != null) 'ProviderType': providerType.toValue(), + }; + } +} + +enum ConnectionStatus { + pending, + available, + error, +} + +extension ConnectionStatusValueExtension on ConnectionStatus { + String toValue() { + switch (this) { + case ConnectionStatus.pending: + return 'PENDING'; + case ConnectionStatus.available: + return 'AVAILABLE'; + case ConnectionStatus.error: + return 'ERROR'; + } + } +} + +extension ConnectionStatusFromString on String { + ConnectionStatus toConnectionStatus() { + switch (this) { + case 'PENDING': + return ConnectionStatus.pending; + case 'AVAILABLE': + return ConnectionStatus.available; + case 'ERROR': + return ConnectionStatus.error; + } + throw Exception('$this is not known in enum ConnectionStatus'); + } +} + +class CreateConnectionOutput { + /// The Amazon Resource Name (ARN) of the connection to be created. The ARN is + /// used as the connection reference when the connection is shared between + /// Amazon Web Services services. + /// + /// The ARN is never reused if the connection is deleted. + /// + final String connectionArn; + + /// Specifies the tags applied to the resource. + final List? tags; + + CreateConnectionOutput({ + required this.connectionArn, + this.tags, + }); + + factory CreateConnectionOutput.fromJson(Map json) { + return CreateConnectionOutput( + connectionArn: json['ConnectionArn'] as String, + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final connectionArn = this.connectionArn; + final tags = this.tags; + return { + 'ConnectionArn': connectionArn, + if (tags != null) 'Tags': tags, + }; + } +} + +class CreateHostOutput { + /// The Amazon Resource Name (ARN) of the host to be created. + final String? hostArn; + + /// Tags for the created host. + final List? tags; + + CreateHostOutput({ + this.hostArn, + this.tags, + }); + + factory CreateHostOutput.fromJson(Map json) { + return CreateHostOutput( + hostArn: json['HostArn'] as String?, + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final hostArn = this.hostArn; + final tags = this.tags; + return { + if (hostArn != null) 'HostArn': hostArn, + if (tags != null) 'Tags': tags, + }; + } +} + +class CreateRepositoryLinkOutput { + /// The returned information about the created repository link. + final RepositoryLinkInfo repositoryLinkInfo; + + CreateRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory CreateRepositoryLinkOutput.fromJson(Map json) { + return CreateRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class CreateSyncConfigurationOutput { + /// The created sync configuration for the connection. A sync configuration + /// allows Amazon Web Services to sync content from a Git repository to update a + /// specified Amazon Web Services resource. + final SyncConfiguration syncConfiguration; + + CreateSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory CreateSyncConfigurationOutput.fromJson(Map json) { + return CreateSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + +class DeleteConnectionOutput { + DeleteConnectionOutput(); + + factory DeleteConnectionOutput.fromJson(Map _) { + return DeleteConnectionOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteHostOutput { + DeleteHostOutput(); + + factory DeleteHostOutput.fromJson(Map _) { + return DeleteHostOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteRepositoryLinkOutput { + DeleteRepositoryLinkOutput(); + + factory DeleteRepositoryLinkOutput.fromJson(Map _) { + return DeleteRepositoryLinkOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSyncConfigurationOutput { + DeleteSyncConfigurationOutput(); + + factory DeleteSyncConfigurationOutput.fromJson(Map _) { + return DeleteSyncConfigurationOutput(); + } + + Map toJson() { + return {}; + } +} + +class GetConnectionOutput { + /// The connection details, such as status, owner, and provider type. + final Connection? connection; + + GetConnectionOutput({ + this.connection, + }); + + factory GetConnectionOutput.fromJson(Map json) { + return GetConnectionOutput( + connection: json['Connection'] != null + ? Connection.fromJson(json['Connection'] as Map) + : null, + ); + } + + Map toJson() { + final connection = this.connection; + return { + if (connection != null) 'Connection': connection, + }; + } +} + +class GetHostOutput { + /// The name of the requested host. + final String? name; + + /// The endpoint of the infrastructure represented by the requested host. + final String? providerEndpoint; + + /// The provider type of the requested host, such as GitHub Enterprise Server. + final ProviderType? providerType; + + /// The status of the requested host. + final String? status; + + /// The VPC configuration of the requested host. + final VpcConfiguration? vpcConfiguration; + + GetHostOutput({ + this.name, + this.providerEndpoint, + this.providerType, + this.status, + this.vpcConfiguration, + }); + + factory GetHostOutput.fromJson(Map json) { + return GetHostOutput( + name: json['Name'] as String?, + providerEndpoint: json['ProviderEndpoint'] as String?, + providerType: (json['ProviderType'] as String?)?.toProviderType(), + status: json['Status'] as String?, + vpcConfiguration: json['VpcConfiguration'] != null + ? VpcConfiguration.fromJson( + json['VpcConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final name = this.name; + final providerEndpoint = this.providerEndpoint; + final providerType = this.providerType; + final status = this.status; + final vpcConfiguration = this.vpcConfiguration; + return { + if (name != null) 'Name': name, + if (providerEndpoint != null) 'ProviderEndpoint': providerEndpoint, + if (providerType != null) 'ProviderType': providerType.toValue(), + if (status != null) 'Status': status, + if (vpcConfiguration != null) 'VpcConfiguration': vpcConfiguration, + }; + } +} + +class GetRepositoryLinkOutput { + /// The information returned for a specified repository link. + final RepositoryLinkInfo repositoryLinkInfo; + + GetRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory GetRepositoryLinkOutput.fromJson(Map json) { + return GetRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class GetRepositorySyncStatusOutput { + /// The status of the latest sync returned for a specified repository and + /// branch. + final RepositorySyncAttempt latestSync; + + GetRepositorySyncStatusOutput({ + required this.latestSync, + }); + + factory GetRepositorySyncStatusOutput.fromJson(Map json) { + return GetRepositorySyncStatusOutput( + latestSync: RepositorySyncAttempt.fromJson( + json['LatestSync'] as Map), + ); + } + + Map toJson() { + final latestSync = this.latestSync; + return { + 'LatestSync': latestSync, + }; + } +} + +class GetResourceSyncStatusOutput { + /// The latest sync for the sync status with the Git repository, whether + /// successful or not. + final ResourceSyncAttempt latestSync; + + /// The desired state of the Amazon Web Services resource for the sync status + /// with the Git repository. + final Revision? desiredState; + + /// The latest successful sync for the sync status with the Git repository. + final ResourceSyncAttempt? latestSuccessfulSync; + + GetResourceSyncStatusOutput({ + required this.latestSync, + this.desiredState, + this.latestSuccessfulSync, + }); + + factory GetResourceSyncStatusOutput.fromJson(Map json) { + return GetResourceSyncStatusOutput( + latestSync: ResourceSyncAttempt.fromJson( + json['LatestSync'] as Map), + desiredState: json['DesiredState'] != null + ? Revision.fromJson(json['DesiredState'] as Map) + : null, + latestSuccessfulSync: json['LatestSuccessfulSync'] != null + ? ResourceSyncAttempt.fromJson( + json['LatestSuccessfulSync'] as Map) + : null, + ); + } + + Map toJson() { + final latestSync = this.latestSync; + final desiredState = this.desiredState; + final latestSuccessfulSync = this.latestSuccessfulSync; + return { + 'LatestSync': latestSync, + if (desiredState != null) 'DesiredState': desiredState, + if (latestSuccessfulSync != null) + 'LatestSuccessfulSync': latestSuccessfulSync, + }; + } +} + +class GetSyncBlockerSummaryOutput { + /// The list of sync blockers for a specified resource. + final SyncBlockerSummary syncBlockerSummary; + + GetSyncBlockerSummaryOutput({ + required this.syncBlockerSummary, + }); + + factory GetSyncBlockerSummaryOutput.fromJson(Map json) { + return GetSyncBlockerSummaryOutput( + syncBlockerSummary: SyncBlockerSummary.fromJson( + json['SyncBlockerSummary'] as Map), + ); + } + + Map toJson() { + final syncBlockerSummary = this.syncBlockerSummary; + return { + 'SyncBlockerSummary': syncBlockerSummary, + }; + } +} + +class GetSyncConfigurationOutput { + /// The details about the sync configuration for which you want to retrieve + /// information. + final SyncConfiguration syncConfiguration; + + GetSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory GetSyncConfigurationOutput.fromJson(Map json) { + return GetSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + +/// A resource that represents the infrastructure where a third-party provider +/// is installed. The host is used when you create connections to an installed +/// third-party provider type, such as GitHub Enterprise Server. You create one +/// host for all connections to that provider. +/// +/// A host created through the CLI or the SDK is in `PENDING` status by default. +/// You can make its status `AVAILABLE` by setting up the host in the console. +/// +class Host { + /// The Amazon Resource Name (ARN) of the host. + final String? hostArn; + + /// The name of the host. + final String? name; + + /// The endpoint of the infrastructure where your provider type is installed. + final String? providerEndpoint; + + /// The name of the installed provider to be associated with your connection. + /// The host resource represents the infrastructure where your provider type is + /// installed. The valid provider type is GitHub Enterprise Server. + final ProviderType? providerType; + + /// The status of the host, such as PENDING, AVAILABLE, VPC_CONFIG_DELETING, + /// VPC_CONFIG_INITIALIZING, and VPC_CONFIG_FAILED_INITIALIZATION. + final String? status; + + /// The status description for the host. + final String? statusMessage; + + /// The VPC configuration provisioned for the host. + final VpcConfiguration? vpcConfiguration; + + Host({ + this.hostArn, + this.name, + this.providerEndpoint, + this.providerType, + this.status, + this.statusMessage, + this.vpcConfiguration, + }); + + factory Host.fromJson(Map json) { + return Host( + hostArn: json['HostArn'] as String?, + name: json['Name'] as String?, + providerEndpoint: json['ProviderEndpoint'] as String?, + providerType: (json['ProviderType'] as String?)?.toProviderType(), + status: json['Status'] as String?, + statusMessage: json['StatusMessage'] as String?, + vpcConfiguration: json['VpcConfiguration'] != null + ? VpcConfiguration.fromJson( + json['VpcConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final hostArn = this.hostArn; + final name = this.name; + final providerEndpoint = this.providerEndpoint; + final providerType = this.providerType; + final status = this.status; + final statusMessage = this.statusMessage; + final vpcConfiguration = this.vpcConfiguration; + return { + if (hostArn != null) 'HostArn': hostArn, + if (name != null) 'Name': name, + if (providerEndpoint != null) 'ProviderEndpoint': providerEndpoint, + if (providerType != null) 'ProviderType': providerType.toValue(), + if (status != null) 'Status': status, + if (statusMessage != null) 'StatusMessage': statusMessage, + if (vpcConfiguration != null) 'VpcConfiguration': vpcConfiguration, + }; + } +} + +class ListConnectionsOutput { + /// A list of connections and the details for each connection, such as status, + /// owner, and provider type. + final List? connections; + + /// A token that can be used in the next ListConnections call. To + /// view all items in the list, continue to call this operation with each + /// subsequent token until no more nextToken values are returned. + final String? nextToken; + + ListConnectionsOutput({ + this.connections, + this.nextToken, + }); + + factory ListConnectionsOutput.fromJson(Map json) { + return ListConnectionsOutput( + connections: (json['Connections'] as List?) + ?.whereNotNull() + .map((e) => Connection.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final connections = this.connections; + final nextToken = this.nextToken; + return { + if (connections != null) 'Connections': connections, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListHostsOutput { + /// A list of hosts and the details for each host, such as status, endpoint, and + /// provider type. + final List? hosts; + + /// A token that can be used in the next ListHosts call. To view + /// all items in the list, continue to call this operation with each subsequent + /// token until no more nextToken values are returned. + final String? nextToken; + + ListHostsOutput({ + this.hosts, + this.nextToken, + }); + + factory ListHostsOutput.fromJson(Map json) { + return ListHostsOutput( + hosts: (json['Hosts'] as List?) + ?.whereNotNull() + .map((e) => Host.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final hosts = this.hosts; + final nextToken = this.nextToken; + return { + if (hosts != null) 'Hosts': hosts, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRepositoryLinksOutput { + /// Lists the repository links called by the list repository links operation. + final List repositoryLinks; + + /// An enumeration token that allows the operation to batch the results of the + /// operation. + final String? nextToken; + + ListRepositoryLinksOutput({ + required this.repositoryLinks, + this.nextToken, + }); + + factory ListRepositoryLinksOutput.fromJson(Map json) { + return ListRepositoryLinksOutput( + repositoryLinks: (json['RepositoryLinks'] as List) + .whereNotNull() + .map((e) => RepositoryLinkInfo.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final repositoryLinks = this.repositoryLinks; + final nextToken = this.nextToken; + return { + 'RepositoryLinks': repositoryLinks, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRepositorySyncDefinitionsOutput { + /// The list of repository sync definitions returned by the request. A + /// RepositorySyncDefinition is a mapping from a repository branch + /// to all the Amazon Web Services resources that are being synced from that + /// branch. + final List repositorySyncDefinitions; + + /// An enumeration token that, when provided in a request, returns the next + /// batch of the results. + final String? nextToken; + + ListRepositorySyncDefinitionsOutput({ + required this.repositorySyncDefinitions, + this.nextToken, + }); + + factory ListRepositorySyncDefinitionsOutput.fromJson( + Map json) { + return ListRepositorySyncDefinitionsOutput( + repositorySyncDefinitions: (json['RepositorySyncDefinitions'] as List) + .whereNotNull() + .map((e) => + RepositorySyncDefinition.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final repositorySyncDefinitions = this.repositorySyncDefinitions; + final nextToken = this.nextToken; + return { + 'RepositorySyncDefinitions': repositorySyncDefinitions, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListSyncConfigurationsOutput { + /// The list of repository sync definitions returned by the request. + final List syncConfigurations; + + /// An enumeration token that allows the operation to batch the next results of + /// the operation. + final String? nextToken; + + ListSyncConfigurationsOutput({ + required this.syncConfigurations, + this.nextToken, + }); + + factory ListSyncConfigurationsOutput.fromJson(Map json) { + return ListSyncConfigurationsOutput( + syncConfigurations: (json['SyncConfigurations'] as List) + .whereNotNull() + .map((e) => SyncConfiguration.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final syncConfigurations = this.syncConfigurations; + final nextToken = this.nextToken; + return { + 'SyncConfigurations': syncConfigurations, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListTagsForResourceOutput { + /// A list of tag key and value pairs associated with the specified resource. + final List? tags; + + ListTagsForResourceOutput({ + this.tags, + }); + + factory ListTagsForResourceOutput.fromJson(Map json) { + return ListTagsForResourceOutput( + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'Tags': tags, + }; + } +} + +enum ProviderType { + bitbucket, + gitHub, + gitHubEnterpriseServer, + gitLab, + gitLabSelfManaged, +} + +extension ProviderTypeValueExtension on ProviderType { + String toValue() { + switch (this) { + case ProviderType.bitbucket: + return 'Bitbucket'; + case ProviderType.gitHub: + return 'GitHub'; + case ProviderType.gitHubEnterpriseServer: + return 'GitHubEnterpriseServer'; + case ProviderType.gitLab: + return 'GitLab'; + case ProviderType.gitLabSelfManaged: + return 'GitLabSelfManaged'; + } + } +} + +extension ProviderTypeFromString on String { + ProviderType toProviderType() { + switch (this) { + case 'Bitbucket': + return ProviderType.bitbucket; + case 'GitHub': + return ProviderType.gitHub; + case 'GitHubEnterpriseServer': + return ProviderType.gitHubEnterpriseServer; + case 'GitLab': + return ProviderType.gitLab; + case 'GitLabSelfManaged': + return ProviderType.gitLabSelfManaged; + } + throw Exception('$this is not known in enum ProviderType'); + } +} + +enum PublishDeploymentStatus { + enabled, + disabled, +} + +extension PublishDeploymentStatusValueExtension on PublishDeploymentStatus { + String toValue() { + switch (this) { + case PublishDeploymentStatus.enabled: + return 'ENABLED'; + case PublishDeploymentStatus.disabled: + return 'DISABLED'; + } + } +} + +extension PublishDeploymentStatusFromString on String { + PublishDeploymentStatus toPublishDeploymentStatus() { + switch (this) { + case 'ENABLED': + return PublishDeploymentStatus.enabled; + case 'DISABLED': + return PublishDeploymentStatus.disabled; + } + throw Exception('$this is not known in enum PublishDeploymentStatus'); + } +} + +/// Information about the repository link resource, such as the repository link +/// ARN, the associated connection ARN, encryption key ARN, and owner ID. +class RepositoryLinkInfo { + /// The Amazon Resource Name (ARN) of the connection associated with the + /// repository link. + final String connectionArn; + + /// The owner ID for the repository associated with the repository link, such as + /// the owner ID in GitHub. + final String ownerId; + + /// The provider type for the connection, such as GitHub, associated with the + /// repository link. + final ProviderType providerType; + + /// The Amazon Resource Name (ARN) of the repository link. + final String repositoryLinkArn; + + /// The ID of the repository link. + final String repositoryLinkId; + + /// The name of the repository associated with the repository link. + final String repositoryName; + + /// The Amazon Resource Name (ARN) of the encryption key for the repository + /// associated with the repository link. + final String? encryptionKeyArn; + + RepositoryLinkInfo({ + required this.connectionArn, + required this.ownerId, + required this.providerType, + required this.repositoryLinkArn, + required this.repositoryLinkId, + required this.repositoryName, + this.encryptionKeyArn, + }); + + factory RepositoryLinkInfo.fromJson(Map json) { + return RepositoryLinkInfo( + connectionArn: json['ConnectionArn'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryLinkArn: json['RepositoryLinkArn'] as String, + repositoryLinkId: json['RepositoryLinkId'] as String, + repositoryName: json['RepositoryName'] as String, + encryptionKeyArn: json['EncryptionKeyArn'] as String?, + ); + } + + Map toJson() { + final connectionArn = this.connectionArn; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryLinkArn = this.repositoryLinkArn; + final repositoryLinkId = this.repositoryLinkId; + final repositoryName = this.repositoryName; + final encryptionKeyArn = this.encryptionKeyArn; + return { + 'ConnectionArn': connectionArn, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryLinkArn': repositoryLinkArn, + 'RepositoryLinkId': repositoryLinkId, + 'RepositoryName': repositoryName, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + }; + } +} + +/// Information about a repository sync attempt for a repository with a sync +/// configuration. +class RepositorySyncAttempt { + /// The events associated with a specific sync attempt. + final List events; + + /// The start time of a specific sync attempt. + final DateTime startedAt; + + /// The status of a specific sync attempt. The following are valid statuses: + /// + ///
                  + ///
                • + /// INITIATED - A repository sync attempt has been created and will begin soon. + ///
                • + ///
                • + /// IN_PROGRESS - A repository sync attempt has started and work is being done + /// to reconcile the branch. + ///
                • + ///
                • + /// SUCCEEDED - The repository sync attempt has completed successfully. + ///
                • + ///
                • + /// FAILED - The repository sync attempt has failed. + ///
                • + ///
                • + /// QUEUED - The repository sync attempt didn't execute and was queued. + ///
                • + ///
                + final RepositorySyncStatus status; + + RepositorySyncAttempt({ + required this.events, + required this.startedAt, + required this.status, + }); + + factory RepositorySyncAttempt.fromJson(Map json) { + return RepositorySyncAttempt( + events: (json['Events'] as List) + .whereNotNull() + .map((e) => RepositorySyncEvent.fromJson(e as Map)) + .toList(), + startedAt: nonNullableTimeStampFromJson(json['StartedAt'] as Object), + status: (json['Status'] as String).toRepositorySyncStatus(), + ); + } + + Map toJson() { + final events = this.events; + final startedAt = this.startedAt; + final status = this.status; + return { + 'Events': events, + 'StartedAt': unixTimestampToJson(startedAt), + 'Status': status.toValue(), + }; + } +} + +/// The definition for a repository with a sync configuration. +class RepositorySyncDefinition { + /// The branch specified for a repository sync definition. + final String branch; + + /// The configuration file for a repository sync definition. This value comes + /// from creating or updating the config-file field of a + /// sync-configuration. + final String directory; + + /// The parent resource specified for a repository sync definition. + final String parent; + + /// The target resource specified for a repository sync definition. In some + /// cases, such as CFN_STACK_SYNC, the parent and target resource are the same. + final String target; + + RepositorySyncDefinition({ + required this.branch, + required this.directory, + required this.parent, + required this.target, + }); + + factory RepositorySyncDefinition.fromJson(Map json) { + return RepositorySyncDefinition( + branch: json['Branch'] as String, + directory: json['Directory'] as String, + parent: json['Parent'] as String, + target: json['Target'] as String, + ); + } + + Map toJson() { + final branch = this.branch; + final directory = this.directory; + final parent = this.parent; + final target = this.target; + return { + 'Branch': branch, + 'Directory': directory, + 'Parent': parent, + 'Target': target, + }; + } +} + +/// Information about a repository sync event. +class RepositorySyncEvent { + /// A description of a repository sync event. + final String event; + + /// The time that a repository sync event occurred. + final DateTime time; + + /// The event type for a repository sync event. + final String type; + + /// The ID for a repository sync event. + final String? externalId; + + RepositorySyncEvent({ + required this.event, + required this.time, + required this.type, + this.externalId, + }); + + factory RepositorySyncEvent.fromJson(Map json) { + return RepositorySyncEvent( + event: json['Event'] as String, + time: nonNullableTimeStampFromJson(json['Time'] as Object), + type: json['Type'] as String, + externalId: json['ExternalId'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final time = this.time; + final type = this.type; + final externalId = this.externalId; + return { + 'Event': event, + 'Time': unixTimestampToJson(time), + 'Type': type, + if (externalId != null) 'ExternalId': externalId, + }; + } +} + +enum RepositorySyncStatus { + failed, + initiated, + inProgress, + succeeded, + queued, +} + +extension RepositorySyncStatusValueExtension on RepositorySyncStatus { + String toValue() { + switch (this) { + case RepositorySyncStatus.failed: + return 'FAILED'; + case RepositorySyncStatus.initiated: + return 'INITIATED'; + case RepositorySyncStatus.inProgress: + return 'IN_PROGRESS'; + case RepositorySyncStatus.succeeded: + return 'SUCCEEDED'; + case RepositorySyncStatus.queued: + return 'QUEUED'; + } + } +} + +extension RepositorySyncStatusFromString on String { + RepositorySyncStatus toRepositorySyncStatus() { + switch (this) { + case 'FAILED': + return RepositorySyncStatus.failed; + case 'INITIATED': + return RepositorySyncStatus.initiated; + case 'IN_PROGRESS': + return RepositorySyncStatus.inProgress; + case 'SUCCEEDED': + return RepositorySyncStatus.succeeded; + case 'QUEUED': + return RepositorySyncStatus.queued; + } + throw Exception('$this is not known in enum RepositorySyncStatus'); + } +} + +/// Information about a resource sync attempt. +class ResourceSyncAttempt { + /// The events related to a resource sync attempt. + final List events; + + /// The current state of the resource as defined in the resource's + /// config-file in the linked repository. + final Revision initialRevision; + + /// The start time for a resource sync attempt. + final DateTime startedAt; + + /// The status for a resource sync attempt. The follow are valid statuses: + /// + ///
                  + ///
                • + /// SYNC-INITIATED - A resource sync attempt has been created and will begin + /// soon. + ///
                • + ///
                • + /// SYNCING - Syncing has started and work is being done to reconcile state. + ///
                • + ///
                • + /// SYNCED - Syncing has completed successfully. + ///
                • + ///
                • + /// SYNC_FAILED - A resource sync attempt has failed. + ///
                • + ///
                + final ResourceSyncStatus status; + + /// The name of the Amazon Web Services resource that is attempted to be + /// synchronized. + final String target; + + /// The desired state of the resource as defined in the resource's + /// config-file in the linked repository. Git sync attempts to + /// update the resource to this state. + final Revision targetRevision; + + ResourceSyncAttempt({ + required this.events, + required this.initialRevision, + required this.startedAt, + required this.status, + required this.target, + required this.targetRevision, + }); + + factory ResourceSyncAttempt.fromJson(Map json) { + return ResourceSyncAttempt( + events: (json['Events'] as List) + .whereNotNull() + .map((e) => ResourceSyncEvent.fromJson(e as Map)) + .toList(), + initialRevision: + Revision.fromJson(json['InitialRevision'] as Map), + startedAt: nonNullableTimeStampFromJson(json['StartedAt'] as Object), + status: (json['Status'] as String).toResourceSyncStatus(), + target: json['Target'] as String, + targetRevision: + Revision.fromJson(json['TargetRevision'] as Map), + ); + } + + Map toJson() { + final events = this.events; + final initialRevision = this.initialRevision; + final startedAt = this.startedAt; + final status = this.status; + final target = this.target; + final targetRevision = this.targetRevision; + return { + 'Events': events, + 'InitialRevision': initialRevision, + 'StartedAt': unixTimestampToJson(startedAt), + 'Status': status.toValue(), + 'Target': target, + 'TargetRevision': targetRevision, + }; + } +} + +/// Information about a resource sync event for the resource associated with a +/// sync configuration. +class ResourceSyncEvent { + /// The event for a resource sync event. + final String event; + + /// The time that a resource sync event occurred. + final DateTime time; + + /// The type of resource sync event. + final String type; + + /// The ID for a resource sync event. + final String? externalId; + + ResourceSyncEvent({ + required this.event, + required this.time, + required this.type, + this.externalId, + }); + + factory ResourceSyncEvent.fromJson(Map json) { + return ResourceSyncEvent( + event: json['Event'] as String, + time: nonNullableTimeStampFromJson(json['Time'] as Object), + type: json['Type'] as String, + externalId: json['ExternalId'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final time = this.time; + final type = this.type; + final externalId = this.externalId; + return { + 'Event': event, + 'Time': unixTimestampToJson(time), + 'Type': type, + if (externalId != null) 'ExternalId': externalId, + }; + } +} + +enum ResourceSyncStatus { + failed, + initiated, + inProgress, + succeeded, +} + +extension ResourceSyncStatusValueExtension on ResourceSyncStatus { + String toValue() { + switch (this) { + case ResourceSyncStatus.failed: + return 'FAILED'; + case ResourceSyncStatus.initiated: + return 'INITIATED'; + case ResourceSyncStatus.inProgress: + return 'IN_PROGRESS'; + case ResourceSyncStatus.succeeded: + return 'SUCCEEDED'; + } + } +} + +extension ResourceSyncStatusFromString on String { + ResourceSyncStatus toResourceSyncStatus() { + switch (this) { + case 'FAILED': + return ResourceSyncStatus.failed; + case 'INITIATED': + return ResourceSyncStatus.initiated; + case 'IN_PROGRESS': + return ResourceSyncStatus.inProgress; + case 'SUCCEEDED': + return ResourceSyncStatus.succeeded; + } + throw Exception('$this is not known in enum ResourceSyncStatus'); + } +} + +/// Information about the revision for a specific sync event, such as the +/// branch, owner ID, and name of the repository. +class Revision { + /// The branch name for a specific revision. + final String branch; + + /// The directory, if any, for a specific revision. + final String directory; + + /// The owner ID for a specific revision, such as the GitHub owner ID for a + /// GitHub repository. + final String ownerId; + + /// The provider type for a revision, such as GitHub. + final ProviderType providerType; + + /// The repository name for a specific revision. + final String repositoryName; + + /// The SHA, such as the commit ID, for a specific revision. + final String sha; + + Revision({ + required this.branch, + required this.directory, + required this.ownerId, + required this.providerType, + required this.repositoryName, + required this.sha, + }); + + factory Revision.fromJson(Map json) { + return Revision( + branch: json['Branch'] as String, + directory: json['Directory'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryName: json['RepositoryName'] as String, + sha: json['Sha'] as String, + ); + } + + Map toJson() { + final branch = this.branch; + final directory = this.directory; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryName = this.repositoryName; + final sha = this.sha; + return { + 'Branch': branch, + 'Directory': directory, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryName': repositoryName, + 'Sha': sha, + }; + } +} + +/// Information about a blocker for a sync event. +class SyncBlocker { + /// The creation time for a specific sync blocker. + final DateTime createdAt; + + /// The provided reason for a specific sync blocker. + final String createdReason; + + /// The ID for a specific sync blocker. + final String id; + + /// The status for a specific sync blocker. + final BlockerStatus status; + + /// The sync blocker type. + final BlockerType type; + + /// The contexts for a specific sync blocker. + final List? contexts; + + /// The time that a specific sync blocker was resolved. + final DateTime? resolvedAt; + + /// The resolved reason for a specific sync blocker. + final String? resolvedReason; + + SyncBlocker({ + required this.createdAt, + required this.createdReason, + required this.id, + required this.status, + required this.type, + this.contexts, + this.resolvedAt, + this.resolvedReason, + }); + + factory SyncBlocker.fromJson(Map json) { + return SyncBlocker( + createdAt: nonNullableTimeStampFromJson(json['CreatedAt'] as Object), + createdReason: json['CreatedReason'] as String, + id: json['Id'] as String, + status: (json['Status'] as String).toBlockerStatus(), + type: (json['Type'] as String).toBlockerType(), + contexts: (json['Contexts'] as List?) + ?.whereNotNull() + .map((e) => SyncBlockerContext.fromJson(e as Map)) + .toList(), + resolvedAt: timeStampFromJson(json['ResolvedAt']), + resolvedReason: json['ResolvedReason'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdReason = this.createdReason; + final id = this.id; + final status = this.status; + final type = this.type; + final contexts = this.contexts; + final resolvedAt = this.resolvedAt; + final resolvedReason = this.resolvedReason; + return { + 'CreatedAt': unixTimestampToJson(createdAt), + 'CreatedReason': createdReason, + 'Id': id, + 'Status': status.toValue(), + 'Type': type.toValue(), + if (contexts != null) 'Contexts': contexts, + if (resolvedAt != null) 'ResolvedAt': unixTimestampToJson(resolvedAt), + if (resolvedReason != null) 'ResolvedReason': resolvedReason, + }; + } +} + +/// The context for a specific sync blocker. +class SyncBlockerContext { + /// The key provided for a context key-value pair for a specific sync blocker. + final String key; + + /// The value provided for a context key-value pair for a specific sync blocker. + final String value; + + SyncBlockerContext({ + required this.key, + required this.value, + }); + + factory SyncBlockerContext.fromJson(Map json) { + return SyncBlockerContext( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +/// A summary for sync blockers. +class SyncBlockerSummary { + /// The resource name for sync blocker summary. + final String resourceName; + + /// The latest events for a sync blocker summary. + final List? latestBlockers; + + /// The parent resource name for a sync blocker summary. + final String? parentResourceName; + + SyncBlockerSummary({ + required this.resourceName, + this.latestBlockers, + this.parentResourceName, + }); + + factory SyncBlockerSummary.fromJson(Map json) { + return SyncBlockerSummary( + resourceName: json['ResourceName'] as String, + latestBlockers: (json['LatestBlockers'] as List?) + ?.whereNotNull() + .map((e) => SyncBlocker.fromJson(e as Map)) + .toList(), + parentResourceName: json['ParentResourceName'] as String?, + ); + } + + Map toJson() { + final resourceName = this.resourceName; + final latestBlockers = this.latestBlockers; + final parentResourceName = this.parentResourceName; + return { + 'ResourceName': resourceName, + if (latestBlockers != null) 'LatestBlockers': latestBlockers, + if (parentResourceName != null) 'ParentResourceName': parentResourceName, + }; + } +} + +/// Information, such as repository, branch, provider, and resource names for a +/// specific sync configuration. +class SyncConfiguration { + /// The branch associated with a specific sync configuration. + final String branch; + + /// The owner ID for the repository associated with a specific sync + /// configuration, such as the owner ID in GitHub. + final String ownerId; + + /// The connection provider type associated with a specific sync configuration, + /// such as GitHub. + final ProviderType providerType; + + /// The ID of the repository link associated with a specific sync configuration. + final String repositoryLinkId; + + /// The name of the repository associated with a specific sync configuration. + final String repositoryName; + + /// The name of the connection resource associated with a specific sync + /// configuration. + final String resourceName; + + /// The Amazon Resource Name (ARN) of the IAM role associated with a specific + /// sync configuration. + final String roleArn; + + /// The type of sync for a specific sync configuration. + final SyncConfigurationType syncType; + + /// The file path to the configuration file associated with a specific sync + /// configuration. The path should point to an actual file in the sync + /// configurations linked repository. + final String? configFile; + + /// Whether to enable or disable publishing of deployment status to source + /// providers. + final PublishDeploymentStatus? publishDeploymentStatus; + + /// When to trigger Git sync to begin the stack update. + final TriggerResourceUpdateOn? triggerResourceUpdateOn; + + SyncConfiguration({ + required this.branch, + required this.ownerId, + required this.providerType, + required this.repositoryLinkId, + required this.repositoryName, + required this.resourceName, + required this.roleArn, + required this.syncType, + this.configFile, + this.publishDeploymentStatus, + this.triggerResourceUpdateOn, + }); + + factory SyncConfiguration.fromJson(Map json) { + return SyncConfiguration( + branch: json['Branch'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryLinkId: json['RepositoryLinkId'] as String, + repositoryName: json['RepositoryName'] as String, + resourceName: json['ResourceName'] as String, + roleArn: json['RoleArn'] as String, + syncType: (json['SyncType'] as String).toSyncConfigurationType(), + configFile: json['ConfigFile'] as String?, + publishDeploymentStatus: (json['PublishDeploymentStatus'] as String?) + ?.toPublishDeploymentStatus(), + triggerResourceUpdateOn: (json['TriggerResourceUpdateOn'] as String?) + ?.toTriggerResourceUpdateOn(), + ); + } + + Map toJson() { + final branch = this.branch; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryLinkId = this.repositoryLinkId; + final repositoryName = this.repositoryName; + final resourceName = this.resourceName; + final roleArn = this.roleArn; + final syncType = this.syncType; + final configFile = this.configFile; + final publishDeploymentStatus = this.publishDeploymentStatus; + final triggerResourceUpdateOn = this.triggerResourceUpdateOn; + return { + 'Branch': branch, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryLinkId': repositoryLinkId, + 'RepositoryName': repositoryName, + 'ResourceName': resourceName, + 'RoleArn': roleArn, + 'SyncType': syncType.toValue(), + if (configFile != null) 'ConfigFile': configFile, + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }; + } +} + +enum SyncConfigurationType { + cfnStackSync, +} + +extension SyncConfigurationTypeValueExtension on SyncConfigurationType { + String toValue() { + switch (this) { + case SyncConfigurationType.cfnStackSync: + return 'CFN_STACK_SYNC'; + } + } +} + +extension SyncConfigurationTypeFromString on String { + SyncConfigurationType toSyncConfigurationType() { + switch (this) { + case 'CFN_STACK_SYNC': + return SyncConfigurationType.cfnStackSync; + } + throw Exception('$this is not known in enum SyncConfigurationType'); + } +} + +/// A tag is a key-value pair that is used to manage the resource. +/// +/// This tag is available for use by Amazon Web Services services that support +/// tags. +class Tag { + /// The tag's key. + final String key; + + /// The tag's value. + final String value; + + Tag({ + required this.key, + required this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +class TagResourceOutput { + TagResourceOutput(); + + factory TagResourceOutput.fromJson(Map _) { + return TagResourceOutput(); + } + + Map toJson() { + return {}; + } +} + +enum TriggerResourceUpdateOn { + anyChange, + fileChange, +} + +extension TriggerResourceUpdateOnValueExtension on TriggerResourceUpdateOn { + String toValue() { + switch (this) { + case TriggerResourceUpdateOn.anyChange: + return 'ANY_CHANGE'; + case TriggerResourceUpdateOn.fileChange: + return 'FILE_CHANGE'; + } + } +} + +extension TriggerResourceUpdateOnFromString on String { + TriggerResourceUpdateOn toTriggerResourceUpdateOn() { + switch (this) { + case 'ANY_CHANGE': + return TriggerResourceUpdateOn.anyChange; + case 'FILE_CHANGE': + return TriggerResourceUpdateOn.fileChange; + } + throw Exception('$this is not known in enum TriggerResourceUpdateOn'); + } +} + +class UntagResourceOutput { + UntagResourceOutput(); + + factory UntagResourceOutput.fromJson(Map _) { + return UntagResourceOutput(); + } + + Map toJson() { + return {}; + } +} + +class UpdateHostOutput { + UpdateHostOutput(); + + factory UpdateHostOutput.fromJson(Map _) { + return UpdateHostOutput(); + } + + Map toJson() { + return {}; + } +} + +class UpdateRepositoryLinkOutput { + /// Information about the repository link to be updated. + final RepositoryLinkInfo repositoryLinkInfo; + + UpdateRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory UpdateRepositoryLinkOutput.fromJson(Map json) { + return UpdateRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class UpdateSyncBlockerOutput { + /// The resource name for the sync blocker. + final String resourceName; + + /// Information about the sync blocker to be updated. + final SyncBlocker syncBlocker; + + /// The parent resource name for the sync blocker. + final String? parentResourceName; + + UpdateSyncBlockerOutput({ + required this.resourceName, + required this.syncBlocker, + this.parentResourceName, + }); + + factory UpdateSyncBlockerOutput.fromJson(Map json) { + return UpdateSyncBlockerOutput( + resourceName: json['ResourceName'] as String, + syncBlocker: + SyncBlocker.fromJson(json['SyncBlocker'] as Map), + parentResourceName: json['ParentResourceName'] as String?, + ); + } + + Map toJson() { + final resourceName = this.resourceName; + final syncBlocker = this.syncBlocker; + final parentResourceName = this.parentResourceName; + return { + 'ResourceName': resourceName, + 'SyncBlocker': syncBlocker, + if (parentResourceName != null) 'ParentResourceName': parentResourceName, + }; + } +} + +class UpdateSyncConfigurationOutput { + /// The information returned for the sync configuration to be updated. + final SyncConfiguration syncConfiguration; + + UpdateSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory UpdateSyncConfigurationOutput.fromJson(Map json) { + return UpdateSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + +/// The VPC configuration provisioned for the host. +class VpcConfiguration { + /// The ID of the security group or security groups associated with the Amazon + /// VPC connected to the infrastructure where your provider type is installed. + final List securityGroupIds; + + /// The ID of the subnet or subnets associated with the Amazon VPC connected to + /// the infrastructure where your provider type is installed. + final List subnetIds; + + /// The ID of the Amazon VPC connected to the infrastructure where your provider + /// type is installed. + final String vpcId; + + /// The value of the Transport Layer Security (TLS) certificate associated with + /// the infrastructure where your provider type is installed. + final String? tlsCertificate; + + VpcConfiguration({ + required this.securityGroupIds, + required this.subnetIds, + required this.vpcId, + this.tlsCertificate, + }); + + factory VpcConfiguration.fromJson(Map json) { + return VpcConfiguration( + securityGroupIds: (json['SecurityGroupIds'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + subnetIds: (json['SubnetIds'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + vpcId: json['VpcId'] as String, + tlsCertificate: json['TlsCertificate'] as String?, + ); + } + + Map toJson() { + final securityGroupIds = this.securityGroupIds; + final subnetIds = this.subnetIds; + final vpcId = this.vpcId; + final tlsCertificate = this.tlsCertificate; + return { + 'SecurityGroupIds': securityGroupIds, + 'SubnetIds': subnetIds, + 'VpcId': vpcId, + if (tlsCertificate != null) 'TlsCertificate': tlsCertificate, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConcurrentModificationException extends _s.GenericAwsException { + ConcurrentModificationException({String? type, String? message}) + : super( + type: type, + code: 'ConcurrentModificationException', + message: message); +} + +class ConditionalCheckFailedException extends _s.GenericAwsException { + ConditionalCheckFailedException({String? type, String? message}) + : super( + type: type, + code: 'ConditionalCheckFailedException', + message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class InvalidInputException extends _s.GenericAwsException { + InvalidInputException({String? type, String? message}) + : super(type: type, code: 'InvalidInputException', message: message); +} + +class LimitExceededException extends _s.GenericAwsException { + LimitExceededException({String? type, String? message}) + : super(type: type, code: 'LimitExceededException', message: message); +} + +class ResourceAlreadyExistsException extends _s.GenericAwsException { + ResourceAlreadyExistsException({String? type, String? message}) + : super( + type: type, + code: 'ResourceAlreadyExistsException', + message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ResourceUnavailableException extends _s.GenericAwsException { + ResourceUnavailableException({String? type, String? message}) + : super( + type: type, code: 'ResourceUnavailableException', message: message); +} + +class RetryLatestCommitFailedException extends _s.GenericAwsException { + RetryLatestCommitFailedException({String? type, String? message}) + : super( + type: type, + code: 'RetryLatestCommitFailedException', + message: message); +} + +class SyncBlockerDoesNotExistException extends _s.GenericAwsException { + SyncBlockerDoesNotExistException({String? type, String? message}) + : super( + type: type, + code: 'SyncBlockerDoesNotExistException', + message: message); +} + +class SyncConfigurationStillExistsException extends _s.GenericAwsException { + SyncConfigurationStillExistsException({String? type, String? message}) + : super( + type: type, + code: 'SyncConfigurationStillExistsException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class UnsupportedOperationException extends _s.GenericAwsException { + UnsupportedOperationException({String? type, String? message}) + : super( + type: type, + code: 'UnsupportedOperationException', + message: message); +} + +class UnsupportedProviderTypeException extends _s.GenericAwsException { + UnsupportedProviderTypeException({String? type, String? message}) + : super( + type: type, + code: 'UnsupportedProviderTypeException', + message: message); +} + +class UpdateOutOfSyncException extends _s.GenericAwsException { + UpdateOutOfSyncException({String? type, String? message}) + : super(type: type, code: 'UpdateOutOfSyncException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConcurrentModificationException': (type, message) => + ConcurrentModificationException(type: type, message: message), + 'ConditionalCheckFailedException': (type, message) => + ConditionalCheckFailedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'InvalidInputException': (type, message) => + InvalidInputException(type: type, message: message), + 'LimitExceededException': (type, message) => + LimitExceededException(type: type, message: message), + 'ResourceAlreadyExistsException': (type, message) => + ResourceAlreadyExistsException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ResourceUnavailableException': (type, message) => + ResourceUnavailableException(type: type, message: message), + 'RetryLatestCommitFailedException': (type, message) => + RetryLatestCommitFailedException(type: type, message: message), + 'SyncBlockerDoesNotExistException': (type, message) => + SyncBlockerDoesNotExistException(type: type, message: message), + 'SyncConfigurationStillExistsException': (type, message) => + SyncConfigurationStillExistsException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'UnsupportedOperationException': (type, message) => + UnsupportedOperationException(type: type, message: message), + 'UnsupportedProviderTypeException': (type, message) => + UnsupportedProviderTypeException(type: type, message: message), + 'UpdateOutOfSyncException': (type, message) => + UpdateOutOfSyncException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/code_deploy/v2014_10_06.dart b/aws_client/lib/src/generated/code_deploy/v2014_10_06.dart index 81a273f65..5e3d23139 100644 --- a/aws_client/lib/src/generated/code_deploy/v2014_10_06.dart +++ b/aws_client/lib/src/generated/code_deploy/v2014_10_06.dart @@ -262,7 +262,7 @@ class CodeDeploy { /// May throw [DeploymentConfigDoesNotExistException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the applicable IAM + /// The name of an CodeDeploy application associated with the applicable user /// or Amazon Web Services account. /// /// Parameter [deploymentGroupNames] : @@ -404,8 +404,8 @@ class CodeDeploy { ///
              • ///
              Future batchGetDeploymentTargets({ - String? deploymentId, - List? targetIds, + required String deploymentId, + required List targetIds, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -418,8 +418,8 @@ class CodeDeploy { // TODO queryParams headers: headers, payload: { - if (deploymentId != null) 'deploymentId': deploymentId, - if (targetIds != null) 'targetIds': targetIds, + 'deploymentId': deploymentId, + 'targetIds': targetIds, }, ); @@ -546,7 +546,7 @@ class CodeDeploy { /// /// Parameter [applicationName] : /// The name of the application. This name must be unique with the applicable - /// IAM or Amazon Web Services account. + /// user or Amazon Web Services account. /// /// Parameter [computePlatform] : /// The destination platform type for the deployment (Lambda, @@ -612,16 +612,16 @@ class CodeDeploy { /// May throw [InvalidTrafficRoutingConfigurationException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [autoRollbackConfiguration] : /// Configuration information for an automatic rollback that is added when a /// deployment is created. /// /// Parameter [deploymentConfigName] : - /// The name of a deployment configuration associated with the IAM user or - /// Amazon Web Services account. + /// The name of a deployment configuration associated with the user or Amazon + /// Web Services account. /// /// If not specified, the value configured in the deployment group is used as /// the default. If the deployment group does not have a deployment @@ -771,6 +771,7 @@ class CodeDeploy { /// May throw [DeploymentConfigLimitExceededException]. /// May throw [InvalidComputePlatformException]. /// May throw [InvalidTrafficRoutingConfigurationException]. + /// May throw [InvalidZonalDeploymentConfigurationException]. /// /// Parameter [deploymentConfigName] : /// The name of the deployment configuration to create. @@ -806,11 +807,22 @@ class CodeDeploy { /// /// Parameter [trafficRoutingConfig] : /// The configuration that specifies how the deployment traffic is routed. + /// + /// Parameter [zonalConfig] : + /// Configure the ZonalConfig object if you want CodeDeploy to + /// deploy your application to one Availability + /// Zone at a time, within an Amazon Web Services Region. + /// + /// For more information about the zonal configuration feature, see zonal + /// configuration in the CodeDeploy User Guide. Future createDeploymentConfig({ required String deploymentConfigName, ComputePlatform? computePlatform, MinimumHealthyHosts? minimumHealthyHosts, TrafficRoutingConfig? trafficRoutingConfig, + ZonalConfig? zonalConfig, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -830,6 +842,7 @@ class CodeDeploy { 'minimumHealthyHosts': minimumHealthyHosts, if (trafficRoutingConfig != null) 'trafficRoutingConfig': trafficRoutingConfig, + if (zonalConfig != null) 'zonalConfig': zonalConfig, }, ); @@ -873,8 +886,8 @@ class CodeDeploy { /// May throw [InvalidTrafficRoutingConfigurationException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [deploymentGroupName] : /// The name of a new deployment group for the specified application. @@ -966,6 +979,27 @@ class CodeDeploy { /// organize and categorize them. Each tag consists of a key and an optional /// value, both of which you define. /// + /// Parameter [terminationHookEnabled] : + /// This parameter only applies if you are using CodeDeploy with Amazon EC2 + /// Auto Scaling. For more information, see Integrating + /// CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User + /// Guide. + /// + /// Set terminationHookEnabled to true to have + /// CodeDeploy install a termination hook into your Auto Scaling group when + /// you create a deployment group. When this hook is installed, CodeDeploy + /// will perform termination deployments. + /// + /// For information about termination deployments, see Enabling + /// termination deployments during Auto Scaling scale-in events in the + /// CodeDeploy User Guide. + /// + /// For more information about Auto Scaling scale-in events, see the Scale + /// in topic in the Amazon EC2 Auto Scaling User Guide. + /// /// Parameter [triggerConfigurations] : /// Information about triggers to create when the deployment group is created. /// For examples, see ? tags, + bool? terminationHookEnabled, List? triggerConfigurations, }) async { final headers = { @@ -1025,6 +1060,8 @@ class CodeDeploy { if (outdatedInstancesStrategy != null) 'outdatedInstancesStrategy': outdatedInstancesStrategy.toValue(), if (tags != null) 'tags': tags, + if (terminationHookEnabled != null) + 'terminationHookEnabled': terminationHookEnabled, if (triggerConfigurations != null) 'triggerConfigurations': triggerConfigurations, }, @@ -1040,8 +1077,8 @@ class CodeDeploy { /// May throw [InvalidRoleException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. Future deleteApplication({ required String applicationName, }) async { @@ -1073,8 +1110,8 @@ class CodeDeploy { /// May throw [InvalidOperationException]. /// /// Parameter [deploymentConfigName] : - /// The name of a deployment configuration associated with the IAM user or - /// Amazon Web Services account. + /// The name of a deployment configuration associated with the user or Amazon + /// Web Services account. Future deleteDeploymentConfig({ required String deploymentConfigName, }) async { @@ -1103,8 +1140,8 @@ class CodeDeploy { /// May throw [InvalidRoleException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [deploymentGroupName] : /// The name of a deployment group for the specified application. @@ -1162,7 +1199,14 @@ class CodeDeploy { return DeleteGitHubAccountTokenOutput.fromJson(jsonResponse.body); } - /// Deletes resources linked to an external ID. + /// Deletes resources linked to an external ID. This action only applies if + /// you have configured blue/green deployments through CloudFormation. + /// + /// It is not necessary to call this action directly. CloudFormation calls it + /// on your behalf when it needs to delete stack resources. This action is + /// offered publicly in case you need to delete resources to comply with + /// General Data Protection Regulation (GDPR) requirements. + /// /// /// Parameter [externalId] : /// The unique ID of an external resource (for example, a CloudFormation stack @@ -1219,8 +1263,8 @@ class CodeDeploy { /// May throw [ApplicationDoesNotExistException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. Future getApplication({ required String applicationName, }) async { @@ -1294,7 +1338,7 @@ class CodeDeploy { /// May throw [DeploymentDoesNotExistException]. /// /// Parameter [deploymentId] : - /// The unique ID of a deployment associated with the IAM user or Amazon Web + /// The unique ID of a deployment associated with the user or Amazon Web /// Services account. Future getDeployment({ required String deploymentId, @@ -1325,8 +1369,8 @@ class CodeDeploy { /// May throw [InvalidComputePlatformException]. /// /// Parameter [deploymentConfigName] : - /// The name of a deployment configuration associated with the IAM user or - /// Amazon Web Services account. + /// The name of a deployment configuration associated with the user or Amazon + /// Web Services account. Future getDeploymentConfig({ required String deploymentConfigName, }) async { @@ -1359,8 +1403,8 @@ class CodeDeploy { /// May throw [DeploymentConfigDoesNotExistException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [deploymentGroupName] : /// The name of a deployment group for the specified application. @@ -1443,8 +1487,8 @@ class CodeDeploy { /// Parameter [targetId] : /// The unique ID of a deployment target. Future getDeploymentTarget({ - String? deploymentId, - String? targetId, + required String deploymentId, + required String targetId, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1457,8 +1501,8 @@ class CodeDeploy { // TODO queryParams headers: headers, payload: { - if (deploymentId != null) 'deploymentId': deploymentId, - if (targetId != null) 'targetId': targetId, + 'deploymentId': deploymentId, + 'targetId': targetId, }, ); @@ -1508,8 +1552,8 @@ class CodeDeploy { /// May throw [InvalidNextTokenException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [deployed] : /// Whether to list revisions based on whether the revision is the target @@ -1610,7 +1654,7 @@ class CodeDeploy { return ListApplicationRevisionsOutput.fromJson(jsonResponse.body); } - /// Lists the applications registered with the IAM user or Amazon Web Services + /// Lists the applications registered with the user or Amazon Web Services /// account. /// /// May throw [InvalidNextTokenException]. @@ -1639,8 +1683,8 @@ class CodeDeploy { return ListApplicationsOutput.fromJson(jsonResponse.body); } - /// Lists the deployment configurations with the IAM user or Amazon Web - /// Services account. + /// Lists the deployment configurations with the user or Amazon Web Services + /// account. /// /// May throw [InvalidNextTokenException]. /// @@ -1669,8 +1713,8 @@ class CodeDeploy { return ListDeploymentConfigsOutput.fromJson(jsonResponse.body); } - /// Lists the deployment groups for an application registered with the IAM - /// user or Amazon Web Services account. + /// Lists the deployment groups for an application registered with the Amazon + /// Web Services user or Amazon Web Services account. /// /// May throw [ApplicationNameRequiredException]. /// May throw [InvalidApplicationNameException]. @@ -1678,8 +1722,8 @@ class CodeDeploy { /// May throw [InvalidNextTokenException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [nextToken] : /// An identifier returned from the previous list deployment groups call. It @@ -1713,8 +1757,8 @@ class CodeDeploy { /// ListDeploymentInstances throws an exception if it is used /// with a compute platform other than EC2/On-premises or Lambda. /// - /// Lists the instance for a deployment associated with the IAM user or Amazon - /// Web Services account. + /// Lists the instance for a deployment associated with the user or Amazon Web + /// Services account. /// /// May throw [DeploymentIdRequiredException]. /// May throw [DeploymentDoesNotExistException]. @@ -1808,6 +1852,7 @@ class CodeDeploy { /// May throw [InvalidInstanceStatusException]. /// May throw [InvalidInstanceTypeException]. /// May throw [InvalidDeploymentInstanceTypeException]. + /// May throw [InvalidTargetFilterNameException]. /// /// Parameter [deploymentId] : /// The unique ID of a deployment. @@ -1833,7 +1878,7 @@ class CodeDeploy { ///
            • ///
            Future listDeploymentTargets({ - String? deploymentId, + required String deploymentId, String? nextToken, Map>? targetFilters, }) async { @@ -1848,7 +1893,7 @@ class CodeDeploy { // TODO queryParams headers: headers, payload: { - if (deploymentId != null) 'deploymentId': deploymentId, + 'deploymentId': deploymentId, if (nextToken != null) 'nextToken': nextToken, if (targetFilters != null) 'targetFilters': @@ -1860,7 +1905,7 @@ class CodeDeploy { } /// Lists the deployments in a deployment group for an application registered - /// with the IAM user or Amazon Web Services account. + /// with the user or Amazon Web Services account. /// /// May throw [ApplicationNameRequiredException]. /// May throw [InvalidApplicationNameException]. @@ -1875,8 +1920,8 @@ class CodeDeploy { /// May throw [InvalidInputException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// If applicationName is specified, then /// deploymentGroupName must be specified. If it is not @@ -2164,8 +2209,8 @@ class CodeDeploy { /// May throw [InvalidRevisionException]. /// /// Parameter [applicationName] : - /// The name of an CodeDeploy application associated with the IAM user or - /// Amazon Web Services account. + /// The name of an CodeDeploy application associated with the user or Amazon + /// Web Services account. /// /// Parameter [revision] : /// Information about the application revision to register, including type and @@ -2220,7 +2265,7 @@ class CodeDeploy { /// The ARN of the IAM session to associate with the on-premises instance. /// /// Parameter [iamUserArn] : - /// The ARN of the IAM user to associate with the on-premises instance. + /// The ARN of the user to associate with the on-premises instance. Future registerOnPremisesInstance({ required String instanceName, String? iamSessionArn, @@ -2533,7 +2578,7 @@ class CodeDeploy { /// To remove Auto Scaling groups, specify a non-null empty list of Auto /// Scaling group names to detach all CodeDeploy-managed Auto Scaling /// lifecycle hooks. For examples, see Amazon + /// href="https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-auto-scaling.html#troubleshooting-auto-scaling-heartbeat">Amazon /// EC2 instances in an Amazon EC2 Auto Scaling group fail to launch and /// receive the error "Heartbeat Timeout" in the CodeDeploy User /// Guide. @@ -2599,6 +2644,27 @@ class CodeDeploy { /// Parameter [serviceRoleArn] : /// A replacement ARN for the service role, if you want to change it. /// + /// Parameter [terminationHookEnabled] : + /// This parameter only applies if you are using CodeDeploy with Amazon EC2 + /// Auto Scaling. For more information, see Integrating + /// CodeDeploy with Amazon EC2 Auto Scaling in the CodeDeploy User + /// Guide. + /// + /// Set terminationHookEnabled to true to have + /// CodeDeploy install a termination hook into your Auto Scaling group when + /// you update a deployment group. When this hook is installed, CodeDeploy + /// will perform termination deployments. + /// + /// For information about termination deployments, see Enabling + /// termination deployments during Auto Scaling scale-in events in the + /// CodeDeploy User Guide. + /// + /// For more information about Auto Scaling scale-in events, see the Scale + /// in topic in the Amazon EC2 Auto Scaling User Guide. + /// /// Parameter [triggerConfigurations] : /// Information about triggers to change when the deployment group is updated. /// For examples, see ? triggerConfigurations, }) async { final headers = { @@ -2660,6 +2727,8 @@ class CodeDeploy { if (outdatedInstancesStrategy != null) 'outdatedInstancesStrategy': outdatedInstancesStrategy.toValue(), if (serviceRoleArn != null) 'serviceRoleArn': serviceRoleArn, + if (terminationHookEnabled != null) + 'terminationHookEnabled': terminationHookEnabled, if (triggerConfigurations != null) 'triggerConfigurations': triggerConfigurations, }, @@ -2959,30 +3028,49 @@ extension AutoRollbackEventFromString on String { /// Information about an Auto Scaling group. class AutoScalingGroup { - /// An Auto Scaling lifecycle event hook name. + /// The name of the launch hook that CodeDeploy installed into the Auto Scaling + /// group. + /// + /// For more information about the launch hook, see How + /// Amazon EC2 Auto Scaling works with CodeDeploy in the CodeDeploy User + /// Guide. final String? hook; /// The Auto Scaling group name. final String? name; + /// The name of the termination hook that CodeDeploy installed into the Auto + /// Scaling group. + /// + /// For more information about the termination hook, see Enabling + /// termination deployments during Auto Scaling scale-in events in the + /// CodeDeploy User Guide. + final String? terminationHook; + AutoScalingGroup({ this.hook, this.name, + this.terminationHook, }); factory AutoScalingGroup.fromJson(Map json) { return AutoScalingGroup( hook: json['hook'] as String?, name: json['name'] as String?, + terminationHook: json['terminationHook'] as String?, ); } Map toJson() { final hook = this.hook; final name = this.name; + final terminationHook = this.terminationHook; return { if (hook != null) 'hook': hook, if (name != null) 'name': name, + if (terminationHook != null) 'terminationHook': terminationHook, }; } } @@ -3660,13 +3748,16 @@ class DeploymentConfigInfo { /// The deployment configuration name. final String? deploymentConfigName; - /// Information about the number or percentage of minimum healthy instance. + /// Information about the number or percentage of minimum healthy instances. final MinimumHealthyHosts? minimumHealthyHosts; /// The configuration that specifies how the deployment traffic is routed. Used /// for deployments with a Lambda or Amazon ECS compute platform only. final TrafficRoutingConfig? trafficRoutingConfig; + /// Information about a zonal configuration. + final ZonalConfig? zonalConfig; + DeploymentConfigInfo({ this.computePlatform, this.createTime, @@ -3674,6 +3765,7 @@ class DeploymentConfigInfo { this.deploymentConfigName, this.minimumHealthyHosts, this.trafficRoutingConfig, + this.zonalConfig, }); factory DeploymentConfigInfo.fromJson(Map json) { @@ -3691,6 +3783,9 @@ class DeploymentConfigInfo { ? TrafficRoutingConfig.fromJson( json['trafficRoutingConfig'] as Map) : null, + zonalConfig: json['zonalConfig'] != null + ? ZonalConfig.fromJson(json['zonalConfig'] as Map) + : null, ); } @@ -3701,6 +3796,7 @@ class DeploymentConfigInfo { final deploymentConfigName = this.deploymentConfigName; final minimumHealthyHosts = this.minimumHealthyHosts; final trafficRoutingConfig = this.trafficRoutingConfig; + final zonalConfig = this.zonalConfig; return { if (computePlatform != null) 'computePlatform': computePlatform.toValue(), if (createTime != null) 'createTime': unixTimestampToJson(createTime), @@ -3711,6 +3807,7 @@ class DeploymentConfigInfo { 'minimumHealthyHosts': minimumHealthyHosts, if (trafficRoutingConfig != null) 'trafficRoutingConfig': trafficRoutingConfig, + if (zonalConfig != null) 'zonalConfig': zonalConfig, }; } } @@ -3723,6 +3820,7 @@ enum DeploymentCreator { codeDeployAutoUpdate, cloudFormation, cloudFormationRollback, + autoscalingTermination, } extension DeploymentCreatorValueExtension on DeploymentCreator { @@ -3742,6 +3840,8 @@ extension DeploymentCreatorValueExtension on DeploymentCreator { return 'CloudFormation'; case DeploymentCreator.cloudFormationRollback: return 'CloudFormationRollback'; + case DeploymentCreator.autoscalingTermination: + return 'autoscalingTermination'; } } } @@ -3763,6 +3863,8 @@ extension DeploymentCreatorFromString on String { return DeploymentCreator.cloudFormation; case 'CloudFormationRollback': return DeploymentCreator.cloudFormationRollback; + case 'autoscalingTermination': + return DeploymentCreator.autoscalingTermination; } throw Exception('$this is not known in enum DeploymentCreator'); } @@ -3861,6 +3963,15 @@ class DeploymentGroupInfo { /// location. final RevisionLocation? targetRevision; + /// Indicates whether the deployment group was configured to have CodeDeploy + /// install a termination hook into an Auto Scaling group. + /// + /// For more information about the termination hook, see How + /// Amazon EC2 Auto Scaling works with CodeDeploy in the CodeDeploy User + /// Guide. + final bool? terminationHookEnabled; + /// Information about triggers associated with the deployment group. final List? triggerConfigurations; @@ -3886,6 +3997,7 @@ class DeploymentGroupInfo { this.outdatedInstancesStrategy, this.serviceRoleArn, this.targetRevision, + this.terminationHookEnabled, this.triggerConfigurations, }); @@ -3958,6 +4070,7 @@ class DeploymentGroupInfo { ? RevisionLocation.fromJson( json['targetRevision'] as Map) : null, + terminationHookEnabled: json['terminationHookEnabled'] as bool?, triggerConfigurations: (json['triggerConfigurations'] as List?) ?.whereNotNull() .map((e) => TriggerConfig.fromJson(e as Map)) @@ -3988,6 +4101,7 @@ class DeploymentGroupInfo { final outdatedInstancesStrategy = this.outdatedInstancesStrategy; final serviceRoleArn = this.serviceRoleArn; final targetRevision = this.targetRevision; + final terminationHookEnabled = this.terminationHookEnabled; final triggerConfigurations = this.triggerConfigurations; return { if (alarmConfiguration != null) 'alarmConfiguration': alarmConfiguration, @@ -4019,6 +4133,8 @@ class DeploymentGroupInfo { 'outdatedInstancesStrategy': outdatedInstancesStrategy.toValue(), if (serviceRoleArn != null) 'serviceRoleArn': serviceRoleArn, if (targetRevision != null) 'targetRevision': targetRevision, + if (terminationHookEnabled != null) + 'terminationHookEnabled': terminationHookEnabled, if (triggerConfigurations != null) 'triggerConfigurations': triggerConfigurations, }; @@ -5195,14 +5311,14 @@ class ECSTaskSet { } } -/// Information about a load balancer in Elastic Load Balancing to use in a -/// deployment. Instances are registered directly with a load balancer, and +/// Information about a Classic Load Balancer in Elastic Load Balancing to use +/// in a deployment. Instances are registered directly with a load balancer, and /// traffic is routed to the load balancer. class ELBInfo { - /// For blue/green deployments, the name of the load balancer that is used to - /// route traffic from original instances to replacement instances in a - /// blue/green deployment. For in-place deployments, the name of the load - /// balancer that instances are deregistered from so they are not serving + /// For blue/green deployments, the name of the Classic Load Balancer that is + /// used to route traffic from original instances to replacement instances in a + /// blue/green deployment. For in-place deployments, the name of the Classic + /// Load Balancer that instances are deregistered from so they are not serving /// traffic during a deployment, and then re-registered with after the /// deployment is complete. final String? name; @@ -5954,7 +6070,7 @@ class InstanceInfo { /// The ARN of the IAM session associated with the on-premises instance. final String? iamSessionArn; - /// The IAM user ARN associated with the on-premises instance. + /// The user ARN associated with the on-premises instance. final String? iamUserArn; /// The ARN of the on-premises instance. @@ -7011,20 +7127,33 @@ class ListTagsForResourceOutput { /// Information about the Elastic Load Balancing load balancer or target group /// used in a deployment. +/// +/// You can use load balancers and target groups in combination. For example, if +/// you have two Classic Load Balancers, and five target groups tied to an +/// Application Load Balancer, you can specify the two Classic Load Balancers in +/// elbInfoList, and the five target groups in +/// targetGroupInfoList. class LoadBalancerInfo { - /// An array that contains information about the load balancer to use for load - /// balancing in a deployment. In Elastic Load Balancing, load balancers are - /// used with Classic Load Balancers. + /// An array that contains information about the load balancers to use for load + /// balancing in a deployment. If you're using Classic Load Balancers, specify + /// those load balancers in this array. /// - /// Adding more than one load balancer to the array is not supported. + /// You can add up to 10 load balancers to the array. + /// + /// If you're using Application Load Balancers or Network Load Balancers, use + /// the targetGroupInfoList array instead of this one. /// final List? elbInfoList; - /// An array that contains information about the target group to use for load - /// balancing in a deployment. In Elastic Load Balancing, target groups are used - /// with Application Load Balancers. + /// An array that contains information about the target groups to use for load + /// balancing in a deployment. If you're using Application Load Balancers and + /// Network Load Balancers, specify their associated target groups in this + /// array. /// - /// Adding more than one target group to the array is not supported. + /// You can add up to 10 target groups to the array. + /// + /// If you're using Classic Load Balancers, use the elbInfoList + /// array instead of this one. /// final List? targetGroupInfoList; @@ -7069,7 +7198,7 @@ class LoadBalancerInfo { } } -/// Information about minimum healthy instance. +/// Information about the minimum number of healthy instances. class MinimumHealthyHosts { /// The minimum healthy instance type: /// @@ -7131,6 +7260,69 @@ class MinimumHealthyHosts { } } +/// Information about the minimum number of healthy instances per Availability +/// Zone. +class MinimumHealthyHostsPerZone { + /// The type associated with the + /// MinimumHealthyHostsPerZone option. + final MinimumHealthyHostsPerZoneType? type; + + /// The value associated with the + /// MinimumHealthyHostsPerZone option. + final int? value; + + MinimumHealthyHostsPerZone({ + this.type, + this.value, + }); + + factory MinimumHealthyHostsPerZone.fromJson(Map json) { + return MinimumHealthyHostsPerZone( + type: (json['type'] as String?)?.toMinimumHealthyHostsPerZoneType(), + value: json['value'] as int?, + ); + } + + Map toJson() { + final type = this.type; + final value = this.value; + return { + if (type != null) 'type': type.toValue(), + if (value != null) 'value': value, + }; + } +} + +enum MinimumHealthyHostsPerZoneType { + hostCount, + fleetPercent, +} + +extension MinimumHealthyHostsPerZoneTypeValueExtension + on MinimumHealthyHostsPerZoneType { + String toValue() { + switch (this) { + case MinimumHealthyHostsPerZoneType.hostCount: + return 'HOST_COUNT'; + case MinimumHealthyHostsPerZoneType.fleetPercent: + return 'FLEET_PERCENT'; + } + } +} + +extension MinimumHealthyHostsPerZoneTypeFromString on String { + MinimumHealthyHostsPerZoneType toMinimumHealthyHostsPerZoneType() { + switch (this) { + case 'HOST_COUNT': + return MinimumHealthyHostsPerZoneType.hostCount; + case 'FLEET_PERCENT': + return MinimumHealthyHostsPerZoneType.fleetPercent; + } + throw Exception( + '$this is not known in enum MinimumHealthyHostsPerZoneType'); + } +} + enum MinimumHealthyHostsType { hostCount, fleetPercent, @@ -7568,6 +7760,12 @@ class S3Location { ///
          • /// zip: A zip archive file. ///
          • + ///
          • + /// YAML: A YAML-formatted file. + ///
          • + ///
          • + /// JSON: A JSON-formatted file. + ///
          • ///
          final BundleType? bundleType; @@ -8453,6 +8651,95 @@ class UpdateDeploymentGroupOutput { } } +/// Configure the ZonalConfig object if you want CodeDeploy to +/// deploy your application to one Availability +/// Zone at a time, within an Amazon Web Services Region. By deploying to +/// one Availability Zone at a time, you can expose your deployment to a +/// progressively larger audience as confidence in the deployment's performance +/// and viability grows. If you don't configure the ZonalConfig +/// object, CodeDeploy deploys your application to a random selection of hosts +/// across a Region. +/// +/// For more information about the zonal configuration feature, see zonal +/// configuration in the CodeDeploy User Guide. +class ZonalConfig { + /// The period of time, in seconds, that CodeDeploy must wait after completing a + /// deployment to the first Availability Zone. CodeDeploy will wait this + /// amount of time before starting a deployment to the second Availability Zone. + /// You might set this option if you want to allow extra bake time for the first + /// Availability Zone. If you don't specify a value for + /// firstZoneMonitorDurationInSeconds, then CodeDeploy uses the + /// monitorDurationInSeconds value for the first Availability Zone. + /// + /// For more information about the zonal configuration feature, see zonal + /// configuration in the CodeDeploy User Guide. + final int? firstZoneMonitorDurationInSeconds; + + /// The number or percentage of instances that must remain available per + /// Availability Zone during a deployment. This option works in conjunction with + /// the MinimumHealthyHosts option. For more information, see About + /// the minimum number of healthy hosts per Availability Zone in the + /// CodeDeploy User Guide. + /// + /// If you don't specify the minimumHealthyHostsPerZone option, + /// then CodeDeploy uses a default value of 0 percent. + /// + /// For more information about the zonal configuration feature, see zonal + /// configuration in the CodeDeploy User Guide. + final MinimumHealthyHostsPerZone? minimumHealthyHostsPerZone; + + /// The period of time, in seconds, that CodeDeploy must wait after completing a + /// deployment to an Availability Zone. CodeDeploy will wait this amount of time + /// before starting a deployment to the next Availability Zone. Consider adding + /// a monitor duration to give the deployment some time to prove itself (or + /// 'bake') in one Availability Zone before it is released in the next zone. If + /// you don't specify a monitorDurationInSeconds, CodeDeploy starts + /// deploying to the next Availability Zone immediately. + /// + /// For more information about the zonal configuration feature, see zonal + /// configuration in the CodeDeploy User Guide. + final int? monitorDurationInSeconds; + + ZonalConfig({ + this.firstZoneMonitorDurationInSeconds, + this.minimumHealthyHostsPerZone, + this.monitorDurationInSeconds, + }); + + factory ZonalConfig.fromJson(Map json) { + return ZonalConfig( + firstZoneMonitorDurationInSeconds: + json['firstZoneMonitorDurationInSeconds'] as int?, + minimumHealthyHostsPerZone: json['minimumHealthyHostsPerZone'] != null + ? MinimumHealthyHostsPerZone.fromJson( + json['minimumHealthyHostsPerZone'] as Map) + : null, + monitorDurationInSeconds: json['monitorDurationInSeconds'] as int?, + ); + } + + Map toJson() { + final firstZoneMonitorDurationInSeconds = + this.firstZoneMonitorDurationInSeconds; + final minimumHealthyHostsPerZone = this.minimumHealthyHostsPerZone; + final monitorDurationInSeconds = this.monitorDurationInSeconds; + return { + if (firstZoneMonitorDurationInSeconds != null) + 'firstZoneMonitorDurationInSeconds': firstZoneMonitorDurationInSeconds, + if (minimumHealthyHostsPerZone != null) + 'minimumHealthyHostsPerZone': minimumHealthyHostsPerZone, + if (monitorDurationInSeconds != null) + 'monitorDurationInSeconds': monitorDurationInSeconds, + }; + } +} + class AlarmsLimitExceededException extends _s.GenericAwsException { AlarmsLimitExceededException({String? type, String? message}) : super( @@ -9143,6 +9430,15 @@ class InvalidUpdateOutdatedInstancesOnlyValueException message: message); } +class InvalidZonalDeploymentConfigurationException + extends _s.GenericAwsException { + InvalidZonalDeploymentConfigurationException({String? type, String? message}) + : super( + type: type, + code: 'InvalidZonalDeploymentConfigurationException', + message: message); +} + class LifecycleEventAlreadyCompletedException extends _s.GenericAwsException { LifecycleEventAlreadyCompletedException({String? type, String? message}) : super( @@ -9439,6 +9735,9 @@ final _exceptionFns = { 'InvalidUpdateOutdatedInstancesOnlyValueException': (type, message) => InvalidUpdateOutdatedInstancesOnlyValueException( type: type, message: message), + 'InvalidZonalDeploymentConfigurationException': (type, message) => + InvalidZonalDeploymentConfigurationException( + type: type, message: message), 'LifecycleEventAlreadyCompletedException': (type, message) => LifecycleEventAlreadyCompletedException(type: type, message: message), 'LifecycleHookLimitExceededException': (type, message) => diff --git a/aws_client/lib/src/generated/code_guru_security/v2018_05_10.dart b/aws_client/lib/src/generated/code_guru_security/v2018_05_10.dart new file mode 100644 index 000000000..1c082b6ed --- /dev/null +++ b/aws_client/lib/src/generated/code_guru_security/v2018_05_10.dart @@ -0,0 +1,2124 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// +/// Amazon CodeGuru Security is in preview release and is subject to change. +/// +/// This section provides documentation for the Amazon CodeGuru Security API +/// operations. CodeGuru Security is a service that uses program analysis and +/// machine learning to detect security policy violations and vulnerabilities, +/// and recommends ways to address these security risks. +/// +/// By proactively detecting and providing recommendations for addressing +/// security risks, CodeGuru Security improves the overall security of your +/// application code. For more information about CodeGuru Security, see the Amazon +/// CodeGuru Security User Guide. +class CodeGuruSecurity { + final _s.RestJsonProtocol _protocol; + CodeGuruSecurity({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'codeguru-security', + signingName: 'codeguru-security', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Returns a list of requested findings from standard scans. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [findingIdentifiers] : + /// A list of finding identifiers. Each identifier consists of a + /// scanName and a findingId. You retrieve the + /// findingId when you call GetFindings. + Future batchGetFindings({ + required List findingIdentifiers, + }) async { + final $payload = { + 'findingIdentifiers': findingIdentifiers, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/batchGetFindings', + exceptionFnMap: _exceptionFns, + ); + return BatchGetFindingsResponse.fromJson(response); + } + + /// Use to create a scan using code uploaded to an Amazon S3 bucket. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceId] : + /// The identifier for the resource object to be scanned. + /// + /// Parameter [scanName] : + /// The unique name that CodeGuru Security uses to track revisions across + /// multiple scans of the same resource. Only allowed for a + /// STANDARD scan type. + /// + /// Parameter [analysisType] : + /// The type of analysis you want CodeGuru Security to perform in the scan, + /// either Security or All. The + /// Security type only generates findings related to security. + /// The All type generates both security findings and quality + /// findings. Defaults to Security type if missing. + /// + /// Parameter [clientToken] : + /// The idempotency token for the request. Amazon CodeGuru Security uses this + /// value to prevent the accidental creation of duplicate scans if there are + /// failures and retries. + /// + /// Parameter [scanType] : + /// The type of scan, either Standard or Express. + /// Defaults to Standard type if missing. + /// + /// Express scans run on limited resources and use a limited set + /// of detectors to analyze your code in near-real time. Standard + /// scans have standard resource limits and use the full set of detectors to + /// analyze your code. + /// + /// Parameter [tags] : + /// An array of key-value pairs used to tag a scan. A tag is a custom + /// attribute label with two parts: + /// + ///
            + ///
          • + /// A tag key. For example, CostCenter, Environment, + /// or Secret. Tag keys are case sensitive. + ///
          • + ///
          • + /// An optional tag value field. For example, 111122223333, + /// Production, or a team name. Omitting the tag value is the + /// same as using an empty string. Tag values are case sensitive. + ///
          • + ///
          + Future createScan({ + required ResourceId resourceId, + required String scanName, + AnalysisType? analysisType, + String? clientToken, + ScanType? scanType, + Map? tags, + }) async { + final $payload = { + 'resourceId': resourceId, + 'scanName': scanName, + if (analysisType != null) 'analysisType': analysisType.toValue(), + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (scanType != null) 'scanType': scanType.toValue(), + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/scans', + exceptionFnMap: _exceptionFns, + ); + return CreateScanResponse.fromJson(response); + } + + /// Generates a pre-signed URL, request headers used to upload a code + /// resource, and code artifact identifier for the uploaded resource. + /// + /// You can upload your code resource to the URL with the request headers + /// using any HTTP client. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [scanName] : + /// The name of the scan that will use the uploaded resource. CodeGuru + /// Security uses the unique scan name to track revisions across multiple + /// scans of the same resource. Use this scanName when you call + /// CreateScan on the code resource you upload to this URL. + Future createUploadUrl({ + required String scanName, + }) async { + final $payload = { + 'scanName': scanName, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/uploadUrl', + exceptionFnMap: _exceptionFns, + ); + return CreateUploadUrlResponse.fromJson(response); + } + + /// Use to get the encryption configuration for an account. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + Future getAccountConfiguration() async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/accountConfiguration/get', + exceptionFnMap: _exceptionFns, + ); + return GetAccountConfigurationResponse.fromJson(response); + } + + /// Returns a list of all findings generated by a particular scan. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [scanName] : + /// The name of the scan you want to retrieve findings from. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. Use this + /// parameter when paginating results. If additional results exist beyond the + /// number you specify, the nextToken element is returned in the + /// response. Use nextToken in a subsequent request to retrieve + /// additional results. If not specified, returns 1000 results. + /// + /// Parameter [nextToken] : + /// A token to use for paginating results that are returned in the response. + /// Set the value of this parameter to null for the first request. For + /// subsequent calls, use the nextToken value returned from the + /// previous request to continue listing results after the first page. + /// + /// Parameter [status] : + /// The status of the findings you want to get. Pass either Open, + /// Closed, or All. + Future getFindings({ + required String scanName, + int? maxResults, + String? nextToken, + Status? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/findings/${Uri.encodeComponent(scanName)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetFindingsResponse.fromJson(response); + } + + /// Returns a summary of metrics for an account from a specified date, + /// including number of open findings, the categories with most findings, the + /// scans with most open findings, and scans with most open critical findings. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [date] : + /// The date you want to retrieve summary metrics from, rounded to the nearest + /// day. The date must be within the past two years. + Future getMetricsSummary({ + required DateTime date, + }) async { + final $query = >{ + 'date': [_s.iso8601ToJson(date).toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/metrics/summary', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetMetricsSummaryResponse.fromJson(response); + } + + /// Returns details about a scan, including whether or not a scan has + /// completed. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [scanName] : + /// The name of the scan you want to view details about. + /// + /// Parameter [runId] : + /// UUID that identifies the individual scan run you want to view details + /// about. You retrieve this when you call the CreateScan + /// operation. Defaults to the latest scan run if missing. + Future getScan({ + required String scanName, + String? runId, + }) async { + final $query = >{ + if (runId != null) 'runId': [runId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/scans/${Uri.encodeComponent(scanName)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetScanResponse.fromJson(response); + } + + /// Returns metrics about all findings in an account within a specified time + /// range. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [endDate] : + /// The end date of the interval which you want to retrieve metrics from. + /// Round to the nearest day. + /// + /// Parameter [startDate] : + /// The start date of the interval which you want to retrieve metrics from. + /// Rounds to the nearest day. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. Use this + /// parameter when paginating results. If additional results exist beyond the + /// number you specify, the nextToken element is returned in the + /// response. Use nextToken in a subsequent request to retrieve + /// additional results. If not specified, returns 1000 results. + /// + /// Parameter [nextToken] : + /// A token to use for paginating results that are returned in the response. + /// Set the value of this parameter to null for the first request. For + /// subsequent calls, use the nextToken value returned from the + /// previous request to continue listing results after the first page. + Future listFindingsMetrics({ + required DateTime endDate, + required DateTime startDate, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + 'endDate': [_s.iso8601ToJson(endDate).toString()], + 'startDate': [_s.iso8601ToJson(startDate).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/metrics/findings', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFindingsMetricsResponse.fromJson(response); + } + + /// Returns a list of all scans in an account. Does not return + /// EXPRESS scans. + /// + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in the response. Use this + /// parameter when paginating results. If additional results exist beyond the + /// number you specify, the nextToken element is returned in the + /// response. Use nextToken in a subsequent request to retrieve + /// additional results. If not specified, returns 100 results. + /// + /// Parameter [nextToken] : + /// A token to use for paginating results that are returned in the response. + /// Set the value of this parameter to null for the first request. For + /// subsequent calls, use the nextToken value returned from the + /// previous request to continue listing results after the first page. + Future listScans({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/scans', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListScansResponse.fromJson(response); + } + + /// Returns a list of all tags associated with a scan. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the ScanName object. You can retrieve this ARN by + /// calling CreateScan, ListScans, or + /// GetScan. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Use to add one or more tags to an existing scan. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the ScanName object. You can retrieve this ARN by + /// calling CreateScan, ListScans, or + /// GetScan. + /// + /// Parameter [tags] : + /// An array of key-value pairs used to tag an existing scan. A tag is a + /// custom attribute label with two parts: + /// + ///
            + ///
          • + /// A tag key. For example, CostCenter, Environment, + /// or Secret. Tag keys are case sensitive. + ///
          • + ///
          • + /// An optional tag value field. For example, 111122223333, + /// Production, or a team name. Omitting the tag value is the + /// same as using an empty string. Tag values are case sensitive. + ///
          • + ///
          + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Use to remove one or more tags from an existing scan. + /// + /// May throw [InternalServerException]. + /// May throw [ConflictException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the ScanName object. You can retrieve this ARN by + /// calling CreateScan, ListScans, or + /// GetScan. + /// + /// Parameter [tagKeys] : + /// A list of keys for each tag you want to remove from a scan. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Use to update the encryption configuration for an account. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [encryptionConfig] : + /// The customer-managed KMS key ARN you want to use for encryption. If not + /// specified, CodeGuru Security will use an AWS-managed key for encryption. + /// If you previously specified a customer-managed KMS key and want CodeGuru + /// Security to use an AWS-managed key for encryption instead, pass nothing. + Future updateAccountConfiguration({ + required EncryptionConfig encryptionConfig, + }) async { + final $payload = { + 'encryptionConfig': encryptionConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/updateAccountConfiguration', + exceptionFnMap: _exceptionFns, + ); + return UpdateAccountConfigurationResponse.fromJson(response); + } +} + +/// A summary of findings metrics for an account on a specified date. +class AccountFindingsMetric { + /// The number of closed findings of each severity on the specified date. + final FindingMetricsValuePerSeverity? closedFindings; + + /// The date from which the findings metrics were retrieved. + final DateTime? date; + + /// The average time in days it takes to close findings of each severity as of a + /// specified date. + final FindingMetricsValuePerSeverity? meanTimeToClose; + + /// The number of new findings of each severity on the specified date. + final FindingMetricsValuePerSeverity? newFindings; + + /// The number of open findings of each severity as of the specified date. + final FindingMetricsValuePerSeverity? openFindings; + + AccountFindingsMetric({ + this.closedFindings, + this.date, + this.meanTimeToClose, + this.newFindings, + this.openFindings, + }); + + factory AccountFindingsMetric.fromJson(Map json) { + return AccountFindingsMetric( + closedFindings: json['closedFindings'] != null + ? FindingMetricsValuePerSeverity.fromJson( + json['closedFindings'] as Map) + : null, + date: timeStampFromJson(json['date']), + meanTimeToClose: json['meanTimeToClose'] != null + ? FindingMetricsValuePerSeverity.fromJson( + json['meanTimeToClose'] as Map) + : null, + newFindings: json['newFindings'] != null + ? FindingMetricsValuePerSeverity.fromJson( + json['newFindings'] as Map) + : null, + openFindings: json['openFindings'] != null + ? FindingMetricsValuePerSeverity.fromJson( + json['openFindings'] as Map) + : null, + ); + } + + Map toJson() { + final closedFindings = this.closedFindings; + final date = this.date; + final meanTimeToClose = this.meanTimeToClose; + final newFindings = this.newFindings; + final openFindings = this.openFindings; + return { + if (closedFindings != null) 'closedFindings': closedFindings, + if (date != null) 'date': unixTimestampToJson(date), + if (meanTimeToClose != null) 'meanTimeToClose': meanTimeToClose, + if (newFindings != null) 'newFindings': newFindings, + if (openFindings != null) 'openFindings': openFindings, + }; + } +} + +enum AnalysisType { + security, + all, +} + +extension AnalysisTypeValueExtension on AnalysisType { + String toValue() { + switch (this) { + case AnalysisType.security: + return 'Security'; + case AnalysisType.all: + return 'All'; + } + } +} + +extension AnalysisTypeFromString on String { + AnalysisType toAnalysisType() { + switch (this) { + case 'Security': + return AnalysisType.security; + case 'All': + return AnalysisType.all; + } + throw Exception('$this is not known in enum AnalysisType'); + } +} + +/// Contains information about the error that caused a finding to fail to be +/// retrieved. +class BatchGetFindingsError { + /// A code associated with the type of error. + final ErrorCode errorCode; + + /// The finding ID of the finding that was not fetched. + final String findingId; + + /// Describes the error. + final String message; + + /// The name of the scan that generated the finding. + final String scanName; + + BatchGetFindingsError({ + required this.errorCode, + required this.findingId, + required this.message, + required this.scanName, + }); + + factory BatchGetFindingsError.fromJson(Map json) { + return BatchGetFindingsError( + errorCode: (json['errorCode'] as String).toErrorCode(), + findingId: json['findingId'] as String, + message: json['message'] as String, + scanName: json['scanName'] as String, + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final findingId = this.findingId; + final message = this.message; + final scanName = this.scanName; + return { + 'errorCode': errorCode.toValue(), + 'findingId': findingId, + 'message': message, + 'scanName': scanName, + }; + } +} + +class BatchGetFindingsResponse { + /// A list of errors for individual findings which were not fetched. Each + /// BatchGetFindingsError contains the scanName, + /// findingId, errorCode and error + /// message. + final List failedFindings; + + /// A list of all findings which were successfully fetched. + final List findings; + + BatchGetFindingsResponse({ + required this.failedFindings, + required this.findings, + }); + + factory BatchGetFindingsResponse.fromJson(Map json) { + return BatchGetFindingsResponse( + failedFindings: (json['failedFindings'] as List) + .whereNotNull() + .map((e) => BatchGetFindingsError.fromJson(e as Map)) + .toList(), + findings: (json['findings'] as List) + .whereNotNull() + .map((e) => Finding.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final failedFindings = this.failedFindings; + final findings = this.findings; + return { + 'failedFindings': failedFindings, + 'findings': findings, + }; + } +} + +/// Information about a finding category with open findings. +class CategoryWithFindingNum { + /// The name of the finding category. A finding category is determined by the + /// detector that detected the finding. + final String? categoryName; + + /// The number of open findings in the category. + final int? findingNumber; + + CategoryWithFindingNum({ + this.categoryName, + this.findingNumber, + }); + + factory CategoryWithFindingNum.fromJson(Map json) { + return CategoryWithFindingNum( + categoryName: json['categoryName'] as String?, + findingNumber: json['findingNumber'] as int?, + ); + } + + Map toJson() { + final categoryName = this.categoryName; + final findingNumber = this.findingNumber; + return { + if (categoryName != null) 'categoryName': categoryName, + if (findingNumber != null) 'findingNumber': findingNumber, + }; + } +} + +/// The line of code where a finding was detected. +class CodeLine { + /// The code that contains a vulnerability. + final String? content; + + /// The code line number. + final int? number; + + CodeLine({ + this.content, + this.number, + }); + + factory CodeLine.fromJson(Map json) { + return CodeLine( + content: json['content'] as String?, + number: json['number'] as int?, + ); + } + + Map toJson() { + final content = this.content; + final number = this.number; + return { + if (content != null) 'content': content, + if (number != null) 'number': number, + }; + } +} + +class CreateScanResponse { + /// The identifier for the resource object that contains resources that were + /// scanned. + final ResourceId resourceId; + + /// UUID that identifies the individual scan run. + final String runId; + + /// The name of the scan. + final String scanName; + + /// The current state of the scan. Returns either InProgress, + /// Successful, or Failed. + final ScanState scanState; + + /// The ARN for the scan name. + final String? scanNameArn; + + CreateScanResponse({ + required this.resourceId, + required this.runId, + required this.scanName, + required this.scanState, + this.scanNameArn, + }); + + factory CreateScanResponse.fromJson(Map json) { + return CreateScanResponse( + resourceId: + ResourceId.fromJson(json['resourceId'] as Map), + runId: json['runId'] as String, + scanName: json['scanName'] as String, + scanState: (json['scanState'] as String).toScanState(), + scanNameArn: json['scanNameArn'] as String?, + ); + } + + Map toJson() { + final resourceId = this.resourceId; + final runId = this.runId; + final scanName = this.scanName; + final scanState = this.scanState; + final scanNameArn = this.scanNameArn; + return { + 'resourceId': resourceId, + 'runId': runId, + 'scanName': scanName, + 'scanState': scanState.toValue(), + if (scanNameArn != null) 'scanNameArn': scanNameArn, + }; + } +} + +class CreateUploadUrlResponse { + /// The identifier for the uploaded code resource. Pass this to + /// CreateScan to use the uploaded resources. + final String codeArtifactId; + + /// A set of key-value pairs that contain the required headers when uploading + /// your resource. + final Map requestHeaders; + + /// A pre-signed S3 URL. You can upload the code file you want to scan with the + /// required requestHeaders using any HTTP client. + final String s3Url; + + CreateUploadUrlResponse({ + required this.codeArtifactId, + required this.requestHeaders, + required this.s3Url, + }); + + factory CreateUploadUrlResponse.fromJson(Map json) { + return CreateUploadUrlResponse( + codeArtifactId: json['codeArtifactId'] as String, + requestHeaders: (json['requestHeaders'] as Map) + .map((k, e) => MapEntry(k, e as String)), + s3Url: json['s3Url'] as String, + ); + } + + Map toJson() { + final codeArtifactId = this.codeArtifactId; + final requestHeaders = this.requestHeaders; + final s3Url = this.s3Url; + return { + 'codeArtifactId': codeArtifactId, + 'requestHeaders': requestHeaders, + 's3Url': s3Url, + }; + } +} + +/// Information about the encryption configuration for an account. Required to +/// call UpdateAccountConfiguration. +class EncryptionConfig { + /// The KMS key ARN that is used for encryption. If an AWS-managed key is used + /// for encryption, returns empty. + final String? kmsKeyArn; + + EncryptionConfig({ + this.kmsKeyArn, + }); + + factory EncryptionConfig.fromJson(Map json) { + return EncryptionConfig( + kmsKeyArn: json['kmsKeyArn'] as String?, + ); + } + + Map toJson() { + final kmsKeyArn = this.kmsKeyArn; + return { + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + }; + } +} + +enum ErrorCode { + duplicateIdentifier, + itemDoesNotExist, + internalError, + invalidFindingId, + invalidScanName, +} + +extension ErrorCodeValueExtension on ErrorCode { + String toValue() { + switch (this) { + case ErrorCode.duplicateIdentifier: + return 'DUPLICATE_IDENTIFIER'; + case ErrorCode.itemDoesNotExist: + return 'ITEM_DOES_NOT_EXIST'; + case ErrorCode.internalError: + return 'INTERNAL_ERROR'; + case ErrorCode.invalidFindingId: + return 'INVALID_FINDING_ID'; + case ErrorCode.invalidScanName: + return 'INVALID_SCAN_NAME'; + } + } +} + +extension ErrorCodeFromString on String { + ErrorCode toErrorCode() { + switch (this) { + case 'DUPLICATE_IDENTIFIER': + return ErrorCode.duplicateIdentifier; + case 'ITEM_DOES_NOT_EXIST': + return ErrorCode.itemDoesNotExist; + case 'INTERNAL_ERROR': + return ErrorCode.internalError; + case 'INVALID_FINDING_ID': + return ErrorCode.invalidFindingId; + case 'INVALID_SCAN_NAME': + return ErrorCode.invalidScanName; + } + throw Exception('$this is not known in enum ErrorCode'); + } +} + +/// Information about the location of security vulnerabilities that Amazon +/// CodeGuru Security detected in your code. +class FilePath { + /// A list of CodeLine objects that describe where the security + /// vulnerability appears in your code. + final List? codeSnippet; + + /// The last line number of the code snippet where the security vulnerability + /// appears in your code. + final int? endLine; + + /// The name of the file. + final String? name; + + /// The path to the resource with the security vulnerability. + final String? path; + + /// The first line number of the code snippet where the security vulnerability + /// appears in your code. + final int? startLine; + + FilePath({ + this.codeSnippet, + this.endLine, + this.name, + this.path, + this.startLine, + }); + + factory FilePath.fromJson(Map json) { + return FilePath( + codeSnippet: (json['codeSnippet'] as List?) + ?.whereNotNull() + .map((e) => CodeLine.fromJson(e as Map)) + .toList(), + endLine: json['endLine'] as int?, + name: json['name'] as String?, + path: json['path'] as String?, + startLine: json['startLine'] as int?, + ); + } + + Map toJson() { + final codeSnippet = this.codeSnippet; + final endLine = this.endLine; + final name = this.name; + final path = this.path; + final startLine = this.startLine; + return { + if (codeSnippet != null) 'codeSnippet': codeSnippet, + if (endLine != null) 'endLine': endLine, + if (name != null) 'name': name, + if (path != null) 'path': path, + if (startLine != null) 'startLine': startLine, + }; + } +} + +/// Information about a finding that was detected in your code. +class Finding { + /// The time when the finding was created. + final DateTime? createdAt; + + /// A description of the finding. + final String? description; + + /// The identifier for the detector that detected the finding in your code. A + /// detector is a defined rule based on industry standards and AWS best + /// practices. + final String? detectorId; + + /// The name of the detector that identified the security vulnerability in your + /// code. + final String? detectorName; + + /// One or more tags or categorizations that are associated with a detector. + /// These tags are defined by type, programming language, or other + /// classification such as maintainability or consistency. + final List? detectorTags; + + /// The identifier for the component that generated a finding such as + /// AmazonCodeGuruSecurity. + final String? generatorId; + + /// The identifier for a finding. + final String? id; + + /// An object that contains the details about how to remediate a finding. + final Remediation? remediation; + + /// The resource where Amazon CodeGuru Security detected a finding. + final Resource? resource; + + /// The identifier for the rule that generated the finding. + final String? ruleId; + + /// The severity of the finding. Severity can be critical, high, medium, low, or + /// informational. For information on severity levels, see Finding + /// severity in the Amazon CodeGuru Security User Guide. + final Severity? severity; + + /// The status of the finding. A finding status can be open or closed. + final Status? status; + + /// The title of the finding. + final String? title; + + /// The type of finding. + final String? type; + + /// The time when the finding was last updated. Findings are updated when you + /// remediate them or when the finding code location changes. + final DateTime? updatedAt; + + /// An object that describes the detected security vulnerability. + final Vulnerability? vulnerability; + + Finding({ + this.createdAt, + this.description, + this.detectorId, + this.detectorName, + this.detectorTags, + this.generatorId, + this.id, + this.remediation, + this.resource, + this.ruleId, + this.severity, + this.status, + this.title, + this.type, + this.updatedAt, + this.vulnerability, + }); + + factory Finding.fromJson(Map json) { + return Finding( + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + detectorId: json['detectorId'] as String?, + detectorName: json['detectorName'] as String?, + detectorTags: (json['detectorTags'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + generatorId: json['generatorId'] as String?, + id: json['id'] as String?, + remediation: json['remediation'] != null + ? Remediation.fromJson(json['remediation'] as Map) + : null, + resource: json['resource'] != null + ? Resource.fromJson(json['resource'] as Map) + : null, + ruleId: json['ruleId'] as String?, + severity: (json['severity'] as String?)?.toSeverity(), + status: (json['status'] as String?)?.toStatus(), + title: json['title'] as String?, + type: json['type'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + vulnerability: json['vulnerability'] != null + ? Vulnerability.fromJson( + json['vulnerability'] as Map) + : null, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final description = this.description; + final detectorId = this.detectorId; + final detectorName = this.detectorName; + final detectorTags = this.detectorTags; + final generatorId = this.generatorId; + final id = this.id; + final remediation = this.remediation; + final resource = this.resource; + final ruleId = this.ruleId; + final severity = this.severity; + final status = this.status; + final title = this.title; + final type = this.type; + final updatedAt = this.updatedAt; + final vulnerability = this.vulnerability; + return { + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (description != null) 'description': description, + if (detectorId != null) 'detectorId': detectorId, + if (detectorName != null) 'detectorName': detectorName, + if (detectorTags != null) 'detectorTags': detectorTags, + if (generatorId != null) 'generatorId': generatorId, + if (id != null) 'id': id, + if (remediation != null) 'remediation': remediation, + if (resource != null) 'resource': resource, + if (ruleId != null) 'ruleId': ruleId, + if (severity != null) 'severity': severity.toValue(), + if (status != null) 'status': status.toValue(), + if (title != null) 'title': title, + if (type != null) 'type': type, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (vulnerability != null) 'vulnerability': vulnerability, + }; + } +} + +/// An object that contains information about a finding and the scan that +/// generated it. +class FindingIdentifier { + /// The identifier for a finding. + final String findingId; + + /// The name of the scan that generated the finding. + final String scanName; + + FindingIdentifier({ + required this.findingId, + required this.scanName, + }); + + Map toJson() { + final findingId = this.findingId; + final scanName = this.scanName; + return { + 'findingId': findingId, + 'scanName': scanName, + }; + } +} + +/// A numeric value corresponding to the severity of a finding, such as the +/// number of open findings or the average time it takes to close findings of a +/// given severity. +class FindingMetricsValuePerSeverity { + /// A numeric value corresponding to a critical finding. + final double? critical; + + /// A numeric value corresponding to a high severity finding. + final double? high; + + /// A numeric value corresponding to an informational finding. + final double? info; + + /// A numeric value corresponding to a low severity finding. + final double? low; + + /// A numeric value corresponding to a medium severity finding. + final double? medium; + + FindingMetricsValuePerSeverity({ + this.critical, + this.high, + this.info, + this.low, + this.medium, + }); + + factory FindingMetricsValuePerSeverity.fromJson(Map json) { + return FindingMetricsValuePerSeverity( + critical: json['critical'] as double?, + high: json['high'] as double?, + info: json['info'] as double?, + low: json['low'] as double?, + medium: json['medium'] as double?, + ); + } + + Map toJson() { + final critical = this.critical; + final high = this.high; + final info = this.info; + final low = this.low; + final medium = this.medium; + return { + if (critical != null) 'critical': critical, + if (high != null) 'high': high, + if (info != null) 'info': info, + if (low != null) 'low': low, + if (medium != null) 'medium': medium, + }; + } +} + +class GetAccountConfigurationResponse { + /// An EncryptionConfig object that contains the KMS key ARN that + /// is used for encryption. By default, CodeGuru Security uses an AWS-managed + /// key for encryption. To specify your own key, call + /// UpdateAccountConfiguration. If you do not specify a + /// customer-managed key, returns empty. + final EncryptionConfig encryptionConfig; + + GetAccountConfigurationResponse({ + required this.encryptionConfig, + }); + + factory GetAccountConfigurationResponse.fromJson(Map json) { + return GetAccountConfigurationResponse( + encryptionConfig: EncryptionConfig.fromJson( + json['encryptionConfig'] as Map), + ); + } + + Map toJson() { + final encryptionConfig = this.encryptionConfig; + return { + 'encryptionConfig': encryptionConfig, + }; + } +} + +class GetFindingsResponse { + /// A list of findings generated by the specified scan. + final List? findings; + + /// A pagination token. You can use this in future calls to + /// GetFindings to continue listing results after the current page. + final String? nextToken; + + GetFindingsResponse({ + this.findings, + this.nextToken, + }); + + factory GetFindingsResponse.fromJson(Map json) { + return GetFindingsResponse( + findings: (json['findings'] as List?) + ?.whereNotNull() + .map((e) => Finding.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final findings = this.findings; + final nextToken = this.nextToken; + return { + if (findings != null) 'findings': findings, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class GetMetricsSummaryResponse { + /// The summary metrics from the specified date. + final MetricsSummary? metricsSummary; + + GetMetricsSummaryResponse({ + this.metricsSummary, + }); + + factory GetMetricsSummaryResponse.fromJson(Map json) { + return GetMetricsSummaryResponse( + metricsSummary: json['metricsSummary'] != null + ? MetricsSummary.fromJson( + json['metricsSummary'] as Map) + : null, + ); + } + + Map toJson() { + final metricsSummary = this.metricsSummary; + return { + if (metricsSummary != null) 'metricsSummary': metricsSummary, + }; + } +} + +class GetScanResponse { + /// The type of analysis CodeGuru Security performed in the scan, either + /// Security or All. The Security type + /// only generates findings related to security. The All type + /// generates both security findings and quality findings. + final AnalysisType analysisType; + + /// The time the scan was created. + final DateTime createdAt; + + /// UUID that identifies the individual scan run. + final String runId; + + /// The name of the scan. + final String scanName; + + /// The current state of the scan. Returns either InProgress, + /// Successful, or Failed. + final ScanState scanState; + + /// Details about the error that causes a scan to fail to be retrieved. + final String? errorMessage; + + /// The number of times a scan has been re-run on a revised resource. + final int? numberOfRevisions; + + /// The ARN for the scan name. + final String? scanNameArn; + + /// The time when the scan was last updated. Only available for + /// STANDARD scan types. + final DateTime? updatedAt; + + GetScanResponse({ + required this.analysisType, + required this.createdAt, + required this.runId, + required this.scanName, + required this.scanState, + this.errorMessage, + this.numberOfRevisions, + this.scanNameArn, + this.updatedAt, + }); + + factory GetScanResponse.fromJson(Map json) { + return GetScanResponse( + analysisType: (json['analysisType'] as String).toAnalysisType(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + runId: json['runId'] as String, + scanName: json['scanName'] as String, + scanState: (json['scanState'] as String).toScanState(), + errorMessage: json['errorMessage'] as String?, + numberOfRevisions: json['numberOfRevisions'] as int?, + scanNameArn: json['scanNameArn'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final analysisType = this.analysisType; + final createdAt = this.createdAt; + final runId = this.runId; + final scanName = this.scanName; + final scanState = this.scanState; + final errorMessage = this.errorMessage; + final numberOfRevisions = this.numberOfRevisions; + final scanNameArn = this.scanNameArn; + final updatedAt = this.updatedAt; + return { + 'analysisType': analysisType.toValue(), + 'createdAt': unixTimestampToJson(createdAt), + 'runId': runId, + 'scanName': scanName, + 'scanState': scanState.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (numberOfRevisions != null) 'numberOfRevisions': numberOfRevisions, + if (scanNameArn != null) 'scanNameArn': scanNameArn, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + }; + } +} + +class ListFindingsMetricsResponse { + /// A list of AccountFindingsMetric objects retrieved from the + /// specified time interval. + final List? findingsMetrics; + + /// A pagination token. You can use this in future calls to + /// ListFindingMetrics to continue listing results after the + /// current page. + final String? nextToken; + + ListFindingsMetricsResponse({ + this.findingsMetrics, + this.nextToken, + }); + + factory ListFindingsMetricsResponse.fromJson(Map json) { + return ListFindingsMetricsResponse( + findingsMetrics: (json['findingsMetrics'] as List?) + ?.whereNotNull() + .map((e) => AccountFindingsMetric.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final findingsMetrics = this.findingsMetrics; + final nextToken = this.nextToken; + return { + if (findingsMetrics != null) 'findingsMetrics': findingsMetrics, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListScansResponse { + /// A pagination token. You can use this in future calls to + /// ListScans to continue listing results after the current page. + final String? nextToken; + + /// A list of ScanSummary objects with information about all scans + /// in an account. + final List? summaries; + + ListScansResponse({ + this.nextToken, + this.summaries, + }); + + factory ListScansResponse.fromJson(Map json) { + return ListScansResponse( + nextToken: json['nextToken'] as String?, + summaries: (json['summaries'] as List?) + ?.whereNotNull() + .map((e) => ScanSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final summaries = this.summaries; + return { + if (nextToken != null) 'nextToken': nextToken, + if (summaries != null) 'summaries': summaries, + }; + } +} + +class ListTagsForResourceResponse { + /// An array of key-value pairs used to tag an existing scan. A tag is a custom + /// attribute label with two parts: + /// + ///
            + ///
          • + /// A tag key. For example, CostCenter, Environment, + /// or Secret. Tag keys are case sensitive. + ///
          • + ///
          • + /// An optional tag value field. For example, 111122223333, + /// Production, or a team name. Omitting the tag value is the same + /// as using an empty string. Tag values are case sensitive. + ///
          • + ///
          + final Map? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +/// A summary of metrics for an account as of a specified date. +class MetricsSummary { + /// A list of CategoryWithFindingNum objects for the top 5 finding + /// categories with the most findings. + final List? categoriesWithMostFindings; + + /// The date from which the metrics summary information was retrieved. + final DateTime? date; + + /// The number of open findings of each severity. + final FindingMetricsValuePerSeverity? openFindings; + + /// A list of ScanNameWithFindingNum objects for the top 3 scans + /// with the most number of open critical findings. + final List? scansWithMostOpenCriticalFindings; + + /// A list of ScanNameWithFindingNum objects for the top 3 scans + /// with the most number of open findings. + final List? scansWithMostOpenFindings; + + MetricsSummary({ + this.categoriesWithMostFindings, + this.date, + this.openFindings, + this.scansWithMostOpenCriticalFindings, + this.scansWithMostOpenFindings, + }); + + factory MetricsSummary.fromJson(Map json) { + return MetricsSummary( + categoriesWithMostFindings: (json['categoriesWithMostFindings'] as List?) + ?.whereNotNull() + .map( + (e) => CategoryWithFindingNum.fromJson(e as Map)) + .toList(), + date: timeStampFromJson(json['date']), + openFindings: json['openFindings'] != null + ? FindingMetricsValuePerSeverity.fromJson( + json['openFindings'] as Map) + : null, + scansWithMostOpenCriticalFindings: + (json['scansWithMostOpenCriticalFindings'] as List?) + ?.whereNotNull() + .map((e) => + ScanNameWithFindingNum.fromJson(e as Map)) + .toList(), + scansWithMostOpenFindings: (json['scansWithMostOpenFindings'] as List?) + ?.whereNotNull() + .map( + (e) => ScanNameWithFindingNum.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final categoriesWithMostFindings = this.categoriesWithMostFindings; + final date = this.date; + final openFindings = this.openFindings; + final scansWithMostOpenCriticalFindings = + this.scansWithMostOpenCriticalFindings; + final scansWithMostOpenFindings = this.scansWithMostOpenFindings; + return { + if (categoriesWithMostFindings != null) + 'categoriesWithMostFindings': categoriesWithMostFindings, + if (date != null) 'date': unixTimestampToJson(date), + if (openFindings != null) 'openFindings': openFindings, + if (scansWithMostOpenCriticalFindings != null) + 'scansWithMostOpenCriticalFindings': scansWithMostOpenCriticalFindings, + if (scansWithMostOpenFindings != null) + 'scansWithMostOpenFindings': scansWithMostOpenFindings, + }; + } +} + +/// Information about the recommended course of action to remediate a finding. +class Recommendation { + /// The recommended course of action to remediate the finding. + final String? text; + + /// The URL address to the recommendation for remediating the finding. + final String? url; + + Recommendation({ + this.text, + this.url, + }); + + factory Recommendation.fromJson(Map json) { + return Recommendation( + text: json['text'] as String?, + url: json['url'] as String?, + ); + } + + Map toJson() { + final text = this.text; + final url = this.url; + return { + if (text != null) 'text': text, + if (url != null) 'url': url, + }; + } +} + +/// Information about how to remediate a finding. +class Remediation { + /// An object that contains information about the recommended course of action + /// to remediate a finding. + final Recommendation? recommendation; + + /// A list of SuggestedFix objects. Each object contains + /// information about a suggested code fix to remediate the finding. + final List? suggestedFixes; + + Remediation({ + this.recommendation, + this.suggestedFixes, + }); + + factory Remediation.fromJson(Map json) { + return Remediation( + recommendation: json['recommendation'] != null + ? Recommendation.fromJson( + json['recommendation'] as Map) + : null, + suggestedFixes: (json['suggestedFixes'] as List?) + ?.whereNotNull() + .map((e) => SuggestedFix.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final recommendation = this.recommendation; + final suggestedFixes = this.suggestedFixes; + return { + if (recommendation != null) 'recommendation': recommendation, + if (suggestedFixes != null) 'suggestedFixes': suggestedFixes, + }; + } +} + +/// Information about a resource that contains a finding. +class Resource { + /// The scanName of the scan that was run on the resource. + final String? id; + + /// The identifier for a section of the resource. + final String? subResourceId; + + Resource({ + this.id, + this.subResourceId, + }); + + factory Resource.fromJson(Map json) { + return Resource( + id: json['id'] as String?, + subResourceId: json['subResourceId'] as String?, + ); + } + + Map toJson() { + final id = this.id; + final subResourceId = this.subResourceId; + return { + if (id != null) 'id': id, + if (subResourceId != null) 'subResourceId': subResourceId, + }; + } +} + +/// The identifier for a resource object that contains resources to scan. +/// Specifying a codeArtifactId is required to create a scan. +class ResourceId { + /// The identifier for the code file uploaded to the resource object. Returned + /// by CreateUploadUrl when you upload resources to be scanned. + final String? codeArtifactId; + + ResourceId({ + this.codeArtifactId, + }); + + factory ResourceId.fromJson(Map json) { + return ResourceId( + codeArtifactId: json['codeArtifactId'] as String?, + ); + } + + Map toJson() { + final codeArtifactId = this.codeArtifactId; + return { + if (codeArtifactId != null) 'codeArtifactId': codeArtifactId, + }; + } +} + +/// Information about the number of findings generated by a scan. +class ScanNameWithFindingNum { + /// The number of findings generated by a scan. + final int? findingNumber; + + /// The name of the scan. + final String? scanName; + + ScanNameWithFindingNum({ + this.findingNumber, + this.scanName, + }); + + factory ScanNameWithFindingNum.fromJson(Map json) { + return ScanNameWithFindingNum( + findingNumber: json['findingNumber'] as int?, + scanName: json['scanName'] as String?, + ); + } + + Map toJson() { + final findingNumber = this.findingNumber; + final scanName = this.scanName; + return { + if (findingNumber != null) 'findingNumber': findingNumber, + if (scanName != null) 'scanName': scanName, + }; + } +} + +enum ScanState { + inProgress, + successful, + failed, +} + +extension ScanStateValueExtension on ScanState { + String toValue() { + switch (this) { + case ScanState.inProgress: + return 'InProgress'; + case ScanState.successful: + return 'Successful'; + case ScanState.failed: + return 'Failed'; + } + } +} + +extension ScanStateFromString on String { + ScanState toScanState() { + switch (this) { + case 'InProgress': + return ScanState.inProgress; + case 'Successful': + return ScanState.successful; + case 'Failed': + return ScanState.failed; + } + throw Exception('$this is not known in enum ScanState'); + } +} + +/// Information about a scan. +class ScanSummary { + /// The time when the scan was created. + final DateTime createdAt; + + /// The identifier for the scan run. + final String runId; + + /// The name of the scan. + final String scanName; + + /// The state of the scan. A scan can be In Progress, + /// Complete, or Failed. + final ScanState scanState; + + /// The ARN for the scan name. + final String? scanNameArn; + + /// The time the scan was last updated. A scan is updated when it is re-run. + final DateTime? updatedAt; + + ScanSummary({ + required this.createdAt, + required this.runId, + required this.scanName, + required this.scanState, + this.scanNameArn, + this.updatedAt, + }); + + factory ScanSummary.fromJson(Map json) { + return ScanSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + runId: json['runId'] as String, + scanName: json['scanName'] as String, + scanState: (json['scanState'] as String).toScanState(), + scanNameArn: json['scanNameArn'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final runId = this.runId; + final scanName = this.scanName; + final scanState = this.scanState; + final scanNameArn = this.scanNameArn; + final updatedAt = this.updatedAt; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'runId': runId, + 'scanName': scanName, + 'scanState': scanState.toValue(), + if (scanNameArn != null) 'scanNameArn': scanNameArn, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + }; + } +} + +enum ScanType { + standard, + express, +} + +extension ScanTypeValueExtension on ScanType { + String toValue() { + switch (this) { + case ScanType.standard: + return 'Standard'; + case ScanType.express: + return 'Express'; + } + } +} + +extension ScanTypeFromString on String { + ScanType toScanType() { + switch (this) { + case 'Standard': + return ScanType.standard; + case 'Express': + return ScanType.express; + } + throw Exception('$this is not known in enum ScanType'); + } +} + +enum Severity { + critical, + high, + medium, + low, + info, +} + +extension SeverityValueExtension on Severity { + String toValue() { + switch (this) { + case Severity.critical: + return 'Critical'; + case Severity.high: + return 'High'; + case Severity.medium: + return 'Medium'; + case Severity.low: + return 'Low'; + case Severity.info: + return 'Info'; + } + } +} + +extension SeverityFromString on String { + Severity toSeverity() { + switch (this) { + case 'Critical': + return Severity.critical; + case 'High': + return Severity.high; + case 'Medium': + return Severity.medium; + case 'Low': + return Severity.low; + case 'Info': + return Severity.info; + } + throw Exception('$this is not known in enum Severity'); + } +} + +enum Status { + closed, + open, + all, +} + +extension StatusValueExtension on Status { + String toValue() { + switch (this) { + case Status.closed: + return 'Closed'; + case Status.open: + return 'Open'; + case Status.all: + return 'All'; + } + } +} + +extension StatusFromString on String { + Status toStatus() { + switch (this) { + case 'Closed': + return Status.closed; + case 'Open': + return Status.open; + case 'All': + return Status.all; + } + throw Exception('$this is not known in enum Status'); + } +} + +/// Information about the suggested code fix to remediate a finding. +class SuggestedFix { + /// The suggested code fix. If applicable, includes code patch to replace your + /// source code. + final String? code; + + /// A description of the suggested code fix and why it is being suggested. + final String? description; + + SuggestedFix({ + this.code, + this.description, + }); + + factory SuggestedFix.fromJson(Map json) { + return SuggestedFix( + code: json['code'] as String?, + description: json['description'] as String?, + ); + } + + Map toJson() { + final code = this.code; + final description = this.description; + return { + if (code != null) 'code': code, + if (description != null) 'description': description, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateAccountConfigurationResponse { + /// An EncryptionConfig object that contains the KMS key ARN that + /// is used for encryption. If you did not specify a customer-managed KMS key in + /// the request, returns empty. + final EncryptionConfig encryptionConfig; + + UpdateAccountConfigurationResponse({ + required this.encryptionConfig, + }); + + factory UpdateAccountConfigurationResponse.fromJson( + Map json) { + return UpdateAccountConfigurationResponse( + encryptionConfig: EncryptionConfig.fromJson( + json['encryptionConfig'] as Map), + ); + } + + Map toJson() { + final encryptionConfig = this.encryptionConfig; + return { + 'encryptionConfig': encryptionConfig, + }; + } +} + +/// Information about a security vulnerability that Amazon CodeGuru Security +/// detected. +class Vulnerability { + /// An object that describes the location of the detected security vulnerability + /// in your code. + final FilePath? filePath; + + /// The identifier for the vulnerability. + final String? id; + + /// The number of times the vulnerability appears in your code. + final int? itemCount; + + /// One or more URL addresses that contain details about a vulnerability. + final List? referenceUrls; + + /// One or more vulnerabilities that are related to the vulnerability being + /// described. + final List? relatedVulnerabilities; + + Vulnerability({ + this.filePath, + this.id, + this.itemCount, + this.referenceUrls, + this.relatedVulnerabilities, + }); + + factory Vulnerability.fromJson(Map json) { + return Vulnerability( + filePath: json['filePath'] != null + ? FilePath.fromJson(json['filePath'] as Map) + : null, + id: json['id'] as String?, + itemCount: json['itemCount'] as int?, + referenceUrls: (json['referenceUrls'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + relatedVulnerabilities: (json['relatedVulnerabilities'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final filePath = this.filePath; + final id = this.id; + final itemCount = this.itemCount; + final referenceUrls = this.referenceUrls; + final relatedVulnerabilities = this.relatedVulnerabilities; + return { + if (filePath != null) 'filePath': filePath, + if (id != null) 'id': id, + if (itemCount != null) 'itemCount': itemCount, + if (referenceUrls != null) 'referenceUrls': referenceUrls, + if (relatedVulnerabilities != null) + 'relatedVulnerabilities': relatedVulnerabilities, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/code_pipeline/v2015_07_09.dart b/aws_client/lib/src/generated/code_pipeline/v2015_07_09.dart index 7cf398798..424ca53e7 100644 --- a/aws_client/lib/src/generated/code_pipeline/v2015_07_09.dart +++ b/aws_client/lib/src/generated/code_pipeline/v2015_07_09.dart @@ -19,12 +19,12 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// This is the AWS CodePipeline API Reference. This guide provides descriptions -/// of the actions and data types for AWS CodePipeline. Some functionality for -/// your pipeline can only be configured through the API. For more information, -/// see the AWS -/// CodePipeline User Guide. +/// This is the CodePipeline API Reference. This guide provides descriptions of +/// the actions and data types for CodePipeline. Some functionality for your +/// pipeline can only be configured through the API. For more information, see +/// the CodePipeline +/// User Guide. class CodePipeline { final _s.JsonProtocol _protocol; CodePipeline({ @@ -65,9 +65,9 @@ class CodePipeline { /// receipt. /// /// Parameter [nonce] : - /// A system-generated random number that AWS CodePipeline uses to ensure that - /// the job is being worked on by only one job worker. Get this number from - /// the response of the PollForJobs request that returned this job. + /// A system-generated random number that CodePipeline uses to ensure that the + /// job is being worked on by only one job worker. Get this number from the + /// response of the PollForJobs request that returned this job. Future acknowledgeJob({ required String jobId, required String nonce, @@ -108,9 +108,9 @@ class CodePipeline { /// The unique system-generated ID of the job. /// /// Parameter [nonce] : - /// A system-generated random number that AWS CodePipeline uses to ensure that - /// the job is being worked on by only one job worker. Get this number from - /// the response to a GetThirdPartyJobDetails request. + /// A system-generated random number that CodePipeline uses to ensure that the + /// job is being worked on by only one job worker. Get this number from the + /// response to a GetThirdPartyJobDetails request. Future acknowledgeThirdPartyJob({ required String clientToken, required String jobId, @@ -137,7 +137,7 @@ class CodePipeline { } /// Creates a new custom action that can be used in all pipelines associated - /// with the AWS account. Only used for custom actions. + /// with the Amazon Web Services account. Only used for custom actions. /// /// May throw [ValidationException]. /// May throw [LimitExceededException]. @@ -156,8 +156,7 @@ class CodePipeline { /// The details of the output artifact of the action, such as its commit ID. /// /// Parameter [provider] : - /// The provider of the service used in the custom action, such as AWS - /// CodeDeploy. + /// The provider of the service used in the custom action, such as CodeDeploy. /// /// Parameter [version] : /// The version identifier of the custom action. @@ -281,8 +280,7 @@ class CodePipeline { /// or deploy. /// /// Parameter [provider] : - /// The provider of the service used in the custom action, such as AWS - /// CodeDeploy. + /// The provider of the service used in the custom action, such as CodeDeploy. /// /// Parameter [version] : /// The version of the custom action to delete. @@ -336,10 +334,10 @@ class CodePipeline { } /// Deletes a previously created webhook by name. Deleting the webhook stops - /// AWS CodePipeline from starting a pipeline every time an external event - /// occurs. The API returns successfully when trying to delete a webhook that - /// is already deleted. If a deleted webhook is re-created by calling - /// PutWebhook with the same name, it will have a different URL. + /// CodePipeline from starting a pipeline every time an external event occurs. + /// The API returns successfully when trying to delete a webhook that is + /// already deleted. If a deleted webhook is re-created by calling PutWebhook + /// with the same name, it will have a different URL. /// /// May throw [ValidationException]. /// May throw [ConcurrentModificationException]. @@ -558,8 +556,8 @@ class CodePipeline { /// Returns information about a job. Used for custom actions only. /// - /// When this API is called, AWS CodePipeline returns temporary credentials - /// for the S3 bucket used to store artifacts for the pipeline, if the action + /// When this API is called, CodePipeline returns temporary credentials for + /// the S3 bucket used to store artifacts for the pipeline, if the action /// requires access to that S3 bucket for input or output artifacts. This API /// also returns any secret values defined for the action. /// @@ -601,7 +599,7 @@ class CodePipeline { /// /// Parameter [name] : /// The name of the pipeline for which you want to get information. Pipeline - /// names must be unique under an AWS user account. + /// names must be unique in an Amazon Web Services account. /// /// Parameter [version] : /// The version number of the pipeline. If you do not specify a version, @@ -709,8 +707,8 @@ class CodePipeline { /// Requests the details of a job for a third party action. Used for partner /// actions only. /// - /// When this API is called, AWS CodePipeline returns temporary credentials - /// for the S3 bucket used to store artifacts for the pipeline, if the action + /// When this API is called, CodePipeline returns temporary credentials for + /// the S3 bucket used to store artifacts for the pipeline, if the action /// requires access to that S3 bucket for input or output artifacts. This API /// also returns any secret values defined for the action. /// @@ -811,7 +809,7 @@ class CodePipeline { return ListActionExecutionsOutput.fromJson(jsonResponse.body); } - /// Gets a summary of all AWS CodePipeline action types associated with your + /// Gets a summary of all CodePipeline action types associated with your /// account. /// /// May throw [ValidationException]. @@ -862,6 +860,9 @@ class CodePipeline { /// The name of the pipeline for which you want to get execution summary /// information. /// + /// Parameter [filter] : + /// The pipeline execution to filter on. + /// /// Parameter [maxResults] : /// The maximum number of results to return in a single call. To retrieve the /// remaining results, make another call with the returned nextToken value. @@ -874,6 +875,7 @@ class CodePipeline { /// next set of pipeline executions in the list. Future listPipelineExecutions({ required String pipelineName, + PipelineExecutionFilter? filter, int? maxResults, String? nextToken, }) async { @@ -895,6 +897,7 @@ class CodePipeline { headers: headers, payload: { 'pipelineName': pipelineName, + if (filter != null) 'filter': filter, if (maxResults != null) 'maxResults': maxResults, if (nextToken != null) 'nextToken': nextToken, }, @@ -995,9 +998,9 @@ class CodePipeline { return ListTagsForResourceOutput.fromJson(jsonResponse.body); } - /// Gets a listing of all the webhooks in this AWS Region for this account. - /// The output lists all webhooks and includes the webhook URL and ARN and the - /// configuration for each webhook. + /// Gets a listing of all the webhooks in this Amazon Web Services Region for + /// this account. The output lists all webhooks and includes the webhook URL + /// and ARN and the configuration for each webhook. /// /// May throw [ValidationException]. /// May throw [InvalidNextTokenException]. @@ -1038,13 +1041,14 @@ class CodePipeline { return ListWebhooksOutput.fromJson(jsonResponse.body); } - /// Returns information about any jobs for AWS CodePipeline to act on. + /// Returns information about any jobs for CodePipeline to act on. /// PollForJobs is valid only for action types with "Custom" in - /// the owner field. If the action type contains "AWS" or "ThirdParty" in the - /// owner field, the PollForJobs action returns an error. + /// the owner field. If the action type contains AWS or + /// ThirdParty in the owner field, the PollForJobs + /// action returns an error. /// - /// When this API is called, AWS CodePipeline returns temporary credentials - /// for the S3 bucket used to store artifacts for the pipeline, if the action + /// When this API is called, CodePipeline returns temporary credentials for + /// the S3 bucket used to store artifacts for the pipeline, if the action /// requires access to that S3 bucket for input or output artifacts. This API /// also returns any secret values defined for the action. /// @@ -1098,8 +1102,8 @@ class CodePipeline { /// Determines whether there are any third party jobs for a job worker to act /// on. Used for partner actions only. /// - /// When this API is called, AWS CodePipeline returns temporary credentials - /// for the S3 bucket used to store artifacts for the pipeline, if the action + /// When this API is called, CodePipeline returns temporary credentials for + /// the S3 bucket used to store artifacts for the pipeline, if the action /// requires access to that S3 bucket for input or output artifacts. /// /// @@ -1140,7 +1144,7 @@ class CodePipeline { return PollForThirdPartyJobsOutput.fromJson(jsonResponse.body); } - /// Provides information to AWS CodePipeline about new revisions to a source. + /// Provides information to CodePipeline about new revisions to a source. /// /// May throw [PipelineNotFoundException]. /// May throw [StageNotFoundException]. @@ -1186,8 +1190,8 @@ class CodePipeline { return PutActionRevisionOutput.fromJson(jsonResponse.body); } - /// Provides the response to a manual approval request to AWS CodePipeline. - /// Valid responses include Approved and Rejected. + /// Provides the response to a manual approval request to CodePipeline. Valid + /// responses include Approved and Rejected. /// /// May throw [InvalidApprovalTokenException]. /// May throw [ApprovalAlreadyCompletedException]. @@ -1289,12 +1293,12 @@ class CodePipeline { /// ID returned from PollForJobs. /// /// Parameter [continuationToken] : - /// A token generated by a job worker, such as an AWS CodeDeploy deployment - /// ID, that a successful job provides to identify a custom action in - /// progress. Future jobs use this token to identify the running instance of - /// the action. It can be reused to return more information about the progress - /// of the custom action. When the action is complete, no continuation token - /// should be supplied. + /// A token generated by a job worker, such as a CodeDeploy deployment ID, + /// that a successful job provides to identify a custom action in progress. + /// Future jobs use this token to identify the running instance of the action. + /// It can be reused to return more information about the progress of the + /// custom action. When the action is complete, no continuation token should + /// be supplied. /// /// Parameter [currentRevision] : /// The ID of the current revision of the artifact successfully worked on by @@ -1396,12 +1400,12 @@ class CodePipeline { /// returned from PollForThirdPartyJobs. /// /// Parameter [continuationToken] : - /// A token generated by a job worker, such as an AWS CodeDeploy deployment - /// ID, that a successful job provides to identify a partner action in - /// progress. Future jobs use this token to identify the running instance of - /// the action. It can be reused to return more information about the progress - /// of the partner action. When the action is complete, no continuation token - /// should be supplied. + /// A token generated by a job worker, such as a CodeDeploy deployment ID, + /// that a successful job provides to identify a partner action in progress. + /// Future jobs use this token to identify the running instance of the action. + /// It can be reused to return more information about the progress of the + /// partner action. When the action is complete, no continuation token should + /// be supplied. /// /// Parameter [currentRevision] : /// Represents information about a current revision. @@ -1515,10 +1519,15 @@ class CodePipeline { ); } - /// Resumes the pipeline execution by retrying the last failed actions in a - /// stage. You can retry a stage immediately if any of the actions in the - /// stage fail. When you retry, all actions that are still in progress - /// continue working, and failed actions are triggered again. + /// You can retry a stage that has failed without having to run a pipeline + /// again from the beginning. You do this by either retrying the failed + /// actions in a stage or by retrying all actions in the stage starting from + /// the first action in the stage. When you retry the failed actions in a + /// stage, all actions that are still in progress continue working, and failed + /// actions are triggered again. When you retry a failed stage from the first + /// action in the stage, the stage cannot have any actions in progress. Before + /// a stage can be retried, it must either have all actions failed or some + /// actions failed and some succeeded. /// /// May throw [ValidationException]. /// May throw [ConflictException]. @@ -1536,8 +1545,7 @@ class CodePipeline { /// The name of the pipeline that contains the failed stage. /// /// Parameter [retryMode] : - /// The scope of the retry attempt. Currently, the only supported value is - /// FAILED_ACTIONS. + /// The scope of the retry attempt. /// /// Parameter [stageName] : /// The name of the failed stage to be retried. @@ -1568,12 +1576,56 @@ class CodePipeline { return RetryStageExecutionOutput.fromJson(jsonResponse.body); } + /// Rolls back a stage execution. + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [PipelineNotFoundException]. + /// May throw [PipelineExecutionNotFoundException]. + /// May throw [PipelineExecutionOutdatedException]. + /// May throw [StageNotFoundException]. + /// May throw [UnableToRollbackStageException]. + /// + /// Parameter [pipelineName] : + /// The name of the pipeline for which the stage will be rolled back. + /// + /// Parameter [stageName] : + /// The name of the stage in the pipeline to be rolled back. + /// + /// Parameter [targetPipelineExecutionId] : + /// The pipeline execution ID for the stage to be rolled back to. + Future rollbackStage({ + required String pipelineName, + required String stageName, + required String targetPipelineExecutionId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodePipeline_20150709.RollbackStage' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'pipelineName': pipelineName, + 'stageName': stageName, + 'targetPipelineExecutionId': targetPipelineExecutionId, + }, + ); + + return RollbackStageOutput.fromJson(jsonResponse.body); + } + /// Starts the specified pipeline. Specifically, it begins processing the /// latest commit to the source location specified as part of the pipeline. /// /// May throw [ValidationException]. /// May throw [ConflictException]. /// May throw [PipelineNotFoundException]. + /// May throw [ConcurrentPipelineExecutionsLimitExceededException]. /// /// Parameter [name] : /// The name of the pipeline to start. @@ -1581,9 +1633,22 @@ class CodePipeline { /// Parameter [clientRequestToken] : /// The system-generated unique ID used to identify a unique execution /// request. + /// + /// Parameter [sourceRevisions] : + /// A list that allows you to specify, or override, the source revision for a + /// pipeline execution that's being started. A source revision is the version + /// with all the changes to your application code, or source artifact, for the + /// pipeline execution. + /// + /// Parameter [variables] : + /// A list that overrides pipeline variables for a pipeline execution that's + /// being started. Variable names must match [A-Za-z0-9@\-_]+, + /// and the values can be anything except an empty string. Future startPipelineExecution({ required String name, String? clientRequestToken, + List? sourceRevisions, + List? variables, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1599,6 +1664,8 @@ class CodePipeline { 'name': name, 'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(), + if (sourceRevisions != null) 'sourceRevisions': sourceRevisions, + if (variables != null) 'variables': variables, }, ); @@ -1699,7 +1766,7 @@ class CodePipeline { ); } - /// Removes tags from an AWS resource. + /// Removes tags from an Amazon Web Services resource. /// /// May throw [ValidationException]. /// May throw [ResourceNotFoundException]. @@ -1799,10 +1866,11 @@ class CodePipeline { } } -/// Represents an AWS session credentials object. These credentials are -/// temporary credentials that are issued by AWS Secure Token Service (STS). -/// They can be used to access input and output artifacts in the S3 bucket used -/// to store artifact for the pipeline in AWS CodePipeline. +/// Represents an Amazon Web Services session credentials object. These +/// credentials are temporary credentials that are issued by Amazon Web Services +/// Secure Token Service (STS). They can be used to access input and output +/// artifacts in the S3 bucket used to store artifact for the pipeline in +/// CodePipeline. class AWSSessionCredentials { /// The access key for the session. final String accessKeyId; @@ -2115,13 +2183,13 @@ class ActionDeclaration { /// values for an action. For more information, see Action /// Structure Requirements in CodePipeline. For the list of configuration - /// properties for the AWS CloudFormation action type in CodePipeline, see Configuration - /// Properties Reference in the AWS CloudFormation User Guide. For + /// Properties Reference in the CloudFormation User Guide. For /// template snippets with examples, see Using - /// Parameter Override Functions with CodePipeline Pipelines in the AWS - /// CloudFormation User Guide. + /// Parameter Override Functions with CodePipeline Pipelines in the + /// CloudFormation User Guide. /// /// The values can be represented in either JSON or YAML format. For example, /// the JSON configuration item format is as follows: @@ -2143,7 +2211,7 @@ class ActionDeclaration { /// build artifact. final List? outputArtifacts; - /// The action declaration's AWS Region, such as us-east-1. + /// The action declaration's Amazon Web Services Region, such as us-east-1. final String? region; /// The ARN of the IAM service role that performs the declared action. This is @@ -2153,6 +2221,13 @@ class ActionDeclaration { /// The order in which actions are run. final int? runOrder; + /// A timeout duration in minutes that can be applied against the ActionType’s + /// default timeout value specified in Quotas + /// for CodePipeline . This attribute is available only to the manual + /// approval ActionType. + final int? timeoutInMinutes; + ActionDeclaration({ required this.actionTypeId, required this.name, @@ -2163,6 +2238,7 @@ class ActionDeclaration { this.region, this.roleArn, this.runOrder, + this.timeoutInMinutes, }); factory ActionDeclaration.fromJson(Map json) { @@ -2184,6 +2260,7 @@ class ActionDeclaration { region: json['region'] as String?, roleArn: json['roleArn'] as String?, runOrder: json['runOrder'] as int?, + timeoutInMinutes: json['timeoutInMinutes'] as int?, ); } @@ -2197,6 +2274,7 @@ class ActionDeclaration { final region = this.region; final roleArn = this.roleArn; final runOrder = this.runOrder; + final timeoutInMinutes = this.timeoutInMinutes; return { 'actionTypeId': actionTypeId, 'name': name, @@ -2207,6 +2285,7 @@ class ActionDeclaration { if (region != null) 'region': region, if (roleArn != null) 'roleArn': roleArn, if (runOrder != null) 'runOrder': runOrder, + if (timeoutInMinutes != null) 'timeoutInMinutes': timeoutInMinutes, }; } } @@ -2222,14 +2301,14 @@ class ActionExecution { /// final String? actionExecutionId; - /// The details of an error returned by a URL external to AWS. + /// The details of an error returned by a URL external to Amazon Web Services. final ErrorDetails? errorDetails; /// The external ID of the run of the action. final String? externalExecutionId; - /// The URL of a resource external to AWS that is used when running the action - /// (for example, an external repository URL). + /// The URL of a resource external to Amazon Web Services that is used when + /// running the action (for example, an external repository URL). final String? externalExecutionUrl; /// The last status change of the action. @@ -2349,6 +2428,9 @@ class ActionExecutionDetail { /// InProgress, Succeeded, and Failed. final ActionExecutionStatus? status; + /// The ARN of the user who changed the pipeline execution details. + final String? updatedBy; + ActionExecutionDetail({ this.actionExecutionId, this.actionName, @@ -2360,6 +2442,7 @@ class ActionExecutionDetail { this.stageName, this.startTime, this.status, + this.updatedBy, }); factory ActionExecutionDetail.fromJson(Map json) { @@ -2379,6 +2462,7 @@ class ActionExecutionDetail { stageName: json['stageName'] as String?, startTime: timeStampFromJson(json['startTime']), status: (json['status'] as String?)?.toActionExecutionStatus(), + updatedBy: json['updatedBy'] as String?, ); } @@ -2393,6 +2477,7 @@ class ActionExecutionDetail { final stageName = this.stageName; final startTime = this.startTime; final status = this.status; + final updatedBy = this.updatedBy; return { if (actionExecutionId != null) 'actionExecutionId': actionExecutionId, if (actionName != null) 'actionName': actionName, @@ -2406,22 +2491,34 @@ class ActionExecutionDetail { if (stageName != null) 'stageName': stageName, if (startTime != null) 'startTime': unixTimestampToJson(startTime), if (status != null) 'status': status.toValue(), + if (updatedBy != null) 'updatedBy': updatedBy, }; } } /// Filter values for the action execution. class ActionExecutionFilter { + /// The latest execution in the pipeline. + /// + /// Filtering on the latest execution is available for executions run on or + /// after February 08, 2024. + /// + final LatestInPipelineExecutionFilter? latestInPipelineExecution; + /// The pipeline execution ID used to filter action execution history. final String? pipelineExecutionId; ActionExecutionFilter({ + this.latestInPipelineExecution, this.pipelineExecutionId, }); Map toJson() { + final latestInPipelineExecution = this.latestInPipelineExecution; final pipelineExecutionId = this.pipelineExecutionId; return { + if (latestInPipelineExecution != null) + 'latestInPipelineExecution': latestInPipelineExecution, if (pipelineExecutionId != null) 'pipelineExecutionId': pipelineExecutionId, }; @@ -2443,7 +2540,7 @@ class ActionExecutionInput { /// output by this action fall under this namespace. final String? namespace; - /// The AWS Region for the action, such as us-east-1. + /// The Amazon Web Services Region for the action, such as us-east-1. final String? region; /// Configuration data for an action execution with all variable references @@ -2555,6 +2652,8 @@ class ActionExecutionOutput { /// Execution result information, such as the external execution ID. class ActionExecutionResult { + final ErrorDetails? errorDetails; + /// The action provider's external ID for the action execution. final String? externalExecutionId; @@ -2566,6 +2665,7 @@ class ActionExecutionResult { final String? externalExecutionUrl; ActionExecutionResult({ + this.errorDetails, this.externalExecutionId, this.externalExecutionSummary, this.externalExecutionUrl, @@ -2573,6 +2673,9 @@ class ActionExecutionResult { factory ActionExecutionResult.fromJson(Map json) { return ActionExecutionResult( + errorDetails: json['errorDetails'] != null + ? ErrorDetails.fromJson(json['errorDetails'] as Map) + : null, externalExecutionId: json['externalExecutionId'] as String?, externalExecutionSummary: json['externalExecutionSummary'] as String?, externalExecutionUrl: json['externalExecutionUrl'] as String?, @@ -2580,10 +2683,12 @@ class ActionExecutionResult { } Map toJson() { + final errorDetails = this.errorDetails; final externalExecutionId = this.externalExecutionId; final externalExecutionSummary = this.externalExecutionSummary; final externalExecutionUrl = this.externalExecutionUrl; return { + if (errorDetails != null) 'errorDetails': errorDetails, if (externalExecutionId != null) 'externalExecutionId': externalExecutionId, if (externalExecutionSummary != null) @@ -2969,7 +3074,7 @@ class ActionTypeExecutor { final int? jobTimeout; /// The policy statement that specifies the permissions in the CodePipeline - /// customer’s account that are needed to successfully run an action. + /// customer account that are needed to successfully run an action. /// /// To grant permission to another account, specify the account ID as the /// Principal, a domain-style identifier defined by the service, for example @@ -3049,8 +3154,8 @@ class ActionTypeId { /// The provider of the service being called by the action. Valid providers are /// determined by the action category. For example, an action in the Deploy - /// category type might have a provider of AWS CodeDeploy, which would be - /// specified as CodeDeploy. For more information, see CodeDeploy. For more information, see Valid /// Action Types and Providers in CodePipeline. final String provider; @@ -3157,8 +3262,8 @@ class ActionTypeIdentifier { /// Details identifying the users with permissions to use the action type. class ActionTypePermissions { - /// A list of AWS account IDs with access to use the action type in their - /// pipelines. + /// A list of Amazon Web Services account IDs with access to use the action type + /// in their pipelines. final List allowedAccounts; ActionTypePermissions({ @@ -3248,20 +3353,19 @@ class ActionTypeProperty { /// Returns information about the settings for an action type. class ActionTypeSettings { - /// The URL returned to the AWS CodePipeline console that provides a deep link - /// to the resources of the external system, such as the configuration page for - /// an AWS CodeDeploy deployment group. This link is provided as part of the - /// action display in the pipeline. + /// The URL returned to the CodePipeline console that provides a deep link to + /// the resources of the external system, such as the configuration page for a + /// CodeDeploy deployment group. This link is provided as part of the action + /// display in the pipeline. final String? entityUrlTemplate; - /// The URL returned to the AWS CodePipeline console that contains a link to the + /// The URL returned to the CodePipeline console that contains a link to the /// top-level landing page for the external system, such as the console page for - /// AWS CodeDeploy. This link is shown on the pipeline view page in the AWS - /// CodePipeline console and provides a link to the execution entity of the - /// external action. + /// CodeDeploy. This link is shown on the pipeline view page in the CodePipeline + /// console and provides a link to the execution entity of the external action. final String? executionUrlTemplate; - /// The URL returned to the AWS CodePipeline console that contains a link to the + /// The URL returned to the CodePipeline console that contains a link to the /// page where customers can update or change the configuration of the external /// action. final String? revisionUrlTemplate; @@ -3409,8 +3513,11 @@ extension ApprovalStatusFromString on String { } } -/// Represents information about an artifact that is worked on by actions in the -/// pipeline. +/// Artifacts are the files that are worked on by actions in the pipeline. See +/// the action configuration for each action for details about artifact +/// parameters. For example, the S3 source action artifact is a file name (or +/// file path), and the files are generally provided as a ZIP file. Example +/// artifact name: SampleApp_Windows.zip class Artifact { /// The location of an artifact. final ArtifactLocation? location; @@ -3586,15 +3693,14 @@ class ArtifactRevision { final String? revisionId; /// Summary information about the most recent revision of the artifact. For - /// GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3 + /// GitHub and CodeCommit repositories, the commit message. For Amazon S3 /// buckets or actions, the user-provided content of a /// codepipeline-artifact-revision-summary key specified in the /// object metadata. final String? revisionSummary; /// The commit ID for the artifact revision. For artifacts stored in GitHub or - /// AWS CodeCommit repositories, the commit ID is linked to a commit details - /// page. + /// CodeCommit repositories, the commit ID is linked to a commit details page. final String? revisionUrl; ArtifactRevision({ @@ -3647,15 +3753,15 @@ class ArtifactStore { /// The S3 bucket used for storing the artifacts for a pipeline. You can specify /// the name of an S3 bucket but not a folder in the bucket. A folder to contain /// the pipeline artifacts is created for you based on the name of the pipeline. - /// You can use any S3 bucket in the same AWS Region as the pipeline to store - /// your pipeline artifacts. + /// You can use any S3 bucket in the same Amazon Web Services Region as the + /// pipeline to store your pipeline artifacts. final String location; /// The type of the artifact store, such as S3. final ArtifactStoreType type; /// The encryption key used to encrypt the data in the artifact store, such as - /// an AWS Key Management Service (AWS KMS) key. If this is undefined, the + /// an Amazon Web Services Key Management Service key. If this is undefined, the /// default key for Amazon S3 is used. final EncryptionKey? encryptionKey; @@ -3897,19 +4003,22 @@ class DeregisterWebhookWithThirdPartyOutput { } /// Represents information about the key used to encrypt data in the artifact -/// store, such as an AWS Key Management Service (AWS KMS) key. +/// store, such as an Amazon Web Services Key Management Service (Key Management +/// Service) key. class EncryptionKey { - /// The ID used to identify the key. For an AWS KMS key, you can use the key ID, - /// the key ARN, or the alias ARN. + /// The ID used to identify the key. For an Amazon Web Services KMS key, you can + /// use the key ID, the key ARN, or the alias ARN. /// - /// Aliases are recognized only in the account that created the customer master - /// key (CMK). For cross-account actions, you can only use the key ID or key ARN - /// to identify the key. + /// Aliases are recognized only in the account that created the KMS key. For + /// cross-account actions, you can only use the key ID or key ARN to identify + /// the key. Cross-account actions involve using the role from the other account + /// (AccountB), so specifying the key ID will use the key from the other account + /// (AccountB). /// final String id; - /// The type of encryption key, such as an AWS Key Management Service (AWS KMS) - /// key. When creating or updating a pipeline, the value must be set to 'KMS'. + /// The type of encryption key, such as an Amazon Web Services KMS key. When + /// creating or updating a pipeline, the value must be set to 'KMS'. final EncryptionKeyType type; EncryptionKey({ @@ -3957,7 +4066,7 @@ extension EncryptionKeyTypeFromString on String { } } -/// Represents information about an error in AWS CodePipeline. +/// Represents information about an error in CodePipeline. class ErrorDetails { /// The system ID or number code of the error. final String? code; @@ -3991,7 +4100,7 @@ class ErrorDetails { /// passes through stages in the pipeline. class ExecutionDetails { /// The system-generated unique ID of this action used to identify this job - /// worker in any external systems, such as AWS CodeDeploy. + /// worker in any external systems, such as CodeDeploy. final String? externalExecutionId; /// The percentage of work completed on the action, represented on a scale of 0 @@ -4020,6 +4129,39 @@ class ExecutionDetails { } } +enum ExecutionMode { + queued, + superseded, + parallel, +} + +extension ExecutionModeValueExtension on ExecutionMode { + String toValue() { + switch (this) { + case ExecutionMode.queued: + return 'QUEUED'; + case ExecutionMode.superseded: + return 'SUPERSEDED'; + case ExecutionMode.parallel: + return 'PARALLEL'; + } + } +} + +extension ExecutionModeFromString on String { + ExecutionMode toExecutionMode() { + switch (this) { + case 'QUEUED': + return ExecutionMode.queued; + case 'SUPERSEDED': + return ExecutionMode.superseded; + case 'PARALLEL': + return ExecutionMode.parallel; + } + throw Exception('$this is not known in enum ExecutionMode'); + } +} + /// The interaction or event that started a pipeline execution. class ExecutionTrigger { /// Detail related to the event that started a pipeline execution, such as the @@ -4053,6 +4195,34 @@ class ExecutionTrigger { } } +enum ExecutionType { + standard, + rollback, +} + +extension ExecutionTypeValueExtension on ExecutionType { + String toValue() { + switch (this) { + case ExecutionType.standard: + return 'STANDARD'; + case ExecutionType.rollback: + return 'ROLLBACK'; + } + } +} + +extension ExecutionTypeFromString on String { + ExecutionType toExecutionType() { + switch (this) { + case 'STANDARD': + return ExecutionType.standard; + case 'ROLLBACK': + return ExecutionType.rollback; + } + throw Exception('$this is not known in enum ExecutionType'); + } +} + /// The action engine, or executor, related to the supported integration model /// used to create and update the action type. The available executor types are /// Lambda and JobWorker. @@ -4122,6 +4292,31 @@ extension ExecutorTypeFromString on String { } } +/// The configuration that specifies the result, such as rollback, to occur upon +/// stage failure. +class FailureConditions { + /// The specified result for when the failure conditions are met, such as + /// rolling back the stage. + final Result? result; + + FailureConditions({ + this.result, + }); + + factory FailureConditions.fromJson(Map json) { + return FailureConditions( + result: (json['result'] as String?)?.toResult(), + ); + } + + Map toJson() { + final result = this.result; + return { + if (result != null) 'result': result.toValue(), + }; + } +} + /// Represents information about failure details. class FailureDetails { /// The message about the failure. @@ -4404,11 +4599,321 @@ class GetThirdPartyJobDetailsOutput { } } +/// The Git repository branches specified as filter criteria to start the +/// pipeline. +class GitBranchFilterCriteria { + /// The list of patterns of Git branches that, when a commit is pushed, are to + /// be excluded from starting the pipeline. + final List? excludes; + + /// The list of patterns of Git branches that, when a commit is pushed, are to + /// be included as criteria that starts the pipeline. + final List? includes; + + GitBranchFilterCriteria({ + this.excludes, + this.includes, + }); + + factory GitBranchFilterCriteria.fromJson(Map json) { + return GitBranchFilterCriteria( + excludes: (json['excludes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + includes: (json['includes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final excludes = this.excludes; + final includes = this.includes; + return { + if (excludes != null) 'excludes': excludes, + if (includes != null) 'includes': includes, + }; + } +} + +/// A type of trigger configuration for Git-based source actions. +/// +/// You can specify the Git configuration trigger type for all third-party +/// Git-based source actions that are supported by the +/// CodeStarSourceConnection action type. +/// +class GitConfiguration { + /// The name of the pipeline source action where the trigger configuration, such + /// as Git tags, is specified. The trigger configuration will start the pipeline + /// upon the specified change only. + /// + /// You can only specify one trigger configuration per source action. + /// + final String sourceActionName; + + /// The field where the repository event that will start the pipeline is + /// specified as pull requests. + final List? pullRequest; + + /// The field where the repository event that will start the pipeline, such as + /// pushing Git tags, is specified with details. + final List? push; + + GitConfiguration({ + required this.sourceActionName, + this.pullRequest, + this.push, + }); + + factory GitConfiguration.fromJson(Map json) { + return GitConfiguration( + sourceActionName: json['sourceActionName'] as String, + pullRequest: (json['pullRequest'] as List?) + ?.whereNotNull() + .map((e) => GitPullRequestFilter.fromJson(e as Map)) + .toList(), + push: (json['push'] as List?) + ?.whereNotNull() + .map((e) => GitPushFilter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final sourceActionName = this.sourceActionName; + final pullRequest = this.pullRequest; + final push = this.push; + return { + 'sourceActionName': sourceActionName, + if (pullRequest != null) 'pullRequest': pullRequest, + if (push != null) 'push': push, + }; + } +} + +/// The Git repository file paths specified as filter criteria to start the +/// pipeline. +class GitFilePathFilterCriteria { + /// The list of patterns of Git repository file paths that, when a commit is + /// pushed, are to be excluded from starting the pipeline. + final List? excludes; + + /// The list of patterns of Git repository file paths that, when a commit is + /// pushed, are to be included as criteria that starts the pipeline. + final List? includes; + + GitFilePathFilterCriteria({ + this.excludes, + this.includes, + }); + + factory GitFilePathFilterCriteria.fromJson(Map json) { + return GitFilePathFilterCriteria( + excludes: (json['excludes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + includes: (json['includes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final excludes = this.excludes; + final includes = this.includes; + return { + if (excludes != null) 'excludes': excludes, + if (includes != null) 'includes': includes, + }; + } +} + +enum GitPullRequestEventType { + open, + updated, + closed, +} + +extension GitPullRequestEventTypeValueExtension on GitPullRequestEventType { + String toValue() { + switch (this) { + case GitPullRequestEventType.open: + return 'OPEN'; + case GitPullRequestEventType.updated: + return 'UPDATED'; + case GitPullRequestEventType.closed: + return 'CLOSED'; + } + } +} + +extension GitPullRequestEventTypeFromString on String { + GitPullRequestEventType toGitPullRequestEventType() { + switch (this) { + case 'OPEN': + return GitPullRequestEventType.open; + case 'UPDATED': + return GitPullRequestEventType.updated; + case 'CLOSED': + return GitPullRequestEventType.closed; + } + throw Exception('$this is not known in enum GitPullRequestEventType'); + } +} + +/// The event criteria for the pull request trigger configuration, such as the +/// lists of branches or file paths to include and exclude. +class GitPullRequestFilter { + /// The field that specifies to filter on branches for the pull request trigger + /// configuration. + final GitBranchFilterCriteria? branches; + + /// The field that specifies which pull request events to filter on (opened, + /// updated, closed) for the trigger configuration. + final List? events; + + /// The field that specifies to filter on file paths for the pull request + /// trigger configuration. + final GitFilePathFilterCriteria? filePaths; + + GitPullRequestFilter({ + this.branches, + this.events, + this.filePaths, + }); + + factory GitPullRequestFilter.fromJson(Map json) { + return GitPullRequestFilter( + branches: json['branches'] != null + ? GitBranchFilterCriteria.fromJson( + json['branches'] as Map) + : null, + events: (json['events'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toGitPullRequestEventType()) + .toList(), + filePaths: json['filePaths'] != null + ? GitFilePathFilterCriteria.fromJson( + json['filePaths'] as Map) + : null, + ); + } + + Map toJson() { + final branches = this.branches; + final events = this.events; + final filePaths = this.filePaths; + return { + if (branches != null) 'branches': branches, + if (events != null) 'events': events.map((e) => e.toValue()).toList(), + if (filePaths != null) 'filePaths': filePaths, + }; + } +} + +/// The event criteria that specify when a specified repository event will start +/// the pipeline for the specified trigger configuration, such as the lists of +/// Git tags to include and exclude. +class GitPushFilter { + /// The field that specifies to filter on branches for the push trigger + /// configuration. + final GitBranchFilterCriteria? branches; + + /// The field that specifies to filter on file paths for the push trigger + /// configuration. + final GitFilePathFilterCriteria? filePaths; + + /// The field that contains the details for the Git tags trigger configuration. + final GitTagFilterCriteria? tags; + + GitPushFilter({ + this.branches, + this.filePaths, + this.tags, + }); + + factory GitPushFilter.fromJson(Map json) { + return GitPushFilter( + branches: json['branches'] != null + ? GitBranchFilterCriteria.fromJson( + json['branches'] as Map) + : null, + filePaths: json['filePaths'] != null + ? GitFilePathFilterCriteria.fromJson( + json['filePaths'] as Map) + : null, + tags: json['tags'] != null + ? GitTagFilterCriteria.fromJson(json['tags'] as Map) + : null, + ); + } + + Map toJson() { + final branches = this.branches; + final filePaths = this.filePaths; + final tags = this.tags; + return { + if (branches != null) 'branches': branches, + if (filePaths != null) 'filePaths': filePaths, + if (tags != null) 'tags': tags, + }; + } +} + +/// The Git tags specified as filter criteria for whether a Git tag repository +/// event will start the pipeline. +class GitTagFilterCriteria { + /// The list of patterns of Git tags that, when pushed, are to be excluded from + /// starting the pipeline. + final List? excludes; + + /// The list of patterns of Git tags that, when pushed, are to be included as + /// criteria that starts the pipeline. + final List? includes; + + GitTagFilterCriteria({ + this.excludes, + this.includes, + }); + + factory GitTagFilterCriteria.fromJson(Map json) { + return GitTagFilterCriteria( + excludes: (json['excludes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + includes: (json['includes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final excludes = this.excludes; + final includes = this.includes; + return { + if (excludes != null) 'excludes': excludes, + if (includes != null) 'includes': includes, + }; + } +} + /// Represents information about an artifact to be worked on, such as a test or /// build artifact. class InputArtifact { /// The name of the artifact to be worked on (for example, "My App"). /// + /// Artifacts are the files that are worked on by actions in the pipeline. See + /// the action configuration for each action for details about artifact + /// parameters. For example, the S3 source action input artifact is a file name + /// (or file path), and the files are generally provided as a ZIP file. Example + /// artifact name: SampleApp_Windows.zip + /// /// The input artifact of an action must exactly match the output artifact /// declared in a preceding action, but the input artifact does not have to be /// the next action in strict sequence from the action that provided the output @@ -4436,7 +4941,7 @@ class InputArtifact { /// Represents information about a job. class Job { - /// The ID of the AWS account to use when performing the job. + /// The ID of the Amazon Web Services account to use when performing the job. final String? accountId; /// Other data about a job. @@ -4445,8 +4950,8 @@ class Job { /// The unique system-generated ID of the job. final String? id; - /// A system-generated random number that AWS CodePipeline uses to ensure that - /// the job is being worked on by only one job worker. Use this number in an + /// A system-generated random number that CodePipeline uses to ensure that the + /// job is being worked on by only one job worker. Use this number in an /// AcknowledgeJob request. final String? nonce; @@ -4491,18 +4996,19 @@ class JobData { /// Represents information about an action type. final ActionTypeId? actionTypeId; - /// Represents an AWS session credentials object. These credentials are - /// temporary credentials that are issued by AWS Secure Token Service (STS). - /// They can be used to access input and output artifacts in the S3 bucket used - /// to store artifacts for the pipeline in AWS CodePipeline. + /// Represents an Amazon Web Services session credentials object. These + /// credentials are temporary credentials that are issued by Amazon Web Services + /// Secure Token Service (STS). They can be used to access input and output + /// artifacts in the S3 bucket used to store artifacts for the pipeline in + /// CodePipeline. final AWSSessionCredentials? artifactCredentials; - /// A system-generated token, such as a AWS CodeDeploy deployment ID, required - /// by a job to continue the job asynchronously. + /// A system-generated token, such as a deployment ID, required by a job to + /// continue the job asynchronously. final String? continuationToken; /// Represents information about the key used to encrypt data in the artifact - /// store, such as an AWS Key Management Service (AWS KMS) key. + /// store, such as an KMS key. final EncryptionKey? encryptionKey; /// The artifact supplied to the job. @@ -4588,7 +5094,7 @@ class JobData { /// Represents information about the details of a job. class JobDetails { - /// The AWS account ID associated with the job. + /// The Amazon Web Services account ID associated with the job. final String? accountId; /// Represents other information about a job required for a job worker to @@ -4743,6 +5249,43 @@ class LambdaExecutorConfiguration { } } +/// The field that specifies to filter on the latest execution in the pipeline. +/// +/// Filtering on the latest execution is available for executions run on or +/// after February 08, 2024. +/// +class LatestInPipelineExecutionFilter { + /// The execution ID for the latest execution in the pipeline. + final String pipelineExecutionId; + + /// The start time to filter on for the latest execution in the pipeline. Valid + /// options: + /// + ///
            + ///
          • + /// All + ///
          • + ///
          • + /// Latest + ///
          • + ///
          + final StartTimeRange startTimeRange; + + LatestInPipelineExecutionFilter({ + required this.pipelineExecutionId, + required this.startTimeRange, + }); + + Map toJson() { + final pipelineExecutionId = this.pipelineExecutionId; + final startTimeRange = this.startTimeRange; + return { + 'pipelineExecutionId': pipelineExecutionId, + 'startTimeRange': startTimeRange.toValue(), + }; + } +} + class ListActionExecutionsOutput { /// The details for a list of recent executions, such as action execution ID. final List? actionExecutionDetails; @@ -5133,7 +5676,7 @@ class PipelineDeclaration { /// The name of the pipeline. final String name; - /// The Amazon Resource Name (ARN) for AWS CodePipeline to use to either perform + /// The Amazon Resource Name (ARN) for CodePipeline to use to either perform /// actions with no actionRoleArn, or to use to assume roles for /// actions with an actionRoleArn. final String roleArn; @@ -5151,9 +5694,9 @@ class PipelineDeclaration { /// final ArtifactStore? artifactStore; - /// A mapping of artifactStore objects and their corresponding AWS - /// Regions. There must be an artifact store for the pipeline Region and for - /// each cross-region action in the pipeline. + /// A mapping of artifactStore objects and their corresponding + /// Amazon Web Services Regions. There must be an artifact store for the + /// pipeline Region and for each cross-region action in the pipeline. /// /// You must include either artifactStore or /// artifactStores in your pipeline, but you cannot use both. If @@ -5162,17 +5705,64 @@ class PipelineDeclaration { /// final Map? artifactStores; - /// The version number of the pipeline. A new pipeline always has a version - /// number of 1. This number is incremented when a pipeline is updated. - final int? version; + /// The method that the pipeline will use to handle multiple executions. The + /// default mode is SUPERSEDED. + final ExecutionMode? executionMode; - PipelineDeclaration({ - required this.name, - required this.roleArn, - required this.stages, - this.artifactStore, - this.artifactStores, - this.version, + /// CodePipeline provides the following pipeline types, which differ in + /// characteristics and price, so that you can tailor your pipeline features and + /// cost to the needs of your applications. + /// + ///
            + ///
          • + /// V1 type pipelines have a JSON structure that contains standard pipeline, + /// stage, and action-level parameters. + ///
          • + ///
          • + /// V2 type pipelines have the same structure as a V1 type, along with + /// additional parameters for release safety and trigger configuration. + ///
          • + ///
          + /// Including V2 parameters, such as triggers on Git tags, in the pipeline JSON + /// when creating or updating a pipeline will result in the pipeline having the + /// V2 type of pipeline and the associated costs. + /// + /// For information about pricing for CodePipeline, see Pricing. + /// + /// For information about which type of pipeline to choose, see What + /// type of pipeline is right for me?. + final PipelineType? pipelineType; + + /// The trigger configuration specifying a type of event, such as Git tags, that + /// starts the pipeline. + /// + /// When a trigger configuration is specified, default change detection for + /// repository and branch commits is disabled. + /// + final List? triggers; + + /// A list that defines the pipeline variables for a pipeline resource. Variable + /// names can have alphanumeric and underscore characters, and the values must + /// match [A-Za-z0-9@\-_]+. + final List? variables; + + /// The version number of the pipeline. A new pipeline always has a version + /// number of 1. This number is incremented when a pipeline is updated. + final int? version; + + PipelineDeclaration({ + required this.name, + required this.roleArn, + required this.stages, + this.artifactStore, + this.artifactStores, + this.executionMode, + this.pipelineType, + this.triggers, + this.variables, + this.version, }); factory PipelineDeclaration.fromJson(Map json) { @@ -5190,6 +5780,18 @@ class PipelineDeclaration { artifactStores: (json['artifactStores'] as Map?)?.map( (k, e) => MapEntry(k, ArtifactStore.fromJson(e as Map))), + executionMode: (json['executionMode'] as String?)?.toExecutionMode(), + pipelineType: (json['pipelineType'] as String?)?.toPipelineType(), + triggers: (json['triggers'] as List?) + ?.whereNotNull() + .map((e) => + PipelineTriggerDeclaration.fromJson(e as Map)) + .toList(), + variables: (json['variables'] as List?) + ?.whereNotNull() + .map((e) => + PipelineVariableDeclaration.fromJson(e as Map)) + .toList(), version: json['version'] as int?, ); } @@ -5200,6 +5802,10 @@ class PipelineDeclaration { final stages = this.stages; final artifactStore = this.artifactStore; final artifactStores = this.artifactStores; + final executionMode = this.executionMode; + final pipelineType = this.pipelineType; + final triggers = this.triggers; + final variables = this.variables; final version = this.version; return { 'name': name, @@ -5207,6 +5813,10 @@ class PipelineDeclaration { 'stages': stages, if (artifactStore != null) 'artifactStore': artifactStore, if (artifactStores != null) 'artifactStores': artifactStores, + if (executionMode != null) 'executionMode': executionMode.toValue(), + if (pipelineType != null) 'pipelineType': pipelineType.toValue(), + if (triggers != null) 'triggers': triggers, + if (variables != null) 'variables': variables, if (version != null) 'version': version, }; } @@ -5218,6 +5828,13 @@ class PipelineExecution { /// execution. final List? artifactRevisions; + /// The method that the pipeline will use to handle multiple executions. The + /// default mode is SUPERSEDED. + final ExecutionMode? executionMode; + + /// The type of the pipeline execution. + final ExecutionType? executionType; + /// The ID of the pipeline execution. final String? pipelineExecutionId; @@ -5227,6 +5844,9 @@ class PipelineExecution { /// The version number of the pipeline with the specified pipeline execution. final int? pipelineVersion; + /// The metadata about the execution pertaining to stage rollback. + final PipelineRollbackMetadata? rollbackMetadata; + /// The status of the pipeline execution. /// ///
            @@ -5268,14 +5888,23 @@ class PipelineExecution { /// A summary that contains a description of the pipeline execution status. final String? statusSummary; + final ExecutionTrigger? trigger; + + /// A list of pipeline variables used for the pipeline execution. + final List? variables; PipelineExecution({ this.artifactRevisions, + this.executionMode, + this.executionType, this.pipelineExecutionId, this.pipelineName, this.pipelineVersion, + this.rollbackMetadata, this.status, this.statusSummary, + this.trigger, + this.variables, }); factory PipelineExecution.fromJson(Map json) { @@ -5284,29 +5913,71 @@ class PipelineExecution { ?.whereNotNull() .map((e) => ArtifactRevision.fromJson(e as Map)) .toList(), + executionMode: (json['executionMode'] as String?)?.toExecutionMode(), + executionType: (json['executionType'] as String?)?.toExecutionType(), pipelineExecutionId: json['pipelineExecutionId'] as String?, pipelineName: json['pipelineName'] as String?, pipelineVersion: json['pipelineVersion'] as int?, + rollbackMetadata: json['rollbackMetadata'] != null + ? PipelineRollbackMetadata.fromJson( + json['rollbackMetadata'] as Map) + : null, status: (json['status'] as String?)?.toPipelineExecutionStatus(), statusSummary: json['statusSummary'] as String?, + trigger: json['trigger'] != null + ? ExecutionTrigger.fromJson(json['trigger'] as Map) + : null, + variables: (json['variables'] as List?) + ?.whereNotNull() + .map((e) => + ResolvedPipelineVariable.fromJson(e as Map)) + .toList(), ); } Map toJson() { final artifactRevisions = this.artifactRevisions; + final executionMode = this.executionMode; + final executionType = this.executionType; final pipelineExecutionId = this.pipelineExecutionId; final pipelineName = this.pipelineName; final pipelineVersion = this.pipelineVersion; + final rollbackMetadata = this.rollbackMetadata; final status = this.status; final statusSummary = this.statusSummary; + final trigger = this.trigger; + final variables = this.variables; return { if (artifactRevisions != null) 'artifactRevisions': artifactRevisions, + if (executionMode != null) 'executionMode': executionMode.toValue(), + if (executionType != null) 'executionType': executionType.toValue(), if (pipelineExecutionId != null) 'pipelineExecutionId': pipelineExecutionId, if (pipelineName != null) 'pipelineName': pipelineName, if (pipelineVersion != null) 'pipelineVersion': pipelineVersion, + if (rollbackMetadata != null) 'rollbackMetadata': rollbackMetadata, if (status != null) 'status': status.toValue(), if (statusSummary != null) 'statusSummary': statusSummary, + if (trigger != null) 'trigger': trigger, + if (variables != null) 'variables': variables, + }; + } +} + +/// The pipeline execution to filter on. +class PipelineExecutionFilter { + /// Filter for pipeline executions where the stage was successful in the current + /// pipeline version. + final SucceededInStageFilter? succeededInStage; + + PipelineExecutionFilter({ + this.succeededInStage, + }); + + Map toJson() { + final succeededInStage = this.succeededInStage; + return { + if (succeededInStage != null) 'succeededInStage': succeededInStage, }; } } @@ -5366,6 +6037,13 @@ extension PipelineExecutionStatusFromString on String { /// Summary information about a pipeline execution. class PipelineExecutionSummary { + /// The method that the pipeline will use to handle multiple executions. The + /// default mode is SUPERSEDED. + final ExecutionMode? executionMode; + + /// Type of the pipeline execution. + final ExecutionType? executionType; + /// The date and time of the last change to the pipeline execution, in timestamp /// format. final DateTime? lastUpdateTime; @@ -5373,6 +6051,9 @@ class PipelineExecutionSummary { /// The ID of the pipeline execution. final String? pipelineExecutionId; + /// The metadata for the stage execution to be rolled back. + final PipelineRollbackMetadata? rollbackMetadata; + /// A list of the source artifact revisions that initiated a pipeline execution. final List? sourceRevisions; @@ -5414,6 +6095,9 @@ class PipelineExecutionSummary { ///
          final PipelineExecutionStatus? status; + /// Status summary for the pipeline. + final String? statusSummary; + /// The interaction that stopped a pipeline execution. final StopExecutionTrigger? stopTrigger; @@ -5423,25 +6107,36 @@ class PipelineExecutionSummary { final ExecutionTrigger? trigger; PipelineExecutionSummary({ + this.executionMode, + this.executionType, this.lastUpdateTime, this.pipelineExecutionId, + this.rollbackMetadata, this.sourceRevisions, this.startTime, this.status, + this.statusSummary, this.stopTrigger, this.trigger, }); factory PipelineExecutionSummary.fromJson(Map json) { return PipelineExecutionSummary( + executionMode: (json['executionMode'] as String?)?.toExecutionMode(), + executionType: (json['executionType'] as String?)?.toExecutionType(), lastUpdateTime: timeStampFromJson(json['lastUpdateTime']), pipelineExecutionId: json['pipelineExecutionId'] as String?, + rollbackMetadata: json['rollbackMetadata'] != null + ? PipelineRollbackMetadata.fromJson( + json['rollbackMetadata'] as Map) + : null, sourceRevisions: (json['sourceRevisions'] as List?) ?.whereNotNull() .map((e) => SourceRevision.fromJson(e as Map)) .toList(), startTime: timeStampFromJson(json['startTime']), status: (json['status'] as String?)?.toPipelineExecutionStatus(), + statusSummary: json['statusSummary'] as String?, stopTrigger: json['stopTrigger'] != null ? StopExecutionTrigger.fromJson( json['stopTrigger'] as Map) @@ -5453,21 +6148,29 @@ class PipelineExecutionSummary { } Map toJson() { + final executionMode = this.executionMode; + final executionType = this.executionType; final lastUpdateTime = this.lastUpdateTime; final pipelineExecutionId = this.pipelineExecutionId; + final rollbackMetadata = this.rollbackMetadata; final sourceRevisions = this.sourceRevisions; final startTime = this.startTime; final status = this.status; + final statusSummary = this.statusSummary; final stopTrigger = this.stopTrigger; final trigger = this.trigger; return { + if (executionMode != null) 'executionMode': executionMode.toValue(), + if (executionType != null) 'executionType': executionType.toValue(), if (lastUpdateTime != null) 'lastUpdateTime': unixTimestampToJson(lastUpdateTime), if (pipelineExecutionId != null) 'pipelineExecutionId': pipelineExecutionId, + if (rollbackMetadata != null) 'rollbackMetadata': rollbackMetadata, if (sourceRevisions != null) 'sourceRevisions': sourceRevisions, if (startTime != null) 'startTime': unixTimestampToJson(startTime), if (status != null) 'status': status.toValue(), + if (statusSummary != null) 'statusSummary': statusSummary, if (stopTrigger != null) 'stopTrigger': stopTrigger, if (trigger != null) 'trigger': trigger, }; @@ -5482,12 +6185,23 @@ class PipelineMetadata { /// The Amazon Resource Name (ARN) of the pipeline. final String? pipelineArn; + /// The date and time that polling for source changes (periodic checks) was + /// stopped for the pipeline, in timestamp format. You can migrate (update) a + /// polling pipeline to use event-based change detection. For example, for a + /// pipeline with a CodeCommit source, we recommend you migrate (update) your + /// pipeline to use CloudWatch Events. To learn more, see Migrate + /// polling pipelines to use event-based change detection in the + /// CodePipeline User Guide. + final DateTime? pollingDisabledAt; + /// The date and time the pipeline was last updated, in timestamp format. final DateTime? updated; PipelineMetadata({ this.created, this.pipelineArn, + this.pollingDisabledAt, this.updated, }); @@ -5495,6 +6209,7 @@ class PipelineMetadata { return PipelineMetadata( created: timeStampFromJson(json['created']), pipelineArn: json['pipelineArn'] as String?, + pollingDisabledAt: timeStampFromJson(json['pollingDisabledAt']), updated: timeStampFromJson(json['updated']), ); } @@ -5502,23 +6217,82 @@ class PipelineMetadata { Map toJson() { final created = this.created; final pipelineArn = this.pipelineArn; + final pollingDisabledAt = this.pollingDisabledAt; final updated = this.updated; return { if (created != null) 'created': unixTimestampToJson(created), if (pipelineArn != null) 'pipelineArn': pipelineArn, + if (pollingDisabledAt != null) + 'pollingDisabledAt': unixTimestampToJson(pollingDisabledAt), if (updated != null) 'updated': unixTimestampToJson(updated), }; } } +/// The metadata for the stage execution to be rolled back. +class PipelineRollbackMetadata { + /// The pipeline execution ID to which the stage will be rolled back. + final String? rollbackTargetPipelineExecutionId; + + PipelineRollbackMetadata({ + this.rollbackTargetPipelineExecutionId, + }); + + factory PipelineRollbackMetadata.fromJson(Map json) { + return PipelineRollbackMetadata( + rollbackTargetPipelineExecutionId: + json['rollbackTargetPipelineExecutionId'] as String?, + ); + } + + Map toJson() { + final rollbackTargetPipelineExecutionId = + this.rollbackTargetPipelineExecutionId; + return { + if (rollbackTargetPipelineExecutionId != null) + 'rollbackTargetPipelineExecutionId': rollbackTargetPipelineExecutionId, + }; + } +} + /// Returns a summary of a pipeline. class PipelineSummary { /// The date and time the pipeline was created, in timestamp format. final DateTime? created; + /// The method that the pipeline will use to handle multiple executions. The + /// default mode is SUPERSEDED. + final ExecutionMode? executionMode; + /// The name of the pipeline. final String? name; + /// CodePipeline provides the following pipeline types, which differ in + /// characteristics and price, so that you can tailor your pipeline features and + /// cost to the needs of your applications. + /// + ///
            + ///
          • + /// V1 type pipelines have a JSON structure that contains standard pipeline, + /// stage, and action-level parameters. + ///
          • + ///
          • + /// V2 type pipelines have the same structure as a V1 type, along with + /// additional parameters for release safety and trigger configuration. + ///
          • + ///
          + /// Including V2 parameters, such as triggers on Git tags, in the pipeline JSON + /// when creating or updating a pipeline will result in the pipeline having the + /// V2 type of pipeline and the associated costs. + /// + /// For information about pricing for CodePipeline, see Pricing. + /// + /// For information about which type of pipeline to choose, see What + /// type of pipeline is right for me?. + final PipelineType? pipelineType; + /// The date and time of the last update to the pipeline, in timestamp format. final DateTime? updated; @@ -5527,7 +6301,9 @@ class PipelineSummary { PipelineSummary({ this.created, + this.executionMode, this.name, + this.pipelineType, this.updated, this.version, }); @@ -5535,7 +6311,9 @@ class PipelineSummary { factory PipelineSummary.fromJson(Map json) { return PipelineSummary( created: timeStampFromJson(json['created']), + executionMode: (json['executionMode'] as String?)?.toExecutionMode(), name: json['name'] as String?, + pipelineType: (json['pipelineType'] as String?)?.toPipelineType(), updated: timeStampFromJson(json['updated']), version: json['version'] as int?, ); @@ -5543,18 +6321,179 @@ class PipelineSummary { Map toJson() { final created = this.created; + final executionMode = this.executionMode; final name = this.name; + final pipelineType = this.pipelineType; final updated = this.updated; final version = this.version; return { if (created != null) 'created': unixTimestampToJson(created), + if (executionMode != null) 'executionMode': executionMode.toValue(), if (name != null) 'name': name, + if (pipelineType != null) 'pipelineType': pipelineType.toValue(), if (updated != null) 'updated': unixTimestampToJson(updated), if (version != null) 'version': version, }; } } +/// Represents information about the specified trigger configuration, such as +/// the filter criteria and the source stage for the action that contains the +/// trigger. +/// +/// This is only supported for the CodeStarSourceConnection action +/// type. +/// +/// When a trigger configuration is specified, default change detection for +/// repository and branch commits is disabled. +/// +class PipelineTriggerDeclaration { + /// Provides the filter criteria and the source stage for the repository event + /// that starts the pipeline, such as Git tags. + final GitConfiguration gitConfiguration; + + /// The source provider for the event, such as connections configured for a + /// repository with Git tags, for the specified trigger configuration. + final PipelineTriggerProviderType providerType; + + PipelineTriggerDeclaration({ + required this.gitConfiguration, + required this.providerType, + }); + + factory PipelineTriggerDeclaration.fromJson(Map json) { + return PipelineTriggerDeclaration( + gitConfiguration: GitConfiguration.fromJson( + json['gitConfiguration'] as Map), + providerType: + (json['providerType'] as String).toPipelineTriggerProviderType(), + ); + } + + Map toJson() { + final gitConfiguration = this.gitConfiguration; + final providerType = this.providerType; + return { + 'gitConfiguration': gitConfiguration, + 'providerType': providerType.toValue(), + }; + } +} + +enum PipelineTriggerProviderType { + codeStarSourceConnection, +} + +extension PipelineTriggerProviderTypeValueExtension + on PipelineTriggerProviderType { + String toValue() { + switch (this) { + case PipelineTriggerProviderType.codeStarSourceConnection: + return 'CodeStarSourceConnection'; + } + } +} + +extension PipelineTriggerProviderTypeFromString on String { + PipelineTriggerProviderType toPipelineTriggerProviderType() { + switch (this) { + case 'CodeStarSourceConnection': + return PipelineTriggerProviderType.codeStarSourceConnection; + } + throw Exception('$this is not known in enum PipelineTriggerProviderType'); + } +} + +enum PipelineType { + v1, + v2, +} + +extension PipelineTypeValueExtension on PipelineType { + String toValue() { + switch (this) { + case PipelineType.v1: + return 'V1'; + case PipelineType.v2: + return 'V2'; + } + } +} + +extension PipelineTypeFromString on String { + PipelineType toPipelineType() { + switch (this) { + case 'V1': + return PipelineType.v1; + case 'V2': + return PipelineType.v2; + } + throw Exception('$this is not known in enum PipelineType'); + } +} + +/// A pipeline-level variable used for a pipeline execution. +class PipelineVariable { + /// The name of a pipeline-level variable. + final String name; + + /// The value of a pipeline-level variable. + final String value; + + PipelineVariable({ + required this.name, + required this.value, + }); + + Map toJson() { + final name = this.name; + final value = this.value; + return { + 'name': name, + 'value': value, + }; + } +} + +/// A variable declared at the pipeline level. +class PipelineVariableDeclaration { + /// The name of a pipeline-level variable. + final String name; + + /// The value of a pipeline-level variable. + final String? defaultValue; + + /// The description of a pipeline-level variable. It's used to add additional + /// context about the variable, and not being used at time when pipeline + /// executes. + final String? description; + + PipelineVariableDeclaration({ + required this.name, + this.defaultValue, + this.description, + }); + + factory PipelineVariableDeclaration.fromJson(Map json) { + return PipelineVariableDeclaration( + name: json['name'] as String, + defaultValue: json['defaultValue'] as String?, + description: json['description'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final defaultValue = this.defaultValue; + final description = this.description; + return { + 'name': name, + if (defaultValue != null) 'defaultValue': defaultValue, + if (description != null) 'description': description, + }; + } +} + /// Represents the output of a PollForJobs action. class PollForJobsOutput { /// Information about the jobs to take action on. @@ -5699,6 +6638,59 @@ class RegisterWebhookWithThirdPartyOutput { } } +/// A pipeline-level variable used for a pipeline execution. +class ResolvedPipelineVariable { + /// The name of a pipeline-level variable. + final String? name; + + /// The resolved value of a pipeline-level variable. + final String? resolvedValue; + + ResolvedPipelineVariable({ + this.name, + this.resolvedValue, + }); + + factory ResolvedPipelineVariable.fromJson(Map json) { + return ResolvedPipelineVariable( + name: json['name'] as String?, + resolvedValue: json['resolvedValue'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final resolvedValue = this.resolvedValue; + return { + if (name != null) 'name': name, + if (resolvedValue != null) 'resolvedValue': resolvedValue, + }; + } +} + +enum Result { + rollback, +} + +extension ResultValueExtension on Result { + String toValue() { + switch (this) { + case Result.rollback: + return 'ROLLBACK'; + } + } +} + +extension ResultFromString on String { + Result toResult() { + switch (this) { + case 'ROLLBACK': + return Result.rollback; + } + throw Exception('$this is not known in enum Result'); + } +} + /// Represents the output of a RetryStageExecution action. class RetryStageExecutionOutput { /// The ID of the current workflow execution in the failed stage. @@ -5723,6 +6715,29 @@ class RetryStageExecutionOutput { } } +class RollbackStageOutput { + /// The execution ID of the pipeline execution for the stage that has been + /// rolled back. + final String pipelineExecutionId; + + RollbackStageOutput({ + required this.pipelineExecutionId, + }); + + factory RollbackStageOutput.fromJson(Map json) { + return RollbackStageOutput( + pipelineExecutionId: json['pipelineExecutionId'] as String, + ); + } + + Map toJson() { + final pipelineExecutionId = this.pipelineExecutionId; + return { + 'pipelineExecutionId': pipelineExecutionId, + }; + } +} + /// The location of the S3 bucket that contains a revision. class S3ArtifactLocation { /// The name of the S3 bucket. @@ -5795,15 +6810,14 @@ class SourceRevision { final String? revisionId; /// Summary information about the most recent revision of the artifact. For - /// GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3 + /// GitHub and CodeCommit repositories, the commit message. For Amazon S3 /// buckets or actions, the user-provided content of a /// codepipeline-artifact-revision-summary key specified in the /// object metadata. final String? revisionSummary; /// The commit ID for the artifact revision. For artifacts stored in GitHub or - /// AWS CodeCommit repositories, the commit ID is linked to a commit details - /// page. + /// CodeCommit repositories, the commit ID is linked to a commit details page. final String? revisionUrl; SourceRevision({ @@ -5836,6 +6850,73 @@ class SourceRevision { } } +/// A list that allows you to specify, or override, the source revision for a +/// pipeline execution that's being started. A source revision is the version +/// with all the changes to your application code, or source artifact, for the +/// pipeline execution. +class SourceRevisionOverride { + /// The name of the action where the override will be applied. + final String actionName; + + /// The type of source revision, based on the source provider. For example, the + /// revision type for the CodeCommit action provider is the commit ID. + final SourceRevisionType revisionType; + + /// The source revision, or version of your source artifact, with the changes + /// that you want to run in the pipeline execution. + final String revisionValue; + + SourceRevisionOverride({ + required this.actionName, + required this.revisionType, + required this.revisionValue, + }); + + Map toJson() { + final actionName = this.actionName; + final revisionType = this.revisionType; + final revisionValue = this.revisionValue; + return { + 'actionName': actionName, + 'revisionType': revisionType.toValue(), + 'revisionValue': revisionValue, + }; + } +} + +enum SourceRevisionType { + commitId, + imageDigest, + s3ObjectVersionId, +} + +extension SourceRevisionTypeValueExtension on SourceRevisionType { + String toValue() { + switch (this) { + case SourceRevisionType.commitId: + return 'COMMIT_ID'; + case SourceRevisionType.imageDigest: + return 'IMAGE_DIGEST'; + case SourceRevisionType.s3ObjectVersionId: + return 'S3_OBJECT_VERSION_ID'; + } + } +} + +extension SourceRevisionTypeFromString on String { + SourceRevisionType toSourceRevisionType() { + switch (this) { + case 'COMMIT_ID': + return SourceRevisionType.commitId; + case 'IMAGE_DIGEST': + return SourceRevisionType.imageDigest; + case 'S3_OBJECT_VERSION_ID': + return SourceRevisionType.s3ObjectVersionId; + } + throw Exception('$this is not known in enum SourceRevisionType'); + } +} + /// Represents information about a stage to a job worker. class StageContext { /// The name of the stage. @@ -5870,10 +6951,16 @@ class StageDeclaration { /// Reserved for future use. final List? blockers; + /// The method to use when a stage has not completed successfully. For example, + /// configuring this field for rollback will roll back a failed stage + /// automatically to the last successful pipeline execution in the stage. + final FailureConditions? onFailure; + StageDeclaration({ required this.actions, required this.name, this.blockers, + this.onFailure, }); factory StageDeclaration.fromJson(Map json) { @@ -5887,6 +6974,10 @@ class StageDeclaration { ?.whereNotNull() .map((e) => BlockerDeclaration.fromJson(e as Map)) .toList(), + onFailure: json['onFailure'] != null + ? FailureConditions.fromJson( + json['onFailure'] as Map) + : null, ); } @@ -5894,10 +6985,12 @@ class StageDeclaration { final actions = this.actions; final name = this.name; final blockers = this.blockers; + final onFailure = this.onFailure; return { 'actions': actions, 'name': name, if (blockers != null) 'blockers': blockers, + if (onFailure != null) 'onFailure': onFailure, }; } } @@ -5915,24 +7008,32 @@ class StageExecution { /// final StageExecutionStatus status; + /// The type of pipeline execution for the stage, such as a rollback pipeline + /// execution. + final ExecutionType? type; + StageExecution({ required this.pipelineExecutionId, required this.status, + this.type, }); factory StageExecution.fromJson(Map json) { return StageExecution( pipelineExecutionId: json['pipelineExecutionId'] as String, status: (json['status'] as String).toStageExecutionStatus(), + type: (json['type'] as String?)?.toExecutionType(), ); } Map toJson() { final pipelineExecutionId = this.pipelineExecutionId; final status = this.status; + final type = this.type; return { 'pipelineExecutionId': pipelineExecutionId, 'status': status.toValue(), + if (type != null) 'type': type.toValue(), }; } } @@ -5987,6 +7088,7 @@ extension StageExecutionStatusFromString on String { enum StageRetryMode { failedActions, + allActions, } extension StageRetryModeValueExtension on StageRetryMode { @@ -5994,6 +7096,8 @@ extension StageRetryModeValueExtension on StageRetryMode { switch (this) { case StageRetryMode.failedActions: return 'FAILED_ACTIONS'; + case StageRetryMode.allActions: + return 'ALL_ACTIONS'; } } } @@ -6003,6 +7107,8 @@ extension StageRetryModeFromString on String { switch (this) { case 'FAILED_ACTIONS': return StageRetryMode.failedActions; + case 'ALL_ACTIONS': + return StageRetryMode.allActions; } throw Exception('$this is not known in enum StageRetryMode'); } @@ -6014,6 +7120,9 @@ class StageState { final List? actionStates; final StageExecution? inboundExecution; + /// The inbound executions for a stage. + final List? inboundExecutions; + /// The state of the inbound transition, which is either enabled or disabled. final TransitionState? inboundTransitionState; @@ -6027,6 +7136,7 @@ class StageState { StageState({ this.actionStates, this.inboundExecution, + this.inboundExecutions, this.inboundTransitionState, this.latestExecution, this.stageName, @@ -6042,6 +7152,10 @@ class StageState { ? StageExecution.fromJson( json['inboundExecution'] as Map) : null, + inboundExecutions: (json['inboundExecutions'] as List?) + ?.whereNotNull() + .map((e) => StageExecution.fromJson(e as Map)) + .toList(), inboundTransitionState: json['inboundTransitionState'] != null ? TransitionState.fromJson( json['inboundTransitionState'] as Map) @@ -6057,12 +7171,14 @@ class StageState { Map toJson() { final actionStates = this.actionStates; final inboundExecution = this.inboundExecution; + final inboundExecutions = this.inboundExecutions; final inboundTransitionState = this.inboundTransitionState; final latestExecution = this.latestExecution; final stageName = this.stageName; return { if (actionStates != null) 'actionStates': actionStates, if (inboundExecution != null) 'inboundExecution': inboundExecution, + if (inboundExecutions != null) 'inboundExecutions': inboundExecutions, if (inboundTransitionState != null) 'inboundTransitionState': inboundTransitionState, if (latestExecution != null) 'latestExecution': latestExecution, @@ -6123,6 +7239,34 @@ class StartPipelineExecutionOutput { } } +enum StartTimeRange { + latest, + all, +} + +extension StartTimeRangeValueExtension on StartTimeRange { + String toValue() { + switch (this) { + case StartTimeRange.latest: + return 'Latest'; + case StartTimeRange.all: + return 'All'; + } + } +} + +extension StartTimeRangeFromString on String { + StartTimeRange toStartTimeRange() { + switch (this) { + case 'Latest': + return StartTimeRange.latest; + case 'All': + return StartTimeRange.all; + } + throw Exception('$this is not known in enum StartTimeRange'); + } +} + /// The interaction that stopped a pipeline execution. class StopExecutionTrigger { /// The user-specified reason the pipeline was stopped. @@ -6169,6 +7313,25 @@ class StopPipelineExecutionOutput { } } +/// Filter for pipeline executions that have successfully completed the stage in +/// the current pipeline version. +class SucceededInStageFilter { + /// The name of the stage for filtering for pipeline executions where the stage + /// was successful in the current pipeline version. + final String? stageName; + + SucceededInStageFilter({ + this.stageName, + }); + + Map toJson() { + final stageName = this.stageName; + return { + if (stageName != null) 'stageName': stageName, + }; + } +} + /// A tag is a key-value pair that is used to manage the resource. class Tag { /// The tag's key. @@ -6211,7 +7374,7 @@ class TagResourceOutput { } } -/// A response to a PollForThirdPartyJobs request returned by AWS +/// A response to a PollForThirdPartyJobs request returned by /// CodePipeline when there is a job to be worked on by a partner action. class ThirdPartyJob { /// The clientToken portion of the clientId and @@ -6219,7 +7382,7 @@ class ThirdPartyJob { /// allowed access to the job and its details. final String? clientId; - /// The identifier used to identify the job in AWS CodePipeline. + /// The identifier used to identify the job in CodePipeline. final String? jobId; ThirdPartyJob({ @@ -6252,19 +7415,20 @@ class ThirdPartyJobData { /// Represents information about an action type. final ActionTypeId? actionTypeId; - /// Represents an AWS session credentials object. These credentials are - /// temporary credentials that are issued by AWS Secure Token Service (STS). - /// They can be used to access input and output artifacts in the S3 bucket used - /// to store artifact for the pipeline in AWS CodePipeline. + /// Represents an Amazon Web Services session credentials object. These + /// credentials are temporary credentials that are issued by Amazon Web Services + /// Secure Token Service (STS). They can be used to access input and output + /// artifacts in the S3 bucket used to store artifact for the pipeline in + /// CodePipeline. final AWSSessionCredentials? artifactCredentials; - /// A system-generated token, such as a AWS CodeDeploy deployment ID, that a job + /// A system-generated token, such as a CodeDeploy deployment ID, that a job /// requires to continue the job asynchronously. final String? continuationToken; /// The encryption key used to encrypt and decrypt data in the artifact store - /// for the pipeline, such as an AWS Key Management Service (AWS KMS) key. This - /// is optional and might not be present. + /// for the pipeline, such as an Amazon Web Services Key Management Service + /// (Amazon Web Services KMS) key. This is optional and might not be present. final EncryptionKey? encryptionKey; /// The name of the artifact that is worked on by the action, if any. This name @@ -6360,11 +7524,11 @@ class ThirdPartyJobDetails { /// The data to be returned by the third party job worker. final ThirdPartyJobData? data; - /// The identifier used to identify the job details in AWS CodePipeline. + /// The identifier used to identify the job details in CodePipeline. final String? id; - /// A system-generated random number that AWS CodePipeline uses to ensure that - /// the job is being worked on by only one job worker. Use this number in an + /// A system-generated random number that CodePipeline uses to ensure that the + /// job is being worked on by only one job worker. Use this number in an /// AcknowledgeThirdPartyJob request. final String? nonce; @@ -6450,6 +7614,9 @@ enum TriggerType { webhook, cloudWatchEvent, putActionRevision, + webhookV2, + manualRollback, + automatedRollback, } extension TriggerTypeValueExtension on TriggerType { @@ -6467,6 +7634,12 @@ extension TriggerTypeValueExtension on TriggerType { return 'CloudWatchEvent'; case TriggerType.putActionRevision: return 'PutActionRevision'; + case TriggerType.webhookV2: + return 'WebhookV2'; + case TriggerType.manualRollback: + return 'ManualRollback'; + case TriggerType.automatedRollback: + return 'AutomatedRollback'; } } } @@ -6486,6 +7659,12 @@ extension TriggerTypeFromString on String { return TriggerType.cloudWatchEvent; case 'PutActionRevision': return TriggerType.putActionRevision; + case 'WebhookV2': + return TriggerType.webhookV2; + case 'ManualRollback': + return TriggerType.manualRollback; + case 'AutomatedRollback': + return TriggerType.automatedRollback; } throw Exception('$this is not known in enum TriggerType'); } @@ -6697,9 +7876,9 @@ class WebhookFilterRule { /// placeholders in this value by surrounding the action configuration key with /// curly brackets. For example, if the value supplied here is /// "refs/heads/{Branch}" and the target action has an action configuration - /// property called "Branch" with a value of "master", the - /// MatchEquals value is evaluated as "refs/heads/master". For a - /// list of action configuration properties for built-in action types, see MatchEquals value is evaluated as "refs/heads/main". For a list + /// of action configuration properties for built-in action types, see Pipeline /// Structure Reference Action Requirements. final String? matchEquals; @@ -6753,6 +7932,16 @@ class ConcurrentModificationException extends _s.GenericAwsException { message: message); } +class ConcurrentPipelineExecutionsLimitExceededException + extends _s.GenericAwsException { + ConcurrentPipelineExecutionsLimitExceededException( + {String? type, String? message}) + : super( + type: type, + code: 'ConcurrentPipelineExecutionsLimitExceededException', + message: message); +} + class ConflictException extends _s.GenericAwsException { ConflictException({String? type, String? message}) : super(type: type, code: 'ConflictException', message: message); @@ -6899,6 +8088,14 @@ class PipelineExecutionNotStoppableException extends _s.GenericAwsException { message: message); } +class PipelineExecutionOutdatedException extends _s.GenericAwsException { + PipelineExecutionOutdatedException({String? type, String? message}) + : super( + type: type, + code: 'PipelineExecutionOutdatedException', + message: message); +} + class PipelineNameInUseException extends _s.GenericAwsException { PipelineNameInUseException({String? type, String? message}) : super(type: type, code: 'PipelineNameInUseException', message: message); @@ -6942,6 +8139,14 @@ class TooManyTagsException extends _s.GenericAwsException { : super(type: type, code: 'TooManyTagsException', message: message); } +class UnableToRollbackStageException extends _s.GenericAwsException { + UnableToRollbackStageException({String? type, String? message}) + : super( + type: type, + code: 'UnableToRollbackStageException', + message: message); +} + class ValidationException extends _s.GenericAwsException { ValidationException({String? type, String? message}) : super(type: type, code: 'ValidationException', message: message); @@ -6961,6 +8166,9 @@ final _exceptionFns = { ApprovalAlreadyCompletedException(type: type, message: message), 'ConcurrentModificationException': (type, message) => ConcurrentModificationException(type: type, message: message), + 'ConcurrentPipelineExecutionsLimitExceededException': (type, message) => + ConcurrentPipelineExecutionsLimitExceededException( + type: type, message: message), 'ConflictException': (type, message) => ConflictException(type: type, message: message), 'DuplicatedStopRequestException': (type, message) => @@ -7006,6 +8214,8 @@ final _exceptionFns = { PipelineExecutionNotFoundException(type: type, message: message), 'PipelineExecutionNotStoppableException': (type, message) => PipelineExecutionNotStoppableException(type: type, message: message), + 'PipelineExecutionOutdatedException': (type, message) => + PipelineExecutionOutdatedException(type: type, message: message), 'PipelineNameInUseException': (type, message) => PipelineNameInUseException(type: type, message: message), 'PipelineNotFoundException': (type, message) => @@ -7022,6 +8232,8 @@ final _exceptionFns = { StageNotRetryableException(type: type, message: message), 'TooManyTagsException': (type, message) => TooManyTagsException(type: type, message: message), + 'UnableToRollbackStageException': (type, message) => + UnableToRollbackStageException(type: type, message: message), 'ValidationException': (type, message) => ValidationException(type: type, message: message), 'WebhookNotFoundException': (type, message) => diff --git a/aws_client/lib/src/generated/code_star_connections/v2019_12_01.dart b/aws_client/lib/src/generated/code_star_connections/v2019_12_01.dart index fc7c3f2cf..a1c6946ab 100644 --- a/aws_client/lib/src/generated/code_star_connections/v2019_12_01.dart +++ b/aws_client/lib/src/generated/code_star_connections/v2019_12_01.dart @@ -19,10 +19,10 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// This AWS CodeStar Connections API Reference provides descriptions and usage -/// examples of the operations and data types for the AWS CodeStar Connections -/// API. You can use the connections API to work with connections and -/// installations. +/// This Amazon Web Services CodeStar Connections API Reference provides +/// descriptions and usage examples of the operations and data types for the +/// Amazon Web Services CodeStar Connections API. You can use the connections +/// API to work with connections and installations. class CodeStarConnections { final _s.JsonProtocol _protocol; CodeStarConnections({ @@ -52,18 +52,17 @@ class CodeStarConnections { _protocol.close(); } - /// Creates a connection that can then be given to other AWS services like - /// CodePipeline so that it can access third-party code repositories. The - /// connection is in pending status until the third-party connection handshake - /// is completed from the console. + /// Creates a connection that can then be given to other Amazon Web Services + /// services like CodePipeline so that it can access third-party code + /// repositories. The connection is in pending status until the third-party + /// connection handshake is completed from the console. /// /// May throw [LimitExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [ResourceUnavailableException]. /// /// Parameter [connectionName] : - /// The name of the connection to be created. The name must be unique in the - /// calling AWS account. + /// The name of the connection to be created. /// /// Parameter [hostArn] : /// The Amazon Resource Name (ARN) of the host associated with the connection @@ -116,8 +115,7 @@ class CodeStarConnections { /// May throw [LimitExceededException]. /// /// Parameter [name] : - /// The name of the host to be created. The name must be unique in the calling - /// AWS account. + /// The name of the host to be created. /// /// Parameter [providerEndpoint] : /// The endpoint of the infrastructure to be represented by the host after it @@ -128,6 +126,9 @@ class CodeStarConnections { /// The host resource represents the infrastructure where your provider type /// is installed. The valid provider type is GitHub Enterprise Server. /// + /// Parameter [tags] : + /// Tags for the host to be created. + /// /// Parameter [vpcConfiguration] : /// The VPC configuration to be provisioned for the host. A VPC must be /// configured and the infrastructure to be represented by the host must @@ -162,6 +163,148 @@ class CodeStarConnections { return CreateHostOutput.fromJson(jsonResponse.body); } + /// Creates a link to a specified external Git repository. A repository link + /// allows Git sync to monitor and sync changes to files in a specified Git + /// repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of the connection to be associated with the + /// repository link. + /// + /// Parameter [ownerId] : + /// The owner ID for the repository associated with a specific sync + /// configuration, such as the owner ID in GitHub. + /// + /// Parameter [repositoryName] : + /// The name of the repository to be associated with the repository link. + /// + /// Parameter [encryptionKeyArn] : + /// The Amazon Resource Name (ARN) encryption key for the repository to be + /// associated with the repository link. + /// + /// Parameter [tags] : + /// The tags for the repository to be associated with the repository link. + Future createRepositoryLink({ + required String connectionArn, + required String ownerId, + required String repositoryName, + String? encryptionKeyArn, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConnectionArn': connectionArn, + 'OwnerId': ownerId, + 'RepositoryName': repositoryName, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Creates a sync configuration which allows Amazon Web Services to sync + /// content from a Git repository to update a specified Amazon Web Services + /// resource. Parameters for the sync configuration are determined by the sync + /// type. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceAlreadyExistsException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [branch] : + /// The branch in the repository from which changes will be synced. + /// + /// Parameter [configFile] : + /// The file name of the configuration file that manages syncing between the + /// connection and the repository. This configuration file is stored in the + /// repository. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link created for the connection. A repository + /// link allows Git sync to monitor and sync changes to files in a specified + /// Git repository. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource (for example, a + /// CloudFormation stack in the case of CFN_STACK_SYNC) that will be + /// synchronized from the linked repository. + /// + /// Parameter [roleArn] : + /// The ARN of the IAM role that grants permission for Amazon Web Services to + /// use Git sync to update a given Amazon Web Services resource on your + /// behalf. + /// + /// Parameter [syncType] : + /// The type of sync configuration. + /// + /// Parameter [publishDeploymentStatus] : + /// Whether to enable or disable publishing of deployment status to source + /// providers. + /// + /// Parameter [triggerResourceUpdateOn] : + /// When to trigger Git sync to begin the stack update. + Future createSyncConfiguration({ + required String branch, + required String configFile, + required String repositoryLinkId, + required String resourceName, + required String roleArn, + required SyncConfigurationType syncType, + PublishDeploymentStatus? publishDeploymentStatus, + TriggerResourceUpdateOn? triggerResourceUpdateOn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Branch': branch, + 'ConfigFile': configFile, + 'RepositoryLinkId': repositoryLinkId, + 'ResourceName': resourceName, + 'RoleArn': roleArn, + 'SyncType': syncType.toValue(), + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }, + ); + + return CreateSyncConfigurationOutput.fromJson(jsonResponse.body); + } + /// The connection to be deleted. /// /// May throw [ResourceNotFoundException]. @@ -223,6 +366,77 @@ class CodeStarConnections { ); } + /// Deletes the association between your connection and a specified external + /// Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [SyncConfigurationStillExistsException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UnsupportedProviderTypeException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to be deleted. + Future deleteRepositoryLink({ + required String repositoryLinkId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.DeleteRepositoryLink' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + }, + ); + } + + /// Deletes the sync configuration for a specified repository and connection. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [LimitExceededException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource associated with the sync + /// configuration to be deleted. + /// + /// Parameter [syncType] : + /// The type of sync configuration to be deleted. + Future deleteSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.DeleteSyncConfiguration' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + } + /// Returns the connection ARN and details such as status, owner, and provider /// type. /// @@ -283,8 +497,207 @@ class CodeStarConnections { return GetHostOutput.fromJson(jsonResponse.body); } + /// Returns details about a repository link. A repository link allows Git sync + /// to monitor and sync changes from files in a specified Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to get. + Future getRepositoryLink({ + required String repositoryLinkId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + }, + ); + + return GetRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Returns details about the sync status for a repository. A repository sync + /// uses Git sync to push and pull changes from your remote repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [branch] : + /// The branch of the repository link for the requested repository sync + /// status. + /// + /// Parameter [repositoryLinkId] : + /// The repository link ID for the requested repository sync status. + /// + /// Parameter [syncType] : + /// The sync type of the requested sync status. + Future getRepositorySyncStatus({ + required String branch, + required String repositoryLinkId, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetRepositorySyncStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Branch': branch, + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), + }, + ); + + return GetRepositorySyncStatusOutput.fromJson(jsonResponse.body); + } + + /// Returns the status of the sync with the Git repository for a specific + /// Amazon Web Services resource. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync status with the + /// Git repository. + /// + /// Parameter [syncType] : + /// The sync type for the sync status with the Git repository. + Future getResourceSyncStatus({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetResourceSyncStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetResourceSyncStatusOutput.fromJson(jsonResponse.body); + } + + /// Returns a list of the most recent sync blockers. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource currently blocked from + /// automatically being synced from a Git repository. + /// + /// Parameter [syncType] : + /// The sync type for the sync blocker summary. + Future getSyncBlockerSummary({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetSyncBlockerSummary' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetSyncBlockerSummaryOutput.fromJson(jsonResponse.body); + } + + /// Returns details about a sync configuration, including the sync type and + /// resource name. A sync configuration allows the configuration to sync (push + /// and pull) changes from the remote repository for a specified branch in a + /// Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync configuration + /// for which you want to retrieve information. + /// + /// Parameter [syncType] : + /// The sync type for the sync configuration for which you want to retrieve + /// information. + Future getSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return GetSyncConfigurationOutput.fromJson(jsonResponse.body); + } + /// Lists the connections associated with your account. /// + /// May throw [ResourceNotFoundException]. + /// /// Parameter [hostArnFilter] : /// Filters the list of connections to those associated with a specified host. /// @@ -375,21 +788,36 @@ class CodeStarConnections { return ListHostsOutput.fromJson(jsonResponse.body); } - /// Gets the set of key-value pairs (metadata) that are used to manage the - /// resource. + /// Lists the repository links created for connections in your account. /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource for which you want to get - /// information about tags, if any. - Future listTagsForResource({ - required String resourceArn, + /// Parameter [maxResults] : + /// A non-zero, non-negative integer used to limit the number of returned + /// results. + /// + /// Parameter [nextToken] : + /// An enumeration token that, when provided in a request, returns the next + /// batch of the results. + Future listRepositoryLinks({ + int? maxResults, + String? nextToken, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); final headers = { 'Content-Type': 'application/x-amz-json-1.0', 'X-Amz-Target': - 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListTagsForResource' + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListRepositoryLinks' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -398,61 +826,188 @@ class CodeStarConnections { // TODO queryParams headers: headers, payload: { - 'ResourceArn': resourceArn, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, }, ); - return ListTagsForResourceOutput.fromJson(jsonResponse.body); + return ListRepositoryLinksOutput.fromJson(jsonResponse.body); } - /// Adds to or modifies the tags of the given resource. Tags are metadata that - /// can be used to manage a resource. + /// Lists the repository sync definitions for repository links in your + /// account. /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. /// May throw [ResourceNotFoundException]. - /// May throw [LimitExceededException]. + /// May throw [ThrottlingException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource to which you want to add or - /// update tags. + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the sync definition for which you want + /// to retrieve information. /// - /// Parameter [tags] : - /// The tags you want to modify or add to the resource. - Future tagResource({ - required String resourceArn, - required List tags, + /// Parameter [syncType] : + /// The sync type of the repository link for the the sync definition for which + /// you want to retrieve information. + Future listRepositorySyncDefinitions({ + required String repositoryLinkId, + required SyncConfigurationType syncType, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.0', 'X-Amz-Target': - 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.TagResource' + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListRepositorySyncDefinitions' }; - await _protocol.send( + final jsonResponse = await _protocol.send( method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, payload: { - 'ResourceArn': resourceArn, - 'Tags': tags, + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), }, ); + + return ListRepositorySyncDefinitionsOutput.fromJson(jsonResponse.body); } - /// Removes tags from an AWS resource. + /// Returns a list of sync configurations for a specified repository. /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource to remove tags from. + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the requested list of sync + /// configurations. /// - /// Parameter [tagKeys] : - /// The list of keys for the tags to be removed from the resource. - Future untagResource({ - required String resourceArn, - required List tagKeys, - }) async { - final headers = { + /// Parameter [syncType] : + /// The sync type for the requested list of sync configurations. + /// + /// Parameter [maxResults] : + /// A non-zero, non-negative integer used to limit the number of returned + /// results. + /// + /// Parameter [nextToken] : + /// An enumeration token that allows the operation to batch the results of the + /// operation. + Future listSyncConfigurations({ + required String repositoryLinkId, + required SyncConfigurationType syncType, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListSyncConfigurations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + 'SyncType': syncType.toValue(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListSyncConfigurationsOutput.fromJson(jsonResponse.body); + } + + /// Gets the set of key-value pairs (metadata) that are used to manage the + /// resource. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource for which you want to get + /// information about tags, if any. + Future listTagsForResource({ + required String resourceArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + }, + ); + + return ListTagsForResourceOutput.fromJson(jsonResponse.body); + } + + /// Adds to or modifies the tags of the given resource. Tags are metadata that + /// can be used to manage a resource. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to which you want to add or + /// update tags. + /// + /// Parameter [tags] : + /// The tags you want to modify or add to the resource. + Future tagResource({ + required String resourceArn, + required List tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'Tags': tags, + }, + ); + } + + /// Removes tags from an Amazon Web Services resource. + /// + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to remove tags from. + /// + /// Parameter [tagKeys] : + /// The list of keys for the tags to be removed from the resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final headers = { 'Content-Type': 'application/x-amz-json-1.0', 'X-Amz-Target': 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.UntagResource' @@ -510,24 +1065,249 @@ class CodeStarConnections { }, ); } + + /// Updates the association between your connection and a specified external + /// Git repository. A repository link allows Git sync to monitor and sync + /// changes to files in a specified Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConditionalCheckFailedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UpdateOutOfSyncException]. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link to be updated. + /// + /// Parameter [connectionArn] : + /// The Amazon Resource Name (ARN) of the connection for the repository link + /// to be updated. The updated connection ARN must have the same providerType + /// (such as GitHub) as the original connection ARN for the repo link. + /// + /// Parameter [encryptionKeyArn] : + /// The Amazon Resource Name (ARN) of the encryption key for the repository + /// link to be updated. + Future updateRepositoryLink({ + required String repositoryLinkId, + String? connectionArn, + String? encryptionKeyArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.UpdateRepositoryLink' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RepositoryLinkId': repositoryLinkId, + if (connectionArn != null) 'ConnectionArn': connectionArn, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + }, + ); + + return UpdateRepositoryLinkOutput.fromJson(jsonResponse.body); + } + + /// Allows you to update the status of a sync blocker, resolving the blocker + /// and allowing syncing to continue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [RetryLatestCommitFailedException]. + /// May throw [SyncBlockerDoesNotExistException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [id] : + /// The ID of the sync blocker to be updated. + /// + /// Parameter [resolvedReason] : + /// The reason for resolving the sync blocker. + /// + /// Parameter [resourceName] : + /// The name of the resource for the sync blocker to be updated. + /// + /// Parameter [syncType] : + /// The sync type of the sync blocker to be updated. + Future updateSyncBlocker({ + required String id, + required String resolvedReason, + required String resourceName, + required SyncConfigurationType syncType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.UpdateSyncBlocker' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Id': id, + 'ResolvedReason': resolvedReason, + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + }, + ); + + return UpdateSyncBlockerOutput.fromJson(jsonResponse.body); + } + + /// Updates the sync configuration for your connection and a specified + /// external Git repository. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConcurrentModificationException]. + /// May throw [InternalServerException]. + /// May throw [InvalidInputException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [UpdateOutOfSyncException]. + /// + /// Parameter [resourceName] : + /// The name of the Amazon Web Services resource for the sync configuration to + /// be updated. + /// + /// Parameter [syncType] : + /// The sync type for the sync configuration to be updated. + /// + /// Parameter [branch] : + /// The branch for the sync configuration to be updated. + /// + /// Parameter [configFile] : + /// The configuration file for the sync configuration to be updated. + /// + /// Parameter [publishDeploymentStatus] : + /// Whether to enable or disable publishing of deployment status to source + /// providers. + /// + /// Parameter [repositoryLinkId] : + /// The ID of the repository link for the sync configuration to be updated. + /// + /// Parameter [roleArn] : + /// The ARN of the IAM role for the sync configuration to be updated. + /// + /// Parameter [triggerResourceUpdateOn] : + /// When to trigger Git sync to begin the stack update. + Future updateSyncConfiguration({ + required String resourceName, + required SyncConfigurationType syncType, + String? branch, + String? configFile, + PublishDeploymentStatus? publishDeploymentStatus, + String? repositoryLinkId, + String? roleArn, + TriggerResourceUpdateOn? triggerResourceUpdateOn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': + 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.UpdateSyncConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceName': resourceName, + 'SyncType': syncType.toValue(), + if (branch != null) 'Branch': branch, + if (configFile != null) 'ConfigFile': configFile, + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (repositoryLinkId != null) 'RepositoryLinkId': repositoryLinkId, + if (roleArn != null) 'RoleArn': roleArn, + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }, + ); + + return UpdateSyncConfigurationOutput.fromJson(jsonResponse.body); + } +} + +enum BlockerStatus { + active, + resolved, +} + +extension BlockerStatusValueExtension on BlockerStatus { + String toValue() { + switch (this) { + case BlockerStatus.active: + return 'ACTIVE'; + case BlockerStatus.resolved: + return 'RESOLVED'; + } + } +} + +extension BlockerStatusFromString on String { + BlockerStatus toBlockerStatus() { + switch (this) { + case 'ACTIVE': + return BlockerStatus.active; + case 'RESOLVED': + return BlockerStatus.resolved; + } + throw Exception('$this is not known in enum BlockerStatus'); + } +} + +enum BlockerType { + automated, +} + +extension BlockerTypeValueExtension on BlockerType { + String toValue() { + switch (this) { + case BlockerType.automated: + return 'AUTOMATED'; + } + } +} + +extension BlockerTypeFromString on String { + BlockerType toBlockerType() { + switch (this) { + case 'AUTOMATED': + return BlockerType.automated; + } + throw Exception('$this is not known in enum BlockerType'); + } } /// A resource that is used to connect third-party source providers with -/// services like AWS CodePipeline. +/// services like CodePipeline. /// /// Note: A connection created through CloudFormation, the CLI, or the SDK is in /// `PENDING` status by default. You can make its status `AVAILABLE` by updating /// the connection in the console. class Connection { /// The Amazon Resource Name (ARN) of the connection. The ARN is used as the - /// connection reference when the connection is shared between AWS services. + /// connection reference when the connection is shared between Amazon Web + /// Services. /// /// The ARN is never reused if the connection is deleted. /// final String? connectionArn; - /// The name of the connection. Connection names must be unique in an AWS user - /// account. + /// The name of the connection. Connection names must be unique in an Amazon Web + /// Services account. final String? connectionName; /// The current status of the connection. @@ -620,8 +1400,8 @@ extension ConnectionStatusFromString on String { class CreateConnectionOutput { /// The Amazon Resource Name (ARN) of the connection to be created. The ARN is - /// used as the connection reference when the connection is shared between AWS - /// services. + /// used as the connection reference when the connection is shared between + /// Amazon Web Services services. /// /// The ARN is never reused if the connection is deleted. /// @@ -658,6 +1438,8 @@ class CreateConnectionOutput { class CreateHostOutput { /// The Amazon Resource Name (ARN) of the host to be created. final String? hostArn; + + /// Tags for the created host. final List? tags; CreateHostOutput({ @@ -685,6 +1467,54 @@ class CreateHostOutput { } } +class CreateRepositoryLinkOutput { + /// The returned information about the created repository link. + final RepositoryLinkInfo repositoryLinkInfo; + + CreateRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory CreateRepositoryLinkOutput.fromJson(Map json) { + return CreateRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class CreateSyncConfigurationOutput { + /// The created sync configuration for the connection. A sync configuration + /// allows Amazon Web Services to sync content from a Git repository to update a + /// specified Amazon Web Services resource. + final SyncConfiguration syncConfiguration; + + CreateSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory CreateSyncConfigurationOutput.fromJson(Map json) { + return CreateSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + class DeleteConnectionOutput { DeleteConnectionOutput(); @@ -709,6 +1539,30 @@ class DeleteHostOutput { } } +class DeleteRepositoryLinkOutput { + DeleteRepositoryLinkOutput(); + + factory DeleteRepositoryLinkOutput.fromJson(Map _) { + return DeleteRepositoryLinkOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSyncConfigurationOutput { + DeleteSyncConfigurationOutput(); + + factory DeleteSyncConfigurationOutput.fromJson(Map _) { + return DeleteSyncConfigurationOutput(); + } + + Map toJson() { + return {}; + } +} + class GetConnectionOutput { /// The connection details, such as status, owner, and provider type. final Connection? connection; @@ -786,13 +1640,152 @@ class GetHostOutput { } } -/// A resource that represents the infrastructure where a third-party provider -/// is installed. The host is used when you create connections to an installed -/// third-party provider type, such as GitHub Enterprise Server. You create one -/// host for all connections to that provider. -/// -/// A host created through the CLI or the SDK is in `PENDING` status by default. -/// You can make its status `AVAILABLE` by setting up the host in the console. +class GetRepositoryLinkOutput { + /// The information returned for a specified repository link. + final RepositoryLinkInfo repositoryLinkInfo; + + GetRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory GetRepositoryLinkOutput.fromJson(Map json) { + return GetRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class GetRepositorySyncStatusOutput { + /// The status of the latest sync returned for a specified repository and + /// branch. + final RepositorySyncAttempt latestSync; + + GetRepositorySyncStatusOutput({ + required this.latestSync, + }); + + factory GetRepositorySyncStatusOutput.fromJson(Map json) { + return GetRepositorySyncStatusOutput( + latestSync: RepositorySyncAttempt.fromJson( + json['LatestSync'] as Map), + ); + } + + Map toJson() { + final latestSync = this.latestSync; + return { + 'LatestSync': latestSync, + }; + } +} + +class GetResourceSyncStatusOutput { + /// The latest sync for the sync status with the Git repository, whether + /// successful or not. + final ResourceSyncAttempt latestSync; + + /// The desired state of the Amazon Web Services resource for the sync status + /// with the Git repository. + final Revision? desiredState; + + /// The latest successful sync for the sync status with the Git repository. + final ResourceSyncAttempt? latestSuccessfulSync; + + GetResourceSyncStatusOutput({ + required this.latestSync, + this.desiredState, + this.latestSuccessfulSync, + }); + + factory GetResourceSyncStatusOutput.fromJson(Map json) { + return GetResourceSyncStatusOutput( + latestSync: ResourceSyncAttempt.fromJson( + json['LatestSync'] as Map), + desiredState: json['DesiredState'] != null + ? Revision.fromJson(json['DesiredState'] as Map) + : null, + latestSuccessfulSync: json['LatestSuccessfulSync'] != null + ? ResourceSyncAttempt.fromJson( + json['LatestSuccessfulSync'] as Map) + : null, + ); + } + + Map toJson() { + final latestSync = this.latestSync; + final desiredState = this.desiredState; + final latestSuccessfulSync = this.latestSuccessfulSync; + return { + 'LatestSync': latestSync, + if (desiredState != null) 'DesiredState': desiredState, + if (latestSuccessfulSync != null) + 'LatestSuccessfulSync': latestSuccessfulSync, + }; + } +} + +class GetSyncBlockerSummaryOutput { + /// The list of sync blockers for a specified resource. + final SyncBlockerSummary syncBlockerSummary; + + GetSyncBlockerSummaryOutput({ + required this.syncBlockerSummary, + }); + + factory GetSyncBlockerSummaryOutput.fromJson(Map json) { + return GetSyncBlockerSummaryOutput( + syncBlockerSummary: SyncBlockerSummary.fromJson( + json['SyncBlockerSummary'] as Map), + ); + } + + Map toJson() { + final syncBlockerSummary = this.syncBlockerSummary; + return { + 'SyncBlockerSummary': syncBlockerSummary, + }; + } +} + +class GetSyncConfigurationOutput { + /// The details about the sync configuration for which you want to retrieve + /// information. + final SyncConfiguration syncConfiguration; + + GetSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory GetSyncConfigurationOutput.fromJson(Map json) { + return GetSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + +/// A resource that represents the infrastructure where a third-party provider +/// is installed. The host is used when you create connections to an installed +/// third-party provider type, such as GitHub Enterprise Server. You create one +/// host for all connections to that provider. +/// +/// A host created through the CLI or the SDK is in `PENDING` status by default. +/// You can make its status `AVAILABLE` by setting up the host in the console. /// class Host { /// The Amazon Resource Name (ARN) of the host. @@ -934,6 +1927,110 @@ class ListHostsOutput { } } +class ListRepositoryLinksOutput { + /// Lists the repository links called by the list repository links operation. + final List repositoryLinks; + + /// An enumeration token that allows the operation to batch the results of the + /// operation. + final String? nextToken; + + ListRepositoryLinksOutput({ + required this.repositoryLinks, + this.nextToken, + }); + + factory ListRepositoryLinksOutput.fromJson(Map json) { + return ListRepositoryLinksOutput( + repositoryLinks: (json['RepositoryLinks'] as List) + .whereNotNull() + .map((e) => RepositoryLinkInfo.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final repositoryLinks = this.repositoryLinks; + final nextToken = this.nextToken; + return { + 'RepositoryLinks': repositoryLinks, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRepositorySyncDefinitionsOutput { + /// The list of repository sync definitions returned by the request. A + /// RepositorySyncDefinition is a mapping from a repository branch + /// to all the Amazon Web Services resources that are being synced from that + /// branch. + final List repositorySyncDefinitions; + + /// An enumeration token that, when provided in a request, returns the next + /// batch of the results. + final String? nextToken; + + ListRepositorySyncDefinitionsOutput({ + required this.repositorySyncDefinitions, + this.nextToken, + }); + + factory ListRepositorySyncDefinitionsOutput.fromJson( + Map json) { + return ListRepositorySyncDefinitionsOutput( + repositorySyncDefinitions: (json['RepositorySyncDefinitions'] as List) + .whereNotNull() + .map((e) => + RepositorySyncDefinition.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final repositorySyncDefinitions = this.repositorySyncDefinitions; + final nextToken = this.nextToken; + return { + 'RepositorySyncDefinitions': repositorySyncDefinitions, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListSyncConfigurationsOutput { + /// The list of repository sync definitions returned by the request. + final List syncConfigurations; + + /// An enumeration token that allows the operation to batch the next results of + /// the operation. + final String? nextToken; + + ListSyncConfigurationsOutput({ + required this.syncConfigurations, + this.nextToken, + }); + + factory ListSyncConfigurationsOutput.fromJson(Map json) { + return ListSyncConfigurationsOutput( + syncConfigurations: (json['SyncConfigurations'] as List) + .whereNotNull() + .map((e) => SyncConfiguration.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final syncConfigurations = this.syncConfigurations; + final nextToken = this.nextToken; + return { + 'SyncConfigurations': syncConfigurations, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListTagsForResourceOutput { /// A list of tag key and value pairs associated with the specified resource. final List? tags; @@ -963,6 +2060,8 @@ enum ProviderType { bitbucket, gitHub, gitHubEnterpriseServer, + gitLab, + gitLabSelfManaged, } extension ProviderTypeValueExtension on ProviderType { @@ -974,6 +2073,10 @@ extension ProviderTypeValueExtension on ProviderType { return 'GitHub'; case ProviderType.gitHubEnterpriseServer: return 'GitHubEnterpriseServer'; + case ProviderType.gitLab: + return 'GitLab'; + case ProviderType.gitLabSelfManaged: + return 'GitLabSelfManaged'; } } } @@ -987,14 +2090,810 @@ extension ProviderTypeFromString on String { return ProviderType.gitHub; case 'GitHubEnterpriseServer': return ProviderType.gitHubEnterpriseServer; + case 'GitLab': + return ProviderType.gitLab; + case 'GitLabSelfManaged': + return ProviderType.gitLabSelfManaged; } throw Exception('$this is not known in enum ProviderType'); } } +enum PublishDeploymentStatus { + enabled, + disabled, +} + +extension PublishDeploymentStatusValueExtension on PublishDeploymentStatus { + String toValue() { + switch (this) { + case PublishDeploymentStatus.enabled: + return 'ENABLED'; + case PublishDeploymentStatus.disabled: + return 'DISABLED'; + } + } +} + +extension PublishDeploymentStatusFromString on String { + PublishDeploymentStatus toPublishDeploymentStatus() { + switch (this) { + case 'ENABLED': + return PublishDeploymentStatus.enabled; + case 'DISABLED': + return PublishDeploymentStatus.disabled; + } + throw Exception('$this is not known in enum PublishDeploymentStatus'); + } +} + +/// Information about the repository link resource, such as the repository link +/// ARN, the associated connection ARN, encryption key ARN, and owner ID. +class RepositoryLinkInfo { + /// The Amazon Resource Name (ARN) of the connection associated with the + /// repository link. + final String connectionArn; + + /// The owner ID for the repository associated with the repository link, such as + /// the owner ID in GitHub. + final String ownerId; + + /// The provider type for the connection, such as GitHub, associated with the + /// repository link. + final ProviderType providerType; + + /// The Amazon Resource Name (ARN) of the repository link. + final String repositoryLinkArn; + + /// The ID of the repository link. + final String repositoryLinkId; + + /// The name of the repository associated with the repository link. + final String repositoryName; + + /// The Amazon Resource Name (ARN) of the encryption key for the repository + /// associated with the repository link. + final String? encryptionKeyArn; + + RepositoryLinkInfo({ + required this.connectionArn, + required this.ownerId, + required this.providerType, + required this.repositoryLinkArn, + required this.repositoryLinkId, + required this.repositoryName, + this.encryptionKeyArn, + }); + + factory RepositoryLinkInfo.fromJson(Map json) { + return RepositoryLinkInfo( + connectionArn: json['ConnectionArn'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryLinkArn: json['RepositoryLinkArn'] as String, + repositoryLinkId: json['RepositoryLinkId'] as String, + repositoryName: json['RepositoryName'] as String, + encryptionKeyArn: json['EncryptionKeyArn'] as String?, + ); + } + + Map toJson() { + final connectionArn = this.connectionArn; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryLinkArn = this.repositoryLinkArn; + final repositoryLinkId = this.repositoryLinkId; + final repositoryName = this.repositoryName; + final encryptionKeyArn = this.encryptionKeyArn; + return { + 'ConnectionArn': connectionArn, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryLinkArn': repositoryLinkArn, + 'RepositoryLinkId': repositoryLinkId, + 'RepositoryName': repositoryName, + if (encryptionKeyArn != null) 'EncryptionKeyArn': encryptionKeyArn, + }; + } +} + +/// Information about a repository sync attempt for a repository with a sync +/// configuration. +class RepositorySyncAttempt { + /// The events associated with a specific sync attempt. + final List events; + + /// The start time of a specific sync attempt. + final DateTime startedAt; + + /// The status of a specific sync attempt. The following are valid statuses: + /// + ///
            + ///
          • + /// INITIATED - A repository sync attempt has been created and will begin soon. + ///
          • + ///
          • + /// IN_PROGRESS - A repository sync attempt has started and work is being done + /// to reconcile the branch. + ///
          • + ///
          • + /// SUCCEEDED - The repository sync attempt has completed successfully. + ///
          • + ///
          • + /// FAILED - The repository sync attempt has failed. + ///
          • + ///
          • + /// QUEUED - The repository sync attempt didn't execute and was queued. + ///
          • + ///
          + final RepositorySyncStatus status; + + RepositorySyncAttempt({ + required this.events, + required this.startedAt, + required this.status, + }); + + factory RepositorySyncAttempt.fromJson(Map json) { + return RepositorySyncAttempt( + events: (json['Events'] as List) + .whereNotNull() + .map((e) => RepositorySyncEvent.fromJson(e as Map)) + .toList(), + startedAt: nonNullableTimeStampFromJson(json['StartedAt'] as Object), + status: (json['Status'] as String).toRepositorySyncStatus(), + ); + } + + Map toJson() { + final events = this.events; + final startedAt = this.startedAt; + final status = this.status; + return { + 'Events': events, + 'StartedAt': unixTimestampToJson(startedAt), + 'Status': status.toValue(), + }; + } +} + +/// The definition for a repository with a sync configuration. +class RepositorySyncDefinition { + /// The branch specified for a repository sync definition. + final String branch; + + /// The configuration file for a repository sync definition. This value comes + /// from creating or updating the config-file field of a + /// sync-configuration. + final String directory; + + /// The parent resource specified for a repository sync definition. + final String parent; + + /// The target resource specified for a repository sync definition. In some + /// cases, such as CFN_STACK_SYNC, the parent and target resource are the same. + final String target; + + RepositorySyncDefinition({ + required this.branch, + required this.directory, + required this.parent, + required this.target, + }); + + factory RepositorySyncDefinition.fromJson(Map json) { + return RepositorySyncDefinition( + branch: json['Branch'] as String, + directory: json['Directory'] as String, + parent: json['Parent'] as String, + target: json['Target'] as String, + ); + } + + Map toJson() { + final branch = this.branch; + final directory = this.directory; + final parent = this.parent; + final target = this.target; + return { + 'Branch': branch, + 'Directory': directory, + 'Parent': parent, + 'Target': target, + }; + } +} + +/// Information about a repository sync event. +class RepositorySyncEvent { + /// A description of a repository sync event. + final String event; + + /// The time that a repository sync event occurred. + final DateTime time; + + /// The event type for a repository sync event. + final String type; + + /// The ID for a repository sync event. + final String? externalId; + + RepositorySyncEvent({ + required this.event, + required this.time, + required this.type, + this.externalId, + }); + + factory RepositorySyncEvent.fromJson(Map json) { + return RepositorySyncEvent( + event: json['Event'] as String, + time: nonNullableTimeStampFromJson(json['Time'] as Object), + type: json['Type'] as String, + externalId: json['ExternalId'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final time = this.time; + final type = this.type; + final externalId = this.externalId; + return { + 'Event': event, + 'Time': unixTimestampToJson(time), + 'Type': type, + if (externalId != null) 'ExternalId': externalId, + }; + } +} + +enum RepositorySyncStatus { + failed, + initiated, + inProgress, + succeeded, + queued, +} + +extension RepositorySyncStatusValueExtension on RepositorySyncStatus { + String toValue() { + switch (this) { + case RepositorySyncStatus.failed: + return 'FAILED'; + case RepositorySyncStatus.initiated: + return 'INITIATED'; + case RepositorySyncStatus.inProgress: + return 'IN_PROGRESS'; + case RepositorySyncStatus.succeeded: + return 'SUCCEEDED'; + case RepositorySyncStatus.queued: + return 'QUEUED'; + } + } +} + +extension RepositorySyncStatusFromString on String { + RepositorySyncStatus toRepositorySyncStatus() { + switch (this) { + case 'FAILED': + return RepositorySyncStatus.failed; + case 'INITIATED': + return RepositorySyncStatus.initiated; + case 'IN_PROGRESS': + return RepositorySyncStatus.inProgress; + case 'SUCCEEDED': + return RepositorySyncStatus.succeeded; + case 'QUEUED': + return RepositorySyncStatus.queued; + } + throw Exception('$this is not known in enum RepositorySyncStatus'); + } +} + +/// Information about a resource sync attempt. +class ResourceSyncAttempt { + /// The events related to a resource sync attempt. + final List events; + + /// The current state of the resource as defined in the resource's + /// config-file in the linked repository. + final Revision initialRevision; + + /// The start time for a resource sync attempt. + final DateTime startedAt; + + /// The status for a resource sync attempt. The follow are valid statuses: + /// + ///
            + ///
          • + /// SYNC-INITIATED - A resource sync attempt has been created and will begin + /// soon. + ///
          • + ///
          • + /// SYNCING - Syncing has started and work is being done to reconcile state. + ///
          • + ///
          • + /// SYNCED - Syncing has completed successfully. + ///
          • + ///
          • + /// SYNC_FAILED - A resource sync attempt has failed. + ///
          • + ///
          + final ResourceSyncStatus status; + + /// The name of the Amazon Web Services resource that is attempted to be + /// synchronized. + final String target; + + /// The desired state of the resource as defined in the resource's + /// config-file in the linked repository. Git sync attempts to + /// update the resource to this state. + final Revision targetRevision; + + ResourceSyncAttempt({ + required this.events, + required this.initialRevision, + required this.startedAt, + required this.status, + required this.target, + required this.targetRevision, + }); + + factory ResourceSyncAttempt.fromJson(Map json) { + return ResourceSyncAttempt( + events: (json['Events'] as List) + .whereNotNull() + .map((e) => ResourceSyncEvent.fromJson(e as Map)) + .toList(), + initialRevision: + Revision.fromJson(json['InitialRevision'] as Map), + startedAt: nonNullableTimeStampFromJson(json['StartedAt'] as Object), + status: (json['Status'] as String).toResourceSyncStatus(), + target: json['Target'] as String, + targetRevision: + Revision.fromJson(json['TargetRevision'] as Map), + ); + } + + Map toJson() { + final events = this.events; + final initialRevision = this.initialRevision; + final startedAt = this.startedAt; + final status = this.status; + final target = this.target; + final targetRevision = this.targetRevision; + return { + 'Events': events, + 'InitialRevision': initialRevision, + 'StartedAt': unixTimestampToJson(startedAt), + 'Status': status.toValue(), + 'Target': target, + 'TargetRevision': targetRevision, + }; + } +} + +/// Information about a resource sync event for the resource associated with a +/// sync configuration. +class ResourceSyncEvent { + /// The event for a resource sync event. + final String event; + + /// The time that a resource sync event occurred. + final DateTime time; + + /// The type of resource sync event. + final String type; + + /// The ID for a resource sync event. + final String? externalId; + + ResourceSyncEvent({ + required this.event, + required this.time, + required this.type, + this.externalId, + }); + + factory ResourceSyncEvent.fromJson(Map json) { + return ResourceSyncEvent( + event: json['Event'] as String, + time: nonNullableTimeStampFromJson(json['Time'] as Object), + type: json['Type'] as String, + externalId: json['ExternalId'] as String?, + ); + } + + Map toJson() { + final event = this.event; + final time = this.time; + final type = this.type; + final externalId = this.externalId; + return { + 'Event': event, + 'Time': unixTimestampToJson(time), + 'Type': type, + if (externalId != null) 'ExternalId': externalId, + }; + } +} + +enum ResourceSyncStatus { + failed, + initiated, + inProgress, + succeeded, +} + +extension ResourceSyncStatusValueExtension on ResourceSyncStatus { + String toValue() { + switch (this) { + case ResourceSyncStatus.failed: + return 'FAILED'; + case ResourceSyncStatus.initiated: + return 'INITIATED'; + case ResourceSyncStatus.inProgress: + return 'IN_PROGRESS'; + case ResourceSyncStatus.succeeded: + return 'SUCCEEDED'; + } + } +} + +extension ResourceSyncStatusFromString on String { + ResourceSyncStatus toResourceSyncStatus() { + switch (this) { + case 'FAILED': + return ResourceSyncStatus.failed; + case 'INITIATED': + return ResourceSyncStatus.initiated; + case 'IN_PROGRESS': + return ResourceSyncStatus.inProgress; + case 'SUCCEEDED': + return ResourceSyncStatus.succeeded; + } + throw Exception('$this is not known in enum ResourceSyncStatus'); + } +} + +/// Information about the revision for a specific sync event, such as the +/// branch, owner ID, and name of the repository. +class Revision { + /// The branch name for a specific revision. + final String branch; + + /// The directory, if any, for a specific revision. + final String directory; + + /// The owner ID for a specific revision, such as the GitHub owner ID for a + /// GitHub repository. + final String ownerId; + + /// The provider type for a revision, such as GitHub. + final ProviderType providerType; + + /// The repository name for a specific revision. + final String repositoryName; + + /// The SHA, such as the commit ID, for a specific revision. + final String sha; + + Revision({ + required this.branch, + required this.directory, + required this.ownerId, + required this.providerType, + required this.repositoryName, + required this.sha, + }); + + factory Revision.fromJson(Map json) { + return Revision( + branch: json['Branch'] as String, + directory: json['Directory'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryName: json['RepositoryName'] as String, + sha: json['Sha'] as String, + ); + } + + Map toJson() { + final branch = this.branch; + final directory = this.directory; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryName = this.repositoryName; + final sha = this.sha; + return { + 'Branch': branch, + 'Directory': directory, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryName': repositoryName, + 'Sha': sha, + }; + } +} + +/// Information about a blocker for a sync event. +class SyncBlocker { + /// The creation time for a specific sync blocker. + final DateTime createdAt; + + /// The provided reason for a specific sync blocker. + final String createdReason; + + /// The ID for a specific sync blocker. + final String id; + + /// The status for a specific sync blocker. + final BlockerStatus status; + + /// The sync blocker type. + final BlockerType type; + + /// The contexts for a specific sync blocker. + final List? contexts; + + /// The time that a specific sync blocker was resolved. + final DateTime? resolvedAt; + + /// The resolved reason for a specific sync blocker. + final String? resolvedReason; + + SyncBlocker({ + required this.createdAt, + required this.createdReason, + required this.id, + required this.status, + required this.type, + this.contexts, + this.resolvedAt, + this.resolvedReason, + }); + + factory SyncBlocker.fromJson(Map json) { + return SyncBlocker( + createdAt: nonNullableTimeStampFromJson(json['CreatedAt'] as Object), + createdReason: json['CreatedReason'] as String, + id: json['Id'] as String, + status: (json['Status'] as String).toBlockerStatus(), + type: (json['Type'] as String).toBlockerType(), + contexts: (json['Contexts'] as List?) + ?.whereNotNull() + .map((e) => SyncBlockerContext.fromJson(e as Map)) + .toList(), + resolvedAt: timeStampFromJson(json['ResolvedAt']), + resolvedReason: json['ResolvedReason'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdReason = this.createdReason; + final id = this.id; + final status = this.status; + final type = this.type; + final contexts = this.contexts; + final resolvedAt = this.resolvedAt; + final resolvedReason = this.resolvedReason; + return { + 'CreatedAt': unixTimestampToJson(createdAt), + 'CreatedReason': createdReason, + 'Id': id, + 'Status': status.toValue(), + 'Type': type.toValue(), + if (contexts != null) 'Contexts': contexts, + if (resolvedAt != null) 'ResolvedAt': unixTimestampToJson(resolvedAt), + if (resolvedReason != null) 'ResolvedReason': resolvedReason, + }; + } +} + +/// The context for a specific sync blocker. +class SyncBlockerContext { + /// The key provided for a context key-value pair for a specific sync blocker. + final String key; + + /// The value provided for a context key-value pair for a specific sync blocker. + final String value; + + SyncBlockerContext({ + required this.key, + required this.value, + }); + + factory SyncBlockerContext.fromJson(Map json) { + return SyncBlockerContext( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +/// A summary for sync blockers. +class SyncBlockerSummary { + /// The resource name for sync blocker summary. + final String resourceName; + + /// The latest events for a sync blocker summary. + final List? latestBlockers; + + /// The parent resource name for a sync blocker summary. + final String? parentResourceName; + + SyncBlockerSummary({ + required this.resourceName, + this.latestBlockers, + this.parentResourceName, + }); + + factory SyncBlockerSummary.fromJson(Map json) { + return SyncBlockerSummary( + resourceName: json['ResourceName'] as String, + latestBlockers: (json['LatestBlockers'] as List?) + ?.whereNotNull() + .map((e) => SyncBlocker.fromJson(e as Map)) + .toList(), + parentResourceName: json['ParentResourceName'] as String?, + ); + } + + Map toJson() { + final resourceName = this.resourceName; + final latestBlockers = this.latestBlockers; + final parentResourceName = this.parentResourceName; + return { + 'ResourceName': resourceName, + if (latestBlockers != null) 'LatestBlockers': latestBlockers, + if (parentResourceName != null) 'ParentResourceName': parentResourceName, + }; + } +} + +/// Information, such as repository, branch, provider, and resource names for a +/// specific sync configuration. +class SyncConfiguration { + /// The branch associated with a specific sync configuration. + final String branch; + + /// The owner ID for the repository associated with a specific sync + /// configuration, such as the owner ID in GitHub. + final String ownerId; + + /// The connection provider type associated with a specific sync configuration, + /// such as GitHub. + final ProviderType providerType; + + /// The ID of the repository link associated with a specific sync configuration. + final String repositoryLinkId; + + /// The name of the repository associated with a specific sync configuration. + final String repositoryName; + + /// The name of the connection resource associated with a specific sync + /// configuration. + final String resourceName; + + /// The Amazon Resource Name (ARN) of the IAM role associated with a specific + /// sync configuration. + final String roleArn; + + /// The type of sync for a specific sync configuration. + final SyncConfigurationType syncType; + + /// The file path to the configuration file associated with a specific sync + /// configuration. The path should point to an actual file in the sync + /// configurations linked repository. + final String? configFile; + + /// Whether to enable or disable publishing of deployment status to source + /// providers. + final PublishDeploymentStatus? publishDeploymentStatus; + + /// When to trigger Git sync to begin the stack update. + final TriggerResourceUpdateOn? triggerResourceUpdateOn; + + SyncConfiguration({ + required this.branch, + required this.ownerId, + required this.providerType, + required this.repositoryLinkId, + required this.repositoryName, + required this.resourceName, + required this.roleArn, + required this.syncType, + this.configFile, + this.publishDeploymentStatus, + this.triggerResourceUpdateOn, + }); + + factory SyncConfiguration.fromJson(Map json) { + return SyncConfiguration( + branch: json['Branch'] as String, + ownerId: json['OwnerId'] as String, + providerType: (json['ProviderType'] as String).toProviderType(), + repositoryLinkId: json['RepositoryLinkId'] as String, + repositoryName: json['RepositoryName'] as String, + resourceName: json['ResourceName'] as String, + roleArn: json['RoleArn'] as String, + syncType: (json['SyncType'] as String).toSyncConfigurationType(), + configFile: json['ConfigFile'] as String?, + publishDeploymentStatus: (json['PublishDeploymentStatus'] as String?) + ?.toPublishDeploymentStatus(), + triggerResourceUpdateOn: (json['TriggerResourceUpdateOn'] as String?) + ?.toTriggerResourceUpdateOn(), + ); + } + + Map toJson() { + final branch = this.branch; + final ownerId = this.ownerId; + final providerType = this.providerType; + final repositoryLinkId = this.repositoryLinkId; + final repositoryName = this.repositoryName; + final resourceName = this.resourceName; + final roleArn = this.roleArn; + final syncType = this.syncType; + final configFile = this.configFile; + final publishDeploymentStatus = this.publishDeploymentStatus; + final triggerResourceUpdateOn = this.triggerResourceUpdateOn; + return { + 'Branch': branch, + 'OwnerId': ownerId, + 'ProviderType': providerType.toValue(), + 'RepositoryLinkId': repositoryLinkId, + 'RepositoryName': repositoryName, + 'ResourceName': resourceName, + 'RoleArn': roleArn, + 'SyncType': syncType.toValue(), + if (configFile != null) 'ConfigFile': configFile, + if (publishDeploymentStatus != null) + 'PublishDeploymentStatus': publishDeploymentStatus.toValue(), + if (triggerResourceUpdateOn != null) + 'TriggerResourceUpdateOn': triggerResourceUpdateOn.toValue(), + }; + } +} + +enum SyncConfigurationType { + cfnStackSync, +} + +extension SyncConfigurationTypeValueExtension on SyncConfigurationType { + String toValue() { + switch (this) { + case SyncConfigurationType.cfnStackSync: + return 'CFN_STACK_SYNC'; + } + } +} + +extension SyncConfigurationTypeFromString on String { + SyncConfigurationType toSyncConfigurationType() { + switch (this) { + case 'CFN_STACK_SYNC': + return SyncConfigurationType.cfnStackSync; + } + throw Exception('$this is not known in enum SyncConfigurationType'); + } +} + /// A tag is a key-value pair that is used to manage the resource. /// -/// This tag is available for use by AWS services that support tags. +/// This tag is available for use by Amazon Web Services services that support +/// tags. class Tag { /// The tag's key. final String key; @@ -1036,6 +2935,34 @@ class TagResourceOutput { } } +enum TriggerResourceUpdateOn { + anyChange, + fileChange, +} + +extension TriggerResourceUpdateOnValueExtension on TriggerResourceUpdateOn { + String toValue() { + switch (this) { + case TriggerResourceUpdateOn.anyChange: + return 'ANY_CHANGE'; + case TriggerResourceUpdateOn.fileChange: + return 'FILE_CHANGE'; + } + } +} + +extension TriggerResourceUpdateOnFromString on String { + TriggerResourceUpdateOn toTriggerResourceUpdateOn() { + switch (this) { + case 'ANY_CHANGE': + return TriggerResourceUpdateOn.anyChange; + case 'FILE_CHANGE': + return TriggerResourceUpdateOn.fileChange; + } + throw Exception('$this is not known in enum TriggerResourceUpdateOn'); + } +} + class UntagResourceOutput { UntagResourceOutput(); @@ -1060,6 +2987,89 @@ class UpdateHostOutput { } } +class UpdateRepositoryLinkOutput { + /// Information about the repository link to be updated. + final RepositoryLinkInfo repositoryLinkInfo; + + UpdateRepositoryLinkOutput({ + required this.repositoryLinkInfo, + }); + + factory UpdateRepositoryLinkOutput.fromJson(Map json) { + return UpdateRepositoryLinkOutput( + repositoryLinkInfo: RepositoryLinkInfo.fromJson( + json['RepositoryLinkInfo'] as Map), + ); + } + + Map toJson() { + final repositoryLinkInfo = this.repositoryLinkInfo; + return { + 'RepositoryLinkInfo': repositoryLinkInfo, + }; + } +} + +class UpdateSyncBlockerOutput { + /// The resource name for the sync blocker. + final String resourceName; + + /// Information about the sync blocker to be updated. + final SyncBlocker syncBlocker; + + /// The parent resource name for the sync blocker. + final String? parentResourceName; + + UpdateSyncBlockerOutput({ + required this.resourceName, + required this.syncBlocker, + this.parentResourceName, + }); + + factory UpdateSyncBlockerOutput.fromJson(Map json) { + return UpdateSyncBlockerOutput( + resourceName: json['ResourceName'] as String, + syncBlocker: + SyncBlocker.fromJson(json['SyncBlocker'] as Map), + parentResourceName: json['ParentResourceName'] as String?, + ); + } + + Map toJson() { + final resourceName = this.resourceName; + final syncBlocker = this.syncBlocker; + final parentResourceName = this.parentResourceName; + return { + 'ResourceName': resourceName, + 'SyncBlocker': syncBlocker, + if (parentResourceName != null) 'ParentResourceName': parentResourceName, + }; + } +} + +class UpdateSyncConfigurationOutput { + /// The information returned for the sync configuration to be updated. + final SyncConfiguration syncConfiguration; + + UpdateSyncConfigurationOutput({ + required this.syncConfiguration, + }); + + factory UpdateSyncConfigurationOutput.fromJson(Map json) { + return UpdateSyncConfigurationOutput( + syncConfiguration: SyncConfiguration.fromJson( + json['SyncConfiguration'] as Map), + ); + } + + Map toJson() { + final syncConfiguration = this.syncConfiguration; + return { + 'SyncConfiguration': syncConfiguration, + }; + } +} + /// The VPC configuration provisioned for the host. class VpcConfiguration { /// The ID of the security group or security groups associated with the Amazon @@ -1114,16 +3124,55 @@ class VpcConfiguration { } } +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConcurrentModificationException extends _s.GenericAwsException { + ConcurrentModificationException({String? type, String? message}) + : super( + type: type, + code: 'ConcurrentModificationException', + message: message); +} + +class ConditionalCheckFailedException extends _s.GenericAwsException { + ConditionalCheckFailedException({String? type, String? message}) + : super( + type: type, + code: 'ConditionalCheckFailedException', + message: message); +} + class ConflictException extends _s.GenericAwsException { ConflictException({String? type, String? message}) : super(type: type, code: 'ConflictException', message: message); } +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class InvalidInputException extends _s.GenericAwsException { + InvalidInputException({String? type, String? message}) + : super(type: type, code: 'InvalidInputException', message: message); +} + class LimitExceededException extends _s.GenericAwsException { LimitExceededException({String? type, String? message}) : super(type: type, code: 'LimitExceededException', message: message); } +class ResourceAlreadyExistsException extends _s.GenericAwsException { + ResourceAlreadyExistsException({String? type, String? message}) + : super( + type: type, + code: 'ResourceAlreadyExistsException', + message: message); +} + class ResourceNotFoundException extends _s.GenericAwsException { ResourceNotFoundException({String? type, String? message}) : super(type: type, code: 'ResourceNotFoundException', message: message); @@ -1135,6 +3184,35 @@ class ResourceUnavailableException extends _s.GenericAwsException { type: type, code: 'ResourceUnavailableException', message: message); } +class RetryLatestCommitFailedException extends _s.GenericAwsException { + RetryLatestCommitFailedException({String? type, String? message}) + : super( + type: type, + code: 'RetryLatestCommitFailedException', + message: message); +} + +class SyncBlockerDoesNotExistException extends _s.GenericAwsException { + SyncBlockerDoesNotExistException({String? type, String? message}) + : super( + type: type, + code: 'SyncBlockerDoesNotExistException', + message: message); +} + +class SyncConfigurationStillExistsException extends _s.GenericAwsException { + SyncConfigurationStillExistsException({String? type, String? message}) + : super( + type: type, + code: 'SyncConfigurationStillExistsException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + class UnsupportedOperationException extends _s.GenericAwsException { UnsupportedOperationException({String? type, String? message}) : super( @@ -1143,15 +3221,52 @@ class UnsupportedOperationException extends _s.GenericAwsException { message: message); } +class UnsupportedProviderTypeException extends _s.GenericAwsException { + UnsupportedProviderTypeException({String? type, String? message}) + : super( + type: type, + code: 'UnsupportedProviderTypeException', + message: message); +} + +class UpdateOutOfSyncException extends _s.GenericAwsException { + UpdateOutOfSyncException({String? type, String? message}) + : super(type: type, code: 'UpdateOutOfSyncException', message: message); +} + final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConcurrentModificationException': (type, message) => + ConcurrentModificationException(type: type, message: message), + 'ConditionalCheckFailedException': (type, message) => + ConditionalCheckFailedException(type: type, message: message), 'ConflictException': (type, message) => ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'InvalidInputException': (type, message) => + InvalidInputException(type: type, message: message), 'LimitExceededException': (type, message) => LimitExceededException(type: type, message: message), + 'ResourceAlreadyExistsException': (type, message) => + ResourceAlreadyExistsException(type: type, message: message), 'ResourceNotFoundException': (type, message) => ResourceNotFoundException(type: type, message: message), 'ResourceUnavailableException': (type, message) => ResourceUnavailableException(type: type, message: message), + 'RetryLatestCommitFailedException': (type, message) => + RetryLatestCommitFailedException(type: type, message: message), + 'SyncBlockerDoesNotExistException': (type, message) => + SyncBlockerDoesNotExistException(type: type, message: message), + 'SyncConfigurationStillExistsException': (type, message) => + SyncConfigurationStillExistsException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), 'UnsupportedOperationException': (type, message) => UnsupportedOperationException(type: type, message: message), + 'UnsupportedProviderTypeException': (type, message) => + UnsupportedProviderTypeException(type: type, message: message), + 'UpdateOutOfSyncException': (type, message) => + UpdateOutOfSyncException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/codeartifact/v2018_09_22.dart b/aws_client/lib/src/generated/codeartifact/v2018_09_22.dart index 70f1980ad..b9d7ff404 100644 --- a/aws_client/lib/src/generated/codeartifact/v2018_09_22.dart +++ b/aws_client/lib/src/generated/codeartifact/v2018_09_22.dart @@ -27,10 +27,7 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// between a CodeArtifact repository and another repository, which effectively /// merges their contents from the point of view of a package manager client. /// -/// CodeArtifact Components -/// -/// Use the information in this guide to help you work with the following -/// CodeArtifact components: +/// CodeArtifact concepts /// ///
            ///
          • @@ -39,10 +36,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// versions, each of which maps to a set of assets, or files. Repositories /// are polyglot, so a single repository can contain packages of any supported /// type. Each repository exposes endpoints for fetching and publishing packages -/// using tools like the npm CLI, the Maven CLI ( -/// mvn ), Python CLIs ( pip and -/// twine), and NuGet CLIs (nuget and -/// dotnet). +/// using tools such as the npm CLI or the Maven CLI ( +/// mvn ). For a list of supported package managers, see the CodeArtifact +/// User Guide. ///
          • ///
          • /// Domain: Repositories are aggregated into a higher-level entity known @@ -67,15 +64,11 @@ export '../../shared/shared.dart' show AwsClientCredentials; ///
          • /// Package: A package is a bundle of software and the metadata /// required to resolve dependencies and install the software. CodeArtifact -/// supports npm, -/// PyPI, -/// Maven, -/// and NuGet -/// package formats. +/// supports npm, PyPI, Maven, NuGet, Swift, Ruby, and generic package formats. +/// For more information about the supported package formats and how to use +/// CodeArtifact with them, see the CodeArtifact +/// User Guide. /// /// In CodeArtifact, a package consists of: /// @@ -97,6 +90,16 @@ export '../../shared/shared.dart' show AwsClientCredentials; ///
          • ///
        • ///
        • +/// Package group: A group of packages that match a specified definition. +/// Package groups can be used to apply configuration to multiple packages that +/// match a defined pattern using package format, package namespace, and package +/// name. You can use package groups to more conveniently configure package +/// origin controls for multiple packages. Package origin controls are used to +/// block or allow ingestion or publishing of new package versions, which +/// protects users from malicious actions known as dependency substitution +/// attacks. +///
        • +///
        • /// Package version: A version of a package, such as @types/node /// 12.6.9. The version number format and semantics vary for different /// package formats. For example, npm package versions must conform to the ///
        -/// CodeArtifact supports these operations: +/// CodeArtifact supported API operations /// ///
          ///
        • @@ -129,7 +132,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// repository to another repository in the same domain. ///
        • ///
        • -/// CreateDomain: Creates a domain +/// CreateDomain: Creates a domain. +///
        • +///
        • +/// CreatePackageGroup: Creates a package group. ///
        • ///
        • /// CreateRepository: Creates a CodeArtifact repository in a @@ -148,6 +154,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// versions. ///
        • ///
        • +/// DeletePackageGroup: Deletes a package group. Does not delete +/// packages or package versions that are associated with a package group. +///
        • +///
        • /// DeletePackageVersions: Deletes versions of a package. After a /// package has been deleted, it can be republished, but its assets and metadata /// cannot be restored because they have been permanently removed from storage. @@ -169,6 +179,11 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// object that contains details about a package. ///
        • ///
        • +/// DescribePackageGroup: Returns a PackageGroup +/// object that contains details about a package group. +///
        • +///
        • /// DescribePackageVersion: Returns a PackageVersionDescription /// object that contains details about a package version. @@ -188,6 +203,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// connection from a repository. ///
        • ///
        • +/// GetAssociatedPackageGroup: Returns the most closely associated +/// package group to the specified package. +///
        • +///
        • /// GetAuthorizationToken: Generates a temporary authorization /// token for accessing repositories in the domain. The token expires the /// authorization period has passed. The default authorization period is 12 @@ -212,6 +231,9 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// ///
            ///
          • +/// generic +///
          • +///
          • /// maven ///
          • ///
          • @@ -223,12 +245,27 @@ export '../../shared/shared.dart' show AwsClientCredentials; ///
          • /// pypi ///
          • +///
          • +/// ruby +///
          • +///
          • +/// swift +///
          • ///
        • ///
        • /// GetRepositoryPermissionsPolicy: Returns the resource policy /// that is set on a repository. ///
        • ///
        • +/// ListAllowedRepositoriesForGroup: Lists the allowed repositories +/// for a package group that has origin configuration set to +/// ALLOW_SPECIFIC_REPOSITORIES. +///
        • +///
        • +/// ListAssociatedPackages: Returns a list of packages associated +/// with the requested package group. +///
        • +///
        • /// ListDomains: Returns a list of DomainSummary /// objects. Each returned DomainSummary object contains /// information about a domain. @@ -237,6 +274,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// ListPackages: Lists the packages in a repository. ///
        • ///
        • +/// ListPackageGroups: Returns a list of package groups in the +/// requested domain. +///
        • +///
        • /// ListPackageVersionAssets: Lists the assets for a given package /// version. ///
        • @@ -257,6 +298,10 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// a domain. /// ///
        • +/// ListSubPackageGroups: Returns a list of direct children of the +/// specified package group. +///
        • +///
        • /// PublishPackageVersion: Creates a new package version containing /// one or more assets. ///
        • @@ -274,6 +319,14 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// repository that specifies permissions to access it. /// ///
        • +/// UpdatePackageGroup: Updates a package group. This API cannot be +/// used to update a package group's origin configuration or pattern. +///
        • +///
        • +/// UpdatePackageGroupOriginConfiguration: Updates the package +/// origin configuration for a package group. +///
        • +///
        • /// UpdatePackageVersionsStatus: Updates the status of one or more /// versions of a package. ///
        • @@ -441,24 +494,38 @@ class CodeArtifact { /// with upstream repositories. /// /// Parameter [namespace] : - /// The namespace of the package versions to be copied. The package version - /// component that specifies its namespace depends on its type. For example: + /// The namespace of the package versions to be copied. The package component + /// that specifies its namespace depends on its type. For example: + /// + /// The namespace is required when copying package versions of the following + /// formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. The - /// namespace is required when copying Maven package versions. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          /// /// Parameter [versionRevisions] : @@ -586,6 +653,66 @@ class CodeArtifact { return CreateDomainResult.fromJson(response); } + /// Creates a package group. For more information about creating package + /// groups, including example CLI commands, see Create + /// a package group in the CodeArtifact User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The name of the domain in which you want to create a package group. + /// + /// Parameter [packageGroup] : + /// The pattern of the package group to create. The pattern is also the + /// identifier of the package group. + /// + /// Parameter [contactInfo] : + /// The contact information for the created package group. + /// + /// Parameter [description] : + /// A description of the package group. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [tags] : + /// One or more tag key-value pairs for the package group. + Future createPackageGroup({ + required String domain, + required String packageGroup, + String? contactInfo, + String? description, + String? domainOwner, + List? tags, + }) async { + final $query = >{ + 'domain': [domain], + if (domainOwner != null) 'domain-owner': [domainOwner], + }; + final $payload = { + 'packageGroup': packageGroup, + if (contactInfo != null) 'contactInfo': contactInfo, + if (description != null) 'description': description, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v1/package-group', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return CreatePackageGroupResult.fromJson(response); + } + /// Creates a repository. /// /// May throw [AccessDeniedException]. @@ -752,22 +879,35 @@ class CodeArtifact { /// Parameter [namespace] : /// The namespace of the package to delete. The package component that /// specifies its namespace depends on its type. For example: + /// + /// The namespace is required when deleting packages of the following formats: /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. The - /// namespace is required when deleting Maven package versions. + /// Maven + ///
          • + ///
          • + /// Swift + ///
          • + ///
          • + /// generic ///
          • + ///
          + ///
            ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// Python and NuGet packages do not contain corresponding components, - /// packages of those formats do not have a namespace. + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          Future deletePackage({ required String domain, @@ -795,6 +935,50 @@ class CodeArtifact { return DeletePackageResult.fromJson(response); } + /// Deletes a package group. Deleting a package group does not delete packages + /// or package versions associated with the package group. When a package + /// group is deleted, the direct child package groups will become children of + /// the package group's direct parent package group. Therefore, if any of the + /// child groups are inheriting any settings from the parent, those settings + /// could change. + /// + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [domain] : + /// The domain that contains the package group to be deleted. + /// + /// Parameter [packageGroup] : + /// The pattern of the package group to be deleted. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + Future deletePackageGroup({ + required String domain, + required String packageGroup, + String? domainOwner, + }) async { + final $query = >{ + 'domain': [domain], + 'package-group': [packageGroup], + if (domainOwner != null) 'domain-owner': [domainOwner], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/v1/package-group', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeletePackageGroupResult.fromJson(response); + } + /// Deletes one or more versions of a package. A deleted package version /// cannot be restored in your repository. If you want to remove a package /// version from your repository and be able to restore it later, set its @@ -835,24 +1019,38 @@ class CodeArtifact { /// The expected status of the package version to delete. /// /// Parameter [namespace] : - /// The namespace of the package versions to be deleted. The package version - /// component that specifies its namespace depends on its type. For example: + /// The namespace of the package versions to be deleted. The package component + /// that specifies its namespace depends on its type. For example: + /// + /// The namespace is required when deleting package versions of the following + /// formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. The - /// namespace is required when deleting Maven package versions. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          Future deletePackageVersions({ required String domain, @@ -1045,22 +1243,36 @@ class CodeArtifact { /// Parameter [namespace] : /// The namespace of the requested package. The package component that /// specifies its namespace depends on its type. For example: + /// + /// The namespace is required when requesting packages of the following + /// formats: /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. The - /// namespace is required when requesting Maven packages. + /// Maven ///
          • ///
          • - /// The namespace of an npm package is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, - /// packages of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          Future describePackage({ required String domain, @@ -1088,6 +1300,45 @@ class CodeArtifact { return DescribePackageResult.fromJson(response); } + /// Returns a PackageGroupDescription + /// object that contains information about the requested package group. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The name of the domain that contains the package group. + /// + /// Parameter [packageGroup] : + /// The pattern of the requested package group. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + Future describePackageGroup({ + required String domain, + required String packageGroup, + String? domainOwner, + }) async { + final $query = >{ + 'domain': [domain], + 'package-group': [packageGroup], + if (domainOwner != null) 'domain-owner': [domainOwner], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/package-group', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DescribePackageGroupResult.fromJson(response); + } + /// Returns a PackageVersionDescription /// object that contains information about the requested package version. @@ -1121,23 +1372,38 @@ class CodeArtifact { /// the domain. It does not include dashes or spaces. /// /// Parameter [namespace] : - /// The namespace of the requested package version. The package version - /// component that specifies its namespace depends on its type. For example: + /// The namespace of the requested package version. The package component that + /// specifies its namespace depends on its type. For example: + /// + /// The namespace is required when requesting package versions of the + /// following formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          Future describePackageVersion({ required String domain, @@ -1295,23 +1561,38 @@ class CodeArtifact { /// The expected status of the package version to dispose. /// /// Parameter [namespace] : - /// The namespace of the package versions to be disposed. The package version + /// The namespace of the package versions to be disposed. The package /// component that specifies its namespace depends on its type. For example: + /// + /// The namespace is required when disposing package versions of the following + /// formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          /// /// Parameter [versionRevisions] : @@ -1350,69 +1631,159 @@ class CodeArtifact { return DisposePackageVersionsResult.fromJson(response); } - /// Generates a temporary authorization token for accessing repositories in - /// the domain. This API requires the - /// codeartifact:GetAuthorizationToken and - /// sts:GetServiceBearerToken permissions. For more information - /// about authorization tokens, see CodeArtifact - /// authentication and tokens. - /// - /// CodeArtifact authorization tokens are valid for a period of 12 hours when - /// created with the login command. You can call - /// login periodically to refresh the token. When you create an - /// authorization token with the GetAuthorizationToken API, you - /// can set a custom authorization period, up to a maximum of 12 hours, with - /// the durationSeconds parameter. - /// - /// The authorization period begins after login or - /// GetAuthorizationToken is called. If login or - /// GetAuthorizationToken is called while assuming a role, the - /// token lifetime is independent of the maximum session duration of the role. - /// For example, if you call sts assume-role and specify a - /// session duration of 15 minutes, then generate a CodeArtifact authorization - /// token, the token will be valid for the full authorization period even - /// though this is longer than the 15-minute session duration. + /// Returns the most closely associated package group to the specified + /// package. This API does not require that the package exist in any + /// repository in the domain. As such, GetAssociatedPackageGroup + /// can be used to see which package group's origin configuration applies to a + /// package before that package is in a repository. This can be helpful to + /// check if public packages are blocked without ingesting them. /// - /// See Using - /// IAM Roles for more information on controlling session duration. - /// + /// For information package group association and matching, see Package + /// group definition syntax and matching behavior in the CodeArtifact + /// User Guide. /// /// May throw [AccessDeniedException]. /// May throw [InternalServerException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. /// /// Parameter [domain] : - /// The name of the domain that is in scope for the generated authorization - /// token. + /// The name of the domain that contains the package from which to get the + /// associated package group. + /// + /// Parameter [format] : + /// The format of the package from which to get the associated package group. + /// + /// Parameter [package] : + /// The package from which to get the associated package group. /// /// Parameter [domainOwner] : /// The 12-digit account number of the Amazon Web Services account that owns /// the domain. It does not include dashes or spaces. /// - /// Parameter [durationSeconds] : - /// The time, in seconds, that the generated authorization token is valid. - /// Valid values are 0 and any number between 900 - /// (15 minutes) and 43200 (12 hours). A value of 0 - /// will set the expiration of the authorization token to the same expiration - /// of the user's role's temporary credentials. - Future getAuthorizationToken({ - required String domain, - String? domainOwner, - int? durationSeconds, - }) async { - _s.validateNumRange( - 'durationSeconds', - durationSeconds, - 0, - 43200, - ); - final $query = >{ - 'domain': [domain], - if (domainOwner != null) 'domain-owner': [domainOwner], + /// Parameter [namespace] : + /// The namespace of the package from which to get the associated package + /// group. The package component that specifies its namespace depends on its + /// type. For example: + /// + /// The namespace is required when getting associated package groups from + /// packages of the following formats: + /// + ///
            + ///
          • + /// Maven + ///
          • + ///
          • + /// Swift + ///
          • + ///
          • + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • + ///
          + Future getAssociatedPackageGroup({ + required String domain, + required PackageFormat format, + required String package, + String? domainOwner, + String? namespace, + }) async { + final $query = >{ + 'domain': [domain], + 'format': [format.toValue()], + 'package': [package], + if (domainOwner != null) 'domain-owner': [domainOwner], + if (namespace != null) 'namespace': [namespace], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v1/get-associated-package-group', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetAssociatedPackageGroupResult.fromJson(response); + } + + /// Generates a temporary authorization token for accessing repositories in + /// the domain. This API requires the + /// codeartifact:GetAuthorizationToken and + /// sts:GetServiceBearerToken permissions. For more information + /// about authorization tokens, see CodeArtifact + /// authentication and tokens. + /// + /// CodeArtifact authorization tokens are valid for a period of 12 hours when + /// created with the login command. You can call + /// login periodically to refresh the token. When you create an + /// authorization token with the GetAuthorizationToken API, you + /// can set a custom authorization period, up to a maximum of 12 hours, with + /// the durationSeconds parameter. + /// + /// The authorization period begins after login or + /// GetAuthorizationToken is called. If login or + /// GetAuthorizationToken is called while assuming a role, the + /// token lifetime is independent of the maximum session duration of the role. + /// For example, if you call sts assume-role and specify a + /// session duration of 15 minutes, then generate a CodeArtifact authorization + /// token, the token will be valid for the full authorization period even + /// though this is longer than the 15-minute session duration. + /// + /// See Using + /// IAM Roles for more information on controlling session duration. + /// + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [domain] : + /// The name of the domain that is in scope for the generated authorization + /// token. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [durationSeconds] : + /// The time, in seconds, that the generated authorization token is valid. + /// Valid values are 0 and any number between 900 + /// (15 minutes) and 43200 (12 hours). A value of 0 + /// will set the expiration of the authorization token to the same expiration + /// of the user's role's temporary credentials. + Future getAuthorizationToken({ + required String domain, + String? domainOwner, + int? durationSeconds, + }) async { + _s.validateNumRange( + 'durationSeconds', + durationSeconds, + 0, + 43200, + ); + final $query = >{ + 'domain': [domain], + if (domainOwner != null) 'domain-owner': [domainOwner], if (durationSeconds != null) 'duration': [durationSeconds.toString()], }; final response = await _protocol.send( @@ -1502,23 +1873,38 @@ class CodeArtifact { /// /// Parameter [namespace] : /// The namespace of the package version with the requested asset file. The - /// package version component that specifies its namespace depends on its - /// type. For example: + /// package component that specifies its namespace depends on its type. For + /// example: + /// + /// The namespace is required when requesting assets from package versions of + /// the following formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          /// /// Parameter [packageVersionRevision] : @@ -1598,15 +1984,36 @@ class CodeArtifact { /// /// Parameter [namespace] : /// The namespace of the package version with the requested readme file. The - /// package version component that specifies its namespace depends on its - /// type. For example: + /// package component that specifies its namespace depends on its type. For + /// example: + /// + /// The namespace is required when requesting the readme from package versions + /// of the following formats: /// ///
            ///
          • - /// The namespace of an npm package version is its scope. + /// Maven + ///
          • + ///
          • + /// Swift + ///
          • + ///
          • + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding + /// Python, NuGet, and Ruby package versions do not contain a corresponding /// component, package versions of those formats do not have a namespace. ///
          • ///
          @@ -1643,6 +2050,9 @@ class CodeArtifact { /// ///
            ///
          • + /// generic + ///
          • + ///
          • /// maven ///
          • ///
          • @@ -1654,6 +2064,12 @@ class CodeArtifact { ///
          • /// pypi ///
          • + ///
          • + /// ruby + ///
          • + ///
          • + /// swift + ///
          • ///
          /// /// May throw [AccessDeniedException]. @@ -1737,16 +2153,33 @@ class CodeArtifact { return GetRepositoryPermissionsPolicyResult.fromJson(response); } - /// Returns a list of DomainSummary - /// objects for all domains owned by the Amazon Web Services account that - /// makes this call. Each returned DomainSummary object contains - /// information about a domain. + /// Lists the repositories in the added repositories list of the specified + /// restriction type for a package group. For more information about + /// restriction types and added repository lists, see Package + /// group origin controls in the CodeArtifact User Guide. /// /// May throw [AccessDeniedException]. /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [ThrottlingException]. /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The name of the domain that contains the package group from which to list + /// allowed repositories. + /// + /// Parameter [originRestrictionType] : + /// The origin configuration restriction type of which to list allowed + /// repositories. + /// + /// Parameter [packageGroup] : + /// The pattern of the package group from which to list allowed repositories. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. /// /// Parameter [maxResults] : /// The maximum number of results to return per page. @@ -1754,7 +2187,12 @@ class CodeArtifact { /// Parameter [nextToken] : /// The token for the next set of results. Use the value returned in the /// previous response in the next request to retrieve the next set of results. - Future listDomains({ + Future + listAllowedRepositoriesForGroup({ + required String domain, + required PackageGroupOriginRestrictionType originRestrictionType, + required String packageGroup, + String? domainOwner, int? maxResults, String? nextToken, }) async { @@ -1764,48 +2202,41 @@ class CodeArtifact { 1, 1000, ); - final $payload = { - if (maxResults != null) 'maxResults': maxResults, - if (nextToken != null) 'nextToken': nextToken, + final $query = >{ + 'domain': [domain], + 'originRestrictionType': [originRestrictionType.toValue()], + 'package-group': [packageGroup], + if (domainOwner != null) 'domain-owner': [domainOwner], + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], }; final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/v1/domains', + payload: null, + method: 'GET', + requestUri: '/v1/package-group-allowed-repositories', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListDomainsResult.fromJson(response); + return ListAllowedRepositoriesForGroupResult.fromJson(response); } - /// Returns a list of AssetSummary - /// objects for assets in a package version. + /// Returns a list of packages associated with the requested package group. + /// For information package group association and matching, see Package + /// group definition syntax and matching behavior in the CodeArtifact + /// User Guide. /// /// May throw [AccessDeniedException]. /// May throw [InternalServerException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. /// /// Parameter [domain] : - /// The name of the domain that contains the repository associated with the - /// package version assets. - /// - /// Parameter [format] : - /// The format of the package that contains the requested package version - /// assets. - /// - /// Parameter [package] : - /// The name of the package that contains the requested package version - /// assets. - /// - /// Parameter [packageVersion] : - /// A string that contains the package version (for example, - /// 3.5.2). + /// The name of the domain that contains the package group from which to list + /// associated packages. /// - /// Parameter [repository] : - /// The name of the repository that contains the package that contains the - /// requested package version assets. + /// Parameter [packageGroup] : + /// The pattern of the package group from which to list associated packages. /// /// Parameter [domainOwner] : /// The 12-digit account number of the Amazon Web Services account that owns @@ -1814,40 +2245,21 @@ class CodeArtifact { /// Parameter [maxResults] : /// The maximum number of results to return per page. /// - /// Parameter [namespace] : - /// The namespace of the package version that contains the requested package - /// version assets. The package version component that specifies its namespace - /// depends on its type. For example: - /// - ///
            - ///
          • - /// The namespace of a Maven package version is its groupId. - ///
          • - ///
          • - /// The namespace of an npm package version is its scope. - ///
          • - ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. - ///
          • - ///
          • - /// The namespace of a generic package is its namespace. - ///
          • - ///
          - /// /// Parameter [nextToken] : /// The token for the next set of results. Use the value returned in the /// previous response in the next request to retrieve the next set of results. - Future listPackageVersionAssets({ + /// + /// Parameter [preview] : + /// When this flag is included, ListAssociatedPackages will + /// return a list of packages that would be associated with a package group, + /// even if it does not exist. + Future listAssociatedPackages({ required String domain, - required PackageFormat format, - required String package, - required String packageVersion, - required String repository, + required String packageGroup, String? domainOwner, int? maxResults, - String? namespace, String? nextToken, + bool? preview, }) async { _s.validateNumRange( 'maxResults', @@ -1857,46 +2269,253 @@ class CodeArtifact { ); final $query = >{ 'domain': [domain], - 'format': [format.toValue()], - 'package': [package], - 'version': [packageVersion], - 'repository': [repository], + 'package-group': [packageGroup], if (domainOwner != null) 'domain-owner': [domainOwner], if (maxResults != null) 'max-results': [maxResults.toString()], - if (namespace != null) 'namespace': [namespace], if (nextToken != null) 'next-token': [nextToken], + if (preview != null) 'preview': [preview.toString()], }; final response = await _protocol.send( payload: null, - method: 'POST', - requestUri: '/v1/package/version/assets', + method: 'GET', + requestUri: '/v1/list-associated-packages', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListPackageVersionAssetsResult.fromJson(response); + return ListAssociatedPackagesResult.fromJson(response); } - /// Returns the direct dependencies for a package version. The dependencies - /// are returned as PackageDependency - /// objects. CodeArtifact extracts the dependencies for a package version from - /// the metadata file for the package format (for example, the - /// package.json file for npm packages and the - /// pom.xml file for Maven). Any package version dependencies - /// that are not listed in the configuration file are not returned. + /// Returns a list of DomainSummary + /// objects for all domains owned by the Amazon Web Services account that + /// makes this call. Each returned DomainSummary object contains + /// information about a domain. /// /// May throw [AccessDeniedException]. /// May throw [InternalServerException]. - /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [ValidationException]. /// - /// Parameter [domain] : - /// The name of the domain that contains the repository that contains the - /// requested package version dependencies. - /// - /// Parameter [format] : - /// The format of the package with the requested dependencies. + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listDomains({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v1/domains', + exceptionFnMap: _exceptionFns, + ); + return ListDomainsResult.fromJson(response); + } + + /// Returns a list of package groups in the requested domain. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The domain for which you want to list package groups. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + /// + /// Parameter [prefix] : + /// A prefix for which to search package groups. When included, + /// ListPackageGroups will return only package groups with + /// patterns that match the prefix. + Future listPackageGroups({ + required String domain, + String? domainOwner, + int? maxResults, + String? nextToken, + String? prefix, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + 'domain': [domain], + if (domainOwner != null) 'domain-owner': [domainOwner], + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + if (prefix != null) 'prefix': [prefix], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/v1/package-groups', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListPackageGroupsResult.fromJson(response); + } + + /// Returns a list of AssetSummary + /// objects for assets in a package version. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [domain] : + /// The name of the domain that contains the repository associated with the + /// package version assets. + /// + /// Parameter [format] : + /// The format of the package that contains the requested package version + /// assets. + /// + /// Parameter [package] : + /// The name of the package that contains the requested package version + /// assets. + /// + /// Parameter [packageVersion] : + /// A string that contains the package version (for example, + /// 3.5.2). + /// + /// Parameter [repository] : + /// The name of the repository that contains the package that contains the + /// requested package version assets. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [namespace] : + /// The namespace of the package version that contains the requested package + /// version assets. The package component that specifies its namespace depends + /// on its type. For example: + /// + /// The namespace is required requesting assets from package versions of the + /// following formats: + /// + ///
            + ///
          • + /// Maven + ///
          • + ///
          • + /// Swift + ///
          • + ///
          • + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • + ///
          + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listPackageVersionAssets({ + required String domain, + required PackageFormat format, + required String package, + required String packageVersion, + required String repository, + String? domainOwner, + int? maxResults, + String? namespace, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + 'domain': [domain], + 'format': [format.toValue()], + 'package': [package], + 'version': [packageVersion], + 'repository': [repository], + if (domainOwner != null) 'domain-owner': [domainOwner], + if (maxResults != null) 'max-results': [maxResults.toString()], + if (namespace != null) 'namespace': [namespace], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/v1/package/version/assets', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListPackageVersionAssetsResult.fromJson(response); + } + + /// Returns the direct dependencies for a package version. The dependencies + /// are returned as PackageDependency + /// objects. CodeArtifact extracts the dependencies for a package version from + /// the metadata file for the package format (for example, the + /// package.json file for npm packages and the + /// pom.xml file for Maven). Any package version dependencies + /// that are not listed in the configuration file are not returned. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [domain] : + /// The name of the domain that contains the repository that contains the + /// requested package version dependencies. + /// + /// Parameter [format] : + /// The format of the package with the requested dependencies. /// /// Parameter [package] : /// The name of the package versions' package. @@ -1914,23 +2533,38 @@ class CodeArtifact { /// /// Parameter [namespace] : /// The namespace of the package version with the requested dependencies. The - /// package version component that specifies its namespace depends on its - /// type. For example: + /// package component that specifies its namespace depends on its type. For + /// example: + /// + /// The namespace is required when listing dependencies from package versions + /// of the following formats: /// ///
            ///
          • - /// The namespace of a Maven package version is its groupId. + /// Maven ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// Swift ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// generic + ///
          • + ///
          + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          /// /// Parameter [nextToken] : @@ -2003,21 +2637,36 @@ class CodeArtifact { /// The namespace of the package that contains the requested package versions. /// The package component that specifies its namespace depends on its type. /// For example: + /// + /// The namespace is required when deleting package versions of the following + /// formats: /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. + /// Maven + ///
          • + ///
          • + /// Swift + ///
          • + ///
          • + /// generic ///
          • + ///
          + ///
            ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, - /// packages of those formats do not have a namespace. + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • /// The namespace of a generic package is its namespace. ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • ///
          /// /// Parameter [nextToken] : @@ -2113,17 +2762,18 @@ class CodeArtifact { /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, - /// packages of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// The namespace of a generic package is its namespace. + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          /// @@ -2298,40 +2948,100 @@ class CodeArtifact { return ListRepositoriesInDomainResult.fromJson(response); } - /// Gets information about Amazon Web Services tags for a specified Amazon - /// Resource Name (ARN) in CodeArtifact. + /// Returns a list of direct children of the specified package group. + /// + /// For information package group hierarchy, see Package + /// group definition syntax and matching behavior in the CodeArtifact + /// User Guide. /// /// May throw [AccessDeniedException]. - /// May throw [ResourceNotFoundException]. + /// May throw [InternalServerException]. /// May throw [ThrottlingException]. /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource to get tags for. - Future listTagsForResource({ - required String resourceArn, - }) async { - final $query = >{ - 'resourceArn': [resourceArn], - }; - final response = await _protocol.send( - payload: null, - method: 'POST', - requestUri: '/v1/tags', - queryParams: $query, - exceptionFnMap: _exceptionFns, - ); - return ListTagsForResourceResult.fromJson(response); - } - - /// Creates a new package version containing one or more assets (or files). + /// Parameter [domain] : + /// The name of the domain which contains the package group from which to list + /// sub package groups. /// - /// The unfinished flag can be used to keep the package version - /// in the Unfinished state until all of its assets have been - /// uploaded (see Package - /// version status in the CodeArtifact user guide). To set the - /// package version’s status to Published, omit the + /// Parameter [packageGroup] : + /// The pattern of the package group from which to list sub package groups. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listSubPackageGroups({ + required String domain, + required String packageGroup, + String? domainOwner, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + 'domain': [domain], + 'package-group': [packageGroup], + if (domainOwner != null) 'domain-owner': [domainOwner], + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/v1/package-groups/sub-groups', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSubPackageGroupsResult.fromJson(response); + } + + /// Gets information about Amazon Web Services tags for a specified Amazon + /// Resource Name (ARN) in CodeArtifact. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource to get tags for. + Future listTagsForResource({ + required String resourceArn, + }) async { + final $query = >{ + 'resourceArn': [resourceArn], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/v1/tags', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResult.fromJson(response); + } + + /// Creates a new package version containing one or more assets (or files). + /// + /// The unfinished flag can be used to keep the package version + /// in the Unfinished state until all of its assets have been + /// uploaded (see Package + /// version status in the CodeArtifact user guide). To set the + /// package version’s status to Published, omit the /// unfinished flag when uploading the final asset, or set the /// status using UpdatePackageVersionStatus. @@ -2377,6 +3087,8 @@ class CodeArtifact { /// A format that specifies the type of the package version with the requested /// asset file. /// + /// The only supported value is generic. + /// /// Parameter [package] : /// The name of the package version to publish. /// @@ -2552,17 +3264,18 @@ class CodeArtifact { /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, - /// packages of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// The namespace of a generic package is its namespace. + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          Future putPackageOriginConfiguration({ @@ -2723,6 +3436,134 @@ class CodeArtifact { ); } + /// Updates a package group. This API cannot be used to update a package + /// group's origin configuration or pattern. To update a package group's + /// origin configuration, use UpdatePackageGroupOriginConfiguration. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The name of the domain which contains the package group to be updated. + /// + /// Parameter [packageGroup] : + /// The pattern of the package group to be updated. + /// + /// Parameter [contactInfo] : + /// Contact information which you want to update the requested package group + /// with. + /// + /// Parameter [description] : + /// The description you want to update the requested package group with. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + Future updatePackageGroup({ + required String domain, + required String packageGroup, + String? contactInfo, + String? description, + String? domainOwner, + }) async { + final $query = >{ + 'domain': [domain], + if (domainOwner != null) 'domain-owner': [domainOwner], + }; + final $payload = { + 'packageGroup': packageGroup, + if (contactInfo != null) 'contactInfo': contactInfo, + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/v1/package-group', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return UpdatePackageGroupResult.fromJson(response); + } + + /// Updates the package origin configuration for a package group. + /// + /// The package origin configuration determines how new versions of a package + /// can be added to a repository. You can allow or block direct publishing of + /// new package versions, or ingestion and retaining of new package versions + /// from an external connection or upstream source. For more information about + /// package group origin controls and configuration, see Package + /// group origin controls in the CodeArtifact User Guide. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [domain] : + /// The name of the domain which contains the package group for which to + /// update the origin configuration. + /// + /// Parameter [packageGroup] : + /// The pattern of the package group for which to update the origin + /// configuration. + /// + /// Parameter [addAllowedRepositories] : + /// The repository name and restrictions to add to the allowed repository list + /// of the specified package group. + /// + /// Parameter [domainOwner] : + /// The 12-digit account number of the Amazon Web Services account that owns + /// the domain. It does not include dashes or spaces. + /// + /// Parameter [removeAllowedRepositories] : + /// The repository name and restrictions to remove from the allowed repository + /// list of the specified package group. + /// + /// Parameter [restrictions] : + /// The origin configuration settings that determine how package versions can + /// enter repositories. + Future + updatePackageGroupOriginConfiguration({ + required String domain, + required String packageGroup, + List? addAllowedRepositories, + String? domainOwner, + List? removeAllowedRepositories, + Map? + restrictions, + }) async { + final $query = >{ + 'domain': [domain], + 'package-group': [packageGroup], + if (domainOwner != null) 'domain-owner': [domainOwner], + }; + final $payload = { + if (addAllowedRepositories != null) + 'addAllowedRepositories': addAllowedRepositories, + if (removeAllowedRepositories != null) + 'removeAllowedRepositories': removeAllowedRepositories, + if (restrictions != null) + 'restrictions': + restrictions.map((k, e) => MapEntry(k.toValue(), e.toValue())), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/v1/package-group-origin-configuration', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return UpdatePackageGroupOriginConfigurationResult.fromJson(response); + } + /// Updates the status of one or more versions of a package. Using /// UpdatePackageVersionsStatus, you can update the status of /// package versions to Archived, Published, or @@ -2771,22 +3612,23 @@ class CodeArtifact { /// expectedStatus. /// /// Parameter [namespace] : - /// The namespace of the package version to be updated. The package version - /// component that specifies its namespace depends on its type. For example: + /// The namespace of the package version to be updated. The package component + /// that specifies its namespace depends on its type. For example: /// ///
            ///
          • /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// The namespace of an npm or Swift package version is its + /// scope. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding - /// component, package versions of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// The namespace of a generic package is its namespace. + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          /// @@ -3008,6 +3850,75 @@ class AssociateExternalConnectionResult { } } +/// A package associated with a package group. +class AssociatedPackage { + /// Describes the strength of the association between the package and package + /// group. A strong match can be thought of as an exact match, and a weak match + /// can be thought of as a variation match, for example, the package name + /// matches a variation of the package group pattern. For more information about + /// package group pattern matching, including strong and weak matches, see Package + /// group definition syntax and matching behavior in the CodeArtifact + /// User Guide. + final PackageGroupAssociationType? associationType; + + /// A format that specifies the type of the associated package. + final PackageFormat? format; + + /// The namespace of the associated package. The package component that + /// specifies its namespace depends on its type. For example: + /// + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • + ///
          + final String? namespace; + + /// The name of the associated package. + final String? package; + + AssociatedPackage({ + this.associationType, + this.format, + this.namespace, + this.package, + }); + + factory AssociatedPackage.fromJson(Map json) { + return AssociatedPackage( + associationType: + (json['associationType'] as String?)?.toPackageGroupAssociationType(), + format: (json['format'] as String?)?.toPackageFormat(), + namespace: json['namespace'] as String?, + package: json['package'] as String?, + ); + } + + Map toJson() { + final associationType = this.associationType; + final format = this.format; + final namespace = this.namespace; + final package = this.package; + return { + if (associationType != null) 'associationType': associationType.toValue(), + if (format != null) 'format': format.toValue(), + if (namespace != null) 'namespace': namespace, + if (package != null) 'package': package, + }; + } +} + class CopyPackageVersionsResult { /// A map of package versions that failed to copy and their error codes. The /// possible error codes are in the PackageVersionError data type. @@ -3091,6 +4002,31 @@ class CreateDomainResult { } } +class CreatePackageGroupResult { + /// Information about the created package group after processing the request. + final PackageGroupDescription? packageGroup; + + CreatePackageGroupResult({ + this.packageGroup, + }); + + factory CreatePackageGroupResult.fromJson(Map json) { + return CreatePackageGroupResult( + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final packageGroup = this.packageGroup; + return { + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + class CreateRepositoryResult { /// Information about the created repository after processing the request. final RepositoryDescription? repository; @@ -3165,6 +4101,31 @@ class DeleteDomainResult { } } +class DeletePackageGroupResult { + /// Information about the deleted package group after processing the request. + final PackageGroupDescription? packageGroup; + + DeletePackageGroupResult({ + this.packageGroup, + }); + + factory DeletePackageGroupResult.fromJson(Map json) { + return DeletePackageGroupResult( + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final packageGroup = this.packageGroup; + return { + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + class DeletePackageResult { final PackageSummary? deletedPackage; @@ -3320,6 +4281,33 @@ class DescribeDomainResult { } } +class DescribePackageGroupResult { + /// A PackageGroupDescription + /// object that contains information about the requested package group. + final PackageGroupDescription? packageGroup; + + DescribePackageGroupResult({ + this.packageGroup, + }); + + factory DescribePackageGroupResult.fromJson(Map json) { + return DescribePackageGroupResult( + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final packageGroup = this.packageGroup; + return { + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + class DescribePackageResult { /// A PackageDescription @@ -3567,6 +4555,12 @@ class DomainDescription { /// repository, the entry point is the external connection that it was ingested /// from. An external connection is a CodeArtifact repository that is connected /// to an external repository such as the npm registry or NuGet gallery. +/// +/// If a package version exists in a repository and is updated, for example if a +/// package of the same version is added with additional assets, the package +/// version's DomainEntryPoint will not change from the original +/// package version's value. +/// class DomainEntryPoint { /// The name of the external connection that a package was ingested from. final String? externalConnectionName; @@ -3710,6 +4704,41 @@ extension ExternalConnectionStatusFromString on String { } } +class GetAssociatedPackageGroupResult { + /// Describes the strength of the association between the package and package + /// group. A strong match is also known as an exact match, and a weak match is + /// known as a relative match. + final PackageGroupAssociationType? associationType; + + /// The package group that is associated with the requested package. + final PackageGroupDescription? packageGroup; + + GetAssociatedPackageGroupResult({ + this.associationType, + this.packageGroup, + }); + + factory GetAssociatedPackageGroupResult.fromJson(Map json) { + return GetAssociatedPackageGroupResult( + associationType: + (json['associationType'] as String?)?.toPackageGroupAssociationType(), + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final associationType = this.associationType; + final packageGroup = this.packageGroup; + return { + if (associationType != null) 'associationType': associationType.toValue(), + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + class GetAuthorizationTokenResult { /// The returned authentication token. final String? authorizationToken; @@ -3801,19 +4830,22 @@ class GetPackageVersionReadmeResult { final PackageFormat? format; /// The namespace of the package version with the requested readme file. The - /// package version component that specifies its namespace depends on its type. - /// For example: + /// package component that specifies its namespace depends on its type. For + /// example: /// ///
            ///
          • /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding component, - /// package versions of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -3983,6 +5015,75 @@ class LicenseInfo { } } +class ListAllowedRepositoriesForGroupResult { + /// The list of allowed repositories for the package group and origin + /// configuration restriction type. + final List? allowedRepositories; + + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; + + ListAllowedRepositoriesForGroupResult({ + this.allowedRepositories, + this.nextToken, + }); + + factory ListAllowedRepositoriesForGroupResult.fromJson( + Map json) { + return ListAllowedRepositoriesForGroupResult( + allowedRepositories: (json['allowedRepositories'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final allowedRepositories = this.allowedRepositories; + final nextToken = this.nextToken; + return { + if (allowedRepositories != null) + 'allowedRepositories': allowedRepositories, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListAssociatedPackagesResult { + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; + + /// The list of packages associated with the requested package group. + final List? packages; + + ListAssociatedPackagesResult({ + this.nextToken, + this.packages, + }); + + factory ListAssociatedPackagesResult.fromJson(Map json) { + return ListAssociatedPackagesResult( + nextToken: json['nextToken'] as String?, + packages: (json['packages'] as List?) + ?.whereNotNull() + .map((e) => AssociatedPackage.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final packages = this.packages; + return { + if (nextToken != null) 'nextToken': nextToken, + if (packages != null) 'packages': packages, + }; + } +} + class ListDomainsResult { /// The returned list of DomainSummary @@ -4018,6 +5119,39 @@ class ListDomainsResult { } } +class ListPackageGroupsResult { + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; + + /// The list of package groups in the requested domain. + final List? packageGroups; + + ListPackageGroupsResult({ + this.nextToken, + this.packageGroups, + }); + + factory ListPackageGroupsResult.fromJson(Map json) { + return ListPackageGroupsResult( + nextToken: json['nextToken'] as String?, + packageGroups: (json['packageGroups'] as List?) + ?.whereNotNull() + .map((e) => PackageGroupSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final packageGroups = this.packageGroups; + return { + if (nextToken != null) 'nextToken': nextToken, + if (packageGroups != null) 'packageGroups': packageGroups, + }; + } +} + class ListPackageVersionAssetsResult { /// The returned list of AssetSummary @@ -4029,19 +5163,22 @@ class ListPackageVersionAssetsResult { final PackageFormat? format; /// The namespace of the package version that contains the requested package - /// version assets. The package version component that specifies its namespace - /// depends on its type. For example: + /// version assets. The package component that specifies its namespace depends + /// on its type. For example: /// ///
            ///
          • /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding component, - /// package versions of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -4115,19 +5252,22 @@ class ListPackageVersionDependenciesResult { final PackageFormat? format; /// The namespace of the package version that contains the returned - /// dependencies. The package version component that specifies its namespace - /// depends on its type. For example: + /// dependencies. The package component that specifies its namespace depends on + /// its type. For example: /// ///
            ///
          • /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding component, - /// package versions of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -4217,14 +5357,17 @@ class ListPackageVersionsResult { /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, packages - /// of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -4386,6 +5529,39 @@ class ListRepositoriesResult { } } +class ListSubPackageGroupsResult { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// A list of sub package groups for the requested package group. + final List? packageGroups; + + ListSubPackageGroupsResult({ + this.nextToken, + this.packageGroups, + }); + + factory ListSubPackageGroupsResult.fromJson(Map json) { + return ListSubPackageGroupsResult( + nextToken: json['nextToken'] as String?, + packageGroups: (json['packageGroups'] as List?) + ?.whereNotNull() + .map((e) => PackageGroupSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final packageGroups = this.packageGroups; + return { + if (nextToken != null) 'nextToken': nextToken, + if (packageGroups != null) 'packageGroups': packageGroups, + }; + } +} + class ListTagsForResourceResult { /// A list of tag key and value pairs associated with the specified resource. final List? tags; @@ -4404,206 +5580,681 @@ class ListTagsForResourceResult { } Map toJson() { - final tags = this.tags; + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +/// Details about a package dependency. +class PackageDependency { + /// The type of a package dependency. The possible values depend on the package + /// type. + /// + ///
            + ///
          • + /// npm: regular, dev, peer, + /// optional + ///
          • + ///
          • + /// maven: optional, parent, compile, + /// runtime, test, system, + /// provided. + /// + /// Note that parent is not a regular Maven dependency type; + /// instead this is extracted from the <parent> element if + /// one is defined in the package version's POM file. + ///
          • + ///
          • + /// nuget: The dependencyType field is never set for NuGet + /// packages. + ///
          • + ///
          • + /// pypi: Requires-Dist + ///
          • + ///
          + final String? dependencyType; + + /// The namespace of the package that this package depends on. The package + /// component that specifies its namespace depends on its type. For example: + /// + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • + ///
          + final String? namespace; + + /// The name of the package that this package depends on. + final String? package; + + /// The required version, or version range, of the package that this package + /// depends on. The version format is specific to the package type. For example, + /// the following are possible valid required versions: 1.2.3, + /// ^2.3.4, or 4.x. + final String? versionRequirement; + + PackageDependency({ + this.dependencyType, + this.namespace, + this.package, + this.versionRequirement, + }); + + factory PackageDependency.fromJson(Map json) { + return PackageDependency( + dependencyType: json['dependencyType'] as String?, + namespace: json['namespace'] as String?, + package: json['package'] as String?, + versionRequirement: json['versionRequirement'] as String?, + ); + } + + Map toJson() { + final dependencyType = this.dependencyType; + final namespace = this.namespace; + final package = this.package; + final versionRequirement = this.versionRequirement; + return { + if (dependencyType != null) 'dependencyType': dependencyType, + if (namespace != null) 'namespace': namespace, + if (package != null) 'package': package, + if (versionRequirement != null) 'versionRequirement': versionRequirement, + }; + } +} + +/// Details about a package. +class PackageDescription { + /// A format that specifies the type of the package. + final PackageFormat? format; + + /// The name of the package. + final String? name; + + /// The namespace of the package. The package component that specifies its + /// namespace depends on its type. For example: + /// + ///
            + ///
          • + /// The namespace of a Maven package version is its groupId. + ///
          • + ///
          • + /// The namespace of an npm or Swift package version is its scope. + ///
          • + ///
          • + /// The namespace of a generic package is its namespace. + ///
          • + ///
          • + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. + ///
          • + ///
          + final String? namespace; + + /// The package origin configuration for the package. + final PackageOriginConfiguration? originConfiguration; + + PackageDescription({ + this.format, + this.name, + this.namespace, + this.originConfiguration, + }); + + factory PackageDescription.fromJson(Map json) { + return PackageDescription( + format: (json['format'] as String?)?.toPackageFormat(), + name: json['name'] as String?, + namespace: json['namespace'] as String?, + originConfiguration: json['originConfiguration'] != null + ? PackageOriginConfiguration.fromJson( + json['originConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final format = this.format; + final name = this.name; + final namespace = this.namespace; + final originConfiguration = this.originConfiguration; + return { + if (format != null) 'format': format.toValue(), + if (name != null) 'name': name, + if (namespace != null) 'namespace': namespace, + if (originConfiguration != null) + 'originConfiguration': originConfiguration, + }; + } +} + +enum PackageFormat { + npm, + pypi, + maven, + nuget, + generic, + ruby, + swift, +} + +extension PackageFormatValueExtension on PackageFormat { + String toValue() { + switch (this) { + case PackageFormat.npm: + return 'npm'; + case PackageFormat.pypi: + return 'pypi'; + case PackageFormat.maven: + return 'maven'; + case PackageFormat.nuget: + return 'nuget'; + case PackageFormat.generic: + return 'generic'; + case PackageFormat.ruby: + return 'ruby'; + case PackageFormat.swift: + return 'swift'; + } + } +} + +extension PackageFormatFromString on String { + PackageFormat toPackageFormat() { + switch (this) { + case 'npm': + return PackageFormat.npm; + case 'pypi': + return PackageFormat.pypi; + case 'maven': + return PackageFormat.maven; + case 'nuget': + return PackageFormat.nuget; + case 'generic': + return PackageFormat.generic; + case 'ruby': + return PackageFormat.ruby; + case 'swift': + return PackageFormat.swift; + } + throw Exception('$this is not known in enum PackageFormat'); + } +} + +/// Details about an allowed repository for a package group, including its name +/// and origin configuration. +class PackageGroupAllowedRepository { + /// The origin configuration restriction type of the allowed repository. + final PackageGroupOriginRestrictionType? originRestrictionType; + + /// The name of the allowed repository. + final String? repositoryName; + + PackageGroupAllowedRepository({ + this.originRestrictionType, + this.repositoryName, + }); + + Map toJson() { + final originRestrictionType = this.originRestrictionType; + final repositoryName = this.repositoryName; + return { + if (originRestrictionType != null) + 'originRestrictionType': originRestrictionType.toValue(), + if (repositoryName != null) 'repositoryName': repositoryName, + }; + } +} + +enum PackageGroupAllowedRepositoryUpdateType { + added, + removed, +} + +extension PackageGroupAllowedRepositoryUpdateTypeValueExtension + on PackageGroupAllowedRepositoryUpdateType { + String toValue() { + switch (this) { + case PackageGroupAllowedRepositoryUpdateType.added: + return 'ADDED'; + case PackageGroupAllowedRepositoryUpdateType.removed: + return 'REMOVED'; + } + } +} + +extension PackageGroupAllowedRepositoryUpdateTypeFromString on String { + PackageGroupAllowedRepositoryUpdateType + toPackageGroupAllowedRepositoryUpdateType() { + switch (this) { + case 'ADDED': + return PackageGroupAllowedRepositoryUpdateType.added; + case 'REMOVED': + return PackageGroupAllowedRepositoryUpdateType.removed; + } + throw Exception( + '$this is not known in enum PackageGroupAllowedRepositoryUpdateType'); + } +} + +enum PackageGroupAssociationType { + strong, + weak, +} + +extension PackageGroupAssociationTypeValueExtension + on PackageGroupAssociationType { + String toValue() { + switch (this) { + case PackageGroupAssociationType.strong: + return 'STRONG'; + case PackageGroupAssociationType.weak: + return 'WEAK'; + } + } +} + +extension PackageGroupAssociationTypeFromString on String { + PackageGroupAssociationType toPackageGroupAssociationType() { + switch (this) { + case 'STRONG': + return PackageGroupAssociationType.strong; + case 'WEAK': + return PackageGroupAssociationType.weak; + } + throw Exception('$this is not known in enum PackageGroupAssociationType'); + } +} + +/// The description of the package group. +class PackageGroupDescription { + /// The ARN of the package group. + final String? arn; + + /// The contact information of the package group. + final String? contactInfo; + + /// A timestamp that represents the date and time the package group was created. + final DateTime? createdTime; + + /// The description of the package group. + final String? description; + + /// The name of the domain that contains the package group. + final String? domainName; + + /// The 12-digit account number of the Amazon Web Services account that owns the + /// domain. It does not include dashes or spaces. + final String? domainOwner; + + /// The package group origin configuration that determines how package versions + /// can enter repositories. + final PackageGroupOriginConfiguration? originConfiguration; + + /// The direct parent package group of the package group. + final PackageGroupReference? parent; + + /// The pattern of the package group. The pattern determines which packages are + /// associated with the package group. + final String? pattern; + + PackageGroupDescription({ + this.arn, + this.contactInfo, + this.createdTime, + this.description, + this.domainName, + this.domainOwner, + this.originConfiguration, + this.parent, + this.pattern, + }); + + factory PackageGroupDescription.fromJson(Map json) { + return PackageGroupDescription( + arn: json['arn'] as String?, + contactInfo: json['contactInfo'] as String?, + createdTime: timeStampFromJson(json['createdTime']), + description: json['description'] as String?, + domainName: json['domainName'] as String?, + domainOwner: json['domainOwner'] as String?, + originConfiguration: json['originConfiguration'] != null + ? PackageGroupOriginConfiguration.fromJson( + json['originConfiguration'] as Map) + : null, + parent: json['parent'] != null + ? PackageGroupReference.fromJson( + json['parent'] as Map) + : null, + pattern: json['pattern'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final contactInfo = this.contactInfo; + final createdTime = this.createdTime; + final description = this.description; + final domainName = this.domainName; + final domainOwner = this.domainOwner; + final originConfiguration = this.originConfiguration; + final parent = this.parent; + final pattern = this.pattern; + return { + if (arn != null) 'arn': arn, + if (contactInfo != null) 'contactInfo': contactInfo, + if (createdTime != null) 'createdTime': unixTimestampToJson(createdTime), + if (description != null) 'description': description, + if (domainName != null) 'domainName': domainName, + if (domainOwner != null) 'domainOwner': domainOwner, + if (originConfiguration != null) + 'originConfiguration': originConfiguration, + if (parent != null) 'parent': parent, + if (pattern != null) 'pattern': pattern, + }; + } +} + +/// The package group origin configuration that determines how package versions +/// can enter repositories. +class PackageGroupOriginConfiguration { + /// The origin configuration settings that determine how package versions can + /// enter repositories. + final Map? + restrictions; + + PackageGroupOriginConfiguration({ + this.restrictions, + }); + + factory PackageGroupOriginConfiguration.fromJson(Map json) { + return PackageGroupOriginConfiguration( + restrictions: (json['restrictions'] as Map?)?.map( + (k, e) => MapEntry( + k.toPackageGroupOriginRestrictionType(), + PackageGroupOriginRestriction.fromJson( + e as Map))), + ); + } + + Map toJson() { + final restrictions = this.restrictions; + return { + if (restrictions != null) + 'restrictions': restrictions.map((k, e) => MapEntry(k.toValue(), e)), + }; + } +} + +/// Contains information about the configured restrictions of the origin +/// controls of a package group. +class PackageGroupOriginRestriction { + /// The effective package group origin restriction setting. If the value of + /// mode is ALLOW, + /// ALLOW_SPECIFIC_REPOSITORIES, or BLOCK, then the + /// value of effectiveMode is the same. Otherwise, when the value + /// of mode is INHERIT, then the value of + /// effectiveMode is the value of mode of the first + /// parent group which does not have a value of INHERIT. + final PackageGroupOriginRestrictionMode? effectiveMode; + + /// The parent package group that the package group origin restrictions are + /// inherited from. + final PackageGroupReference? inheritedFrom; + + /// The package group origin restriction setting. If the value of + /// mode is ALLOW, + /// ALLOW_SPECIFIC_REPOSITORIES, or BLOCK, then the + /// value of effectiveMode is the same. Otherwise, when the value + /// is INHERIT, then the value of effectiveMode is the + /// value of mode of the first parent group which does not have a + /// value of INHERIT. + final PackageGroupOriginRestrictionMode? mode; + + /// The number of repositories in the allowed repository list. + final int? repositoriesCount; + + PackageGroupOriginRestriction({ + this.effectiveMode, + this.inheritedFrom, + this.mode, + this.repositoriesCount, + }); + + factory PackageGroupOriginRestriction.fromJson(Map json) { + return PackageGroupOriginRestriction( + effectiveMode: (json['effectiveMode'] as String?) + ?.toPackageGroupOriginRestrictionMode(), + inheritedFrom: json['inheritedFrom'] != null + ? PackageGroupReference.fromJson( + json['inheritedFrom'] as Map) + : null, + mode: (json['mode'] as String?)?.toPackageGroupOriginRestrictionMode(), + repositoriesCount: json['repositoriesCount'] as int?, + ); + } + + Map toJson() { + final effectiveMode = this.effectiveMode; + final inheritedFrom = this.inheritedFrom; + final mode = this.mode; + final repositoriesCount = this.repositoriesCount; return { - if (tags != null) 'tags': tags, + if (effectiveMode != null) 'effectiveMode': effectiveMode.toValue(), + if (inheritedFrom != null) 'inheritedFrom': inheritedFrom, + if (mode != null) 'mode': mode.toValue(), + if (repositoriesCount != null) 'repositoriesCount': repositoriesCount, }; } } -/// Details about a package dependency. -class PackageDependency { - /// The type of a package dependency. The possible values depend on the package - /// type. - /// - ///
            - ///
          • - /// npm: regular, dev, peer, - /// optional - ///
          • - ///
          • - /// maven: optional, parent, compile, - /// runtime, test, system, - /// provided. - /// - /// Note that parent is not a regular Maven dependency type; - /// instead this is extracted from the <parent> element if - /// one is defined in the package version's POM file. - ///
          • - ///
          • - /// nuget: The dependencyType field is never set for NuGet - /// packages. - ///
          • - ///
          • - /// pypi: Requires-Dist - ///
          • - ///
          - final String? dependencyType; +enum PackageGroupOriginRestrictionMode { + allow, + allowSpecificRepositories, + block, + inherit, +} - /// The namespace of the package that this package depends on. The package - /// component that specifies its namespace depends on its type. For example: - /// - ///
            - ///
          • - /// The namespace of a Maven package is its groupId. - ///
          • - ///
          • - /// The namespace of an npm package is its scope. - ///
          • - ///
          • - /// Python and NuGet packages do not contain a corresponding component, packages - /// of those formats do not have a namespace. - ///
          • - ///
          - final String? namespace; +extension PackageGroupOriginRestrictionModeValueExtension + on PackageGroupOriginRestrictionMode { + String toValue() { + switch (this) { + case PackageGroupOriginRestrictionMode.allow: + return 'ALLOW'; + case PackageGroupOriginRestrictionMode.allowSpecificRepositories: + return 'ALLOW_SPECIFIC_REPOSITORIES'; + case PackageGroupOriginRestrictionMode.block: + return 'BLOCK'; + case PackageGroupOriginRestrictionMode.inherit: + return 'INHERIT'; + } + } +} - /// The name of the package that this package depends on. - final String? package; +extension PackageGroupOriginRestrictionModeFromString on String { + PackageGroupOriginRestrictionMode toPackageGroupOriginRestrictionMode() { + switch (this) { + case 'ALLOW': + return PackageGroupOriginRestrictionMode.allow; + case 'ALLOW_SPECIFIC_REPOSITORIES': + return PackageGroupOriginRestrictionMode.allowSpecificRepositories; + case 'BLOCK': + return PackageGroupOriginRestrictionMode.block; + case 'INHERIT': + return PackageGroupOriginRestrictionMode.inherit; + } + throw Exception( + '$this is not known in enum PackageGroupOriginRestrictionMode'); + } +} - /// The required version, or version range, of the package that this package - /// depends on. The version format is specific to the package type. For example, - /// the following are possible valid required versions: 1.2.3, - /// ^2.3.4, or 4.x. - final String? versionRequirement; +enum PackageGroupOriginRestrictionType { + externalUpstream, + internalUpstream, + publish, +} - PackageDependency({ - this.dependencyType, - this.namespace, - this.package, - this.versionRequirement, +extension PackageGroupOriginRestrictionTypeValueExtension + on PackageGroupOriginRestrictionType { + String toValue() { + switch (this) { + case PackageGroupOriginRestrictionType.externalUpstream: + return 'EXTERNAL_UPSTREAM'; + case PackageGroupOriginRestrictionType.internalUpstream: + return 'INTERNAL_UPSTREAM'; + case PackageGroupOriginRestrictionType.publish: + return 'PUBLISH'; + } + } +} + +extension PackageGroupOriginRestrictionTypeFromString on String { + PackageGroupOriginRestrictionType toPackageGroupOriginRestrictionType() { + switch (this) { + case 'EXTERNAL_UPSTREAM': + return PackageGroupOriginRestrictionType.externalUpstream; + case 'INTERNAL_UPSTREAM': + return PackageGroupOriginRestrictionType.internalUpstream; + case 'PUBLISH': + return PackageGroupOriginRestrictionType.publish; + } + throw Exception( + '$this is not known in enum PackageGroupOriginRestrictionType'); + } +} + +/// Information about the identifiers of a package group. +class PackageGroupReference { + /// The ARN of the package group. + final String? arn; + + /// The pattern of the package group. The pattern determines which packages are + /// associated with the package group, and is also the identifier of the package + /// group. + final String? pattern; + + PackageGroupReference({ + this.arn, + this.pattern, }); - factory PackageDependency.fromJson(Map json) { - return PackageDependency( - dependencyType: json['dependencyType'] as String?, - namespace: json['namespace'] as String?, - package: json['package'] as String?, - versionRequirement: json['versionRequirement'] as String?, + factory PackageGroupReference.fromJson(Map json) { + return PackageGroupReference( + arn: json['arn'] as String?, + pattern: json['pattern'] as String?, ); } Map toJson() { - final dependencyType = this.dependencyType; - final namespace = this.namespace; - final package = this.package; - final versionRequirement = this.versionRequirement; + final arn = this.arn; + final pattern = this.pattern; return { - if (dependencyType != null) 'dependencyType': dependencyType, - if (namespace != null) 'namespace': namespace, - if (package != null) 'package': package, - if (versionRequirement != null) 'versionRequirement': versionRequirement, + if (arn != null) 'arn': arn, + if (pattern != null) 'pattern': pattern, }; } } -/// Details about a package. -class PackageDescription { - /// A format that specifies the type of the package. - final PackageFormat? format; +/// Details about a package group. +class PackageGroupSummary { + /// The ARN of the package group. + final String? arn; - /// The name of the package. - final String? name; + /// The contact information of the package group. + final String? contactInfo; - /// The namespace of the package. The package component that specifies its - /// namespace depends on its type. For example: - /// - ///
            - ///
          • - /// The namespace of a Maven package is its groupId. - ///
          • - ///
          • - /// The namespace of an npm package is its scope. - ///
          • - ///
          • - /// Python and NuGet packages do not contain a corresponding component, packages - /// of those formats do not have a namespace. - ///
          • - ///
          • - /// The namespace of a generic package is its namespace. - ///
          • - ///
          - final String? namespace; + /// A timestamp that represents the date and time the repository was created. + final DateTime? createdTime; - /// The package origin configuration for the package. - final PackageOriginConfiguration? originConfiguration; + /// The description of the package group. + final String? description; - PackageDescription({ - this.format, - this.name, - this.namespace, + /// The domain that contains the package group. + final String? domainName; + + /// The 12-digit account number of the Amazon Web Services account that owns the + /// domain. It does not include dashes or spaces. + final String? domainOwner; + + /// Details about the package origin configuration of a package group. + final PackageGroupOriginConfiguration? originConfiguration; + + /// The direct parent package group of the package group. + final PackageGroupReference? parent; + + /// The pattern of the package group. The pattern determines which packages are + /// associated with the package group. + final String? pattern; + + PackageGroupSummary({ + this.arn, + this.contactInfo, + this.createdTime, + this.description, + this.domainName, + this.domainOwner, this.originConfiguration, + this.parent, + this.pattern, }); - factory PackageDescription.fromJson(Map json) { - return PackageDescription( - format: (json['format'] as String?)?.toPackageFormat(), - name: json['name'] as String?, - namespace: json['namespace'] as String?, + factory PackageGroupSummary.fromJson(Map json) { + return PackageGroupSummary( + arn: json['arn'] as String?, + contactInfo: json['contactInfo'] as String?, + createdTime: timeStampFromJson(json['createdTime']), + description: json['description'] as String?, + domainName: json['domainName'] as String?, + domainOwner: json['domainOwner'] as String?, originConfiguration: json['originConfiguration'] != null - ? PackageOriginConfiguration.fromJson( + ? PackageGroupOriginConfiguration.fromJson( json['originConfiguration'] as Map) : null, + parent: json['parent'] != null + ? PackageGroupReference.fromJson( + json['parent'] as Map) + : null, + pattern: json['pattern'] as String?, ); } Map toJson() { - final format = this.format; - final name = this.name; - final namespace = this.namespace; + final arn = this.arn; + final contactInfo = this.contactInfo; + final createdTime = this.createdTime; + final description = this.description; + final domainName = this.domainName; + final domainOwner = this.domainOwner; final originConfiguration = this.originConfiguration; + final parent = this.parent; + final pattern = this.pattern; return { - if (format != null) 'format': format.toValue(), - if (name != null) 'name': name, - if (namespace != null) 'namespace': namespace, + if (arn != null) 'arn': arn, + if (contactInfo != null) 'contactInfo': contactInfo, + if (createdTime != null) 'createdTime': unixTimestampToJson(createdTime), + if (description != null) 'description': description, + if (domainName != null) 'domainName': domainName, + if (domainOwner != null) 'domainOwner': domainOwner, if (originConfiguration != null) 'originConfiguration': originConfiguration, + if (parent != null) 'parent': parent, + if (pattern != null) 'pattern': pattern, }; } } -enum PackageFormat { - npm, - pypi, - maven, - nuget, - generic, -} - -extension PackageFormatValueExtension on PackageFormat { - String toValue() { - switch (this) { - case PackageFormat.npm: - return 'npm'; - case PackageFormat.pypi: - return 'pypi'; - case PackageFormat.maven: - return 'maven'; - case PackageFormat.nuget: - return 'nuget'; - case PackageFormat.generic: - return 'generic'; - } - } -} - -extension PackageFormatFromString on String { - PackageFormat toPackageFormat() { - switch (this) { - case 'npm': - return PackageFormat.npm; - case 'pypi': - return PackageFormat.pypi; - case 'maven': - return PackageFormat.maven; - case 'nuget': - return PackageFormat.nuget; - case 'generic': - return PackageFormat.generic; - } - throw Exception('$this is not known in enum PackageFormat'); - } -} - /// Details about the package origin configuration of a package. class PackageOriginConfiguration { /// A PackageOriginRestrictions object that contains information @@ -4676,17 +6327,17 @@ class PackageSummary { /// ///
            ///
          • - /// The namespace of a Maven package is its groupId. + /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet packages do not contain a corresponding component, packages - /// of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// The namespace of a generic package is its namespace. + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -4754,22 +6405,22 @@ class PackageVersionDescription { /// Information about licenses associated with the package version. final List? licenses; - /// The namespace of the package version. The package version component that - /// specifies its namespace depends on its type. For example: + /// The namespace of the package version. The package component that specifies + /// its namespace depends on its type. For example: /// ///
            ///
          • /// The namespace of a Maven package version is its groupId. ///
          • ///
          • - /// The namespace of an npm package version is its scope. + /// The namespace of an npm or Swift package version is its scope. ///
          • ///
          • - /// Python and NuGet package versions do not contain a corresponding component, - /// package versions of those formats do not have a namespace. + /// The namespace of a generic package is its namespace. ///
          • ///
          • - /// The namespace of a generic package is its namespace. + /// Python, NuGet, and Ruby package versions do not contain a corresponding + /// component, package versions of those formats do not have a namespace. ///
          • ///
          final String? namespace; @@ -5679,6 +7330,79 @@ class UntagResourceResult { } } +class UpdatePackageGroupOriginConfigurationResult { + /// Information about the updated allowed repositories after processing the + /// request. + final Map>>? + allowedRepositoryUpdates; + + /// The package group and information about it after processing the request. + final PackageGroupDescription? packageGroup; + + UpdatePackageGroupOriginConfigurationResult({ + this.allowedRepositoryUpdates, + this.packageGroup, + }); + + factory UpdatePackageGroupOriginConfigurationResult.fromJson( + Map json) { + return UpdatePackageGroupOriginConfigurationResult( + allowedRepositoryUpdates: + (json['allowedRepositoryUpdates'] as Map?)?.map( + (k, e) => MapEntry( + k.toPackageGroupOriginRestrictionType(), + (e as Map).map((k, e) => MapEntry( + k.toPackageGroupAllowedRepositoryUpdateType(), + (e as List) + .whereNotNull() + .map((e) => e as String) + .toList())))), + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final allowedRepositoryUpdates = this.allowedRepositoryUpdates; + final packageGroup = this.packageGroup; + return { + if (allowedRepositoryUpdates != null) + 'allowedRepositoryUpdates': allowedRepositoryUpdates.map((k, e) => + MapEntry(k.toValue(), e.map((k, e) => MapEntry(k.toValue(), e)))), + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + +class UpdatePackageGroupResult { + /// The package group and information about it after the request has been + /// processed. + final PackageGroupDescription? packageGroup; + + UpdatePackageGroupResult({ + this.packageGroup, + }); + + factory UpdatePackageGroupResult.fromJson(Map json) { + return UpdatePackageGroupResult( + packageGroup: json['packageGroup'] != null + ? PackageGroupDescription.fromJson( + json['packageGroup'] as Map) + : null, + ); + } + + Map toJson() { + final packageGroup = this.packageGroup; + return { + if (packageGroup != null) 'packageGroup': packageGroup, + }; + } +} + class UpdatePackageVersionsStatusResult { /// A list of SuccessfulPackageVersionInfo objects, one for each /// package version with a status that successfully updated. diff --git a/aws_client/lib/src/generated/cognito_identity_provider/v2016_04_18.dart b/aws_client/lib/src/generated/cognito_identity_provider/v2016_04_18.dart index ffd824af0..e89e30779 100644 --- a/aws_client/lib/src/generated/cognito_identity_provider/v2016_04_18.dart +++ b/aws_client/lib/src/generated/cognito_identity_provider/v2016_04_18.dart @@ -19,16 +19,103 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Using the Amazon Cognito user pools API, you can create a user pool to -/// manage directories and users. You can authenticate a user to obtain tokens -/// related to user identity and access policies. +/// With the Amazon Cognito user pools API, you can configure user pools and +/// authenticate users. To authenticate users from third-party identity +/// providers (IdPs) in this API, you can link +/// IdP users to native user profiles. Learn more about the authentication +/// and authorization of federated users at Adding +/// user pool sign-in through a third party and in the User +/// pool federation endpoints and hosted UI reference. /// -/// This API reference provides information about user pools in Amazon Cognito -/// user pools. +/// This API reference provides detailed information about API operations and +/// object types in Amazon Cognito. /// -/// For more information, see the Amazon -/// Cognito Documentation. +/// Along with resource management operations, the Amazon Cognito user pools API +/// includes classes of operations and authorization models for client-side and +/// server-side authentication of users. You can interact with operations in the +/// Amazon Cognito user pools API as any of the following subjects. +///
            +///
          1. +/// An administrator who wants to configure user pools, app clients, users, +/// groups, or other user pool functions. +///
          2. +///
          3. +/// A server-side app, like a web application, that wants to use its Amazon Web +/// Services privileges to manage, authenticate, or authorize a user. +///
          4. +///
          5. +/// A client-side app, like a mobile app, that wants to make unauthenticated +/// requests to manage, authenticate, or authorize a user. +///
          +/// For more information, see Using +/// the Amazon Cognito user pools API and user pool endpoints in the +/// Amazon Cognito Developer Guide. +/// +/// With your Amazon Web Services SDK, you can build the logic to support +/// operational flows in every use case for this API. You can also make direct +/// REST API requests to Amazon +/// Cognito user pools service endpoints. The following links can get you +/// started with the CognitoIdentityProvider client in other +/// supported Amazon Web Services SDKs. +/// +/// +/// To get started with an Amazon Web Services SDK, see Tools to Build on Amazon Web +/// Services. For example actions and scenarios, see Code +/// examples for Amazon Cognito Identity Provider using Amazon Web Services +/// SDKs. class CognitoIdentityProvider { final _s.JsonProtocol _protocol; CognitoIdentityProvider({ @@ -58,6 +145,25 @@ class CognitoIdentityProvider { } /// Adds additional user attributes to the user pool schema. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

          Learn more + /// + ///

          /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -93,9 +199,28 @@ class CognitoIdentityProvider { ); } - /// Adds the specified user to the specified group. + /// Adds a user to a group. A user who is in a group can present a + /// preferred-role claim to an identity pool, and populates a + /// cognito:groups claim to their access and identity tokens. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

          Learn more /// - /// Calling this action requires developer credentials. + ///

          /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -105,13 +230,17 @@ class CognitoIdentityProvider { /// May throw [InternalErrorException]. /// /// Parameter [groupName] : - /// The group name. + /// The name of the group that you want to add your user to. /// /// Parameter [userPoolId] : /// The user pool ID for the user pool. /// /// Parameter [username] : - /// The username for the user. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminAddUserToGroup({ required String groupName, required String userPoolId, @@ -135,10 +264,37 @@ class CognitoIdentityProvider { ); } - /// Confirms user registration as an admin without using a confirmation code. - /// Works on any user. + /// This IAM-authenticated API operation provides a code that Amazon Cognito + /// sent to your user when they signed up in your user pool. After your user + /// enters their code, they confirm ownership of the email address or phone + /// number that they provided, and their user account becomes active. + /// Depending on your user pool configuration, your users will receive their + /// confirmation code in an email or SMS message. /// - /// Calling this action requires developer credentials. + /// Local users who signed up in your user pool are the only type of user who + /// can confirm sign-up with a code. Users who federate through an external + /// identity provider (IdP) have already been confirmed by their IdP. + /// Administrator-created users confirm their accounts when they respond to + /// their invitation email message and choose a password. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

          Learn more + /// + ///

          /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -156,7 +312,11 @@ class CognitoIdentityProvider { /// The user pool ID for which you want to confirm user registration. /// /// Parameter [username] : - /// The user name for which you want to confirm user registration. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -238,7 +398,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -252,8 +412,25 @@ class CognitoIdentityProvider { /// /// In either case, the user will be in the FORCE_CHANGE_PASSWORD /// state until they sign in and change their password. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

          Learn more /// - /// AdminCreateUser requires developer credentials. + ///

          /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -276,9 +453,26 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool where the user will be created. /// /// Parameter [username] : - /// The username for the user. Must be unique within the user pool. Must be a - /// UTF-8 string between 1 and 128 characters. After the user is created, the - /// username can't be changed. + /// The value that you want to set as the username sign-in attribute. The + /// following conditions apply to the username parameter. + /// + ///
            + ///
          • + /// The username can't be a duplicate of another username in the same user + /// pool. + ///
          • + ///
          • + /// You can't change the value of a username after you create it. + ///
          • + ///
          • + /// You can only provide a value if usernames are a valid sign-in attribute + /// for your user pool. If your user pool only supports phone numbers or email + /// addresses as sign-in attributes, Amazon Cognito automatically generates a + /// username value. For more information, see Customizing + /// sign-in attributes. + ///
          • + ///
          /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -357,10 +551,9 @@ class CognitoIdentityProvider { /// Cognito generates one for you. /// /// The temporary password can only be used until the user account expiration - /// limit that you specified when you created the user pool. To reset the - /// account after that time limit, you must call AdminCreateUser - /// again, specifying "RESEND" for the MessageAction - /// parameter. + /// limit that you set for your user pool. To reset the account after that + /// time limit, you must call AdminCreateUser again and specify + /// RESEND for the MessageAction parameter. /// /// Parameter [userAttributes] : /// An array of name-value pairs that contain user attributes and attribute @@ -403,18 +596,21 @@ class CognitoIdentityProvider { ///
        /// /// Parameter [validationData] : - /// The user's validation data. This is an array of name-value pairs that - /// contain user attributes and attribute values that you can use for custom - /// validation, such as restricting the types of user accounts that can be - /// registered. For example, you might choose to allow or disallow user - /// sign-up based on the user's domain. - /// - /// To configure custom validation, you must create a Pre Sign-up Lambda - /// trigger for the user pool as described in the Amazon Cognito Developer - /// Guide. The Lambda trigger receives the validation data and uses it in the - /// validation process. - /// - /// The user's validation data isn't persisted. + /// Temporary user attributes that contribute to the outcomes of your pre + /// sign-up Lambda trigger. This set of key-value pairs are for custom + /// validation of information that you collect from your users but don't need + /// to retain. + /// + /// Your Lambda function can analyze this additional data and act on it. Your + /// function might perform external API operations like logging user + /// attributes and validation data to Amazon CloudWatch Logs. Validation data + /// might also affect the response that your function returns to Amazon + /// Cognito, like automatically confirming the user if they sign up from + /// within your network. + /// + /// For more information about the pre sign-up Lambda trigger, see Pre + /// sign-up Lambda trigger. Future adminCreateUser({ required String userPoolId, required String username, @@ -456,8 +652,25 @@ class CognitoIdentityProvider { } /// Deletes a user as an administrator. Works on any user. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -470,7 +683,11 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool where you want to delete the user. /// /// Parameter [username] : - /// The user name of the user you want to delete. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminDeleteUser({ required String userPoolId, required String username, @@ -494,8 +711,25 @@ class CognitoIdentityProvider { /// Deletes the user attributes in a user pool as an administrator. Works on /// any user. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -516,7 +750,11 @@ class CognitoIdentityProvider { /// attributes. /// /// Parameter [username] : - /// The user name of the user from which you would like to delete attributes. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminDeleteUserAttributes({ required List userAttributeNames, required String userPoolId, @@ -551,9 +789,6 @@ class CognitoIdentityProvider { /// must create a new user account. See AdminLinkProviderForUser. /// - /// This action is enabled only for admin access and requires developer - /// credentials. - /// /// The ProviderName must match the value specified when creating /// an IdP for the pool. /// @@ -579,6 +814,25 @@ class CognitoIdentityProvider { /// ProviderAttributeName must be Cognito_Subject /// and ProviderAttributeValue must be the subject of the SAML /// assertion. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more + /// + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -618,9 +872,25 @@ class CognitoIdentityProvider { /// Deactivates a user and revokes all access tokens for the user. A /// deactivated user can't sign in, but still appears in the responses to /// GetUser and ListUsers API requests. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// You must make this API request with Amazon Web Services credentials that - /// have cognito-idp:AdminDisableUser permissions. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -633,7 +903,11 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool where you want to disable the user. /// /// Parameter [username] : - /// The user name of the user you want to disable. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminDisableUser({ required String userPoolId, required String username, @@ -656,8 +930,25 @@ class CognitoIdentityProvider { } /// Enables the specified user as an administrator. Works on any user. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -670,7 +961,11 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool where you want to enable the user. /// /// Parameter [username] : - /// The user name of the user you want to enable. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminEnableUser({ required String userPoolId, required String username, @@ -693,8 +988,25 @@ class CognitoIdentityProvider { } /// Forgets the device, as an administrator. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -711,7 +1023,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user name. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminForgetDevice({ required String deviceKey, required String userPoolId, @@ -736,8 +1052,25 @@ class CognitoIdentityProvider { } /// Gets the device, as an administrator. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -753,7 +1086,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user name. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminGetDevice({ required String deviceKey, required String userPoolId, @@ -781,8 +1118,25 @@ class CognitoIdentityProvider { /// Gets the specified user by user name in a user pool as an administrator. /// Works on any user. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more /// - /// Calling this action requires developer credentials. + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -796,7 +1150,11 @@ class CognitoIdentityProvider { /// the user. /// /// Parameter [username] : - /// The user name of the user you want to retrieve. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminGetUser({ required String userPoolId, required String username, @@ -838,11 +1196,28 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. - ///
        - /// Calling this action requires developer credentials. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more + /// + ///

        /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -929,17 +1304,18 @@ class CognitoIdentityProvider { /// app client is configured with a client secret), DEVICE_KEY. ///
      • ///
      • + /// For ADMIN_USER_PASSWORD_AUTH: USERNAME + /// (required), PASSWORD (required), SECRET_HASH + /// (required if the app client is configured with a client secret), + /// DEVICE_KEY. + ///
      • + ///
      • /// For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: /// REFRESH_TOKEN (required), SECRET_HASH (required /// if the app client is configured with a client secret), /// DEVICE_KEY. ///
      • ///
      • - /// For ADMIN_NO_SRP_AUTH: USERNAME (required), - /// SECRET_HASH (if app client is configured with client secret), - /// PASSWORD (required), DEVICE_KEY. - ///
      • - ///
      • /// For CUSTOM_AUTH: USERNAME (required), /// SECRET_HASH (if app client is configured with client secret), /// DEVICE_KEY. To start the authentication flow with password @@ -947,6 +1323,12 @@ class CognitoIdentityProvider { /// (The SRP_A Value). ///
      • ///
      + /// For more information about SECRET_HASH, see Computing + /// secret hash values. For information about DEVICE_KEY, see + /// Working + /// with user devices in your user pool. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for certain @@ -997,9 +1379,6 @@ class CognitoIdentityProvider { ///
    • /// Define auth challenge ///
    • - ///
    • - /// Verify auth challenge - ///
    • ///
    /// For more information, see @@ -1082,8 +1461,25 @@ class CognitoIdentityProvider { /// in as an existing user in the user pool, it is critical that it only be /// used with external IdPs and provider attributes that have been trusted by /// the application owner. - /// - /// This action is administrative and requires developer credentials. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -1096,7 +1492,7 @@ class CognitoIdentityProvider { /// /// Parameter [destinationUser] : /// The existing user in the user pool that you want to assign to the external - /// IdP user account. This user can be a native (Username + Password) Amazon + /// IdP user account. This user can be a local (Username + Password) Amazon /// Cognito user pools user or a federated user (for example, a SAML or /// Facebook user). If the user doesn't exist, Amazon Cognito generates an /// exception. Amazon Cognito returns this user when the new user (with the @@ -1134,14 +1530,24 @@ class CognitoIdentityProvider { /// the same value as the id, sub, or /// user_id value found in the social IdP token. ///

    + /// For OIDC, the ProviderAttributeName can be any value that + /// matches a claim in the ID token, or that your app retrieves from the + /// userInfo endpoint. You must map the claim to a user pool + /// attribute in your IdP configuration, and set the user pool attribute name + /// as the value of ProviderAttributeName in your + /// AdminLinkProviderForUser request. + /// /// For SAML, the ProviderAttributeName can be any value that - /// matches a claim in the SAML assertion. If you want to link SAML users - /// based on the subject of the SAML assertion, you should map the subject to - /// a claim through the SAML IdP and submit that claim name as the - /// ProviderAttributeName. If you set + /// matches a claim in the SAML assertion. To link SAML users based on the + /// subject of the SAML assertion, map the subject to a claim through the SAML + /// IdP and set that claim name as the value of + /// ProviderAttributeName in your + /// AdminLinkProviderForUser request. + /// + /// For both OIDC and SAML users, when you set /// ProviderAttributeName to Cognito_Subject, Amazon /// Cognito will automatically parse the default unique identifier found in - /// the subject from the SAML token. + /// the subject from the IdP token. /// /// Parameter [userPoolId] : /// The user pool ID for the user pool. @@ -1170,8 +1576,25 @@ class CognitoIdentityProvider { } /// Lists devices, as an administrator. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1184,13 +1607,22 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user name. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [limit] : /// The limit of the devices request. /// /// Parameter [paginationToken] : - /// The pagination token. + /// This API operation returns a limited number of results. The pagination + /// token is an identifier that you can present in an additional API request + /// with the same parameters. When you include the pagination token, Amazon + /// Cognito returns the next set of items after the current list. Subsequent + /// requests return a new pagination token. By use of this token, you can + /// paginate through the full list of items. Future adminListDevices({ required String userPoolId, required String username, @@ -1224,9 +1656,26 @@ class CognitoIdentityProvider { return AdminListDevicesResponse.fromJson(jsonResponse.body); } - /// Lists the groups that the user belongs to. + /// Lists the groups that a user belongs to. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1239,7 +1688,11 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool. /// /// Parameter [username] : - /// The username for the user. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [limit] : /// The limit of the request to list groups. @@ -1282,6 +1735,25 @@ class CognitoIdentityProvider { /// A history of user activity and any risks detected as part of Amazon /// Cognito advanced security. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1295,7 +1767,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user pool username or an alias. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [maxResults] : /// The maximum number of authentication events to return. Returns 60 events @@ -1339,8 +1815,25 @@ class CognitoIdentityProvider { } /// Removes the specified user from the specified group. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1356,7 +1849,11 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool. /// /// Parameter [username] : - /// The username for the user. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminRemoveUserFromGroup({ required String groupName, required String userPoolId, @@ -1384,15 +1881,10 @@ class CognitoIdentityProvider { /// Resets the specified user's password in a user pool as an administrator. /// Works on any user. /// - /// When a developer calls this API, the current password is invalidated, so - /// it must be changed. If a user tries to sign in after the API is called, - /// the app will get a PasswordResetRequiredException exception back and - /// should direct the user down the flow to reset the password, which is the - /// same as the forgot password flow. In addition, if the user pool has phone - /// verification selected and a verified phone number exists for the user, or - /// if email verification is selected and a verified email exists for the - /// user, calling this API will also result in sending a message to the end - /// user with the code to change their password. + /// To use this API operation, your user pool must have self-service account + /// recovery configured. Use AdminSetUserPassword + /// if you manage passwords as an administrator. /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number @@ -1410,11 +1902,38 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// - /// Calling this action requires developer credentials. + /// Deactivates a user's password, requiring them to change it. If a user + /// tries to sign in after the API is called, Amazon Cognito responds with a + /// PasswordResetRequiredException error. Your app must then + /// perform the actions that reset your user's password: the forgot-password + /// flow. In addition, if the user pool has phone verification selected and a + /// verified phone number exists for the user, or if email verification is + /// selected and a verified email exists for the user, calling this API will + /// also result in sending a message to the end user with the code to change + /// their password. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -1435,7 +1954,11 @@ class CognitoIdentityProvider { /// password. /// /// Parameter [username] : - /// The user name of the user whose password you want to reset. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -1498,7 +2021,16 @@ class CognitoIdentityProvider { ); } - /// Responds to an authentication challenge, as an administrator. + /// Some API operations in a user pool generate a challenge, like a prompt for + /// an MFA code, for device authentication that bypasses MFA, or for a custom + /// authentication challenge. An AdminRespondToAuthChallenge API + /// request provides the answer to that challenge, like a code or a secure + /// remote password (SRP). The parameters of a response to an authentication + /// challenge vary with the type of challenge. + /// + /// For more information about custom authentication challenges, see Custom + /// authentication challenge Lambda triggers. /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number @@ -1516,11 +2048,28 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. - /// - /// Calling this action requires developer credentials. + ///
    + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -1558,57 +2107,71 @@ class CognitoIdentityProvider { /// AdminRespondToAuthChallenge calls. /// /// Parameter [challengeResponses] : - /// The challenge responses. These are inputs corresponding to the value of - /// ChallengeName, for example: - /// - ///
      - ///
    • - /// SMS_MFA: SMS_MFA_CODE, USERNAME, - /// SECRET_HASH (if app client is configured with client secret). - ///
    • - ///
    • - /// PASSWORD_VERIFIER: PASSWORD_CLAIM_SIGNATURE, - /// PASSWORD_CLAIM_SECRET_BLOCK, TIMESTAMP, - /// USERNAME, SECRET_HASH (if app client is - /// configured with client secret). - /// - /// PASSWORD_VERIFIER requires DEVICE_KEY when - /// signing in with a remembered device. - ///
    • - ///
    • - /// ADMIN_NO_SRP_AUTH: PASSWORD, - /// USERNAME, SECRET_HASH (if app client is - /// configured with client secret). - ///
    • - ///
    • - /// NEW_PASSWORD_REQUIRED: NEW_PASSWORD, - /// USERNAME, SECRET_HASH (if app client is - /// configured with client secret). To set any required attributes that Amazon - /// Cognito returned as requiredAttributes in the - /// AdminInitiateAuth response, add a - /// userAttributes.attributename parameter. This + /// The responses to the challenge that you received in the previous request. + /// Each challenge has its own required response parameters. The following + /// examples are partial JSON request bodies that highlight challenge-response + /// parameters. + /// + /// You must provide a SECRET_HASH parameter in all challenge responses to an + /// app client that has a client secret. + ///
      SMS_MFA
      + /// "ChallengeName": "SMS_MFA", "ChallengeResponses": {"SMS_MFA_CODE": + /// "[SMS_code]", "USERNAME": "[username]"} + ///
      PASSWORD_VERIFIER
      + /// "ChallengeName": "PASSWORD_VERIFIER", "ChallengeResponses": + /// {"PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", + /// "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], + /// "USERNAME": "[username]"} + /// + /// Add "DEVICE_KEY" when you sign in with a remembered device. + ///
      CUSTOM_CHALLENGE
      + /// "ChallengeName": "CUSTOM_CHALLENGE", "ChallengeResponses": + /// {"USERNAME": "[username]", "ANSWER": "[challenge_answer]"} + /// + /// Add "DEVICE_KEY" when you sign in with a remembered device. + ///
      NEW_PASSWORD_REQUIRED
      + /// "ChallengeName": "NEW_PASSWORD_REQUIRED", "ChallengeResponses": + /// {"NEW_PASSWORD": "[new_password]", "USERNAME": "[username]"} + /// + /// To set any required attributes that InitiateAuth returned in + /// an requiredAttributes parameter, add + /// "userAttributes.[attribute_name]": "[attribute_value]". This /// parameter can also set values for writable attributes that aren't required /// by your user pool. /// /// In a NEW_PASSWORD_REQUIRED challenge response, you can't /// modify a required attribute that already has a value. In - /// AdminRespondToAuthChallenge, set a value for any keys that - /// Amazon Cognito returned in the requiredAttributes parameter, - /// then use the AdminUpdateUserAttributes API operation to - /// modify the value of any additional attributes. - ///
    • - ///
    • - /// MFA_SETUP requires USERNAME, plus you must use - /// the session value returned by VerifySoftwareToken in the - /// Session parameter. - ///
    • - ///
    - /// The value of the USERNAME attribute must be the user's actual - /// username, not an alias (such as an email address or phone number). To make - /// this simpler, the AdminInitiateAuth response includes the - /// actual username value in the USERNAMEUSER_ID_FOR_SRP - /// attribute. This happens even if you specified an alias in your call to - /// AdminInitiateAuth. + /// RespondToAuthChallenge, set a value for any keys that Amazon + /// Cognito returned in the requiredAttributes parameter, then + /// use the UpdateUserAttributes API operation to modify the + /// value of any additional attributes. + ///
    SOFTWARE_TOKEN_MFA
    + /// "ChallengeName": "SOFTWARE_TOKEN_MFA", "ChallengeResponses": + /// {"USERNAME": "[username]", "SOFTWARE_TOKEN_MFA_CODE": + /// [authenticator_code]} + ///
    DEVICE_SRP_AUTH
    + /// "ChallengeName": "DEVICE_SRP_AUTH", "ChallengeResponses": + /// {"USERNAME": "[username]", "DEVICE_KEY": "[device_key]", "SRP_A": + /// "[srp_a]"} + ///
    DEVICE_PASSWORD_VERIFIER
    + /// "ChallengeName": "DEVICE_PASSWORD_VERIFIER", "ChallengeResponses": + /// {"DEVICE_KEY": "[device_key]", "PASSWORD_CLAIM_SIGNATURE": + /// "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", + /// "TIMESTAMP": [timestamp], "USERNAME": "[username]"} + ///
    MFA_SETUP
    + /// "ChallengeName": "MFA_SETUP", "ChallengeResponses": {"USERNAME": + /// "[username]"}, "SESSION": "[Session ID from VerifySoftwareToken]" + ///
    SELECT_MFA_TYPE
    + /// "ChallengeName": "SELECT_MFA_TYPE", "ChallengeResponses": + /// {"USERNAME": "[username]", "ANSWER": "[SMS_MFA or + /// SOFTWARE_TOKEN_MFA]"} + ///
    + /// For more information about SECRET_HASH, see Computing + /// secret hash values. For information about DEVICE_KEY, see + /// Working + /// with user devices in your user pool. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -1733,6 +2296,25 @@ class CognitoIdentityProvider { /// a user if multiple factors are activated. If multiple options are /// activated and no preference is set, a challenge to choose an MFA option /// will be returned during sign-in. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -1746,7 +2328,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user pool username or alias. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [sMSMfaSettings] : /// The SMS text message MFA settings. @@ -1793,6 +2379,39 @@ class CognitoIdentityProvider { /// Once the user has set a new password, or the password is permanent, the /// user status is set to Confirmed. /// + /// AdminSetUserPassword can set a password for the user profile + /// that Amazon Cognito creates for third-party federated users. When you set + /// a password, the federated user's status changes from + /// EXTERNAL_PROVIDER to CONFIRMED. A user in this + /// state can sign in as a federated user, and initiate authentication flows + /// in the API like a linked native user. They can also modify their password + /// and attributes in token-authenticated API requests like + /// ChangePassword and UpdateUserAttributes. As a + /// best security practice and to keep users in sync with your external IdP, + /// don't set passwords on federated user profiles. To set up a federated user + /// for native sign-in with a linked native user, refer to Linking + /// federated users to an existing user profile. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    + /// /// May throw [ResourceNotFoundException]. /// May throw [NotAuthorizedException]. /// May throw [UserNotFoundException]. @@ -1809,7 +2428,11 @@ class CognitoIdentityProvider { /// password. /// /// Parameter [username] : - /// The user name of the user whose password you want to set. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [permanent] : /// True if the password is permanent, False if it @@ -1844,6 +2467,25 @@ class CognitoIdentityProvider { /// (TOTP) software token MFA. To configure either type of MFA, use AdminSetUserMFAPreference /// instead. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -1860,7 +2502,11 @@ class CognitoIdentityProvider { /// setting. /// /// Parameter [username] : - /// The user name of the user whose options you're setting. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminSetUserSettings({ required List mFAOptions, required String userPoolId, @@ -1887,6 +2533,25 @@ class CognitoIdentityProvider { /// Provides feedback for an authentication event indicating if it was from a /// valid user. This feedback is used for improving the risk evaluation /// decision for the user pool as part of Amazon Cognito advanced security. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1900,13 +2565,23 @@ class CognitoIdentityProvider { /// The authentication event ID. /// /// Parameter [feedbackValue] : - /// The authentication event feedback value. + /// The authentication event feedback value. When you provide a + /// FeedbackValue value of valid, you tell Amazon + /// Cognito that you trust a user session where Amazon Cognito has evaluated + /// some level of risk. When you provide a FeedbackValue value of + /// invalid, you tell Amazon Cognito that you don't trust a user + /// session, or you don't believe that Amazon Cognito evaluated a high-enough + /// risk level. /// /// Parameter [userPoolId] : /// The user pool ID. /// /// Parameter [username] : - /// The user pool username. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminUpdateAuthEventFeedback({ required String eventId, required FeedbackValueType feedbackValue, @@ -1934,8 +2609,25 @@ class CognitoIdentityProvider { } /// Updates the device status as an administrator. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -1952,7 +2644,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user name. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [deviceRememberedStatus] : /// The status indicating whether a device has been remembered or not. @@ -1983,14 +2679,6 @@ class CognitoIdentityProvider { ); } - /// Updates the specified user's attributes, including developer attributes, - /// as an administrator. Works on any user. - /// - /// For custom attributes, you must prepend the custom: prefix to - /// the attribute name. - /// - /// In addition to updating user attributes, this API can also be used to mark - /// phone and email as verified. /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number @@ -2008,11 +2696,38 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// - /// Calling this action requires developer credentials. + /// Updates the specified user's attributes, including developer attributes, + /// as an administrator. Works on any user. To delete an attribute from your + /// user, submit the attribute in your API request with a blank value. + /// + /// For custom attributes, you must prepend the custom: prefix to + /// the attribute name. + /// + /// In addition to updating user attributes, this API can also be used to mark + /// phone and email as verified. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -2056,7 +2771,11 @@ class CognitoIdentityProvider { /// attributes. /// /// Parameter [username] : - /// The user name of the user for whom you want to update user attributes. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -2122,15 +2841,56 @@ class CognitoIdentityProvider { ); } - /// Signs out a user from all devices. You must sign - /// AdminUserGlobalSignOut requests with Amazon Web Services - /// credentials. It also invalidates all refresh tokens that Amazon Cognito - /// has issued to a user. The user's current access and ID tokens remain valid - /// until they expire. By default, access and ID tokens expire one hour after - /// they're issued. A user can still use a hosted UI cookie to retrieve new - /// tokens for the duration of the cookie validity period of 1 hour. + /// Invalidates the identity, access, and refresh tokens that Amazon Cognito + /// issued to a user. Call this operation with your administrative credentials + /// when your user signs out of your app. This results in the following + /// behavior. /// - /// Calling this action requires developer credentials. + ///
      + ///
    • + /// Amazon Cognito no longer accepts token-authorized user operations + /// that you authorize with a signed-out user's access tokens. For more + /// information, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// Amazon Cognito returns an Access Token has been revoked error + /// when your app attempts to authorize a user pools API request with a + /// revoked access token that contains the scope + /// aws.cognito.signin.user.admin. + ///
    • + ///
    • + /// Amazon Cognito no longer accepts a signed-out user's ID token in a GetId + /// request to an identity pool with ServerSideTokenCheck + /// enabled for its user pool IdP configuration in CognitoIdentityProvider. + ///
    • + ///
    • + /// Amazon Cognito no longer accepts a signed-out user's refresh tokens in + /// refresh requests. + ///
    • + ///
    + /// Other requests might be valid until your user's token expires. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -2143,7 +2903,11 @@ class CognitoIdentityProvider { /// The user pool ID. /// /// Parameter [username] : - /// The user name. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future adminUserGlobalSignOut({ required String userPoolId, required String username, @@ -2186,6 +2950,14 @@ class CognitoIdentityProvider { /// After you set up software token MFA for your user, Amazon Cognito /// generates a SOFTWARE_TOKEN_MFA challenge when they /// authenticate. Respond to this challenge with your user's TOTP. + ///
    + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. /// /// /// May throw [ConcurrentModificationException]. @@ -2216,6 +2988,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -2229,6 +3002,18 @@ class CognitoIdentityProvider { /// Changes the password for a specified user in a user pool. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [InvalidPasswordException]. @@ -2275,7 +3060,21 @@ class CognitoIdentityProvider { } /// Confirms tracking of the device. This API call is the call that begins - /// device tracking. + /// device tracking. For more information about device authentication, see Working + /// with user devices in your user pool. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -2317,6 +3116,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -2332,6 +3132,15 @@ class CognitoIdentityProvider { } /// Allows a user to enter a confirmation code to reset a forgotten password. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [UnexpectedLambdaException]. @@ -2362,8 +3171,11 @@ class CognitoIdentityProvider { /// The new password that your user wants to set. /// /// Parameter [username] : - /// The user name of the user for whom you want to enter a code to retrieve a - /// forgotten password. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [analyticsMetadata] : /// The Amazon Pinpoint analytics metadata for collecting metrics for @@ -2411,7 +3223,9 @@ class CognitoIdentityProvider { /// Parameter [secretHash] : /// A keyed-hash message authentication code (HMAC) calculated using the /// secret key of a user pool client and username plus the client ID in the - /// message. + /// message. For more information about SecretHash, see Computing + /// secret hash values. /// /// Parameter [userContextData] : /// Contextual data about your user session, such as the device fingerprint, @@ -2452,7 +3266,31 @@ class CognitoIdentityProvider { ); } - /// Confirms registration of a new user. + /// This public API operation provides a code that Amazon Cognito sent to your + /// user when they signed up in your user pool via the SignUp + /// API operation. After your user enters their code, they confirm ownership + /// of the email address or phone number that they provided, and their user + /// account becomes active. Depending on your user pool configuration, your + /// users will receive their confirmation code in an email or SMS message. + /// + /// Local users who signed up in your user pool are the only type of user who + /// can confirm sign-up with a code. Users who federate through an external + /// identity provider (IdP) have already been confirmed by their IdP. + /// Administrator-created users, users created with the AdminCreateUser + /// API operation, confirm their accounts when they respond to their + /// invitation email message and choose a password. They do not receive a + /// confirmation code. Instead, they receive a temporary password. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -2477,7 +3315,11 @@ class CognitoIdentityProvider { /// The confirmation code sent by a user's request to confirm registration. /// /// Parameter [username] : - /// The user name of the user whose registration you want to confirm. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [analyticsMetadata] : /// The Amazon Pinpoint analytics metadata for collecting metrics for @@ -2577,8 +3419,25 @@ class CognitoIdentityProvider { } /// Creates a new group in the specified user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [GroupExistsException]. @@ -2617,168 +3476,177 @@ class CognitoIdentityProvider { /// The default Precedence value is null. The maximum /// Precedence value is 2^31-1. /// - /// Parameter [roleArn] : - /// The role Amazon Resource Name (ARN) for the group. - Future createGroup({ - required String groupName, - required String userPoolId, - String? description, - int? precedence, - String? roleArn, - }) async { - _s.validateNumRange( - 'precedence', - precedence, - 0, - 1152921504606846976, - ); - final headers = { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AWSCognitoIdentityProviderService.CreateGroup' - }; - final jsonResponse = await _protocol.send( - method: 'POST', - requestUri: '/', - exceptionFnMap: _exceptionFns, - // TODO queryParams - headers: headers, - payload: { - 'GroupName': groupName, - 'UserPoolId': userPoolId, - if (description != null) 'Description': description, - if (precedence != null) 'Precedence': precedence, - if (roleArn != null) 'RoleArn': roleArn, - }, - ); - - return CreateGroupResponse.fromJson(jsonResponse.body); - } - - /// Creates an IdP for a user pool. - /// - /// May throw [InvalidParameterException]. - /// May throw [DuplicateProviderException]. - /// May throw [ResourceNotFoundException]. - /// May throw [NotAuthorizedException]. - /// May throw [TooManyRequestsException]. - /// May throw [LimitExceededException]. - /// May throw [InternalErrorException]. - /// - /// Parameter [providerDetails] : - /// The IdP details. The following list describes the provider detail keys for - /// each IdP type. - /// - ///
      - ///
    • - /// For Google and Login with Amazon: - /// - ///
        - ///
      • - /// client_id - ///
      • - ///
      • - /// client_secret - ///
      • - ///
      • - /// authorize_scopes - ///
      • - ///
    • - ///
    • - /// For Facebook: - /// - ///
        - ///
      • - /// client_id - ///
      • - ///
      • - /// client_secret - ///
      • - ///
      • - /// authorize_scopes - ///
      • - ///
      • - /// api_version - ///
      • - ///
    • - ///
    • - /// For Sign in with Apple: - /// - ///
        - ///
      • - /// client_id - ///
      • - ///
      • - /// team_id - ///
      • - ///
      • - /// key_id - ///
      • - ///
      • - /// private_key - ///
      • - ///
      • - /// authorize_scopes - ///
      • - ///
    • - ///
    • - /// For OpenID Connect (OIDC) providers: - /// - ///
        - ///
      • - /// client_id - ///
      • - ///
      • - /// client_secret - ///
      • - ///
      • - /// attributes_request_method - ///
      • - ///
      • - /// oidc_issuer - ///
      • - ///
      • - /// authorize_scopes - ///
      • - ///
      • - /// The following keys are only present if Amazon Cognito didn't discover them - /// at the oidc_issuer URL. - /// + /// Parameter [roleArn] : + /// The role Amazon Resource Name (ARN) for the group. + Future createGroup({ + required String groupName, + required String userPoolId, + String? description, + int? precedence, + String? roleArn, + }) async { + _s.validateNumRange( + 'precedence', + precedence, + 0, + 1152921504606846976, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityProviderService.CreateGroup' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'GroupName': groupName, + 'UserPoolId': userPoolId, + if (description != null) 'Description': description, + if (precedence != null) 'Precedence': precedence, + if (roleArn != null) 'RoleArn': roleArn, + }, + ); + + return CreateGroupResponse.fromJson(jsonResponse.body); + } + + /// Adds a configuration and trust relationship between a third-party identity + /// provider (IdP) and a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

        Learn more + /// ///

      • - ///
      • - /// Amazon Cognito sets the value of the following keys automatically. They - /// are read-only. + ///
      /// - ///
        - ///
      • - /// attributes_url_add_attributes - ///
      • - ///
    • - ///
    - ///
  • - /// For SAML providers: + /// May throw [InvalidParameterException]. + /// May throw [DuplicateProviderException]. + /// May throw [ResourceNotFoundException]. + /// May throw [NotAuthorizedException]. + /// May throw [TooManyRequestsException]. + /// May throw [LimitExceededException]. + /// May throw [InternalErrorException]. /// - ///
      - ///
    • - /// MetadataFile or MetadataURL - ///
    • - ///
    • - /// IDPSignout optional - ///
    • - ///
  • - /// + /// Parameter [providerDetails] : + /// The scopes, URLs, and identifiers for your external identity provider. The + /// following examples describe the provider detail keys for each IdP type. + /// These values and their schema are subject to change. Social IdP + /// authorize_scopes values must match the values listed here. + ///
    OpenID Connect (OIDC)
    + /// Amazon Cognito accepts the following elements when it can't discover + /// endpoint URLs from oidc_issuer: attributes_url, + /// authorize_url, jwks_uri, token_url. + /// + /// Create or update request: "ProviderDetails": { + /// "attributes_request_method": "GET", "attributes_url": + /// "https://auth.example.com/userInfo", "authorize_scopes": "openid profile + /// email", "authorize_url": "https://auth.example.com/authorize", + /// "client_id": "1example23456789", "client_secret": + /// "provider-app-client-secret", "jwks_uri": + /// "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + /// + /// Describe response: "ProviderDetails": { "attributes_request_method": + /// "GET", "attributes_url": "https://auth.example.com/userInfo", + /// "attributes_url_add_attributes": "false", "authorize_scopes": "openid + /// profile email", "authorize_url": "https://auth.example.com/authorize", + /// "client_id": "1example23456789", "client_secret": + /// "provider-app-client-secret", "jwks_uri": + /// "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + ///
    SAML
    + /// Create or update request with Metadata URL: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataURL": "https://auth.example.com/sso/saml/metadata", + /// "RequestSigningAlgorithm": "rsa-sha256" } + /// + /// Create or update request with Metadata file: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" + /// } + /// + /// The value of MetadataFile must be the plaintext metadata + /// document with all quote (") characters escaped by backslashes. + /// + /// Describe response: "ProviderDetails": { "IDPInit": "true", + /// "IDPSignout": "true", "EncryptedResponses" : "true", + /// "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": + /// "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": + /// "rsa-sha256", "SLORedirectBindingURI": + /// "https://auth.example.com/slo/saml", "SSORedirectBindingURI": + /// "https://auth.example.com/sso/saml" } + ///
    LoginWithAmazon
    + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "profile postal_code", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret" + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://api.amazon.com/user/profile", "attributes_url_add_attributes": + /// "false", "authorize_scopes": "profile postal_code", "authorize_url": + /// "https://www.amazon.com/ap/oa", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret", "token_request_method": "POST", "token_url": + /// "https://api.amazon.com/auth/o2/token" } + ///
    Google
    + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email profile openid", "client_id": + /// "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://people.googleapis.com/v1/people/me?personFields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": "email + /// profile openid", "authorize_url": + /// "https://accounts.google.com/o/oauth2/v2/auth", "client_id": + /// "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret", "oidc_issuer": + /// "https://accounts.google.com", "token_request_method": "POST", + /// "token_url": "https://www.googleapis.com/oauth2/v4/token" } + ///
    SignInWithApple
    + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email name", "client_id": "com.example.cognito", "private_key": + /// "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" } + /// + /// Describe response: "ProviderDetails": { + /// "attributes_url_add_attributes": "false", "authorize_scopes": "email + /// name", "authorize_url": "https://appleid.apple.com/auth/authorize", + /// "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": + /// "https://appleid.apple.com", "team_id": "2EXAMPLE", + /// "token_request_method": "POST", "token_url": + /// "https://appleid.apple.com/auth/token" } + ///
    Facebook
    + /// Create or update request: "ProviderDetails": { "api_version": + /// "v17.0", "authorize_scopes": "public_profile, email", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "api_version": "v17.0", + /// "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": + /// "public_profile, email", "authorize_url": + /// "https://www.facebook.com/v17.0/dialog/oauth", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret", + /// "token_request_method": "GET", "token_url": + /// "https://graph.facebook.com/v17.0/oauth/access_token" } + ///
    /// /// Parameter [providerName] : /// The IdP name. @@ -2827,6 +3695,25 @@ class CognitoIdentityProvider { /// Creates a new OAuth2.0 resource server and defines custom scopes within /// it. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -2836,9 +3723,14 @@ class CognitoIdentityProvider { /// May throw [InternalErrorException]. /// /// Parameter [identifier] : - /// A unique resource server identifier for the resource server. This could be - /// an HTTPS endpoint where the resource server is located, such as - /// https://my-weather-api.example.com. + /// A unique resource server identifier for the resource server. The + /// identifier can be an API friendly name like + /// solar-system-data. You can also set an API URL like + /// https://solar-system-data-api.example.com as your identifier. + /// + /// Amazon Cognito represents scopes in the access token in the format + /// $resource-server-identifier/$scope. Longer scope-identifier + /// strings increase the size of your access tokens. /// /// Parameter [name] : /// A friendly name for the resource server. @@ -2876,7 +3768,26 @@ class CognitoIdentityProvider { return CreateResourceServerResponse.fromJson(jsonResponse.body); } - /// Creates the user import job. + /// Creates a user import job. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -2920,8 +3831,6 @@ class CognitoIdentityProvider { return CreateUserImportJobResponse.fromJson(jsonResponse.body); } - /// Creates a new Amazon Cognito user pool and sets the password policy for - /// the pool. /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number @@ -2939,10 +3848,34 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// + /// Creates a new Amazon Cognito user pool and sets the password policy for + /// the pool. + /// + /// If you don't provide a value for an attribute, Amazon Cognito sets it to + /// its default value. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [TooManyRequestsException]. @@ -3061,8 +3994,14 @@ class CognitoIdentityProvider { /// Verifying updates to email addresses and phone numbers. /// /// Parameter [userPoolAddOns] : - /// Enables advanced security risk detection. Set the key - /// AdvancedSecurityMode to the value "AUDIT". + /// User pool add-ons. Contains settings for activation of advanced security + /// features. To log user security information but take no action, set to + /// AUDIT. To configure automatic security responses to risky + /// traffic to your user pool, set to ENFORCED. + /// + /// For more information, see Adding + /// advanced security to a user pool. /// /// Parameter [userPoolTags] : /// The tag keys and values to assign to the user pool. A tag is a label that @@ -3075,9 +4014,18 @@ class CognitoIdentityProvider { /// /// Parameter [usernameConfiguration] : /// Case sensitivity on the username input for the selected sign-in option. - /// For example, when case sensitivity is set to False, users can - /// sign in using either "username" or "Username". This configuration is - /// immutable once it has been set. For more information, see False (case insensitive), + /// users can sign in with any combination of capital and lowercase letters. + /// For example, username, USERNAME, or + /// UserName, or for email, email@example.com or + /// EMaiL@eXamplE.Com. For most use cases, set case sensitivity + /// to False (case insensitive) as a best practice. When + /// usernames and email addresses are case insensitive, Amazon Cognito treats + /// any variation in case as the same user, and prevents a case variation from + /// being assigned to the same attribute for a different user. + /// + /// This configuration is immutable after you set it. For more information, + /// see UsernameConfigurationType. /// /// Parameter [verificationMessageTemplate] : @@ -3171,6 +4119,28 @@ class CognitoIdentityProvider { /// When you create a new user pool client, token revocation is automatically /// activated. For more information about revoking tokens, see RevokeToken. + /// + /// If you don't provide a value for an attribute, Amazon Cognito sets it to + /// its default value. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -3206,7 +4176,9 @@ class CognitoIdentityProvider { /// your access tokens are valid for one hour. /// /// Parameter [allowedOAuthFlows] : - /// The allowed OAuth flows. + /// The OAuth grant types that you want your app client to generate. To create + /// an app client that generates client credentials grants, you must add + /// client_credentials as the only allowed OAuth flow. ///
    code
    /// Use a code grant flow, which provides an authorization code as the /// response. This code can be exchanged for access tokens with the @@ -3221,8 +4193,33 @@ class CognitoIdentityProvider { ///
    /// /// Parameter [allowedOAuthFlowsUserPoolClient] : - /// Set to true if the client is allowed to follow the OAuth protocol when - /// interacting with Amazon Cognito user pools. + /// Set to true to use OAuth 2.0 features in your user pool app + /// client. + /// + /// AllowedOAuthFlowsUserPoolClient must be true + /// before you can configure the following features in your app client. + /// + ///
      + ///
    • + /// CallBackURLs: Callback URLs. + ///
    • + ///
    • + /// LogoutURLs: Sign-out redirect URLs. + ///
    • + ///
    • + /// AllowedOAuthScopes: OAuth 2.0 scopes. + ///
    • + ///
    • + /// AllowedOAuthFlows: Support for authorization code, implicit, + /// and client credentials OAuth 2.0 grants. + ///
    • + ///
    + /// To use OAuth 2.0 features, configure one of these features in the Amazon + /// Cognito console or set AllowedOAuthFlowsUserPoolClient to + /// true in a CreateUserPoolClient or + /// UpdateUserPoolClient API request. If you don't set a value + /// for AllowedOAuthFlowsUserPoolClient in a request with the CLI + /// or SDKs, it defaults to false. /// /// Parameter [allowedOAuthScopes] : /// The allowed OAuth scopes. Possible values provided by OAuth are @@ -3273,7 +4270,9 @@ class CognitoIdentityProvider { /// App callback URLs such as myapp://example are also supported. /// /// Parameter [defaultRedirectURI] : - /// The default redirect URI. Must be in the CallbackURLs list. + /// The default redirect URI. In app clients with one assigned IdP, replaces + /// redirect_uri in authentication requests. Must be in the + /// CallbackURLs list. /// /// A redirect URI must: /// @@ -3288,8 +4287,9 @@ class CognitoIdentityProvider { /// Not include a fragment component. /// /// - /// See OAuth 2.0 - /// - Redirection Endpoint. + /// For more information, see Default + /// redirect URI. /// /// Amazon Cognito requires HTTPS over HTTP except for http://localhost for /// testing purposes only. @@ -3374,8 +4374,8 @@ class CognitoIdentityProvider { /// and TokenValidityUnits as hours, your user can /// authenticate their session with their ID token for 10 hours. /// - /// The default time unit for AccessTokenValidity in an API - /// request is hours. Valid range is displayed below in seconds. + /// The default time unit for IdTokenValidity in an API request + /// is hours. Valid range is displayed below in seconds. /// /// If you don't specify otherwise in the configuration of your app client, /// your ID tokens are valid for one hour. @@ -3407,7 +4407,21 @@ class CognitoIdentityProvider { /// /// /// Parameter [readAttributes] : - /// The read attributes. + /// The list of user attributes that you want your app client to have + /// read-only access to. After your user authenticates in your app, their + /// access token authorizes them to read their own attribute value for any + /// attribute in this list. An example of this kind of activity is when your + /// user selects a link to view their profile information. Your app makes a GetUser + /// API request to retrieve and display your user's profile data. + /// + /// When you don't specify the ReadAttributes for your app + /// client, your app can read the values of email_verified, + /// phone_number_verified, and the Standard attributes of your + /// user pool. When your user pool has read access to these default + /// attributes, ReadAttributes doesn't return any information. + /// Amazon Cognito only populates ReadAttributes in the API + /// response if you have specified your own custom set of read attributes. /// /// Parameter [refreshTokenValidity] : /// The refresh token time limit. After this limit expires, your user can't @@ -3443,7 +4457,21 @@ class CognitoIdentityProvider { /// for RefreshToken is days, and default for ID and access tokens are hours. /// /// Parameter [writeAttributes] : - /// The user pool attributes that the app client can write to. + /// The list of user attributes that you want your app client to have write + /// access to. After your user authenticates in your app, their access token + /// authorizes them to set or modify their own attribute value for any + /// attribute in this list. An example of this kind of activity is when you + /// present your user with a form to update their profile information and they + /// change their last name. Your app then makes an UpdateUserAttributes + /// API request and sets family_name to the new value. + /// + /// When you don't specify the WriteAttributes for your app + /// client, your app can write the values of the Standard attributes of your + /// user pool. When your user pool has write access to these default + /// attributes, WriteAttributes doesn't return any information. + /// Amazon Cognito only populates WriteAttributes in the API + /// response if you have specified your own custom set of write attributes. /// /// If your app client allows users to sign in through an IdP, this array must /// include all attributes that you have mapped to IdP attributes. Amazon @@ -3558,6 +4586,25 @@ class CognitoIdentityProvider { } /// Creates a new domain for a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -3716,7 +4763,19 @@ class CognitoIdentityProvider { ); } - /// Allows a user to delete himself or herself. + /// Allows a user to delete their own user profile. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -3753,6 +4812,18 @@ class CognitoIdentityProvider { /// Deletes the attributes for a user. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -3941,7 +5012,14 @@ class CognitoIdentityProvider { /// May throw [InternalErrorException]. /// /// Parameter [identifier] : - /// The identifier for the resource server + /// A unique resource server identifier for the resource server. The + /// identifier can be an API friendly name like + /// solar-system-data. You can also set an API URL like + /// https://solar-system-data-api.example.com as your identifier. + /// + /// Amazon Cognito represents scopes in the access token in the format + /// $resource-server-identifier/$scope. Longer scope-identifier + /// strings increase the size of your access tokens. /// /// Parameter [userPoolId] : /// The user pool ID for the user pool that hosts the resource server. @@ -4044,6 +5122,25 @@ class CognitoIdentityProvider { /// Returns the configuration information and metadata of the specified user /// pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -4077,6 +5174,25 @@ class CognitoIdentityProvider { /// Client method for returning the configuration information and metadata of /// the specified user pool app client. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -4144,7 +5260,22 @@ class CognitoIdentityProvider { return DescribeUserPoolDomainResponse.fromJson(jsonResponse.body); } - /// Forgets the specified device. + /// Forgets the specified device. For more information about device + /// authentication, see Working + /// with user devices in your user pool. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -4175,6 +5306,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -4190,12 +5322,28 @@ class CognitoIdentityProvider { /// The method used to send the confirmation code is sent according to the /// specified AccountRecoverySetting. For more information, see Recovering - /// User Accounts in the Amazon Cognito Developer Guide. If neither - /// a verified phone number nor a verified email exists, an - /// InvalidParameterException is thrown. To use the confirmation - /// code for resetting the password, call in the Amazon Cognito Developer Guide. To use the + /// confirmation code for resetting the password, call ConfirmForgotPassword. + /// + /// If neither a verified phone number nor a verified email exists, this API + /// returns InvalidParameterException. If your app client has a + /// client secret and you don't provide a SECRET_HASH parameter, + /// this API returns NotAuthorizedException. + /// + /// To use this API operation, your user pool must have self-service account + /// recovery configured. Use AdminSetUserPassword + /// if you manage passwords as an administrator. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -4212,7 +5360,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -4237,8 +5385,11 @@ class CognitoIdentityProvider { /// The ID of the client associated with the user pool. /// /// Parameter [username] : - /// The user name of the user for whom you want to enter a code to reset a - /// forgotten password. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [analyticsMetadata] : /// The Amazon Pinpoint analytics metadata that contributes to your metrics @@ -4358,7 +5509,21 @@ class CognitoIdentityProvider { return GetCSVHeaderResponse.fromJson(jsonResponse.body); } - /// Gets the device. + /// Gets the device. For more information about device authentication, see Working + /// with user devices in your user pool. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -4389,6 +5554,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -4476,6 +5642,39 @@ class CognitoIdentityProvider { return GetIdentityProviderByIdentifierResponse.fromJson(jsonResponse.body); } + /// Gets the detailed activity logging configuration for a user pool. + /// + /// May throw [InvalidParameterException]. + /// May throw [InternalErrorException]. + /// May throw [TooManyRequestsException]. + /// May throw [NotAuthorizedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [userPoolId] : + /// The ID of the user pool where you want to view detailed activity logging + /// configuration. + Future getLogDeliveryConfiguration({ + required String userPoolId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSCognitoIdentityProviderService.GetLogDeliveryConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'UserPoolId': userPoolId, + }, + ); + + return GetLogDeliveryConfigurationResponse.fromJson(jsonResponse.body); + } + /// This method takes a user pool ID, and returns the signing certificate. The /// issued certificate is valid for 10 years from the date of issue. /// @@ -4554,6 +5753,18 @@ class CognitoIdentityProvider { /// Gets the user attributes and metadata for a user. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -4592,7 +5803,18 @@ class CognitoIdentityProvider { /// Generates a user attribute verification code for the specified attribute /// name. Sends a message to a user with a code that they must return in a /// VerifyUserAttribute request. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -4609,7 +5831,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -4737,10 +5959,48 @@ class CognitoIdentityProvider { return GetUserPoolMfaConfigResponse.fromJson(jsonResponse.body); } - /// Signs out users from all devices. It also invalidates all refresh tokens - /// that Amazon Cognito has issued to a user. A user can still use a hosted UI - /// cookie to retrieve new tokens for the duration of the 1-hour cookie - /// validity period. + /// Invalidates the identity, access, and refresh tokens that Amazon Cognito + /// issued to a user. Call this operation when your user signs out of your + /// app. This results in the following behavior. + /// + ///
      + ///
    • + /// Amazon Cognito no longer accepts token-authorized user operations + /// that you authorize with a signed-out user's access tokens. For more + /// information, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// Amazon Cognito returns an Access Token has been revoked error + /// when your app attempts to authorize a user pools API request with a + /// revoked access token that contains the scope + /// aws.cognito.signin.user.admin. + ///
    • + ///
    • + /// Amazon Cognito no longer accepts a signed-out user's ID token in a GetId + /// request to an identity pool with ServerSideTokenCheck + /// enabled for its user pool IdP configuration in CognitoIdentityProvider. + ///
    • + ///
    • + /// Amazon Cognito no longer accepts a signed-out user's refresh tokens in + /// refresh requests. + ///
    • + ///
    + /// Other requests might be valid until your user's token expires. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -4765,6 +6025,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -4779,6 +6040,14 @@ class CognitoIdentityProvider { /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-identity-federation.html"> /// Adding user pool sign-in through a third party. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -4795,7 +6064,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -4878,6 +6147,12 @@ class CognitoIdentityProvider { /// app client is configured with a client secret), DEVICE_KEY. /// ///
  • + /// For USER_PASSWORD_AUTH: USERNAME (required), + /// PASSWORD (required), SECRET_HASH (required if + /// the app client is configured with a client secret), + /// DEVICE_KEY. + ///
  • + ///
  • /// For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: /// REFRESH_TOKEN (required), SECRET_HASH (required /// if the app client is configured with a client secret), @@ -4891,6 +6166,12 @@ class CognitoIdentityProvider { /// (The SRP_A Value). ///
  • /// + /// For more information about SECRET_HASH, see Computing + /// secret hash values. For information about DEVICE_KEY, see + /// Working + /// with user devices in your user pool. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for certain @@ -4941,9 +6222,6 @@ class CognitoIdentityProvider { ///
  • /// Define auth challenge ///
  • - ///
  • - /// Verify auth challenge - ///
  • /// /// For more information, see @@ -5007,7 +6285,21 @@ class CognitoIdentityProvider { } /// Lists the sign-in devices that Amazon Cognito has registered to the - /// current user. + /// current user. For more information about device authentication, see Working + /// with user devices in your user pool. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5028,7 +6320,12 @@ class CognitoIdentityProvider { /// The limit of the device request. /// /// Parameter [paginationToken] : - /// The pagination token for the list request. + /// This API operation returns a limited number of results. The pagination + /// token is an identifier that you can present in an additional API request + /// with the same parameters. When you include the pagination token, Amazon + /// Cognito returns the next set of items after the current list. Subsequent + /// requests return a new pagination token. By use of this token, you can + /// paginate through the full list of items. Future listDevices({ required String accessToken, int? limit, @@ -5048,6 +6345,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -5061,8 +6359,25 @@ class CognitoIdentityProvider { } /// Lists the groups associated with a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more /// - /// Calling this action requires developer credentials. + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5111,6 +6426,25 @@ class CognitoIdentityProvider { } /// Lists information about all IdPs for a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5158,6 +6492,25 @@ class CognitoIdentityProvider { } /// Lists the resource servers for a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5242,7 +6595,26 @@ class CognitoIdentityProvider { return ListTagsForResourceResponse.fromJson(jsonResponse.body); } - /// Lists the user import jobs. + /// Lists user import jobs for a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -5257,9 +6629,12 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool that the users are being imported into. /// /// Parameter [paginationToken] : - /// An identifier that was returned from the previous call to - /// ListUserImportJobs, which can be used to return the next set - /// of import jobs in the list. + /// This API operation returns a limited number of results. The pagination + /// token is an identifier that you can present in an additional API request + /// with the same parameters. When you include the pagination token, Amazon + /// Cognito returns the next set of items after the current list. Subsequent + /// requests return a new pagination token. By use of this token, you can + /// paginate through the full list of items. Future listUserImportJobs({ required int maxResults, required String userPoolId, @@ -5293,6 +6668,25 @@ class CognitoIdentityProvider { } /// Lists the clients that have been created for the specified user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5343,6 +6737,25 @@ class CognitoIdentityProvider { } /// Lists the user pools associated with an Amazon Web Services account. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [TooManyRequestsException]. @@ -5386,7 +6799,26 @@ class CognitoIdentityProvider { return ListUserPoolsResponse.fromJson(jsonResponse.body); } - /// Lists the users in the Amazon Cognito user pool. + /// Lists users and their basic details in a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5399,15 +6831,23 @@ class CognitoIdentityProvider { /// performed. /// /// Parameter [attributesToGet] : - /// An array of strings, where each string is the name of a user attribute to - /// be returned for each user in the search results. If the array is null, all - /// attributes are returned. + /// A JSON array of user attribute names, for example given_name, + /// that you want Amazon Cognito to include in the response for each user. + /// When you don't provide an AttributesToGet parameter, Amazon + /// Cognito returns all attributes for each user. + /// + /// Use AttributesToGet with required attributes in your user + /// pool, or in conjunction with Filter. Amazon Cognito returns + /// an error if not all users in the results have set a value for the + /// attribute you request. Attributes that you can't filter on, including + /// custom attributes, must have a value set in every user profile before an + /// AttributesToGet parameter returns results. /// /// Parameter [filter] : /// A filter string of the form "AttributeName Filter-Type /// "AttributeValue"". Quotation marks within the filter string must be - /// escaped using the backslash (\) character. For example, - /// "family_name = \"Reddy\"". + /// escaped using the backslash (\) character. For example, + /// "family_name = \"Reddy\"". /// ///
      ///
    • @@ -5415,9 +6855,9 @@ class CognitoIdentityProvider { /// only search for one attribute at a time. ///
    • ///
    • - /// Filter-Type: For an exact match, use =, for example, - /// "given_name = \"Jon\"". For a prefix ("starts with") match, - /// use ^=, for example, "given_name ^= \"Jon\"". + /// Filter-Type: For an exact match, use =, for example, + /// "given_name = \"Jon\"". For a prefix ("starts with") match, + /// use ^=, for example, "given_name ^= \"Jon\"". ///
    • ///
    • /// AttributeValue: The attribute value that must be matched for each @@ -5491,8 +6931,12 @@ class CognitoIdentityProvider { /// Maximum number of users to be returned. /// /// Parameter [paginationToken] : - /// An identifier that was returned from the previous call to this operation, - /// which can be used to return the next set of items in the list. + /// This API operation returns a limited number of results. The pagination + /// token is an identifier that you can present in an additional API request + /// with the same parameters. When you include the pagination token, Amazon + /// Cognito returns the next set of items after the current list. Subsequent + /// requests return a new pagination token. By use of this token, you can + /// paginate through the full list of items. Future listUsers({ required String userPoolId, List? attributesToGet, @@ -5529,8 +6973,25 @@ class CognitoIdentityProvider { } /// Lists the users in the specified group. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more /// - /// Calling this action requires developer credentials. + ///

      /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5545,7 +7006,7 @@ class CognitoIdentityProvider { /// The user pool ID for the user pool. /// /// Parameter [limit] : - /// The limit of the request to list users. + /// The maximum number of users that you want to retrieve before pagination. /// /// Parameter [nextToken] : /// An identifier that was returned from the previous call to this operation, @@ -5586,6 +7047,14 @@ class CognitoIdentityProvider { /// Resends the confirmation (for confirmation of registration) to a specific /// user in the user pool. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -5602,7 +7071,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -5627,8 +7096,11 @@ class CognitoIdentityProvider { /// The ID of the client associated with the user pool. /// /// Parameter [username] : - /// The username attribute of the user to whom you want to resend - /// a confirmation code. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. /// /// Parameter [analyticsMetadata] : /// The Amazon Pinpoint analytics metadata that contributes to your metrics @@ -5715,8 +7187,25 @@ class CognitoIdentityProvider { return ResendConfirmationCodeResponse.fromJson(jsonResponse.body); } - /// Responds to the authentication challenge. + /// Some API operations in a user pool generate a challenge, like a prompt for + /// an MFA code, for device authentication that bypasses MFA, or for a custom + /// authentication challenge. A RespondToAuthChallenge API + /// request provides the answer to that challenge, like a code or a secure + /// remote password (SRP). The parameters of a response to an authentication + /// challenge vary with the type of challenge. + /// + /// For more information about custom authentication challenges, see Custom + /// authentication challenge Lambda triggers. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -5733,7 +7222,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -5774,32 +7263,35 @@ class CognitoIdentityProvider { /// for RespondToAuthChallenge calls. /// /// Parameter [challengeResponses] : - /// The challenge responses. These are inputs corresponding to the value of - /// ChallengeName, for example: - /// - /// SECRET_HASH (if app client is configured with client secret) - /// applies to all of the inputs that follow (including - /// SOFTWARE_TOKEN_MFA). - /// - ///
        - ///
      • - /// SMS_MFA: SMS_MFA_CODE, USERNAME. - ///
      • - ///
      • - /// PASSWORD_VERIFIER: PASSWORD_CLAIM_SIGNATURE, - /// PASSWORD_CLAIM_SECRET_BLOCK, TIMESTAMP, - /// USERNAME. - /// - /// PASSWORD_VERIFIER requires DEVICE_KEY when you - /// sign in with a remembered device. - ///
      • - ///
      • - /// NEW_PASSWORD_REQUIRED: NEW_PASSWORD, - /// USERNAME, SECRET_HASH (if app client is - /// configured with client secret). To set any required attributes that Amazon - /// Cognito returned as requiredAttributes in the - /// InitiateAuth response, add a - /// userAttributes.attributename parameter. This + /// The responses to the challenge that you received in the previous request. + /// Each challenge has its own required response parameters. The following + /// examples are partial JSON request bodies that highlight challenge-response + /// parameters. + /// + /// You must provide a SECRET_HASH parameter in all challenge responses to an + /// app client that has a client secret. + ///
        SMS_MFA
        + /// "ChallengeName": "SMS_MFA", "ChallengeResponses": {"SMS_MFA_CODE": + /// "[SMS_code]", "USERNAME": "[username]"} + ///
        PASSWORD_VERIFIER
        + /// "ChallengeName": "PASSWORD_VERIFIER", "ChallengeResponses": + /// {"PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", + /// "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], + /// "USERNAME": "[username]"} + /// + /// Add "DEVICE_KEY" when you sign in with a remembered device. + ///
        CUSTOM_CHALLENGE
        + /// "ChallengeName": "CUSTOM_CHALLENGE", "ChallengeResponses": + /// {"USERNAME": "[username]", "ANSWER": "[challenge_answer]"} + /// + /// Add "DEVICE_KEY" when you sign in with a remembered device. + ///
        NEW_PASSWORD_REQUIRED
        + /// "ChallengeName": "NEW_PASSWORD_REQUIRED", "ChallengeResponses": + /// {"NEW_PASSWORD": "[new_password]", "USERNAME": "[username]"} + /// + /// To set any required attributes that InitiateAuth returned in + /// an requiredAttributes parameter, add + /// "userAttributes.[attribute_name]": "[attribute_value]". This /// parameter can also set values for writable attributes that aren't required /// by your user pool. /// @@ -5809,26 +7301,33 @@ class CognitoIdentityProvider { /// Cognito returned in the requiredAttributes parameter, then /// use the UpdateUserAttributes API operation to modify the /// value of any additional attributes. - ///
      • - ///
      • - /// SOFTWARE_TOKEN_MFA: USERNAME and - /// SOFTWARE_TOKEN_MFA_CODE are required attributes. - ///
      • - ///
      • - /// DEVICE_SRP_AUTH requires USERNAME, - /// DEVICE_KEY, SRP_A (and - /// SECRET_HASH). - ///
      • - ///
      • - /// DEVICE_PASSWORD_VERIFIER requires everything that - /// PASSWORD_VERIFIER requires, plus DEVICE_KEY. - ///
      • - ///
      • - /// MFA_SETUP requires USERNAME, plus you must use - /// the session value returned by VerifySoftwareToken in the - /// Session parameter. - ///
      • - ///
      + ///
      SOFTWARE_TOKEN_MFA
      + /// "ChallengeName": "SOFTWARE_TOKEN_MFA", "ChallengeResponses": + /// {"USERNAME": "[username]", "SOFTWARE_TOKEN_MFA_CODE": + /// [authenticator_code]} + ///
      DEVICE_SRP_AUTH
      + /// "ChallengeName": "DEVICE_SRP_AUTH", "ChallengeResponses": + /// {"USERNAME": "[username]", "DEVICE_KEY": "[device_key]", "SRP_A": + /// "[srp_a]"} + ///
      DEVICE_PASSWORD_VERIFIER
      + /// "ChallengeName": "DEVICE_PASSWORD_VERIFIER", "ChallengeResponses": + /// {"DEVICE_KEY": "[device_key]", "PASSWORD_CLAIM_SIGNATURE": + /// "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", + /// "TIMESTAMP": [timestamp], "USERNAME": "[username]"} + ///
      MFA_SETUP
      + /// "ChallengeName": "MFA_SETUP", "ChallengeResponses": {"USERNAME": + /// "[username]"}, "SESSION": "[Session ID from VerifySoftwareToken]" + ///
      SELECT_MFA_TYPE
      + /// "ChallengeName": "SELECT_MFA_TYPE", "ChallengeResponses": + /// {"USERNAME": "[username]", "ANSWER": "[SMS_MFA or + /// SOFTWARE_TOKEN_MFA]"} + ///
      + /// For more information about SECRET_HASH, see Computing + /// secret hash values. For information about DEVICE_KEY, see + /// Working + /// with user devices in your user pool. /// /// Parameter [clientMetadata] : /// A map of custom key-value pairs that you can provide as input for any @@ -5923,6 +7422,15 @@ class CognitoIdentityProvider { /// the specified refresh token. After a token is revoked, you can't use the /// revoked token to access Amazon Cognito user APIs, or to authorize access /// to your resource server. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [TooManyRequestsException]. /// May throw [InternalErrorException]. @@ -5954,6 +7462,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -5964,6 +7473,46 @@ class CognitoIdentityProvider { ); } + /// Sets up or modifies the detailed activity logging configuration of a user + /// pool. + /// + /// May throw [InvalidParameterException]. + /// May throw [InternalErrorException]. + /// May throw [TooManyRequestsException]. + /// May throw [NotAuthorizedException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [logConfigurations] : + /// A collection of all of the detailed activity logging configurations for a + /// user pool. + /// + /// Parameter [userPoolId] : + /// The ID of the user pool where you want to configure detailed activity + /// logging . + Future setLogDeliveryConfiguration({ + required List logConfigurations, + required String userPoolId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSCognitoIdentityProviderService.SetLogDeliveryConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'LogConfigurations': logConfigurations, + 'UserPoolId': userPoolId, + }, + ); + + return SetLogDeliveryConfigurationResponse.fromJson(jsonResponse.body); + } + /// Configures actions on detected risks. To delete the risk configuration for /// UserPoolId or ClientId, pass null values for all /// four configuration types. @@ -6108,6 +7657,18 @@ class CognitoIdentityProvider { /// sign-in attempts, deactivate MFA for users and turn on Adaptive /// Authentication for the user pool. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -6139,6 +7700,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -6168,13 +7730,14 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// /// /// May throw [InvalidParameterException]. /// May throw [TooManyRequestsException]. + /// May throw [ConcurrentModificationException]. /// May throw [ResourceNotFoundException]. /// May throw [InvalidSmsRoleAccessPolicyException]. /// May throw [InvalidSmsRoleTrustRelationshipException]. @@ -6245,6 +7808,18 @@ class CognitoIdentityProvider { /// href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserMFAPreference.html">SetUserMFAPreference /// instead. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -6286,6 +7861,14 @@ class CognitoIdentityProvider { /// Registers the user in the specified user pool and creates a user name, /// password, and user attributes. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -6302,7 +7885,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -6317,6 +7900,7 @@ class CognitoIdentityProvider { /// May throw [UsernameExistsException]. /// May throw [TooManyRequestsException]. /// May throw [InternalErrorException]. + /// May throw [LimitExceededException]. /// May throw [InvalidSmsRoleAccessPolicyException]. /// May throw [InvalidSmsRoleTrustRelationshipException]. /// May throw [InvalidEmailRoleAccessPolicyException]. @@ -6330,7 +7914,9 @@ class CognitoIdentityProvider { /// The password of the user you want to register. /// /// Parameter [username] : - /// The user name of the user you want to register. + /// The username of the user that you want to sign up. The value of this + /// parameter is typically a username, but can be any alias attribute in your + /// user pool. /// /// Parameter [analyticsMetadata] : /// The Amazon Pinpoint analytics metadata that contributes to your metrics @@ -6393,7 +7979,21 @@ class CognitoIdentityProvider { /// generates and passes to Amazon Cognito when it makes API requests. /// /// Parameter [validationData] : - /// The validation data in the request to register a user. + /// Temporary user attributes that contribute to the outcomes of your pre + /// sign-up Lambda trigger. This set of key-value pairs are for custom + /// validation of information that you collect from your users but don't need + /// to retain. + /// + /// Your Lambda function can analyze this additional data and act on it. Your + /// function might perform external API operations like logging user + /// attributes and validation data to Amazon CloudWatch Logs. Validation data + /// might also affect the response that your function returns to Amazon + /// Cognito, like automatically confirming the user if they sign up from + /// within your network. + /// + /// For more information about the pre sign-up Lambda trigger, see Pre + /// sign-up Lambda trigger. Future signUp({ required String clientId, required String password, @@ -6597,6 +8197,15 @@ class CognitoIdentityProvider { /// Provides the feedback for an authentication event, whether it was from a /// valid user or not. This feedback is used for improving the risk evaluation /// decision for the user pool as part of Amazon Cognito advanced security. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -6613,13 +8222,23 @@ class CognitoIdentityProvider { /// The feedback token. /// /// Parameter [feedbackValue] : - /// The authentication event feedback value. + /// The authentication event feedback value. When you provide a + /// FeedbackValue value of valid, you tell Amazon + /// Cognito that you trust a user session where Amazon Cognito has evaluated + /// some level of risk. When you provide a FeedbackValue value of + /// invalid, you tell Amazon Cognito that you don't trust a user + /// session, or you don't believe that Amazon Cognito evaluated a high-enough + /// risk level. /// /// Parameter [userPoolId] : /// The user pool ID. /// /// Parameter [username] : - /// The user pool username. + /// The username of the user that you want to query or modify. The value of + /// this parameter is typically your user's username, but it can be any of + /// their alias attributes. If username isn't an alias attribute + /// in your user pool, this value must be the sub of a local user + /// or the username of a user from a third-party IdP. Future updateAuthEventFeedback({ required String eventId, required String feedbackToken, @@ -6636,6 +8255,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -6648,7 +8268,22 @@ class CognitoIdentityProvider { ); } - /// Updates the device status. + /// Updates the device status. For more information about device + /// authentication, see Working + /// with user devices in your user pool. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -6683,6 +8318,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -6695,8 +8331,25 @@ class CognitoIdentityProvider { } /// Updates the specified group with the specified attributes. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more /// - /// Calling this action requires developer credentials. + ///

      /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -6758,6 +8411,25 @@ class CognitoIdentityProvider { } /// Updates IdP information for a user pool. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more + /// + ///

      /// /// May throw [InvalidParameterException]. /// May throw [UnsupportedIdentityProviderException]. @@ -6780,8 +8452,109 @@ class CognitoIdentityProvider { /// A list of IdP identifiers. /// /// Parameter [providerDetails] : - /// The IdP details to be updated, such as MetadataURL and - /// MetadataFile. + /// The scopes, URLs, and identifiers for your external identity provider. The + /// following examples describe the provider detail keys for each IdP type. + /// These values and their schema are subject to change. Social IdP + /// authorize_scopes values must match the values listed here. + ///
      OpenID Connect (OIDC)
      + /// Amazon Cognito accepts the following elements when it can't discover + /// endpoint URLs from oidc_issuer: attributes_url, + /// authorize_url, jwks_uri, token_url. + /// + /// Create or update request: "ProviderDetails": { + /// "attributes_request_method": "GET", "attributes_url": + /// "https://auth.example.com/userInfo", "authorize_scopes": "openid profile + /// email", "authorize_url": "https://auth.example.com/authorize", + /// "client_id": "1example23456789", "client_secret": + /// "provider-app-client-secret", "jwks_uri": + /// "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + /// + /// Describe response: "ProviderDetails": { "attributes_request_method": + /// "GET", "attributes_url": "https://auth.example.com/userInfo", + /// "attributes_url_add_attributes": "false", "authorize_scopes": "openid + /// profile email", "authorize_url": "https://auth.example.com/authorize", + /// "client_id": "1example23456789", "client_secret": + /// "provider-app-client-secret", "jwks_uri": + /// "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + ///
      SAML
      + /// Create or update request with Metadata URL: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataURL": "https://auth.example.com/sso/saml/metadata", + /// "RequestSigningAlgorithm": "rsa-sha256" } + /// + /// Create or update request with Metadata file: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" + /// } + /// + /// The value of MetadataFile must be the plaintext metadata + /// document with all quote (") characters escaped by backslashes. + /// + /// Describe response: "ProviderDetails": { "IDPInit": "true", + /// "IDPSignout": "true", "EncryptedResponses" : "true", + /// "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": + /// "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": + /// "rsa-sha256", "SLORedirectBindingURI": + /// "https://auth.example.com/slo/saml", "SSORedirectBindingURI": + /// "https://auth.example.com/sso/saml" } + ///
      LoginWithAmazon
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "profile postal_code", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret" + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://api.amazon.com/user/profile", "attributes_url_add_attributes": + /// "false", "authorize_scopes": "profile postal_code", "authorize_url": + /// "https://www.amazon.com/ap/oa", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret", "token_request_method": "POST", "token_url": + /// "https://api.amazon.com/auth/o2/token" } + ///
      Google
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email profile openid", "client_id": + /// "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://people.googleapis.com/v1/people/me?personFields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": "email + /// profile openid", "authorize_url": + /// "https://accounts.google.com/o/oauth2/v2/auth", "client_id": + /// "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret", "oidc_issuer": + /// "https://accounts.google.com", "token_request_method": "POST", + /// "token_url": "https://www.googleapis.com/oauth2/v4/token" } + ///
      SignInWithApple
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email name", "client_id": "com.example.cognito", "private_key": + /// "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" } + /// + /// Describe response: "ProviderDetails": { + /// "attributes_url_add_attributes": "false", "authorize_scopes": "email + /// name", "authorize_url": "https://appleid.apple.com/auth/authorize", + /// "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": + /// "https://appleid.apple.com", "team_id": "2EXAMPLE", + /// "token_request_method": "POST", "token_url": + /// "https://appleid.apple.com/auth/token" } + ///
      Facebook
      + /// Create or update request: "ProviderDetails": { "api_version": + /// "v17.0", "authorize_scopes": "public_profile, email", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "api_version": "v17.0", + /// "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": + /// "public_profile, email", "authorize_url": + /// "https://www.facebook.com/v17.0/dialog/oauth", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret", + /// "token_request_method": "GET", "token_url": + /// "https://graph.facebook.com/v17.0/oauth/access_token" } + ///
      Future updateIdentityProvider({ required String providerName, required String userPoolId, @@ -6816,7 +8589,25 @@ class CognitoIdentityProvider { /// /// If you don't provide a value for an attribute, it is set to the default /// value. - /// + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more + /// + ///

      /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -6825,7 +8616,14 @@ class CognitoIdentityProvider { /// May throw [InternalErrorException]. /// /// Parameter [identifier] : - /// The identifier for the resource server. + /// A unique resource server identifier for the resource server. The + /// identifier can be an API friendly name like + /// solar-system-data. You can also set an API URL like + /// https://solar-system-data-api.example.com as your identifier. + /// + /// Amazon Cognito represents scopes in the access token in the format + /// $resource-server-identifier/$scope. Longer scope-identifier + /// strings increase the size of your access tokens. /// /// Parameter [name] : /// The name of the resource server. @@ -6862,8 +8660,23 @@ class CognitoIdentityProvider { return UpdateResourceServerResponse.fromJson(jsonResponse.body); } - /// Allows a user to update a specific attribute (one at a time). + /// With this operation, your users can update one or more of their attributes + /// with their own credentials. You authorize this API request with the user's + /// access token. To delete an attribute from your user, submit the attribute + /// in your API request with a blank value. Custom attribute values in this + /// request must include the custom: prefix. + /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number /// before you can send SMS messages to US phone numbers. If you use SMS text @@ -6880,7 +8693,7 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// @@ -6986,11 +8799,6 @@ class CognitoIdentityProvider { return UpdateUserAttributesResponse.fromJson(jsonResponse.body); } - /// Updates the specified user pool with the specified attributes. You can get - /// a list of the current user pool settings using DescribeUserPool. - /// If you don't provide a value for an attribute, it will be set to the - /// default value. /// /// This action might generate an SMS text message. Starting June 1, 2021, US /// telecom carriers require you to register an origination phone number @@ -7008,10 +8816,35 @@ class CognitoIdentityProvider { /// mode , you can send messages only to verified phone numbers. After /// you test your app while in the sandbox environment, you can move out of /// the sandbox and into production. For more information, see + /// href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-sms-settings.html"> /// SMS message settings for Amazon Cognito user pools in the Amazon /// Cognito Developer Guide. /// + /// Updates the specified user pool with the specified attributes. You can get + /// a list of the current user pool settings using DescribeUserPool. + /// + /// If you don't provide a value for an attribute, Amazon Cognito sets it to + /// its default value. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more + /// + ///

      /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -7130,8 +8963,14 @@ class CognitoIdentityProvider { /// Verifying updates to email addresses and phone numbers. /// /// Parameter [userPoolAddOns] : - /// Enables advanced security risk detection. Set the key - /// AdvancedSecurityMode to the value "AUDIT". + /// User pool add-ons. Contains settings for activation of advanced security + /// features. To log user security information but take no action, set to + /// AUDIT. To configure automatic security responses to risky + /// traffic to your user pool, set to ENFORCED. + /// + /// For more information, see Adding + /// advanced security to a user pool. /// /// Parameter [userPoolTags] : /// The tag keys and values to assign to the user pool. A tag is a label that @@ -7213,12 +9052,31 @@ class CognitoIdentityProvider { /// You can get a list of the current user pool app client settings using DescribeUserPoolClient. /// - /// If you don't provide a value for an attribute, it will be set to the - /// default value. + /// If you don't provide a value for an attribute, Amazon Cognito sets it to + /// its default value. /// /// You can also use this operation to enable token revocation for user pool /// clients. For more information about revoking tokens, see RevokeToken. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

      Learn more + /// + ///

      /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. @@ -7269,8 +9127,33 @@ class CognitoIdentityProvider { /// /// /// Parameter [allowedOAuthFlowsUserPoolClient] : - /// Set to true if the client is allowed to follow the OAuth protocol when - /// interacting with Amazon Cognito user pools. + /// Set to true to use OAuth 2.0 features in your user pool app + /// client. + /// + /// AllowedOAuthFlowsUserPoolClient must be true + /// before you can configure the following features in your app client. + /// + ///
        + ///
      • + /// CallBackURLs: Callback URLs. + ///
      • + ///
      • + /// LogoutURLs: Sign-out redirect URLs. + ///
      • + ///
      • + /// AllowedOAuthScopes: OAuth 2.0 scopes. + ///
      • + ///
      • + /// AllowedOAuthFlows: Support for authorization code, implicit, + /// and client credentials OAuth 2.0 grants. + ///
      • + ///
      + /// To use OAuth 2.0 features, configure one of these features in the Amazon + /// Cognito console or set AllowedOAuthFlowsUserPoolClient to + /// true in a CreateUserPoolClient or + /// UpdateUserPoolClient API request. If you don't set a value + /// for AllowedOAuthFlowsUserPoolClient in a request with the CLI + /// or SDKs, it defaults to false. /// /// Parameter [allowedOAuthScopes] : /// The allowed OAuth scopes. Possible values provided by OAuth are @@ -7418,8 +9301,8 @@ class CognitoIdentityProvider { /// and TokenValidityUnits as hours, your user can /// authenticate their session with their ID token for 10 hours. /// - /// The default time unit for AccessTokenValidity in an API - /// request is hours. Valid range is displayed below in seconds. + /// The default time unit for IdTokenValidity in an API request + /// is hours. Valid range is displayed below in seconds. /// /// If you don't specify otherwise in the configuration of your app client, /// your ID tokens are valid for one hour. @@ -7451,7 +9334,21 @@ class CognitoIdentityProvider { ///
    /// /// Parameter [readAttributes] : - /// The read-only attributes of the user pool. + /// The list of user attributes that you want your app client to have + /// read-only access to. After your user authenticates in your app, their + /// access token authorizes them to read their own attribute value for any + /// attribute in this list. An example of this kind of activity is when your + /// user selects a link to view their profile information. Your app makes a GetUser + /// API request to retrieve and display your user's profile data. + /// + /// When you don't specify the ReadAttributes for your app + /// client, your app can read the values of email_verified, + /// phone_number_verified, and the Standard attributes of your + /// user pool. When your user pool has read access to these default + /// attributes, ReadAttributes doesn't return any information. + /// Amazon Cognito only populates ReadAttributes in the API + /// response if you have specified your own custom set of read attributes. /// /// Parameter [refreshTokenValidity] : /// The refresh token time limit. After this limit expires, your user can't @@ -7481,12 +9378,35 @@ class CognitoIdentityProvider { /// providers. /// /// Parameter [tokenValidityUnits] : - /// The units in which the validity times are represented. The default unit - /// for RefreshToken is days, and the default for ID and access tokens is - /// hours. + /// The time units you use when you set the duration of ID, access, and + /// refresh tokens. The default unit for RefreshToken is days, and the default + /// for ID and access tokens is hours. /// /// Parameter [writeAttributes] : - /// The writeable attributes of the user pool. + /// The list of user attributes that you want your app client to have write + /// access to. After your user authenticates in your app, their access token + /// authorizes them to set or modify their own attribute value for any + /// attribute in this list. An example of this kind of activity is when you + /// present your user with a form to update their profile information and they + /// change their last name. Your app then makes an UpdateUserAttributes + /// API request and sets family_name to the new value. + /// + /// When you don't specify the WriteAttributes for your app + /// client, your app can write the values of the Standard attributes of your + /// user pool. When your user pool has write access to these default + /// attributes, WriteAttributes doesn't return any information. + /// Amazon Cognito only populates WriteAttributes in the API + /// response if you have specified your own custom set of write attributes. + /// + /// If your app client allows users to sign in through an IdP, this array must + /// include all attributes that you have mapped to IdP attributes. Amazon + /// Cognito updates mapped attributes when users sign in to your application + /// through an IdP. If your app client does not have write access to a mapped + /// attribute, Amazon Cognito throws an error when it tries to update the + /// attribute. For more information, see Specifying + /// IdP Attribute Mappings for Your user pool. Future updateUserPoolClient({ required String clientId, required String userPoolId, @@ -7623,6 +9543,25 @@ class CognitoIdentityProvider { /// Using /// Your Own Domain for the Hosted UI. + /// + /// Amazon Cognito evaluates Identity and Access Management (IAM) policies in + /// requests for this API operation. For this operation, you must use IAM + /// credentials to authorize requests, and you must grant yourself the + /// corresponding IAM permission in a policy. + ///

    Learn more + /// + ///

    /// /// May throw [InvalidParameterException]. /// May throw [NotAuthorizedException]. @@ -7676,6 +9615,15 @@ class CognitoIdentityProvider { /// (TOTP) code and mark the user's software token MFA status as "verified" if /// successful. The request takes an access token or a session string, but not /// both. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -7720,6 +9668,7 @@ class CognitoIdentityProvider { method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, + signed: false, // TODO queryParams headers: headers, payload: { @@ -7742,6 +9691,18 @@ class CognitoIdentityProvider { /// href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UserAttributeUpdateSettingsType.html"> /// UserAttributeUpdateSettingsType. /// + /// Authorize this action with a signed-in user's access token. It must + /// include the scope aws.cognito.signin.user.admin. + /// + /// Amazon Cognito doesn't evaluate Identity and Access Management (IAM) + /// policies in requests for this API operation. For this operation, you can't + /// use IAM credentials to authorize requests, and you can't grant IAM + /// permissions in policies. For more information about authorization models + /// in Amazon Cognito, see Using + /// the Amazon Cognito user pools API and user pool endpoints. + /// + /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [CodeMismatchException]. @@ -8180,7 +10141,7 @@ class AdminGetDeviceResponse { /// Represents the response from the server from the request to get the /// specified user as an administrator. class AdminGetUserResponse { - /// The user name of the user about whom you're receiving information. + /// The username of the user that you requested. final String username; /// Indicates that the status is enabled. @@ -8202,7 +10163,9 @@ class AdminGetUserResponse { /// The date the user was created. final DateTime? userCreateDate; - /// The date the user was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? userLastModifiedDate; /// The MFA options that are activated for the user. The possible values in this @@ -8219,9 +10182,6 @@ class AdminGetUserResponse { /// CONFIRMED - User has been confirmed. /// ///
  • - /// ARCHIVED - User is no longer active. - ///
  • - ///
  • /// UNKNOWN - User status isn't known. ///
  • ///
  • @@ -8370,7 +10330,7 @@ class AdminInitiateAuthResponse { ///
  • /// MFA_SETUP: For users who are required to set up an MFA factor /// before they can sign in. The MFA types activated for the user pool will be - /// listed in the challenge parameters MFA_CAN_SETUP value. + /// listed in the challenge parameters MFAS_CAN_SETUP value. /// /// To set up software token MFA, use the session returned here from /// InitiateAuth as an input to @@ -8462,7 +10422,10 @@ class AdminListDevicesResponse { /// The devices in the list of devices response. final List? devices; - /// The pagination token. + /// The identifier that Amazon Cognito returned with the previous request to + /// this operation. When you include a pagination token in your request, Amazon + /// Cognito returns the next set of items in the list. By use of this token, you + /// can paginate through the full list of items. final String? paginationToken; AdminListDevicesResponse({ @@ -8789,7 +10752,7 @@ extension AliasAttributeTypeFromString on String { /// The Amazon Pinpoint analytics configuration necessary to collect metrics for /// a user pool. /// -/// In Regions where Amazon Pinpointisn't available, user pools only support +/// In Regions where Amazon Pinpoint isn't available, user pools only support /// sending events to Amazon Pinpoint projects in us-east-1. In Regions where /// Amazon Pinpoint is available, user pools support sending events to Amazon /// Pinpoint projects within that same Region. @@ -8979,7 +10942,9 @@ class AuthEventType { /// The challenge responses. final List? challengeResponses; - /// The creation date + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The user context data captured at the time of an event request. This value @@ -9345,6 +11310,39 @@ class ChangePasswordResponse { } } +/// The CloudWatch logging destination of a user pool detailed activity logging +/// configuration. +class CloudWatchLogsConfigurationType { + /// The Amazon Resource Name (arn) of a CloudWatch Logs log group where your + /// user pool sends logs. The log group must not be encrypted with Key + /// Management Service and must be in the same Amazon Web Services account as + /// your user pool. + /// + /// To send logs to log groups with a resource policy of a size greater than + /// 5120 characters, configure a log group with a path that starts with + /// /aws/vendedlogs. For more information, see Enabling + /// logging from certain Amazon Web Services services. + final String? logGroupArn; + + CloudWatchLogsConfigurationType({ + this.logGroupArn, + }); + + factory CloudWatchLogsConfigurationType.fromJson(Map json) { + return CloudWatchLogsConfigurationType( + logGroupArn: json['LogGroupArn'] as String?, + ); + } + + Map toJson() { + final logGroupArn = this.logGroupArn; + return { + if (logGroupArn != null) 'LogGroupArn': logGroupArn, + }; + } +} + /// The delivery details for an email or SMS message that Amazon Cognito sent /// for authentication or verification. class CodeDeliveryDetailsType { @@ -9699,7 +11697,10 @@ class CreateUserPoolClientResponse { class CreateUserPoolDomainResponse { /// The Amazon CloudFront endpoint that you use as the target of the alias that - /// you set up with your Domain Name Service (DNS) provider. + /// you set up with your Domain Name Service (DNS) provider. Amazon Cognito + /// returns this value if you set a custom domain with + /// CustomDomainConfig. If you set an Amazon Cognito prefix domain, + /// this operation returns a blank response. final String? cloudFrontDomain; CreateUserPoolDomainResponse({ @@ -9771,15 +11772,18 @@ class CustomDomainConfigType { } } -/// A custom email sender Lambda configuration type. +/// The properties of a custom email sender Lambda trigger. class CustomEmailLambdaVersionConfigType { - /// The Amazon Resource Name (ARN) of the Lambda function that Amazon Cognito - /// activates to send email notifications to users. + /// The Amazon Resource Name (ARN) of the function that you want to assign to + /// your Lambda trigger. final String lambdaArn; - /// Signature of the "request" attribute in the "event" information Amazon - /// Cognito passes to your custom email Lambda function. The only supported - /// value is V1_0. + /// The user pool trigger version of the request that Amazon Cognito sends to + /// your Lambda function. Higher-numbered versions add fields that support new + /// features. + /// + /// You must use a LambdaVersion of V1_0 with a custom + /// sender function. final CustomEmailSenderLambdaVersionType lambdaVersion; CustomEmailLambdaVersionConfigType({ @@ -9831,15 +11835,18 @@ extension CustomEmailSenderLambdaVersionTypeFromString on String { } } -/// A custom SMS sender Lambda configuration type. +/// The properties of a custom SMS sender Lambda trigger. class CustomSMSLambdaVersionConfigType { - /// The Amazon Resource Name (ARN) of the Lambda function that Amazon Cognito - /// activates to send SMS notifications to users. + /// The Amazon Resource Name (ARN) of the function that you want to assign to + /// your Lambda trigger. final String lambdaArn; - /// Signature of the "request" attribute in the "event" information that Amazon - /// Cognito passes to your custom SMS Lambda function. The only supported value - /// is V1_0. + /// The user pool trigger version of the request that Amazon Cognito sends to + /// your Lambda function. Higher-numbered versions add fields that support new + /// features. + /// + /// You must use a LambdaVersion of V1_0 with a custom + /// sender function. final CustomSMSSenderLambdaVersionType lambdaVersion; CustomSMSLambdaVersionConfigType({ @@ -10319,7 +12326,9 @@ class DeviceType { /// The date when the device was last authenticated. final DateTime? deviceLastAuthenticatedDate; - /// The last modified date of the device. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? deviceLastModifiedDate; DeviceType({ @@ -10369,7 +12378,8 @@ class DomainDescriptionType { /// The Amazon Web Services ID for the user pool owner. final String? awsAccountId; - /// The Amazon Resource Name (ARN) of the Amazon CloudFront distribution. + /// The Amazon CloudFront endpoint that you use as the target of the alias that + /// you set up with your Domain Name Service (DNS) provider. final String? cloudFrontDistribution; /// The configuration for a custom domain that hosts the sign-up and sign-in @@ -10566,9 +12576,13 @@ class EmailConfigurationType { /// The destination to which the receiver of the email should reply. final String? replyToEmailAddress; - /// The ARN of a verified email address in Amazon SES. Amazon Cognito uses this - /// email address in one of the following ways, depending on the value that you - /// specify for the EmailSendingAccount parameter: + /// The ARN of a verified email address or an address from a verified domain in + /// Amazon SES. You can set a SourceArn email from a verified + /// domain only with an API request. You can set a verified email address, but + /// not an address in a verified domain, in the Amazon Cognito console. Amazon + /// Cognito uses the email address that you provide in one of the following + /// ways, depending on the value that you specify for the + /// EmailSendingAccount parameter: /// ///
      ///
    • @@ -10709,7 +12723,13 @@ class EventContextDataType { /// Specifies the event feedback type. class EventFeedbackType { - /// The event feedback value. + /// The authentication event feedback value. When you provide a + /// FeedbackValue value of valid, you tell Amazon + /// Cognito that you trust a user session where Amazon Cognito has evaluated + /// some level of risk. When you provide a FeedbackValue value of + /// invalid, you tell Amazon Cognito that you don't trust a user + /// session, or you don't believe that Amazon Cognito evaluated a high-enough + /// risk level. final FeedbackValueType feedbackValue; /// The provider. @@ -10851,6 +12871,29 @@ class EventRiskType { } } +enum EventSourceName { + userNotification, +} + +extension EventSourceNameValueExtension on EventSourceName { + String toValue() { + switch (this) { + case EventSourceName.userNotification: + return 'userNotification'; + } + } +} + +extension EventSourceNameFromString on String { + EventSourceName toEventSourceName() { + switch (this) { + case 'userNotification': + return EventSourceName.userNotification; + } + throw Exception('$this is not known in enum EventSourceName'); + } +} + enum EventType { signIn, signUp, @@ -11113,6 +13156,33 @@ class GetIdentityProviderByIdentifierResponse { } } +class GetLogDeliveryConfigurationResponse { + /// The detailed activity logging configuration of the requested user pool. + final LogDeliveryConfigurationType? logDeliveryConfiguration; + + GetLogDeliveryConfigurationResponse({ + this.logDeliveryConfiguration, + }); + + factory GetLogDeliveryConfigurationResponse.fromJson( + Map json) { + return GetLogDeliveryConfigurationResponse( + logDeliveryConfiguration: json['LogDeliveryConfiguration'] != null + ? LogDeliveryConfigurationType.fromJson( + json['LogDeliveryConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final logDeliveryConfiguration = this.logDeliveryConfiguration; + return { + if (logDeliveryConfiguration != null) + 'LogDeliveryConfiguration': logDeliveryConfiguration, + }; + } +} + /// Response from Amazon Cognito for a signing certificate request. class GetSigningCertificateResponse { /// The signing certificate. @@ -11258,7 +13328,7 @@ class GetUserResponse { /// the attribute name. final List userAttributes; - /// The user name of the user you want to retrieve from the get user request. + /// The username of the user that you requested. final String username; /// This response parameter is no longer supported. It provides @@ -11334,7 +13404,9 @@ class GlobalSignOutResponse { /// The group type. class GroupType { - /// The date the group was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// A string containing the description of the group. @@ -11343,7 +13415,9 @@ class GroupType { /// The name of the group. final String? groupName; - /// The date the group was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// A non-negative integer value that specifies the precedence of this group @@ -11443,132 +13517,118 @@ class IdentityProviderType { /// A mapping of IdP attributes to standard and custom user pool attributes. final Map? attributeMapping; - /// The date the IdP was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// A list of IdP identifiers. final List? idpIdentifiers; - /// The date the IdP was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; - /// The IdP details. The following list describes the provider detail keys for - /// each IdP type. - /// - ///
        - ///
      • - /// For Google and Login with Amazon: - /// - ///
          - ///
        • - /// client_id - ///
        • - ///
        • - /// client_secret - ///
        • - ///
        • - /// authorize_scopes - ///
        • - ///
      • - ///
      • - /// For Facebook: - /// - ///
          - ///
        • - /// client_id - ///
        • - ///
        • - /// client_secret - ///
        • - ///
        • - /// authorize_scopes - ///
        • - ///
        • - /// api_version - ///
        • - ///
      • - ///
      • - /// For Sign in with Apple: - /// - ///
          - ///
        • - /// client_id - ///
        • - ///
        • - /// team_id - ///
        • - ///
        • - /// key_id - ///
        • - ///
        • - /// private_key - /// - /// You can submit a private_key when you add or update an IdP. Describe - /// operations don't return the private key. - ///
        • - ///
        • - /// authorize_scopes - ///
        • - ///
      • - ///
      • - /// For OIDC providers: - /// - ///
          - ///
        • - /// client_id - ///
        • - ///
        • - /// client_secret - ///
        • - ///
        • - /// attributes_request_method - ///
        • - ///
        • - /// oidc_issuer - ///
        • - ///
        • - /// authorize_scopes - ///
        • - ///
        • - /// The following keys are only present if Amazon Cognito didn't discover them - /// at the oidc_issuer URL. - /// - ///
            - ///
          • - /// authorize_url - ///
          • - ///
          • - /// token_url - ///
          • - ///
          • - /// attributes_url - ///
          • - ///
          • - /// jwks_uri - ///
          • - ///
        • - ///
        • - /// Amazon Cognito sets the value of the following keys automatically. They are - /// read-only. - /// - ///
            - ///
          • - /// attributes_url_add_attributes - ///
          • - ///
        • - ///
      • - ///
      • - /// For SAML providers: - /// - ///
          - ///
        • - /// MetadataFile or MetadataURL - ///
        • - ///
        • - /// IDPSignout optional - ///
        • - ///
      • - ///
      + /// The scopes, URLs, and identifiers for your external identity provider. The + /// following examples describe the provider detail keys for each IdP type. + /// These values and their schema are subject to change. Social IdP + /// authorize_scopes values must match the values listed here. + ///
      OpenID Connect (OIDC)
      + /// Amazon Cognito accepts the following elements when it can't discover + /// endpoint URLs from oidc_issuer: attributes_url, + /// authorize_url, jwks_uri, token_url. + /// + /// Create or update request: "ProviderDetails": { + /// "attributes_request_method": "GET", "attributes_url": + /// "https://auth.example.com/userInfo", "authorize_scopes": "openid profile + /// email", "authorize_url": "https://auth.example.com/authorize", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret", + /// "jwks_uri": "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + /// + /// Describe response: "ProviderDetails": { "attributes_request_method": + /// "GET", "attributes_url": "https://auth.example.com/userInfo", + /// "attributes_url_add_attributes": "false", "authorize_scopes": "openid + /// profile email", "authorize_url": "https://auth.example.com/authorize", + /// "client_id": "1example23456789", "client_secret": + /// "provider-app-client-secret", "jwks_uri": + /// "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": + /// "https://auth.example.com", "token_url": "https://example.com/token" + /// } + ///
      SAML
      + /// Create or update request with Metadata URL: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataURL": "https://auth.example.com/sso/saml/metadata", + /// "RequestSigningAlgorithm": "rsa-sha256" } + /// + /// Create or update request with Metadata file: "ProviderDetails": { + /// "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", + /// "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" + /// } + /// + /// The value of MetadataFile must be the plaintext metadata + /// document with all quote (") characters escaped by backslashes. + /// + /// Describe response: "ProviderDetails": { "IDPInit": "true", + /// "IDPSignout": "true", "EncryptedResponses" : "true", + /// "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": + /// "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": + /// "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", + /// "SSORedirectBindingURI": "https://auth.example.com/sso/saml" } + ///
      LoginWithAmazon
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "profile postal_code", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret" + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://api.amazon.com/user/profile", "attributes_url_add_attributes": + /// "false", "authorize_scopes": "profile postal_code", "authorize_url": + /// "https://www.amazon.com/ap/oa", "client_id": + /// "amzn1.application-oa2-client.1example23456789", "client_secret": + /// "provider-app-client-secret", "token_request_method": "POST", "token_url": + /// "https://api.amazon.com/auth/o2/token" } + ///
      Google
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email profile openid", "client_id": + /// "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "attributes_url": + /// "https://people.googleapis.com/v1/people/me?personFields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": "email profile + /// openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", + /// "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": + /// "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", + /// "token_request_method": "POST", "token_url": + /// "https://www.googleapis.com/oauth2/v4/token" } + ///
      SignInWithApple
      + /// Create or update request: "ProviderDetails": { "authorize_scopes": + /// "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", + /// "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" } + /// + /// Describe response: "ProviderDetails": { + /// "attributes_url_add_attributes": "false", "authorize_scopes": "email name", + /// "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": + /// "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": + /// "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": + /// "POST", "token_url": "https://appleid.apple.com/auth/token" } + ///
      Facebook
      + /// Create or update request: "ProviderDetails": { "api_version": "v17.0", + /// "authorize_scopes": "public_profile, email", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret" } + /// + /// Describe response: "ProviderDetails": { "api_version": "v17.0", + /// "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", + /// "attributes_url_add_attributes": "true", "authorize_scopes": + /// "public_profile, email", "authorize_url": + /// "https://www.facebook.com/v17.0/dialog/oauth", "client_id": + /// "1example23456789", "client_secret": "provider-app-client-secret", + /// "token_request_method": "GET", "token_url": + /// "https://graph.facebook.com/v17.0/oauth/access_token" } + ///
      final Map? providerDetails; /// The IdP name. @@ -11691,8 +13751,8 @@ class InitiateAuthResponse { final AuthenticationResultType? authenticationResult; /// The name of the challenge that you're responding to with this call. This - /// name is returned in the AdminInitiateAuth response if you must - /// pass another challenge. + /// name is returned in the InitiateAuth response if you must pass + /// another challenge. /// /// Valid values include the following: /// @@ -11745,7 +13805,7 @@ class InitiateAuthResponse { ///
    • /// MFA_SETUP: For users who are required to setup an MFA factor /// before they can sign in. The MFA types activated for the user pool will be - /// listed in the challenge parameters MFA_CAN_SETUP value. + /// listed in the challenge parameters MFAS_CAN_SETUP value. /// /// To set up software token MFA, use the session returned here from /// InitiateAuth as an input to @@ -11847,9 +13907,23 @@ class LambdaConfigType { /// A pre-registration Lambda trigger. final String? preSignUp; - /// A Lambda trigger that is invoked before token generation. + /// The Amazon Resource Name (ARN) of the function that you want to assign to + /// your Lambda trigger. + /// + /// Set this parameter for legacy purposes. If you also set an ARN in + /// PreTokenGenerationConfig, its value must be identical to + /// PreTokenGeneration. For new instances of pre token generation + /// triggers, set the LambdaArn of + /// PreTokenGenerationConfig. + /// + /// You can set final String? preTokenGeneration; + /// The detailed configuration of a pre token generation trigger. If you also + /// set an ARN in PreTokenGeneration, its value must be identical + /// to PreTokenGenerationConfig. + final PreTokenGenerationVersionConfigType? preTokenGenerationConfig; + /// The user migration Lambda config type. final String? userMigration; @@ -11868,6 +13942,7 @@ class LambdaConfigType { this.preAuthentication, this.preSignUp, this.preTokenGeneration, + this.preTokenGenerationConfig, this.userMigration, this.verifyAuthChallengeResponse, }); @@ -11891,6 +13966,10 @@ class LambdaConfigType { preAuthentication: json['PreAuthentication'] as String?, preSignUp: json['PreSignUp'] as String?, preTokenGeneration: json['PreTokenGeneration'] as String?, + preTokenGenerationConfig: json['PreTokenGenerationConfig'] != null + ? PreTokenGenerationVersionConfigType.fromJson( + json['PreTokenGenerationConfig'] as Map) + : null, userMigration: json['UserMigration'] as String?, verifyAuthChallengeResponse: json['VerifyAuthChallengeResponse'] as String?, @@ -11909,6 +13988,7 @@ class LambdaConfigType { final preAuthentication = this.preAuthentication; final preSignUp = this.preSignUp; final preTokenGeneration = this.preTokenGeneration; + final preTokenGenerationConfig = this.preTokenGenerationConfig; final userMigration = this.userMigration; final verifyAuthChallengeResponse = this.verifyAuthChallengeResponse; return { @@ -11925,6 +14005,8 @@ class LambdaConfigType { if (preAuthentication != null) 'PreAuthentication': preAuthentication, if (preSignUp != null) 'PreSignUp': preSignUp, if (preTokenGeneration != null) 'PreTokenGeneration': preTokenGeneration, + if (preTokenGenerationConfig != null) + 'PreTokenGenerationConfig': preTokenGenerationConfig, if (userMigration != null) 'UserMigration': userMigration, if (verifyAuthChallengeResponse != null) 'VerifyAuthChallengeResponse': verifyAuthChallengeResponse, @@ -11937,7 +14019,10 @@ class ListDevicesResponse { /// The devices returned in the list devices response. final List? devices; - /// The pagination token for the list device response. + /// The identifier that Amazon Cognito returned with the previous request to + /// this operation. When you include a pagination token in your request, Amazon + /// Cognito returns the next set of items in the list. By use of this token, you + /// can paginate through the full list of items. final String? paginationToken; ListDevicesResponse({ @@ -12088,8 +14173,10 @@ class ListTagsForResourceResponse { /// Represents the response from the server to the request to list the user /// import jobs. class ListUserImportJobsResponse { - /// An identifier that can be used to return the next set of user import jobs in - /// the list. + /// The identifier that Amazon Cognito returned with the previous request to + /// this operation. When you include a pagination token in your request, Amazon + /// Cognito returns the next set of items in the list. By use of this token, you + /// can paginate through the full list of items. final String? paginationToken; /// The user import jobs. @@ -12195,7 +14282,7 @@ class ListUsersInGroupResponse { /// items in the list. final String? nextToken; - /// The users returned in the request to list users. + /// A list of users in the group, and their attributes. final List? users; ListUsersInGroupResponse({ @@ -12225,11 +14312,23 @@ class ListUsersInGroupResponse { /// The response from the request to list users. class ListUsersResponse { - /// An identifier that was returned from the previous call to this operation, - /// which can be used to return the next set of items in the list. + /// The identifier that Amazon Cognito returned with the previous request to + /// this operation. When you include a pagination token in your request, Amazon + /// Cognito returns the next set of items in the list. By use of this token, you + /// can paginate through the full list of items. final String? paginationToken; - /// The users returned in the request to list users. + /// A list of the user pool users, and their attributes, that match your query. + /// + /// Amazon Cognito creates a profile in your user pool for each native user in + /// your user pool, and each unique user ID from your third-party identity + /// providers (IdPs). When you link users with the AdminLinkProviderForUser + /// API operation, the output of ListUsers displays both the IdP + /// user and the native user that you linked. You can identify IdP users in the + /// Users object of this API response by the IdP prefix that Amazon + /// Cognito appends to Username. + /// final List? users; ListUsersResponse({ @@ -12257,6 +14356,105 @@ class ListUsersResponse { } } +/// The logging parameters of a user pool. +class LogConfigurationType { + /// The source of events that your user pool sends for detailed activity + /// logging. + final EventSourceName eventSource; + + /// The errorlevel selection of logs that a user pool sends for + /// detailed activity logging. + final LogLevel logLevel; + + /// The CloudWatch logging destination of a user pool. + final CloudWatchLogsConfigurationType? cloudWatchLogsConfiguration; + + LogConfigurationType({ + required this.eventSource, + required this.logLevel, + this.cloudWatchLogsConfiguration, + }); + + factory LogConfigurationType.fromJson(Map json) { + return LogConfigurationType( + eventSource: (json['EventSource'] as String).toEventSourceName(), + logLevel: (json['LogLevel'] as String).toLogLevel(), + cloudWatchLogsConfiguration: json['CloudWatchLogsConfiguration'] != null + ? CloudWatchLogsConfigurationType.fromJson( + json['CloudWatchLogsConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final eventSource = this.eventSource; + final logLevel = this.logLevel; + final cloudWatchLogsConfiguration = this.cloudWatchLogsConfiguration; + return { + 'EventSource': eventSource.toValue(), + 'LogLevel': logLevel.toValue(), + if (cloudWatchLogsConfiguration != null) + 'CloudWatchLogsConfiguration': cloudWatchLogsConfiguration, + }; + } +} + +/// The logging parameters of a user pool. +class LogDeliveryConfigurationType { + /// The detailed activity logging destination of a user pool. + final List logConfigurations; + + /// The ID of the user pool where you configured detailed activity logging. + final String userPoolId; + + LogDeliveryConfigurationType({ + required this.logConfigurations, + required this.userPoolId, + }); + + factory LogDeliveryConfigurationType.fromJson(Map json) { + return LogDeliveryConfigurationType( + logConfigurations: (json['LogConfigurations'] as List) + .whereNotNull() + .map((e) => LogConfigurationType.fromJson(e as Map)) + .toList(), + userPoolId: json['UserPoolId'] as String, + ); + } + + Map toJson() { + final logConfigurations = this.logConfigurations; + final userPoolId = this.userPoolId; + return { + 'LogConfigurations': logConfigurations, + 'UserPoolId': userPoolId, + }; + } +} + +enum LogLevel { + error, +} + +extension LogLevelValueExtension on LogLevel { + String toValue() { + switch (this) { + case LogLevel.error: + return 'ERROR'; + } + } +} + +extension LogLevelFromString on String { + LogLevel toLogLevel() { + switch (this) { + case 'ERROR': + return LogLevel.error; + } + throw Exception('$this is not known in enum LogLevel'); + } +} + /// This data type is no longer supported. Applies only to SMS /// multi-factor authentication (MFA) configurations. Does not apply to /// time-based one-time password (TOTP) software token MFA configurations. @@ -12501,7 +14699,9 @@ class NotifyEmailType { /// The minimum and maximum values of an attribute that is of the number data /// type. class NumberAttributeConstraintsType { - /// The maximum value of an attribute that is of the number data type. + /// The maximum length of a number attribute value. Must be a number less than + /// or equal to 2^1023, represented as a string with a length of + /// 131072 characters or fewer. final String? maxValue; /// The minimum value of an attribute that is of the number data type. @@ -12586,7 +14786,9 @@ class PasswordPolicyType { /// The number of days a temporary password is valid in the password policy. If /// the user doesn't sign in during this time, an administrator must reset their - /// password. + /// password. Defaults to 7. If you submit a value of + /// 0, Amazon Cognito treats it as a null value and sets + /// TemporaryPasswordValidityDays to its default value. /// /// When you set TemporaryPasswordValidityDays for a user pool, you /// can no longer set a value for the legacy @@ -12634,6 +14836,75 @@ class PasswordPolicyType { } } +enum PreTokenGenerationLambdaVersionType { + v1_0, + v2_0, +} + +extension PreTokenGenerationLambdaVersionTypeValueExtension + on PreTokenGenerationLambdaVersionType { + String toValue() { + switch (this) { + case PreTokenGenerationLambdaVersionType.v1_0: + return 'V1_0'; + case PreTokenGenerationLambdaVersionType.v2_0: + return 'V2_0'; + } + } +} + +extension PreTokenGenerationLambdaVersionTypeFromString on String { + PreTokenGenerationLambdaVersionType toPreTokenGenerationLambdaVersionType() { + switch (this) { + case 'V1_0': + return PreTokenGenerationLambdaVersionType.v1_0; + case 'V2_0': + return PreTokenGenerationLambdaVersionType.v2_0; + } + throw Exception( + '$this is not known in enum PreTokenGenerationLambdaVersionType'); + } +} + +/// The properties of a pre token generation Lambda trigger. +class PreTokenGenerationVersionConfigType { + /// The Amazon Resource Name (ARN) of the function that you want to assign to + /// your Lambda trigger. + /// + /// This parameter and the PreTokenGeneration property of + /// LambdaConfig have the same value. For new instances of pre + /// token generation triggers, set LambdaArn. + final String lambdaArn; + + /// The user pool trigger version of the request that Amazon Cognito sends to + /// your Lambda function. Higher-numbered versions add fields that support new + /// features. + final PreTokenGenerationLambdaVersionType lambdaVersion; + + PreTokenGenerationVersionConfigType({ + required this.lambdaArn, + required this.lambdaVersion, + }); + + factory PreTokenGenerationVersionConfigType.fromJson( + Map json) { + return PreTokenGenerationVersionConfigType( + lambdaArn: json['LambdaArn'] as String, + lambdaVersion: (json['LambdaVersion'] as String) + .toPreTokenGenerationLambdaVersionType(), + ); + } + + Map toJson() { + final lambdaArn = this.lambdaArn; + final lambdaVersion = this.lambdaVersion; + return { + 'LambdaArn': lambdaArn, + 'LambdaVersion': lambdaVersion.toValue(), + }; + } +} + enum PreventUserExistenceErrorTypes { legacy, enabled, @@ -12666,7 +14937,9 @@ extension PreventUserExistenceErrorTypesFromString on String { /// A container for IdP details. class ProviderDescription { - /// The date the provider was added to the user pool. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The date the provider was last modified. @@ -12868,7 +15141,14 @@ class ResourceServerScopeType { /// A container for information about a resource server for a user pool. class ResourceServerType { - /// The identifier for the resource server. + /// A unique resource server identifier for the resource server. The identifier + /// can be an API friendly name like solar-system-data. You can + /// also set an API URL like + /// https://solar-system-data-api.example.com as your identifier. + /// + /// Amazon Cognito represents scopes in the access token in the format + /// $resource-server-identifier/$scope. Longer scope-identifier + /// strings increase the size of your access tokens. final String? identifier; /// The name of the resource server. @@ -12998,7 +15278,9 @@ class RiskConfigurationType { final CompromisedCredentialsRiskConfigurationType? compromisedCredentialsRiskConfiguration; - /// The last modified date. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// The configuration to override the risk decision. @@ -13202,9 +15484,23 @@ class SMSMfaSettingsType { } } -/// Contains information about the schema attribute. +/// A list of the user attributes and their properties in your user pool. The +/// attribute schema contains standard attributes, custom attributes with a +/// custom: prefix, and developer attributes with a +/// dev: prefix. For more information, see User +/// pool attributes. +/// +/// Developer-only attributes are a legacy feature of user pools, are read-only +/// to all app clients. You can create and update developer-only attributes only +/// with IAM-authenticated API operations. Use app client read/write permissions +/// instead. class SchemaAttributeType { - /// The attribute data type. + /// The data format of the values for your attribute. When you choose an + /// AttributeDataType, Amazon Cognito validates the input against + /// the data type. A custom attribute value in your user's ID token is always a + /// string, for example "custom:isMember" : "true" or + /// "custom:YearsAsMember" : "12". final AttributeDataType? attributeDataType; /// @@ -13222,16 +15518,25 @@ class SchemaAttributeType { /// Specifies whether the value of the attribute can be changed. /// - /// For any user pool attribute that is mapped to an IdP attribute, you must set - /// this parameter to true. Amazon Cognito updates mapped - /// attributes when users sign in to your application through an IdP. If an - /// attribute is immutable, Amazon Cognito throws an error when it attempts to - /// update the attribute. For more information, see true. Amazon Cognito updates + /// mapped attributes when users sign in to your application through an IdP. If + /// an attribute is immutable, Amazon Cognito throws an error when it attempts + /// to update the attribute. For more information, see Specifying /// Identity Provider Attribute Mappings for Your User Pool. final bool? mutable; - /// A schema attribute of the name type. + /// The name of your user pool attribute. When you create or update a user pool, + /// adding a schema attribute creates a custom or developer-only attribute. When + /// you add an attribute with a Name value of + /// MyAttribute, Amazon Cognito creates the custom attribute + /// custom:MyAttribute. When DeveloperOnlyAttribute is + /// true, Amazon Cognito creates your attribute as + /// dev:MyAttribute. In an operation that describes a user pool, + /// Amazon Cognito returns this value as value for standard + /// attributes, custom:value for custom attributes, and + /// dev:value for developer-only attributes.. final String? name; /// Specifies the constraints for an attribute of the number type. @@ -13298,6 +15603,34 @@ class SchemaAttributeType { } } +class SetLogDeliveryConfigurationResponse { + /// The detailed activity logging configuration that you applied to the + /// requested user pool. + final LogDeliveryConfigurationType? logDeliveryConfiguration; + + SetLogDeliveryConfigurationResponse({ + this.logDeliveryConfiguration, + }); + + factory SetLogDeliveryConfigurationResponse.fromJson( + Map json) { + return SetLogDeliveryConfigurationResponse( + logDeliveryConfiguration: json['LogDeliveryConfiguration'] != null + ? LogDeliveryConfigurationType.fromJson( + json['LogDeliveryConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final logDeliveryConfiguration = this.logDeliveryConfiguration; + return { + if (logDeliveryConfiguration != null) + 'LogDeliveryConfiguration': logDeliveryConfiguration, + }; + } +} + class SetRiskConfigurationResponse { /// The risk configuration. final RiskConfigurationType riskConfiguration; @@ -13721,7 +16054,9 @@ class StopUserImportJobResponse { /// The constraints associated with a string attribute. class StringAttributeConstraintsType { - /// The maximum length. + /// The maximum length of a string attribute value. Must be a number less than + /// or equal to 2^1023, represented as a string with a length of + /// 131072 characters or fewer. final String? maxLength; /// The minimum length. @@ -13806,18 +16141,24 @@ class TokenValidityUnitsType { /// hours, or days for the value that you set in the /// AccessTokenValidity parameter. The default /// AccessTokenValidity time unit is hours. + /// AccessTokenValidity duration can range from five minutes to one + /// day. final TimeUnitsType? accessToken; /// A time unit of seconds, minutes, /// hours, or days for the value that you set in the /// IdTokenValidity parameter. The default /// IdTokenValidity time unit is hours. + /// IdTokenValidity duration can range from five minutes to one + /// day. final TimeUnitsType? idToken; /// A time unit of seconds, minutes, /// hours, or days for the value that you set in the /// RefreshTokenValidity parameter. The default /// RefreshTokenValidity time unit is days. + /// RefreshTokenValidity duration can range from 60 minutes to 10 + /// years. final TimeUnitsType? refreshToken; TokenValidityUnitsType({ @@ -13858,13 +16199,17 @@ class UICustomizationType { /// The client ID for the client app. final String? clientId; - /// The creation date for the UI customization. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The logo image for the UI customization. final String? imageUrl; - /// The last-modified date for the UI customization. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// The user pool ID for the user pool. @@ -14135,8 +16480,6 @@ class UserAttributeUpdateSettingsType { /// You can verify an updated email address or phone number with a VerifyUserAttribute /// API request. You can also call the UpdateUserAttributes - /// or AdminUpdateUserAttributes /// API and set email_verified or /// phone_number_verified to true. @@ -14275,7 +16618,9 @@ class UserImportJobType { /// The message returned when the user import job is completed. final String? completionMessage; - /// The date the user import job was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The number of users that couldn't be imported. @@ -14406,9 +16751,16 @@ class UserImportJobType { } } -/// The user pool add-ons type. +/// User pool add-ons. Contains settings for activation of advanced security +/// features. To log user security information but take no action, set to +/// AUDIT. To configure automatic security responses to risky +/// traffic to your user pool, set to ENFORCED. +/// +/// For more information, see Adding +/// advanced security to a user pool. class UserPoolAddOnsType { - /// The advanced security mode. + /// The operating mode of advanced security features in your user pool. final AdvancedSecurityModeType advancedSecurityMode; UserPoolAddOnsType({ @@ -14501,8 +16853,33 @@ class UserPoolClientType { /// final List? allowedOAuthFlows; - /// Set to true if the client is allowed to follow the OAuth protocol when - /// interacting with Amazon Cognito user pools. + /// Set to true to use OAuth 2.0 features in your user pool app + /// client. + /// + /// AllowedOAuthFlowsUserPoolClient must be true + /// before you can configure the following features in your app client. + /// + ///
        + ///
      • + /// CallBackURLs: Callback URLs. + ///
      • + ///
      • + /// LogoutURLs: Sign-out redirect URLs. + ///
      • + ///
      • + /// AllowedOAuthScopes: OAuth 2.0 scopes. + ///
      • + ///
      • + /// AllowedOAuthFlows: Support for authorization code, implicit, + /// and client credentials OAuth 2.0 grants. + ///
      • + ///
      + /// To use OAuth 2.0 features, configure one of these features in the Amazon + /// Cognito console or set AllowedOAuthFlowsUserPoolClient to + /// true in a CreateUserPoolClient or + /// UpdateUserPoolClient API request. If you don't set a value for + /// AllowedOAuthFlowsUserPoolClient in a request with the CLI or + /// SDKs, it defaults to false. final bool? allowedOAuthFlowsUserPoolClient; /// The OAuth scopes that your app client supports. Possible values that OAuth @@ -14559,7 +16936,9 @@ class UserPoolClientType { /// The client secret from the user pool request of the client type. final String? clientSecret; - /// The date the user pool client was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The default redirect URI. Must be in the CallbackURLs list. @@ -14669,14 +17048,16 @@ class UserPoolClientType { /// and TokenValidityUnits as hours, your user can /// authenticate their session with their ID token for 10 hours. /// - /// The default time unit for AccessTokenValidity in an API request - /// is hours. Valid range is displayed below in seconds. + /// The default time unit for IdTokenValidity in an API request is + /// hours. Valid range is displayed below in seconds. /// /// If you don't specify otherwise in the configuration of your app client, your /// ID tokens are valid for one hour. final int? idTokenValidity; - /// The date the user pool client was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// A list of allowed logout URLs for the IdPs. @@ -14705,7 +17086,21 @@ class UserPoolClientType { ///
    final PreventUserExistenceErrorTypes? preventUserExistenceErrors; - /// The Read-only attributes. + /// The list of user attributes that you want your app client to have read-only + /// access to. After your user authenticates in your app, their access token + /// authorizes them to read their own attribute value for any attribute in this + /// list. An example of this kind of activity is when your user selects a link + /// to view their profile information. Your app makes a GetUser + /// API request to retrieve and display your user's profile data. + /// + /// When you don't specify the ReadAttributes for your app client, + /// your app can read the values of email_verified, + /// phone_number_verified, and the Standard attributes of your user + /// pool. When your user pool has read access to these default attributes, + /// ReadAttributes doesn't return any information. Amazon Cognito + /// only populates ReadAttributes in the API response if you have + /// specified your own custom set of read attributes. final List? readAttributes; /// The refresh token time limit. After this limit expires, your user can't use @@ -14742,7 +17137,30 @@ class UserPoolClientType { /// The user pool ID for the user pool client. final String? userPoolId; - /// The writeable attributes. + /// The list of user attributes that you want your app client to have write + /// access to. After your user authenticates in your app, their access token + /// authorizes them to set or modify their own attribute value for any attribute + /// in this list. An example of this kind of activity is when you present your + /// user with a form to update their profile information and they change their + /// last name. Your app then makes an UpdateUserAttributes + /// API request and sets family_name to the new value. + /// + /// When you don't specify the WriteAttributes for your app client, + /// your app can write the values of the Standard attributes of your user pool. + /// When your user pool has write access to these default attributes, + /// WriteAttributes doesn't return any information. Amazon Cognito + /// only populates WriteAttributes in the API response if you have + /// specified your own custom set of write attributes. + /// + /// If your app client allows users to sign in through an IdP, this array must + /// include all attributes that you have mapped to IdP attributes. Amazon + /// Cognito updates mapped attributes when users sign in to your application + /// through an IdP. If your app client does not have write access to a mapped + /// attribute, Amazon Cognito throws an error when it tries to update the + /// attribute. For more information, see Specifying + /// IdP Attribute Mappings for Your user pool. final List? writeAttributes; UserPoolClientType({ @@ -14911,7 +17329,9 @@ class UserPoolClientType { /// A user pool description. class UserPoolDescriptionType { - /// The date the user pool description was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// The ID in a user pool description. @@ -14920,7 +17340,9 @@ class UserPoolDescriptionType { /// The Lambda configuration information in a user pool description. final LambdaConfigType? lambdaConfig; - /// The date the user pool description was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// The name in a user pool description. @@ -15054,7 +17476,9 @@ class UserPoolType { /// The attributes that are auto-verified in a user pool. final List? autoVerifiedAttributes; - /// The date the user pool was created. + /// The date and time when the item was created. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? creationDate; /// A custom domain name that you provide to Amazon Cognito. This parameter @@ -15091,7 +17515,7 @@ class UserPoolType { /// The email configuration of your user pool. The email configuration type sets /// your preferred sending method, Amazon Web Services Region, and sender for - /// messages tfrom your user pool. + /// messages from your user pool. final EmailConfigurationType? emailConfiguration; /// Deprecated. Review error codes from API requests with @@ -15116,7 +17540,9 @@ class UserPoolType { /// The Lambda triggers associated with the user pool. final LambdaConfigType? lambdaConfig; - /// The date the user pool was last modified. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? lastModifiedDate; /// Can be one of the following values: @@ -15143,7 +17569,17 @@ class UserPoolType { /// The policies associated with the user pool. final UserPoolPolicyType? policies; - /// A container with the schema attributes of a user pool. + /// A list of the user attributes and their properties in your user pool. The + /// attribute schema contains standard attributes, custom attributes with a + /// custom: prefix, and developer attributes with a + /// dev: prefix. For more information, see User + /// pool attributes. + /// + /// Developer-only attributes are a legacy feature of user pools, are read-only + /// to all app clients. You can create and update developer-only attributes only + /// with IAM-authenticated API operations. Use app client read/write permissions + /// instead. final List? schemaAttributes; /// The contents of the SMS authentication message. @@ -15168,9 +17604,9 @@ class UserPoolType { ///
    SNSSandbox
    /// The Amazon Web Services account is in the SNS SMS Sandbox and messages will /// only reach verified end users. This parameter won’t get populated with - /// SNSSandbox if the IAM user creating the user pool doesn’t have SNS - /// permissions. To learn how to move your Amazon Web Services account out of - /// the sandbox, see Moving /// out of the SMS sandbox. ///
    @@ -15180,7 +17616,7 @@ class UserPoolType { /// href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_VerificationMessageTemplateType.html">VerificationMessageTemplateType. final String? smsVerificationMessage; - /// The status of a user pool. + /// This parameter is no longer used. final StatusType? status; /// The settings for updates to user attributes. These settings include the @@ -15192,7 +17628,14 @@ class UserPoolType { /// Verifying updates to email addresses and phone numbers. final UserAttributeUpdateSettingsType? userAttributeUpdateSettings; - /// The user pool add-ons. + /// User pool add-ons. Contains settings for activation of advanced security + /// features. To log user security information but take no action, set to + /// AUDIT. To configure automatic security responses to risky + /// traffic to your user pool, set to ENFORCED. + /// + /// For more information, see Adding + /// advanced security to a user pool. final UserPoolAddOnsType? userPoolAddOns; /// The tags that are assigned to the user pool. A tag is a label that you can @@ -15438,6 +17881,7 @@ enum UserStatusType { unknown, resetRequired, forceChangePassword, + externalProvider, } extension UserStatusTypeValueExtension on UserStatusType { @@ -15457,6 +17901,8 @@ extension UserStatusTypeValueExtension on UserStatusType { return 'RESET_REQUIRED'; case UserStatusType.forceChangePassword: return 'FORCE_CHANGE_PASSWORD'; + case UserStatusType.externalProvider: + return 'EXTERNAL_PROVIDER'; } } } @@ -15478,6 +17924,8 @@ extension UserStatusTypeFromString on String { return UserStatusType.resetRequired; case 'FORCE_CHANGE_PASSWORD': return UserStatusType.forceChangePassword; + case 'EXTERNAL_PROVIDER': + return UserStatusType.externalProvider; } throw Exception('$this is not known in enum UserStatusType'); } @@ -15497,7 +17945,9 @@ class UserType { /// The creation date of the user. final DateTime? userCreateDate; - /// The last modified date of the user. + /// The date and time when the item was modified. Amazon Cognito returns this + /// timestamp in UNIX epoch time format. Your SDK might render the output in a + /// human-readable format like ISO 8601 or a Java Date object. final DateTime? userLastModifiedDate; /// The user status. This can be one of the following: @@ -15513,9 +17963,6 @@ class UserType { /// EXTERNAL_PROVIDER - User signed in with a third-party IdP. ///
  • ///
  • - /// ARCHIVED - User is no longer active. - ///
  • - ///
  • /// UNKNOWN - User status isn't known. ///
  • ///
  • @@ -15614,7 +18061,11 @@ extension UsernameAttributeTypeFromString on String { /// The username configuration type. class UsernameConfigurationType { /// Specifies whether user name case sensitivity will be applied for all users - /// in the user pool through Amazon Cognito APIs. + /// in the user pool through Amazon Cognito APIs. For most use cases, set case + /// sensitivity to False (case insensitive) as a best practice. + /// When usernames and email addresses are case insensitive, users can sign in + /// as the same user when they enter a different capitalization of their user + /// name. /// /// Valid values include: ///
    True
    @@ -15623,10 +18074,11 @@ class UsernameConfigurationType { /// their given username, such as “UserName”. This is the default value. ///
    False
    /// Enables case insensitivity for all username input. For example, when this - /// option is set to False, users can sign in using either - /// "username" or "Username". This option also enables both - /// preferred_username and email alias to be case - /// insensitive, in addition to the username attribute. + /// option is set to False, users can sign in using + /// username, USERNAME, or UserName. This + /// option also enables both preferred_username and + /// email alias to be case insensitive, in addition to the + /// username attribute. ///
    final bool caseSensitive; diff --git a/aws_client/lib/src/generated/comprehend/v2017_11_27.dart b/aws_client/lib/src/generated/comprehend/v2017_11_27.dart index b4b51443f..2f09c6348 100644 --- a/aws_client/lib/src/generated/comprehend/v2017_11_27.dart +++ b/aws_client/lib/src/generated/comprehend/v2017_11_27.dart @@ -263,7 +263,7 @@ class Comprehend { /// /// For more information about targeted sentiment, see Targeted - /// sentiment. + /// sentiment in the Amazon Comprehend Developer Guide. /// /// May throw [InvalidRequestException]. /// May throw [TextSizeLimitExceededException]. @@ -302,15 +302,30 @@ class Comprehend { return BatchDetectTargetedSentimentResponse.fromJson(jsonResponse.body); } - /// Creates a new document classification request to analyze a single document - /// in real-time, using a previously created and trained custom model and an - /// endpoint. - /// - /// You can input plain text or you can upload a single-page input document - /// (text, PDF, Word, or image). + /// Creates a classification request to analyze a single document in + /// real-time. ClassifyDocument supports the following model + /// types: /// + ///
      + ///
    • + /// Custom classifier - a custom model that you have created and trained. For + /// input, you can provide plain text, a single-page document (PDF, Word, or + /// image), or Amazon Textract API output. For more information, see Custom + /// classification in the Amazon Comprehend Developer Guide. + ///
    • + ///
    • + /// Prompt safety classifier - Amazon Comprehend provides a pre-trained model + /// for classifying input prompts for generative AI applications. For input, + /// you provide English plain text input. For prompt safety classification, + /// the response includes only the Classes field. For more + /// information about prompt safety classifiers, see Prompt + /// safety classification in the Amazon Comprehend Developer Guide. + ///
    • + ///
    /// If the system detects errors while processing a page in the input - /// document, the API response includes an entry in Errors that + /// document, the API response includes an Errors field that /// describes the errors. /// /// If the system detects a document-level error in your input document, the @@ -325,16 +340,29 @@ class Comprehend { /// May throw [InternalServerException]. /// /// Parameter [endpointArn] : - /// The Amazon Resource Number (ARN) of the endpoint. For information about - /// endpoints, see Managing - /// endpoints. + /// The Amazon Resource Number (ARN) of the endpoint. + /// + /// For prompt safety classification, Amazon Comprehend provides the endpoint + /// ARN. For more information about prompt safety classifiers, see Prompt + /// safety classification in the Amazon Comprehend Developer Guide + /// + /// For custom classification, you create an endpoint for your custom model. + /// For more information, see Using + /// Amazon Comprehend endpoints. /// /// Parameter [bytes] : /// Use the Bytes parameter to input a text, PDF, Word or image - /// file. You can also use the Bytes parameter to input an Amazon - /// Textract DetectDocumentText or AnalyzeDocument - /// output file. + /// file. + /// + /// When you classify a document using a custom model, you can also use the + /// Bytes parameter to input an Amazon Textract + /// DetectDocumentText or AnalyzeDocument output + /// file. + /// + /// To classify a document using the prompt safety classifier, use the + /// Text parameter for input. /// /// Provide the input document as a sequence of base64-encoded bytes. If your /// code uses an Amazon Web Services SDK to classify documents, the SDK may @@ -394,8 +422,7 @@ class Comprehend { /// May throw [InternalServerException]. /// /// Parameter [languageCode] : - /// The language of the input documents. Currently, English is the only valid - /// language. + /// The language of the input documents. /// /// Parameter [text] : /// A UTF-8 text string. The maximum string size is 100 KB. @@ -531,11 +558,11 @@ class Comprehend { /// /// Parameter [mode] : /// Indicates the mode in which the classifier will be trained. The classifier - /// can be trained in multi-class mode, which identifies one and only one - /// class for each document, or multi-label mode, which identifies one or more - /// labels for each document. In multi-label mode, multiple labels for an - /// individual document are separated by a delimiter. The default delimiter - /// between labels is a pipe (|). + /// can be trained in multi-class (single-label) mode or multi-label mode. + /// Multi-class mode identifies a single class label for each document and + /// multi-label mode identifies one or more class labels for each document. + /// Multiple labels for an individual document are separated by a delimiter. + /// The default delimiter between labels is a pipe (|). /// /// Parameter [modelKmsKeyId] : /// ID for the KMS key that Amazon Comprehend uses to encrypt trained custom @@ -571,7 +598,7 @@ class Comprehend { /// /// Parameter [outputDataConfig] : /// Specifies the location for the output files from a custom classifier job. - /// This parameter is required for a request that creates a native classifier + /// This parameter is required for a request that creates a native document /// model. /// /// Parameter [tags] : @@ -934,7 +961,9 @@ class Comprehend { /// /// Parameter [activeModelArn] : /// To associate an existing model with the flywheel, specify the Amazon - /// Resource Number (ARN) of the model version. + /// Resource Number (ARN) of the model version. Do not set + /// TaskConfig or ModelType if you specify an + /// ActiveModelArn. /// /// Parameter [clientRequestToken] : /// A unique identifier for the request. If you don't set the client request @@ -944,13 +973,16 @@ class Comprehend { /// Data security configurations. /// /// Parameter [modelType] : - /// The model type. + /// The model type. You need to set ModelType if you are creating + /// a flywheel for a new model. /// /// Parameter [tags] : /// The tags to associate with this flywheel. /// /// Parameter [taskConfig] : - /// Configuration about the custom classifier associated with the flywheel. + /// Configuration about the model associated with the flywheel. You need to + /// set TaskConfig if you are creating a flywheel for a new + /// model. Future createFlywheel({ required String dataAccessRoleArn, required String dataLakeS3Uri, @@ -1895,8 +1927,8 @@ class Comprehend { /// May throw [InternalServerException]. /// /// Parameter [languageCode] : - /// The language of the input documents. Currently, English is the only valid - /// language. + /// The language of the input text. Enter the language code for English (en) + /// or Spanish (es). /// /// Parameter [text] : /// A UTF-8 text string. The maximum string size is 100 KB. @@ -2008,7 +2040,7 @@ class Comprehend { /// /// For more information about targeted sentiment, see Targeted - /// sentiment. + /// sentiment in the Amazon Comprehend Developer Guide. /// /// May throw [InvalidRequestException]. /// May throw [TextSizeLimitExceededException]. @@ -2044,6 +2076,47 @@ class Comprehend { return DetectTargetedSentimentResponse.fromJson(jsonResponse.body); } + /// Performs toxicity analysis on the list of text strings that you provide as + /// input. The API response contains a results list that matches the size of + /// the input list. For more information about toxicity detection, see Toxicity + /// detection in the Amazon Comprehend Developer Guide. + /// + /// May throw [InvalidRequestException]. + /// May throw [TextSizeLimitExceededException]. + /// May throw [UnsupportedLanguageException]. + /// May throw [InternalServerException]. + /// + /// Parameter [languageCode] : + /// The language of the input text. Currently, English is the only supported + /// language. + /// + /// Parameter [textSegments] : + /// A list of up to 10 text strings. Each string has a maximum size of 1 KB, + /// and the maximum size of the list is 10 KB. + Future detectToxicContent({ + required LanguageCode languageCode, + required List textSegments, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Comprehend_20171127.DetectToxicContent' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'LanguageCode': languageCode.toValue(), + 'TextSegments': textSegments, + }, + ); + + return DetectToxicContentResponse.fromJson(jsonResponse.body); + } + /// Creates a new custom model that replicates a source custom model that you /// import. The source model can be in your Amazon Web Services account or /// another one. @@ -3052,7 +3125,8 @@ class Comprehend { return PutResourcePolicyResponse.fromJson(jsonResponse.body); } - /// Starts an asynchronous document classification job. Use the + /// Starts an asynchronous document classification job using a custom + /// classification model. Use the /// DescribeDocumentClassificationJob operation to track the /// progress of the job. /// @@ -3609,8 +3683,8 @@ class Comprehend { /// The input properties for a PII entities detection job. /// /// Parameter [languageCode] : - /// The language of the input documents. Currently, English is the only valid - /// language. + /// The language of the input documents. Enter the language code for English + /// (en) or Spanish (es). /// /// Parameter [mode] : /// Specifies whether the output provides the locations (offsets) of PII @@ -3792,7 +3866,7 @@ class Comprehend { /// Parameter [dataAccessRoleArn] : /// The Amazon Resource Name (ARN) of the IAM role that grants Amazon /// Comprehend read access to your input data. For more information, see Role-based + /// href="https://docs.aws.amazon.com/comprehend/latest/dg/security_iam_id-based-policy-examples.html#auth-role-permissions">Role-based /// permissions. /// /// Parameter [languageCode] : @@ -5547,10 +5621,15 @@ class ClassifierMetadata { } class ClassifyDocumentResponse { - /// The classes used by the document being analyzed. These are used for - /// multi-class trained models. Individual classes are mutually exclusive and + /// The classes used by the document being analyzed. These are used for models + /// trained in multi-class mode. Individual classes are mutually exclusive and /// each document is expected to have only a single class assigned to it. For /// example, an animal can be a dog or a cat, but not both at the same time. + /// + /// For prompt safety classification, the response includes only two classes + /// (SAFE_PROMPT and UNSAFE_PROMPT), along with a confidence score for each + /// class. The value range of the score is zero to one, where one is the highest + /// confidence. final List? classes; /// Extraction information about the document. This field is present in the @@ -5566,11 +5645,11 @@ class ClassifyDocumentResponse { /// document. The field is empty if the system encountered no errors. final List? errors; - /// The labels used the document being analyzed. These are used for multi-label - /// trained models. Individual labels represent different categories that are - /// related in some manner and are not mutually exclusive. For example, a movie - /// can be just an action movie, or it can be an action movie, a science fiction - /// movie, and a comedy, all at the same time. + /// The labels used in the document being analyzed. These are used for + /// multi-label trained models. Individual labels represent different categories + /// that are related in some manner and are not mutually exclusive. For example, + /// a movie can be just an action movie, or it can be an action movie, a science + /// fiction movie, and a comedy, all at the same time. final List? labels; /// Warnings detected while processing the input document. The response includes @@ -7124,6 +7203,34 @@ class DetectTargetedSentimentResponse { } } +class DetectToxicContentResponse { + /// Results of the content moderation analysis. Each entry in the results list + /// contains a list of toxic content types identified in the text, along with a + /// confidence score for each content type. The results list also includes a + /// toxicity score for each entry in the results list. + final List? resultList; + + DetectToxicContentResponse({ + this.resultList, + }); + + factory DetectToxicContentResponse.fromJson(Map json) { + return DetectToxicContentResponse( + resultList: (json['ResultList'] as List?) + ?.whereNotNull() + .map((e) => ToxicLabels.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final resultList = this.resultList; + return { + if (resultList != null) 'ResultList': resultList, + }; + } +} + /// Specifies the class that categorizes the document being analyzed class DocumentClass { /// The name of the class. @@ -7163,7 +7270,7 @@ class DocumentClass { } } -/// Configuration required for a custom classification model. +/// Configuration required for a document classification model. class DocumentClassificationConfig { /// Classification mode indicates whether the documents are /// MULTI_CLASS or MULTI_LABEL. @@ -7312,7 +7419,7 @@ class DocumentClassificationJobProperties { /// Configuration parameters for a private Virtual Private Cloud (VPC) /// containing the resources you are using for your document classification job. /// For more information, see Amazon + /// href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon /// VPC. final VpcConfig? vpcConfig; @@ -7457,7 +7564,7 @@ extension DocumentClassifierDocumentTypeFormatFromString on String { } /// The location of the training documents. This parameter is required in a -/// request to create a native classifier model. +/// request to create a semi-structured document classification model. class DocumentClassifierDocuments { /// The S3 URI location of the training documents specified in the S3Uri CSV /// file. @@ -7575,11 +7682,11 @@ class DocumentClassifierInputDataConfig { /// The type of input documents for training the model. Provide plain-text /// documents to create a plain-text model, and provide semi-structured - /// documents to create a native model. + /// documents to create a native document model. final DocumentClassifierDocumentTypeFormat? documentType; /// The S3 location of the training documents. This parameter is required in a - /// request to create a native classifier model. + /// request to create a native document model. final DocumentClassifierDocuments? documents; /// Indicates the delimiter used to separate each label for training a @@ -7605,9 +7712,9 @@ class DocumentClassifierInputDataConfig { /// COMPREHEND_CSV. final String? s3Uri; - /// This specifies the Amazon S3 location where the test annotations for an - /// entity recognizer are located. The URI must be in the same Amazon Web - /// Services Region as the API endpoint that you are calling. + /// This specifies the Amazon S3 location that contains the test annotations for + /// the document classifier. The URI must be in the same Amazon Web Services + /// Region as the API endpoint that you are calling. final String? testS3Uri; DocumentClassifierInputDataConfig({ @@ -7699,7 +7806,7 @@ extension DocumentClassifierModeFromString on String { } /// Provide the location for output data from a custom classifier job. This -/// field is mandatory if you are training a native classifier model. +/// field is mandatory if you are training a native document model. class DocumentClassifierOutputDataConfig { /// The Amazon S3 prefix for the data lake location of the flywheel statistics. final String? flywheelStatsS3Prefix; @@ -7871,7 +7978,7 @@ class DocumentClassifierProperties { /// Configuration parameters for a private Virtual Private Cloud (VPC) /// containing the resources you are using for your custom classifier. For more /// information, see Amazon + /// href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon /// VPC. final VpcConfig? vpcConfig; @@ -8139,20 +8246,7 @@ extension DocumentReadActionFromString on String { } } -/// Specifies the type of Amazon Textract features to apply. If you chose -/// TEXTRACT_ANALYZE_DOCUMENT as the read action, you must specify -/// one or both of the following values: -/// -///
      -///
    • -/// TABLES - Returns additional information about any tables that -/// are detected in the input document. -///
    • -///
    • -/// FORMS - Returns additional information about any forms that are -/// detected in the input document. -///
    • -///
    +/// TABLES or FORMS enum DocumentReadFeatureTypes { tables, forms, @@ -8273,12 +8367,12 @@ class DocumentReaderConfig { /// ///
      ///
    • - /// TABLES - Returns information about any tables that are detected - /// in the input document. + /// TABLES - Returns additional information about any tables that + /// are detected in the input document. ///
    • ///
    • - /// FORMS - Returns information and the data from any forms that - /// are detected in the input document. + /// FORMS - Returns additional information about any forms that are + /// detected in the input document. ///
    • ///
    final List? featureTypes; @@ -9983,7 +10077,7 @@ class EntityTypesListItem { /// /// Entity types must not contain the following invalid characters: \n (line /// break), \\n (escaped line break, \r (carriage return), \\r (escaped carriage - /// return), \t (tab), \\t (escaped tab), space, and , (comma). + /// return), \t (tab), \\t (escaped tab), and , (comma). final String type; EntityTypesListItem({ @@ -10552,7 +10646,7 @@ class FlywheelProperties { /// The status of the flywheel. final FlywheelStatus? status; - /// Configuration about the custom classifier associated with the flywheel. + /// Configuration about the model associated with a flywheel. final TaskConfig? taskConfig; FlywheelProperties({ @@ -11931,7 +12025,7 @@ class ListTopicsDetectionJobsResponse { /// /// For more information about targeted sentiment, see Targeted -/// sentiment. +/// sentiment in the Amazon Comprehend Developer Guide. class MentionSentiment { /// The sentiment of the mention. final SentimentType? sentiment; @@ -12068,8 +12162,11 @@ class OutputDataConfig { final String s3Uri; /// ID for the Amazon Web Services Key Management Service (KMS) key that Amazon - /// Comprehend uses to encrypt the output results from an analysis job. The - /// KmsKeyId can be one of the following formats: + /// Comprehend uses to encrypt the output results from an analysis job. Specify + /// the Key Id of a symmetric key, because you cannot use an asymmetric key for + /// uploading data to S3. + /// + /// The KmsKeyId can be one of the following formats: /// ///
      ///
    • @@ -12405,7 +12502,7 @@ class PiiEntitiesDetectionJobProperties { /// failure. final JobStatus? jobStatus; - /// The language code of the input documents + /// The language code of the input documents. final LanguageCode? languageCode; /// A description of the status of a job. @@ -14491,7 +14588,7 @@ class TargetedSentimentDetectionJobProperties { /// /// For more information about targeted sentiment, see Targeted -/// sentiment. +/// sentiment in the Amazon Comprehend Developer Guide. class TargetedSentimentEntity { /// One or more index into the Mentions array that provides the best name for /// the entity group. @@ -14642,7 +14739,7 @@ extension TargetedSentimentEntityTypeFromString on String { /// /// For more information about targeted sentiment, see Targeted -/// sentiment. +/// sentiment in the Amazon Comprehend Developer Guide. class TargetedSentimentMention { /// The offset into the document text where the mention begins. final int? beginOffset; @@ -14714,12 +14811,12 @@ class TargetedSentimentMention { } } -/// Configuration about the custom classifier associated with the flywheel. +/// Configuration about the model associated with a flywheel. class TaskConfig { /// Language code for the language that the model supports. final LanguageCode languageCode; - /// Configuration required for a classification model. + /// Configuration required for a document classification model. final DocumentClassificationConfig? documentClassificationConfig; /// Configuration required for an entity recognition model. @@ -14759,6 +14856,23 @@ class TaskConfig { } } +/// One of the of text strings. Each string has a size limit of 1KB. +class TextSegment { + /// The text content. + final String text; + + TextSegment({ + required this.text, + }); + + Map toJson() { + final text = this.text; + return { + 'Text': text, + }; + } +} + /// Provides information for filtering topic detection jobs. For more /// information, see . class TopicsDetectionJobFilter { @@ -14949,6 +15063,130 @@ class TopicsDetectionJobProperties { } } +/// Toxic content analysis result for one string. For more information about +/// toxicity detection, see Toxicity +/// detection in the Amazon Comprehend Developer Guide +class ToxicContent { + /// The name of the toxic content type. + final ToxicContentType? name; + + /// Model confidence in the detected content type. Value range is zero to one, + /// where one is highest confidence. + final double? score; + + ToxicContent({ + this.name, + this.score, + }); + + factory ToxicContent.fromJson(Map json) { + return ToxicContent( + name: (json['Name'] as String?)?.toToxicContentType(), + score: json['Score'] as double?, + ); + } + + Map toJson() { + final name = this.name; + final score = this.score; + return { + if (name != null) 'Name': name.toValue(), + if (score != null) 'Score': score, + }; + } +} + +enum ToxicContentType { + graphic, + harassmentOrAbuse, + hateSpeech, + insult, + profanity, + sexual, + violenceOrThreat, +} + +extension ToxicContentTypeValueExtension on ToxicContentType { + String toValue() { + switch (this) { + case ToxicContentType.graphic: + return 'GRAPHIC'; + case ToxicContentType.harassmentOrAbuse: + return 'HARASSMENT_OR_ABUSE'; + case ToxicContentType.hateSpeech: + return 'HATE_SPEECH'; + case ToxicContentType.insult: + return 'INSULT'; + case ToxicContentType.profanity: + return 'PROFANITY'; + case ToxicContentType.sexual: + return 'SEXUAL'; + case ToxicContentType.violenceOrThreat: + return 'VIOLENCE_OR_THREAT'; + } + } +} + +extension ToxicContentTypeFromString on String { + ToxicContentType toToxicContentType() { + switch (this) { + case 'GRAPHIC': + return ToxicContentType.graphic; + case 'HARASSMENT_OR_ABUSE': + return ToxicContentType.harassmentOrAbuse; + case 'HATE_SPEECH': + return ToxicContentType.hateSpeech; + case 'INSULT': + return ToxicContentType.insult; + case 'PROFANITY': + return ToxicContentType.profanity; + case 'SEXUAL': + return ToxicContentType.sexual; + case 'VIOLENCE_OR_THREAT': + return ToxicContentType.violenceOrThreat; + } + throw Exception('$this is not known in enum ToxicContentType'); + } +} + +/// Toxicity analysis result for one string. For more information about toxicity +/// detection, see Toxicity +/// detection in the Amazon Comprehend Developer Guide. +class ToxicLabels { + /// Array of toxic content types identified in the string. + final List? labels; + + /// Overall toxicity score for the string. Value range is zero to one, where one + /// is the highest confidence. + final double? toxicity; + + ToxicLabels({ + this.labels, + this.toxicity, + }); + + factory ToxicLabels.fromJson(Map json) { + return ToxicLabels( + labels: (json['Labels'] as List?) + ?.whereNotNull() + .map((e) => ToxicContent.fromJson(e as Map)) + .toList(), + toxicity: json['Toxicity'] as double?, + ); + } + + Map toJson() { + final labels = this.labels; + final toxicity = this.toxicity; + return { + if (labels != null) 'Labels': labels, + if (toxicity != null) 'Toxicity': toxicity, + }; + } +} + class UntagResourceResponse { UntagResourceResponse(); @@ -15104,7 +15342,7 @@ class VpcConfig { ///
        ///
      • /// The document to classify is plain text, but the classifier is a native -/// model. +/// document model. ///
      • ///
      • /// The document to classify is semi-structured, but the classifier is a diff --git a/aws_client/lib/src/generated/comprehend_medical/v2018_10_30.dart b/aws_client/lib/src/generated/comprehend_medical/v2018_10_30.dart index c4c20f761..cd56518f9 100644 --- a/aws_client/lib/src/generated/comprehend_medical/v2018_10_30.dart +++ b/aws_client/lib/src/generated/comprehend_medical/v2018_10_30.dart @@ -19,8 +19,13 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// Comprehend Medical; extracts structured information from unstructured -/// clinical text. Use these actions to gain insight in your documents. +/// Amazon Comprehend Medical extracts structured information from unstructured +/// clinical text. Use these actions to gain insight in your documents. Amazon +/// Comprehend Medical only detects entities in English language texts. Amazon +/// Comprehend Medical places limits on the sizes of files allowed for different +/// API operations. To learn more, see Guidelines +/// and quotas in the Amazon Comprehend Medical Developer Guide. class ComprehendMedical { final _s.JsonProtocol _protocol; ComprehendMedical({ @@ -59,7 +64,7 @@ class ComprehendMedical { /// May throw [InternalServerException]. /// /// Parameter [jobId] : - /// The identifier that Comprehend Medical; generated for the job. The + /// The identifier that Amazon Comprehend Medical generated for the job. The /// StartEntitiesDetectionV2Job operation returns this identifier /// in its response. Future @@ -127,7 +132,7 @@ class ComprehendMedical { /// May throw [InternalServerException]. /// /// Parameter [jobId] : - /// The identifier that Comprehend Medical; generated for the job. The + /// The identifier that Amazon Comprehend Medical generated for the job. The /// StartPHIDetectionJob operation returns this identifier in its /// response. Future describePHIDetectionJob({ @@ -221,7 +226,7 @@ class ComprehendMedical { /// /// Inspects the clinical text for a variety of medical entities and returns /// specific information about them such as entity category, location, and - /// confidence score on that information . + /// confidence score on that information. /// /// May throw [InternalServerException]. /// May throw [ServiceUnavailableException]. @@ -232,7 +237,7 @@ class ComprehendMedical { /// /// Parameter [text] : /// A UTF-8 text string containing the clinical content being examined for - /// entities. Each string must contain fewer than 20,000 bytes of characters. + /// entities. @Deprecated('This operation is deprecated, use DetectEntitiesV2 instead.') Future detectEntities({ required String text, @@ -279,7 +284,7 @@ class ComprehendMedical { /// /// Parameter [text] : /// A UTF-8 string containing the clinical content being examined for - /// entities. Each string must contain fewer than 20,000 bytes of characters. + /// entities. Future detectEntitiesV2({ required String text, }) async { @@ -315,7 +320,7 @@ class ComprehendMedical { /// /// Parameter [text] : /// A UTF-8 text string containing the clinical content being examined for PHI - /// entities. Each string must contain fewer than 20,000 bytes of characters. + /// entities. Future detectPHI({ required String text, }) async { @@ -351,8 +356,7 @@ class ComprehendMedical { /// May throw [TextSizeLimitExceededException]. /// /// Parameter [text] : - /// The input text used for analysis. The input for InferICD10CM is a string - /// from 1 to 10000 characters. + /// The input text used for analysis. Future inferICD10CM({ required String text, }) async { @@ -387,8 +391,7 @@ class ComprehendMedical { /// May throw [TextSizeLimitExceededException]. /// /// Parameter [text] : - /// The input text used for analysis. The input for InferRxNorm is a string - /// from 1 to 10000 characters. + /// The input text used for analysis. Future inferRxNorm({ required String text, }) async { @@ -422,8 +425,7 @@ class ComprehendMedical { /// May throw [TextSizeLimitExceededException]. /// /// Parameter [text] : - /// The input text to be analyzed using InferSNOMEDCT. The text should be a - /// string with 1 to 10000 characters. + /// The input text to be analyzed using InferSNOMEDCT. Future inferSNOMEDCT({ required String text, }) async { @@ -541,8 +543,8 @@ class ComprehendMedical { return ListICD10CMInferenceJobsResponse.fromJson(jsonResponse.body); } - /// Gets a list of protected health information (PHI) detection jobs that you - /// have submitted. + /// Gets a list of protected health information (PHI) detection jobs you have + /// submitted. /// /// May throw [InvalidRequestException]. /// May throw [ValidationException]. @@ -692,10 +694,10 @@ class ComprehendMedical { /// /// Parameter [dataAccessRoleArn] : /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management - /// (IAM) role that grants Comprehend Medical; read access to your input data. - /// For more information, see - /// Role-Based Permissions Required for Asynchronous Operations. + /// (IAM) role that grants Amazon Comprehend Medical read access to your input + /// data. For more information, see Role-Based + /// Permissions Required for Asynchronous Operations. /// /// Parameter [inputDataConfig] : /// The input configuration that specifies the format and location of the @@ -703,14 +705,14 @@ class ComprehendMedical { /// /// Parameter [languageCode] : /// The language of the input documents. All documents must be in the same - /// language. Comprehend Medical; processes files in US English (en). + /// language. Amazon Comprehend Medical processes files in US English (en). /// /// Parameter [outputDataConfig] : /// The output configuration that specifies where to send the output files. /// /// Parameter [clientRequestToken] : /// A unique identifier for the request. If you don't set the client request - /// token, Comprehend Medical; generates one for you. + /// token, Amazon Comprehend Medical generates one for you. /// /// Parameter [jobName] : /// The identifier of the job. @@ -763,8 +765,8 @@ class ComprehendMedical { /// /// Parameter [dataAccessRoleArn] : /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management - /// (IAM) role that grants Comprehend Medical; read access to your input data. - /// For more information, see /// Role-Based Permissions Required for Asynchronous Operations. /// @@ -780,7 +782,7 @@ class ComprehendMedical { /// /// Parameter [clientRequestToken] : /// A unique identifier for the request. If you don't set the client request - /// token, Comprehend Medical; generates one. + /// token, Amazon Comprehend Medical generates one. /// /// Parameter [jobName] : /// The identifier of the job. @@ -833,8 +835,8 @@ class ComprehendMedical { /// /// Parameter [dataAccessRoleArn] : /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management - /// (IAM) role that grants Comprehend Medical; read access to your input data. - /// For more information, see /// Role-Based Permissions Required for Asynchronous Operations. /// @@ -850,7 +852,7 @@ class ComprehendMedical { /// /// Parameter [clientRequestToken] : /// A unique identifier for the request. If you don't set the client request - /// token, Comprehend Medical; generates one. + /// token, Amazon Comprehend Medical generates one. /// /// Parameter [jobName] : /// The identifier of the job. @@ -903,8 +905,8 @@ class ComprehendMedical { /// /// Parameter [dataAccessRoleArn] : /// The Amazon Resource Name (ARN) of the AWS Identity and Access Management - /// (IAM) role that grants Comprehend Medical; read access to your input data. - /// For more information, see /// Role-Based Permissions Required for Asynchronous Operations. /// @@ -920,7 +922,7 @@ class ComprehendMedical { /// /// Parameter [clientRequestToken] : /// A unique identifier for the request. If you don't set the client request - /// token, Comprehend Medical; generates one. + /// token, Amazon Comprehend Medical generates one. /// /// Parameter [jobName] : /// The identifier of the job. @@ -1192,8 +1194,8 @@ class Attribute { /// identifier. final int? id; - /// The level of confidence that Comprehend Medical; has that this attribute is - /// correctly related to this entity. + /// The level of confidence that Amazon Comprehend Medical has that this + /// attribute is correctly related to this entity. final double? relationshipScore; /// The type of relationship between the entity and attribute. Type for the @@ -1201,8 +1203,8 @@ class Attribute { /// the same time as the Date_Expression. final RelationshipType? relationshipType; - /// The level of confidence that Comprehend Medical; has that the segment of - /// text is correctly recognized as an attribute. + /// The level of confidence that Amazon Comprehend Medical has that the segment + /// of text is correctly recognized as an attribute. final double? score; /// The segment of input text extracted as this attribute. @@ -1339,7 +1341,7 @@ extension AttributeNameFromString on String { /// The number of characters in the input text to be analyzed. class Characters { /// The number of characters present in the input text document as processed by - /// Comprehend Medical. + /// Amazon Comprehend Medical. final int? originalTextCharacters; Characters({ @@ -1405,8 +1407,8 @@ class ComprehendMedicalAsyncJobFilter { /// Provides information about a detection job. class ComprehendMedicalAsyncJobProperties { - /// The Amazon Resource Name (ARN) that gives Comprehend Medical; read access to - /// your input data. + /// The Amazon Resource Name (ARN) that gives Amazon Comprehend Medical read + /// access to your input data. final String? dataAccessRoleArn; /// The time that the detection job completed. @@ -1699,7 +1701,7 @@ class DetectEntitiesResponse { /// The collection of medical entities extracted from the input text and their /// associated information. For each entity, the response provides the entity /// text, the entity category, where the entity text begins and ends, and the - /// level of confidence that Comprehend Medical; has in the detection and + /// level of confidence that Amazon Comprehend Medical has in the detection and /// analysis. Attributes and traits of the entity are also returned. final List entities; @@ -1814,7 +1816,7 @@ class DetectPHIResponse { /// The collection of PHI entities extracted from the input text and their /// associated information. For each entity, the response provides the entity /// text, the entity category, where the entity text begins and ends, and the - /// level of confidence that Comprehend Medical; has in its detection. + /// level of confidence that Amazon Comprehend Medical has in its detection. final List entities; /// The version of the model used to analyze the documents. The version number @@ -1876,8 +1878,8 @@ class Entity { /// unique within this response rather than a global unique identifier. final int? id; - /// The level of confidence that Comprehend Medical; has in the accuracy of the - /// detection. + /// The level of confidence that Amazon Comprehend Medical has in the accuracy + /// of the detection. final double? score; /// The segment of input text extracted as this entity. @@ -2606,6 +2608,7 @@ extension ICD10CMEntityTypeFromString on String { enum ICD10CMRelationshipType { overlap, systemOrganSite, + quality, } extension ICD10CMRelationshipTypeValueExtension on ICD10CMRelationshipType { @@ -2615,6 +2618,8 @@ extension ICD10CMRelationshipTypeValueExtension on ICD10CMRelationshipType { return 'OVERLAP'; case ICD10CMRelationshipType.systemOrganSite: return 'SYSTEM_ORGAN_SITE'; + case ICD10CMRelationshipType.quality: + return 'QUALITY'; } } } @@ -2626,6 +2631,8 @@ extension ICD10CMRelationshipTypeFromString on String { return ICD10CMRelationshipType.overlap; case 'SYSTEM_ORGAN_SITE': return ICD10CMRelationshipType.systemOrganSite; + case 'QUALITY': + return ICD10CMRelationshipType.quality; } throw Exception('$this is not known in enum ICD10CMRelationshipType'); } @@ -2638,8 +2645,8 @@ class ICD10CMTrait { /// Provides a name or contextual description about the trait. final ICD10CMTraitName? name; - /// The level of confidence that Comprehend Medical; has that the segment of - /// text is correctly recognized as a trait. + /// The level of confidence that Amazon Comprehend Medical has that the segment + /// of text is correctly recognized as a trait. final double? score; ICD10CMTrait({ @@ -2811,8 +2818,8 @@ class InferSNOMEDCTResponse { /// The collection of medical concept entities extracted from the input text and /// their associated information. For each entity, the response provides the /// entity text, the entity category, where the entity text begins and ends, and - /// the level of confidence that Comprehend Medical has in the detection and - /// analysis. Attributes and traits of the entity are also returned. + /// the level of confidence that Amazon Comprehend Medical has in the detection + /// and analysis. Attributes and traits of the entity are also returned. final List entities; /// The number of characters in the input request documentation. @@ -2878,9 +2885,6 @@ class InferSNOMEDCTResponse { class InputDataConfig { /// The URI of the S3 bucket that contains the input data. The bucket must be in /// the same region as the API endpoint that you are calling. - /// - /// Each file in the document collection must be less than 40 KB. You can store - /// a maximum of 30 GB in the bucket. final String s3Bucket; /// The path to the input data files in the S3 bucket. @@ -3185,9 +3189,9 @@ class OutputDataConfig { /// the output. final String s3Bucket; - /// The path to the output data files in the S3 bucket. Comprehend Medical; - /// creates an output directory using the job ID so that the output from one job - /// does not overwrite the output of another. + /// The path to the output data files in the S3 bucket. Amazon Comprehend + /// Medical creates an output directory using the job ID so that the output from + /// one job does not overwrite the output of another. final String? s3Key; OutputDataConfig({ @@ -3233,6 +3237,8 @@ enum RelationshipType { direction, systemOrganSite, amount, + usage, + quality, } extension RelationshipTypeValueExtension on RelationshipType { @@ -3278,6 +3284,10 @@ extension RelationshipTypeValueExtension on RelationshipType { return 'SYSTEM_ORGAN_SITE'; case RelationshipType.amount: return 'AMOUNT'; + case RelationshipType.usage: + return 'USAGE'; + case RelationshipType.quality: + return 'QUALITY'; } } } @@ -3325,6 +3335,10 @@ extension RelationshipTypeFromString on String { return RelationshipType.systemOrganSite; case 'AMOUNT': return RelationshipType.amount; + case 'USAGE': + return RelationshipType.usage; + case 'QUALITY': + return RelationshipType.quality; } throw Exception('$this is not known in enum RelationshipType'); } @@ -3352,8 +3366,8 @@ class RxNormAttribute { /// attribute is accurately linked to an entity. final double? relationshipScore; - /// The level of confidence that Comprehend Medical has that the segment of text - /// is correctly recognized as an attribute. + /// The level of confidence that Amazon Comprehend Medical has that the segment + /// of text is correctly recognized as an attribute. final double? score; /// The segment of input text which corresponds to the detected attribute. @@ -3704,6 +3718,7 @@ class RxNormTrait { enum RxNormTraitName { negation, + pastHistory, } extension RxNormTraitNameValueExtension on RxNormTraitName { @@ -3711,6 +3726,8 @@ extension RxNormTraitNameValueExtension on RxNormTraitName { switch (this) { case RxNormTraitName.negation: return 'NEGATION'; + case RxNormTraitName.pastHistory: + return 'PAST_HISTORY'; } } } @@ -3720,6 +3737,8 @@ extension RxNormTraitNameFromString on String { switch (this) { case 'NEGATION': return RxNormTraitName.negation; + case 'PAST_HISTORY': + return RxNormTraitName.pastHistory; } throw Exception('$this is not known in enum RxNormTraitName'); } @@ -3746,8 +3765,8 @@ class SNOMEDCTAttribute { /// identifier. final int? id; - /// The level of confidence that Comprehend Medical has that this attribute is - /// correctly related to this entity. + /// The level of confidence that Amazon Comprehend Medical has that this + /// attribute is correctly related to this entity. final double? relationshipScore; /// The type of relationship that exists between the entity and the related @@ -3758,8 +3777,8 @@ class SNOMEDCTAttribute { /// indicating the likelihood of the match. final List? sNOMEDCTConcepts; - /// The level of confidence that Comprehend Medical has that the segment of text - /// is correctly recognized as an attribute. + /// The level of confidence that Amazon Comprehend Medical has that the segment + /// of text is correctly recognized as an attribute. final double? score; /// The segment of input text extracted as this attribute. @@ -3897,8 +3916,8 @@ class SNOMEDCTConcept { /// The description of the SNOMED-CT concept. final String? description; - /// The level of confidence Comprehend Medical has that the entity should be - /// linked to the identified SNOMED-CT concept. + /// The level of confidence Amazon Comprehend Medical has that the entity should + /// be linked to the identified SNOMED-CT concept. final double? score; SNOMEDCTConcept({ @@ -3971,7 +3990,7 @@ class SNOMEDCTDetails { /// The collection of medical entities extracted from the input text and their /// associated information. For each entity, the response provides the entity /// text, the entity category, where the entity text begins and ends, and the -/// level of confidence that Comprehend Medical has in the detection and +/// level of confidence that Amazon Comprehend Medical has in the detection and /// analysis. Attributes and traits of the entity are also returned. class SNOMEDCTEntity { /// An extracted segment of the text that is an attribute of an entity, or @@ -3998,8 +4017,8 @@ class SNOMEDCTEntity { /// indicating the likelihood of the match. final List? sNOMEDCTConcepts; - /// The level of confidence that Comprehend Medical has in the accuracy of the - /// detected entity. + /// The level of confidence that Amazon Comprehend Medical has in the accuracy + /// of the detected entity. final double? score; /// The segment of input text extracted as this entity. @@ -4154,6 +4173,7 @@ enum SNOMEDCTRelationshipType { testUnits, direction, systemOrganSite, + testUnit, } extension SNOMEDCTRelationshipTypeValueExtension on SNOMEDCTRelationshipType { @@ -4171,6 +4191,8 @@ extension SNOMEDCTRelationshipTypeValueExtension on SNOMEDCTRelationshipType { return 'DIRECTION'; case SNOMEDCTRelationshipType.systemOrganSite: return 'SYSTEM_ORGAN_SITE'; + case SNOMEDCTRelationshipType.testUnit: + return 'TEST_UNIT'; } } } @@ -4190,6 +4212,8 @@ extension SNOMEDCTRelationshipTypeFromString on String { return SNOMEDCTRelationshipType.direction; case 'SYSTEM_ORGAN_SITE': return SNOMEDCTRelationshipType.systemOrganSite; + case 'TEST_UNIT': + return SNOMEDCTRelationshipType.testUnit; } throw Exception('$this is not known in enum SNOMEDCTRelationshipType'); } @@ -4200,8 +4224,8 @@ class SNOMEDCTTrait { /// The name or contextual description of a detected trait. final SNOMEDCTTraitName? name; - /// The level of confidence that Comprehend Medical has in the accuracy of a - /// detected trait. + /// The level of confidence that Amazon Comprehend Medical has in the accuracy + /// of a detected trait. final double? score; SNOMEDCTTrait({ @@ -4524,8 +4548,8 @@ class Trait { /// Provides a name or contextual description about the trait. final AttributeName? name; - /// The level of confidence that Comprehend Medical; has in the accuracy of this - /// trait. + /// The level of confidence that Amazon Comprehend Medical has in the accuracy + /// of this trait. final double? score; Trait({ @@ -4550,7 +4574,7 @@ class Trait { } } -/// An attribute that was extracted, but Comprehend Medical; was unable to +/// An attribute that was extracted, but Amazon Comprehend Medical was unable to /// relate to an entity. class UnmappedAttribute { /// The specific attribute that has been extracted but not mapped to an entity. diff --git a/aws_client/lib/src/generated/compute_optimizer/v2019_11_01.dart b/aws_client/lib/src/generated/compute_optimizer/v2019_11_01.dart index 623912c66..0f5bd5f94 100644 --- a/aws_client/lib/src/generated/compute_optimizer/v2019_11_01.dart +++ b/aws_client/lib/src/generated/compute_optimizer/v2019_11_01.dart @@ -772,6 +772,108 @@ class ComputeOptimizer { jsonResponse.body); } + /// Export optimization recommendations for your licenses. + /// + /// Recommendations are exported in a comma-separated values (CSV) file, and + /// its metadata in a JavaScript Object Notation (JSON) file, to an existing + /// Amazon Simple Storage Service (Amazon S3) bucket that you specify. For + /// more information, see Exporting + /// Recommendations in the Compute Optimizer User Guide. + /// + /// You can have only one license export job in progress per Amazon Web + /// Services Region. + /// + /// May throw [OptInRequiredException]. + /// May throw [InternalServerException]. + /// May throw [ServiceUnavailableException]. + /// May throw [AccessDeniedException]. + /// May throw [InvalidParameterValueException]. + /// May throw [MissingAuthenticationToken]. + /// May throw [ThrottlingException]. + /// May throw [LimitExceededException]. + /// + /// Parameter [accountIds] : + /// The IDs of the Amazon Web Services accounts for which to export license + /// recommendations. + /// + /// If your account is the management account of an organization, use this + /// parameter to specify the member account for which you want to export + /// recommendations. + /// + /// This parameter can't be specified together with the include member + /// accounts parameter. The parameters are mutually exclusive. + /// + /// If this parameter is omitted, recommendations for member accounts aren't + /// included in the export. + /// + /// You can specify multiple account IDs per request. + /// + /// Parameter [fieldsToExport] : + /// The recommendations data to include in the export file. For more + /// information about the fields that can be exported, see Exported + /// files in the Compute Optimizer User Guide. + /// + /// Parameter [fileFormat] : + /// The format of the export file. + /// + /// A CSV file is the only export format currently supported. + /// + /// Parameter [filters] : + /// An array of objects to specify a filter that exports a more specific set + /// of license recommendations. + /// + /// Parameter [includeMemberAccounts] : + /// Indicates whether to include recommendations for resources in all member + /// accounts of the organization if your account is the management account of + /// an organization. + /// + /// The member accounts must also be opted in to Compute Optimizer, and + /// trusted access for Compute Optimizer must be enabled in the organization + /// account. For more information, see Compute + /// Optimizer and Amazon Web Services Organizations trusted access in the + /// Compute Optimizer User Guide. + /// + /// If this parameter is omitted, recommendations for member accounts of the + /// organization aren't included in the export file . + /// + /// This parameter cannot be specified together with the account IDs + /// parameter. The parameters are mutually exclusive. + Future exportLicenseRecommendations({ + required S3DestinationConfig s3DestinationConfig, + List? accountIds, + List? fieldsToExport, + FileFormat? fileFormat, + List? filters, + bool? includeMemberAccounts, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'ComputeOptimizerService.ExportLicenseRecommendations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 's3DestinationConfig': s3DestinationConfig, + if (accountIds != null) 'accountIds': accountIds, + if (fieldsToExport != null) + 'fieldsToExport': fieldsToExport.map((e) => e.toValue()).toList(), + if (fileFormat != null) 'fileFormat': fileFormat.toValue(), + if (filters != null) 'filters': filters, + if (includeMemberAccounts != null) + 'includeMemberAccounts': includeMemberAccounts, + }, + ); + + return ExportLicenseRecommendationsResponse.fromJson(jsonResponse.body); + } + /// Returns Auto Scaling group recommendations. /// /// Compute Optimizer generates recommendations for Amazon EC2 Auto Scaling @@ -1471,6 +1573,88 @@ class ComputeOptimizer { return GetLambdaFunctionRecommendationsResponse.fromJson(jsonResponse.body); } + /// Returns license recommendations for Amazon EC2 instances that run on a + /// specific license. + /// + /// Compute Optimizer generates recommendations for licenses that meet a + /// specific set of requirements. For more information, see the Supported + /// resources and requirements in the Compute Optimizer User Guide. + /// + /// May throw [OptInRequiredException]. + /// May throw [InternalServerException]. + /// May throw [ServiceUnavailableException]. + /// May throw [AccessDeniedException]. + /// May throw [InvalidParameterValueException]. + /// May throw [ResourceNotFoundException]. + /// May throw [MissingAuthenticationToken]. + /// May throw [ThrottlingException]. + /// + /// Parameter [accountIds] : + /// The ID of the Amazon Web Services account for which to return license + /// recommendations. + /// + /// If your account is the management account of an organization, use this + /// parameter to specify the member account for which you want to return + /// license recommendations. + /// + /// Only one account ID can be specified per request. + /// + /// Parameter [filters] : + /// An array of objects to specify a filter that returns a more specific list + /// of license recommendations. + /// + /// Parameter [maxResults] : + /// The maximum number of license recommendations to return with a single + /// request. + /// + /// To retrieve the remaining results, make another request with the returned + /// nextToken value. + /// + /// Parameter [nextToken] : + /// The token to advance to the next page of license recommendations. + /// + /// Parameter [resourceArns] : + /// The ARN that identifies the Amazon EC2 instance. + /// + /// The following is the format of the ARN: + /// + /// arn:aws:ec2:region:aws_account_id:instance/instance-id + Future getLicenseRecommendations({ + List? accountIds, + List? filters, + int? maxResults, + String? nextToken, + List? resourceArns, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 1000, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'ComputeOptimizerService.GetLicenseRecommendations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (accountIds != null) 'accountIds': accountIds, + if (filters != null) 'filters': filters, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (resourceArns != null) 'resourceArns': resourceArns, + }, + ); + + return GetLicenseRecommendationsResponse.fromJson(jsonResponse.body); + } + /// Returns existing recommendation preferences, such as enhanced /// infrastructure metrics. /// @@ -1713,6 +1897,39 @@ class ComputeOptimizer { /// href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/inferred-workload-types.html">Inferred /// workload types in the Compute Optimizer User Guide. /// + /// Parameter [lookBackPeriod] : + /// The preference to control the number of days the utilization metrics of + /// the Amazon Web Services resource are analyzed. When this preference isn't + /// specified, we use the default value DAYS_14. + /// + /// You can only set this preference for the Amazon EC2 instance and Auto + /// Scaling group resource types. + /// + /// + /// Parameter [preferredResources] : + /// The preference to control which resource type values are considered when + /// generating rightsizing recommendations. You can specify this preference as + /// a combination of include and exclude lists. You must specify either an + /// includeList or excludeList. If the preference is + /// an empty set of resource type values, an error occurs. + /// + /// You can only set this preference for the Amazon EC2 instance and Auto + /// Scaling group resource types. + /// + /// + /// Parameter [savingsEstimationMode] : + /// The status of the savings estimation mode preference to create or update. + /// + /// Specify the AfterDiscounts status to activate the preference, + /// or specify BeforeDiscounts to deactivate the preference. + /// + /// Only the account manager or delegated administrator of your organization + /// can activate this preference. + /// + /// For more information, see + /// Savings estimation mode in the Compute Optimizer User Guide. + /// /// Parameter [scope] : /// An object that describes the scope of the recommendation preference to /// create. @@ -1735,12 +1952,48 @@ class ComputeOptimizer { /// recommendation preferences at the resource level only for standalone /// instances. /// + /// + /// Parameter [utilizationPreferences] : + /// The preference to control the resource’s CPU utilization threshold, CPU + /// utilization headroom, and memory utilization headroom. When this + /// preference isn't specified, we use the following default values. + /// + /// CPU utilization: + /// + ///
          + ///
        • + /// P99_5 for threshold + ///
        • + ///
        • + /// PERCENT_20 for headroom + ///
        • + ///
        + /// Memory utilization: + /// + ///
          + ///
        • + /// PERCENT_20 for headroom + ///
        • + ///
        + ///
          + ///
        • + /// You can only set CPU and memory utilization preferences for the Amazon EC2 + /// instance resource type. + ///
        • + ///
        • + /// The threshold setting isn’t available for memory utilization. + ///
        • + ///
        Future putRecommendationPreferences({ required ResourceType resourceType, EnhancedInfrastructureMetrics? enhancedInfrastructureMetrics, ExternalMetricsPreference? externalMetricsPreference, InferredWorkloadTypesPreference? inferredWorkloadTypes, + LookBackPeriodPreference? lookBackPeriod, + List? preferredResources, + SavingsEstimationMode? savingsEstimationMode, Scope? scope, + List? utilizationPreferences, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.0', @@ -1761,7 +2014,14 @@ class ComputeOptimizer { 'externalMetricsPreference': externalMetricsPreference, if (inferredWorkloadTypes != null) 'inferredWorkloadTypes': inferredWorkloadTypes.toValue(), + if (lookBackPeriod != null) 'lookBackPeriod': lookBackPeriod.toValue(), + if (preferredResources != null) + 'preferredResources': preferredResources, + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode.toValue(), if (scope != null) 'scope': scope, + if (utilizationPreferences != null) + 'utilizationPreferences': utilizationPreferences, }, ); } @@ -1970,6 +2230,39 @@ class AutoScalingGroupConfiguration { } } +/// An object that describes the estimated monthly savings possible by adopting +/// Compute Optimizer’s Auto Scaling group recommendations. This is based on the +/// Savings Plans and Reserved Instances discounts. +class AutoScalingGroupEstimatedMonthlySavings { + /// The currency of the estimated monthly savings. + final Currency? currency; + + /// The value of the estimated monthly savings. + final double? value; + + AutoScalingGroupEstimatedMonthlySavings({ + this.currency, + this.value, + }); + + factory AutoScalingGroupEstimatedMonthlySavings.fromJson( + Map json) { + return AutoScalingGroupEstimatedMonthlySavings( + currency: (json['currency'] as String?)?.toCurrency(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final currency = this.currency; + final value = this.value; + return { + if (currency != null) 'currency': currency.toValue(), + if (value != null) 'value': value, + }; + } +} + /// Describes an Auto Scaling group recommendation. class AutoScalingGroupRecommendation { /// The Amazon Web Services account ID of the Auto Scaling group. @@ -1985,6 +2278,10 @@ class AutoScalingGroupRecommendation { /// Scaling group. final AutoScalingGroupConfiguration? currentConfiguration; + /// Describes the GPU accelerator settings for the current instance type of the + /// Auto Scaling group. + final GpuInfo? currentInstanceGpuInfo; + /// The risk of the current Auto Scaling group not meeting the performance needs /// of its workloads. The higher the risk, the more likely the current Auto /// Scaling group configuration has insufficient capacity and cannot meet @@ -2079,6 +2376,7 @@ class AutoScalingGroupRecommendation { this.autoScalingGroupArn, this.autoScalingGroupName, this.currentConfiguration, + this.currentInstanceGpuInfo, this.currentPerformanceRisk, this.effectiveRecommendationPreferences, this.finding, @@ -2098,6 +2396,10 @@ class AutoScalingGroupRecommendation { ? AutoScalingGroupConfiguration.fromJson( json['currentConfiguration'] as Map) : null, + currentInstanceGpuInfo: json['currentInstanceGpuInfo'] != null + ? GpuInfo.fromJson( + json['currentInstanceGpuInfo'] as Map) + : null, currentPerformanceRisk: (json['currentPerformanceRisk'] as String?) ?.toCurrentPerformanceRisk(), effectiveRecommendationPreferences: @@ -2130,6 +2432,7 @@ class AutoScalingGroupRecommendation { final autoScalingGroupArn = this.autoScalingGroupArn; final autoScalingGroupName = this.autoScalingGroupName; final currentConfiguration = this.currentConfiguration; + final currentInstanceGpuInfo = this.currentInstanceGpuInfo; final currentPerformanceRisk = this.currentPerformanceRisk; final effectiveRecommendationPreferences = this.effectiveRecommendationPreferences; @@ -2147,6 +2450,8 @@ class AutoScalingGroupRecommendation { 'autoScalingGroupName': autoScalingGroupName, if (currentConfiguration != null) 'currentConfiguration': currentConfiguration, + if (currentInstanceGpuInfo != null) + 'currentInstanceGpuInfo': currentInstanceGpuInfo, if (currentPerformanceRisk != null) 'currentPerformanceRisk': currentPerformanceRisk.toValue(), if (effectiveRecommendationPreferences != null) @@ -2172,6 +2477,10 @@ class AutoScalingGroupRecommendationOption { /// An array of objects that describe an Auto Scaling group configuration. final AutoScalingGroupConfiguration? configuration; + /// Describes the GPU accelerator settings for the recommended instance type of + /// the Auto Scaling group. + final GpuInfo? instanceGpuInfo; + /// The level of effort required to migrate from the current instance type to /// the recommended instance type. /// @@ -2222,13 +2531,22 @@ class AutoScalingGroupRecommendationOption { /// savings amount and percentage. final SavingsOpportunity? savingsOpportunity; + /// An object that describes the savings opportunity for the Auto Scaling group + /// recommendation option that includes Savings Plans and Reserved Instances + /// discounts. Savings opportunity includes the estimated monthly savings and + /// percentage. + final AutoScalingGroupSavingsOpportunityAfterDiscounts? + savingsOpportunityAfterDiscounts; + AutoScalingGroupRecommendationOption({ this.configuration, + this.instanceGpuInfo, this.migrationEffort, this.performanceRisk, this.projectedUtilizationMetrics, this.rank, this.savingsOpportunity, + this.savingsOpportunityAfterDiscounts, }); factory AutoScalingGroupRecommendationOption.fromJson( @@ -2238,6 +2556,9 @@ class AutoScalingGroupRecommendationOption { ? AutoScalingGroupConfiguration.fromJson( json['configuration'] as Map) : null, + instanceGpuInfo: json['instanceGpuInfo'] != null + ? GpuInfo.fromJson(json['instanceGpuInfo'] as Map) + : null, migrationEffort: (json['migrationEffort'] as String?)?.toMigrationEffort(), performanceRisk: json['performanceRisk'] as double?, @@ -2251,24 +2572,82 @@ class AutoScalingGroupRecommendationOption { ? SavingsOpportunity.fromJson( json['savingsOpportunity'] as Map) : null, + savingsOpportunityAfterDiscounts: + json['savingsOpportunityAfterDiscounts'] != null + ? AutoScalingGroupSavingsOpportunityAfterDiscounts.fromJson( + json['savingsOpportunityAfterDiscounts'] + as Map) + : null, ); } Map toJson() { final configuration = this.configuration; + final instanceGpuInfo = this.instanceGpuInfo; final migrationEffort = this.migrationEffort; final performanceRisk = this.performanceRisk; final projectedUtilizationMetrics = this.projectedUtilizationMetrics; final rank = this.rank; final savingsOpportunity = this.savingsOpportunity; + final savingsOpportunityAfterDiscounts = + this.savingsOpportunityAfterDiscounts; return { if (configuration != null) 'configuration': configuration, + if (instanceGpuInfo != null) 'instanceGpuInfo': instanceGpuInfo, if (migrationEffort != null) 'migrationEffort': migrationEffort.toValue(), if (performanceRisk != null) 'performanceRisk': performanceRisk, if (projectedUtilizationMetrics != null) 'projectedUtilizationMetrics': projectedUtilizationMetrics, if (rank != null) 'rank': rank, if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, + if (savingsOpportunityAfterDiscounts != null) + 'savingsOpportunityAfterDiscounts': savingsOpportunityAfterDiscounts, + }; + } +} + +/// Describes the savings opportunity for Auto Scaling group recommendations +/// after applying the Savings Plans and Reserved Instances discounts. +/// +/// Savings opportunity represents the estimated monthly savings you can achieve +/// by implementing Compute Optimizer recommendations. +class AutoScalingGroupSavingsOpportunityAfterDiscounts { + /// An object that describes the estimated monthly savings possible by adopting + /// Compute Optimizer’s Auto Scaling group recommendations. This is based on the + /// Savings Plans and Reserved Instances pricing discounts. + final AutoScalingGroupEstimatedMonthlySavings? estimatedMonthlySavings; + + /// The estimated monthly savings possible as a percentage of monthly cost after + /// applying the Savings Plans and Reserved Instances discounts. This saving can + /// be achieved by adopting Compute Optimizer’s Auto Scaling group + /// recommendations. + final double? savingsOpportunityPercentage; + + AutoScalingGroupSavingsOpportunityAfterDiscounts({ + this.estimatedMonthlySavings, + this.savingsOpportunityPercentage, + }); + + factory AutoScalingGroupSavingsOpportunityAfterDiscounts.fromJson( + Map json) { + return AutoScalingGroupSavingsOpportunityAfterDiscounts( + estimatedMonthlySavings: json['estimatedMonthlySavings'] != null + ? AutoScalingGroupEstimatedMonthlySavings.fromJson( + json['estimatedMonthlySavings'] as Map) + : null, + savingsOpportunityPercentage: + json['savingsOpportunityPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final savingsOpportunityPercentage = this.savingsOpportunityPercentage; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (savingsOpportunityPercentage != null) + 'savingsOpportunityPercentage': savingsOpportunityPercentage, }; } } @@ -2502,12 +2881,159 @@ class CurrentPerformanceRiskRatings { } } -class DeleteRecommendationPreferencesResponse { - DeleteRecommendationPreferencesResponse(); +enum CustomizableMetricHeadroom { + percent_30, + percent_20, + percent_10, + percent_0, +} - factory DeleteRecommendationPreferencesResponse.fromJson( - Map _) { - return DeleteRecommendationPreferencesResponse(); +extension CustomizableMetricHeadroomValueExtension + on CustomizableMetricHeadroom { + String toValue() { + switch (this) { + case CustomizableMetricHeadroom.percent_30: + return 'PERCENT_30'; + case CustomizableMetricHeadroom.percent_20: + return 'PERCENT_20'; + case CustomizableMetricHeadroom.percent_10: + return 'PERCENT_10'; + case CustomizableMetricHeadroom.percent_0: + return 'PERCENT_0'; + } + } +} + +extension CustomizableMetricHeadroomFromString on String { + CustomizableMetricHeadroom toCustomizableMetricHeadroom() { + switch (this) { + case 'PERCENT_30': + return CustomizableMetricHeadroom.percent_30; + case 'PERCENT_20': + return CustomizableMetricHeadroom.percent_20; + case 'PERCENT_10': + return CustomizableMetricHeadroom.percent_10; + case 'PERCENT_0': + return CustomizableMetricHeadroom.percent_0; + } + throw Exception('$this is not known in enum CustomizableMetricHeadroom'); + } +} + +enum CustomizableMetricName { + cpuUtilization, + memoryUtilization, +} + +extension CustomizableMetricNameValueExtension on CustomizableMetricName { + String toValue() { + switch (this) { + case CustomizableMetricName.cpuUtilization: + return 'CpuUtilization'; + case CustomizableMetricName.memoryUtilization: + return 'MemoryUtilization'; + } + } +} + +extension CustomizableMetricNameFromString on String { + CustomizableMetricName toCustomizableMetricName() { + switch (this) { + case 'CpuUtilization': + return CustomizableMetricName.cpuUtilization; + case 'MemoryUtilization': + return CustomizableMetricName.memoryUtilization; + } + throw Exception('$this is not known in enum CustomizableMetricName'); + } +} + +/// Defines the various metric parameters that can be customized, such as +/// threshold and headroom. +class CustomizableMetricParameters { + /// The headroom value in percentage used for the specified metric parameter. + /// + /// The following lists the valid values for CPU and memory utilization. + /// + ///
          + ///
        • + /// CPU utilization: PERCENT_30 | PERCENT_20 | PERCENT_0 + ///
        • + ///
        • + /// Memory utilization: PERCENT_30 | PERCENT_20 | PERCENT_10 + ///
        • + ///
        + final CustomizableMetricHeadroom? headroom; + + /// The threshold value used for the specified metric parameter. + /// + /// You can only specify the threshold value for CPU utilization. + /// + final CustomizableMetricThreshold? threshold; + + CustomizableMetricParameters({ + this.headroom, + this.threshold, + }); + + factory CustomizableMetricParameters.fromJson(Map json) { + return CustomizableMetricParameters( + headroom: (json['headroom'] as String?)?.toCustomizableMetricHeadroom(), + threshold: + (json['threshold'] as String?)?.toCustomizableMetricThreshold(), + ); + } + + Map toJson() { + final headroom = this.headroom; + final threshold = this.threshold; + return { + if (headroom != null) 'headroom': headroom.toValue(), + if (threshold != null) 'threshold': threshold.toValue(), + }; + } +} + +enum CustomizableMetricThreshold { + p90, + p95, + p99_5, +} + +extension CustomizableMetricThresholdValueExtension + on CustomizableMetricThreshold { + String toValue() { + switch (this) { + case CustomizableMetricThreshold.p90: + return 'P90'; + case CustomizableMetricThreshold.p95: + return 'P95'; + case CustomizableMetricThreshold.p99_5: + return 'P99_5'; + } + } +} + +extension CustomizableMetricThresholdFromString on String { + CustomizableMetricThreshold toCustomizableMetricThreshold() { + switch (this) { + case 'P90': + return CustomizableMetricThreshold.p90; + case 'P95': + return CustomizableMetricThreshold.p95; + case 'P99_5': + return CustomizableMetricThreshold.p99_5; + } + throw Exception('$this is not known in enum CustomizableMetricThreshold'); + } +} + +class DeleteRecommendationPreferencesResponse { + DeleteRecommendationPreferencesResponse(); + + factory DeleteRecommendationPreferencesResponse.fromJson( + Map _) { + return DeleteRecommendationPreferencesResponse(); } Map toJson() { @@ -2552,6 +3078,67 @@ class DescribeRecommendationExportJobsResponse { } } +/// Describes the effective recommendation preferences for Amazon EBS volumes. +class EBSEffectiveRecommendationPreferences { + /// Describes the savings estimation mode preference applied for calculating + /// savings opportunity for Amazon EBS volumes. + final EBSSavingsEstimationMode? savingsEstimationMode; + + EBSEffectiveRecommendationPreferences({ + this.savingsEstimationMode, + }); + + factory EBSEffectiveRecommendationPreferences.fromJson( + Map json) { + return EBSEffectiveRecommendationPreferences( + savingsEstimationMode: json['savingsEstimationMode'] != null + ? EBSSavingsEstimationMode.fromJson( + json['savingsEstimationMode'] as Map) + : null, + ); + } + + Map toJson() { + final savingsEstimationMode = this.savingsEstimationMode; + return { + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode, + }; + } +} + +/// An object that describes the estimated monthly savings possible by adopting +/// Compute Optimizer’s Amazon EBS volume recommendations. This includes any +/// applicable discounts. +class EBSEstimatedMonthlySavings { + /// The currency of the estimated monthly savings. + final Currency? currency; + + /// The value of the estimated monthly savings. + final double? value; + + EBSEstimatedMonthlySavings({ + this.currency, + this.value, + }); + + factory EBSEstimatedMonthlySavings.fromJson(Map json) { + return EBSEstimatedMonthlySavings( + currency: (json['currency'] as String?)?.toCurrency(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final currency = this.currency; + final value = this.value; + return { + if (currency != null) 'currency': currency.toValue(), + if (value != null) 'value': value, + }; + } +} + /// Describes a filter that returns a more specific list of Amazon Elastic Block /// Store (Amazon EBS) volume recommendations. Use this filter with the /// GetEBSVolumeRecommendations action. @@ -2694,6 +3281,108 @@ extension EBSMetricNameFromString on String { } } +/// Describes the savings estimation mode used for calculating savings +/// opportunity for Amazon EBS volumes. +class EBSSavingsEstimationMode { + /// Describes the source for calculating the savings opportunity for Amazon EBS + /// volumes. + final EBSSavingsEstimationModeSource? source; + + EBSSavingsEstimationMode({ + this.source, + }); + + factory EBSSavingsEstimationMode.fromJson(Map json) { + return EBSSavingsEstimationMode( + source: (json['source'] as String?)?.toEBSSavingsEstimationModeSource(), + ); + } + + Map toJson() { + final source = this.source; + return { + if (source != null) 'source': source.toValue(), + }; + } +} + +enum EBSSavingsEstimationModeSource { + publicPricing, + costExplorerRightsizing, + costOptimizationHub, +} + +extension EBSSavingsEstimationModeSourceValueExtension + on EBSSavingsEstimationModeSource { + String toValue() { + switch (this) { + case EBSSavingsEstimationModeSource.publicPricing: + return 'PublicPricing'; + case EBSSavingsEstimationModeSource.costExplorerRightsizing: + return 'CostExplorerRightsizing'; + case EBSSavingsEstimationModeSource.costOptimizationHub: + return 'CostOptimizationHub'; + } + } +} + +extension EBSSavingsEstimationModeSourceFromString on String { + EBSSavingsEstimationModeSource toEBSSavingsEstimationModeSource() { + switch (this) { + case 'PublicPricing': + return EBSSavingsEstimationModeSource.publicPricing; + case 'CostExplorerRightsizing': + return EBSSavingsEstimationModeSource.costExplorerRightsizing; + case 'CostOptimizationHub': + return EBSSavingsEstimationModeSource.costOptimizationHub; + } + throw Exception( + '$this is not known in enum EBSSavingsEstimationModeSource'); + } +} + +/// Describes the savings opportunity for Amazon EBS volume recommendations +/// after applying specific discounts. +class EBSSavingsOpportunityAfterDiscounts { + /// The estimated monthly savings possible as a percentage of monthly cost by + /// adopting Compute Optimizer’s Amazon EBS volume recommendations. This saving + /// includes any applicable discounts. + final EBSEstimatedMonthlySavings? estimatedMonthlySavings; + + /// The estimated monthly savings possible as a percentage of monthly cost after + /// applying the specific discounts. This saving can be achieved by adopting + /// Compute Optimizer’s Amazon EBS volume recommendations. + final double? savingsOpportunityPercentage; + + EBSSavingsOpportunityAfterDiscounts({ + this.estimatedMonthlySavings, + this.savingsOpportunityPercentage, + }); + + factory EBSSavingsOpportunityAfterDiscounts.fromJson( + Map json) { + return EBSSavingsOpportunityAfterDiscounts( + estimatedMonthlySavings: json['estimatedMonthlySavings'] != null + ? EBSEstimatedMonthlySavings.fromJson( + json['estimatedMonthlySavings'] as Map) + : null, + savingsOpportunityPercentage: + json['savingsOpportunityPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final savingsOpportunityPercentage = this.savingsOpportunityPercentage; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (savingsOpportunityPercentage != null) + 'savingsOpportunityPercentage': savingsOpportunityPercentage, + }; + } +} + /// Describes a utilization metric of an Amazon Elastic Block Store (Amazon EBS) /// volume. /// @@ -2780,6 +3469,173 @@ class EBSUtilizationMetric { } } +/// Describes the effective recommendation preferences for Amazon ECS services. +class ECSEffectiveRecommendationPreferences { + /// Describes the savings estimation mode preference applied for calculating + /// savings opportunity for Amazon ECS services. + final ECSSavingsEstimationMode? savingsEstimationMode; + + ECSEffectiveRecommendationPreferences({ + this.savingsEstimationMode, + }); + + factory ECSEffectiveRecommendationPreferences.fromJson( + Map json) { + return ECSEffectiveRecommendationPreferences( + savingsEstimationMode: json['savingsEstimationMode'] != null + ? ECSSavingsEstimationMode.fromJson( + json['savingsEstimationMode'] as Map) + : null, + ); + } + + Map toJson() { + final savingsEstimationMode = this.savingsEstimationMode; + return { + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode, + }; + } +} + +/// Describes the estimated monthly savings possible for Amazon ECS services by +/// adopting Compute Optimizer recommendations. This is based on Amazon ECS +/// service pricing after applying Savings Plans discounts. +class ECSEstimatedMonthlySavings { + /// The currency of the estimated monthly savings. + final Currency? currency; + + /// The value of the estimated monthly savings for Amazon ECS services. + final double? value; + + ECSEstimatedMonthlySavings({ + this.currency, + this.value, + }); + + factory ECSEstimatedMonthlySavings.fromJson(Map json) { + return ECSEstimatedMonthlySavings( + currency: (json['currency'] as String?)?.toCurrency(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final currency = this.currency; + final value = this.value; + return { + if (currency != null) 'currency': currency.toValue(), + if (value != null) 'value': value, + }; + } +} + +/// Describes the savings estimation mode used for calculating savings +/// opportunity for Amazon ECS services. +class ECSSavingsEstimationMode { + /// Describes the source for calculating the savings opportunity for Amazon ECS + /// services. + final ECSSavingsEstimationModeSource? source; + + ECSSavingsEstimationMode({ + this.source, + }); + + factory ECSSavingsEstimationMode.fromJson(Map json) { + return ECSSavingsEstimationMode( + source: (json['source'] as String?)?.toECSSavingsEstimationModeSource(), + ); + } + + Map toJson() { + final source = this.source; + return { + if (source != null) 'source': source.toValue(), + }; + } +} + +enum ECSSavingsEstimationModeSource { + publicPricing, + costExplorerRightsizing, + costOptimizationHub, +} + +extension ECSSavingsEstimationModeSourceValueExtension + on ECSSavingsEstimationModeSource { + String toValue() { + switch (this) { + case ECSSavingsEstimationModeSource.publicPricing: + return 'PublicPricing'; + case ECSSavingsEstimationModeSource.costExplorerRightsizing: + return 'CostExplorerRightsizing'; + case ECSSavingsEstimationModeSource.costOptimizationHub: + return 'CostOptimizationHub'; + } + } +} + +extension ECSSavingsEstimationModeSourceFromString on String { + ECSSavingsEstimationModeSource toECSSavingsEstimationModeSource() { + switch (this) { + case 'PublicPricing': + return ECSSavingsEstimationModeSource.publicPricing; + case 'CostExplorerRightsizing': + return ECSSavingsEstimationModeSource.costExplorerRightsizing; + case 'CostOptimizationHub': + return ECSSavingsEstimationModeSource.costOptimizationHub; + } + throw Exception( + '$this is not known in enum ECSSavingsEstimationModeSource'); + } +} + +/// Describes the savings opportunity for Amazon ECS service recommendations +/// after applying Savings Plans discounts. +/// +/// Savings opportunity represents the estimated monthly savings after applying +/// Savings Plans discounts. You can achieve this by implementing a given +/// Compute Optimizer recommendation. +class ECSSavingsOpportunityAfterDiscounts { + /// The estimated monthly savings possible by adopting Compute Optimizer’s + /// Amazon ECS service recommendations. This includes any applicable Savings + /// Plans discounts. + final ECSEstimatedMonthlySavings? estimatedMonthlySavings; + + /// The estimated monthly savings possible as a percentage of monthly cost by + /// adopting Compute Optimizer’s Amazon ECS service recommendations. This + /// includes any applicable Savings Plans discounts. + final double? savingsOpportunityPercentage; + + ECSSavingsOpportunityAfterDiscounts({ + this.estimatedMonthlySavings, + this.savingsOpportunityPercentage, + }); + + factory ECSSavingsOpportunityAfterDiscounts.fromJson( + Map json) { + return ECSSavingsOpportunityAfterDiscounts( + estimatedMonthlySavings: json['estimatedMonthlySavings'] != null + ? ECSEstimatedMonthlySavings.fromJson( + json['estimatedMonthlySavings'] as Map) + : null, + savingsOpportunityPercentage: + json['savingsOpportunityPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final savingsOpportunityPercentage = this.savingsOpportunityPercentage; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (savingsOpportunityPercentage != null) + 'savingsOpportunityPercentage': savingsOpportunityPercentage, + }; + } +} + enum ECSServiceLaunchType { ec2, fargate, @@ -3027,6 +3883,10 @@ class ECSServiceRecommendation { /// The configuration of the current Amazon ECS service. final ServiceConfiguration? currentServiceConfiguration; + /// Describes the effective recommendation preferences for Amazon ECS services. + final ECSEffectiveRecommendationPreferences? + effectiveRecommendationPreferences; + /// The finding classification of an Amazon ECS service. /// /// Findings for Amazon ECS services include: @@ -3120,6 +3980,7 @@ class ECSServiceRecommendation { this.accountId, this.currentPerformanceRisk, this.currentServiceConfiguration, + this.effectiveRecommendationPreferences, this.finding, this.findingReasonCodes, this.lastRefreshTimestamp, @@ -3140,6 +4001,12 @@ class ECSServiceRecommendation { ? ServiceConfiguration.fromJson( json['currentServiceConfiguration'] as Map) : null, + effectiveRecommendationPreferences: + json['effectiveRecommendationPreferences'] != null + ? ECSEffectiveRecommendationPreferences.fromJson( + json['effectiveRecommendationPreferences'] + as Map) + : null, finding: (json['finding'] as String?)?.toECSServiceRecommendationFinding(), findingReasonCodes: (json['findingReasonCodes'] as List?) @@ -3173,6 +4040,8 @@ class ECSServiceRecommendation { final accountId = this.accountId; final currentPerformanceRisk = this.currentPerformanceRisk; final currentServiceConfiguration = this.currentServiceConfiguration; + final effectiveRecommendationPreferences = + this.effectiveRecommendationPreferences; final finding = this.finding; final findingReasonCodes = this.findingReasonCodes; final lastRefreshTimestamp = this.lastRefreshTimestamp; @@ -3188,6 +4057,9 @@ class ECSServiceRecommendation { 'currentPerformanceRisk': currentPerformanceRisk.toValue(), if (currentServiceConfiguration != null) 'currentServiceConfiguration': currentServiceConfiguration, + if (effectiveRecommendationPreferences != null) + 'effectiveRecommendationPreferences': + effectiveRecommendationPreferences, if (finding != null) 'finding': finding.toValue(), if (findingReasonCodes != null) 'findingReasonCodes': @@ -3393,12 +4265,21 @@ class ECSServiceRecommendationOption { final List? projectedUtilizationMetrics; final SavingsOpportunity? savingsOpportunity; + /// Describes the savings opportunity for Amazon ECS service recommendations or + /// for the recommendation option. + /// + /// Savings opportunity represents the estimated monthly savings after applying + /// Savings Plans discounts. You can achieve this by implementing a given + /// Compute Optimizer recommendation. + final ECSSavingsOpportunityAfterDiscounts? savingsOpportunityAfterDiscounts; + ECSServiceRecommendationOption({ this.containerRecommendations, this.cpu, this.memory, this.projectedUtilizationMetrics, this.savingsOpportunity, + this.savingsOpportunityAfterDiscounts, }); factory ECSServiceRecommendationOption.fromJson(Map json) { @@ -3420,6 +4301,12 @@ class ECSServiceRecommendationOption { ? SavingsOpportunity.fromJson( json['savingsOpportunity'] as Map) : null, + savingsOpportunityAfterDiscounts: + json['savingsOpportunityAfterDiscounts'] != null + ? ECSSavingsOpportunityAfterDiscounts.fromJson( + json['savingsOpportunityAfterDiscounts'] + as Map) + : null, ); } @@ -3429,6 +4316,8 @@ class ECSServiceRecommendationOption { final memory = this.memory; final projectedUtilizationMetrics = this.projectedUtilizationMetrics; final savingsOpportunity = this.savingsOpportunity; + final savingsOpportunityAfterDiscounts = + this.savingsOpportunityAfterDiscounts; return { if (containerRecommendations != null) 'containerRecommendations': containerRecommendations, @@ -3437,6 +4326,8 @@ class ECSServiceRecommendationOption { if (projectedUtilizationMetrics != null) 'projectedUtilizationMetrics': projectedUtilizationMetrics, if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, + if (savingsOpportunityAfterDiscounts != null) + 'savingsOpportunityAfterDiscounts': savingsOpportunityAfterDiscounts, }; } } @@ -3557,6 +4448,66 @@ class ECSServiceUtilizationMetric { } } +/// Describes the effective preferred resources that Compute Optimizer considers +/// as rightsizing recommendation candidates. +/// +/// Compute Optimizer only supports Amazon EC2 instance types. +/// +class EffectivePreferredResource { + /// The expanded version of your preferred resource's include list. + final List? effectiveIncludeList; + + /// The list of preferred resources values that you want excluded from + /// rightsizing recommendation candidates. + final List? excludeList; + + /// The list of preferred resource values that you want considered as + /// rightsizing recommendation candidates. + final List? includeList; + + /// The name of the preferred resource list. + final PreferredResourceName? name; + + EffectivePreferredResource({ + this.effectiveIncludeList, + this.excludeList, + this.includeList, + this.name, + }); + + factory EffectivePreferredResource.fromJson(Map json) { + return EffectivePreferredResource( + effectiveIncludeList: (json['effectiveIncludeList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + excludeList: (json['excludeList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + includeList: (json['includeList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + name: (json['name'] as String?)?.toPreferredResourceName(), + ); + } + + Map toJson() { + final effectiveIncludeList = this.effectiveIncludeList; + final excludeList = this.excludeList; + final includeList = this.includeList; + final name = this.name; + return { + if (effectiveIncludeList != null) + 'effectiveIncludeList': effectiveIncludeList, + if (excludeList != null) 'excludeList': excludeList, + if (includeList != null) 'includeList': includeList, + if (name != null) 'name': name.toValue(), + }; + } +} + /// Describes the effective recommendation preferences for a resource. class EffectiveRecommendationPreferences { /// Describes the CPU vendor and architecture for an instance or Auto Scaling @@ -3610,11 +4561,34 @@ class EffectiveRecommendationPreferences { /// confirms that it's not yet applied to recommendations. final InferredWorkloadTypesPreference? inferredWorkloadTypes; + /// The number of days the utilization metrics of the Amazon Web Services + /// resource are analyzed. + final LookBackPeriodPreference? lookBackPeriod; + + /// The resource type values that are considered as candidates when generating + /// rightsizing recommendations. + final List? preferredResources; + + /// Describes the savings estimation mode applied for calculating savings + /// opportunity for a resource. + final InstanceSavingsEstimationMode? savingsEstimationMode; + + /// The resource’s CPU and memory utilization preferences, such as threshold and + /// headroom, that are used to generate rightsizing recommendations. + /// + /// This preference is only available for the Amazon EC2 instance resource type. + /// + final List? utilizationPreferences; + EffectiveRecommendationPreferences({ this.cpuVendorArchitectures, this.enhancedInfrastructureMetrics, this.externalMetricsPreference, this.inferredWorkloadTypes, + this.lookBackPeriod, + this.preferredResources, + this.savingsEstimationMode, + this.utilizationPreferences, }); factory EffectiveRecommendationPreferences.fromJson( @@ -3633,6 +4607,21 @@ class EffectiveRecommendationPreferences { : null, inferredWorkloadTypes: (json['inferredWorkloadTypes'] as String?) ?.toInferredWorkloadTypesPreference(), + lookBackPeriod: + (json['lookBackPeriod'] as String?)?.toLookBackPeriodPreference(), + preferredResources: (json['preferredResources'] as List?) + ?.whereNotNull() + .map((e) => + EffectivePreferredResource.fromJson(e as Map)) + .toList(), + savingsEstimationMode: json['savingsEstimationMode'] != null + ? InstanceSavingsEstimationMode.fromJson( + json['savingsEstimationMode'] as Map) + : null, + utilizationPreferences: (json['utilizationPreferences'] as List?) + ?.whereNotNull() + .map((e) => UtilizationPreference.fromJson(e as Map)) + .toList(), ); } @@ -3641,6 +4630,10 @@ class EffectiveRecommendationPreferences { final enhancedInfrastructureMetrics = this.enhancedInfrastructureMetrics; final externalMetricsPreference = this.externalMetricsPreference; final inferredWorkloadTypes = this.inferredWorkloadTypes; + final lookBackPeriod = this.lookBackPeriod; + final preferredResources = this.preferredResources; + final savingsEstimationMode = this.savingsEstimationMode; + final utilizationPreferences = this.utilizationPreferences; return { if (cpuVendorArchitectures != null) 'cpuVendorArchitectures': @@ -3652,6 +4645,12 @@ class EffectiveRecommendationPreferences { 'externalMetricsPreference': externalMetricsPreference, if (inferredWorkloadTypes != null) 'inferredWorkloadTypes': inferredWorkloadTypes.toValue(), + if (lookBackPeriod != null) 'lookBackPeriod': lookBackPeriod.toValue(), + if (preferredResources != null) 'preferredResources': preferredResources, + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode, + if (utilizationPreferences != null) + 'utilizationPreferences': utilizationPreferences, }; } } @@ -3979,6 +4978,40 @@ class ExportLambdaFunctionRecommendationsResponse { } } +class ExportLicenseRecommendationsResponse { + /// The identification number of the export job. + /// + /// To view the status of an export job, use the + /// DescribeRecommendationExportJobs action and specify the job ID. + final String? jobId; + final S3Destination? s3Destination; + + ExportLicenseRecommendationsResponse({ + this.jobId, + this.s3Destination, + }); + + factory ExportLicenseRecommendationsResponse.fromJson( + Map json) { + return ExportLicenseRecommendationsResponse( + jobId: json['jobId'] as String?, + s3Destination: json['s3Destination'] != null + ? S3Destination.fromJson( + json['s3Destination'] as Map) + : null, + ); + } + + Map toJson() { + final jobId = this.jobId; + final s3Destination = this.s3Destination; + return { + if (jobId != null) 'jobId': jobId, + if (s3Destination != null) 's3Destination': s3Destination, + }; + } +} + enum ExportableAutoScalingGroupField { accountId, autoScalingGroupArn, @@ -4034,6 +5067,18 @@ enum ExportableAutoScalingGroupField { effectiveRecommendationPreferencesInferredWorkloadTypes, inferredWorkloadTypes, recommendationOptionsMigrationEffort, + currentInstanceGpuInfo, + recommendationOptionsInstanceGpuInfo, + utilizationMetricsGpuPercentageMaximum, + utilizationMetricsGpuMemoryPercentageMaximum, + recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum, + recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum, + effectiveRecommendationPreferencesSavingsEstimationMode, + recommendationOptionsSavingsOpportunityAfterDiscountsPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts, + recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts, + effectiveRecommendationPreferencesPreferredResources, + effectiveRecommendationPreferencesLookBackPeriod, } extension ExportableAutoScalingGroupFieldValueExtension @@ -4176,6 +5221,40 @@ extension ExportableAutoScalingGroupFieldValueExtension return 'InferredWorkloadTypes'; case ExportableAutoScalingGroupField.recommendationOptionsMigrationEffort: return 'RecommendationOptionsMigrationEffort'; + case ExportableAutoScalingGroupField.currentInstanceGpuInfo: + return 'CurrentInstanceGpuInfo'; + case ExportableAutoScalingGroupField.recommendationOptionsInstanceGpuInfo: + return 'RecommendationOptionsInstanceGpuInfo'; + case ExportableAutoScalingGroupField + .utilizationMetricsGpuPercentageMaximum: + return 'UtilizationMetricsGpuPercentageMaximum'; + case ExportableAutoScalingGroupField + .utilizationMetricsGpuMemoryPercentageMaximum: + return 'UtilizationMetricsGpuMemoryPercentageMaximum'; + case ExportableAutoScalingGroupField + .recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum: + return 'RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum'; + case ExportableAutoScalingGroupField + .recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum: + return 'RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum'; + case ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesSavingsEstimationMode: + return 'EffectiveRecommendationPreferencesSavingsEstimationMode'; + case ExportableAutoScalingGroupField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage: + return 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage'; + case ExportableAutoScalingGroupField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts'; + case ExportableAutoScalingGroupField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts'; + case ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesPreferredResources: + return 'EffectiveRecommendationPreferencesPreferredResources'; + case ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesLookBackPeriod: + return 'EffectiveRecommendationPreferencesLookBackPeriod'; } } } @@ -4323,6 +5402,41 @@ extension ExportableAutoScalingGroupFieldFromString on String { case 'RecommendationOptionsMigrationEffort': return ExportableAutoScalingGroupField .recommendationOptionsMigrationEffort; + case 'CurrentInstanceGpuInfo': + return ExportableAutoScalingGroupField.currentInstanceGpuInfo; + case 'RecommendationOptionsInstanceGpuInfo': + return ExportableAutoScalingGroupField + .recommendationOptionsInstanceGpuInfo; + case 'UtilizationMetricsGpuPercentageMaximum': + return ExportableAutoScalingGroupField + .utilizationMetricsGpuPercentageMaximum; + case 'UtilizationMetricsGpuMemoryPercentageMaximum': + return ExportableAutoScalingGroupField + .utilizationMetricsGpuMemoryPercentageMaximum; + case 'RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum': + return ExportableAutoScalingGroupField + .recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum; + case 'RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum': + return ExportableAutoScalingGroupField + .recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum; + case 'EffectiveRecommendationPreferencesSavingsEstimationMode': + return ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesSavingsEstimationMode; + case 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage': + return ExportableAutoScalingGroupField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts': + return ExportableAutoScalingGroupField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts; + case 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts': + return ExportableAutoScalingGroupField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts; + case 'EffectiveRecommendationPreferencesPreferredResources': + return ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesPreferredResources; + case 'EffectiveRecommendationPreferencesLookBackPeriod': + return ExportableAutoScalingGroupField + .effectiveRecommendationPreferencesLookBackPeriod; } throw Exception( '$this is not known in enum ExportableAutoScalingGroupField'); @@ -4354,6 +5468,10 @@ enum ExportableECSServiceField { recommendationOptionsProjectedUtilizationMetricsCpuMaximum, recommendationOptionsProjectedUtilizationMetricsMemoryMaximum, tags, + effectiveRecommendationPreferencesSavingsEstimationMode, + recommendationOptionsSavingsOpportunityAfterDiscountsPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts, + recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts, } extension ExportableECSServiceFieldValueExtension on ExportableECSServiceField { @@ -4415,6 +5533,18 @@ extension ExportableECSServiceFieldValueExtension on ExportableECSServiceField { return 'RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum'; case ExportableECSServiceField.tags: return 'Tags'; + case ExportableECSServiceField + .effectiveRecommendationPreferencesSavingsEstimationMode: + return 'EffectiveRecommendationPreferencesSavingsEstimationMode'; + case ExportableECSServiceField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage: + return 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage'; + case ExportableECSServiceField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts'; + case ExportableECSServiceField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts'; } } } @@ -4478,6 +5608,18 @@ extension ExportableECSServiceFieldFromString on String { .recommendationOptionsProjectedUtilizationMetricsMemoryMaximum; case 'Tags': return ExportableECSServiceField.tags; + case 'EffectiveRecommendationPreferencesSavingsEstimationMode': + return ExportableECSServiceField + .effectiveRecommendationPreferencesSavingsEstimationMode; + case 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage': + return ExportableECSServiceField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts': + return ExportableECSServiceField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts; + case 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts': + return ExportableECSServiceField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts; } throw Exception('$this is not known in enum ExportableECSServiceField'); } @@ -4541,6 +5683,20 @@ enum ExportableInstanceField { tags, externalMetricStatusCode, externalMetricStatusReason, + currentInstanceGpuInfo, + recommendationOptionsInstanceGpuInfo, + utilizationMetricsGpuPercentageMaximum, + utilizationMetricsGpuMemoryPercentageMaximum, + recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum, + recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum, + idle, + effectiveRecommendationPreferencesPreferredResources, + effectiveRecommendationPreferencesLookBackPeriod, + effectiveRecommendationPreferencesUtilizationPreferences, + effectiveRecommendationPreferencesSavingsEstimationMode, + recommendationOptionsSavingsOpportunityAfterDiscountsPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts, + recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts, } extension ExportableInstanceFieldValueExtension on ExportableInstanceField { @@ -4685,6 +5841,43 @@ extension ExportableInstanceFieldValueExtension on ExportableInstanceField { return 'ExternalMetricStatusCode'; case ExportableInstanceField.externalMetricStatusReason: return 'ExternalMetricStatusReason'; + case ExportableInstanceField.currentInstanceGpuInfo: + return 'CurrentInstanceGpuInfo'; + case ExportableInstanceField.recommendationOptionsInstanceGpuInfo: + return 'RecommendationOptionsInstanceGpuInfo'; + case ExportableInstanceField.utilizationMetricsGpuPercentageMaximum: + return 'UtilizationMetricsGpuPercentageMaximum'; + case ExportableInstanceField.utilizationMetricsGpuMemoryPercentageMaximum: + return 'UtilizationMetricsGpuMemoryPercentageMaximum'; + case ExportableInstanceField + .recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum: + return 'RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum'; + case ExportableInstanceField + .recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum: + return 'RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum'; + case ExportableInstanceField.idle: + return 'Idle'; + case ExportableInstanceField + .effectiveRecommendationPreferencesPreferredResources: + return 'EffectiveRecommendationPreferencesPreferredResources'; + case ExportableInstanceField + .effectiveRecommendationPreferencesLookBackPeriod: + return 'EffectiveRecommendationPreferencesLookBackPeriod'; + case ExportableInstanceField + .effectiveRecommendationPreferencesUtilizationPreferences: + return 'EffectiveRecommendationPreferencesUtilizationPreferences'; + case ExportableInstanceField + .effectiveRecommendationPreferencesSavingsEstimationMode: + return 'EffectiveRecommendationPreferencesSavingsEstimationMode'; + case ExportableInstanceField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage: + return 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage'; + case ExportableInstanceField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts'; + case ExportableInstanceField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts'; } } } @@ -4833,6 +6026,44 @@ extension ExportableInstanceFieldFromString on String { return ExportableInstanceField.externalMetricStatusCode; case 'ExternalMetricStatusReason': return ExportableInstanceField.externalMetricStatusReason; + case 'CurrentInstanceGpuInfo': + return ExportableInstanceField.currentInstanceGpuInfo; + case 'RecommendationOptionsInstanceGpuInfo': + return ExportableInstanceField.recommendationOptionsInstanceGpuInfo; + case 'UtilizationMetricsGpuPercentageMaximum': + return ExportableInstanceField.utilizationMetricsGpuPercentageMaximum; + case 'UtilizationMetricsGpuMemoryPercentageMaximum': + return ExportableInstanceField + .utilizationMetricsGpuMemoryPercentageMaximum; + case 'RecommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum': + return ExportableInstanceField + .recommendationOptionsProjectedUtilizationMetricsGpuPercentageMaximum; + case 'RecommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum': + return ExportableInstanceField + .recommendationOptionsProjectedUtilizationMetricsGpuMemoryPercentageMaximum; + case 'Idle': + return ExportableInstanceField.idle; + case 'EffectiveRecommendationPreferencesPreferredResources': + return ExportableInstanceField + .effectiveRecommendationPreferencesPreferredResources; + case 'EffectiveRecommendationPreferencesLookBackPeriod': + return ExportableInstanceField + .effectiveRecommendationPreferencesLookBackPeriod; + case 'EffectiveRecommendationPreferencesUtilizationPreferences': + return ExportableInstanceField + .effectiveRecommendationPreferencesUtilizationPreferences; + case 'EffectiveRecommendationPreferencesSavingsEstimationMode': + return ExportableInstanceField + .effectiveRecommendationPreferencesSavingsEstimationMode; + case 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage': + return ExportableInstanceField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts': + return ExportableInstanceField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts; + case 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts': + return ExportableInstanceField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts; } throw Exception('$this is not known in enum ExportableInstanceField'); } @@ -4866,6 +6097,10 @@ enum ExportableLambdaFunctionField { recommendationOptionsEstimatedMonthlySavingsCurrency, recommendationOptionsEstimatedMonthlySavingsValue, tags, + effectiveRecommendationPreferencesSavingsEstimationMode, + recommendationOptionsSavingsOpportunityAfterDiscountsPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts, + recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts, } extension ExportableLambdaFunctionFieldValueExtension @@ -4933,6 +6168,18 @@ extension ExportableLambdaFunctionFieldValueExtension return 'RecommendationOptionsEstimatedMonthlySavingsValue'; case ExportableLambdaFunctionField.tags: return 'Tags'; + case ExportableLambdaFunctionField + .effectiveRecommendationPreferencesSavingsEstimationMode: + return 'EffectiveRecommendationPreferencesSavingsEstimationMode'; + case ExportableLambdaFunctionField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage: + return 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage'; + case ExportableLambdaFunctionField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts'; + case ExportableLambdaFunctionField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts'; } } } @@ -5001,11 +6248,153 @@ extension ExportableLambdaFunctionFieldFromString on String { .recommendationOptionsEstimatedMonthlySavingsValue; case 'Tags': return ExportableLambdaFunctionField.tags; + case 'EffectiveRecommendationPreferencesSavingsEstimationMode': + return ExportableLambdaFunctionField + .effectiveRecommendationPreferencesSavingsEstimationMode; + case 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage': + return ExportableLambdaFunctionField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts': + return ExportableLambdaFunctionField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts; + case 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts': + return ExportableLambdaFunctionField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts; } throw Exception('$this is not known in enum ExportableLambdaFunctionField'); } } +enum ExportableLicenseField { + accountId, + resourceArn, + lookbackPeriodInDays, + lastRefreshTimestamp, + finding, + findingReasonCodes, + currentLicenseConfigurationNumberOfCores, + currentLicenseConfigurationInstanceType, + currentLicenseConfigurationOperatingSystem, + currentLicenseConfigurationLicenseName, + currentLicenseConfigurationLicenseEdition, + currentLicenseConfigurationLicenseModel, + currentLicenseConfigurationLicenseVersion, + currentLicenseConfigurationMetricsSource, + recommendationOptionsOperatingSystem, + recommendationOptionsLicenseEdition, + recommendationOptionsLicenseModel, + recommendationOptionsSavingsOpportunityPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrency, + recommendationOptionsEstimatedMonthlySavingsValue, + tags, +} + +extension ExportableLicenseFieldValueExtension on ExportableLicenseField { + String toValue() { + switch (this) { + case ExportableLicenseField.accountId: + return 'AccountId'; + case ExportableLicenseField.resourceArn: + return 'ResourceArn'; + case ExportableLicenseField.lookbackPeriodInDays: + return 'LookbackPeriodInDays'; + case ExportableLicenseField.lastRefreshTimestamp: + return 'LastRefreshTimestamp'; + case ExportableLicenseField.finding: + return 'Finding'; + case ExportableLicenseField.findingReasonCodes: + return 'FindingReasonCodes'; + case ExportableLicenseField.currentLicenseConfigurationNumberOfCores: + return 'CurrentLicenseConfigurationNumberOfCores'; + case ExportableLicenseField.currentLicenseConfigurationInstanceType: + return 'CurrentLicenseConfigurationInstanceType'; + case ExportableLicenseField.currentLicenseConfigurationOperatingSystem: + return 'CurrentLicenseConfigurationOperatingSystem'; + case ExportableLicenseField.currentLicenseConfigurationLicenseName: + return 'CurrentLicenseConfigurationLicenseName'; + case ExportableLicenseField.currentLicenseConfigurationLicenseEdition: + return 'CurrentLicenseConfigurationLicenseEdition'; + case ExportableLicenseField.currentLicenseConfigurationLicenseModel: + return 'CurrentLicenseConfigurationLicenseModel'; + case ExportableLicenseField.currentLicenseConfigurationLicenseVersion: + return 'CurrentLicenseConfigurationLicenseVersion'; + case ExportableLicenseField.currentLicenseConfigurationMetricsSource: + return 'CurrentLicenseConfigurationMetricsSource'; + case ExportableLicenseField.recommendationOptionsOperatingSystem: + return 'RecommendationOptionsOperatingSystem'; + case ExportableLicenseField.recommendationOptionsLicenseEdition: + return 'RecommendationOptionsLicenseEdition'; + case ExportableLicenseField.recommendationOptionsLicenseModel: + return 'RecommendationOptionsLicenseModel'; + case ExportableLicenseField + .recommendationOptionsSavingsOpportunityPercentage: + return 'RecommendationOptionsSavingsOpportunityPercentage'; + case ExportableLicenseField + .recommendationOptionsEstimatedMonthlySavingsCurrency: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrency'; + case ExportableLicenseField + .recommendationOptionsEstimatedMonthlySavingsValue: + return 'RecommendationOptionsEstimatedMonthlySavingsValue'; + case ExportableLicenseField.tags: + return 'Tags'; + } + } +} + +extension ExportableLicenseFieldFromString on String { + ExportableLicenseField toExportableLicenseField() { + switch (this) { + case 'AccountId': + return ExportableLicenseField.accountId; + case 'ResourceArn': + return ExportableLicenseField.resourceArn; + case 'LookbackPeriodInDays': + return ExportableLicenseField.lookbackPeriodInDays; + case 'LastRefreshTimestamp': + return ExportableLicenseField.lastRefreshTimestamp; + case 'Finding': + return ExportableLicenseField.finding; + case 'FindingReasonCodes': + return ExportableLicenseField.findingReasonCodes; + case 'CurrentLicenseConfigurationNumberOfCores': + return ExportableLicenseField.currentLicenseConfigurationNumberOfCores; + case 'CurrentLicenseConfigurationInstanceType': + return ExportableLicenseField.currentLicenseConfigurationInstanceType; + case 'CurrentLicenseConfigurationOperatingSystem': + return ExportableLicenseField + .currentLicenseConfigurationOperatingSystem; + case 'CurrentLicenseConfigurationLicenseName': + return ExportableLicenseField.currentLicenseConfigurationLicenseName; + case 'CurrentLicenseConfigurationLicenseEdition': + return ExportableLicenseField.currentLicenseConfigurationLicenseEdition; + case 'CurrentLicenseConfigurationLicenseModel': + return ExportableLicenseField.currentLicenseConfigurationLicenseModel; + case 'CurrentLicenseConfigurationLicenseVersion': + return ExportableLicenseField.currentLicenseConfigurationLicenseVersion; + case 'CurrentLicenseConfigurationMetricsSource': + return ExportableLicenseField.currentLicenseConfigurationMetricsSource; + case 'RecommendationOptionsOperatingSystem': + return ExportableLicenseField.recommendationOptionsOperatingSystem; + case 'RecommendationOptionsLicenseEdition': + return ExportableLicenseField.recommendationOptionsLicenseEdition; + case 'RecommendationOptionsLicenseModel': + return ExportableLicenseField.recommendationOptionsLicenseModel; + case 'RecommendationOptionsSavingsOpportunityPercentage': + return ExportableLicenseField + .recommendationOptionsSavingsOpportunityPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrency': + return ExportableLicenseField + .recommendationOptionsEstimatedMonthlySavingsCurrency; + case 'RecommendationOptionsEstimatedMonthlySavingsValue': + return ExportableLicenseField + .recommendationOptionsEstimatedMonthlySavingsValue; + case 'Tags': + return ExportableLicenseField.tags; + } + throw Exception('$this is not known in enum ExportableLicenseField'); + } +} + enum ExportableVolumeField { accountId, volumeArn, @@ -5037,6 +6426,11 @@ enum ExportableVolumeField { recommendationOptionsEstimatedMonthlySavingsValue, rootVolume, tags, + currentConfigurationRootVolume, + effectiveRecommendationPreferencesSavingsEstimationMode, + recommendationOptionsSavingsOpportunityAfterDiscountsPercentage, + recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts, + recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts, } extension ExportableVolumeFieldValueExtension on ExportableVolumeField { @@ -5113,6 +6507,20 @@ extension ExportableVolumeFieldValueExtension on ExportableVolumeField { return 'RootVolume'; case ExportableVolumeField.tags: return 'Tags'; + case ExportableVolumeField.currentConfigurationRootVolume: + return 'CurrentConfigurationRootVolume'; + case ExportableVolumeField + .effectiveRecommendationPreferencesSavingsEstimationMode: + return 'EffectiveRecommendationPreferencesSavingsEstimationMode'; + case ExportableVolumeField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage: + return 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage'; + case ExportableVolumeField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts'; + case ExportableVolumeField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts: + return 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts'; } } } @@ -5194,6 +6602,20 @@ extension ExportableVolumeFieldFromString on String { return ExportableVolumeField.rootVolume; case 'Tags': return ExportableVolumeField.tags; + case 'CurrentConfigurationRootVolume': + return ExportableVolumeField.currentConfigurationRootVolume; + case 'EffectiveRecommendationPreferencesSavingsEstimationMode': + return ExportableVolumeField + .effectiveRecommendationPreferencesSavingsEstimationMode; + case 'RecommendationOptionsSavingsOpportunityAfterDiscountsPercentage': + return ExportableVolumeField + .recommendationOptionsSavingsOpportunityAfterDiscountsPercentage; + case 'RecommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts': + return ExportableVolumeField + .recommendationOptionsEstimatedMonthlySavingsCurrencyAfterDiscounts; + case 'RecommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts': + return ExportableVolumeField + .recommendationOptionsEstimatedMonthlySavingsValueAfterDiscounts; } throw Exception('$this is not known in enum ExportableVolumeField'); } @@ -5968,9 +7390,44 @@ class GetEffectiveRecommendationPreferencesResponse { /// infrastructure metrics in the Compute Optimizer User Guide. final ExternalMetricsPreference? externalMetricsPreference; + /// The number of days the utilization metrics of the Amazon Web Services + /// resource are analyzed. + /// + /// To validate that the preference is applied to your last generated set of + /// recommendations, review the effectiveRecommendationPreferences + /// value in the response of the GetAutoScalingGroupRecommendations or + /// GetEC2InstanceRecommendations actions. + final LookBackPeriodPreference? lookBackPeriod; + + /// The resource type values that are considered as candidates when generating + /// rightsizing recommendations. This object resolves any wildcard expressions + /// and returns the effective list of candidate resource type values. It also + /// considers all applicable preferences that you set at the resource, account, + /// and organization level. + /// + /// To validate that the preference is applied to your last generated set of + /// recommendations, review the effectiveRecommendationPreferences + /// value in the response of the GetAutoScalingGroupRecommendations or + /// GetEC2InstanceRecommendations actions. + final List? preferredResources; + + /// The resource’s CPU and memory utilization preferences, such as threshold and + /// headroom, that were used to generate rightsizing recommendations. It + /// considers all applicable preferences that you set at the resource, account, + /// and organization level. + /// + /// To validate that the preference is applied to your last generated set of + /// recommendations, review the effectiveRecommendationPreferences + /// value in the response of the GetAutoScalingGroupRecommendations or + /// GetEC2InstanceRecommendations actions. + final List? utilizationPreferences; + GetEffectiveRecommendationPreferencesResponse({ this.enhancedInfrastructureMetrics, this.externalMetricsPreference, + this.lookBackPeriod, + this.preferredResources, + this.utilizationPreferences, }); factory GetEffectiveRecommendationPreferencesResponse.fromJson( @@ -5983,18 +7440,36 @@ class GetEffectiveRecommendationPreferencesResponse { ? ExternalMetricsPreference.fromJson( json['externalMetricsPreference'] as Map) : null, + lookBackPeriod: + (json['lookBackPeriod'] as String?)?.toLookBackPeriodPreference(), + preferredResources: (json['preferredResources'] as List?) + ?.whereNotNull() + .map((e) => + EffectivePreferredResource.fromJson(e as Map)) + .toList(), + utilizationPreferences: (json['utilizationPreferences'] as List?) + ?.whereNotNull() + .map((e) => UtilizationPreference.fromJson(e as Map)) + .toList(), ); } Map toJson() { final enhancedInfrastructureMetrics = this.enhancedInfrastructureMetrics; final externalMetricsPreference = this.externalMetricsPreference; + final lookBackPeriod = this.lookBackPeriod; + final preferredResources = this.preferredResources; + final utilizationPreferences = this.utilizationPreferences; return { if (enhancedInfrastructureMetrics != null) 'enhancedInfrastructureMetrics': enhancedInfrastructureMetrics.toValue(), if (externalMetricsPreference != null) 'externalMetricsPreference': externalMetricsPreference, + if (lookBackPeriod != null) 'lookBackPeriod': lookBackPeriod.toValue(), + if (preferredResources != null) 'preferredResources': preferredResources, + if (utilizationPreferences != null) + 'utilizationPreferences': utilizationPreferences, }; } } @@ -6138,6 +7613,51 @@ class GetLambdaFunctionRecommendationsResponse { } } +class GetLicenseRecommendationsResponse { + /// An array of objects that describe errors of the request. + final List? errors; + + /// An array of objects that describe license recommendations. + final List? licenseRecommendations; + + /// The token to use to advance to the next page of license recommendations. + final String? nextToken; + + GetLicenseRecommendationsResponse({ + this.errors, + this.licenseRecommendations, + this.nextToken, + }); + + factory GetLicenseRecommendationsResponse.fromJson( + Map json) { + return GetLicenseRecommendationsResponse( + errors: (json['errors'] as List?) + ?.whereNotNull() + .map( + (e) => GetRecommendationError.fromJson(e as Map)) + .toList(), + licenseRecommendations: (json['licenseRecommendations'] as List?) + ?.whereNotNull() + .map((e) => LicenseRecommendation.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final errors = this.errors; + final licenseRecommendations = this.licenseRecommendations; + final nextToken = this.nextToken; + return { + if (errors != null) 'errors': errors, + if (licenseRecommendations != null) + 'licenseRecommendations': licenseRecommendations, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + /// Describes an error experienced when getting recommendations. /// /// For example, an error is returned if you request recommendations for an @@ -6256,19 +7776,76 @@ class GetRecommendationSummariesResponse { } } -/// The estimated monthly savings after you adjust the configurations of your -/// instances running on the inferred workload types to the recommended -/// configurations. If the inferredWorkloadTypes list contains -/// multiple entries, then the savings are the sum of the monthly savings from -/// instances that run the exact combination of the inferred workload types. -class InferredWorkloadSaving { - /// An object that describes the estimated monthly savings amount possible by - /// adopting Compute Optimizer recommendations for a given resource. This is - /// based on the On-Demand instance pricing. - final EstimatedMonthlySavings? estimatedMonthlySavings; +/// Describes the GPU accelerators for the instance type. +class Gpu { + /// The number of GPUs for the instance type. + final int? gpuCount; - /// The applications that might be running on the instance as inferred by - /// Compute Optimizer. + /// The total size of the memory for the GPU accelerators for the instance type, + /// in MiB. + final int? gpuMemorySizeInMiB; + + Gpu({ + this.gpuCount, + this.gpuMemorySizeInMiB, + }); + + factory Gpu.fromJson(Map json) { + return Gpu( + gpuCount: json['gpuCount'] as int?, + gpuMemorySizeInMiB: json['gpuMemorySizeInMiB'] as int?, + ); + } + + Map toJson() { + final gpuCount = this.gpuCount; + final gpuMemorySizeInMiB = this.gpuMemorySizeInMiB; + return { + if (gpuCount != null) 'gpuCount': gpuCount, + if (gpuMemorySizeInMiB != null) 'gpuMemorySizeInMiB': gpuMemorySizeInMiB, + }; + } +} + +/// Describes the GPU accelerator settings for the instance type. +class GpuInfo { + /// Describes the GPU accelerators for the instance type. + final List? gpus; + + GpuInfo({ + this.gpus, + }); + + factory GpuInfo.fromJson(Map json) { + return GpuInfo( + gpus: (json['gpus'] as List?) + ?.whereNotNull() + .map((e) => Gpu.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final gpus = this.gpus; + return { + if (gpus != null) 'gpus': gpus, + }; + } +} + +/// The estimated monthly savings after you adjust the configurations of your +/// instances running on the inferred workload types to the recommended +/// configurations. If the inferredWorkloadTypes list contains +/// multiple entries, then the savings are the sum of the monthly savings from +/// instances that run the exact combination of the inferred workload types. +class InferredWorkloadSaving { + /// An object that describes the estimated monthly savings amount possible by + /// adopting Compute Optimizer recommendations for a given resource. This is + /// based on the On-Demand instance pricing. + final EstimatedMonthlySavings? estimatedMonthlySavings; + + /// The applications that might be running on the instance as inferred by + /// Compute Optimizer. /// /// Compute Optimizer can infer if one of the following applications might be /// running on the instance: @@ -6434,11 +8011,74 @@ extension InferredWorkloadTypesPreferenceFromString on String { } } +/// An object that describes the estimated monthly savings possible by adopting +/// Compute Optimizer’s Amazon EC2 instance recommendations. This is based on +/// the Savings Plans and Reserved Instances pricing discounts. +class InstanceEstimatedMonthlySavings { + /// The currency of the estimated monthly savings. + final Currency? currency; + + /// The value of the estimated monthly savings. + final double? value; + + InstanceEstimatedMonthlySavings({ + this.currency, + this.value, + }); + + factory InstanceEstimatedMonthlySavings.fromJson(Map json) { + return InstanceEstimatedMonthlySavings( + currency: (json['currency'] as String?)?.toCurrency(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final currency = this.currency; + final value = this.value; + return { + if (currency != null) 'currency': currency.toValue(), + if (value != null) 'value': value, + }; + } +} + +enum InstanceIdle { + $true, + $false, +} + +extension InstanceIdleValueExtension on InstanceIdle { + String toValue() { + switch (this) { + case InstanceIdle.$true: + return 'True'; + case InstanceIdle.$false: + return 'False'; + } + } +} + +extension InstanceIdleFromString on String { + InstanceIdle toInstanceIdle() { + switch (this) { + case 'True': + return InstanceIdle.$true; + case 'False': + return InstanceIdle.$false; + } + throw Exception('$this is not known in enum InstanceIdle'); + } +} + /// Describes an Amazon EC2 instance recommendation. class InstanceRecommendation { /// The Amazon Web Services account ID of the instance. final String? accountId; + /// Describes the GPU accelerator settings for the current instance type. + final GpuInfo? currentInstanceGpuInfo; + /// The instance type of the current instance. final String? currentInstanceType; @@ -6631,6 +8271,9 @@ class InstanceRecommendation { /// final List? findingReasonCodes; + /// Describes if an Amazon EC2 instance is idle. + final InstanceIdle? idle; + /// The applications that might be running on the instance as inferred by /// Compute Optimizer. /// @@ -6705,12 +8348,14 @@ class InstanceRecommendation { InstanceRecommendation({ this.accountId, + this.currentInstanceGpuInfo, this.currentInstanceType, this.currentPerformanceRisk, this.effectiveRecommendationPreferences, this.externalMetricStatus, this.finding, this.findingReasonCodes, + this.idle, this.inferredWorkloadTypes, this.instanceArn, this.instanceName, @@ -6726,6 +8371,10 @@ class InstanceRecommendation { factory InstanceRecommendation.fromJson(Map json) { return InstanceRecommendation( accountId: json['accountId'] as String?, + currentInstanceGpuInfo: json['currentInstanceGpuInfo'] != null + ? GpuInfo.fromJson( + json['currentInstanceGpuInfo'] as Map) + : null, currentInstanceType: json['currentInstanceType'] as String?, currentPerformanceRisk: (json['currentPerformanceRisk'] as String?) ?.toCurrentPerformanceRisk(), @@ -6744,6 +8393,7 @@ class InstanceRecommendation { ?.whereNotNull() .map((e) => (e as String).toInstanceRecommendationFindingReasonCode()) .toList(), + idle: (json['idle'] as String?)?.toInstanceIdle(), inferredWorkloadTypes: (json['inferredWorkloadTypes'] as List?) ?.whereNotNull() .map((e) => (e as String).toInferredWorkloadType()) @@ -6775,6 +8425,7 @@ class InstanceRecommendation { Map toJson() { final accountId = this.accountId; + final currentInstanceGpuInfo = this.currentInstanceGpuInfo; final currentInstanceType = this.currentInstanceType; final currentPerformanceRisk = this.currentPerformanceRisk; final effectiveRecommendationPreferences = @@ -6782,6 +8433,7 @@ class InstanceRecommendation { final externalMetricStatus = this.externalMetricStatus; final finding = this.finding; final findingReasonCodes = this.findingReasonCodes; + final idle = this.idle; final inferredWorkloadTypes = this.inferredWorkloadTypes; final instanceArn = this.instanceArn; final instanceName = this.instanceName; @@ -6794,6 +8446,8 @@ class InstanceRecommendation { final utilizationMetrics = this.utilizationMetrics; return { if (accountId != null) 'accountId': accountId, + if (currentInstanceGpuInfo != null) + 'currentInstanceGpuInfo': currentInstanceGpuInfo, if (currentInstanceType != null) 'currentInstanceType': currentInstanceType, if (currentPerformanceRisk != null) @@ -6807,6 +8461,7 @@ class InstanceRecommendation { if (findingReasonCodes != null) 'findingReasonCodes': findingReasonCodes.map((e) => e.toValue()).toList(), + if (idle != null) 'idle': idle.toValue(), if (inferredWorkloadTypes != null) 'inferredWorkloadTypes': inferredWorkloadTypes.map((e) => e.toValue()).toList(), @@ -6844,6 +8499,10 @@ enum InstanceRecommendationFindingReasonCode { diskIOPSUnderprovisioned, diskThroughputOverprovisioned, diskThroughputUnderprovisioned, + gPUUnderprovisioned, + gPUOverprovisioned, + gPUMemoryUnderprovisioned, + gPUMemoryOverprovisioned, } extension InstanceRecommendationFindingReasonCodeValueExtension @@ -6887,6 +8546,14 @@ extension InstanceRecommendationFindingReasonCodeValueExtension case InstanceRecommendationFindingReasonCode .diskThroughputUnderprovisioned: return 'DiskThroughputUnderprovisioned'; + case InstanceRecommendationFindingReasonCode.gPUUnderprovisioned: + return 'GPUUnderprovisioned'; + case InstanceRecommendationFindingReasonCode.gPUOverprovisioned: + return 'GPUOverprovisioned'; + case InstanceRecommendationFindingReasonCode.gPUMemoryUnderprovisioned: + return 'GPUMemoryUnderprovisioned'; + case InstanceRecommendationFindingReasonCode.gPUMemoryOverprovisioned: + return 'GPUMemoryOverprovisioned'; } } } @@ -6935,6 +8602,15 @@ extension InstanceRecommendationFindingReasonCodeFromString on String { case 'DiskThroughputUnderprovisioned': return InstanceRecommendationFindingReasonCode .diskThroughputUnderprovisioned; + case 'GPUUnderprovisioned': + return InstanceRecommendationFindingReasonCode.gPUUnderprovisioned; + case 'GPUOverprovisioned': + return InstanceRecommendationFindingReasonCode.gPUOverprovisioned; + case 'GPUMemoryUnderprovisioned': + return InstanceRecommendationFindingReasonCode + .gPUMemoryUnderprovisioned; + case 'GPUMemoryOverprovisioned': + return InstanceRecommendationFindingReasonCode.gPUMemoryOverprovisioned; } throw Exception( '$this is not known in enum InstanceRecommendationFindingReasonCode'); @@ -6943,6 +8619,9 @@ extension InstanceRecommendationFindingReasonCodeFromString on String { /// Describes a recommendation option for an Amazon EC2 instance. class InstanceRecommendationOption { + /// Describes the GPU accelerator settings for the recommended instance type. + final GpuInfo? instanceGpuInfo; + /// The instance type of the instance recommendation. final String? instanceType; @@ -7106,7 +8785,15 @@ class InstanceRecommendationOption { /// savings amount and percentage. final SavingsOpportunity? savingsOpportunity; + /// An object that describes the savings opportunity for the instance + /// recommendation option that includes Savings Plans and Reserved Instances + /// discounts. Savings opportunity includes the estimated monthly savings and + /// percentage. + final InstanceSavingsOpportunityAfterDiscounts? + savingsOpportunityAfterDiscounts; + InstanceRecommendationOption({ + this.instanceGpuInfo, this.instanceType, this.migrationEffort, this.performanceRisk, @@ -7114,10 +8801,14 @@ class InstanceRecommendationOption { this.projectedUtilizationMetrics, this.rank, this.savingsOpportunity, + this.savingsOpportunityAfterDiscounts, }); factory InstanceRecommendationOption.fromJson(Map json) { return InstanceRecommendationOption( + instanceGpuInfo: json['instanceGpuInfo'] != null + ? GpuInfo.fromJson(json['instanceGpuInfo'] as Map) + : null, instanceType: json['instanceType'] as String?, migrationEffort: (json['migrationEffort'] as String?)?.toMigrationEffort(), @@ -7136,10 +8827,17 @@ class InstanceRecommendationOption { ? SavingsOpportunity.fromJson( json['savingsOpportunity'] as Map) : null, + savingsOpportunityAfterDiscounts: + json['savingsOpportunityAfterDiscounts'] != null + ? InstanceSavingsOpportunityAfterDiscounts.fromJson( + json['savingsOpportunityAfterDiscounts'] + as Map) + : null, ); } Map toJson() { + final instanceGpuInfo = this.instanceGpuInfo; final instanceType = this.instanceType; final migrationEffort = this.migrationEffort; final performanceRisk = this.performanceRisk; @@ -7147,7 +8845,10 @@ class InstanceRecommendationOption { final projectedUtilizationMetrics = this.projectedUtilizationMetrics; final rank = this.rank; final savingsOpportunity = this.savingsOpportunity; + final savingsOpportunityAfterDiscounts = + this.savingsOpportunityAfterDiscounts; return { + if (instanceGpuInfo != null) 'instanceGpuInfo': instanceGpuInfo, if (instanceType != null) 'instanceType': instanceType, if (migrationEffort != null) 'migrationEffort': migrationEffort.toValue(), if (performanceRisk != null) 'performanceRisk': performanceRisk, @@ -7158,6 +8859,114 @@ class InstanceRecommendationOption { 'projectedUtilizationMetrics': projectedUtilizationMetrics, if (rank != null) 'rank': rank, if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, + if (savingsOpportunityAfterDiscounts != null) + 'savingsOpportunityAfterDiscounts': savingsOpportunityAfterDiscounts, + }; + } +} + +/// Describes the savings estimation mode used for calculating savings +/// opportunity for Amazon EC2 instances. +class InstanceSavingsEstimationMode { + /// Describes the source for calculating the savings opportunity for Amazon EC2 + /// instances. + final InstanceSavingsEstimationModeSource? source; + + InstanceSavingsEstimationMode({ + this.source, + }); + + factory InstanceSavingsEstimationMode.fromJson(Map json) { + return InstanceSavingsEstimationMode( + source: + (json['source'] as String?)?.toInstanceSavingsEstimationModeSource(), + ); + } + + Map toJson() { + final source = this.source; + return { + if (source != null) 'source': source.toValue(), + }; + } +} + +enum InstanceSavingsEstimationModeSource { + publicPricing, + costExplorerRightsizing, + costOptimizationHub, +} + +extension InstanceSavingsEstimationModeSourceValueExtension + on InstanceSavingsEstimationModeSource { + String toValue() { + switch (this) { + case InstanceSavingsEstimationModeSource.publicPricing: + return 'PublicPricing'; + case InstanceSavingsEstimationModeSource.costExplorerRightsizing: + return 'CostExplorerRightsizing'; + case InstanceSavingsEstimationModeSource.costOptimizationHub: + return 'CostOptimizationHub'; + } + } +} + +extension InstanceSavingsEstimationModeSourceFromString on String { + InstanceSavingsEstimationModeSource toInstanceSavingsEstimationModeSource() { + switch (this) { + case 'PublicPricing': + return InstanceSavingsEstimationModeSource.publicPricing; + case 'CostExplorerRightsizing': + return InstanceSavingsEstimationModeSource.costExplorerRightsizing; + case 'CostOptimizationHub': + return InstanceSavingsEstimationModeSource.costOptimizationHub; + } + throw Exception( + '$this is not known in enum InstanceSavingsEstimationModeSource'); + } +} + +/// Describes the savings opportunity for instance recommendations after +/// applying the Savings Plans and Reserved Instances discounts. +/// +/// Savings opportunity after discounts represents the estimated monthly savings +/// you can achieve by implementing Compute Optimizer recommendations. +class InstanceSavingsOpportunityAfterDiscounts { + /// An object that describes the estimated monthly savings possible by adopting + /// Compute Optimizer’s Amazon EC2 instance recommendations. This is based on + /// pricing after applying the Savings Plans and Reserved Instances discounts. + final InstanceEstimatedMonthlySavings? estimatedMonthlySavings; + + /// The estimated monthly savings possible as a percentage of monthly cost after + /// applying the Savings Plans and Reserved Instances discounts. This saving can + /// be achieved by adopting Compute Optimizer’s EC2 instance recommendations. + final double? savingsOpportunityPercentage; + + InstanceSavingsOpportunityAfterDiscounts({ + this.estimatedMonthlySavings, + this.savingsOpportunityPercentage, + }); + + factory InstanceSavingsOpportunityAfterDiscounts.fromJson( + Map json) { + return InstanceSavingsOpportunityAfterDiscounts( + estimatedMonthlySavings: json['estimatedMonthlySavings'] != null + ? InstanceEstimatedMonthlySavings.fromJson( + json['estimatedMonthlySavings'] as Map) + : null, + savingsOpportunityPercentage: + json['savingsOpportunityPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final savingsOpportunityPercentage = this.savingsOpportunityPercentage; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (savingsOpportunityPercentage != null) + 'savingsOpportunityPercentage': savingsOpportunityPercentage, }; } } @@ -7331,6 +9140,67 @@ extension JobStatusFromString on String { } } +/// Describes the effective recommendation preferences for Lambda functions. +class LambdaEffectiveRecommendationPreferences { + /// Describes the savings estimation mode applied for calculating savings + /// opportunity for Lambda functions. + final LambdaSavingsEstimationMode? savingsEstimationMode; + + LambdaEffectiveRecommendationPreferences({ + this.savingsEstimationMode, + }); + + factory LambdaEffectiveRecommendationPreferences.fromJson( + Map json) { + return LambdaEffectiveRecommendationPreferences( + savingsEstimationMode: json['savingsEstimationMode'] != null + ? LambdaSavingsEstimationMode.fromJson( + json['savingsEstimationMode'] as Map) + : null, + ); + } + + Map toJson() { + final savingsEstimationMode = this.savingsEstimationMode; + return { + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode, + }; + } +} + +/// Describes the estimated monthly savings possible for Lambda functions by +/// adopting Compute Optimizer recommendations. This is based on Lambda +/// functions pricing after applying Savings Plans discounts. +class LambdaEstimatedMonthlySavings { + /// The currency of the estimated monthly savings. + final Currency? currency; + + /// The value of the estimated monthly savings. + final double? value; + + LambdaEstimatedMonthlySavings({ + this.currency, + this.value, + }); + + factory LambdaEstimatedMonthlySavings.fromJson(Map json) { + return LambdaEstimatedMonthlySavings( + currency: (json['currency'] as String?)?.toCurrency(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final currency = this.currency; + final value = this.value; + return { + if (currency != null) 'currency': currency.toValue(), + if (value != null) 'value': value, + }; + } +} + enum LambdaFunctionMemoryMetricName { duration, } @@ -7450,11 +9320,18 @@ class LambdaFunctionMemoryRecommendationOption { /// savings amount and percentage. final SavingsOpportunity? savingsOpportunity; + /// An object that describes the savings opportunity for the Lambda + /// recommendation option which includes Saving Plans discounts. Savings + /// opportunity includes the estimated monthly savings and percentage. + final LambdaSavingsOpportunityAfterDiscounts? + savingsOpportunityAfterDiscounts; + LambdaFunctionMemoryRecommendationOption({ this.memorySize, this.projectedUtilizationMetrics, this.rank, this.savingsOpportunity, + this.savingsOpportunityAfterDiscounts, }); factory LambdaFunctionMemoryRecommendationOption.fromJson( @@ -7472,6 +9349,12 @@ class LambdaFunctionMemoryRecommendationOption { ? SavingsOpportunity.fromJson( json['savingsOpportunity'] as Map) : null, + savingsOpportunityAfterDiscounts: + json['savingsOpportunityAfterDiscounts'] != null + ? LambdaSavingsOpportunityAfterDiscounts.fromJson( + json['savingsOpportunityAfterDiscounts'] + as Map) + : null, ); } @@ -7480,12 +9363,16 @@ class LambdaFunctionMemoryRecommendationOption { final projectedUtilizationMetrics = this.projectedUtilizationMetrics; final rank = this.rank; final savingsOpportunity = this.savingsOpportunity; + final savingsOpportunityAfterDiscounts = + this.savingsOpportunityAfterDiscounts; return { if (memorySize != null) 'memorySize': memorySize, if (projectedUtilizationMetrics != null) 'projectedUtilizationMetrics': projectedUtilizationMetrics, if (rank != null) 'rank': rank, if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, + if (savingsOpportunityAfterDiscounts != null) + 'savingsOpportunityAfterDiscounts': savingsOpportunityAfterDiscounts, }; } } @@ -7560,6 +9447,10 @@ class LambdaFunctionRecommendation { /// function requires more memory. final CurrentPerformanceRisk? currentPerformanceRisk; + /// Describes the effective recommendation preferences for Lambda functions. + final LambdaEffectiveRecommendationPreferences? + effectiveRecommendationPreferences; + /// The finding classification of the function. /// /// Findings for functions include: @@ -7667,6 +9558,7 @@ class LambdaFunctionRecommendation { this.accountId, this.currentMemorySize, this.currentPerformanceRisk, + this.effectiveRecommendationPreferences, this.finding, this.findingReasonCodes, this.functionArn, @@ -7685,6 +9577,12 @@ class LambdaFunctionRecommendation { currentMemorySize: json['currentMemorySize'] as int?, currentPerformanceRisk: (json['currentPerformanceRisk'] as String?) ?.toCurrentPerformanceRisk(), + effectiveRecommendationPreferences: + json['effectiveRecommendationPreferences'] != null + ? LambdaEffectiveRecommendationPreferences.fromJson( + json['effectiveRecommendationPreferences'] + as Map) + : null, finding: (json['finding'] as String?)?.toLambdaFunctionRecommendationFinding(), findingReasonCodes: (json['findingReasonCodes'] as List?) @@ -7719,6 +9617,8 @@ class LambdaFunctionRecommendation { final accountId = this.accountId; final currentMemorySize = this.currentMemorySize; final currentPerformanceRisk = this.currentPerformanceRisk; + final effectiveRecommendationPreferences = + this.effectiveRecommendationPreferences; final finding = this.finding; final findingReasonCodes = this.findingReasonCodes; final functionArn = this.functionArn; @@ -7735,6 +9635,9 @@ class LambdaFunctionRecommendation { if (currentMemorySize != null) 'currentMemorySize': currentMemorySize, if (currentPerformanceRisk != null) 'currentPerformanceRisk': currentPerformanceRisk.toValue(), + if (effectiveRecommendationPreferences != null) + 'effectiveRecommendationPreferences': + effectiveRecommendationPreferences, if (finding != null) 'finding': finding.toValue(), if (findingReasonCodes != null) 'findingReasonCodes': @@ -7893,114 +9796,790 @@ extension LambdaFunctionRecommendationFindingFromString on String { } } -enum LambdaFunctionRecommendationFindingReasonCode { - memoryOverprovisioned, - memoryUnderprovisioned, - insufficientData, - inconclusive, +enum LambdaFunctionRecommendationFindingReasonCode { + memoryOverprovisioned, + memoryUnderprovisioned, + insufficientData, + inconclusive, +} + +extension LambdaFunctionRecommendationFindingReasonCodeValueExtension + on LambdaFunctionRecommendationFindingReasonCode { + String toValue() { + switch (this) { + case LambdaFunctionRecommendationFindingReasonCode.memoryOverprovisioned: + return 'MemoryOverprovisioned'; + case LambdaFunctionRecommendationFindingReasonCode.memoryUnderprovisioned: + return 'MemoryUnderprovisioned'; + case LambdaFunctionRecommendationFindingReasonCode.insufficientData: + return 'InsufficientData'; + case LambdaFunctionRecommendationFindingReasonCode.inconclusive: + return 'Inconclusive'; + } + } +} + +extension LambdaFunctionRecommendationFindingReasonCodeFromString on String { + LambdaFunctionRecommendationFindingReasonCode + toLambdaFunctionRecommendationFindingReasonCode() { + switch (this) { + case 'MemoryOverprovisioned': + return LambdaFunctionRecommendationFindingReasonCode + .memoryOverprovisioned; + case 'MemoryUnderprovisioned': + return LambdaFunctionRecommendationFindingReasonCode + .memoryUnderprovisioned; + case 'InsufficientData': + return LambdaFunctionRecommendationFindingReasonCode.insufficientData; + case 'Inconclusive': + return LambdaFunctionRecommendationFindingReasonCode.inconclusive; + } + throw Exception( + '$this is not known in enum LambdaFunctionRecommendationFindingReasonCode'); + } +} + +/// Describes a utilization metric of an Lambda function. +class LambdaFunctionUtilizationMetric { + /// The name of the utilization metric. + /// + /// The following utilization metrics are available: + /// + ///
          + ///
        • + /// Duration - The amount of time that your function code spends + /// processing an event. + ///
        • + ///
        • + /// Memory - The amount of memory used per invocation. + ///
        • + ///
        + final LambdaFunctionMetricName? name; + + /// The statistic of the utilization metric. + /// + /// The Compute Optimizer API, Command Line Interface (CLI), and SDKs return + /// utilization metrics using only the Maximum statistic, which is + /// the highest value observed during the specified period. + /// + /// The Compute Optimizer console displays graphs for some utilization metrics + /// using the Average statistic, which is the value of + /// Sum / SampleCount during the specified period. For + /// more information, see Viewing + /// resource recommendations in the Compute Optimizer User Guide. You + /// can also get averaged utilization metric data for your resources using + /// Amazon CloudWatch. For more information, see the Amazon + /// CloudWatch User Guide. + final LambdaFunctionMetricStatistic? statistic; + + /// The value of the utilization metric. + final double? value; + + LambdaFunctionUtilizationMetric({ + this.name, + this.statistic, + this.value, + }); + + factory LambdaFunctionUtilizationMetric.fromJson(Map json) { + return LambdaFunctionUtilizationMetric( + name: (json['name'] as String?)?.toLambdaFunctionMetricName(), + statistic: + (json['statistic'] as String?)?.toLambdaFunctionMetricStatistic(), + value: json['value'] as double?, + ); + } + + Map toJson() { + final name = this.name; + final statistic = this.statistic; + final value = this.value; + return { + if (name != null) 'name': name.toValue(), + if (statistic != null) 'statistic': statistic.toValue(), + if (value != null) 'value': value, + }; + } +} + +/// Describes the savings estimation used for calculating savings opportunity +/// for Lambda functions. +class LambdaSavingsEstimationMode { + /// Describes the source for calculation of savings opportunity for Lambda + /// functions. + final LambdaSavingsEstimationModeSource? source; + + LambdaSavingsEstimationMode({ + this.source, + }); + + factory LambdaSavingsEstimationMode.fromJson(Map json) { + return LambdaSavingsEstimationMode( + source: + (json['source'] as String?)?.toLambdaSavingsEstimationModeSource(), + ); + } + + Map toJson() { + final source = this.source; + return { + if (source != null) 'source': source.toValue(), + }; + } +} + +enum LambdaSavingsEstimationModeSource { + publicPricing, + costExplorerRightsizing, + costOptimizationHub, +} + +extension LambdaSavingsEstimationModeSourceValueExtension + on LambdaSavingsEstimationModeSource { + String toValue() { + switch (this) { + case LambdaSavingsEstimationModeSource.publicPricing: + return 'PublicPricing'; + case LambdaSavingsEstimationModeSource.costExplorerRightsizing: + return 'CostExplorerRightsizing'; + case LambdaSavingsEstimationModeSource.costOptimizationHub: + return 'CostOptimizationHub'; + } + } +} + +extension LambdaSavingsEstimationModeSourceFromString on String { + LambdaSavingsEstimationModeSource toLambdaSavingsEstimationModeSource() { + switch (this) { + case 'PublicPricing': + return LambdaSavingsEstimationModeSource.publicPricing; + case 'CostExplorerRightsizing': + return LambdaSavingsEstimationModeSource.costExplorerRightsizing; + case 'CostOptimizationHub': + return LambdaSavingsEstimationModeSource.costOptimizationHub; + } + throw Exception( + '$this is not known in enum LambdaSavingsEstimationModeSource'); + } +} + +/// Describes the savings opportunity for Lambda functions recommendations after +/// applying Savings Plans discounts. +/// +/// Savings opportunity represents the estimated monthly savings after applying +/// Savings Plans discounts. You can achieve this by implementing a given +/// Compute Optimizer recommendation. +class LambdaSavingsOpportunityAfterDiscounts { + /// The estimated monthly savings possible by adopting Compute Optimizer’s + /// Lambda function recommendations. This includes any applicable Savings Plans + /// discounts. + final LambdaEstimatedMonthlySavings? estimatedMonthlySavings; + + /// The estimated monthly savings possible as a percentage of monthly cost by + /// adopting Compute Optimizer’s Lambda function recommendations. This includes + /// any applicable Savings Plans discounts. + final double? savingsOpportunityPercentage; + + LambdaSavingsOpportunityAfterDiscounts({ + this.estimatedMonthlySavings, + this.savingsOpportunityPercentage, + }); + + factory LambdaSavingsOpportunityAfterDiscounts.fromJson( + Map json) { + return LambdaSavingsOpportunityAfterDiscounts( + estimatedMonthlySavings: json['estimatedMonthlySavings'] != null + ? LambdaEstimatedMonthlySavings.fromJson( + json['estimatedMonthlySavings'] as Map) + : null, + savingsOpportunityPercentage: + json['savingsOpportunityPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final savingsOpportunityPercentage = this.savingsOpportunityPercentage; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (savingsOpportunityPercentage != null) + 'savingsOpportunityPercentage': savingsOpportunityPercentage, + }; + } +} + +/// Describes the configuration of a license for an Amazon EC2 instance. +class LicenseConfiguration { + /// The instance type used in the license. + final String? instanceType; + + /// The edition of the license for the application that runs on the instance. + final LicenseEdition? licenseEdition; + + /// The license type associated with the instance. + final LicenseModel? licenseModel; + + /// The name of the license for the application that runs on the instance. + final LicenseName? licenseName; + + /// The version of the license for the application that runs on the instance. + final String? licenseVersion; + + /// The list of metric sources required to generate recommendations for + /// commercial software licenses. + final List? metricsSource; + + /// The current number of cores associated with the instance. + final int? numberOfCores; + + /// The operating system of the instance. + final String? operatingSystem; + + LicenseConfiguration({ + this.instanceType, + this.licenseEdition, + this.licenseModel, + this.licenseName, + this.licenseVersion, + this.metricsSource, + this.numberOfCores, + this.operatingSystem, + }); + + factory LicenseConfiguration.fromJson(Map json) { + return LicenseConfiguration( + instanceType: json['instanceType'] as String?, + licenseEdition: (json['licenseEdition'] as String?)?.toLicenseEdition(), + licenseModel: (json['licenseModel'] as String?)?.toLicenseModel(), + licenseName: (json['licenseName'] as String?)?.toLicenseName(), + licenseVersion: json['licenseVersion'] as String?, + metricsSource: (json['metricsSource'] as List?) + ?.whereNotNull() + .map((e) => MetricSource.fromJson(e as Map)) + .toList(), + numberOfCores: json['numberOfCores'] as int?, + operatingSystem: json['operatingSystem'] as String?, + ); + } + + Map toJson() { + final instanceType = this.instanceType; + final licenseEdition = this.licenseEdition; + final licenseModel = this.licenseModel; + final licenseName = this.licenseName; + final licenseVersion = this.licenseVersion; + final metricsSource = this.metricsSource; + final numberOfCores = this.numberOfCores; + final operatingSystem = this.operatingSystem; + return { + if (instanceType != null) 'instanceType': instanceType, + if (licenseEdition != null) 'licenseEdition': licenseEdition.toValue(), + if (licenseModel != null) 'licenseModel': licenseModel.toValue(), + if (licenseName != null) 'licenseName': licenseName.toValue(), + if (licenseVersion != null) 'licenseVersion': licenseVersion, + if (metricsSource != null) 'metricsSource': metricsSource, + if (numberOfCores != null) 'numberOfCores': numberOfCores, + if (operatingSystem != null) 'operatingSystem': operatingSystem, + }; + } +} + +enum LicenseEdition { + enterprise, + standard, + free, + noLicenseEditionFound, +} + +extension LicenseEditionValueExtension on LicenseEdition { + String toValue() { + switch (this) { + case LicenseEdition.enterprise: + return 'Enterprise'; + case LicenseEdition.standard: + return 'Standard'; + case LicenseEdition.free: + return 'Free'; + case LicenseEdition.noLicenseEditionFound: + return 'NoLicenseEditionFound'; + } + } +} + +extension LicenseEditionFromString on String { + LicenseEdition toLicenseEdition() { + switch (this) { + case 'Enterprise': + return LicenseEdition.enterprise; + case 'Standard': + return LicenseEdition.standard; + case 'Free': + return LicenseEdition.free; + case 'NoLicenseEditionFound': + return LicenseEdition.noLicenseEditionFound; + } + throw Exception('$this is not known in enum LicenseEdition'); + } +} + +enum LicenseFinding { + insufficientMetrics, + optimized, + notOptimized, +} + +extension LicenseFindingValueExtension on LicenseFinding { + String toValue() { + switch (this) { + case LicenseFinding.insufficientMetrics: + return 'InsufficientMetrics'; + case LicenseFinding.optimized: + return 'Optimized'; + case LicenseFinding.notOptimized: + return 'NotOptimized'; + } + } +} + +extension LicenseFindingFromString on String { + LicenseFinding toLicenseFinding() { + switch (this) { + case 'InsufficientMetrics': + return LicenseFinding.insufficientMetrics; + case 'Optimized': + return LicenseFinding.optimized; + case 'NotOptimized': + return LicenseFinding.notOptimized; + } + throw Exception('$this is not known in enum LicenseFinding'); + } +} + +enum LicenseFindingReasonCode { + invalidCloudWatchApplicationInsightsSetup, + cloudWatchApplicationInsightsError, + licenseOverprovisioned, + optimized, +} + +extension LicenseFindingReasonCodeValueExtension on LicenseFindingReasonCode { + String toValue() { + switch (this) { + case LicenseFindingReasonCode.invalidCloudWatchApplicationInsightsSetup: + return 'InvalidCloudWatchApplicationInsightsSetup'; + case LicenseFindingReasonCode.cloudWatchApplicationInsightsError: + return 'CloudWatchApplicationInsightsError'; + case LicenseFindingReasonCode.licenseOverprovisioned: + return 'LicenseOverprovisioned'; + case LicenseFindingReasonCode.optimized: + return 'Optimized'; + } + } +} + +extension LicenseFindingReasonCodeFromString on String { + LicenseFindingReasonCode toLicenseFindingReasonCode() { + switch (this) { + case 'InvalidCloudWatchApplicationInsightsSetup': + return LicenseFindingReasonCode + .invalidCloudWatchApplicationInsightsSetup; + case 'CloudWatchApplicationInsightsError': + return LicenseFindingReasonCode.cloudWatchApplicationInsightsError; + case 'LicenseOverprovisioned': + return LicenseFindingReasonCode.licenseOverprovisioned; + case 'Optimized': + return LicenseFindingReasonCode.optimized; + } + throw Exception('$this is not known in enum LicenseFindingReasonCode'); + } +} + +enum LicenseModel { + licenseIncluded, + bringYourOwnLicense, +} + +extension LicenseModelValueExtension on LicenseModel { + String toValue() { + switch (this) { + case LicenseModel.licenseIncluded: + return 'LicenseIncluded'; + case LicenseModel.bringYourOwnLicense: + return 'BringYourOwnLicense'; + } + } +} + +extension LicenseModelFromString on String { + LicenseModel toLicenseModel() { + switch (this) { + case 'LicenseIncluded': + return LicenseModel.licenseIncluded; + case 'BringYourOwnLicense': + return LicenseModel.bringYourOwnLicense; + } + throw Exception('$this is not known in enum LicenseModel'); + } +} + +enum LicenseName { + sQLServer, +} + +extension LicenseNameValueExtension on LicenseName { + String toValue() { + switch (this) { + case LicenseName.sQLServer: + return 'SQLServer'; + } + } +} + +extension LicenseNameFromString on String { + LicenseName toLicenseName() { + switch (this) { + case 'SQLServer': + return LicenseName.sQLServer; + } + throw Exception('$this is not known in enum LicenseName'); + } +} + +/// Describes a license recommendation for an EC2 instance. +class LicenseRecommendation { + /// The Amazon Web Services account ID of the license. + final String? accountId; + + /// An object that describes the current configuration of an instance that runs + /// on a license. + final LicenseConfiguration? currentLicenseConfiguration; + + /// The finding classification for an instance that runs on a license. + /// + /// Findings include: + /// + ///
          + ///
        • + /// InsufficentMetrics — When Compute Optimizer detects that your + /// CloudWatch Application Insights isn't enabled or is enabled with + /// insufficient permissions. + ///
        • + ///
        • + /// NotOptimized — When Compute Optimizer detects that your EC2 + /// infrastructure isn't using any of the SQL server license features you're + /// paying for, a license is considered not optimized. + ///
        • + ///
        • + /// Optimized — When Compute Optimizer detects that all + /// specifications of your license meet the performance requirements of your + /// workload. + ///
        • + ///
        + final LicenseFinding? finding; + + /// The reason for the finding classification for an instance that runs on a + /// license. + /// + /// Finding reason codes include: + /// + ///
          + ///
        • + /// Optimized — All specifications of your license meet the + /// performance requirements of your workload. + ///
        • + ///
        • + /// LicenseOverprovisioned — A license is considered + /// over-provisioned when your license can be downgraded while still meeting the + /// performance requirements of your workload. + ///
        • + ///
        • + /// InvalidCloudwatchApplicationInsights — CloudWatch Application + /// Insights isn't configured properly. + ///
        • + ///
        • + /// CloudwatchApplicationInsightsError — There is a CloudWatch + /// Application Insights error. + ///
        • + ///
        + final List? findingReasonCodes; + + /// The timestamp of when the license recommendation was last generated. + final DateTime? lastRefreshTimestamp; + + /// An array of objects that describe the license recommendation options. + final List? licenseRecommendationOptions; + + /// The number of days for which utilization metrics were analyzed for an + /// instance that runs on a license. + final double? lookbackPeriodInDays; + + /// The ARN that identifies the Amazon EC2 instance. + final String? resourceArn; + + /// A list of tags assigned to an EC2 instance. + final List? tags; + + LicenseRecommendation({ + this.accountId, + this.currentLicenseConfiguration, + this.finding, + this.findingReasonCodes, + this.lastRefreshTimestamp, + this.licenseRecommendationOptions, + this.lookbackPeriodInDays, + this.resourceArn, + this.tags, + }); + + factory LicenseRecommendation.fromJson(Map json) { + return LicenseRecommendation( + accountId: json['accountId'] as String?, + currentLicenseConfiguration: json['currentLicenseConfiguration'] != null + ? LicenseConfiguration.fromJson( + json['currentLicenseConfiguration'] as Map) + : null, + finding: (json['finding'] as String?)?.toLicenseFinding(), + findingReasonCodes: (json['findingReasonCodes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toLicenseFindingReasonCode()) + .toList(), + lastRefreshTimestamp: timeStampFromJson(json['lastRefreshTimestamp']), + licenseRecommendationOptions: (json['licenseRecommendationOptions'] + as List?) + ?.whereNotNull() + .map((e) => + LicenseRecommendationOption.fromJson(e as Map)) + .toList(), + lookbackPeriodInDays: json['lookbackPeriodInDays'] as double?, + resourceArn: json['resourceArn'] as String?, + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final currentLicenseConfiguration = this.currentLicenseConfiguration; + final finding = this.finding; + final findingReasonCodes = this.findingReasonCodes; + final lastRefreshTimestamp = this.lastRefreshTimestamp; + final licenseRecommendationOptions = this.licenseRecommendationOptions; + final lookbackPeriodInDays = this.lookbackPeriodInDays; + final resourceArn = this.resourceArn; + final tags = this.tags; + return { + if (accountId != null) 'accountId': accountId, + if (currentLicenseConfiguration != null) + 'currentLicenseConfiguration': currentLicenseConfiguration, + if (finding != null) 'finding': finding.toValue(), + if (findingReasonCodes != null) + 'findingReasonCodes': + findingReasonCodes.map((e) => e.toValue()).toList(), + if (lastRefreshTimestamp != null) + 'lastRefreshTimestamp': unixTimestampToJson(lastRefreshTimestamp), + if (licenseRecommendationOptions != null) + 'licenseRecommendationOptions': licenseRecommendationOptions, + if (lookbackPeriodInDays != null) + 'lookbackPeriodInDays': lookbackPeriodInDays, + if (resourceArn != null) 'resourceArn': resourceArn, + if (tags != null) 'tags': tags, + }; + } +} + +/// Describes a filter that returns a more specific list of license +/// recommendations. Use this filter with the +/// GetLicenseRecommendation action. +class LicenseRecommendationFilter { + /// The name of the filter. + /// + /// Specify Finding to return recommendations with a specific + /// finding classification. + /// + /// Specify FindingReasonCode to return recommendations with a + /// specific finding reason code. + /// + /// You can filter your license recommendations by tag:key and + /// tag-key tags. + /// + /// A tag:key is a key and value combination of a tag assigned to + /// your license recommendations. Use the tag key in the filter name and the tag + /// value as the filter value. For example, to find all license recommendations + /// that have a tag with the key of Owner and the value of + /// TeamA, specify tag:Owner for the filter name and + /// TeamA for the filter value. + /// + /// A tag-key is the key of a tag assigned to your license + /// recommendations. Use this filter to find all of your license recommendations + /// that have a tag with a specific key. This doesn’t consider the tag value. + /// For example, you can find your license recommendations with a tag key value + /// of Owner or without any tag keys assigned. + final LicenseRecommendationFilterName? name; + + /// The value of the filter. + /// + /// The valid values for this parameter are as follows, depending on what you + /// specify for the name parameter: + /// + ///
          + ///
        • + /// If you specify the name parameter as Finding, then + /// specify Optimized, NotOptimized, or + /// InsufficentMetrics. + ///
        • + ///
        • + /// If you specify the name parameter as + /// FindingReasonCode, then specify Optimized, + /// LicenseOverprovisioned, + /// InvalidCloudwatchApplicationInsights, or + /// CloudwatchApplicationInsightsError. + ///
        • + ///
        + final List? values; + + LicenseRecommendationFilter({ + this.name, + this.values, + }); + + Map toJson() { + final name = this.name; + final values = this.values; + return { + if (name != null) 'name': name.toValue(), + if (values != null) 'values': values, + }; + } +} + +enum LicenseRecommendationFilterName { + finding, + findingReasonCode, + licenseName, } -extension LambdaFunctionRecommendationFindingReasonCodeValueExtension - on LambdaFunctionRecommendationFindingReasonCode { +extension LicenseRecommendationFilterNameValueExtension + on LicenseRecommendationFilterName { String toValue() { switch (this) { - case LambdaFunctionRecommendationFindingReasonCode.memoryOverprovisioned: - return 'MemoryOverprovisioned'; - case LambdaFunctionRecommendationFindingReasonCode.memoryUnderprovisioned: - return 'MemoryUnderprovisioned'; - case LambdaFunctionRecommendationFindingReasonCode.insufficientData: - return 'InsufficientData'; - case LambdaFunctionRecommendationFindingReasonCode.inconclusive: - return 'Inconclusive'; + case LicenseRecommendationFilterName.finding: + return 'Finding'; + case LicenseRecommendationFilterName.findingReasonCode: + return 'FindingReasonCode'; + case LicenseRecommendationFilterName.licenseName: + return 'LicenseName'; } } } -extension LambdaFunctionRecommendationFindingReasonCodeFromString on String { - LambdaFunctionRecommendationFindingReasonCode - toLambdaFunctionRecommendationFindingReasonCode() { +extension LicenseRecommendationFilterNameFromString on String { + LicenseRecommendationFilterName toLicenseRecommendationFilterName() { switch (this) { - case 'MemoryOverprovisioned': - return LambdaFunctionRecommendationFindingReasonCode - .memoryOverprovisioned; - case 'MemoryUnderprovisioned': - return LambdaFunctionRecommendationFindingReasonCode - .memoryUnderprovisioned; - case 'InsufficientData': - return LambdaFunctionRecommendationFindingReasonCode.insufficientData; - case 'Inconclusive': - return LambdaFunctionRecommendationFindingReasonCode.inconclusive; + case 'Finding': + return LicenseRecommendationFilterName.finding; + case 'FindingReasonCode': + return LicenseRecommendationFilterName.findingReasonCode; + case 'LicenseName': + return LicenseRecommendationFilterName.licenseName; } throw Exception( - '$this is not known in enum LambdaFunctionRecommendationFindingReasonCode'); + '$this is not known in enum LicenseRecommendationFilterName'); } } -/// Describes a utilization metric of an Lambda function. -class LambdaFunctionUtilizationMetric { - /// The name of the utilization metric. - /// - /// The following utilization metrics are available: - /// - ///
          - ///
        • - /// Duration - The amount of time that your function code spends - /// processing an event. - ///
        • - ///
        • - /// Memory - The amount of memory used per invocation. - ///
        • - ///
        - final LambdaFunctionMetricName? name; +/// Describes the recommendation options for licenses. +class LicenseRecommendationOption { + /// The recommended edition of the license for the application that runs on the + /// instance. + final LicenseEdition? licenseEdition; - /// The statistic of the utilization metric. - /// - /// The Compute Optimizer API, Command Line Interface (CLI), and SDKs return - /// utilization metrics using only the Maximum statistic, which is - /// the highest value observed during the specified period. - /// - /// The Compute Optimizer console displays graphs for some utilization metrics - /// using the Average statistic, which is the value of - /// Sum / SampleCount during the specified period. For - /// more information, see Viewing - /// resource recommendations in the Compute Optimizer User Guide. You - /// can also get averaged utilization metric data for your resources using - /// Amazon CloudWatch. For more information, see the Amazon - /// CloudWatch User Guide. - final LambdaFunctionMetricStatistic? statistic; + /// The recommended license type associated with the instance. + final LicenseModel? licenseModel; - /// The value of the utilization metric. - final double? value; + /// The operating system of a license recommendation option. + final String? operatingSystem; - LambdaFunctionUtilizationMetric({ - this.name, - this.statistic, - this.value, + /// The rank of the license recommendation option. + /// + /// The top recommendation option is ranked as 1. + final int? rank; + final SavingsOpportunity? savingsOpportunity; + + LicenseRecommendationOption({ + this.licenseEdition, + this.licenseModel, + this.operatingSystem, + this.rank, + this.savingsOpportunity, }); - factory LambdaFunctionUtilizationMetric.fromJson(Map json) { - return LambdaFunctionUtilizationMetric( - name: (json['name'] as String?)?.toLambdaFunctionMetricName(), - statistic: - (json['statistic'] as String?)?.toLambdaFunctionMetricStatistic(), - value: json['value'] as double?, + factory LicenseRecommendationOption.fromJson(Map json) { + return LicenseRecommendationOption( + licenseEdition: (json['licenseEdition'] as String?)?.toLicenseEdition(), + licenseModel: (json['licenseModel'] as String?)?.toLicenseModel(), + operatingSystem: json['operatingSystem'] as String?, + rank: json['rank'] as int?, + savingsOpportunity: json['savingsOpportunity'] != null + ? SavingsOpportunity.fromJson( + json['savingsOpportunity'] as Map) + : null, ); } Map toJson() { - final name = this.name; - final statistic = this.statistic; - final value = this.value; + final licenseEdition = this.licenseEdition; + final licenseModel = this.licenseModel; + final operatingSystem = this.operatingSystem; + final rank = this.rank; + final savingsOpportunity = this.savingsOpportunity; return { - if (name != null) 'name': name.toValue(), - if (statistic != null) 'statistic': statistic.toValue(), - if (value != null) 'value': value, + if (licenseEdition != null) 'licenseEdition': licenseEdition.toValue(), + if (licenseModel != null) 'licenseModel': licenseModel.toValue(), + if (operatingSystem != null) 'operatingSystem': operatingSystem, + if (rank != null) 'rank': rank, + if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, }; } } +enum LookBackPeriodPreference { + days_14, + days_32, + days_93, +} + +extension LookBackPeriodPreferenceValueExtension on LookBackPeriodPreference { + String toValue() { + switch (this) { + case LookBackPeriodPreference.days_14: + return 'DAYS_14'; + case LookBackPeriodPreference.days_32: + return 'DAYS_32'; + case LookBackPeriodPreference.days_93: + return 'DAYS_93'; + } + } +} + +extension LookBackPeriodPreferenceFromString on String { + LookBackPeriodPreference toLookBackPeriodPreference() { + switch (this) { + case 'DAYS_14': + return LookBackPeriodPreference.days_14; + case 'DAYS_32': + return LookBackPeriodPreference.days_32; + case 'DAYS_93': + return LookBackPeriodPreference.days_93; + } + throw Exception('$this is not known in enum LookBackPeriodPreference'); + } +} + /// The memory size configurations of a container. class MemorySizeConfiguration { /// The amount of memory in the container. @@ -8046,6 +10625,8 @@ enum MetricName { networkOutBytesPerSecond, networkPacketsInPerSecond, networkPacketsOutPerSecond, + gpuPercentage, + gpuMemoryPercentage, } extension MetricNameValueExtension on MetricName { @@ -8079,6 +10660,10 @@ extension MetricNameValueExtension on MetricName { return 'NETWORK_PACKETS_IN_PER_SECOND'; case MetricName.networkPacketsOutPerSecond: return 'NETWORK_PACKETS_OUT_PER_SECOND'; + case MetricName.gpuPercentage: + return 'GPU_PERCENTAGE'; + case MetricName.gpuMemoryPercentage: + return 'GPU_MEMORY_PERCENTAGE'; } } } @@ -8114,11 +10699,69 @@ extension MetricNameFromString on String { return MetricName.networkPacketsInPerSecond; case 'NETWORK_PACKETS_OUT_PER_SECOND': return MetricName.networkPacketsOutPerSecond; + case 'GPU_PERCENTAGE': + return MetricName.gpuPercentage; + case 'GPU_MEMORY_PERCENTAGE': + return MetricName.gpuMemoryPercentage; } throw Exception('$this is not known in enum MetricName'); } } +/// The list of metric sources required to generate recommendations for +/// commercial software licenses. +class MetricSource { + /// The name of the metric source provider. + final MetricSourceProvider? provider; + + /// The ARN of the metric source provider. + final String? providerArn; + + MetricSource({ + this.provider, + this.providerArn, + }); + + factory MetricSource.fromJson(Map json) { + return MetricSource( + provider: (json['provider'] as String?)?.toMetricSourceProvider(), + providerArn: json['providerArn'] as String?, + ); + } + + Map toJson() { + final provider = this.provider; + final providerArn = this.providerArn; + return { + if (provider != null) 'provider': provider.toValue(), + if (providerArn != null) 'providerArn': providerArn, + }; + } +} + +enum MetricSourceProvider { + cloudWatchApplicationInsights, +} + +extension MetricSourceProviderValueExtension on MetricSourceProvider { + String toValue() { + switch (this) { + case MetricSourceProvider.cloudWatchApplicationInsights: + return 'CloudWatchApplicationInsights'; + } + } +} + +extension MetricSourceProviderFromString on String { + MetricSourceProvider toMetricSourceProvider() { + switch (this) { + case 'CloudWatchApplicationInsights': + return MetricSourceProvider.cloudWatchApplicationInsights; + } + throw Exception('$this is not known in enum MetricSourceProvider'); + } +} + enum MetricStatistic { maximum, average, @@ -8233,6 +10876,87 @@ extension PlatformDifferenceFromString on String { } } +/// The preference to control which resource type values are considered when +/// generating rightsizing recommendations. You can specify this preference as a +/// combination of include and exclude lists. You must specify either an +/// includeList or excludeList. If the preference is +/// an empty set of resource type values, an error occurs. For more information, +/// see +/// Rightsizing recommendation preferences in the Compute Optimizer User +/// Guide. +/// +///
          +///
        • +/// This preference is only available for the Amazon EC2 instance and Auto +/// Scaling group resource types. +///
        • +///
        • +/// Compute Optimizer only supports the customization of +/// Ec2InstanceTypes. +///
        • +///
        +class PreferredResource { + /// The preferred resource type values to exclude from the recommendation + /// candidates. If this isn’t specified, all supported resources are included by + /// default. You can specify up to 1000 values in this list. + final List? excludeList; + + /// The preferred resource type values to include in the recommendation + /// candidates. You can specify the exact resource type value, such as m5.large, + /// or use wild card expressions, such as m5. If this isn’t specified, all + /// supported resources are included by default. You can specify up to 1000 + /// values in this list. + final List? includeList; + + /// The type of preferred resource to customize. + /// + /// Compute Optimizer only supports the customization of + /// Ec2InstanceTypes. + /// + final PreferredResourceName? name; + + PreferredResource({ + this.excludeList, + this.includeList, + this.name, + }); + + Map toJson() { + final excludeList = this.excludeList; + final includeList = this.includeList; + final name = this.name; + return { + if (excludeList != null) 'excludeList': excludeList, + if (includeList != null) 'includeList': includeList, + if (name != null) 'name': name.toValue(), + }; + } +} + +enum PreferredResourceName { + ec2InstanceTypes, +} + +extension PreferredResourceNameValueExtension on PreferredResourceName { + String toValue() { + switch (this) { + case PreferredResourceName.ec2InstanceTypes: + return 'Ec2InstanceTypes'; + } + } +} + +extension PreferredResourceNameFromString on String { + PreferredResourceName toPreferredResourceName() { + switch (this) { + case 'Ec2InstanceTypes': + return PreferredResourceName.ec2InstanceTypes; + } + throw Exception('$this is not known in enum PreferredResourceName'); + } +} + /// Describes a projected utilization metric of a recommendation option, such as /// an Amazon EC2 instance. This represents the projected utilization of a /// recommendation option had you used that resource during the analyzed period. @@ -8241,13 +10965,15 @@ extension PlatformDifferenceFromString on String { /// utilization metric data to determine the performance difference between your /// current resource and the recommended option. /// -/// The Cpu and Memory metrics are the only projected -/// utilization metrics returned when you run the -/// GetEC2RecommendationProjectedMetrics action. Additionally, the -/// Memory metric is returned only for resources that have the +/// The Cpu, Memory, GPU, and +/// GPU_MEMORY metrics are the only projected utilization metrics +/// returned when you run the GetEC2RecommendationProjectedMetrics +/// action. Additionally, these metrics are only returned for resources with the /// unified CloudWatch agent installed on them. For more information, see Enabling -/// Memory Utilization with the CloudWatch Agent. +/// Memory Utilization with the CloudWatch Agent and Enabling +/// NVIDIA GPU utilization with the CloudWatch Agent. /// class ProjectedMetric { /// The name of the projected utilization metric. @@ -8264,8 +10990,6 @@ class ProjectedMetric { /// Depending on the instance type, tools in your operating system can show a /// lower percentage than CloudWatch when the instance is not allocated a full /// processor core. - /// - /// Units: Percent ///
      • ///
      • /// Memory - The percentage of memory that would be in use on the @@ -8275,11 +10999,25 @@ class ProjectedMetric { /// /// Units: Percent /// - /// The Memory metric is returned only for resources that have the + /// The Memory metric is only returned for resources with the /// unified CloudWatch agent installed on them. For more information, see Enabling /// Memory Utilization with the CloudWatch Agent. ///
      • + ///
      • + /// GPU - The projected percentage of allocated GPUs if you adjust + /// your configurations to Compute Optimizer's recommendation option. + ///
      • + ///
      • + /// GPU_MEMORY - The projected percentage of total GPU memory if + /// you adjust your configurations to Compute Optimizer's recommendation option. + /// + /// The GPU and GPU_MEMORY metrics are only returned + /// for resources with the unified CloudWatch Agent installed on them. For more + /// information, see Enabling + /// NVIDIA GPU utilization with the CloudWatch Agent. + ///
      • ///
      final MetricName? name; @@ -8446,6 +11184,9 @@ enum RecommendationPreferenceName { enhancedInfrastructureMetrics, inferredWorkloadTypes, externalMetricsPreference, + lookBackPeriodPreference, + preferredResources, + utilizationPreferences, } extension RecommendationPreferenceNameValueExtension @@ -8458,6 +11199,12 @@ extension RecommendationPreferenceNameValueExtension return 'InferredWorkloadTypes'; case RecommendationPreferenceName.externalMetricsPreference: return 'ExternalMetricsPreference'; + case RecommendationPreferenceName.lookBackPeriodPreference: + return 'LookBackPeriodPreference'; + case RecommendationPreferenceName.preferredResources: + return 'PreferredResources'; + case RecommendationPreferenceName.utilizationPreferences: + return 'UtilizationPreferences'; } } } @@ -8471,6 +11218,12 @@ extension RecommendationPreferenceNameFromString on String { return RecommendationPreferenceName.inferredWorkloadTypes; case 'ExternalMetricsPreference': return RecommendationPreferenceName.externalMetricsPreference; + case 'LookBackPeriodPreference': + return RecommendationPreferenceName.lookBackPeriodPreference; + case 'PreferredResources': + return RecommendationPreferenceName.preferredResources; + case 'UtilizationPreferences': + return RecommendationPreferenceName.utilizationPreferences; } throw Exception('$this is not known in enum RecommendationPreferenceName'); } @@ -8549,6 +11302,17 @@ class RecommendationPreferencesDetail { /// recommendations. final InferredWorkloadTypesPreference? inferredWorkloadTypes; + /// The preference to control the number of days the utilization metrics of the + /// Amazon Web Services resource are analyzed. If the preference isn’t set, this + /// object is null. + final LookBackPeriodPreference? lookBackPeriod; + + /// The preference to control which resource type values are considered when + /// generating rightsizing recommendations. This object resolves any wildcard + /// expressions and returns the effective list of candidate resource type + /// values. If the preference isn’t set, this object is null. + final List? preferredResources; + /// The target resource type of the recommendation preference to create. /// /// The Ec2Instance option encompasses standalone instances and @@ -8557,6 +11321,13 @@ class RecommendationPreferencesDetail { /// part of an Auto Scaling group. final ResourceType? resourceType; + /// Describes the savings estimation mode used for calculating savings + /// opportunity. + /// + /// Only the account manager or delegated administrator of your organization can + /// activate this preference. + final SavingsEstimationMode? savingsEstimationMode; + /// An object that describes the scope of the recommendation preference. /// /// Recommendation preferences can be created at the organization level (for @@ -8567,12 +11338,24 @@ class RecommendationPreferencesDetail { /// Guide. final Scope? scope; + /// The preference to control the resource’s CPU utilization threshold, CPU + /// utilization headroom, and memory utilization headroom. If the preference + /// isn’t set, this object is null. + /// + /// This preference is only available for the Amazon EC2 instance resource type. + /// + final List? utilizationPreferences; + RecommendationPreferencesDetail({ this.enhancedInfrastructureMetrics, this.externalMetricsPreference, this.inferredWorkloadTypes, + this.lookBackPeriod, + this.preferredResources, this.resourceType, + this.savingsEstimationMode, this.scope, + this.utilizationPreferences, }); factory RecommendationPreferencesDetail.fromJson(Map json) { @@ -8586,10 +11369,23 @@ class RecommendationPreferencesDetail { : null, inferredWorkloadTypes: (json['inferredWorkloadTypes'] as String?) ?.toInferredWorkloadTypesPreference(), + lookBackPeriod: + (json['lookBackPeriod'] as String?)?.toLookBackPeriodPreference(), + preferredResources: (json['preferredResources'] as List?) + ?.whereNotNull() + .map((e) => + EffectivePreferredResource.fromJson(e as Map)) + .toList(), resourceType: (json['resourceType'] as String?)?.toResourceType(), + savingsEstimationMode: + (json['savingsEstimationMode'] as String?)?.toSavingsEstimationMode(), scope: json['scope'] != null ? Scope.fromJson(json['scope'] as Map) : null, + utilizationPreferences: (json['utilizationPreferences'] as List?) + ?.whereNotNull() + .map((e) => UtilizationPreference.fromJson(e as Map)) + .toList(), ); } @@ -8597,8 +11393,12 @@ class RecommendationPreferencesDetail { final enhancedInfrastructureMetrics = this.enhancedInfrastructureMetrics; final externalMetricsPreference = this.externalMetricsPreference; final inferredWorkloadTypes = this.inferredWorkloadTypes; + final lookBackPeriod = this.lookBackPeriod; + final preferredResources = this.preferredResources; final resourceType = this.resourceType; + final savingsEstimationMode = this.savingsEstimationMode; final scope = this.scope; + final utilizationPreferences = this.utilizationPreferences; return { if (enhancedInfrastructureMetrics != null) 'enhancedInfrastructureMetrics': @@ -8607,8 +11407,14 @@ class RecommendationPreferencesDetail { 'externalMetricsPreference': externalMetricsPreference, if (inferredWorkloadTypes != null) 'inferredWorkloadTypes': inferredWorkloadTypes.toValue(), + if (lookBackPeriod != null) 'lookBackPeriod': lookBackPeriod.toValue(), + if (preferredResources != null) 'preferredResources': preferredResources, if (resourceType != null) 'resourceType': resourceType.toValue(), + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode.toValue(), if (scope != null) 'scope': scope, + if (utilizationPreferences != null) + 'utilizationPreferences': utilizationPreferences, }; } } @@ -8653,6 +11459,7 @@ enum RecommendationSourceType { ebsVolume, lambdaFunction, ecsService, + license, } extension RecommendationSourceTypeValueExtension on RecommendationSourceType { @@ -8668,6 +11475,8 @@ extension RecommendationSourceTypeValueExtension on RecommendationSourceType { return 'LambdaFunction'; case RecommendationSourceType.ecsService: return 'EcsService'; + case RecommendationSourceType.license: + return 'License'; } } } @@ -8685,6 +11494,8 @@ extension RecommendationSourceTypeFromString on String { return RecommendationSourceType.lambdaFunction; case 'EcsService': return RecommendationSourceType.ecsService; + case 'License': + return RecommendationSourceType.license; } throw Exception('$this is not known in enum RecommendationSourceType'); } @@ -8701,8 +11512,8 @@ class RecommendationSummary { /// An array of objects that describes the estimated monthly saving amounts for /// the instances running on the specified inferredWorkloadTypes. - /// The array contains the top three savings opportunites for the instances - /// running inferred workload types. + /// The array contains the top five savings opportunites for the instances that + /// run inferred workload types. final List? inferredWorkloadSavings; /// The resource type that the recommendation summary applies to. @@ -8837,6 +11648,7 @@ enum ResourceType { lambdaFunction, notApplicable, ecsService, + license, } extension ResourceTypeValueExtension on ResourceType { @@ -8854,6 +11666,8 @@ extension ResourceTypeValueExtension on ResourceType { return 'NotApplicable'; case ResourceType.ecsService: return 'EcsService'; + case ResourceType.license: + return 'License'; } } } @@ -8873,6 +11687,8 @@ extension ResourceTypeFromString on String { return ResourceType.notApplicable; case 'EcsService': return ResourceType.ecsService; + case 'License': + return ResourceType.license; } throw Exception('$this is not known in enum ResourceType'); } @@ -8957,6 +11773,34 @@ class S3DestinationConfig { } } +enum SavingsEstimationMode { + afterDiscounts, + beforeDiscounts, +} + +extension SavingsEstimationModeValueExtension on SavingsEstimationMode { + String toValue() { + switch (this) { + case SavingsEstimationMode.afterDiscounts: + return 'AfterDiscounts'; + case SavingsEstimationMode.beforeDiscounts: + return 'BeforeDiscounts'; + } + } +} + +extension SavingsEstimationModeFromString on String { + SavingsEstimationMode toSavingsEstimationMode() { + switch (this) { + case 'AfterDiscounts': + return SavingsEstimationMode.afterDiscounts; + case 'BeforeDiscounts': + return SavingsEstimationMode.beforeDiscounts; + } + throw Exception('$this is not known in enum SavingsEstimationMode'); + } +} + /// Describes the savings opportunity for recommendations of a given resource /// type or for the recommendation option of an individual resource. /// @@ -9393,6 +12237,20 @@ class UtilizationMetric { /// Memory Utilization with the CloudWatch Agent. ///
    • ///
    • + /// GPU - The percentage of allocated GPUs that currently run on + /// the instance. + ///
    • + ///
    • + /// GPU_MEMORY - The percentage of total GPU memory that currently + /// runs on the instance. + /// + /// The GPU and GPU_MEMORY metrics are only returned + /// for resources with the unified CloudWatch Agent installed on them. For more + /// information, see Enabling + /// NVIDIA GPU utilization with the CloudWatch Agent. + ///
    • + ///
    • /// EBS_READ_OPS_PER_SECOND - The completed read operations from /// all EBS volumes attached to the instance in a specified period of time. /// @@ -9520,6 +12378,43 @@ class UtilizationMetric { } } +/// The preference to control the resource’s CPU utilization thresholds - +/// threshold and headroom. +/// +/// This preference is only available for the Amazon EC2 instance resource type. +/// +class UtilizationPreference { + /// The name of the resource utilization metric name to customize. + final CustomizableMetricName? metricName; + + /// The parameters to set when customizing the resource utilization thresholds. + final CustomizableMetricParameters? metricParameters; + + UtilizationPreference({ + this.metricName, + this.metricParameters, + }); + + factory UtilizationPreference.fromJson(Map json) { + return UtilizationPreference( + metricName: (json['metricName'] as String?)?.toCustomizableMetricName(), + metricParameters: json['metricParameters'] != null + ? CustomizableMetricParameters.fromJson( + json['metricParameters'] as Map) + : null, + ); + } + + Map toJson() { + final metricName = this.metricName; + final metricParameters = this.metricParameters; + return { + if (metricName != null) 'metricName': metricName.toValue(), + if (metricParameters != null) 'metricParameters': metricParameters, + }; + } +} + /// Describes the configuration of an Amazon Elastic Block Store (Amazon EBS) /// volume. class VolumeConfiguration { @@ -9606,6 +12501,10 @@ class VolumeRecommendation { /// doesn't have sufficient capacity. final CurrentPerformanceRisk? currentPerformanceRisk; + /// Describes the effective recommendation preferences for Amazon EBS volume. + final EBSEffectiveRecommendationPreferences? + effectiveRecommendationPreferences; + /// The finding classification of the volume. /// /// Findings for volumes include: @@ -9648,6 +12547,7 @@ class VolumeRecommendation { this.accountId, this.currentConfiguration, this.currentPerformanceRisk, + this.effectiveRecommendationPreferences, this.finding, this.lastRefreshTimestamp, this.lookBackPeriodInDays, @@ -9666,6 +12566,12 @@ class VolumeRecommendation { : null, currentPerformanceRisk: (json['currentPerformanceRisk'] as String?) ?.toCurrentPerformanceRisk(), + effectiveRecommendationPreferences: + json['effectiveRecommendationPreferences'] != null + ? EBSEffectiveRecommendationPreferences.fromJson( + json['effectiveRecommendationPreferences'] + as Map) + : null, finding: (json['finding'] as String?)?.toEBSFinding(), lastRefreshTimestamp: timeStampFromJson(json['lastRefreshTimestamp']), lookBackPeriodInDays: json['lookBackPeriodInDays'] as double?, @@ -9691,6 +12597,8 @@ class VolumeRecommendation { final accountId = this.accountId; final currentConfiguration = this.currentConfiguration; final currentPerformanceRisk = this.currentPerformanceRisk; + final effectiveRecommendationPreferences = + this.effectiveRecommendationPreferences; final finding = this.finding; final lastRefreshTimestamp = this.lastRefreshTimestamp; final lookBackPeriodInDays = this.lookBackPeriodInDays; @@ -9704,6 +12612,9 @@ class VolumeRecommendation { 'currentConfiguration': currentConfiguration, if (currentPerformanceRisk != null) 'currentPerformanceRisk': currentPerformanceRisk.toValue(), + if (effectiveRecommendationPreferences != null) + 'effectiveRecommendationPreferences': + effectiveRecommendationPreferences, if (finding != null) 'finding': finding.toValue(), if (lastRefreshTimestamp != null) 'lastRefreshTimestamp': unixTimestampToJson(lastRefreshTimestamp), @@ -9746,11 +12657,17 @@ class VolumeRecommendationOption { /// savings amount and percentage. final SavingsOpportunity? savingsOpportunity; + /// An object that describes the savings opportunity for the Amazon EBS volume + /// recommendation option with specific discounts. Savings opportunity includes + /// the estimated monthly savings and percentage. + final EBSSavingsOpportunityAfterDiscounts? savingsOpportunityAfterDiscounts; + VolumeRecommendationOption({ this.configuration, this.performanceRisk, this.rank, this.savingsOpportunity, + this.savingsOpportunityAfterDiscounts, }); factory VolumeRecommendationOption.fromJson(Map json) { @@ -9765,6 +12682,12 @@ class VolumeRecommendationOption { ? SavingsOpportunity.fromJson( json['savingsOpportunity'] as Map) : null, + savingsOpportunityAfterDiscounts: + json['savingsOpportunityAfterDiscounts'] != null + ? EBSSavingsOpportunityAfterDiscounts.fromJson( + json['savingsOpportunityAfterDiscounts'] + as Map) + : null, ); } @@ -9773,11 +12696,15 @@ class VolumeRecommendationOption { final performanceRisk = this.performanceRisk; final rank = this.rank; final savingsOpportunity = this.savingsOpportunity; + final savingsOpportunityAfterDiscounts = + this.savingsOpportunityAfterDiscounts; return { if (configuration != null) 'configuration': configuration, if (performanceRisk != null) 'performanceRisk': performanceRisk, if (rank != null) 'rank': rank, if (savingsOpportunity != null) 'savingsOpportunity': savingsOpportunity, + if (savingsOpportunityAfterDiscounts != null) + 'savingsOpportunityAfterDiscounts': savingsOpportunityAfterDiscounts, }; } } diff --git a/aws_client/lib/src/generated/config_service/v2014_11_12.dart b/aws_client/lib/src/generated/config_service/v2014_11_12.dart index 43482bcf6..a5cb51fd3 100644 --- a/aws_client/lib/src/generated/config_service/v2014_11_12.dart +++ b/aws_client/lib/src/generated/config_service/v2014_11_12.dart @@ -1036,7 +1036,7 @@ class ConfigService { /// The number of rule evaluation results that you want returned. /// /// This parameter is required if the rule limit for your account is more than - /// the default of 150 rules. + /// the default of 1000 rules. /// /// For information about requesting a rule limit increase, see Config @@ -1093,7 +1093,7 @@ class ConfigService { /// API returns an unfiltered list. For more information on Detective or /// Proactive Config rules, see - /// Evaluation Mode in the Config Developer Guide. + /// Evaluation Mode in the Config Developer Guide. /// /// Parameter [nextToken] : /// The nextToken string returned on a previous page that you use @@ -1252,10 +1252,10 @@ class ConfigService { /// configuration recorder is not specified, this action returns the status of /// all configuration recorders associated with the account. /// - /// Currently, you can specify only one configuration recorder per region in - /// your account. For a detailed status of recording events over time, add - /// your Config events to Amazon CloudWatch metrics and use CloudWatch - /// metrics. + /// >You can specify only one configuration recorder for each Amazon Web + /// Services Region for each account. For a detailed status of recording + /// events over time, add your Config events to Amazon CloudWatch metrics and + /// use CloudWatch metrics. /// /// /// May throw [NoSuchConfigurationRecorderException]. @@ -1292,8 +1292,8 @@ class ConfigService { /// configuration recorder is not specified, this action returns the details /// for all configuration recorders associated with the account. /// - /// Currently, you can specify only one configuration recorder per region in - /// your account. + /// You can specify only one configuration recorder for each Amazon Web + /// Services Region for each account. /// /// /// May throw [NoSuchConfigurationRecorderException]. @@ -1624,7 +1624,7 @@ class ConfigService { /// rule names. It is only applicable, when you request all the organization /// Config rules. /// - /// For accounts within an organzation + /// For accounts within an organization /// /// If you deploy an organizational rule or conformance pack in an /// organization administrator account, and then establish a delegated @@ -1765,7 +1765,7 @@ class ConfigService { /// conformance packs names. They are only applicable, when you request all /// the organization conformance packs. /// - /// For accounts within an organzation + /// For accounts within an organization /// /// If you deploy an organizational rule or conformance pack in an /// organization administrator account, and then establish a delegated @@ -2981,6 +2981,13 @@ class ConfigService { return GetOrganizationCustomRulePolicyResponse.fromJson(jsonResponse.body); } + /// + /// For accurate reporting on the compliance status, you must record the + /// AWS::Config::ResourceCompliance resource type. For more + /// information, see Selecting + /// Which Resources Config Records. + /// /// Returns a list of ConfigurationItems for the specified /// resource. The list contains details about each state of the resource /// during the specified time interval. If you specified a retention period to @@ -3019,13 +3026,14 @@ class ConfigService { /// results are listed in reverse chronological order. /// /// Parameter [earlierTime] : - /// The time stamp that indicates an earlier time. If not specified, the - /// action returns paginated results that contain configuration items that - /// start when the first configuration item was recorded. + /// The chronologically earliest time in the time range for which the history + /// requested. If not specified, the action returns paginated results that + /// contain configuration items that start when the first configuration item + /// was recorded. /// /// Parameter [laterTime] : - /// The time stamp that indicates a later time. If not specified, current time - /// is taken. + /// The chronologically latest time in the time range for which the history + /// requested. If not specified, current time is taken. /// /// Parameter [limit] : /// The maximum number of configuration items returned on each page. The @@ -3746,29 +3754,33 @@ class ConfigService { return PutConfigurationAggregatorResponse.fromJson(jsonResponse.body); } - /// Creates a new configuration recorder to record the selected resource - /// configurations. + /// Creates a new configuration recorder to record configuration changes for + /// specified resource types. /// - /// You can use this action to change the role roleARN or the - /// recordingGroup of an existing recorder. To change the role, - /// call the action on the existing configuration recorder and specify a role. + /// You can also use this action to change the roleARN or the + /// recordingGroup of an existing recorder. For more information, + /// see + /// Managing the Configuration Recorder in the Config Developer + /// Guide. /// - /// Currently, you can specify only one configuration recorder per region in - /// your account. + /// You can specify only one configuration recorder for each Amazon Web + /// Services Region for each account. /// - /// If ConfigurationRecorder does not have the - /// recordingGroup parameter specified, the default is to record all + /// If the configuration recorder does not have the + /// recordingGroup field specified, the default is to record all /// supported resource types. /// /// /// May throw [MaxNumberOfConfigurationRecordersExceededException]. + /// May throw [ValidationException]. /// May throw [InvalidConfigurationRecorderNameException]. /// May throw [InvalidRoleException]. /// May throw [InvalidRecordingGroupException]. /// /// Parameter [configurationRecorder] : - /// The configuration recorder object that records each configuration change - /// made to the resources. + /// An object for the configuration recorder to record configuration changes + /// for specified resource types. Future putConfigurationRecorder({ required ConfigurationRecorder configurationRecorder, }) async { @@ -3793,7 +3805,7 @@ class ConfigService { /// across an organization. For information on how many conformance packs you /// can have per account, see - /// Service Limits in the Config Developer Guide. + /// Service Limits in the Config Developer Guide. /// /// This API creates a service-linked role /// AWSServiceRoleForConfigConforms in your account. The @@ -3846,7 +3858,10 @@ class ConfigService { /// pack template (max size: 300 KB) that is located in an Amazon S3 bucket in /// the same Region as the conformance pack. /// - /// You must have access to read Amazon S3 bucket. + /// You must have access to read Amazon S3 bucket. In addition, in order to + /// ensure a successful deployment, the template object must not be in an archived + /// storage class if this parameter is passed. /// /// /// Parameter [templateSSMDocumentDetails] : @@ -3890,8 +3905,11 @@ class ConfigService { return PutConformancePackResponse.fromJson(jsonResponse.body); } - /// Creates a delivery channel object to deliver configuration information to - /// an Amazon S3 bucket and Amazon SNS topic. + /// Creates a delivery channel object to deliver configuration information and + /// other compliance information to an Amazon S3 bucket and Amazon SNS topic. + /// For more information, see Notifications + /// that Config Sends to an Amazon SNS topic. /// /// Before you can create a delivery channel, you must create a configuration /// recorder. @@ -4163,7 +4181,7 @@ class ConfigService { /// Organization. For information on how many organization conformance packs /// and how many Config rules you can have per account, see - /// Service Limits in the Config Developer Guide. + /// Service Limits in the Config Developer Guide. /// /// Only a management account and a delegated administrator can call this API. /// When calling this API with a delegated administrator, you must ensure @@ -4236,7 +4254,10 @@ class ConfigService { /// Location of file containing the template body. The uri must point to the /// conformance pack template (max size: 300 KB). /// - /// You must have access to read Amazon S3 bucket. + /// You must have access to read Amazon S3 bucket. In addition, in order to + /// ensure a successful deployment, the template object must not be in an archived + /// storage class if this parameter is passed. /// Future putOrganizationConformancePack({ @@ -4281,6 +4302,8 @@ class ConfigService { /// The target (SSM document) must exist and have permissions to use the /// target. /// + /// Be aware of backward incompatible changes + /// /// If you make backward incompatible changes to the SSM document, you must /// call this again to ensure the remediations can run. /// @@ -4289,6 +4312,8 @@ class ConfigService { /// deployed by conformance packs, and rules deployed by Amazon Web Services /// Security Hub. /// + /// Required fields + /// /// For manual remediation configuration, you need to provide a value for /// automationAssumeRole or use a value in the /// assumeRolefield to remediate your resources. The SSM @@ -4299,6 +4324,22 @@ class ConfigService { /// assumeRole field value is AutomationAssumeRole /// and you need to provide a value for AutomationAssumeRole to /// remediate your resources. + /// + /// Auto remediation can be initiated even for compliant resources + /// + /// If you enable auto remediation for a specific Config rule using the PutRemediationConfigurations + /// API or the Config console, it initiates the remediation process for all + /// non-compliant resources for that specific rule. The auto remediation + /// process relies on the compliance data snapshot which is captured on a + /// periodic basis. Any non-compliant resource that is updated between the + /// snapshot schedule will continue to be remediated based on the last known + /// compliance data snapshot. + /// + /// This means that in some cases auto remediation can be initiated even for + /// compliant resources, since the bootstrap processor uses a database that + /// can have stale evaluation results based on the last known compliance data + /// snapshot. /// /// /// May throw [InsufficientPermissionsException]. @@ -4332,10 +4373,14 @@ class ConfigService { /// an existing exception for a specified resource with a specified Config /// rule. /// + /// Exceptions block auto remediation + /// /// Config generates a remediation exception when a problem occurs running a /// remediation action for a specified resource. Remediation exceptions blocks /// auto-remediation until the exception is cleared. /// + /// Manual remediation is recommended when placing an exception + /// /// When placing an exception on an Amazon Web Services resource, it is /// recommended that remediation is set as manual remediation until the given /// Config rule for the specified resource evaluates the resource as @@ -4346,13 +4391,31 @@ class ConfigService { /// NON_COMPLIANT evaluation result can delete resources before /// the exception is applied. /// + /// Exceptions can only be performed on non-compliant resources + /// /// Placing an exception can only be performed on resources that are /// NON_COMPLIANT. If you use this API for COMPLIANT /// resources or resources that are NOT_APPLICABLE, a remediation /// exception will not be generated. For more information on the conditions /// that initiate the possible Config evaluation results, see Concepts - /// | Config Rules in the Config Developer Guide. + /// | Config Rules in the Config Developer Guide. + /// + /// Auto remediation can be initiated even for compliant resources + /// + /// If you enable auto remediation for a specific Config rule using the PutRemediationConfigurations + /// API or the Config console, it initiates the remediation process for all + /// non-compliant resources for that specific rule. The auto remediation + /// process relies on the compliance data snapshot which is captured on a + /// periodic basis. Any non-compliant resource that is updated between the + /// snapshot schedule will continue to be remediated based on the last known + /// compliance data snapshot. + /// + /// This means that in some cases auto remediation can be initiated even for + /// compliant resources, since the bootstrap processor uses a database that + /// can have stale evaluation results based on the last known compliance data + /// snapshot. /// /// /// May throw [InvalidParameterValueException]. @@ -4590,7 +4653,7 @@ class ConfigService { /// /// For more information about query components, see the - /// Query Components section in the Config Developer Guide. + /// Query Components section in the Config Developer Guide. /// /// If you run an aggregation query (i.e., using GROUP BY or /// using aggregate functions such as COUNT; e.g., SELECT @@ -5788,7 +5851,7 @@ class AggregationAuthorization { } } -/// The detailed configuration of a specified resource. +/// The detailed configurations of a specified resource. class BaseConfigurationItem { /// The 12-digit Amazon Web Services account ID associated with the resource. final String? accountId; @@ -5805,40 +5868,54 @@ class BaseConfigurationItem { /// The description of the resource configuration. final String? configuration; - /// The time when the configuration recording was initiated. + /// The time when the recording of configuration changes was initiated for the + /// resource. final DateTime? configurationItemCaptureTime; - /// The configuration item status. The valid values are: + /// The time when configuration changes for the resource were delivered. + /// + /// This field is optional and is not guaranteed to be present in a + /// configuration item (CI). If you are using daily recording, this field will + /// be populated. However, if you are using continuous recording, this field + /// will be omitted since the delivery time is instantaneous as the CI is + /// available right away. For more information on daily recording and continuous + /// recording, see Recording + /// Frequency in the Config Developer Guide. + /// + final DateTime? configurationItemDeliveryTime; + + /// The configuration item status. Valid values include: /// ///
        ///
      • - /// OK – The resource configuration has been updated + /// OK – The resource configuration has been updated. ///
      • ///
      • - /// ResourceDiscovered – The resource was newly discovered + /// ResourceDiscovered – The resource was newly discovered. ///
      • ///
      • - /// ResourceNotRecorded – The resource was discovered but its configuration was - /// not recorded since the recorder excludes the recording of resources of this - /// type + /// ResourceNotRecorded – The resource was discovered, but its configuration was + /// not recorded since the recorder doesn't record resources of this type. ///
      • ///
      • /// ResourceDeleted – The resource was deleted ///
      • ///
      • - /// ResourceDeletedNotRecorded – The resource was deleted but its configuration - /// was not recorded since the recorder excludes the recording of resources of - /// this type + /// ResourceDeletedNotRecorded – The resource was deleted, but its configuration + /// was not recorded since the recorder doesn't record resources of this type. ///
      • - ///
      - /// The CIs do not incur any cost. - /// + ///
    final ConfigurationItemStatus? configurationItemStatus; /// An identifier that indicates the ordering of the configuration items of a /// resource. final String? configurationStateId; + /// The recording frequency that Config uses to record configuration changes for + /// the resource. + final RecordingFrequency? recordingFrequency; + /// The time stamp when the resource was created. final DateTime? resourceCreationTime; @@ -5865,8 +5942,10 @@ class BaseConfigurationItem { this.awsRegion, this.configuration, this.configurationItemCaptureTime, + this.configurationItemDeliveryTime, this.configurationItemStatus, this.configurationStateId, + this.recordingFrequency, this.resourceCreationTime, this.resourceId, this.resourceName, @@ -5884,9 +5963,13 @@ class BaseConfigurationItem { configuration: json['configuration'] as String?, configurationItemCaptureTime: timeStampFromJson(json['configurationItemCaptureTime']), + configurationItemDeliveryTime: + timeStampFromJson(json['configurationItemDeliveryTime']), configurationItemStatus: (json['configurationItemStatus'] as String?) ?.toConfigurationItemStatus(), configurationStateId: json['configurationStateId'] as String?, + recordingFrequency: + (json['recordingFrequency'] as String?)?.toRecordingFrequency(), resourceCreationTime: timeStampFromJson(json['resourceCreationTime']), resourceId: json['resourceId'] as String?, resourceName: json['resourceName'] as String?, @@ -5905,8 +5988,10 @@ class BaseConfigurationItem { final awsRegion = this.awsRegion; final configuration = this.configuration; final configurationItemCaptureTime = this.configurationItemCaptureTime; + final configurationItemDeliveryTime = this.configurationItemDeliveryTime; final configurationItemStatus = this.configurationItemStatus; final configurationStateId = this.configurationStateId; + final recordingFrequency = this.recordingFrequency; final resourceCreationTime = this.resourceCreationTime; final resourceId = this.resourceId; final resourceName = this.resourceName; @@ -5922,10 +6007,15 @@ class BaseConfigurationItem { if (configurationItemCaptureTime != null) 'configurationItemCaptureTime': unixTimestampToJson(configurationItemCaptureTime), + if (configurationItemDeliveryTime != null) + 'configurationItemDeliveryTime': + unixTimestampToJson(configurationItemDeliveryTime), if (configurationItemStatus != null) 'configurationItemStatus': configurationItemStatus.toValue(), if (configurationStateId != null) 'configurationStateId': configurationStateId, + if (recordingFrequency != null) + 'recordingFrequency': recordingFrequency.toValue(), if (resourceCreationTime != null) 'resourceCreationTime': unixTimestampToJson(resourceCreationTime), if (resourceId != null) 'resourceId': resourceId, @@ -7096,16 +7186,30 @@ class ConfigurationItem { /// The description of the resource configuration. final String? configuration; - /// The time when the configuration recording was initiated. + /// The time when the recording of configuration changes was initiated for the + /// resource. final DateTime? configurationItemCaptureTime; + /// The time when configuration changes for the resource were delivered. + /// + /// This field is optional and is not guaranteed to be present in a + /// configuration item (CI). If you are using daily recording, this field will + /// be populated. However, if you are using continuous recording, this field + /// will be omitted since the delivery time is instantaneous as the CI is + /// available right away. For more information on daily recording and continuous + /// recording, see Recording + /// Frequency in the Config Developer Guide. + /// + final DateTime? configurationItemDeliveryTime; + /// Unique MD5 hash that represents the configuration item's state. /// /// You can use MD5 hash to compare the states of two or more configuration /// items that are associated with the same resource. final String? configurationItemMD5Hash; - /// The configuration item status. The valid values are: + /// The configuration item status. Valid values include: /// ///
      ///
    • @@ -7116,26 +7220,26 @@ class ConfigurationItem { ///
    • ///
    • /// ResourceNotRecorded – The resource was discovered but its configuration was - /// not recorded since the recorder excludes the recording of resources of this - /// type + /// not recorded since the recorder doesn't record resources of this type ///
    • ///
    • /// ResourceDeleted – The resource was deleted ///
    • ///
    • /// ResourceDeletedNotRecorded – The resource was deleted but its configuration - /// was not recorded since the recorder excludes the recording of resources of - /// this type + /// was not recorded since the recorder doesn't record resources of this type ///
    • - ///
    - /// The CIs do not incur any cost. - /// + /// final ConfigurationItemStatus? configurationItemStatus; /// An identifier that indicates the ordering of the configuration items of a /// resource. final String? configurationStateId; + /// The recording frequency that Config uses to record configuration changes for + /// the resource. + final RecordingFrequency? recordingFrequency; + /// A list of CloudTrail event IDs. /// /// A populated field indicates that the current configuration was initiated by @@ -7185,9 +7289,11 @@ class ConfigurationItem { this.awsRegion, this.configuration, this.configurationItemCaptureTime, + this.configurationItemDeliveryTime, this.configurationItemMD5Hash, this.configurationItemStatus, this.configurationStateId, + this.recordingFrequency, this.relatedEvents, this.relationships, this.resourceCreationTime, @@ -7208,10 +7314,14 @@ class ConfigurationItem { configuration: json['configuration'] as String?, configurationItemCaptureTime: timeStampFromJson(json['configurationItemCaptureTime']), + configurationItemDeliveryTime: + timeStampFromJson(json['configurationItemDeliveryTime']), configurationItemMD5Hash: json['configurationItemMD5Hash'] as String?, configurationItemStatus: (json['configurationItemStatus'] as String?) ?.toConfigurationItemStatus(), configurationStateId: json['configurationStateId'] as String?, + recordingFrequency: + (json['recordingFrequency'] as String?)?.toRecordingFrequency(), relatedEvents: (json['relatedEvents'] as List?) ?.whereNotNull() .map((e) => e as String) @@ -7240,9 +7350,11 @@ class ConfigurationItem { final awsRegion = this.awsRegion; final configuration = this.configuration; final configurationItemCaptureTime = this.configurationItemCaptureTime; + final configurationItemDeliveryTime = this.configurationItemDeliveryTime; final configurationItemMD5Hash = this.configurationItemMD5Hash; final configurationItemStatus = this.configurationItemStatus; final configurationStateId = this.configurationStateId; + final recordingFrequency = this.recordingFrequency; final relatedEvents = this.relatedEvents; final relationships = this.relationships; final resourceCreationTime = this.resourceCreationTime; @@ -7261,12 +7373,17 @@ class ConfigurationItem { if (configurationItemCaptureTime != null) 'configurationItemCaptureTime': unixTimestampToJson(configurationItemCaptureTime), + if (configurationItemDeliveryTime != null) + 'configurationItemDeliveryTime': + unixTimestampToJson(configurationItemDeliveryTime), if (configurationItemMD5Hash != null) 'configurationItemMD5Hash': configurationItemMD5Hash, if (configurationItemStatus != null) 'configurationItemStatus': configurationItemStatus.toValue(), if (configurationStateId != null) 'configurationStateId': configurationStateId, + if (recordingFrequency != null) + 'recordingFrequency': recordingFrequency.toValue(), if (relatedEvents != null) 'relatedEvents': relatedEvents, if (relationships != null) 'relationships': relationships, if (resourceCreationTime != null) @@ -7325,29 +7442,95 @@ extension ConfigurationItemStatusFromString on String { } } -/// An object that represents the recording of configuration changes of an -/// Amazon Web Services resource. +/// Records configuration changes to your specified resource types. For more +/// information about the configuration recorder, see +/// Managing the Configuration Recorder in the Config Developer +/// Guide. class ConfigurationRecorder { - /// The name of the recorder. By default, Config automatically assigns the name - /// "default" when creating the configuration recorder. You cannot change the - /// assigned name. + /// The name of the configuration recorder. Config automatically assigns the + /// name of "default" when creating the configuration recorder. + /// + /// You cannot change the name of the configuration recorder after it has been + /// created. To change the configuration recorder name, you must delete it and + /// create a new configuration recorder with a new name. + /// final String? name; - /// Specifies the types of Amazon Web Services resources for which Config - /// records configuration changes. + /// Specifies which resource types Config records for configuration changes. + /// + /// High Number of Config Evaluations + /// + /// You may notice increased activity in your account during your initial month + /// recording with Config when compared to subsequent months. During the initial + /// bootstrapping process, Config runs evaluations on all the resources in your + /// account that you have selected for Config to record. + /// + /// If you are running ephemeral workloads, you may see increased activity from + /// Config as it records configuration changes associated with creating and + /// deleting these temporary resources. An ephemeral workload is a + /// temporary use of computing resources that are loaded and run when needed. + /// Examples include Amazon Elastic Compute Cloud (Amazon EC2) Spot Instances, + /// Amazon EMR jobs, and Auto Scaling. If you want to avoid the increased + /// activity from running ephemeral workloads, you can run these types of + /// workloads in a separate account with Config turned off to avoid increased + /// configuration recording and rule evaluations. + /// final RecordingGroup? recordingGroup; - /// Amazon Resource Name (ARN) of the IAM role used to describe the Amazon Web - /// Services resources associated with the account. + /// Specifies the default recording frequency that Config uses to record + /// configuration changes. Config supports Continuous recording and + /// Daily recording. + /// + ///
      + ///
    • + /// Continuous recording allows you to record configuration changes continuously + /// whenever a change occurs. + ///
    • + ///
    • + /// Daily recording allows you to receive a configuration item (CI) representing + /// the most recent state of your resources over the last 24-hour period, only + /// if it’s different from the previous CI recorded. + ///
    • + ///
    + /// Firewall Manager depends on continuous recording to monitor your resources. + /// If you are using Firewall Manager, it is recommended that you set the + /// recording frequency to Continuous. + /// + /// You can also override the recording frequency for specific resource types. + final RecordingMode? recordingMode; + + /// Amazon Resource Name (ARN) of the IAM role assumed by Config and used by the + /// configuration recorder. /// /// While the API model does not require this field, the server will reject a - /// request without a defined roleARN for the configuration recorder. + /// request without a defined roleARN for the configuration + /// recorder. + /// + /// Pre-existing Config role + /// + /// If you have used an Amazon Web Services service that uses Config, such as + /// Security Hub or Control Tower, and an Config role has already been created, + /// make sure that the IAM role that you use when setting up Config keeps the + /// same minimum permissions as the already created Config role. You must do + /// this so that the other Amazon Web Services service continues to run as + /// expected. + /// + /// For example, if Control Tower has an IAM role that allows Config to read + /// Amazon Simple Storage Service (Amazon S3) objects, make sure that the same + /// permissions are granted within the IAM role you use when setting up Config. + /// Otherwise, it may interfere with how Control Tower operates. For more + /// information about IAM roles for Config, see + /// Identity and Access Management for Config in the Config + /// Developer Guide. /// final String? roleARN; ConfigurationRecorder({ this.name, this.recordingGroup, + this.recordingMode, this.roleARN, }); @@ -7358,6 +7541,10 @@ class ConfigurationRecorder { ? RecordingGroup.fromJson( json['recordingGroup'] as Map) : null, + recordingMode: json['recordingMode'] != null + ? RecordingMode.fromJson( + json['recordingMode'] as Map) + : null, roleARN: json['roleARN'] as String?, ); } @@ -7365,10 +7552,12 @@ class ConfigurationRecorder { Map toJson() { final name = this.name; final recordingGroup = this.recordingGroup; + final recordingMode = this.recordingMode; final roleARN = this.roleARN; return { if (name != null) 'name': name, if (recordingGroup != null) 'recordingGroup': recordingGroup, + if (recordingMode != null) 'recordingMode': recordingMode, if (roleARN != null) 'roleARN': roleARN, }; } @@ -8587,7 +8776,7 @@ class DescribeConfigRuleEvaluationStatusResponse { /// if the filter is not defined, this API returns an unfiltered list. For more /// information on Detective or Proactive Config rules, see -/// Evaluation Mode in the Config Developer Guide. +/// Evaluation Mode in the Config Developer Guide. class DescribeConfigRulesFilters { /// The mode of an evaluation. The valid values are Detective or Proactive. final EvaluationMode? evaluationMode; @@ -9385,7 +9574,7 @@ extension EvaluationModeFromString on String { } } -/// The configuration object for Config rule evaluation mode. The Supported +/// The configuration object for Config rule evaluation mode. The supported /// valid values are Detective or Proactive. class EvaluationModeConfiguration { /// The mode of an evaluation. The valid values are Detective or Proactive. @@ -9632,6 +9821,87 @@ extension EventSourceFromString on String { } } +/// Specifies whether the configuration recorder excludes certain resource types +/// from being recorded. Use the resourceTypes field to enter a +/// comma-separated list of resource types you want to exclude from recording. +/// +/// By default, when Config adds support for a new resource type in the Region +/// where you set up the configuration recorder, including global resource +/// types, Config starts recording resources of that type automatically. +/// +/// How to use the exclusion recording strategy +/// +/// To use this option, you must set the useOnly field of RecordingStrategy +/// to EXCLUSION_BY_RESOURCE_TYPES. +/// +/// Config will then record configuration changes for all supported resource +/// types, except the resource types that you specify to exclude from being +/// recorded. +/// +/// Global resource types and the exclusion recording strategy +/// +/// Unless specifically listed as exclusions, +/// AWS::RDS::GlobalCluster will be recorded automatically in all +/// supported Config Regions were the configuration recorder is enabled. +/// +/// IAM users, groups, roles, and customer managed policies will be recorded in +/// the Region where you set up the configuration recorder if that is a Region +/// where Config was available before February 2022. You cannot be record the +/// global IAM resouce types in Regions supported by Config after February 2022. +/// This list where you cannot record the global IAM resource types includes the +/// following Regions: +/// +///
      +///
    • +/// Asia Pacific (Hyderabad) +///
    • +///
    • +/// Asia Pacific (Melbourne) +///
    • +///
    • +/// Canada West (Calgary) +///
    • +///
    • +/// Europe (Spain) +///
    • +///
    • +/// Europe (Zurich) +///
    • +///
    • +/// Israel (Tel Aviv) +///
    • +///
    • +/// Middle East (UAE) +///
    • +///
    +class ExclusionByResourceTypes { + /// A comma-separated list of resource types to exclude from recording by the + /// configuration recorder. + final List? resourceTypes; + + ExclusionByResourceTypes({ + this.resourceTypes, + }); + + factory ExclusionByResourceTypes.fromJson(Map json) { + return ExclusionByResourceTypes( + resourceTypes: (json['resourceTypes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toResourceType()) + .toList(), + ); + } + + Map toJson() { + final resourceTypes = this.resourceTypes; + return { + if (resourceTypes != null) + 'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(), + }; + } +} + /// The controls that Config uses for executing remediations. class ExecutionControls { /// A SsmControls object. @@ -11826,11 +12096,11 @@ class OrganizationCustomPolicyRuleMetadata { } } -/// An object that specifies metadata for your organization Config Custom Policy -/// rule including the runtime system in use, which accounts have debug logging -/// enabled, and other custom rule metadata such as resource type, resource ID -/// of Amazon Web Services resource, and organization trigger types that trigger -/// Config to evaluate Amazon Web Services resources against a rule. +/// metadata for your organization Config Custom Policy rule including the +/// runtime system in use, which accounts have debug logging enabled, and other +/// custom rule metadata such as resource type, resource ID of Amazon Web +/// Services resource, and organization trigger types that trigger Config to +/// evaluate Amazon Web Services resources against a rule. class OrganizationCustomPolicyRuleMetadataNoPolicy { /// A list of accounts that you can enable debug logging for your organization /// Config Custom Policy rule. List is null when debug logging is enabled for @@ -12835,105 +13105,369 @@ extension RecorderStatusFromString on String { } } -/// Specifies which Amazon Web Services resource types Config records for -/// configuration changes. In the recording group, you specify whether you want -/// to record all supported resource types or only specific types of resources. +enum RecordingFrequency { + continuous, + daily, +} + +extension RecordingFrequencyValueExtension on RecordingFrequency { + String toValue() { + switch (this) { + case RecordingFrequency.continuous: + return 'CONTINUOUS'; + case RecordingFrequency.daily: + return 'DAILY'; + } + } +} + +extension RecordingFrequencyFromString on String { + RecordingFrequency toRecordingFrequency() { + switch (this) { + case 'CONTINUOUS': + return RecordingFrequency.continuous; + case 'DAILY': + return RecordingFrequency.daily; + } + throw Exception('$this is not known in enum RecordingFrequency'); + } +} + +/// Specifies which resource types Config records for configuration changes. By +/// default, Config records configuration changes for all current and future +/// supported resource types in the Amazon Web Services Region where you have +/// enabled Config, excluding the global IAM resource types: IAM users, groups, +/// roles, and customer managed policies. /// -/// By default, Config records the configuration changes for all supported types -/// of regional resources that Config discovers in the region in which it -/// is running. Regional resources are tied to a region and can be used only in -/// that region. Examples of regional resources are EC2 instances and EBS -/// volumes. +/// In the recording group, you specify whether you want to record all supported +/// current and future supported resource types or to include or exclude +/// specific resources types. For a list of supported resource types, see Supported +/// Resource Types in the Config developer guide. /// -/// You can also have Config record supported types of global resources. -/// Global resources are not tied to a specific region and can be used in all -/// regions. The global resource types that Config supports include IAM users, -/// groups, roles, and customer managed policies. +/// If you don't want Config to record all current and future supported resource +/// types (excluding the global IAM resource types), use one of the following +/// recording strategies: +///
      +///
    1. +/// Record all current and future resource types with exclusions +/// (EXCLUSION_BY_RESOURCE_TYPES), or +///
    2. +///
    3. +/// Record specific resource types +/// (INCLUSION_BY_RESOURCE_TYPES). +///
    +/// If you use the recording strategy to Record all current and future +/// resource types (ALL_SUPPORTED_RESOURCE_TYPES), you can use +/// the flag includeGlobalResourceTypes to include the global IAM +/// resource types in your recording. /// -/// Global resource types onboarded to Config recording after February 2022 will -/// only be recorded in the service's home region for the commercial partition -/// and Amazon Web Services GovCloud (US) West for the GovCloud partition. You -/// can view the Configuration Items for these new global resource types only in -/// their home region and Amazon Web Services GovCloud (US) West. +/// Aurora global clusters are recorded in all enabled Regions /// -/// Supported global resource types onboarded before February 2022 such as -/// AWS::IAM::Group, AWS::IAM::Policy, -/// AWS::IAM::Role, AWS::IAM::User remain unchanged, -/// and they will continue to deliver Configuration Items in all supported -/// regions in Config. The change will only affect new global resource types -/// onboarded after February 2022. +/// The AWS::RDS::GlobalCluster resource type will be recorded in +/// all supported Config Regions where the configuration recorder is enabled. /// -/// To record global resource types onboarded after February 2022, enable All -/// Supported Resource Types in the home region of the global resource type you -/// want to record. +/// If you do not want to record AWS::RDS::GlobalCluster in all +/// enabled Regions, use the EXCLUSION_BY_RESOURCE_TYPES or +/// INCLUSION_BY_RESOURCE_TYPES recording strategy. /// -/// If you don't want Config to record all resources, you can specify which -/// types of resources it will record with the resourceTypes -/// parameter. -/// -/// For a list of supported resource types, see Supported -/// Resource Types. -/// -/// For more information and a table of the Home Regions for Global Resource -/// Types Onboarded after February 2022, see Selecting -/// Which Resources Config Records. class RecordingGroup { - /// Specifies whether Config records configuration changes for every supported - /// type of regional resource. + /// Specifies whether Config records configuration changes for all supported + /// resource types, excluding the global IAM resource types. /// - /// If you set this option to true, when Config adds support for a - /// new type of regional resource, it starts recording resources of that type + /// If you set this field to true, when Config adds support for a + /// new resource type, Config starts recording resources of that type /// automatically. /// - /// If you set this option to true, you cannot enumerate a list of - /// resourceTypes. + /// If you set this field to true, you cannot enumerate specific + /// resource types to record in the resourceTypes field of RecordingGroup, + /// or to exclude in the resourceTypes field of ExclusionByResourceTypes. + /// + /// Region availability + /// + /// Check Resource + /// Coverage by Region Availability to see if a resource type is supported + /// in the Amazon Web Services Region where you set up Config. + /// final bool? allSupported; - /// Specifies whether Config includes all supported types of global resources - /// (for example, IAM resources) with the resources that it records. + /// An object that specifies how Config excludes resource types from being + /// recorded by the configuration recorder. + /// + /// Required fields /// - /// Before you can set this option to true, you must set the - /// allSupported option to true. + /// To use this option, you must set the useOnly field of RecordingStrategy + /// to EXCLUSION_BY_RESOURCE_TYPES. + /// + final ExclusionByResourceTypes? exclusionByResourceTypes; + + /// This option is a bundle which only applies to the global IAM resource types: + /// IAM users, groups, roles, and customer managed policies. These global IAM + /// resource types can only be recorded by Config in Regions where Config was + /// available before February 2022. You cannot be record the global IAM resouce + /// types in Regions supported by Config after February 2022. This list where + /// you cannot record the global IAM resource types includes the following + /// Regions: /// - /// If you set this option to true, when Config adds support for a - /// new type of global resource, it starts recording resources of that type - /// automatically. + ///
      + ///
    • + /// Asia Pacific (Hyderabad) + ///
    • + ///
    • + /// Asia Pacific (Melbourne) + ///
    • + ///
    • + /// Canada West (Calgary) + ///
    • + ///
    • + /// Europe (Spain) + ///
    • + ///
    • + /// Europe (Zurich) + ///
    • + ///
    • + /// Israel (Tel Aviv) + ///
    • + ///
    • + /// Middle East (UAE) + ///
    • + ///
    + /// Aurora global clusters are recorded in all enabled Regions /// - /// The configuration details for any global resource are the same in all - /// regions. To prevent duplicate configuration items, you should consider - /// customizing Config in only one region to record global resources. + /// The AWS::RDS::GlobalCluster resource type will be recorded in + /// all supported Config Regions where the configuration recorder is enabled, + /// even if includeGlobalResourceTypes is setfalse. + /// The includeGlobalResourceTypes option is a bundle which only + /// applies to IAM users, groups, roles, and customer managed policies. + /// + /// If you do not want to record AWS::RDS::GlobalCluster in all + /// enabled Regions, use one of the following recording strategies: + ///
      + ///
    1. + /// Record all current and future resource types with exclusions + /// (EXCLUSION_BY_RESOURCE_TYPES), or + ///
    2. + ///
    3. + /// Record specific resource types + /// (INCLUSION_BY_RESOURCE_TYPES). + ///
    + /// For more information, see Selecting + /// Which Resources are Recorded in the Config developer guide. + ///
    + /// includeGlobalResourceTypes and the exclusion recording strategy + /// + /// The includeGlobalResourceTypes field has no impact on the + /// EXCLUSION_BY_RESOURCE_TYPES recording strategy. This means that + /// the global IAM resource types (IAM users, groups, roles, and customer + /// managed policies) will not be automatically added as exclusions for + /// exclusionByResourceTypes when + /// includeGlobalResourceTypes is set to false. + /// + /// The includeGlobalResourceTypes field should only be used to + /// modify the AllSupported field, as the default for the + /// AllSupported field is to record configuration changes for all + /// supported resource types excluding the global IAM resource types. To include + /// the global IAM resource types when AllSupported is set to + /// true, make sure to set includeGlobalResourceTypes + /// to true. + /// + /// To exclude the global IAM resource types for the + /// EXCLUSION_BY_RESOURCE_TYPES recording strategy, you need to + /// manually add them to the resourceTypes field of + /// exclusionByResourceTypes. + /// + /// Required and optional fields + /// + /// Before you set this field to true, set the + /// allSupported field of RecordingGroup + /// to true. Optionally, you can set the useOnly field + /// of RecordingStrategy + /// to ALL_SUPPORTED_RESOURCE_TYPES. + /// + /// Overriding fields + /// + /// If you set this field to false but list global IAM resource + /// types in the resourceTypes field of RecordingGroup, + /// Config will still record configuration changes for those specified resource + /// types regardless of if you set the + /// includeGlobalResourceTypes field to false. + /// + /// If you do not want to record configuration changes to the global IAM + /// resource types (IAM users, groups, roles, and customer managed policies), + /// make sure to not list them in the resourceTypes field in + /// addition to setting the includeGlobalResourceTypes field to + /// false. + /// final bool? includeGlobalResourceTypes; - /// A comma-separated list that specifies the types of Amazon Web Services - /// resources for which Config records configuration changes (for example, - /// AWS::EC2::Instance or AWS::CloudTrail::Trail). + /// An object that specifies the recording strategy for the configuration + /// recorder. + /// + ///
      + ///
    • + /// If you set the useOnly field of RecordingStrategy + /// to ALL_SUPPORTED_RESOURCE_TYPES, Config records configuration + /// changes for all supported resource types, excluding the global IAM resource + /// types. You also must set the allSupported field of RecordingGroup + /// to true. When Config adds support for a new resource type, + /// Config automatically starts recording resources of that type. + ///
    • + ///
    • + /// If you set the useOnly field of RecordingStrategy + /// to INCLUSION_BY_RESOURCE_TYPES, Config records configuration + /// changes for only the resource types you specify in the + /// resourceTypes field of RecordingGroup. + ///
    • + ///
    • + /// If you set the useOnly field of RecordingStrategy + /// to EXCLUSION_BY_RESOURCE_TYPES, Config records configuration + /// changes for all supported resource types except the resource types that you + /// specify to exclude from being recorded in the resourceTypes + /// field of ExclusionByResourceTypes. + ///
    • + ///
    + /// Required and optional fields + /// + /// The recordingStrategy field is optional when you set the + /// allSupported field of RecordingGroup + /// to true. /// - /// To record all configuration changes, you must set the - /// allSupported option to true. + /// The recordingStrategy field is optional when you list resource + /// types in the resourceTypes field of RecordingGroup. /// - /// If you set the AllSupported option to false and populate the - /// ResourceTypes option with values, when Config adds support for - /// a new type of resource, it will not record resources of that type unless you - /// manually add that type to your recording group. + /// The recordingStrategy field is required if you list resource + /// types to exclude from recording in the resourceTypes field of + /// ExclusionByResourceTypes. + /// + /// Overriding fields + /// + /// If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording + /// strategy, the exclusionByResourceTypes field will override + /// other properties in the request. + /// + /// For example, even if you set includeGlobalResourceTypes to + /// false, global IAM resource types will still be automatically recorded in + /// this option unless those resource types are specifically listed as + /// exclusions in the resourceTypes field of + /// exclusionByResourceTypes. + /// + /// Global resources types and the resource exclusion recording strategy + /// + /// By default, if you choose the EXCLUSION_BY_RESOURCE_TYPES + /// recording strategy, when Config adds support for a new resource type in the + /// Region where you set up the configuration recorder, including global + /// resource types, Config starts recording resources of that type + /// automatically. /// - /// For a list of valid resourceTypes values, see the - /// resourceType Value column in AWS::RDS::GlobalCluster
    will be recorded automatically in all + /// supported Config Regions were the configuration recorder is enabled. + /// + /// IAM users, groups, roles, and customer managed policies will be recorded in + /// the Region where you set up the configuration recorder if that is a Region + /// where Config was available before February 2022. You cannot be record the + /// global IAM resouce types in Regions supported by Config after February 2022. + /// This list where you cannot record the global IAM resource types includes the + /// following Regions: + /// + ///
      + ///
    • + /// Asia Pacific (Hyderabad) + ///
    • + ///
    • + /// Asia Pacific (Melbourne) + ///
    • + ///
    • + /// Canada West (Calgary) + ///
    • + ///
    • + /// Europe (Spain) + ///
    • + ///
    • + /// Europe (Zurich) + ///
    • + ///
    • + /// Israel (Tel Aviv) + ///
    • + ///
    • + /// Middle East (UAE) + ///
    • + ///
    + final RecordingStrategy? recordingStrategy; + + /// A comma-separated list that specifies which resource types Config records. + /// + /// For a list of valid resourceTypes values, see the Resource + /// Type Value column in
    Supported - /// Amazon Web Services resource Types. + /// Amazon Web Services resource Types in the Config developer guide. + /// + /// Required and optional fields + /// + /// Optionally, you can set the useOnly field of RecordingStrategy + /// to INCLUSION_BY_RESOURCE_TYPES. + /// + /// To record all configuration changes, set the allSupported field + /// of RecordingGroup + /// to true, and either omit this field or don't specify any + /// resource types in this field. If you set the allSupported field + /// to false and specify values for resourceTypes, + /// when Config adds support for a new type of resource, it will not record + /// resources of that type unless you manually add that type to your recording + /// group. + /// + /// Region availability + /// + /// Before specifying a resource type for Config to track, check Resource + /// Coverage by Region Availability to see if the resource type is supported + /// in the Amazon Web Services Region where you set up Config. If a resource + /// type is supported by Config in at least one Region, you can enable the + /// recording of that resource type in all Regions supported by Config, even if + /// the specified resource type is not supported in the Amazon Web Services + /// Region where you set up Config. + /// final List? resourceTypes; RecordingGroup({ this.allSupported, + this.exclusionByResourceTypes, this.includeGlobalResourceTypes, + this.recordingStrategy, this.resourceTypes, }); factory RecordingGroup.fromJson(Map json) { return RecordingGroup( allSupported: json['allSupported'] as bool?, + exclusionByResourceTypes: json['exclusionByResourceTypes'] != null + ? ExclusionByResourceTypes.fromJson( + json['exclusionByResourceTypes'] as Map) + : null, includeGlobalResourceTypes: json['includeGlobalResourceTypes'] as bool?, + recordingStrategy: json['recordingStrategy'] != null + ? RecordingStrategy.fromJson( + json['recordingStrategy'] as Map) + : null, resourceTypes: (json['resourceTypes'] as List?) ?.whereNotNull() .map((e) => (e as String).toResourceType()) @@ -12943,18 +13477,328 @@ class RecordingGroup { Map toJson() { final allSupported = this.allSupported; + final exclusionByResourceTypes = this.exclusionByResourceTypes; final includeGlobalResourceTypes = this.includeGlobalResourceTypes; + final recordingStrategy = this.recordingStrategy; final resourceTypes = this.resourceTypes; return { if (allSupported != null) 'allSupported': allSupported, + if (exclusionByResourceTypes != null) + 'exclusionByResourceTypes': exclusionByResourceTypes, if (includeGlobalResourceTypes != null) 'includeGlobalResourceTypes': includeGlobalResourceTypes, + if (recordingStrategy != null) 'recordingStrategy': recordingStrategy, if (resourceTypes != null) 'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(), }; } } +/// Specifies the default recording frequency that Config uses to record +/// configuration changes. Config supports Continuous recording and +/// Daily recording. +/// +///
      +///
    • +/// Continuous recording allows you to record configuration changes continuously +/// whenever a change occurs. +///
    • +///
    • +/// Daily recording allows you to receive a configuration item (CI) representing +/// the most recent state of your resources over the last 24-hour period, only +/// if it’s different from the previous CI recorded. +///
    • +///
    +/// Firewall Manager depends on continuous recording to monitor your resources. +/// If you are using Firewall Manager, it is recommended that you set the +/// recording frequency to Continuous. +/// +/// You can also override the recording frequency for specific resource types. +class RecordingMode { + /// The default recording frequency that Config uses to record configuration + /// changes. + /// + /// Daily recording is not supported for the following resource types: + /// + ///
      + ///
    • + /// AWS::Config::ResourceCompliance + ///
    • + ///
    • + /// AWS::Config::ConformancePackCompliance + ///
    • + ///
    • + /// AWS::Config::ConfigurationRecorder + ///
    • + ///
    + /// For the allSupported (ALL_SUPPORTED_RESOURCE_TYPES) + /// recording strategy, these resource types will be set to Continuous + /// recording. + ///
    + final RecordingFrequency recordingFrequency; + + /// An array of recordingModeOverride objects for you to specify + /// your overrides for the recording mode. The + /// recordingModeOverride object in the + /// recordingModeOverrides array consists of three fields: a + /// description, the new recordingFrequency, and an + /// array of resourceTypes to override. + final List? recordingModeOverrides; + + RecordingMode({ + required this.recordingFrequency, + this.recordingModeOverrides, + }); + + factory RecordingMode.fromJson(Map json) { + return RecordingMode( + recordingFrequency: + (json['recordingFrequency'] as String).toRecordingFrequency(), + recordingModeOverrides: (json['recordingModeOverrides'] as List?) + ?.whereNotNull() + .map((e) => RecordingModeOverride.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final recordingFrequency = this.recordingFrequency; + final recordingModeOverrides = this.recordingModeOverrides; + return { + 'recordingFrequency': recordingFrequency.toValue(), + if (recordingModeOverrides != null) + 'recordingModeOverrides': recordingModeOverrides, + }; + } +} + +/// An object for you to specify your overrides for the recording mode. +class RecordingModeOverride { + /// The recording frequency that will be applied to all the resource types + /// specified in the override. + /// + ///
      + ///
    • + /// Continuous recording allows you to record configuration changes continuously + /// whenever a change occurs. + ///
    • + ///
    • + /// Daily recording allows you to receive a configuration item (CI) representing + /// the most recent state of your resources over the last 24-hour period, only + /// if it’s different from the previous CI recorded. + ///
    • + ///
    + /// Firewall Manager depends on continuous recording to monitor your resources. + /// If you are using Firewall Manager, it is recommended that you set the + /// recording frequency to Continuous. + /// + final RecordingFrequency recordingFrequency; + + /// A comma-separated list that specifies which resource types Config includes + /// in the override. + /// + /// Daily recording is not supported for the following resource types: + /// + ///
      + ///
    • + /// AWS::Config::ResourceCompliance + ///
    • + ///
    • + /// AWS::Config::ConformancePackCompliance + ///
    • + ///
    • + /// AWS::Config::ConfigurationRecorder + ///
    • + ///
    + final List resourceTypes; + + /// A description that you provide for the override. + final String? description; + + RecordingModeOverride({ + required this.recordingFrequency, + required this.resourceTypes, + this.description, + }); + + factory RecordingModeOverride.fromJson(Map json) { + return RecordingModeOverride( + recordingFrequency: + (json['recordingFrequency'] as String).toRecordingFrequency(), + resourceTypes: (json['resourceTypes'] as List) + .whereNotNull() + .map((e) => (e as String).toResourceType()) + .toList(), + description: json['description'] as String?, + ); + } + + Map toJson() { + final recordingFrequency = this.recordingFrequency; + final resourceTypes = this.resourceTypes; + final description = this.description; + return { + 'recordingFrequency': recordingFrequency.toValue(), + 'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(), + if (description != null) 'description': description, + }; + } +} + +/// Specifies the recording strategy of the configuration recorder. +class RecordingStrategy { + /// The recording strategy for the configuration recorder. + /// + ///
      + ///
    • + /// If you set this option to ALL_SUPPORTED_RESOURCE_TYPES, Config + /// records configuration changes for all supported resource types, excluding + /// the global IAM resource types. You also must set the + /// allSupported field of RecordingGroup + /// to true. When Config adds support for a new resource type, + /// Config automatically starts recording resources of that type. For a list of + /// supported resource types, see Supported + /// Resource Types in the Config developer guide. + ///
    • + ///
    • + /// If you set this option to INCLUSION_BY_RESOURCE_TYPES, Config + /// records configuration changes for only the resource types that you specify + /// in the resourceTypes field of RecordingGroup. + ///
    • + ///
    • + /// If you set this option to EXCLUSION_BY_RESOURCE_TYPES, Config + /// records configuration changes for all supported resource types, except the + /// resource types that you specify to exclude from being recorded in the + /// resourceTypes field of ExclusionByResourceTypes. + ///
    • + ///
    + /// Required and optional fields + /// + /// The recordingStrategy field is optional when you set the + /// allSupported field of RecordingGroup + /// to true. + /// + /// The recordingStrategy field is optional when you list resource + /// types in the resourceTypes field of RecordingGroup. + /// + /// The recordingStrategy field is required if you list resource + /// types to exclude from recording in the resourceTypes field of + /// ExclusionByResourceTypes. + /// + /// Overriding fields + /// + /// If you choose EXCLUSION_BY_RESOURCE_TYPES for the recording + /// strategy, the exclusionByResourceTypes field will override + /// other properties in the request. + /// + /// For example, even if you set includeGlobalResourceTypes to + /// false, global IAM resource types will still be automatically recorded in + /// this option unless those resource types are specifically listed as + /// exclusions in the resourceTypes field of + /// exclusionByResourceTypes. + /// + /// Global resource types and the exclusion recording strategy + /// + /// By default, if you choose the EXCLUSION_BY_RESOURCE_TYPES + /// recording strategy, when Config adds support for a new resource type in the + /// Region where you set up the configuration recorder, including global + /// resource types, Config starts recording resources of that type + /// automatically. + /// + /// Unless specifically listed as exclusions, + /// AWS::RDS::GlobalCluster will be recorded automatically in all + /// supported Config Regions were the configuration recorder is enabled. + /// + /// IAM users, groups, roles, and customer managed policies will be recorded in + /// the Region where you set up the configuration recorder if that is a Region + /// where Config was available before February 2022. You cannot be record the + /// global IAM resouce types in Regions supported by Config after February 2022. + /// This list where you cannot record the global IAM resource types includes the + /// following Regions: + /// + ///
      + ///
    • + /// Asia Pacific (Hyderabad) + ///
    • + ///
    • + /// Asia Pacific (Melbourne) + ///
    • + ///
    • + /// Canada West (Calgary) + ///
    • + ///
    • + /// Europe (Spain) + ///
    • + ///
    • + /// Europe (Zurich) + ///
    • + ///
    • + /// Israel (Tel Aviv) + ///
    • + ///
    • + /// Middle East (UAE) + ///
    • + ///
    + final RecordingStrategyType? useOnly; + + RecordingStrategy({ + this.useOnly, + }); + + factory RecordingStrategy.fromJson(Map json) { + return RecordingStrategy( + useOnly: (json['useOnly'] as String?)?.toRecordingStrategyType(), + ); + } + + Map toJson() { + final useOnly = this.useOnly; + return { + if (useOnly != null) 'useOnly': useOnly.toValue(), + }; + } +} + +enum RecordingStrategyType { + allSupportedResourceTypes, + inclusionByResourceTypes, + exclusionByResourceTypes, +} + +extension RecordingStrategyTypeValueExtension on RecordingStrategyType { + String toValue() { + switch (this) { + case RecordingStrategyType.allSupportedResourceTypes: + return 'ALL_SUPPORTED_RESOURCE_TYPES'; + case RecordingStrategyType.inclusionByResourceTypes: + return 'INCLUSION_BY_RESOURCE_TYPES'; + case RecordingStrategyType.exclusionByResourceTypes: + return 'EXCLUSION_BY_RESOURCE_TYPES'; + } + } +} + +extension RecordingStrategyTypeFromString on String { + RecordingStrategyType toRecordingStrategyType() { + switch (this) { + case 'ALL_SUPPORTED_RESOURCE_TYPES': + return RecordingStrategyType.allSupportedResourceTypes; + case 'INCLUSION_BY_RESOURCE_TYPES': + return RecordingStrategyType.inclusionByResourceTypes; + case 'EXCLUSION_BY_RESOURCE_TYPES': + return RecordingStrategyType.exclusionByResourceTypes; + } + throw Exception('$this is not known in enum RecordingStrategyType'); + } +} + /// The relationship of the related resource to the main resource. class Relationship { /// The type of relationship with the related resource. @@ -13040,12 +13884,17 @@ class RemediationConfiguration { /// The type of a resource. final String? resourceType; - /// Maximum time in seconds that Config runs auto-remediation. If you do not - /// select a number, the default is 60 seconds. + /// Time window to determine whether or not to add a remediation exception to + /// prevent infinite remediation attempts. If + /// MaximumAutomaticAttempts remediation attempts have been made + /// under RetryAttemptSeconds, a remediation exception will be + /// added to the resource. If you do not select a number, the default is 60 + /// seconds. /// - /// For example, if you specify RetryAttemptSeconds as 50 seconds and - /// MaximumAutomaticAttempts as 5, Config will run auto-remediations 5 times - /// within 50 seconds before throwing an exception. + /// For example, if you specify RetryAttemptSeconds as 50 seconds + /// and MaximumAutomaticAttempts as 5, Config will run + /// auto-remediations 5 times within 50 seconds before adding a remediation + /// exception to the resource. final int? retryAttemptSeconds; /// Version of the target. For example, version of the SSM document. @@ -13678,8 +14527,11 @@ class ResourceEvaluationFilters { /// Stack. final String? evaluationContextIdentifier; - /// Filters all resource evaluations results based on an evaluation mode. the - /// valid value for this API is Proactive. + /// Filters all resource evaluations results based on an evaluation mode. + /// + /// Currently, DECTECTIVE is not supported as a valid value. Ignore + /// other documentation stating otherwise. + /// final EvaluationMode? evaluationMode; /// Returns a TimeWindow object. @@ -14148,6 +15000,116 @@ enum ResourceType { awsRoute53ResolverFirewallRuleGroupAssociation, awsSageMakerAppImageConfig, awsSageMakerImage, + awsEcsTaskSet, + awsCassandraKeyspace, + awsSignerSigningProfile, + awsAmplifyApp, + awsAppMeshVirtualNode, + awsAppMeshVirtualService, + awsAppRunnerVpcConnector, + awsAppStreamApplication, + awsCodeArtifactRepository, + awsEc2PrefixList, + awsEc2SpotFleet, + awsEvidentlyProject, + awsForecastDataset, + awsIamSAMLProvider, + awsIamServerCertificate, + awsPinpointCampaign, + awsPinpointInAppTemplate, + awsSageMakerDomain, + awsTransferAgreement, + awsTransferConnector, + awsKinesisFirehoseDeliveryStream, + awsAmplifyBranch, + awsAppIntegrationsEventIntegration, + awsAppMeshRoute, + awsAthenaPreparedStatement, + awsEc2IPAMScope, + awsEvidentlyLaunch, + awsForecastDatasetGroup, + awsGreengrassV2ComponentVersion, + awsGroundStationMissionProfile, + awsMediaConnectFlowEntitlement, + awsMediaConnectFlowVpcInterface, + awsMediaTailorPlaybackConfiguration, + awsMskConfiguration, + awsPersonalizeDataset, + awsPersonalizeSchema, + awsPersonalizeSolution, + awsPinpointEmailTemplate, + awsPinpointEventStream, + awsResilienceHubApp, + awsAcmpcaCertificateAuthority, + awsAppConfigHostedConfigurationVersion, + awsAppMeshVirtualGateway, + awsAppMeshVirtualRouter, + awsAppRunnerService, + awsCustomerProfilesObjectType, + awsDmsEndpoint, + awsEc2CapacityReservation, + awsEc2ClientVpnEndpoint, + awsKendraIndex, + awsKinesisVideoStream, + awsLogsDestination, + awsPinpointEmailChannel, + awsS3AccessPoint, + awsNetworkManagerCustomerGatewayAssociation, + awsNetworkManagerLinkAssociation, + awsIoTWirelessMulticastGroup, + awsPersonalizeDatasetGroup, + awsIoTTwinMakerComponentType, + awsCodeBuildReportGroup, + awsSageMakerFeatureGroup, + awsMskBatchScramSecret, + awsAppStreamStack, + awsIoTJobTemplate, + awsIoTWirelessFuotaTask, + awsIoTProvisioningTemplate, + awsInspectorV2Filter, + awsRoute53ResolverResolverQueryLoggingConfigAssociation, + awsServiceDiscoveryInstance, + awsTransferCertificate, + awsMediaConnectFlowSource, + awsApsRuleGroupsNamespace, + awsCodeGuruProfilerProfilingGroup, + awsRoute53ResolverResolverQueryLoggingConfig, + awsBatchSchedulingPolicy, + awsAcmpcaCertificateAuthorityActivation, + awsAppMeshGatewayRoute, + awsAppMeshMesh, + awsConnectInstance, + awsConnectQuickConnect, + awsEc2CarrierGateway, + awsEc2IPAMPool, + awsEc2TransitGatewayConnect, + awsEc2TransitGatewayMulticastDomain, + awsEcsCapacityProvider, + awsIamInstanceProfile, + awsIoTCACertificate, + awsIoTTwinMakerSyncJob, + awsKafkaConnectConnector, + awsLambdaCodeSigningConfig, + awsNetworkManagerConnectPeer, + awsResourceExplorer2Index, + awsAppStreamFleet, + awsCognitoUserPool, + awsCognitoUserPoolClient, + awsCognitoUserPoolGroup, + awsEc2NetworkInsightsAccessScope, + awsEc2NetworkInsightsAnalysis, + awsGrafanaWorkspace, + awsGroundStationDataflowEndpointGroup, + awsImageBuilderImageRecipe, + awsKmsAlias, + awsM2Environment, + awsQuickSightDataSource, + awsQuickSightTemplate, + awsQuickSightTheme, + awsRdsOptionGroup, + awsRedshiftEndpointAccess, + awsRoute53ResolverFirewallRuleGroup, + awsSsmDocument, } extension ResourceTypeValueExtension on ResourceType { @@ -14747,6 +15709,226 @@ extension ResourceTypeValueExtension on ResourceType { return 'AWS::SageMaker::AppImageConfig'; case ResourceType.awsSageMakerImage: return 'AWS::SageMaker::Image'; + case ResourceType.awsEcsTaskSet: + return 'AWS::ECS::TaskSet'; + case ResourceType.awsCassandraKeyspace: + return 'AWS::Cassandra::Keyspace'; + case ResourceType.awsSignerSigningProfile: + return 'AWS::Signer::SigningProfile'; + case ResourceType.awsAmplifyApp: + return 'AWS::Amplify::App'; + case ResourceType.awsAppMeshVirtualNode: + return 'AWS::AppMesh::VirtualNode'; + case ResourceType.awsAppMeshVirtualService: + return 'AWS::AppMesh::VirtualService'; + case ResourceType.awsAppRunnerVpcConnector: + return 'AWS::AppRunner::VpcConnector'; + case ResourceType.awsAppStreamApplication: + return 'AWS::AppStream::Application'; + case ResourceType.awsCodeArtifactRepository: + return 'AWS::CodeArtifact::Repository'; + case ResourceType.awsEc2PrefixList: + return 'AWS::EC2::PrefixList'; + case ResourceType.awsEc2SpotFleet: + return 'AWS::EC2::SpotFleet'; + case ResourceType.awsEvidentlyProject: + return 'AWS::Evidently::Project'; + case ResourceType.awsForecastDataset: + return 'AWS::Forecast::Dataset'; + case ResourceType.awsIamSAMLProvider: + return 'AWS::IAM::SAMLProvider'; + case ResourceType.awsIamServerCertificate: + return 'AWS::IAM::ServerCertificate'; + case ResourceType.awsPinpointCampaign: + return 'AWS::Pinpoint::Campaign'; + case ResourceType.awsPinpointInAppTemplate: + return 'AWS::Pinpoint::InAppTemplate'; + case ResourceType.awsSageMakerDomain: + return 'AWS::SageMaker::Domain'; + case ResourceType.awsTransferAgreement: + return 'AWS::Transfer::Agreement'; + case ResourceType.awsTransferConnector: + return 'AWS::Transfer::Connector'; + case ResourceType.awsKinesisFirehoseDeliveryStream: + return 'AWS::KinesisFirehose::DeliveryStream'; + case ResourceType.awsAmplifyBranch: + return 'AWS::Amplify::Branch'; + case ResourceType.awsAppIntegrationsEventIntegration: + return 'AWS::AppIntegrations::EventIntegration'; + case ResourceType.awsAppMeshRoute: + return 'AWS::AppMesh::Route'; + case ResourceType.awsAthenaPreparedStatement: + return 'AWS::Athena::PreparedStatement'; + case ResourceType.awsEc2IPAMScope: + return 'AWS::EC2::IPAMScope'; + case ResourceType.awsEvidentlyLaunch: + return 'AWS::Evidently::Launch'; + case ResourceType.awsForecastDatasetGroup: + return 'AWS::Forecast::DatasetGroup'; + case ResourceType.awsGreengrassV2ComponentVersion: + return 'AWS::GreengrassV2::ComponentVersion'; + case ResourceType.awsGroundStationMissionProfile: + return 'AWS::GroundStation::MissionProfile'; + case ResourceType.awsMediaConnectFlowEntitlement: + return 'AWS::MediaConnect::FlowEntitlement'; + case ResourceType.awsMediaConnectFlowVpcInterface: + return 'AWS::MediaConnect::FlowVpcInterface'; + case ResourceType.awsMediaTailorPlaybackConfiguration: + return 'AWS::MediaTailor::PlaybackConfiguration'; + case ResourceType.awsMskConfiguration: + return 'AWS::MSK::Configuration'; + case ResourceType.awsPersonalizeDataset: + return 'AWS::Personalize::Dataset'; + case ResourceType.awsPersonalizeSchema: + return 'AWS::Personalize::Schema'; + case ResourceType.awsPersonalizeSolution: + return 'AWS::Personalize::Solution'; + case ResourceType.awsPinpointEmailTemplate: + return 'AWS::Pinpoint::EmailTemplate'; + case ResourceType.awsPinpointEventStream: + return 'AWS::Pinpoint::EventStream'; + case ResourceType.awsResilienceHubApp: + return 'AWS::ResilienceHub::App'; + case ResourceType.awsAcmpcaCertificateAuthority: + return 'AWS::ACMPCA::CertificateAuthority'; + case ResourceType.awsAppConfigHostedConfigurationVersion: + return 'AWS::AppConfig::HostedConfigurationVersion'; + case ResourceType.awsAppMeshVirtualGateway: + return 'AWS::AppMesh::VirtualGateway'; + case ResourceType.awsAppMeshVirtualRouter: + return 'AWS::AppMesh::VirtualRouter'; + case ResourceType.awsAppRunnerService: + return 'AWS::AppRunner::Service'; + case ResourceType.awsCustomerProfilesObjectType: + return 'AWS::CustomerProfiles::ObjectType'; + case ResourceType.awsDmsEndpoint: + return 'AWS::DMS::Endpoint'; + case ResourceType.awsEc2CapacityReservation: + return 'AWS::EC2::CapacityReservation'; + case ResourceType.awsEc2ClientVpnEndpoint: + return 'AWS::EC2::ClientVpnEndpoint'; + case ResourceType.awsKendraIndex: + return 'AWS::Kendra::Index'; + case ResourceType.awsKinesisVideoStream: + return 'AWS::KinesisVideo::Stream'; + case ResourceType.awsLogsDestination: + return 'AWS::Logs::Destination'; + case ResourceType.awsPinpointEmailChannel: + return 'AWS::Pinpoint::EmailChannel'; + case ResourceType.awsS3AccessPoint: + return 'AWS::S3::AccessPoint'; + case ResourceType.awsNetworkManagerCustomerGatewayAssociation: + return 'AWS::NetworkManager::CustomerGatewayAssociation'; + case ResourceType.awsNetworkManagerLinkAssociation: + return 'AWS::NetworkManager::LinkAssociation'; + case ResourceType.awsIoTWirelessMulticastGroup: + return 'AWS::IoTWireless::MulticastGroup'; + case ResourceType.awsPersonalizeDatasetGroup: + return 'AWS::Personalize::DatasetGroup'; + case ResourceType.awsIoTTwinMakerComponentType: + return 'AWS::IoTTwinMaker::ComponentType'; + case ResourceType.awsCodeBuildReportGroup: + return 'AWS::CodeBuild::ReportGroup'; + case ResourceType.awsSageMakerFeatureGroup: + return 'AWS::SageMaker::FeatureGroup'; + case ResourceType.awsMskBatchScramSecret: + return 'AWS::MSK::BatchScramSecret'; + case ResourceType.awsAppStreamStack: + return 'AWS::AppStream::Stack'; + case ResourceType.awsIoTJobTemplate: + return 'AWS::IoT::JobTemplate'; + case ResourceType.awsIoTWirelessFuotaTask: + return 'AWS::IoTWireless::FuotaTask'; + case ResourceType.awsIoTProvisioningTemplate: + return 'AWS::IoT::ProvisioningTemplate'; + case ResourceType.awsInspectorV2Filter: + return 'AWS::InspectorV2::Filter'; + case ResourceType.awsRoute53ResolverResolverQueryLoggingConfigAssociation: + return 'AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation'; + case ResourceType.awsServiceDiscoveryInstance: + return 'AWS::ServiceDiscovery::Instance'; + case ResourceType.awsTransferCertificate: + return 'AWS::Transfer::Certificate'; + case ResourceType.awsMediaConnectFlowSource: + return 'AWS::MediaConnect::FlowSource'; + case ResourceType.awsApsRuleGroupsNamespace: + return 'AWS::APS::RuleGroupsNamespace'; + case ResourceType.awsCodeGuruProfilerProfilingGroup: + return 'AWS::CodeGuruProfiler::ProfilingGroup'; + case ResourceType.awsRoute53ResolverResolverQueryLoggingConfig: + return 'AWS::Route53Resolver::ResolverQueryLoggingConfig'; + case ResourceType.awsBatchSchedulingPolicy: + return 'AWS::Batch::SchedulingPolicy'; + case ResourceType.awsAcmpcaCertificateAuthorityActivation: + return 'AWS::ACMPCA::CertificateAuthorityActivation'; + case ResourceType.awsAppMeshGatewayRoute: + return 'AWS::AppMesh::GatewayRoute'; + case ResourceType.awsAppMeshMesh: + return 'AWS::AppMesh::Mesh'; + case ResourceType.awsConnectInstance: + return 'AWS::Connect::Instance'; + case ResourceType.awsConnectQuickConnect: + return 'AWS::Connect::QuickConnect'; + case ResourceType.awsEc2CarrierGateway: + return 'AWS::EC2::CarrierGateway'; + case ResourceType.awsEc2IPAMPool: + return 'AWS::EC2::IPAMPool'; + case ResourceType.awsEc2TransitGatewayConnect: + return 'AWS::EC2::TransitGatewayConnect'; + case ResourceType.awsEc2TransitGatewayMulticastDomain: + return 'AWS::EC2::TransitGatewayMulticastDomain'; + case ResourceType.awsEcsCapacityProvider: + return 'AWS::ECS::CapacityProvider'; + case ResourceType.awsIamInstanceProfile: + return 'AWS::IAM::InstanceProfile'; + case ResourceType.awsIoTCACertificate: + return 'AWS::IoT::CACertificate'; + case ResourceType.awsIoTTwinMakerSyncJob: + return 'AWS::IoTTwinMaker::SyncJob'; + case ResourceType.awsKafkaConnectConnector: + return 'AWS::KafkaConnect::Connector'; + case ResourceType.awsLambdaCodeSigningConfig: + return 'AWS::Lambda::CodeSigningConfig'; + case ResourceType.awsNetworkManagerConnectPeer: + return 'AWS::NetworkManager::ConnectPeer'; + case ResourceType.awsResourceExplorer2Index: + return 'AWS::ResourceExplorer2::Index'; + case ResourceType.awsAppStreamFleet: + return 'AWS::AppStream::Fleet'; + case ResourceType.awsCognitoUserPool: + return 'AWS::Cognito::UserPool'; + case ResourceType.awsCognitoUserPoolClient: + return 'AWS::Cognito::UserPoolClient'; + case ResourceType.awsCognitoUserPoolGroup: + return 'AWS::Cognito::UserPoolGroup'; + case ResourceType.awsEc2NetworkInsightsAccessScope: + return 'AWS::EC2::NetworkInsightsAccessScope'; + case ResourceType.awsEc2NetworkInsightsAnalysis: + return 'AWS::EC2::NetworkInsightsAnalysis'; + case ResourceType.awsGrafanaWorkspace: + return 'AWS::Grafana::Workspace'; + case ResourceType.awsGroundStationDataflowEndpointGroup: + return 'AWS::GroundStation::DataflowEndpointGroup'; + case ResourceType.awsImageBuilderImageRecipe: + return 'AWS::ImageBuilder::ImageRecipe'; + case ResourceType.awsKmsAlias: + return 'AWS::KMS::Alias'; + case ResourceType.awsM2Environment: + return 'AWS::M2::Environment'; + case ResourceType.awsQuickSightDataSource: + return 'AWS::QuickSight::DataSource'; + case ResourceType.awsQuickSightTemplate: + return 'AWS::QuickSight::Template'; + case ResourceType.awsQuickSightTheme: + return 'AWS::QuickSight::Theme'; + case ResourceType.awsRdsOptionGroup: + return 'AWS::RDS::OptionGroup'; + case ResourceType.awsRedshiftEndpointAccess: + return 'AWS::Redshift::EndpointAccess'; + case ResourceType.awsRoute53ResolverFirewallRuleGroup: + return 'AWS::Route53Resolver::FirewallRuleGroup'; + case ResourceType.awsSsmDocument: + return 'AWS::SSM::Document'; } } } @@ -15348,6 +16530,227 @@ extension ResourceTypeFromString on String { return ResourceType.awsSageMakerAppImageConfig; case 'AWS::SageMaker::Image': return ResourceType.awsSageMakerImage; + case 'AWS::ECS::TaskSet': + return ResourceType.awsEcsTaskSet; + case 'AWS::Cassandra::Keyspace': + return ResourceType.awsCassandraKeyspace; + case 'AWS::Signer::SigningProfile': + return ResourceType.awsSignerSigningProfile; + case 'AWS::Amplify::App': + return ResourceType.awsAmplifyApp; + case 'AWS::AppMesh::VirtualNode': + return ResourceType.awsAppMeshVirtualNode; + case 'AWS::AppMesh::VirtualService': + return ResourceType.awsAppMeshVirtualService; + case 'AWS::AppRunner::VpcConnector': + return ResourceType.awsAppRunnerVpcConnector; + case 'AWS::AppStream::Application': + return ResourceType.awsAppStreamApplication; + case 'AWS::CodeArtifact::Repository': + return ResourceType.awsCodeArtifactRepository; + case 'AWS::EC2::PrefixList': + return ResourceType.awsEc2PrefixList; + case 'AWS::EC2::SpotFleet': + return ResourceType.awsEc2SpotFleet; + case 'AWS::Evidently::Project': + return ResourceType.awsEvidentlyProject; + case 'AWS::Forecast::Dataset': + return ResourceType.awsForecastDataset; + case 'AWS::IAM::SAMLProvider': + return ResourceType.awsIamSAMLProvider; + case 'AWS::IAM::ServerCertificate': + return ResourceType.awsIamServerCertificate; + case 'AWS::Pinpoint::Campaign': + return ResourceType.awsPinpointCampaign; + case 'AWS::Pinpoint::InAppTemplate': + return ResourceType.awsPinpointInAppTemplate; + case 'AWS::SageMaker::Domain': + return ResourceType.awsSageMakerDomain; + case 'AWS::Transfer::Agreement': + return ResourceType.awsTransferAgreement; + case 'AWS::Transfer::Connector': + return ResourceType.awsTransferConnector; + case 'AWS::KinesisFirehose::DeliveryStream': + return ResourceType.awsKinesisFirehoseDeliveryStream; + case 'AWS::Amplify::Branch': + return ResourceType.awsAmplifyBranch; + case 'AWS::AppIntegrations::EventIntegration': + return ResourceType.awsAppIntegrationsEventIntegration; + case 'AWS::AppMesh::Route': + return ResourceType.awsAppMeshRoute; + case 'AWS::Athena::PreparedStatement': + return ResourceType.awsAthenaPreparedStatement; + case 'AWS::EC2::IPAMScope': + return ResourceType.awsEc2IPAMScope; + case 'AWS::Evidently::Launch': + return ResourceType.awsEvidentlyLaunch; + case 'AWS::Forecast::DatasetGroup': + return ResourceType.awsForecastDatasetGroup; + case 'AWS::GreengrassV2::ComponentVersion': + return ResourceType.awsGreengrassV2ComponentVersion; + case 'AWS::GroundStation::MissionProfile': + return ResourceType.awsGroundStationMissionProfile; + case 'AWS::MediaConnect::FlowEntitlement': + return ResourceType.awsMediaConnectFlowEntitlement; + case 'AWS::MediaConnect::FlowVpcInterface': + return ResourceType.awsMediaConnectFlowVpcInterface; + case 'AWS::MediaTailor::PlaybackConfiguration': + return ResourceType.awsMediaTailorPlaybackConfiguration; + case 'AWS::MSK::Configuration': + return ResourceType.awsMskConfiguration; + case 'AWS::Personalize::Dataset': + return ResourceType.awsPersonalizeDataset; + case 'AWS::Personalize::Schema': + return ResourceType.awsPersonalizeSchema; + case 'AWS::Personalize::Solution': + return ResourceType.awsPersonalizeSolution; + case 'AWS::Pinpoint::EmailTemplate': + return ResourceType.awsPinpointEmailTemplate; + case 'AWS::Pinpoint::EventStream': + return ResourceType.awsPinpointEventStream; + case 'AWS::ResilienceHub::App': + return ResourceType.awsResilienceHubApp; + case 'AWS::ACMPCA::CertificateAuthority': + return ResourceType.awsAcmpcaCertificateAuthority; + case 'AWS::AppConfig::HostedConfigurationVersion': + return ResourceType.awsAppConfigHostedConfigurationVersion; + case 'AWS::AppMesh::VirtualGateway': + return ResourceType.awsAppMeshVirtualGateway; + case 'AWS::AppMesh::VirtualRouter': + return ResourceType.awsAppMeshVirtualRouter; + case 'AWS::AppRunner::Service': + return ResourceType.awsAppRunnerService; + case 'AWS::CustomerProfiles::ObjectType': + return ResourceType.awsCustomerProfilesObjectType; + case 'AWS::DMS::Endpoint': + return ResourceType.awsDmsEndpoint; + case 'AWS::EC2::CapacityReservation': + return ResourceType.awsEc2CapacityReservation; + case 'AWS::EC2::ClientVpnEndpoint': + return ResourceType.awsEc2ClientVpnEndpoint; + case 'AWS::Kendra::Index': + return ResourceType.awsKendraIndex; + case 'AWS::KinesisVideo::Stream': + return ResourceType.awsKinesisVideoStream; + case 'AWS::Logs::Destination': + return ResourceType.awsLogsDestination; + case 'AWS::Pinpoint::EmailChannel': + return ResourceType.awsPinpointEmailChannel; + case 'AWS::S3::AccessPoint': + return ResourceType.awsS3AccessPoint; + case 'AWS::NetworkManager::CustomerGatewayAssociation': + return ResourceType.awsNetworkManagerCustomerGatewayAssociation; + case 'AWS::NetworkManager::LinkAssociation': + return ResourceType.awsNetworkManagerLinkAssociation; + case 'AWS::IoTWireless::MulticastGroup': + return ResourceType.awsIoTWirelessMulticastGroup; + case 'AWS::Personalize::DatasetGroup': + return ResourceType.awsPersonalizeDatasetGroup; + case 'AWS::IoTTwinMaker::ComponentType': + return ResourceType.awsIoTTwinMakerComponentType; + case 'AWS::CodeBuild::ReportGroup': + return ResourceType.awsCodeBuildReportGroup; + case 'AWS::SageMaker::FeatureGroup': + return ResourceType.awsSageMakerFeatureGroup; + case 'AWS::MSK::BatchScramSecret': + return ResourceType.awsMskBatchScramSecret; + case 'AWS::AppStream::Stack': + return ResourceType.awsAppStreamStack; + case 'AWS::IoT::JobTemplate': + return ResourceType.awsIoTJobTemplate; + case 'AWS::IoTWireless::FuotaTask': + return ResourceType.awsIoTWirelessFuotaTask; + case 'AWS::IoT::ProvisioningTemplate': + return ResourceType.awsIoTProvisioningTemplate; + case 'AWS::InspectorV2::Filter': + return ResourceType.awsInspectorV2Filter; + case 'AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation': + return ResourceType + .awsRoute53ResolverResolverQueryLoggingConfigAssociation; + case 'AWS::ServiceDiscovery::Instance': + return ResourceType.awsServiceDiscoveryInstance; + case 'AWS::Transfer::Certificate': + return ResourceType.awsTransferCertificate; + case 'AWS::MediaConnect::FlowSource': + return ResourceType.awsMediaConnectFlowSource; + case 'AWS::APS::RuleGroupsNamespace': + return ResourceType.awsApsRuleGroupsNamespace; + case 'AWS::CodeGuruProfiler::ProfilingGroup': + return ResourceType.awsCodeGuruProfilerProfilingGroup; + case 'AWS::Route53Resolver::ResolverQueryLoggingConfig': + return ResourceType.awsRoute53ResolverResolverQueryLoggingConfig; + case 'AWS::Batch::SchedulingPolicy': + return ResourceType.awsBatchSchedulingPolicy; + case 'AWS::ACMPCA::CertificateAuthorityActivation': + return ResourceType.awsAcmpcaCertificateAuthorityActivation; + case 'AWS::AppMesh::GatewayRoute': + return ResourceType.awsAppMeshGatewayRoute; + case 'AWS::AppMesh::Mesh': + return ResourceType.awsAppMeshMesh; + case 'AWS::Connect::Instance': + return ResourceType.awsConnectInstance; + case 'AWS::Connect::QuickConnect': + return ResourceType.awsConnectQuickConnect; + case 'AWS::EC2::CarrierGateway': + return ResourceType.awsEc2CarrierGateway; + case 'AWS::EC2::IPAMPool': + return ResourceType.awsEc2IPAMPool; + case 'AWS::EC2::TransitGatewayConnect': + return ResourceType.awsEc2TransitGatewayConnect; + case 'AWS::EC2::TransitGatewayMulticastDomain': + return ResourceType.awsEc2TransitGatewayMulticastDomain; + case 'AWS::ECS::CapacityProvider': + return ResourceType.awsEcsCapacityProvider; + case 'AWS::IAM::InstanceProfile': + return ResourceType.awsIamInstanceProfile; + case 'AWS::IoT::CACertificate': + return ResourceType.awsIoTCACertificate; + case 'AWS::IoTTwinMaker::SyncJob': + return ResourceType.awsIoTTwinMakerSyncJob; + case 'AWS::KafkaConnect::Connector': + return ResourceType.awsKafkaConnectConnector; + case 'AWS::Lambda::CodeSigningConfig': + return ResourceType.awsLambdaCodeSigningConfig; + case 'AWS::NetworkManager::ConnectPeer': + return ResourceType.awsNetworkManagerConnectPeer; + case 'AWS::ResourceExplorer2::Index': + return ResourceType.awsResourceExplorer2Index; + case 'AWS::AppStream::Fleet': + return ResourceType.awsAppStreamFleet; + case 'AWS::Cognito::UserPool': + return ResourceType.awsCognitoUserPool; + case 'AWS::Cognito::UserPoolClient': + return ResourceType.awsCognitoUserPoolClient; + case 'AWS::Cognito::UserPoolGroup': + return ResourceType.awsCognitoUserPoolGroup; + case 'AWS::EC2::NetworkInsightsAccessScope': + return ResourceType.awsEc2NetworkInsightsAccessScope; + case 'AWS::EC2::NetworkInsightsAnalysis': + return ResourceType.awsEc2NetworkInsightsAnalysis; + case 'AWS::Grafana::Workspace': + return ResourceType.awsGrafanaWorkspace; + case 'AWS::GroundStation::DataflowEndpointGroup': + return ResourceType.awsGroundStationDataflowEndpointGroup; + case 'AWS::ImageBuilder::ImageRecipe': + return ResourceType.awsImageBuilderImageRecipe; + case 'AWS::KMS::Alias': + return ResourceType.awsKmsAlias; + case 'AWS::M2::Environment': + return ResourceType.awsM2Environment; + case 'AWS::QuickSight::DataSource': + return ResourceType.awsQuickSightDataSource; + case 'AWS::QuickSight::Template': + return ResourceType.awsQuickSightTemplate; + case 'AWS::QuickSight::Theme': + return ResourceType.awsQuickSightTheme; + case 'AWS::RDS::OptionGroup': + return ResourceType.awsRdsOptionGroup; + case 'AWS::Redshift::EndpointAccess': + return ResourceType.awsRedshiftEndpointAccess; + case 'AWS::Route53Resolver::FirewallRuleGroup': + return ResourceType.awsRoute53ResolverFirewallRuleGroup; + case 'AWS::SSM::Document': + return ResourceType.awsSsmDocument; } throw Exception('$this is not known in enum ResourceType'); } @@ -16158,9 +17561,7 @@ class Tag { class TemplateSSMDocumentDetails { /// The name or Amazon Resource Name (ARN) of the SSM document to use to create /// a conformance pack. If you use the document name, Config checks only your - /// account and Amazon Web Services Region for the SSM document. If you want to - /// use an SSM document from another Region or account, you must provide the - /// ARN. + /// account and Amazon Web Services Region for the SSM document. final String documentName; /// The version of the SSM document to use to create a conformance pack. By diff --git a/aws_client/lib/src/generated/connect/v2017_08_08.dart b/aws_client/lib/src/generated/connect/v2017_08_08.dart index 078922258..19775f8fa 100644 --- a/aws_client/lib/src/generated/connect/v2017_08_08.dart +++ b/aws_client/lib/src/generated/connect/v2017_08_08.dart @@ -112,6 +112,50 @@ class Connect { return ActivateEvaluationFormResponse.fromJson(response); } + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Associates the specified dataset for a Amazon Connect instance with the + /// target account. You can associate only one dataset in a single call. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [dataSetId] : + /// The identifier of the dataset to associate with the target account. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [targetAccountId] : + /// The identifier of the target account. Use to associate a dataset to a + /// different account than the one containing the Amazon Connect instance. If + /// not specified, by default this value is the Amazon Web Services account + /// that has the Amazon Connect instance. + Future associateAnalyticsDataSet({ + required String dataSetId, + required String instanceId, + String? targetAccountId, + }) async { + final $payload = { + 'DataSetId': dataSetId, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/association', + exceptionFnMap: _exceptionFns, + ); + return AssociateAnalyticsDataSetResponse.fromJson(response); + } + /// This API is in preview release for Amazon Connect and is subject to /// change. /// @@ -227,6 +271,47 @@ class Connect { ); } + /// Associates a connect resource to a flow. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [flowId] : + /// The identifier of the flow. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [resourceId] : + /// The identifier of the resource. + /// + /// Parameter [resourceType] : + /// A valid resource type. + Future associateFlow({ + required String flowId, + required String instanceId, + required String resourceId, + required FlowAssociationResourceType resourceType, + }) async { + final $payload = { + 'FlowId': flowId, + 'ResourceId': resourceId, + 'ResourceType': resourceType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/flow-associations/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + } + /// This API is in preview release for Amazon Connect and is subject to /// change. /// @@ -253,7 +338,30 @@ class Connect { /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [resourceType] : - /// A valid resource type. + /// A valid resource type. To enable + /// streaming for real-time analysis of contacts, use the following types: + /// + ///
      + ///
    • + /// For chat contacts, use + /// REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS. + ///
    • + ///
    • + /// For voice contacts, use + /// REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS. + ///
    • + ///
    + /// REAL_TIME_CONTACT_ANALYSIS_SEGMENTS is deprecated, but it is + /// still supported and will apply only to VOICE channel contacts. Use + /// REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS for voice contacts + /// moving forward. + /// + /// If you have previously associated a stream with + /// REAL_TIME_CONTACT_ANALYSIS_SEGMENTS, no action is needed to + /// update the stream to + /// REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS. + /// /// /// Parameter [storageConfig] : /// A valid storage type. @@ -510,227 +618,279 @@ class Connect { return AssociateSecurityKeyResponse.fromJson(response); } - /// Claims an available phone number to your Amazon Connect instance or - /// traffic distribution group. You can call this API only in the same Amazon - /// Web Services Region where the Amazon Connect instance or traffic - /// distribution group was created. - /// - /// For more information about how to use this operation, see Claim - /// a phone number in your country and Claim - /// phone numbers to traffic distribution groups in the Amazon Connect - /// Administrator Guide. - /// - /// You can call the SearchAvailablePhoneNumbers - /// API for available phone numbers that you can claim. Call the DescribePhoneNumber - /// API to verify the status of a previous ClaimPhoneNumber - /// operation. - /// + /// Associates an agent with a traffic distribution group. /// - /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceConflictException]. /// May throw [InternalServiceException]. - /// May throw [IdempotencyException]. - /// May throw [AccessDeniedException]. /// - /// Parameter [phoneNumber] : - /// The phone number you want to claim. Phone numbers are formatted [+] - /// [country code] [subscriber number including area code]. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [targetArn] : - /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. + /// Parameter [trafficDistributionGroupId] : + /// The identifier of the traffic distribution group. This can be the ID or + /// the ARN if the API is being called in the Region where the traffic + /// distribution group was created. The ARN must be provided if the call is + /// from the replicated Region. /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. + /// Parameter [userId] : + /// The identifier of the user account. This can be the ID or the ARN of the + /// user. + Future associateTrafficDistributionGroupUser({ + required String instanceId, + required String trafficDistributionGroupId, + required String userId, + }) async { + final $payload = { + 'InstanceId': instanceId, + 'UserId': userId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/traffic-distribution-group/${Uri.encodeComponent(trafficDistributionGroupId)}/user', + exceptionFnMap: _exceptionFns, + ); + } + + /// >Associates a set of proficiencies with a user. /// - /// Pattern: - /// ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$ + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. /// - /// Parameter [phoneNumberDescription] : - /// The description of the phone number. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN of the instance). /// - /// Parameter [tags] : - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future claimPhoneNumber({ - required String phoneNumber, - required String targetArn, - String? clientToken, - String? phoneNumberDescription, - Map? tags, + /// Parameter [userId] : + /// The identifier of the user account. + /// + /// Parameter [userProficiencies] : + /// The proficiencies to associate with the user. + Future associateUserProficiencies({ + required String instanceId, + required String userId, + required List userProficiencies, }) async { final $payload = { - 'PhoneNumber': phoneNumber, - 'TargetArn': targetArn, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (phoneNumberDescription != null) - 'PhoneNumberDescription': phoneNumberDescription, - if (tags != null) 'Tags': tags, + 'UserProficiencies': userProficiencies, }; - final response = await _protocol.send( + await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/phone-number/claim', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/associate-proficiencies', exceptionFnMap: _exceptionFns, ); - return ClaimPhoneNumberResponse.fromJson(response); } /// This API is in preview release for Amazon Connect and is subject to /// change. /// - /// Creates an agent status for the specified Amazon Connect instance. + /// Associates a list of analytics datasets for a given Amazon Connect + /// instance to a target account. You can associate multiple datasets in a + /// single call. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. - /// May throw [LimitExceededException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [dataSetIds] : + /// An array of dataset identifiers to associate. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [name] : - /// The name of the status. - /// - /// Parameter [state] : - /// The state of the status. - /// - /// Parameter [description] : - /// The description of the status. - /// - /// Parameter [displayOrder] : - /// The display order of the status. - /// - /// Parameter [tags] : - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future createAgentStatus({ + /// Parameter [targetAccountId] : + /// The identifier of the target account. Use to associate a dataset to a + /// different account than the one containing the Amazon Connect instance. If + /// not specified, by default this value is the Amazon Web Services account + /// that has the Amazon Connect instance. + Future + batchAssociateAnalyticsDataSet({ + required List dataSetIds, required String instanceId, - required String name, - required AgentStatusState state, - String? description, - int? displayOrder, - Map? tags, + String? targetAccountId, }) async { - _s.validateNumRange( - 'displayOrder', - displayOrder, - 1, - 50, - ); final $payload = { - 'Name': name, - 'State': state.toValue(), - if (description != null) 'Description': description, - if (displayOrder != null) 'DisplayOrder': displayOrder, - if (tags != null) 'Tags': tags, + 'DataSetIds': dataSetIds, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, }; final response = await _protocol.send( payload: $payload, method: 'PUT', - requestUri: '/agent-status/${Uri.encodeComponent(instanceId)}', + requestUri: + '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/associations', exceptionFnMap: _exceptionFns, ); - return CreateAgentStatusResponse.fromJson(response); + return BatchAssociateAnalyticsDataSetResponse.fromJson(response); } - /// Creates a flow for the specified Amazon Connect instance. + /// This API is in preview release for Amazon Connect and is subject to + /// change. /// - /// You can also create and update flows using the Amazon - /// Connect Flow language. + /// Removes a list of analytics datasets associated with a given Amazon + /// Connect instance. You can disassociate multiple datasets in a single call. /// /// May throw [InvalidRequestException]. - /// May throw [InvalidContactFlowException]. /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. - /// May throw [LimitExceededException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [content] : - /// The content of the flow. + /// Parameter [dataSetIds] : + /// An array of associated dataset identifiers to remove. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. - /// - /// Parameter [name] : - /// The name of the flow. - /// - /// Parameter [type] : - /// The type of the flow. For descriptions of the available types, see Choose - /// a flow type in the Amazon Connect Administrator Guide. - /// - /// Parameter [description] : - /// The description of the flow. + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [tags] : - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future createContactFlow({ - required String content, + /// Parameter [targetAccountId] : + /// The identifier of the target account. Use to disassociate a dataset from a + /// different account than the one containing the Amazon Connect instance. If + /// not specified, by default this value is the Amazon Web Services account + /// that has the Amazon Connect instance. + Future + batchDisassociateAnalyticsDataSet({ + required List dataSetIds, required String instanceId, - required String name, - required ContactFlowType type, - String? description, - Map? tags, + String? targetAccountId, }) async { final $payload = { - 'Content': content, - 'Name': name, - 'Type': type.toValue(), - if (description != null) 'Description': description, - if (tags != null) 'Tags': tags, + 'DataSetIds': dataSetIds, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/contact-flows/${Uri.encodeComponent(instanceId)}', + method: 'POST', + requestUri: + '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/associations', exceptionFnMap: _exceptionFns, ); - return CreateContactFlowResponse.fromJson(response); + return BatchDisassociateAnalyticsDataSetResponse.fromJson(response); } - /// Creates a flow module for the specified Amazon Connect instance. + /// Allows you to retrieve metadata about multiple attached files on an + /// associated resource. Each attached file provided in the input list must be + /// associated with the input AssociatedResourceArn. /// /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. - /// May throw [InvalidContactFlowModuleException]. - /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. - /// May throw [LimitExceededException]. + /// May throw [InternalServiceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [IdempotencyException]. - /// May throw [InternalServiceException]. - /// - /// Parameter [content] : - /// The content of the flow module. + /// + /// Parameter [associatedResourceArn] : + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// + /// + /// Parameter [fileIds] : + /// The unique identifiers of the attached file resource. + /// + /// Parameter [instanceId] : + /// The unique identifier of the Connect instance. + Future batchGetAttachedFileMetadata({ + required String associatedResourceArn, + required List fileIds, + required String instanceId, + }) async { + final $query = >{ + 'associatedResourceArn': [associatedResourceArn], + }; + final $payload = { + 'FileIds': fileIds, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/attached-files/${Uri.encodeComponent(instanceId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return BatchGetAttachedFileMetadataResponse.fromJson(response); + } + + /// Retrieve the flow associations for the given resources. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [name] : - /// The name of the flow module. + /// Parameter [resourceIds] : + /// A list of resource identifiers to retrieve flow associations. + /// + /// Parameter [resourceType] : + /// The type of resource association. + Future batchGetFlowAssociation({ + required String instanceId, + required List resourceIds, + ListFlowAssociationResourceType? resourceType, + }) async { + final $payload = { + 'ResourceIds': resourceIds, + if (resourceType != null) 'ResourceType': resourceType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/flow-associations-batch/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return BatchGetFlowAssociationResponse.fromJson(response); + } + + /// + /// Only the Amazon Connect outbound campaigns service principal is allowed to + /// assume a role in your account and call this API. + /// + /// Allows you to create a batch of contacts in Amazon Connect. The outbound + /// campaigns capability ingests dial requests via the PutDialRequestBatch + /// API. It then uses BatchPutContact to create contacts corresponding to + /// those dial requests. If agents are available, the dial requests are dialed + /// out, which results in a voice call. The resulting voice call uses the same + /// contactId that was created by BatchPutContact. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. + /// May throw [IdempotencyException]. + /// + /// Parameter [contactDataRequestList] : + /// List of individual contact requests. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [clientToken] : /// A unique, case-sensitive identifier that you provide to ensure the @@ -738,61 +898,71 @@ class Connect { /// populates this field. For more information about idempotency, see Making /// retries safe with idempotent APIs. - /// - /// Parameter [description] : - /// The description of the flow module. - /// - /// Parameter [tags] : - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future createContactFlowModule({ - required String content, + Future batchPutContact({ + required List contactDataRequestList, required String instanceId, - required String name, String? clientToken, - String? description, - Map? tags, }) async { final $payload = { - 'Content': content, - 'Name': name, + 'ContactDataRequestList': contactDataRequestList, 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (description != null) 'Description': description, - if (tags != null) 'Tags': tags, }; final response = await _protocol.send( payload: $payload, method: 'PUT', - requestUri: '/contact-flow-modules/${Uri.encodeComponent(instanceId)}', + requestUri: '/contact/batch/${Uri.encodeComponent(instanceId)}', exceptionFnMap: _exceptionFns, ); - return CreateContactFlowModuleResponse.fromJson(response); + return BatchPutContactResponse.fromJson(response); } - /// Creates an evaluation form in the specified Amazon Connect instance. The - /// form can be used to define questions related to agent performance, and - /// create sections to organize such questions. Question and section - /// identifiers cannot be duplicated within the same evaluation form. + /// Claims an available phone number to your Amazon Connect instance or + /// traffic distribution group. You can call this API only in the same Amazon + /// Web Services Region where the Amazon Connect instance or traffic + /// distribution group was created. + /// + /// For more information about how to use this operation, see Claim + /// a phone number in your country and Claim + /// phone numbers to traffic distribution groups in the Amazon Connect + /// Administrator Guide. + /// + /// You can call the SearchAvailablePhoneNumbers + /// API for available phone numbers that you can claim. Call the DescribePhoneNumber + /// API to verify the status of a previous ClaimPhoneNumber + /// operation. + /// + /// If you plan to claim and release numbers frequently, contact us for a + /// service quota exception. Otherwise, it is possible you will be blocked + /// from claiming and releasing any more numbers until up to 180 days past the + /// oldest number released has expired. + /// + /// By default you can claim and release up to 200% of your maximum number of + /// active phone numbers. If you claim and release phone numbers using the UI + /// or API during a rolling 180 day cycle that exceeds 200% of your phone + /// number service level quota, you will be blocked from claiming any more + /// numbers until 180 days past the oldest number released has expired. + /// + /// For example, if you already have 99 claimed numbers and a service level + /// quota of 99 phone numbers, and in any 180 day period you release 99, claim + /// 99, and then release 99, you will have exceeded the 200% limit. At that + /// point you are blocked from claiming any more numbers until you open an + /// Amazon Web Services support ticket. /// - /// May throw [InternalServiceException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [ServiceQuotaExceededException]. - /// May throw [ResourceConflictException]. - /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - /// - /// Parameter [items] : - /// Items that are part of the evaluation form. The total number of sections - /// and questions must not exceed 100 each. Questions must be contained in a - /// section. + /// May throw [InternalServiceException]. + /// May throw [IdempotencyException]. + /// May throw [AccessDeniedException]. /// - /// Parameter [title] : - /// A title of the evaluation form. + /// Parameter [phoneNumber] : + /// The phone number you want to claim. Phone numbers are formatted [+] + /// [country code] [subscriber number including area code]. /// /// Parameter [clientToken] : /// A unique, case-sensitive identifier that you provide to ensure the @@ -801,115 +971,433 @@ class Connect { /// href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making /// retries safe with idempotent APIs. /// - /// Parameter [description] : - /// The description of the evaluation form. + /// Pattern: + /// ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$ /// - /// Parameter [scoringStrategy] : - /// A scoring strategy of the evaluation form. - Future createEvaluationForm({ - required String instanceId, - required List items, - required String title, + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance that phone numbers are + /// claimed to. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. You + /// must enter InstanceId or TargetArn. + /// + /// Parameter [phoneNumberDescription] : + /// The description of the phone number. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + /// + /// Parameter [targetArn] : + /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic + /// distribution groups that phone number inbound traffic is routed through. + /// You must enter InstanceId or TargetArn. + Future claimPhoneNumber({ + required String phoneNumber, String? clientToken, - String? description, - EvaluationFormScoringStrategy? scoringStrategy, + String? instanceId, + String? phoneNumberDescription, + Map? tags, + String? targetArn, }) async { final $payload = { - 'Items': items, - 'Title': title, + 'PhoneNumber': phoneNumber, 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (description != null) 'Description': description, - if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, + if (instanceId != null) 'InstanceId': instanceId, + if (phoneNumberDescription != null) + 'PhoneNumberDescription': phoneNumberDescription, + if (tags != null) 'Tags': tags, + if (targetArn != null) 'TargetArn': targetArn, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/evaluation-forms/${Uri.encodeComponent(instanceId)}', + method: 'POST', + requestUri: '/phone-number/claim', + exceptionFnMap: _exceptionFns, + ); + return ClaimPhoneNumberResponse.fromJson(response); + } + + /// Allows you to confirm that the attached file has been uploaded using the + /// pre-signed URL provided in the StartAttachedFileUpload API. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [associatedResourceArn] : + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// + /// + /// Parameter [fileId] : + /// The unique identifier of the attached file resource. + /// + /// Parameter [instanceId] : + /// The unique identifier of the Connect instance. + Future completeAttachedFileUpload({ + required String associatedResourceArn, + required String fileId, + required String instanceId, + }) async { + final $query = >{ + 'associatedResourceArn': [associatedResourceArn], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/attached-files/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(fileId)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); - return CreateEvaluationFormResponse.fromJson(response); } /// This API is in preview release for Amazon Connect and is subject to /// change. /// - /// Creates hours of operation. + /// Creates an agent status for the specified Amazon Connect instance. /// - /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. /// May throw [LimitExceededException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [config] : - /// Configuration information for the hours of operation: day, start time, and - /// end time. - /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [name] : - /// The name of the hours of operation. + /// The name of the status. /// - /// Parameter [timeZone] : - /// The time zone of the hours of operation. + /// Parameter [state] : + /// The state of the status. /// /// Parameter [description] : - /// The description of the hours of operation. + /// The description of the status. + /// + /// Parameter [displayOrder] : + /// The display order of the status. /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future createHoursOfOperation({ - required List config, + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future createAgentStatus({ required String instanceId, required String name, - required String timeZone, + required AgentStatusState state, String? description, + int? displayOrder, Map? tags, }) async { + _s.validateNumRange( + 'displayOrder', + displayOrder, + 1, + 50, + ); final $payload = { - 'Config': config, 'Name': name, - 'TimeZone': timeZone, + 'State': state.toValue(), if (description != null) 'Description': description, + if (displayOrder != null) 'DisplayOrder': displayOrder, if (tags != null) 'Tags': tags, }; final response = await _protocol.send( payload: $payload, method: 'PUT', - requestUri: '/hours-of-operations/${Uri.encodeComponent(instanceId)}', + requestUri: '/agent-status/${Uri.encodeComponent(instanceId)}', exceptionFnMap: _exceptionFns, ); - return CreateHoursOfOperationResponse.fromJson(response); + return CreateAgentStatusResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Initiates an Amazon Connect instance with all the supported channels - /// enabled. It does not attach any storage, such as Amazon Simple Storage - /// Service (Amazon S3) or Amazon Kinesis. It also does not allow for any - /// configurations on features, such as Contact Lens for Amazon Connect. + /// Creates a flow for the specified Amazon Connect instance. /// - /// Amazon Connect enforces a limit on the total number of instances that you - /// can create or delete in 30 days. If you exceed this limit, you will get an - /// error message indicating there has been an excessive number of attempts at - /// creating or deleting instances. You must wait 30 days before you can - /// restart creating and deleting instances in your account. + /// You can also create and update flows using the Amazon + /// Connect Flow language. /// /// May throw [InvalidRequestException]. - /// May throw [ServiceQuotaExceededException]. - /// May throw [ThrottlingException]. + /// May throw [InvalidContactFlowException]. + /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. + /// May throw [LimitExceededException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [identityManagementType] : - /// The type of identity management for your Amazon Connect users. + /// Parameter [content] : + /// The JSON string that represents the content of the flow. For an example, + /// see Example + /// flow in Amazon Connect Flow language. + /// + /// Length Constraints: Minimum length of 1. Maximum length of 256000. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. + /// + /// Parameter [name] : + /// The name of the flow. + /// + /// Parameter [type] : + /// The type of the flow. For descriptions of the available types, see Choose + /// a flow type in the Amazon Connect Administrator Guide. + /// + /// Parameter [description] : + /// The description of the flow. + /// + /// Parameter [status] : + /// Indicates the flow status as either SAVED or + /// PUBLISHED. The PUBLISHED status will initiate + /// validation on the content. the SAVED status does not initiate + /// validation of the content. SAVED | PUBLISHED. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future createContactFlow({ + required String content, + required String instanceId, + required String name, + required ContactFlowType type, + String? description, + ContactFlowStatus? status, + Map? tags, + }) async { + final $payload = { + 'Content': content, + 'Name': name, + 'Type': type.toValue(), + if (description != null) 'Description': description, + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/contact-flows/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return CreateContactFlowResponse.fromJson(response); + } + + /// Creates a flow module for the specified Amazon Connect instance. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidContactFlowModuleException]. + /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [IdempotencyException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [content] : + /// The JSON string that represents the content of the flow. For an example, + /// see Example + /// flow in Amazon Connect Flow language. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the flow module. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [description] : + /// The description of the flow module. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future createContactFlowModule({ + required String content, + required String instanceId, + required String name, + String? clientToken, + String? description, + Map? tags, + }) async { + final $payload = { + 'Content': content, + 'Name': name, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'Description': description, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/contact-flow-modules/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return CreateContactFlowModuleResponse.fromJson(response); + } + + /// Creates an evaluation form in the specified Amazon Connect instance. The + /// form can be used to define questions related to agent performance, and + /// create sections to organize such questions. Question and section + /// identifiers cannot be duplicated within the same evaluation form. + /// + /// May throw [InternalServiceException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceConflictException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [items] : + /// Items that are part of the evaluation form. The total number of sections + /// and questions must not exceed 100 each. Questions must be contained in a + /// section. + /// + /// Parameter [title] : + /// A title of the evaluation form. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [description] : + /// The description of the evaluation form. + /// + /// Parameter [scoringStrategy] : + /// A scoring strategy of the evaluation form. + Future createEvaluationForm({ + required String instanceId, + required List items, + required String title, + String? clientToken, + String? description, + EvaluationFormScoringStrategy? scoringStrategy, + }) async { + final $payload = { + 'Items': items, + 'Title': title, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'Description': description, + if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/evaluation-forms/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return CreateEvaluationFormResponse.fromJson(response); + } + + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Creates hours of operation. + /// + /// May throw [DuplicateResourceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [config] : + /// Configuration information for the hours of operation: day, start time, and + /// end time. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the hours of operation. + /// + /// Parameter [timeZone] : + /// The time zone of the hours of operation. + /// + /// Parameter [description] : + /// The description of the hours of operation. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future createHoursOfOperation({ + required List config, + required String instanceId, + required String name, + required String timeZone, + String? description, + Map? tags, + }) async { + final $payload = { + 'Config': config, + 'Name': name, + 'TimeZone': timeZone, + if (description != null) 'Description': description, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/hours-of-operations/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return CreateHoursOfOperationResponse.fromJson(response); + } + + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Initiates an Amazon Connect instance with all the supported channels + /// enabled. It does not attach any storage, such as Amazon Simple Storage + /// Service (Amazon S3) or Amazon Kinesis. It also does not allow for any + /// configurations on features, such as Contact Lens for Amazon Connect. + /// + /// Amazon Connect enforces a limit on the total number of instances that you + /// can create or delete in 30 days. If you exceed this limit, you will get an + /// error message indicating there has been an excessive number of attempts at + /// creating or deleting instances. You must wait 30 days before you can + /// restart creating and deleting instances in your account. + /// + /// May throw [InvalidRequestException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [identityManagementType] : + /// The type of identity management for your Amazon Connect users. /// /// Parameter [inboundCallsEnabled] : /// Your contact center handles incoming contacts. @@ -925,6 +1413,10 @@ class Connect { /// /// Parameter [instanceAlias] : /// The name for your instance. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "tags": {"key1":"value1", "key2":"value2"} }. Future createInstance({ required DirectoryType identityManagementType, required bool inboundCallsEnabled, @@ -932,6 +1424,7 @@ class Connect { String? clientToken, String? directoryId, String? instanceAlias, + Map? tags, }) async { final $payload = { 'IdentityManagementType': identityManagementType.toValue(), @@ -940,6 +1433,7 @@ class Connect { if (clientToken != null) 'ClientToken': clientToken, if (directoryId != null) 'DirectoryId': directoryId, if (instanceAlias != null) 'InstanceAlias': instanceAlias, + if (tags != null) 'Tags': tags, }; final response = await _protocol.send( payload: $payload, @@ -988,7 +1482,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createIntegrationAssociation({ required String instanceId, required String integrationArn, @@ -1074,15 +1568,196 @@ class Connect { return CreateParticipantResponse.fromJson(response); } - /// Creates a prompt. For more information about prompts, such as supported - /// file types and maximum length, see Create - /// prompts in the Amazon Connect Administrator's Guide. + /// Enables rehydration of chats for the lifespan of a contact. For more + /// information about chat rehydration, see Enable + /// persistent chat in the Amazon Connect Administrator Guide. /// - /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [LimitExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [initialContactId] : + /// This is the contactId of the current contact that the + /// CreatePersistentContactAssociation API is being called from. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [rehydrationType] : + /// The contactId chosen for rehydration depends on the type chosen. + /// + ///
      + ///
    • + /// ENTIRE_PAST_SESSION: Rehydrates a chat from the most recently + /// terminated past chat contact of the specified past ended chat session. To + /// use this type, provide the initialContactId of the past ended + /// chat session in the sourceContactId field. In this type, + /// Amazon Connect determines what the most recent chat contact on the past + /// ended chat session and uses it to start a persistent chat. + ///
    • + ///
    • + /// FROM_SEGMENT: Rehydrates a chat from the specified past chat + /// contact provided in the sourceContactId field. + ///
    • + ///
    + /// The actual contactId used for rehydration is provided in the response of + /// this API. + /// + /// To illustrate how to use rehydration type, consider the following example: + /// A customer starts a chat session. Agent a1 accepts the chat and a + /// conversation starts between the customer and Agent a1. This first contact + /// creates a contact ID C1. Agent a1 then transfers the chat to Agent + /// a2. This creates another contact ID C2. At this point Agent a2 ends + /// the chat. The customer is forwarded to the disconnect flow for a post chat + /// survey that creates another contact ID C3. After the chat survey, + /// the chat session ends. Later, the customer returns and wants to resume + /// their past chat session. At this point, the customer can have following + /// use cases: + /// + ///
      + ///
    • + /// Use Case 1: The customer wants to continue the past chat session + /// but they want to hide the post chat survey. For this they will use the + /// following configuration: + /// + ///
        + ///
      • + /// Configuration + /// + ///
          + ///
        • + /// SourceContactId = "C2" + ///
        • + ///
        • + /// RehydrationType = "FROM_SEGMENT" + ///
        • + ///
      • + ///
      • + /// Expected behavior + /// + ///
          + ///
        • + /// This starts a persistent chat session from the specified past ended + /// contact (C2). Transcripts of past chat sessions C2 and C1 are accessible + /// in the current persistent chat session. Note that chat segment C3 is + /// dropped from the persistent chat session. + ///
        • + ///
      • + ///
    • + ///
    • + /// Use Case 2: The customer wants to continue the past chat session + /// and see the transcript of the entire past engagement, including the post + /// chat survey. For this they will use the following configuration: + /// + ///
        + ///
      • + /// Configuration + /// + ///
          + ///
        • + /// SourceContactId = "C1" + ///
        • + ///
        • + /// RehydrationType = "ENTIRE_PAST_SESSION" + ///
        • + ///
      • + ///
      • + /// Expected behavior + /// + ///
          + ///
        • + /// This starts a persistent chat session from the most recently ended chat + /// contact (C3). Transcripts of past chat sessions C3, C2 and C1 are + /// accessible in the current persistent chat session. + ///
        • + ///
      • + ///
    • + ///
    + /// + /// Parameter [sourceContactId] : + /// The contactId from which a persistent chat session must be started. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + Future + createPersistentContactAssociation({ + required String initialContactId, + required String instanceId, + required RehydrationType rehydrationType, + required String sourceContactId, + String? clientToken, + }) async { + final $payload = { + 'RehydrationType': rehydrationType.toValue(), + 'SourceContactId': sourceContactId, + if (clientToken != null) 'ClientToken': clientToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/contact/persistent-contact-association/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(initialContactId)}', + exceptionFnMap: _exceptionFns, + ); + return CreatePersistentContactAssociationResponse.fromJson(response); + } + + /// Creates a new predefined attribute for the specified Amazon Connect + /// instance. + /// + /// May throw [DuplicateResourceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the predefined attribute. + /// + /// Parameter [values] : + /// The values of the predefined attribute. + Future createPredefinedAttribute({ + required String instanceId, + required String name, + required PredefinedAttributeValues values, + }) async { + final $payload = { + 'Name': name, + 'Values': values, + }; + await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/predefined-attributes/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Creates a prompt. For more information about prompts, such as supported + /// file types and maximum length, see Create + /// prompts in the Amazon Connect Administrator Guide. + /// + /// May throw [DuplicateResourceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// @@ -1095,14 +1770,17 @@ class Connect { /// The name of the prompt. /// /// Parameter [s3Uri] : - /// The URI for the S3 bucket where the prompt is stored. + /// The URI for the S3 bucket where the prompt is stored. You can provide S3 + /// pre-signed URLs returned by the GetPromptFile + /// API instead of providing S3 URIs. /// /// Parameter [description] : /// The description of the prompt. /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createPrompt({ required String instanceId, required String name, @@ -1130,19 +1808,33 @@ class Connect { /// /// Creates a new queue for the specified Amazon Connect instance. /// - /// If the number being used in the input is claimed to a traffic distribution - /// group, and you are calling this API using an instance in the Amazon Web - /// Services Region where the traffic distribution group was created, you can - /// use either a full phone number ARN or UUID value for the - /// OutboundCallerIdNumberId value of the OutboundCallerConfig - /// request body parameter. However, if the number is claimed to a traffic - /// distribution group and you are calling this API using an instance in the - /// alternate Amazon Web Services Region associated with the traffic - /// distribution group, you must provide a full phone number ARN. If a UUID is - /// provided in this scenario, you will receive a - /// ResourceNotFoundException. - /// + ///
      + ///
    • + /// If the phone number is claimed to a traffic distribution group that was + /// created in the same Region as the Amazon Connect instance where you are + /// calling this API, then you can use a full phone number ARN or a UUID for + /// OutboundCallerIdNumberId. However, if the phone number is + /// claimed to a traffic distribution group that is in one Region, and you are + /// calling this API from an instance in another Amazon Web Services Region + /// that is associated with the traffic distribution group, you must provide a + /// full phone number ARN. If a UUID is provided in this scenario, you will + /// receive a ResourceNotFoundException. + ///
    • + ///
    • + /// Only use the phone number ARN format that doesn't contain + /// instance in the path, for example, + /// arn:aws:connect:us-east-1:1234567890:phone-number/uuid. This + /// is the same ARN format that is returned when you call the ListPhoneNumbersV2 + /// API. + ///
    • + ///
    • + /// If you plan to use IAM policies to allow/deny access to this API for phone + /// number resources claimed to a traffic distribution group, see Allow + /// or Deny queue API actions for phone numbers in a replica Region. + ///
    • + ///
    /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -1178,7 +1870,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createQueue({ required String hoursOfOperationId, required String instanceId, @@ -1230,7 +1922,7 @@ class Connect { /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [name] : - /// The name of the quick connect. + /// A unique name of the quick connect. /// /// Parameter [quickConnectConfig] : /// Configuration settings for the quick connect. @@ -1240,7 +1932,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createQuickConnect({ required String instanceId, required String name, @@ -1291,6 +1983,11 @@ class Connect { /// Parameter [name] : /// The name of the routing profile. Must not be more than 127 characters. /// + /// Parameter [agentAvailabilityTimer] : + /// Whether agents with this routing profile will have their routing order + /// calculated based on longest idle time or time since their last + /// inbound contact. + /// /// Parameter [queueConfigs] : /// The inbound queues associated with the routing profile. If no queue is /// added, the agent can make only outbound calls. @@ -1304,13 +2001,14 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createRoutingProfile({ required String defaultOutboundQueueId, required String description, required String instanceId, required List mediaConcurrencies, required String name, + AgentAvailabilityTimer? agentAvailabilityTimer, List? queueConfigs, Map? tags, }) async { @@ -1319,6 +2017,8 @@ class Connect { 'Description': description, 'MediaConcurrencies': mediaConcurrencies, 'Name': name, + if (agentAvailabilityTimer != null) + 'AgentAvailabilityTimer': agentAvailabilityTimer.toValue(), if (queueConfigs != null) 'QueueConfigs': queueConfigs, if (tags != null) 'Tags': tags, }; @@ -1397,9 +2097,6 @@ class Connect { return CreateRuleResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// /// Creates a security profile. /// /// May throw [InvalidRequestException]. @@ -1418,13 +2115,26 @@ class Connect { /// Parameter [securityProfileName] : /// The name of the security profile. /// + /// Parameter [allowedAccessControlHierarchyGroupId] : + /// The identifier of the hierarchy group that a security profile uses to + /// restrict access to resources in Amazon Connect. + /// /// Parameter [allowedAccessControlTags] : /// The list of tags that a security profile uses to restrict access to /// resources in Amazon Connect. /// + /// Parameter [applications] : + /// A list of third-party applications that the security profile will give + /// access to. + /// /// Parameter [description] : /// The description of the security profile. /// + /// Parameter [hierarchyRestrictedResources] : + /// The list of resources that a security profile applies hierarchy + /// restrictions to in Amazon Connect. Following are acceptable ResourceNames: + /// User. + /// /// Parameter [permissions] : /// Permissions assigned to the security profile. For a list of valid /// permissions, see createSecurityProfile({ required String instanceId, required String securityProfileName, + String? allowedAccessControlHierarchyGroupId, Map? allowedAccessControlTags, + List? applications, String? description, + List? hierarchyRestrictedResources, List? permissions, List? tagRestrictedResources, Map? tags, }) async { final $payload = { 'SecurityProfileName': securityProfileName, + if (allowedAccessControlHierarchyGroupId != null) + 'AllowedAccessControlHierarchyGroupId': + allowedAccessControlHierarchyGroupId, if (allowedAccessControlTags != null) 'AllowedAccessControlTags': allowedAccessControlTags, + if (applications != null) 'Applications': applications, if (description != null) 'Description': description, + if (hierarchyRestrictedResources != null) + 'HierarchyRestrictedResources': hierarchyRestrictedResources, if (permissions != null) 'Permissions': permissions, if (tagRestrictedResources != null) 'TagRestrictedResources': tagRestrictedResources, @@ -1546,7 +2265,16 @@ class Connect { /// Creates a traffic distribution group given an Amazon Connect instance that /// has been replicated. - /// + /// + /// The SignInConfig distribution is available only on a default + /// TrafficDistributionGroup (see the IsDefault + /// parameter in the TrafficDistributionGroup + /// data type). If you call UpdateTrafficDistribution with a + /// modified SignInConfig and a non-default + /// TrafficDistributionGroup, an + /// InvalidRequestException is returned. + /// /// For more information about creating traffic distribution groups, see Set /// up traffic distribution groups in the Amazon Connect Administrator @@ -1580,7 +2308,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createTrafficDistributionGroup({ required String instanceId, @@ -1627,7 +2355,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createUseCase({ required String instanceId, required String integrationAssociationId, @@ -1649,9 +2377,16 @@ class Connect { } /// Creates a user account for the specified Amazon Connect instance. - /// - /// For information about how to create user accounts using the Amazon Connect - /// console, see + /// Certain UserIdentityInfo + /// parameters are required in some situations. For example, + /// Email is required if you are using SAML for identity + /// management. FirstName and LastName are required + /// if you are using Amazon Connect or SAML for identity management. + /// + /// For information about how to create users using the Amazon Connect admin + /// website, see Add /// Users in the Amazon Connect Administrator Guide. /// @@ -1683,6 +2418,20 @@ class Connect { /// using SAML for identity management, the user name can include up to 64 /// characters from [a-zA-Z0-9_-.\@]+. /// + /// Username can include @ only if used in an email format. For example: + /// + ///
      + ///
    • + /// Correct: testuser + ///
    • + ///
    • + /// Correct: testuser@example.com + ///
    • + ///
    • + /// Incorrect: testuser@example + ///
    • + ///
    + /// /// Parameter [directoryUserId] : /// The identifier of the user account in the directory used for identity /// management. If Amazon Connect cannot access the directory, you can specify @@ -1708,7 +2457,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createUser({ required String instanceId, required UserPhoneConfig phoneConfig, @@ -1766,7 +2515,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createUserHierarchyGroup({ required String instanceId, required String name, @@ -1787,6 +2536,134 @@ class Connect { return CreateUserHierarchyGroupResponse.fromJson(response); } + /// Creates a new view with the possible status of SAVED or + /// PUBLISHED. + /// + /// The views will have a unique name for each connect instance. + /// + /// It performs basic content validation if the status is SAVED + /// or full content validation if the status is set to PUBLISHED. + /// An error is returned if validation fails. It associates either the + /// $SAVED qualifier or both of the $SAVED and + /// $LATEST qualifiers with the provided view content based on + /// the status. The view is idempotent if ClientToken is provided. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [DuplicateResourceException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [TooManyRequestsException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [content] : + /// View content containing all content necessary to render a view except for + /// runtime input data. + /// + /// The total uncompressed content has a maximum file size of 400kB. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [name] : + /// The name of the view. + /// + /// Parameter [status] : + /// Indicates the view status as either SAVED or + /// PUBLISHED. The PUBLISHED status will initiate + /// validation on the content. + /// + /// Parameter [clientToken] : + /// A unique Id for each create view request to avoid duplicate view creation. + /// For example, the view is idempotent ClientToken is provided. + /// + /// Parameter [description] : + /// The description of the view. + /// + /// Parameter [tags] : + /// The tags associated with the view resource (not specific to view + /// version).These tags can be used to organize, track, or control access for + /// this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} + /// }. + Future createView({ + required ViewInputContent content, + required String instanceId, + required String name, + required ViewStatus status, + String? clientToken, + String? description, + Map? tags, + }) async { + final $payload = { + 'Content': content, + 'Name': name, + 'Status': status.toValue(), + if (clientToken != null) 'ClientToken': clientToken, + if (description != null) 'Description': description, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/views/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return CreateViewResponse.fromJson(response); + } + + /// Publishes a new version of the view identifier. + /// + /// Versions are immutable and monotonically increasing. + /// + /// It returns the highest version if there is no change in content compared + /// to that version. An error is displayed if the supplied ViewContentSha256 + /// is different from the ViewContentSha256 of the $LATEST alias. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + /// + /// Parameter [versionDescription] : + /// The description for the version being published. + /// + /// Parameter [viewContentSha256] : + /// Indicates the checksum value of the latest published view content. + Future createViewVersion({ + required String instanceId, + required String viewId, + String? versionDescription, + String? viewContentSha256, + }) async { + final $payload = { + if (versionDescription != null) 'VersionDescription': versionDescription, + if (viewContentSha256 != null) 'ViewContentSha256': viewContentSha256, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}/versions', + exceptionFnMap: _exceptionFns, + ); + return CreateViewVersionResponse.fromJson(response); + } + /// Creates a custom vocabulary associated with your Amazon Connect instance. /// You can set a custom vocabulary to be your default vocabulary for a given /// language. Contact Lens for Amazon Connect uses the default vocabulary in @@ -1834,7 +2711,7 @@ class Connect { /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Future createVocabulary({ required String content, required String instanceId, @@ -1905,28 +2782,71 @@ class Connect { return DeactivateEvaluationFormResponse.fromJson(response); } - /// Deletes a contact evaluation in the specified Amazon Connect instance. + /// Deletes an attached file along with the underlying S3 Object. + /// + /// The attached file is permanently deleted if S3 bucket versioning is + /// not enabled. + /// /// - /// May throw [InvalidParameterException]. + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. - /// May throw [ResourceConflictException]. /// - /// Parameter [evaluationId] : - /// A unique identifier for the contact evaluation. + /// Parameter [associatedResourceArn] : + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// + /// + /// Parameter [fileId] : + /// The unique identifier of the attached file resource. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future deleteContactEvaluation({ - required String evaluationId, + /// The unique identifier of the Connect instance. + Future deleteAttachedFile({ + required String associatedResourceArn, + required String fileId, required String instanceId, }) async { - await _protocol.send( - payload: null, - method: 'DELETE', + final $query = >{ + 'associatedResourceArn': [associatedResourceArn], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/attached-files/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(fileId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a contact evaluation in the specified Amazon Connect instance. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// May throw [ResourceConflictException]. + /// + /// Parameter [evaluationId] : + /// A unique identifier for the contact evaluation. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + Future deleteContactEvaluation({ + required String evaluationId, + required String instanceId, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', requestUri: '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}', exceptionFnMap: _exceptionFns, @@ -2133,6 +3053,34 @@ class Connect { ); } + /// Deletes a predefined attribute from the specified Amazon Connect instance. + /// + /// May throw [ResourceInUseException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the predefined attribute. + Future deletePredefinedAttribute({ + required String instanceId, + required String name, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/predefined-attributes/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a prompt. /// /// May throw [InvalidRequestException]. @@ -2161,7 +3109,56 @@ class Connect { ); } + /// Deletes a queue. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceInUseException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [queueId] : + /// The identifier for the queue. + Future deleteQueue({ + required String instanceId, + required String queueId, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a quick connect. + /// + /// After calling DeleteUser, + /// it's important to call DeleteQuickConnect to delete any + /// records related to the deleted users. This will help you: + /// + ///
      + ///
    • + /// Avoid dangling resources that impact your service quotas. + ///
    • + ///
    • + /// Remove deleted users so they don't appear to agents as transfer options. + ///
    • + ///
    • + /// Avoid the disruption of other Amazon Connect processes, such as instance + /// replication and syncing if you're using Amazon + /// Connect Global Resiliency. + ///
    • + ///
    /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -2189,6 +3186,35 @@ class Connect { ); } + /// Deletes a routing profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceInUseException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + Future deleteRoutingProfile({ + required String instanceId, + required String routingProfileId, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a rule for the specified Amazon Connect instance. /// /// May throw [InvalidRequestException]. @@ -2217,9 +3243,6 @@ class Connect { ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// /// Deletes a security profile. /// /// May throw [InvalidRequestException]. @@ -2347,6 +3370,25 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/delete-users.html">Delete /// Users from Your Amazon Connect Instance in the Amazon Connect /// Administrator Guide. + /// + /// After calling DeleteUser, call DeleteQuickConnect + /// to delete any records related to the deleted users. This will help you: + /// + ///
      + ///
    • + /// Avoid dangling resources that impact your service quotas. + ///
    • + ///
    • + /// Remove deleted users so they don't appear to agents as transfer options. + ///
    • + ///
    • + /// Avoid the disruption of other Amazon Connect processes, such as instance + /// replication and syncing if you're using Amazon + /// Connect Global Resiliency. + ///
    • + ///
    /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -2404,6 +3446,72 @@ class Connect { ); } + /// Deletes the view entirely. It deletes the view and all associated + /// qualifiers (versions and aliases). + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + Future deleteView({ + required String instanceId, + required String viewId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the particular version specified in ViewVersion + /// identifier. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + /// + /// Parameter [viewVersion] : + /// The version number of the view. + Future deleteViewVersion({ + required String instanceId, + required String viewId, + required int viewVersion, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}/versions/${Uri.encodeComponent(viewVersion.toString())}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes the vocabulary that has the given identifier. /// /// May throw [InvalidRequestException]. @@ -2538,6 +3646,18 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/APIReference/flow-language.html">Amazon /// Connect Flow language. /// + /// Use the $SAVED alias in the request to describe the + /// SAVED content of a Flow. For example, + /// arn:aws:.../contact-flow/{id}:$SAVED. Once a contact flow is + /// published, $SAVED needs to be supplied to view saved content + /// that has not been published. + /// + /// In the response, Status indicates the flow status as either + /// SAVED or PUBLISHED. The PUBLISHED + /// status will initiate validation on the content. SAVED does + /// not initiate validation of the content. SAVED | + /// PUBLISHED + /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -2566,6 +3686,12 @@ class Connect { /// Describes the specified flow module. /// + /// Use the $SAVED alias in the request to describe the + /// SAVED content of a Flow. For example, + /// arn:aws:.../contact-flow/{id}:$SAVED. Once a contact flow is + /// published, $SAVED needs to be supplied to view saved content + /// that has not been published. + /// /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -2811,6 +3937,35 @@ class Connect { return DescribePhoneNumberResponse.fromJson(response); } + /// Describes a predefined attribute for the specified Amazon Connect + /// instance. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the predefined attribute. + Future describePredefinedAttribute({ + required String instanceId, + required String name, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/predefined-attributes/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(name)}', + exceptionFnMap: _exceptionFns, + ); + return DescribePredefinedAttributeResponse.fromJson(response); + } + /// Describes the prompt. /// /// May throw [InvalidRequestException]. @@ -2959,9 +4114,6 @@ class Connect { return DescribeRuleResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// /// Gets basic information about the security profle. /// /// May throw [InvalidRequestException]. @@ -3018,7 +4170,7 @@ class Connect { return DescribeTrafficDistributionGroupResponse.fromJson(response); } - /// Describes the specified user account. You can find /// the instance ID in the Amazon Connect console (it’s the final part of /// the ARN). The console does not display the user IDs. Instead, list the @@ -3107,6 +4259,49 @@ class Connect { return DescribeUserHierarchyStructureResponse.fromJson(response); } + /// Retrieves the view for the specified Amazon Connect instance and view + /// identifier. + /// + /// The view identifier can be supplied as a ViewId or ARN. + /// + /// $SAVED needs to be supplied if a view is unpublished. + /// + /// The view identifier can contain an optional qualifier, for example, + /// <view-id>:$SAVED, which is either an actual version + /// number or an Amazon Connect managed qualifier $SAVED | + /// $LATEST. If it is not supplied, then $LATEST is + /// assumed for customer managed views and an error is returned if there is no + /// published content available. Version 1 is assumed for Amazon Web Services + /// managed views. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The ViewId of the view. This must be an ARN for Amazon Web Services + /// managed views. + Future describeView({ + required String instanceId, + required String viewId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}', + exceptionFnMap: _exceptionFns, + ); + return DescribeViewResponse.fromJson(response); + } + /// Describes the specified vocabulary. /// /// May throw [InvalidRequestException]. @@ -3139,34 +4334,41 @@ class Connect { /// This API is in preview release for Amazon Connect and is subject to /// change. /// - /// Revokes access to integrated applications from Amazon Connect. + /// Removes the dataset ID associated with a given Amazon Connect instance. /// - /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [dataSetId] : + /// The identifier of the dataset to remove. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [origin] : - /// The domain URL of the integrated application. - Future disassociateApprovedOrigin({ + /// Parameter [targetAccountId] : + /// The identifier of the target account. Use to associate a dataset to a + /// different account than the one containing the Amazon Connect instance. If + /// not specified, by default this value is the Amazon Web Services account + /// that has the Amazon Connect instance. + Future disassociateAnalyticsDataSet({ + required String dataSetId, required String instanceId, - required String origin, + String? targetAccountId, }) async { - final $query = >{ - 'origin': [origin], + final $payload = { + 'DataSetId': dataSetId, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, }; await _protocol.send( - payload: null, - method: 'DELETE', + payload: $payload, + method: 'POST', requestUri: - '/instance/${Uri.encodeComponent(instanceId)}/approved-origin', - queryParams: $query, + '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/association', exceptionFnMap: _exceptionFns, ); } @@ -3174,12 +4376,12 @@ class Connect { /// This API is in preview release for Amazon Connect and is subject to /// change. /// - /// Revokes authorization from the specified instance to access the specified - /// Amazon Lex or Amazon Lex V2 bot. + /// Revokes access to integrated applications from Amazon Connect. /// /// May throw [ResourceNotFoundException]. /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. /// May throw [ThrottlingException]. /// /// Parameter [instanceId] : @@ -3187,10 +4389,45 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [lexV2Bot] : - /// The Amazon Lex V2 bot to disassociate from the instance. - Future disassociateBot({ - required String instanceId, + /// Parameter [origin] : + /// The domain URL of the integrated application. + Future disassociateApprovedOrigin({ + required String instanceId, + required String origin, + }) async { + final $query = >{ + 'origin': [origin], + }; + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/instance/${Uri.encodeComponent(instanceId)}/approved-origin', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Revokes authorization from the specified instance to access the specified + /// Amazon Lex or Amazon Lex V2 bot. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [lexV2Bot] : + /// The Amazon Lex V2 bot to disassociate from the instance. + Future disassociateBot({ + required String instanceId, LexBot? lexBot, LexV2Bot? lexV2Bot, }) async { @@ -3206,6 +4443,39 @@ class Connect { ); } + /// Disassociates a connect resource from a flow. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [resourceId] : + /// The identifier of the resource. + /// + /// Parameter [resourceType] : + /// A valid resource type. + Future disassociateFlow({ + required String instanceId, + required String resourceId, + required FlowAssociationResourceType resourceType, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/flow-associations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(resourceId)}/${Uri.encodeComponent(resourceType.toValue())}', + exceptionFnMap: _exceptionFns, + ); + } + /// This API is in preview release for Amazon Connect and is subject to /// change. /// @@ -3474,6 +4744,81 @@ class Connect { ); } + /// Disassociates an agent from a traffic distribution group. + /// + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceConflictException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [trafficDistributionGroupId] : + /// The identifier of the traffic distribution group. This can be the ID or + /// the ARN if the API is being called in the Region where the traffic + /// distribution group was created. The ARN must be provided if the call is + /// from the replicated Region. + /// + /// Parameter [userId] : + /// The identifier for the user. This can be the ID or the ARN of the user. + Future disassociateTrafficDistributionGroupUser({ + required String instanceId, + required String trafficDistributionGroupId, + required String userId, + }) async { + final $query = >{ + 'InstanceId': [instanceId], + 'UserId': [userId], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/traffic-distribution-group/${Uri.encodeComponent(trafficDistributionGroupId)}/user', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Disassociates a set of proficiencies from a user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [userId] : + /// The identifier of the user account. + /// + /// Parameter [userProficiencies] : + /// The proficiencies to disassociate from the user. + Future disassociateUserProficiencies({ + required String instanceId, + required String userId, + required List userProficiencies, + }) async { + final $payload = { + 'UserProficiencies': userProficiencies, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/disassociate-proficiencies', + exceptionFnMap: _exceptionFns, + ); + } + /// Dismisses contacts from an agent’s CCP and returns the agent to an /// available state, which allows the agent to receive a new routed contact. /// Contacts can only be dismissed if they are in a MISSED, @@ -3515,6 +4860,61 @@ class Connect { ); } + /// Provides a pre-signed URL for download of an approved attached file. This + /// API also returns metadata about the attached file. It will only return a + /// downloadURL if the status of the attached file is APPROVED. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [associatedResourceArn] : + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// + /// + /// Parameter [fileId] : + /// The unique identifier of the attached file resource. + /// + /// Parameter [instanceId] : + /// The unique identifier of the Connect instance. + /// + /// Parameter [urlExpiryInSeconds] : + /// Optional override for the expiry of the pre-signed S3 URL in seconds. The + /// default value is 300. + Future getAttachedFile({ + required String associatedResourceArn, + required String fileId, + required String instanceId, + int? urlExpiryInSeconds, + }) async { + _s.validateNumRange( + 'urlExpiryInSeconds', + urlExpiryInSeconds, + 5, + 300, + ); + final $query = >{ + 'associatedResourceArn': [associatedResourceArn], + if (urlExpiryInSeconds != null) + 'urlExpiryInSeconds': [urlExpiryInSeconds.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/attached-files/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(fileId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetAttachedFileResponse.fromJson(response); + } + /// Retrieves the contact attributes for the specified contact. /// /// May throw [InvalidRequestException]. @@ -3626,6 +5026,13 @@ class Connect { /// /// The actual OLDEST_CONTACT_AGE is 24 seconds. /// + /// When the filter RoutingStepExpression is used, this metric is + /// still calculated from enqueue time. For example, if a contact that has + /// been queued under <Expression 1> for 10 seconds has + /// expired and <Expression 2> becomes active, then + /// OLDEST_CONTACT_AGE for this queue will be counted starting + /// from 10, not 0. + /// /// Name in real-time metrics report: Oldest ///
    SLOTS_ACTIVE
    @@ -3654,12 +5061,20 @@ class Connect { ///
  • /// Channels: 3 (VOICE, CHAT, and TASK channels are supported.) ///
  • + ///
  • + /// RoutingStepExpressions: 50 + ///
  • /// /// Metric data is retrieved only for the resources associated with the queues /// or routing profiles, and by any channels included in the filter. (You /// cannot filter by both queue AND routing profile.) You can include both /// resource IDs and resource ARNs in the same request. /// + /// When using the RoutingStepExpression filter, you need to pass + /// exactly one QueueId. The filter is also case sensitive so + /// when using the RoutingStepExpression filter, grouping by + /// ROUTING_STEP_EXPRESSION is required. + /// /// Currently tagging is only supported on the resources that are passed in /// the filter. /// @@ -3688,6 +5103,10 @@ class Connect { /// If no Grouping is included in the request, a summary of /// metrics is returned. ///
  • + ///
  • + /// When using the RoutingStepExpression filter, group by + /// ROUTING_STEP_EXPRESSION is required. + ///
  • /// /// /// Parameter [maxResults] : @@ -3822,7 +5241,15 @@ class Connect { return GetCurrentUserDataResponse.fromJson(response); } - /// Retrieves a token for federation. + /// Supports SAML sign-in for Amazon Connect. Retrieves a token for + /// federation. The token is for the Amazon Connect user which corresponds to + /// the IAM credentials that were used to invoke this action. + /// + /// For more information about how SAML sign-in works in Amazon Connect, see + /// Configure SAML with IAM for Amazon Connect in the Amazon Connect + /// Administrator Guide. /// /// This API doesn't support root users. If you try to invoke /// GetFederationToken with root credentials, an error message similar to the @@ -3855,11 +5282,56 @@ class Connect { return GetFederationTokenResponse.fromJson(response); } + /// Retrieves the flow associated for a given resource. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [resourceId] : + /// The identifier of the resource. + /// + /// Parameter [resourceType] : + /// A valid resource type. + Future getFlowAssociation({ + required String instanceId, + required String resourceId, + required FlowAssociationResourceType resourceType, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/flow-associations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(resourceId)}/${Uri.encodeComponent(resourceType.toValue())}', + exceptionFnMap: _exceptionFns, + ); + return GetFlowAssociationResponse.fromJson(response); + } + /// Gets historical metric data from the specified Amazon Connect instance. /// /// For a description of each historical metric, see Historical /// Metrics Definitions in the Amazon Connect Administrator Guide. + /// + /// We recommend using the GetMetricDataV2 + /// API. It provides more flexibility, features, and the ability to query + /// longer time ranges than GetMetricData. Use it to retrieve + /// historical agent and contact metrics for the last 3 months, at varying + /// intervals. You can also use it to build custom dashboards to measure + /// historical queue and agent performance. For example, you can track the + /// number of incoming contacts for the last 7 days, with data split by day, + /// to see how contact volume changed per day of the week. + /// /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -3881,6 +5353,9 @@ class Connect { /// or channels included in the filter. You can include both queue IDs and /// queue ARNs in the same request. VOICE, CHAT, and TASK channels are /// supported. + /// + /// RoutingStepExpression is not a valid filter for GetMetricData and we + /// recommend switching to GetMetricDataV2 for more up-to-date features. /// /// To filter by Queues, enter the queue ID/ARN, not the name of /// the queue. @@ -4025,6 +5500,9 @@ class Connect { /// If no grouping is specified, a summary of metrics for all queues is /// returned. /// + /// RoutingStepExpression is not a valid filter for GetMetricData and we + /// recommend switching to GetMetricDataV2 for more up-to-date features. + /// /// Parameter [maxResults] : /// The maximum number of results to return per page. /// @@ -4073,16 +5551,12 @@ class Connect { /// the previous version of this API. It has new metrics, offers filtering at /// a metric level, and offers the ability to filter and group data by /// channels, queues, routing profiles, agents, and agent hierarchy levels. It - /// can retrieve historical data for the last 35 days, in 24-hour intervals. + /// can retrieve historical data for the last 3 months, at varying intervals. /// /// For a description of the historical metrics that are supported by /// GetMetricDataV2 and GetMetricData, see Historical - /// metrics definitions in the Amazon Connect Administrator's - /// Guide. - /// - /// This API is not available in the Amazon Web Services GovCloud (US) - /// Regions. + /// metrics definitions in the Amazon Connect Administrator Guide. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -4096,24 +5570,28 @@ class Connect { /// later than the start time timestamp. It cannot be later than the current /// timestamp. /// - /// The time range between the start and end time must be less than 24 hours. - /// /// Parameter [filters] : /// The filters to apply to returned metrics. You can filter on the following /// resources: /// ///
      ///
    • - /// Queues + /// Agents ///
    • ///
    • - /// Routing profiles + /// Channels ///
    • ///
    • - /// Agents + /// Feature ///
    • ///
    • - /// Channels + /// Queues + ///
    • + ///
    • + /// Routing profiles + ///
    • + ///
    • + /// Routing step expression ///
    • ///
    • /// User hierarchy groups @@ -4124,7 +5602,7 @@ class Connect { /// /// To filter by phone number, see Create - /// a historical metrics report in the Amazon Connect Administrator's + /// a historical metrics report in the Amazon Connect Administrator /// Guide. /// /// Note the following limits: @@ -4132,21 +5610,58 @@ class Connect { ///
        ///
      • /// Filter keys: A maximum of 5 filter keys are supported in a single - /// request. Valid filter keys: QUEUE | - /// ROUTING_PROFILE | AGENT | CHANNEL | + /// request. Valid filter keys: AGENT | /// AGENT_HIERARCHY_LEVEL_ONE | /// AGENT_HIERARCHY_LEVEL_TWO | /// AGENT_HIERARCHY_LEVEL_THREE | /// AGENT_HIERARCHY_LEVEL_FOUR | - /// AGENT_HIERARCHY_LEVEL_FIVE + /// AGENT_HIERARCHY_LEVEL_FIVE | CASE_TEMPLATE_ARN | + /// CASE_STATUS | CHANNEL | + /// contact/segmentAttributes/connect:Subtype | + /// FEATURE | FLOW_TYPE | + /// FLOWS_NEXT_RESOURCE_ID | + /// FLOWS_NEXT_RESOURCE_QUEUE_ID | + /// FLOWS_OUTCOME_TYPE | FLOWS_RESOURCE_ID | + /// INITIATION_METHOD | RESOURCE_PUBLISHED_TIMESTAMP + /// | ROUTING_PROFILE | ROUTING_STEP_EXPRESSION | + /// QUEUE | Q_CONNECT_ENABLED | ///
      • ///
      • /// Filter values: A maximum of 100 filter values are supported in a - /// single request. For example, a GetMetricDataV2 request can - /// filter by 50 queues, 35 agents, and 15 routing profiles for a total of 100 - /// filter values. VOICE, CHAT, and - /// TASK are valid filterValue for the - /// CHANNEL filter key. + /// single request. VOICE, CHAT, and TASK are valid filterValue + /// for the CHANNEL filter key. They do not count towards limitation of 100 + /// filter values. For example, a GetMetricDataV2 request can filter by 50 + /// queues, 35 agents, and 15 routing profiles for a total of 100 filter + /// values, along with 3 channel filters. + /// + /// contact_lens_conversational_analytics is a valid filterValue + /// for the FEATURE filter key. It is available only to contacts + /// analyzed by Contact Lens conversational analytics. + /// + /// connect:Chat, connect:SMS, + /// connect:Telephony, and connect:WebRTC are valid + /// filterValue examples (not exhaustive) for the + /// contact/segmentAttributes/connect:Subtype filter key. + /// + /// ROUTING_STEP_EXPRESSION is a valid filter key with a filter + /// value up to 3000 length. This filter is case and order sensitive. JSON + /// string fields must be sorted in ascending order and JSON array order + /// should be kept as is. + /// + /// Q_CONNECT_ENABLED. TRUE and FALSE are the only valid + /// filterValues for the Q_CONNECT_ENABLED filter key. + /// + ///
          + ///
        • + /// TRUE includes all contacts that had Amazon Q in Connect enabled as part of + /// the flow. + ///
        • + ///
        • + /// FALSE includes all contacts that did not have Amazon Q in Connect enabled + /// as part of the flow + ///
        • + ///
        + /// This filter is available only for contact record-driven metrics. ///
      • ///
      /// @@ -4155,9 +5670,18 @@ class Connect { /// metric. The following historical metrics are available. For a description /// of each metric, see Historical - /// metrics definitions in the Amazon Connect Administrator's - /// Guide. - ///
      AGENT_ADHERENT_TIME
      + /// metrics definitions in the Amazon Connect Administrator Guide. + ///
      ABANDONMENT_RATE
      + /// Unit: Percent + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Abandonment + /// rate + ///
      AGENT_ADHERENT_TIME
      /// This metric is available only in Amazon Web Services Regions where Forecasting, /// capacity planning, and scheduling is available. @@ -4166,15 +5690,56 @@ class Connect { /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent /// Hierarchy + /// + /// UI name: Adherent + /// time + ///
      AGENT_ANSWER_RATE
      + /// Unit: Percent + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Agent + /// answer rate + ///
      AGENT_NON_ADHERENT_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Non-adherent + /// time ///
      AGENT_NON_RESPONSE
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent /// Hierarchy + /// + /// UI name: Agent + /// non-response + ///
      AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// Data for this metric is available starting from October 1, 2023 0:00:00 + /// GMT. + /// + /// UI name: Agent + /// non-response without customer abandons ///
      AGENT_OCCUPANCY
      /// Unit: Percentage /// /// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy + /// + /// UI name: Occupancy ///
      AGENT_SCHEDULE_ADHERENCE
      /// This metric is available only in Amazon Web Services Regions where Forecasting, @@ -4184,6 +5749,9 @@ class Connect { /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent /// Hierarchy + /// + /// UI name: Adherence ///
      AGENT_SCHEDULED_TIME
      /// This metric is available only in Amazon Web Services Regions where Forecasting, @@ -4193,17 +5761,44 @@ class Connect { /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent /// Hierarchy + /// + /// UI name: Scheduled + /// time ///
      AVG_ABANDON_TIME
      /// Unit: Seconds /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// queue abandon time + ///
      AVG_ACTIVE_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: Average + /// active time ///
      AVG_AFTER_CONTACT_WORK_TIME
      /// Unit: Seconds /// + /// Valid metric filter key: INITIATION_METHOD + /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      AVG_AGENT_CONNECTING_TIME
      + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// after contact work time + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_AGENT_CONNECTING_TIME
      /// Unit: Seconds /// /// Valid metric filter key: INITIATION_METHOD. For now, this @@ -4213,218 +5808,945 @@ class Connect { /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent /// Hierarchy - ///
      AVG_HANDLE_TIME
      - /// Unit: Seconds + /// + /// UI name: Average + /// agent API connecting time + /// + /// The Negate key in Metric Level Filters is not applicable for + /// this metric. + ///
      AVG_AGENT_PAUSE_TIME
      + /// Unit: Seconds /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      AVG_HOLD_TIME
      + /// Hierarchy, Q in Connect + /// + /// UI name: Average + /// agent pause time + ///
      AVG_CASE_RELATED_CONTACTS
      + /// Unit: Count + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Average + /// contacts per case + ///
      AVG_CASE_RESOLUTION_TIME
      + /// Unit: Seconds + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Average + /// case resolution time + ///
      AVG_CONTACT_DURATION
      /// Unit: Seconds /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      AVG_INTERACTION_AND_HOLD_TIME
      + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// contact duration + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_CONVERSATION_DURATION
      /// Unit: Seconds /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// conversation duration + ///
      AVG_FLOW_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows next resource ID, Flows next resource queue ID, Flows + /// outcome type, Flows resource ID, Initiation method, Resource published + /// timestamp + /// + /// UI name: Average + /// flow time + ///
      AVG_GREETING_TIME_AGENT
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent greeting time + ///
      AVG_HANDLE_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, + /// RoutingStepExpression + /// + /// UI name: Average + /// handle time + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_HOLD_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// customer hold time + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_HOLD_TIME_ALL_CONTACTS
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// customer hold time all contacts + ///
      AVG_HOLDS
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Average + /// holds + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_INTERACTION_AND_HOLD_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent interaction and customer hold time ///
      AVG_INTERACTION_TIME
      /// Unit: Seconds /// - /// Valid groupings and filters: Queue, Channel, Routing Profile + /// Valid metric filter key: INITIATION_METHOD + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Feature, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent interaction time + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_INTERRUPTIONS_AGENT
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent interruptions + ///
      AVG_INTERRUPTION_TIME_AGENT
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent interruption time + ///
      AVG_NON_TALK_TIME
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// non-talk time ///
      AVG_QUEUE_ANSWER_TIME
      /// Unit: Seconds /// - /// Valid groupings and filters: Queue, Channel, Routing Profile + /// Valid groupings and filters: Queue, Channel, Routing Profile, Feature, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// queue answer time + /// + /// Feature is a valid filter but not a valid grouping. + ///
      AVG_RESOLUTION_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// resolution time + ///
      AVG_TALK_TIME
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// talk time + ///
      AVG_TALK_TIME_AGENT
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// agent talk time + ///
      AVG_TALK_TIME_CUSTOMER
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Average + /// customer talk time + ///
      CASES_CREATED
      + /// Unit: Count + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Cases + /// created ///
      CONTACTS_ABANDONED
      /// Unit: Count /// + /// Metric filter: + /// + ///
        + ///
      • + /// Valid values: API| Incoming | + /// Outbound | Transfer | Callback | + /// Queue_Transfer| Disconnect + ///
      • + ///
      /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy + /// Hierarchy, contact/segmentAttributes/connect:Subtype, + /// RoutingStepExpression, Q in Connect + /// + /// UI name: Contact + /// abandoned + ///
      CONTACTS_ABANDONED_IN_X
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// Threshold: For ThresholdValue, enter any whole number from 1 + /// to 604800 (inclusive), in seconds. For Comparison, you must + /// enter LT (for "Less than"). + /// + /// UI name: Contacts + /// abandoned in X seconds + ///
      CONTACTS_ANSWERED_IN_X
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// Threshold: For ThresholdValue, enter any whole number from 1 + /// to 604800 (inclusive), in seconds. For Comparison, you must + /// enter LT (for "Less than"). + /// + /// UI name: Contacts + /// answered in X seconds ///
      CONTACTS_CREATED
      /// Unit: Count /// /// Valid metric filter key: INITIATION_METHOD /// - /// Valid groupings and filters: Queue, Channel, Routing Profile - ///
      CONTACTS_HANDLED
      + /// Valid groupings and filters: Queue, Channel, Routing Profile, Feature, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Contacts + /// created + /// + /// Feature is a valid filter but not a valid grouping. + ///
      CONTACTS_HANDLED
      /// Unit: Count /// /// Valid metric filter key: INITIATION_METHOD, /// DISCONNECT_REASON /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, + /// RoutingStepExpression, Q in Connect + /// + /// UI name: API + /// contacts handled + /// + /// Feature is a valid filter but not a valid grouping. + ///
      CONTACTS_HANDLED_BY_CONNECTED_TO_AGENT
      + /// Unit: Count + /// + /// Valid metric filter key: INITIATION_METHOD + /// + /// Valid groupings and filters: Queue, Channel, Agent, Agent Hierarchy, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Contacts + /// handled (connected to agent timestamp) ///
      CONTACTS_HOLD_ABANDONS
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      CONTACTS_QUEUED
      + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Contacts + /// hold disconnect + ///
      CONTACTS_ON_HOLD_AGENT_DISCONNECT
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      CONTACTS_TRANSFERRED_OUT
      + /// Hierarchy, Q in Connect + /// + /// UI name: Contacts + /// hold agent disconnect + ///
      CONTACTS_ON_HOLD_CUSTOMER_DISCONNECT
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      CONTACTS_TRANSFERRED_OUT_BY_AGENT
      + /// Hierarchy, Q in Connect + /// + /// UI name: Contacts + /// hold customer disconnect + ///
      CONTACTS_PUT_ON_HOLD
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      CONTACTS_TRANSFERRED_OUT_FROM_QUEUE
      + /// Hierarchy, Q in Connect + /// + /// UI name: Contacts + /// put on hold + ///
      CONTACTS_TRANSFERRED_OUT_EXTERNAL
      /// Unit: Count /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      MAX_QUEUED_TIME
      - /// Unit: Seconds + /// Hierarchy, Q in Connect + /// + /// UI name: Contacts + /// transferred out external + ///
      CONTACTS_TRANSFERRED_OUT_INTERNAL
      + /// Unit: Percent /// /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent - /// Hierarchy - ///
      SERVICE_LEVEL
      - /// You can include up to 20 SERVICE_LEVEL metrics in a request. + /// Hierarchy, Q in Connect /// - /// Unit: Percent + /// UI name: Contacts + /// transferred out internal + ///
      CONTACTS_QUEUED
      + /// Unit: Count /// - /// Valid groupings and filters: Queue, Channel, Routing Profile + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect /// - /// Threshold: For ThresholdValue, enter any whole number from 1 - /// to 604800 (inclusive), in seconds. For Comparison, you must - /// enter LT (for "Less than"). - ///
      SUM_CONTACTS_ANSWERED_IN_X
      + /// UI name: Contacts + /// queued + ///
      CONTACTS_QUEUED_BY_ENQUEUE
      /// Unit: Count /// - /// Valid groupings and filters: Queue, Channel, Routing Profile + /// Valid groupings and filters: Queue, Channel, Agent, Agent Hierarchy, + /// contact/segmentAttributes/connect:Subtype /// - /// Threshold: For ThresholdValue, enter any whole number from 1 - /// to 604800 (inclusive), in seconds. For Comparison, you must - /// enter LT (for "Less than"). - ///
      SUM_CONTACTS_ABANDONED_IN_X
      + /// UI name: Contacts + /// queued (enqueue timestamp) + ///
      CONTACTS_RESOLVED_IN_X
      /// Unit: Count /// - /// Valid groupings and filters: Queue, Channel, Routing Profile + /// Valid groupings and filters: Queue, Channel, Routing Profile, + /// contact/segmentAttributes/connect:Subtype, Q in Connect /// - /// Threshold: For ThresholdValue, enter any whole number from 1 + /// Threshold: For ThresholdValue enter any whole number from 1 /// to 604800 (inclusive), in seconds. For Comparison, you must /// enter LT (for "Less than"). - ///
      SUM_CONTACTS_DISCONNECTED
      - /// Valid metric filter key: DISCONNECT_REASON /// + /// UI name: Contacts + /// resolved in X + ///
      CONTACTS_TRANSFERRED_OUT
      /// Unit: Count /// - /// Valid groupings and filters: Queue, Channel, Routing Profile - ///
      SUM_RETRY_CALLBACK_ATTEMPTS
      + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Feature, contact/segmentAttributes/connect:Subtype, Q in + /// Connect + /// + /// UI name: Contacts + /// transferred out + /// + /// Feature is a valid filter but not a valid grouping. + ///
      CONTACTS_TRANSFERRED_OUT_BY_AGENT
      /// Unit: Count /// - /// Valid groupings and filters: Queue, Channel, Routing Profile - ///
      + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource. This includes the - /// instanceId an Amazon Connect instance. + /// UI name: Contacts + /// transferred out by agent + ///
      CONTACTS_TRANSFERRED_OUT_FROM_QUEUE
      + /// Unit: Count /// - /// Parameter [startTime] : - /// The timestamp, in UNIX Epoch time format, at which to start the reporting - /// interval for the retrieval of historical metrics data. The time must be - /// before the end time timestamp. The time range between the start and end - /// time must be less than 24 hours. The start time cannot be earlier than 35 - /// days before the time of the request. Historical metrics are available for - /// 35 days. + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect /// - /// Parameter [groupings] : - /// The grouping applied to the metrics that are returned. For example, when - /// results are grouped by queue, the metrics returned are grouped by queue. - /// The values that are returned apply to the metrics for each queue. They are - /// not aggregated for all queues. + /// UI name: Contacts + /// transferred out queue + ///
      CURRENT_CASES
      + /// Unit: Count /// - /// If no grouping is specified, a summary of all metrics is returned. + /// Required filter key: CASE_TEMPLATE_ARN /// - /// Valid grouping keys: QUEUE | ROUTING_PROFILE | - /// AGENT | CHANNEL | - /// AGENT_HIERARCHY_LEVEL_ONE | - /// AGENT_HIERARCHY_LEVEL_TWO | - /// AGENT_HIERARCHY_LEVEL_THREE | - /// AGENT_HIERARCHY_LEVEL_FOUR | - /// AGENT_HIERARCHY_LEVEL_FIVE + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS /// - /// Parameter [maxResults] : - /// The maximum number of results to return per page. + /// UI name: Current + /// cases + ///
      FLOWS_OUTCOME
      + /// Unit: Count /// - /// Parameter [nextToken] : - /// The token for the next set of results. Use the value returned in the - /// previous response in the next request to retrieve the next set of results. - Future getMetricDataV2({ - required DateTime endTime, - required List filters, - required List metrics, - required String resourceArn, - required DateTime startTime, - List? groupings, - int? maxResults, - String? nextToken, - }) async { - _s.validateNumRange( - 'maxResults', - maxResults, - 1, - 100, - ); - final $payload = { - 'EndTime': unixTimestampToJson(endTime), - 'Filters': filters, - 'Metrics': metrics, - 'ResourceArn': resourceArn, - 'StartTime': unixTimestampToJson(startTime), - if (groupings != null) 'Groupings': groupings, - if (maxResults != null) 'MaxResults': maxResults, - if (nextToken != null) 'NextToken': nextToken, - }; - final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/metrics/data', - exceptionFnMap: _exceptionFns, - ); - return GetMetricDataV2Response.fromJson(response); - } - - /// Gets the prompt file. + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows next resource ID, Flows next resource queue ID, Flows + /// outcome type, Flows resource ID, Initiation method, Resource published + /// timestamp /// - /// May throw [InvalidParameterException]. - /// May throw [InvalidRequestException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. + /// UI name: Flows + /// outcome + ///
      FLOWS_STARTED
      + /// Unit: Count /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows resource ID, Initiation method, Resource published + /// timestamp /// - /// Parameter [promptId] : - /// A unique identifier for the prompt. - Future getPromptFile({ - required String instanceId, - required String promptId, - }) async { - final response = await _protocol.send( - payload: null, - method: 'GET', - requestUri: - '/prompts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(promptId)}/file', - exceptionFnMap: _exceptionFns, - ); - return GetPromptFileResponse.fromJson(response); - } - - /// Gets details about a specific task template in the specified Amazon - /// Connect instance. + /// UI name: Flows + /// started + ///
      MAX_FLOW_TIME
      + /// Unit: Seconds /// - /// May throw [InvalidRequestException]. + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows next resource ID, Flows next resource queue ID, Flows + /// outcome type, Flows resource ID, Initiation method, Resource published + /// timestamp + /// + /// UI name: Maximum + /// flow time + ///
      MAX_QUEUED_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Maximum + /// queued time + ///
      MIN_FLOW_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows next resource ID, Flows next resource queue ID, Flows + /// outcome type, Flows resource ID, Initiation method, Resource published + /// timestamp + /// + /// UI name: Minimum + /// flow time + ///
      PERCENT_CASES_FIRST_CONTACT_RESOLVED
      + /// Unit: Percent + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Cases + /// resolved on first contact + ///
      PERCENT_CONTACTS_STEP_EXPIRED
      + /// Unit: Percent + /// + /// Valid groupings and filters: Queue, RoutingStepExpression + /// + /// UI name: Not available + ///
      PERCENT_CONTACTS_STEP_JOINED
      + /// Unit: Percent + /// + /// Valid groupings and filters: Queue, RoutingStepExpression + /// + /// UI name: Not available + ///
      PERCENT_FLOWS_OUTCOME
      + /// Unit: Percent + /// + /// Valid metric filter key: FLOWS_OUTCOME_TYPE + /// + /// Valid groupings and filters: Channel, + /// contact/segmentAttributes/connect:Subtype, Flow type, Flows module + /// resource ID, Flows next resource ID, Flows next resource queue ID, Flows + /// outcome type, Flows resource ID, Initiation method, Resource published + /// timestamp + /// + /// UI name: Flows + /// outcome percentage. + /// + /// The FLOWS_OUTCOME_TYPE is not a valid grouping. + ///
      PERCENT_NON_TALK_TIME
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Percentage + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Non-talk + /// time percent + ///
      PERCENT_TALK_TIME
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Percentage + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Talk + /// time percent + ///
      PERCENT_TALK_TIME_AGENT
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Percentage + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Agent + /// talk time percent + ///
      PERCENT_TALK_TIME_CUSTOMER
      + /// This metric is available only for contacts analyzed by Contact Lens + /// conversational analytics. + /// + /// Unit: Percentage + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Customer + /// talk time percent + ///
      REOPENED_CASE_ACTIONS
      + /// Unit: Count + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Cases + /// reopened + ///
      RESOLVED_CASE_ACTIONS
      + /// Unit: Count + /// + /// Required filter key: CASE_TEMPLATE_ARN + /// + /// Valid groupings and filters: CASE_TEMPLATE_ARN, CASE_STATUS + /// + /// UI name: Cases + /// resolved + ///
      SERVICE_LEVEL
      + /// You can include up to 20 SERVICE_LEVEL metrics in a request. + /// + /// Unit: Percent + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Q in Connect + /// + /// Threshold: For ThresholdValue, enter any whole number from 1 + /// to 604800 (inclusive), in seconds. For Comparison, you must + /// enter LT (for "Less than"). + /// + /// UI name: Service + /// level X + ///
      STEP_CONTACTS_QUEUED
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, RoutingStepExpression + /// + /// UI name: Not available + ///
      SUM_AFTER_CONTACT_WORK_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: After + /// contact work time + ///
      SUM_CONNECTING_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid metric filter key: INITIATION_METHOD. This metric only + /// supports the following filter keys as INITIATION_METHOD: + /// INBOUND | OUTBOUND | CALLBACK | + /// API + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Agent + /// API connecting time + /// + /// The Negate key in Metric Level Filters is not applicable for + /// this metric. + ///
      SUM_CONTACT_FLOW_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: Contact + /// flow time + ///
      SUM_CONTACT_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Agent + /// on contact time + ///
      SUM_CONTACTS_DISCONNECTED
      + /// Valid metric filter key: DISCONNECT_REASON + /// + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Contact + /// disconnected + ///
      SUM_ERROR_STATUS_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Error + /// status time + ///
      SUM_HANDLE_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: Contact + /// handle time + ///
      SUM_HOLD_TIME
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: Customer + /// hold time + ///
      SUM_IDLE_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy + /// + /// UI name: Agent + /// idle time + ///
      SUM_INTERACTION_AND_HOLD_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy, Q in Connect + /// + /// UI name: Agent + /// interaction and hold time + ///
      SUM_INTERACTION_TIME
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, Agent, Agent + /// Hierarchy + /// + /// UI name: Agent + /// interaction time + ///
      SUM_NON_PRODUCTIVE_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy + /// + /// UI name: Non-Productive + /// Time + ///
      SUM_ONLINE_TIME_AGENT
      + /// Unit: Seconds + /// + /// Valid groupings and filters: Routing Profile, Agent, Agent Hierarchy + /// + /// UI name: Online + /// time + ///
      SUM_RETRY_CALLBACK_ATTEMPTS
      + /// Unit: Count + /// + /// Valid groupings and filters: Queue, Channel, Routing Profile, + /// contact/segmentAttributes/connect:Subtype, Q in Connect + /// + /// UI name: Callback + /// attempts + ///
      + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource. This includes the + /// instanceId an Amazon Connect instance. + /// + /// Parameter [startTime] : + /// The timestamp, in UNIX Epoch time format, at which to start the reporting + /// interval for the retrieval of historical metrics data. The time must be + /// before the end time timestamp. The start and end time depends on the + /// IntervalPeriod selected. By default the time range between + /// start and end time is 35 days. Historical metrics are available for 3 + /// months. + /// + /// Parameter [groupings] : + /// The grouping applied to the metrics that are returned. For example, when + /// results are grouped by queue, the metrics returned are grouped by queue. + /// The values that are returned apply to the metrics for each queue. They are + /// not aggregated for all queues. + /// + /// If no grouping is specified, a summary of all metrics is returned. + /// + /// Valid grouping keys: AGENT | + /// AGENT_HIERARCHY_LEVEL_ONE | + /// AGENT_HIERARCHY_LEVEL_TWO | + /// AGENT_HIERARCHY_LEVEL_THREE | + /// AGENT_HIERARCHY_LEVEL_FOUR | + /// AGENT_HIERARCHY_LEVEL_FIVE | CASE_TEMPLATE_ARN | + /// CASE_STATUS | CHANNEL | + /// contact/segmentAttributes/connect:Subtype | + /// FLOWS_RESOURCE_ID | FLOWS_MODULE_RESOURCE_ID | + /// FLOW_TYPE | FLOWS_OUTCOME_TYPE | + /// INITIATION_METHOD | Q_CONNECT_ENABLED | + /// QUEUE | RESOURCE_PUBLISHED_TIMESTAMP | + /// ROUTING_PROFILE | ROUTING_STEP_EXPRESSION + /// + /// Parameter [interval] : + /// The interval period and timezone to apply to returned metrics. + /// + ///
        + ///
      • + /// IntervalPeriod: An aggregated grouping applied to request + /// metrics. Valid IntervalPeriod values are: + /// FIFTEEN_MIN | THIRTY_MIN | HOUR | + /// DAY | WEEK | TOTAL. + /// + /// For example, if IntervalPeriod is selected + /// THIRTY_MIN, StartTime and EndTime + /// differs by 1 day, then Amazon Connect returns 48 results in the response. + /// Each result is aggregated by the THIRTY_MIN period. By default Amazon + /// Connect aggregates results based on the TOTAL interval + /// period. + /// + /// The following list describes restrictions on StartTime and + /// EndTime based on which IntervalPeriod is + /// requested. + /// + ///
          + ///
        • + /// FIFTEEN_MIN: The difference between StartTime + /// and EndTime must be less than 3 days. + ///
        • + ///
        • + /// THIRTY_MIN: The difference between StartTime and + /// EndTime must be less than 3 days. + ///
        • + ///
        • + /// HOUR: The difference between StartTime and + /// EndTime must be less than 3 days. + ///
        • + ///
        • + /// DAY: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
        • + ///
        • + /// WEEK: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
        • + ///
        • + /// TOTAL: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
        • + ///
      • + ///
      • + /// TimeZone: The timezone applied to requested metrics. + ///
      • + ///
      + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future getMetricDataV2({ + required DateTime endTime, + required List filters, + required List metrics, + required String resourceArn, + required DateTime startTime, + List? groupings, + IntervalDetails? interval, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + 'EndTime': unixTimestampToJson(endTime), + 'Filters': filters, + 'Metrics': metrics, + 'ResourceArn': resourceArn, + 'StartTime': unixTimestampToJson(startTime), + if (groupings != null) 'Groupings': groupings, + if (interval != null) 'Interval': interval, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/metrics/data', + exceptionFnMap: _exceptionFns, + ); + return GetMetricDataV2Response.fromJson(response); + } + + /// Gets the prompt file. + /// + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [promptId] : + /// A unique identifier for the prompt. + Future getPromptFile({ + required String instanceId, + required String promptId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/prompts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(promptId)}/file', + exceptionFnMap: _exceptionFns, + ); + return GetPromptFileResponse.fromJson(response); + } + + /// Gets details about a specific task template in the specified Amazon + /// Connect instance. + /// + /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. @@ -4470,7 +6792,10 @@ class Connect { /// May throw [ThrottlingException]. /// /// Parameter [id] : - /// The identifier of the traffic distribution group. + /// The identifier of the traffic distribution group. This can be the ID or + /// the ARN if the API is being called in the Region where the traffic + /// distribution group was created. The ARN must be provided if the call is + /// from the replicated Region. Future getTrafficDistribution({ required String id, }) async { @@ -4483,8 +6808,67 @@ class Connect { return GetTrafficDistributionResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. + /// Imports a claimed phone number from an external service, such as Amazon + /// Pinpoint, into an Amazon Connect instance. You can call this API only in + /// the same Amazon Web Services Region where the Amazon Connect instance was + /// created. + /// + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// May throw [IdempotencyException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [sourcePhoneNumberArn] : + /// The claimed phone number ARN being imported from the external service, + /// such as Amazon Pinpoint. If it is from Amazon Pinpoint, it looks like the + /// ARN of the phone number to import from Amazon Pinpoint. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [phoneNumberDescription] : + /// The description of the phone number. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future importPhoneNumber({ + required String instanceId, + required String sourcePhoneNumberArn, + String? clientToken, + String? phoneNumberDescription, + Map? tags, + }) async { + final $payload = { + 'InstanceId': instanceId, + 'SourcePhoneNumberArn': sourcePhoneNumberArn, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (phoneNumberDescription != null) + 'PhoneNumberDescription': phoneNumberDescription, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/phone-number/import', + exceptionFnMap: _exceptionFns, + ); + return ImportPhoneNumberResponse.fromJson(response); + } + + /// This API is in preview release for Amazon Connect and is subject to + /// change. /// /// Lists agent statuses. /// @@ -4536,6 +6920,60 @@ class Connect { return ListAgentStatusResponse.fromJson(response); } + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Lists the association status of requested dataset ID for a given Amazon + /// Connect instance. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [dataSetId] : + /// The identifier of the dataset to get the association status. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listAnalyticsDataAssociations({ + required String instanceId, + String? dataSetId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (dataSetId != null) 'DataSetId': [dataSetId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/association', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAnalyticsDataAssociationsResponse.fromJson(response); + } + /// This API is in preview release for Amazon Connect and is subject to /// change. /// @@ -4796,7 +7234,9 @@ class Connect { /// change. /// /// For the specified referenceTypes, returns a list of - /// references associated with the contact. + /// references associated with the contact. References are links to + /// documents that are related to a contact, such as emails, attachments, or + /// URLs. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -4986,6 +7426,57 @@ class Connect { return ListEvaluationFormsResponse.fromJson(response); } + /// List the flow association based on the filters. + /// + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + /// + /// Parameter [resourceType] : + /// A valid resource type. + Future listFlowAssociations({ + required String instanceId, + int? maxResults, + String? nextToken, + ListFlowAssociationResourceType? resourceType, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (resourceType != null) 'ResourceType': [resourceType.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/flow-associations-summary/${Uri.encodeComponent(instanceId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFlowAssociationsResponse.fromJson(response); + } + /// Provides information about the hours of operation for the specified Amazon /// Connect instance. /// @@ -5193,6 +7684,9 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// + /// Parameter [integrationArn] : + /// The Amazon Resource Name (ARN) of the integration. + /// /// Parameter [integrationType] : /// The integration type. /// @@ -5204,6 +7698,7 @@ class Connect { /// previous response in the next request to retrieve the next set of results. Future listIntegrationAssociations({ required String instanceId, + String? integrationArn, IntegrationType? integrationType, int? maxResults, String? nextToken, @@ -5215,6 +7710,7 @@ class Connect { 100, ); final $query = >{ + if (integrationArn != null) 'integrationArn': [integrationArn], if (integrationType != null) 'integrationType': [integrationType.toValue()], if (maxResults != null) 'maxResults': [maxResults.toString()], @@ -5340,6 +7836,16 @@ class Connect { /// Up Phone Numbers for Your Contact Center in the Amazon Connect /// Administrator Guide. /// + ///
        + ///
      • + /// We recommend using ListPhoneNumbersV2 + /// to return phone number types. ListPhoneNumbers doesn't support number + /// types UIFN, SHARED, THIRD_PARTY_TF, + /// and THIRD_PARTY_DID. While it returns numbers of those types, + /// it incorrectly lists them as TOLL_FREE or DID. + ///
      • + ///
      • /// The phone number Arn value that is returned from each of the /// items in the PhoneNumberSummaryList @@ -5348,7 +7854,8 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html">ListPhoneNumbersV2 /// API. It returns the new phone number ARN that can be used to tag phone /// number resources. - /// + ///
      • + ///
      /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -5374,6 +7881,14 @@ class Connect { /// /// Parameter [phoneNumberTypes] : /// The type of phone number. + /// + /// We recommend using ListPhoneNumbersV2 + /// to return phone number types. While ListPhoneNumbers returns number types + /// UIFN, SHARED, THIRD_PARTY_TF, and + /// THIRD_PARTY_DID, it incorrectly lists them as + /// TOLL_FREE or DID. + /// Future listPhoneNumbers({ required String instanceId, int? maxResults, @@ -5415,6 +7930,18 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-center-phone-number.html">Set /// Up Phone Numbers for Your Contact Center in the Amazon Connect /// Administrator Guide. + /// + ///
        + ///
      • + /// When given an instance ARN, ListPhoneNumbersV2 returns only + /// the phone numbers claimed to the instance. + ///
      • + ///
      • + /// When given a traffic distribution group ARN + /// ListPhoneNumbersV2 returns only the phone numbers claimed to + /// the traffic distribution group. + ///
      • + ///
      /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -5422,6 +7949,15 @@ class Connect { /// May throw [InternalServiceException]. /// May throw [AccessDeniedException]. /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance that phone numbers are + /// claimed to. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. If + /// both TargetArn and InstanceId are not provided, + /// this API lists numbers claimed to all the Amazon Connect instances + /// belonging to your account in the same AWS Region as the request. + /// /// Parameter [maxResults] : /// The maximum number of results to return per page. /// @@ -5441,11 +7977,13 @@ class Connect { /// /// Parameter [targetArn] : /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. If - /// TargetArn input is not provided, this API lists numbers - /// claimed to all the Amazon Connect instances belonging to your account in - /// the same Amazon Web Services Region as the request. + /// distribution groups that phone number inbound traffic is routed through. + /// If both TargetArn and InstanceId input are not + /// provided, this API lists numbers claimed to all the Amazon Connect + /// instances belonging to your account in the same Amazon Web Services Region + /// as the request. Future listPhoneNumbersV2({ + String? instanceId, int? maxResults, String? nextToken, List? phoneNumberCountryCodes, @@ -5460,6 +7998,7 @@ class Connect { 1000, ); final $payload = { + if (instanceId != null) 'InstanceId': instanceId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, if (phoneNumberCountryCodes != null) @@ -5479,6 +8018,49 @@ class Connect { return ListPhoneNumbersV2Response.fromJson(response); } + /// Lists predefined attributes for the specified Amazon Connect instance. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listPredefinedAttributes({ + required String instanceId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/predefined-attributes/${Uri.encodeComponent(instanceId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListPredefinedAttributesResponse.fromJson(response); + } + /// Provides information about the prompts for the specified Amazon Connect /// instance. /// @@ -5660,9 +8242,9 @@ class Connect { /// previous response in the next request to retrieve the next set of results. /// /// Parameter [quickConnectTypes] : - /// The type of quick connect. In the Amazon Connect console, when you create - /// a quick connect, you are prompted to assign one of the following types: - /// Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE). + /// The type of quick connect. In the Amazon Connect admin website, when you + /// create a quick connect, you are prompted to assign one of the following + /// types: Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE). Future listQuickConnects({ required String instanceId, int? maxResults, @@ -5691,6 +8273,69 @@ class Connect { return ListQuickConnectsResponse.fromJson(response); } + /// Provides a list of analysis segments for a real-time analysis session. + /// + /// May throw [OutputTypeNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [outputType] : + /// The Contact Lens output type to be returned. + /// + /// Parameter [segmentTypes] : + /// Enum with segment types . Each value corresponds to a segment type + /// returned in the segments list of the API. Each segment type has its own + /// structure. Different channels may have different sets of supported segment + /// types. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future + listRealtimeContactAnalysisSegmentsV2({ + required String contactId, + required String instanceId, + required RealTimeContactAnalysisOutputType outputType, + required List segmentTypes, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + 'OutputType': outputType.toValue(), + 'SegmentTypes': segmentTypes.map((e) => e.toValue()).toList(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/contact/list-real-time-analysis-segments-v2/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', + exceptionFnMap: _exceptionFns, + ); + return ListRealtimeContactAnalysisSegmentsV2Response.fromJson(response); + } + /// Lists the queues associated with a routing profile. /// /// May throw [InvalidRequestException]. @@ -5897,10 +8542,7 @@ class Connect { return ListSecurityKeysResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Lists the permissions granted to a security profile. + /// Returns a list of third-party applications in a specific security profile. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -5922,8 +8564,8 @@ class Connect { /// Parameter [nextToken] : /// The token for the next set of results. Use the value returned in the /// previous response in the next request to retrieve the next set of results. - Future - listSecurityProfilePermissions({ + Future + listSecurityProfileApplications({ required String instanceId, required String securityProfileId, int? maxResults, @@ -5943,15 +8585,65 @@ class Connect { payload: null, method: 'GET', requestUri: - '/security-profiles-permissions/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(securityProfileId)}', + '/security-profiles-applications/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(securityProfileId)}', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListSecurityProfilePermissionsResponse.fromJson(response); + return ListSecurityProfileApplicationsResponse.fromJson(response); } - /// Provides summary information about the security profiles for the specified - /// Amazon Connect instance. + /// Lists the permissions granted to a security profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [securityProfileId] : + /// The identifier for the security profle. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future + listSecurityProfilePermissions({ + required String instanceId, + required String securityProfileId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/security-profiles-permissions/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(securityProfileId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSecurityProfilePermissionsResponse.fromJson(response); + } + + /// Provides summary information about the security profiles for the specified + /// Amazon Connect instance. /// /// For more information about security profiles, see Security @@ -6096,6 +8788,53 @@ class Connect { return ListTaskTemplatesResponse.fromJson(response); } + /// Lists traffic distribution group users. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [trafficDistributionGroupId] : + /// The identifier of the traffic distribution group. This can be the ID or + /// the ARN if the API is being called in the Region where the traffic + /// distribution group was created. The ARN must be provided if the call is + /// from the replicated Region. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future + listTrafficDistributionGroupUsers({ + required String trafficDistributionGroupId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 10, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/traffic-distribution-group/${Uri.encodeComponent(trafficDistributionGroupId)}/user', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTrafficDistributionGroupUsersResponse.fromJson(response); + } + /// Lists traffic distribution groups. /// /// May throw [InvalidRequestException]. @@ -6239,6 +8978,54 @@ class Connect { return ListUserHierarchyGroupsResponse.fromJson(response); } + /// Lists proficiencies associated with a user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [userId] : + /// The identifier of the user account. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listUserProficiencies({ + required String instanceId, + required String userId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/proficiencies', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListUserProficienciesResponse.fromJson(response); + } + /// Provides summary information about the users for the specified Amazon /// Connect instance. /// @@ -6285,6 +9072,112 @@ class Connect { return ListUsersResponse.fromJson(response); } + /// Returns all the available versions for the specified Amazon Connect + /// instance and view identifier. + /// + /// Results will be sorted from highest to lowest. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. The default MaxResult + /// size is 100. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future listViewVersions({ + required String instanceId, + required String viewId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}/versions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListViewVersionsResponse.fromJson(response); + } + + /// Returns views in the given instance. + /// + /// Results are sorted primarily by type, and secondarily by name. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. The default MaxResult + /// size is 100. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + /// + /// Parameter [type] : + /// The type of the view. + Future listViews({ + required String instanceId, + int? maxResults, + String? nextToken, + ViewType? type, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (type != null) 'type': [type.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/views/${Uri.encodeComponent(instanceId)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListViewsResponse.fromJson(response); + } + /// Initiates silent monitoring of a contact. The Contact Control Panel (CCP) /// of the user specified by userId will be set to silent monitoring /// mode on the contact. @@ -6310,6 +9203,7 @@ class Connect { /// Parameter [allowedMonitorCapabilities] : /// Specify which monitoring actions the user is allowed to take. For example, /// whether the user is allowed to escalate from silent monitoring to barge. + /// AllowedMonitorCapabilities is required if barge is enabled. /// /// Parameter [clientToken] : /// A unique, case-sensitive identifier that you provide to ensure the @@ -6342,6 +9236,44 @@ class Connect { return MonitorContactResponse.fromJson(response); } + /// Allows pausing an ongoing task contact. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [LimitExceededException]. + /// May throw [ConflictException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the + /// instanceId in the ARN of the instance. + /// + /// Parameter [contactFlowId] : + /// The identifier of the flow. + Future pauseContact({ + required String contactId, + required String instanceId, + String? contactFlowId, + }) async { + final $payload = { + 'ContactId': contactId, + 'InstanceId': instanceId, + if (contactFlowId != null) 'ContactFlowId': contactFlowId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/contact/pause', + exceptionFnMap: _exceptionFns, + ); + } + /// Changes the current status of a user or agent in Amazon Connect. If the /// agent is currently handling a contact, this sets the agent's next status. /// @@ -6390,13 +9322,29 @@ class Connect { /// Web Services Region where the number was claimed. /// /// To release phone numbers from a traffic distribution group, use the - /// ReleasePhoneNumber API, not the Amazon Connect console. + /// ReleasePhoneNumber API, not the Amazon Connect admin website. /// /// After releasing a phone number, the phone number enters into a cooldown - /// period of 30 days. It cannot be searched for or claimed again until the - /// period has ended. If you accidentally release a phone number, contact - /// Amazon Web Services Support. + /// period for up to 180 days. It cannot be searched for or claimed again + /// until the period has ended. If you accidentally release a phone number, + /// contact Amazon Web Services Support. /// + /// If you plan to claim and release numbers frequently, contact us for a + /// service quota exception. Otherwise, it is possible you will be blocked + /// from claiming and releasing any more numbers until up to 180 days past the + /// oldest number released has expired. + /// + /// By default you can claim and release up to 200% of your maximum number of + /// active phone numbers. If you claim and release phone numbers using the UI + /// or API during a rolling 180 day cycle that exceeds 200% of your phone + /// number service level quota, you will be blocked from claiming any more + /// numbers until 180 days past the oldest number released has expired. + /// + /// For example, if you already have 99 claimed numbers and a service level + /// quota of 99 phone numbers, and in any 180 day period you release 99, claim + /// 99, and then release 99, you will have exceeded the 200% limit. At that + /// point you are blocked from claiming any more numbers until you open an + /// Amazon Web Services support ticket. /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -6432,7 +9380,8 @@ class Connect { } /// Replicates an Amazon Connect instance in the specified Amazon Web Services - /// Region. + /// Region and copies configuration information for Amazon Connect resources + /// across Amazon Web Services Regions. /// /// For more information about replicating an Amazon Connect instance, see Create @@ -6488,10 +9437,50 @@ class Connect { return ReplicateInstanceResponse.fromJson(response); } - /// When a contact is being recorded, and the recording has been suspended - /// using SuspendContactRecording, this API resumes recording the call. - /// - /// Only voice recordings are supported at this time. + /// Allows resuming a task contact in a paused state. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the + /// instanceId in the ARN of the instance. + /// + /// Parameter [contactFlowId] : + /// The identifier of the flow. + Future resumeContact({ + required String contactId, + required String instanceId, + String? contactFlowId, + }) async { + final $payload = { + 'ContactId': contactId, + 'InstanceId': instanceId, + if (contactFlowId != null) 'ContactFlowId': contactFlowId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/contact/resume', + exceptionFnMap: _exceptionFns, + ); + } + + /// When a contact is being recorded, and the recording has been suspended + /// using SuspendContactRecording, this API resumes recording whatever + /// recording is selected in the flow configuration: call, screen, or both. If + /// only call recording or only screen recording is enabled, then it would + /// resume. + /// + /// Voice and screen recordings are supported. /// /// May throw [InvalidRequestException]. /// May throw [ResourceNotFoundException]. @@ -6543,9 +9532,12 @@ class Connect { /// Parameter [phoneNumberType] : /// The type of phone number. /// - /// Parameter [targetArn] : - /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance that phone numbers are + /// claimed to. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. You + /// must enter InstanceId or TargetArn. /// /// Parameter [maxResults] : /// The maximum number of results to return per page. @@ -6557,13 +9549,19 @@ class Connect { /// Parameter [phoneNumberPrefix] : /// The prefix of the phone number. If provided, it must contain /// + as part of the country code. + /// + /// Parameter [targetArn] : + /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic + /// distribution groups that phone number inbound traffic is routed through. + /// You must enter InstanceId or TargetArn. Future searchAvailablePhoneNumbers({ required PhoneNumberCountryCode phoneNumberCountryCode, required PhoneNumberType phoneNumberType, - required String targetArn, + String? instanceId, int? maxResults, String? nextToken, String? phoneNumberPrefix, + String? targetArn, }) async { _s.validateNumRange( 'maxResults', @@ -6574,10 +9572,11 @@ class Connect { final $payload = { 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), 'PhoneNumberType': phoneNumberType.toValue(), - 'TargetArn': targetArn, + if (instanceId != null) 'InstanceId': instanceId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, if (phoneNumberPrefix != null) 'PhoneNumberPrefix': phoneNumberPrefix, + if (targetArn != null) 'TargetArn': targetArn, }; final response = await _protocol.send( payload: $payload, @@ -6588,10 +9587,8 @@ class Connect { return SearchAvailablePhoneNumbersResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Searches queues in an Amazon Connect instance, with optional filtering. + /// Searches the flow modules in an Amazon Connect instance, with optional + /// filtering. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -6600,9 +9597,8 @@ class Connect { /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [maxResults] : /// The maximum number of results to return per page. @@ -6612,22 +9608,22 @@ class Connect { /// previous response in the next request to retrieve the next set of results. /// /// Parameter [searchCriteria] : - /// The search criteria to be used to return queues. + /// The search criteria to be used to return contact flow modules. /// /// The name and description fields support /// "contains" queries with a minimum of 2 characters and a maximum of 25 /// characters. Any queries with character lengths outside of this range will - /// throw invalid results. + /// result in invalid results. /// /// /// Parameter [searchFilter] : /// Filters to be applied to search results. - Future searchQueues({ + Future searchContactFlowModules({ required String instanceId, int? maxResults, String? nextToken, - QueueSearchCriteria? searchCriteria, - QueueSearchFilter? searchFilter, + ContactFlowModuleSearchCriteria? searchCriteria, + ContactFlowModuleSearchFilter? searchFilter, }) async { _s.validateNumRange( 'maxResults', @@ -6645,16 +9641,13 @@ class Connect { final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/search-queues', + requestUri: '/search-contact-flow-modules', exceptionFnMap: _exceptionFns, ); - return SearchQueuesResponse.fromJson(response); + return SearchContactFlowModulesResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Searches routing profiles in an Amazon Connect instance, with optional + /// Searches the contact flows in an Amazon Connect instance, with optional /// filtering. /// /// May throw [InvalidRequestException]. @@ -6664,9 +9657,8 @@ class Connect { /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [maxResults] : /// The maximum number of results to return per page. @@ -6676,22 +9668,22 @@ class Connect { /// previous response in the next request to retrieve the next set of results. /// /// Parameter [searchCriteria] : - /// The search criteria to be used to return routing profiles. + /// The search criteria to be used to return flows. /// /// The name and description fields support /// "contains" queries with a minimum of 2 characters and a maximum of 25 /// characters. Any queries with character lengths outside of this range will - /// throw invalid results. + /// result in invalid results. /// /// /// Parameter [searchFilter] : /// Filters to be applied to search results. - Future searchRoutingProfiles({ + Future searchContactFlows({ required String instanceId, int? maxResults, String? nextToken, - RoutingProfileSearchCriteria? searchCriteria, - RoutingProfileSearchFilter? searchFilter, + ContactFlowSearchCriteria? searchCriteria, + ContactFlowSearchFilter? searchFilter, }) async { _s.validateNumRange( 'maxResults', @@ -6709,17 +9701,72 @@ class Connect { final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/search-routing-profiles', + requestUri: '/search-contact-flows', exceptionFnMap: _exceptionFns, ); - return SearchRoutingProfilesResponse.fromJson(response); + return SearchContactFlowsResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. + /// Searches contacts in an Amazon Connect instance. /// - /// Searches security profiles in an Amazon Connect instance, with optional - /// filtering. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [instanceId] : + /// The identifier of Amazon Connect instance. You can find the instance ID in + /// the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [timeRange] : + /// Time range that you want to search results. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + /// + /// Parameter [searchCriteria] : + /// The search criteria to be used to return contacts. + /// + /// Parameter [sort] : + /// Specifies a field to sort by and a sort order. + Future searchContacts({ + required String instanceId, + required SearchContactsTimeRange timeRange, + int? maxResults, + String? nextToken, + SearchCriteria? searchCriteria, + Sort? sort, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + 'InstanceId': instanceId, + 'TimeRange': timeRange, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (sort != null) 'Sort': sort, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/search-contacts', + exceptionFnMap: _exceptionFns, + ); + return SearchContactsResponse.fromJson(response); + } + + /// Searches the hours of operation in an Amazon Connect instance, with + /// optional filtering. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -6740,24 +9787,16 @@ class Connect { /// previous response in the next request to retrieve the next set of results. /// /// Parameter [searchCriteria] : - /// The search criteria to be used to return security profiles. - /// - /// The name field support "contains" queries with a minimum of 2 - /// characters and maximum of 25 characters. Any queries with character - /// lengths outside of this range will throw invalid results. - /// - /// The currently supported value for FieldName: - /// name - /// + /// The search criteria to be used to return hours of operations. /// /// Parameter [searchFilter] : /// Filters to be applied to search results. - Future searchSecurityProfiles({ + Future searchHoursOfOperations({ required String instanceId, int? maxResults, String? nextToken, - SecurityProfileSearchCriteria? searchCriteria, - SecurityProfilesSearchFilter? searchFilter, + HoursOfOperationSearchCriteria? searchCriteria, + HoursOfOperationSearchFilter? searchFilter, }) async { _s.validateNumRange( 'maxResults', @@ -6775,16 +9814,13 @@ class Connect { final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/search-security-profiles', + requestUri: '/search-hours-of-operations', exceptionFnMap: _exceptionFns, ); - return SearchSecurityProfilesResponse.fromJson(response); + return SearchHoursOfOperationsResponse.fromJson(response); } - /// Searches users in an Amazon Connect instance, with optional filtering. - /// - /// AfterContactWorkTimeLimit is returned in milliseconds. - /// + /// Predefined attributes that meet certain criteria. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -6793,9 +9829,8 @@ class Connect { /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [maxResults] : /// The maximum number of results to return per page. @@ -6804,14 +9839,13 @@ class Connect { /// The token for the next set of results. Use the value returned in the /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [searchFilter] : - /// Filters to be applied to search results. - Future searchUsers({ - String? instanceId, + /// Parameter [searchCriteria] : + /// The search criteria to be used to return predefined attributes. + Future searchPredefinedAttributes({ + required String instanceId, int? maxResults, String? nextToken, - UserSearchCriteria? searchCriteria, - UserSearchFilter? searchFilter, + PredefinedAttributeSearchCriteria? searchCriteria, }) async { _s.validateNumRange( 'maxResults', @@ -6820,60 +9854,51 @@ class Connect { 100, ); final $payload = { - if (instanceId != null) 'InstanceId': instanceId, + 'InstanceId': instanceId, if (maxResults != null) 'MaxResults': maxResults, if (nextToken != null) 'NextToken': nextToken, if (searchCriteria != null) 'SearchCriteria': searchCriteria, - if (searchFilter != null) 'SearchFilter': searchFilter, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/search-users', + requestUri: '/search-predefined-attributes', exceptionFnMap: _exceptionFns, ); - return SearchUsersResponse.fromJson(response); + return SearchPredefinedAttributesResponse.fromJson(response); } - /// Searches for vocabularies within a specific Amazon Connect instance using - /// State, NameStartsWith, and - /// LanguageCode. + /// Searches prompts in an Amazon Connect instance, with optional filtering. /// /// May throw [InvalidRequestException]. - /// May throw [InternalServiceException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [AccessDeniedException]. + /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [languageCode] : - /// The language code of the vocabulary entries. For a list of languages and - /// their corresponding language codes, see What - /// is Amazon Transcribe? - /// /// Parameter [maxResults] : /// The maximum number of results to return per page. /// - /// Parameter [nameStartsWith] : - /// The starting pattern of the name of the vocabulary. - /// /// Parameter [nextToken] : /// The token for the next set of results. Use the value returned in the /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [state] : - /// The current state of the custom vocabulary. - Future searchVocabularies({ + /// Parameter [searchCriteria] : + /// The search criteria to be used to return prompts. + /// + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchPrompts({ required String instanceId, - VocabularyLanguageCode? languageCode, int? maxResults, - String? nameStartsWith, String? nextToken, - VocabularyState? state, + PromptSearchCriteria? searchCriteria, + PromptSearchFilter? searchFilter, }) async { _s.validateNumRange( 'maxResults', @@ -6882,769 +9907,866 @@ class Connect { 100, ); final $payload = { - if (languageCode != null) 'LanguageCode': languageCode.toValue(), + 'InstanceId': instanceId, if (maxResults != null) 'MaxResults': maxResults, - if (nameStartsWith != null) 'NameStartsWith': nameStartsWith, if (nextToken != null) 'NextToken': nextToken, - if (state != null) 'State': state.toValue(), + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/vocabulary-summary/${Uri.encodeComponent(instanceId)}', + requestUri: '/search-prompts', exceptionFnMap: _exceptionFns, ); - return SearchVocabulariesResponse.fromJson(response); + return SearchPromptsResponse.fromJson(response); } - /// Initiates a flow to start a new chat for the customer. Response of this - /// API provides a token required to obtain credentials from the CreateParticipantConnection - /// API in the Amazon Connect Participant Service. - /// - /// When a new chat contact is successfully created, clients must subscribe to - /// the participant’s connection for the created chat within 5 minutes. This - /// is achieved by invoking CreateParticipantConnection - /// with WEBSOCKET and CONNECTION_CREDENTIALS. - /// - /// A 429 error occurs in the following situations: - /// - ///
        - ///
      • - /// API rate limit is exceeded. API TPS throttling returns a - /// TooManyRequests exception. - ///
      • - ///
      • - /// The quota - /// for concurrent active chats is exceeded. Active chat throttling - /// returns a LimitExceededException. - ///
      • - ///
      - /// If you use the ChatDurationInMinutes parameter and receive a - /// 400 error, your account may not support the ability to configure custom - /// chat durations. For more information, contact Amazon Web Services Support. - /// - /// For more information about chat, see Chat - /// in the Amazon Connect Administrator Guide. + /// Searches queues in an Amazon Connect instance, with optional filtering. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. - /// May throw [LimitExceededException]. - /// - /// Parameter [contactFlowId] : - /// The identifier of the flow for initiating the chat. To see the - /// ContactFlowId in the Amazon Connect console user interface, on the - /// navigation menu go to Routing, Contact Flows. Choose the - /// flow. On the flow page, under the name of the flow, choose Show - /// additional flow information. The ContactFlowId is the last part of the - /// ARN, shown here in bold: - /// - /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [participantDetails] : - /// Information identifying the participant. - /// - /// Parameter [attributes] : - /// A custom key-value pair using an attribute map. The attributes are - /// standard Amazon Connect attributes. They can be accessed in flows just - /// like any other contact attributes. + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per - /// contact. Attribute keys can include only alphanumeric, dash, and - /// underscore characters. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [chatDurationInMinutes] : - /// The total duration of the newly started chat session. If not specified, - /// the chat session duration defaults to 25 hour. The minimum configurable - /// time is 60 minutes. The maximum configurable time is 10,080 minutes (7 - /// days). + /// Parameter [searchCriteria] : + /// The search criteria to be used to return queues. + /// + /// The name and description fields support + /// "contains" queries with a minimum of 2 characters and a maximum of 25 + /// characters. Any queries with character lengths outside of this range will + /// throw invalid results. + /// /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. - /// - /// Parameter [initialMessage] : - /// The initial message to be sent to the newly created chat. - /// - /// Parameter [persistentChat] : - /// Enable persistent chats. For more information about enabling persistent - /// chat, and for example use cases and how to configure for them, see Enable - /// persistent chat. - /// - /// Parameter [relatedContactId] : - /// The unique identifier for an Amazon Connect contact. This identifier is - /// related to the chat starting. - /// - /// You cannot provide data for both RelatedContactId and PersistentChat. - /// - /// - /// Parameter [supportedMessagingContentTypes] : - /// The supported chat message content types. Supported types are - /// text/plain, text/markdown, - /// application/json, - /// application/vnd.amazonaws.connect.message.interactive, and - /// application/vnd.amazonaws.connect.message.interactive.response. - /// - /// Content types must always contain text/plain. You can then - /// put any other supported type in the list. For example, all the following - /// lists are valid because they contain text/plain: - /// [text/plain, text/markdown, application/json], - /// [text/markdown, text/plain], [text/plain, - /// application/json, - /// application/vnd.amazonaws.connect.message.interactive.response]. - /// - /// The type - /// application/vnd.amazonaws.connect.message.interactive is - /// required to use the Show - /// view flow block. - /// - Future startChatContact({ - required String contactFlowId, + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchQueues({ required String instanceId, - required ParticipantDetails participantDetails, - Map? attributes, - int? chatDurationInMinutes, - String? clientToken, - ChatMessage? initialMessage, - PersistentChat? persistentChat, - String? relatedContactId, - List? supportedMessagingContentTypes, + int? maxResults, + String? nextToken, + QueueSearchCriteria? searchCriteria, + QueueSearchFilter? searchFilter, }) async { _s.validateNumRange( - 'chatDurationInMinutes', - chatDurationInMinutes, - 60, - 10080, + 'maxResults', + maxResults, + 1, + 500, ); final $payload = { - 'ContactFlowId': contactFlowId, 'InstanceId': instanceId, - 'ParticipantDetails': participantDetails, - if (attributes != null) 'Attributes': attributes, - if (chatDurationInMinutes != null) - 'ChatDurationInMinutes': chatDurationInMinutes, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (initialMessage != null) 'InitialMessage': initialMessage, - if (persistentChat != null) 'PersistentChat': persistentChat, - if (relatedContactId != null) 'RelatedContactId': relatedContactId, - if (supportedMessagingContentTypes != null) - 'SupportedMessagingContentTypes': supportedMessagingContentTypes, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/contact/chat', + method: 'POST', + requestUri: '/search-queues', exceptionFnMap: _exceptionFns, ); - return StartChatContactResponse.fromJson(response); + return SearchQueuesResponse.fromJson(response); } - /// Starts an empty evaluation in the specified Amazon Connect instance, using - /// the given evaluation form for the particular contact. The evaluation form - /// version used for the contact evaluation corresponds to the currently - /// activated version. If no version is activated for the evaluation form, the - /// contact evaluation cannot be started. - /// - /// Evaluations created through the public API do not contain answer values - /// suggested from automation. - /// + /// Searches quick connects in an Amazon Connect instance, with optional + /// filtering. /// - /// May throw [InternalServiceException]. + /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [ServiceQuotaExceededException]. - /// May throw [ResourceConflictException]. - /// - /// Parameter [contactId] : - /// The identifier of the contact in this instance of Amazon Connect. - /// - /// Parameter [evaluationFormId] : - /// The unique identifier for the evaluation form. + /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. - Future startContactEvaluation({ - required String contactId, - required String evaluationFormId, + /// Parameter [maxResults] : + /// The maximum number of results to return per page. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + /// + /// Parameter [searchCriteria] : + /// The search criteria to be used to return quick connects. + /// + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchQuickConnects({ required String instanceId, - String? clientToken, + int? maxResults, + String? nextToken, + QuickConnectSearchCriteria? searchCriteria, + QuickConnectSearchFilter? searchFilter, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); final $payload = { - 'ContactId': contactId, - 'EvaluationFormId': evaluationFormId, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + 'InstanceId': instanceId, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/contact-evaluations/${Uri.encodeComponent(instanceId)}', + method: 'POST', + requestUri: '/search-quick-connects', exceptionFnMap: _exceptionFns, ); - return StartContactEvaluationResponse.fromJson(response); + return SearchQuickConnectsResponse.fromJson(response); } - /// Starts recording the contact: - /// - ///
        - ///
      • - /// If the API is called before the agent joins the call, recording - /// starts when the agent joins the call. - ///
      • - ///
      • - /// If the API is called after the agent joins the call, recording - /// starts at the time of the API call. - ///
      • - ///
      - /// StartContactRecording is a one-time action. For example, if you use - /// StopContactRecording to stop recording an ongoing call, you can't use - /// StartContactRecording to restart it. For scenarios where the recording has - /// started and you want to suspend and resume it, such as when collecting - /// sensitive information (for example, a credit card number), use - /// SuspendContactRecording and ResumeContactRecording. - /// - /// You can use this API to override the recording behavior configured in the - /// Set - /// recording behavior block. - /// - /// Only voice recordings are supported at this time. + /// Searches tags used in an Amazon Connect instance using optional search + /// criteria. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [MaximumResultReturnedException]. /// - /// Parameter [contactId] : - /// The identifier of the contact. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [initialContactId] : - /// The identifier of the contact. This is the identifier of the contact - /// associated with the first interaction with the contact center. + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [voiceRecordingConfiguration] : - /// The person being recorded. - Future startContactRecording({ - required String contactId, - required String initialContactId, + /// Parameter [resourceTypes] : + /// The list of resource types to be used to search tags from. If not provided + /// or if any empty list is provided, this API will search from all supported + /// resource types. + /// + /// Parameter [searchCriteria] : + /// The search criteria to be used to return tags. + Future searchResourceTags({ required String instanceId, - required VoiceRecordingConfiguration voiceRecordingConfiguration, + int? maxResults, + String? nextToken, + List? resourceTypes, + ResourceTagsSearchCriteria? searchCriteria, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); final $payload = { - 'ContactId': contactId, - 'InitialContactId': initialContactId, 'InstanceId': instanceId, - 'VoiceRecordingConfiguration': voiceRecordingConfiguration, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (resourceTypes != null) 'ResourceTypes': resourceTypes, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/contact/start-recording', + requestUri: '/search-resource-tags', exceptionFnMap: _exceptionFns, ); + return SearchResourceTagsResponse.fromJson(response); } - /// Initiates real-time message streaming for a new chat contact. - /// - /// For more information about message streaming, see Enable - /// real-time chat message streaming in the Amazon Connect - /// Administrator Guide. + /// Searches routing profiles in an Amazon Connect instance, with optional + /// filtering. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. - /// May throw [LimitExceededException]. - /// - /// Parameter [chatStreamingConfiguration] : - /// The streaming configuration, such as the Amazon SNS streaming endpoint. - /// - /// Parameter [contactId] : - /// The identifier of the contact. This is the identifier of the contact - /// associated with the first interaction with the contact center. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. - Future startContactStreaming({ - required ChatStreamingConfiguration chatStreamingConfiguration, - required String contactId, - required String instanceId, - String? clientToken, - }) async { - final $payload = { - 'ChatStreamingConfiguration': chatStreamingConfiguration, - 'ContactId': contactId, - 'InstanceId': instanceId, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - }; - final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/contact/start-streaming', - exceptionFnMap: _exceptionFns, - ); - return StartContactStreamingResponse.fromJson(response); - } - - /// Places an outbound call to a contact, and then initiates the flow. It - /// performs the actions in the flow that's specified (in - /// ContactFlowId). + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// Agents do not initiate the outbound API, which means that they do not dial - /// the contact. If the flow places an outbound call to a contact, and then - /// puts the contact in queue, the call is then routed to the agent, like any - /// other inbound case. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// There is a 60-second dialing timeout for this operation. If the call is - /// not connected after 60 seconds, it fails. + /// Parameter [searchCriteria] : + /// The search criteria to be used to return routing profiles. /// - /// UK numbers with a 447 prefix are not allowed by default. Before you can - /// dial these UK mobile numbers, you must submit a service quota increase - /// request. For more information, see Amazon - /// Connect Service Quotas in the Amazon Connect Administrator - /// Guide. - /// - /// Campaign calls are not allowed by default. Before you can make a call with - /// TrafficType = CAMPAIGN, you must submit a - /// service quota increase request to the quota Amazon - /// Connect campaigns. + /// The name and description fields support + /// "contains" queries with a minimum of 2 characters and a maximum of 25 + /// characters. Any queries with character lengths outside of this range will + /// throw invalid results. /// /// + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchRoutingProfiles({ + required String instanceId, + int? maxResults, + String? nextToken, + RoutingProfileSearchCriteria? searchCriteria, + RoutingProfileSearchFilter? searchFilter, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 500, + ); + final $payload = { + 'InstanceId': instanceId, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/search-routing-profiles', + exceptionFnMap: _exceptionFns, + ); + return SearchRoutingProfilesResponse.fromJson(response); + } + + /// Searches security profiles in an Amazon Connect instance, with optional + /// filtering. + /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. - /// May throw [LimitExceededException]. - /// May throw [DestinationNotAllowedException]. - /// May throw [OutboundContactNotPermittedException]. - /// - /// Parameter [contactFlowId] : - /// The identifier of the flow for the outbound call. To see the ContactFlowId - /// in the Amazon Connect console user interface, on the navigation menu go to - /// Routing, Contact Flows. Choose the flow. On the flow page, - /// under the name of the flow, choose Show additional flow - /// information. The ContactFlowId is the last part of the ARN, shown here - /// in bold: - /// - /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx - /// - /// Parameter [destinationPhoneNumber] : - /// The phone number of the customer, in E.164 format. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [answerMachineDetectionConfig] : - /// Configuration of the answering machine detection for this outbound call. - /// - /// Parameter [attributes] : - /// A custom key-value pair using an attribute map. The attributes are - /// standard Amazon Connect attributes, and can be accessed in flows just like - /// any other contact attributes. - /// - /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per - /// contact. Attribute keys can include only alphanumeric, dash, and - /// underscore characters. - /// - /// Parameter [campaignId] : - /// The campaign identifier of the outbound communication. - /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. The token is valid for 7 days after - /// creation. If a contact is already started, the contact ID is returned. + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// Parameter [queueId] : - /// The queue for the call. If you specify a queue, the phone displayed for - /// caller ID is the phone number specified in the queue. If you do not - /// specify a queue, the queue defined in the flow is used. If you do not - /// specify a queue, you must specify a source phone number. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [sourcePhoneNumber] : - /// The phone number associated with the Amazon Connect instance, in E.164 - /// format. If you do not specify a source phone number, you must specify a - /// queue. + /// Parameter [searchCriteria] : + /// The search criteria to be used to return security profiles. + /// + /// The name field support "contains" queries with a minimum of 2 + /// characters and maximum of 25 characters. Any queries with character + /// lengths outside of this range will throw invalid results. + /// + /// The currently supported value for FieldName: + /// name + /// /// - /// Parameter [trafficType] : - /// Denotes the class of traffic. Calls with different traffic types are - /// handled differently by Amazon Connect. The default value is - /// GENERAL. Use CAMPAIGN if - /// EnableAnswerMachineDetection is set to true. For - /// all other cases, use GENERAL. - Future startOutboundVoiceContact({ - required String contactFlowId, - required String destinationPhoneNumber, + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchSecurityProfiles({ required String instanceId, - AnswerMachineDetectionConfig? answerMachineDetectionConfig, - Map? attributes, - String? campaignId, - String? clientToken, - String? queueId, - String? sourcePhoneNumber, - TrafficType? trafficType, + int? maxResults, + String? nextToken, + SecurityProfileSearchCriteria? searchCriteria, + SecurityProfilesSearchFilter? searchFilter, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); final $payload = { - 'ContactFlowId': contactFlowId, - 'DestinationPhoneNumber': destinationPhoneNumber, 'InstanceId': instanceId, - if (answerMachineDetectionConfig != null) - 'AnswerMachineDetectionConfig': answerMachineDetectionConfig, - if (attributes != null) 'Attributes': attributes, - if (campaignId != null) 'CampaignId': campaignId, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (queueId != null) 'QueueId': queueId, - if (sourcePhoneNumber != null) 'SourcePhoneNumber': sourcePhoneNumber, - if (trafficType != null) 'TrafficType': trafficType.toValue(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/contact/outbound-voice', + method: 'POST', + requestUri: '/search-security-profiles', exceptionFnMap: _exceptionFns, ); - return StartOutboundVoiceContactResponse.fromJson(response); + return SearchSecurityProfilesResponse.fromJson(response); } - /// Initiates a flow to start a new task. + /// Searches users in an Amazon Connect instance, with optional filtering. + /// + /// AfterContactWorkTimeLimit is returned in milliseconds. + /// /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [ServiceQuotaExceededException]. /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// InstanceID is a required field. The "Required: No" below is incorrect. + /// /// - /// Parameter [name] : - /// The name of a task that is shown to an agent in the Contact Control Panel - /// (CCP). + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// Parameter [attributes] : - /// A custom key-value pair using an attribute map. The attributes are - /// standard Amazon Connect attributes, and can be accessed in flows just like - /// any other contact attributes. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per - /// contact. Attribute keys can include only alphanumeric, dash, and - /// underscore characters. + /// Parameter [searchFilter] : + /// Filters to be applied to search results. + Future searchUsers({ + required String instanceId, + int? maxResults, + String? nextToken, + UserSearchCriteria? searchCriteria, + UserSearchFilter? searchFilter, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 500, + ); + final $payload = { + 'InstanceId': instanceId, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (searchCriteria != null) 'SearchCriteria': searchCriteria, + if (searchFilter != null) 'SearchFilter': searchFilter, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/search-users', + exceptionFnMap: _exceptionFns, + ); + return SearchUsersResponse.fromJson(response); + } + + /// Searches for vocabularies within a specific Amazon Connect instance using + /// State, NameStartsWith, and + /// LanguageCode. /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. + /// May throw [InvalidRequestException]. + /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. /// - /// Parameter [contactFlowId] : - /// The identifier of the flow for initiating the tasks. To see the - /// ContactFlowId in the Amazon Connect console user interface, on the - /// navigation menu go to Routing, Contact Flows. Choose the - /// flow. On the flow page, under the name of the flow, choose Show - /// additional flow information. The ContactFlowId is the last part of the - /// ARN, shown here in bold: + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx + /// Parameter [languageCode] : + /// The language code of the vocabulary entries. For a list of languages and + /// their corresponding language codes, see What + /// is Amazon Transcribe? /// - /// Parameter [description] : - /// A description of the task that is shown to an agent in the Contact Control - /// Panel (CCP). - /// - /// Parameter [previousContactId] : - /// The identifier of the previous chat, voice, or task contact. - /// - /// Parameter [quickConnectId] : - /// The identifier for the quick connect. - /// - /// Parameter [references] : - /// A formatted URL that is shown to an agent in the Contact Control Panel - /// (CCP). + /// Parameter [maxResults] : + /// The maximum number of results to return per page. /// - /// Parameter [relatedContactId] : - /// The contactId that is related - /// to this contact. + /// Parameter [nameStartsWith] : + /// The starting pattern of the name of the vocabulary. /// - /// Parameter [scheduledTime] : - /// The timestamp, in Unix Epoch seconds format, at which to start running the - /// inbound flow. The scheduled time cannot be in the past. It must be within - /// up to 6 days in future. + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. /// - /// Parameter [taskTemplateId] : - /// A unique identifier for the task template. - Future startTaskContact({ + /// Parameter [state] : + /// The current state of the custom vocabulary. + Future searchVocabularies({ required String instanceId, - required String name, - Map? attributes, - String? clientToken, - String? contactFlowId, - String? description, - String? previousContactId, - String? quickConnectId, - Map? references, - String? relatedContactId, - DateTime? scheduledTime, - String? taskTemplateId, + VocabularyLanguageCode? languageCode, + int? maxResults, + String? nameStartsWith, + String? nextToken, + VocabularyState? state, }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); final $payload = { - 'InstanceId': instanceId, - 'Name': name, - if (attributes != null) 'Attributes': attributes, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (contactFlowId != null) 'ContactFlowId': contactFlowId, - if (description != null) 'Description': description, - if (previousContactId != null) 'PreviousContactId': previousContactId, - if (quickConnectId != null) 'QuickConnectId': quickConnectId, - if (references != null) 'References': references, - if (relatedContactId != null) 'RelatedContactId': relatedContactId, - if (scheduledTime != null) - 'ScheduledTime': unixTimestampToJson(scheduledTime), - if (taskTemplateId != null) 'TaskTemplateId': taskTemplateId, + if (languageCode != null) 'LanguageCode': languageCode.toValue(), + if (maxResults != null) 'MaxResults': maxResults, + if (nameStartsWith != null) 'NameStartsWith': nameStartsWith, + if (nextToken != null) 'NextToken': nextToken, + if (state != null) 'State': state.toValue(), }; final response = await _protocol.send( payload: $payload, - method: 'PUT', - requestUri: '/contact/task', + method: 'POST', + requestUri: '/vocabulary-summary/${Uri.encodeComponent(instanceId)}', exceptionFnMap: _exceptionFns, ); - return StartTaskContactResponse.fromJson(response); + return SearchVocabulariesResponse.fromJson(response); } - /// Ends the specified contact. This call does not work for the following - /// initiation methods: + /// Processes chat integration events from Amazon Web Services or external + /// integrations to Amazon Connect. A chat integration event includes: /// ///
        ///
      • - /// DISCONNECT - ///
      • - ///
      • - /// TRANSFER + /// SourceId, DestinationId, and Subtype: a set of identifiers, uniquely + /// representing a chat ///
      • ///
      • - /// QUEUE_TRANSFER + /// ChatEvent: details of the chat action to perform such as sending a + /// message, event, or disconnecting from a chat ///
      • ///
      + /// When a chat integration event is sent with chat identifiers that do not + /// map to an active chat contact, a new chat contact is also created before + /// handling chat action. + /// + /// Access to this API is currently restricted to Amazon Pinpoint for + /// supporting SMS integration. /// /// May throw [InvalidRequestException]. - /// May throw [ContactNotFoundException]. - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. /// - /// Parameter [contactId] : - /// The ID of the contact. - /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future stopContact({ - required String contactId, - required String instanceId, + /// Parameter [destinationId] : + /// Chat system identifier, used in part to uniquely identify chat. This is + /// associated with the Amazon Connect instance and flow to be used to start + /// chats. For SMS, this is the phone number destination of inbound SMS + /// messages represented by an Amazon Pinpoint phone number ARN. + /// + /// Parameter [event] : + /// Chat integration event payload + /// + /// Parameter [sourceId] : + /// External identifier of chat customer participant, used in part to uniquely + /// identify a chat. For SMS, this is the E164 phone number of the chat + /// customer participant. + /// + /// Parameter [newSessionDetails] : + /// Contact properties to apply when starting a new chat. If the integration + /// event is handled with an existing chat, this is ignored. + /// + /// Parameter [subtype] : + /// Classification of a channel. This is used in part to uniquely identify + /// chat. + /// + /// Valid value: ["connect:sms"] + Future sendChatIntegrationEvent({ + required String destinationId, + required ChatEvent event, + required String sourceId, + NewSessionDetails? newSessionDetails, + String? subtype, }) async { final $payload = { - 'ContactId': contactId, - 'InstanceId': instanceId, + 'DestinationId': destinationId, + 'Event': event, + 'SourceId': sourceId, + if (newSessionDetails != null) 'NewSessionDetails': newSessionDetails, + if (subtype != null) 'Subtype': subtype, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/contact/stop', + requestUri: '/chat-integration-event', exceptionFnMap: _exceptionFns, ); + return SendChatIntegrationEventResponse.fromJson(response); } - /// Stops recording a call when a contact is being recorded. - /// StopContactRecording is a one-time action. If you use StopContactRecording - /// to stop recording an ongoing call, you can't use StartContactRecording to - /// restart it. For scenarios where the recording has started and you want to - /// suspend it for sensitive information (for example, to collect a credit - /// card number), and then restart it, use SuspendContactRecording and - /// ResumeContactRecording. - /// - /// Only voice recordings are supported at this time. + /// Provides a pre-signed Amazon S3 URL in response for uploading your + /// content. + /// + /// You may only use this API to upload attachments to a Connect + /// Case. + /// /// + /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. - /// May throw [ResourceNotFoundException]. /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceConflictException]. + /// May throw [ServiceQuotaExceededException]. /// - /// Parameter [contactId] : - /// The identifier of the contact. - /// - /// Parameter [initialContactId] : - /// The identifier of the contact. This is the identifier of the contact - /// associated with the first interaction with the contact center. + /// Parameter [associatedResourceArn] : + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future stopContactRecording({ - required String contactId, - required String initialContactId, - required String instanceId, - }) async { - final $payload = { - 'ContactId': contactId, - 'InitialContactId': initialContactId, - 'InstanceId': instanceId, - }; - final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/contact/stop-recording', - exceptionFnMap: _exceptionFns, - ); - } - - /// Ends message streaming on a specified contact. To restart message - /// streaming on that contact, call the StartContactStreaming - /// API. + /// Parameter [fileName] : + /// A case-sensitive name of the attached file being uploaded. /// - /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. + /// Parameter [fileSizeInBytes] : + /// The size of the attached file in bytes. /// - /// Parameter [contactId] : - /// The identifier of the contact. This is the identifier of the contact that - /// is associated with the first interaction with the contact center. + /// Parameter [fileUseCaseType] : + /// The use case for the file. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// The unique identifier of the Connect instance. /// - /// Parameter [streamingId] : - /// The identifier of the streaming configuration enabled. - Future stopContactStreaming({ - required String contactId, + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [createdBy] : + /// Represents the identity that created the file. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + /// + /// Parameter [urlExpiryInSeconds] : + /// Optional override for the expiry of the pre-signed S3 URL in seconds. The + /// default value is 300. + Future startAttachedFileUpload({ + required String associatedResourceArn, + required String fileName, + required int fileSizeInBytes, + required FileUseCaseType fileUseCaseType, required String instanceId, - required String streamingId, + String? clientToken, + CreatedByInfo? createdBy, + Map? tags, + int? urlExpiryInSeconds, }) async { + _s.validateNumRange( + 'fileSizeInBytes', + fileSizeInBytes, + 1, + 1152921504606846976, + isRequired: true, + ); + _s.validateNumRange( + 'urlExpiryInSeconds', + urlExpiryInSeconds, + 5, + 300, + ); + final $query = >{ + 'associatedResourceArn': [associatedResourceArn], + }; final $payload = { - 'ContactId': contactId, - 'InstanceId': instanceId, - 'StreamingId': streamingId, + 'FileName': fileName, + 'FileSizeInBytes': fileSizeInBytes, + 'FileUseCaseType': fileUseCaseType.toValue(), + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (createdBy != null) 'CreatedBy': createdBy, + if (tags != null) 'Tags': tags, + if (urlExpiryInSeconds != null) 'UrlExpiryInSeconds': urlExpiryInSeconds, }; final response = await _protocol.send( payload: $payload, - method: 'POST', - requestUri: '/contact/stop-streaming', + method: 'PUT', + requestUri: '/attached-files/${Uri.encodeComponent(instanceId)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); + return StartAttachedFileUploadResponse.fromJson(response); } - /// Submits a contact evaluation in the specified Amazon Connect instance. - /// Answers included in the request are merged with existing answers for the - /// given evaluation. If no answers or notes are passed, the evaluation is - /// submitted with the existing answers and notes. You can delete an answer or - /// note by passing an empty object ({}) to the question - /// identifier. + /// Initiates a flow to start a new chat for the customer. Response of this + /// API provides a token required to obtain credentials from the CreateParticipantConnection + /// API in the Amazon Connect Participant Service. /// - /// If a contact evaluation is already in submitted state, this operation will - /// trigger a resubmission. + /// When a new chat contact is successfully created, clients must subscribe to + /// the participant’s connection for the created chat within 5 minutes. This + /// is achieved by invoking CreateParticipantConnection + /// with WEBSOCKET and CONNECTION_CREDENTIALS. + /// + /// A 429 error occurs in the following situations: + /// + ///
        + ///
      • + /// API rate limit is exceeded. API TPS throttling returns a + /// TooManyRequests exception. + ///
      • + ///
      • + /// The quota + /// for concurrent active chats is exceeded. Active chat throttling + /// returns a LimitExceededException. + ///
      • + ///
      + /// If you use the ChatDurationInMinutes parameter and receive a + /// 400 error, your account may not support the ability to configure custom + /// chat durations. For more information, contact Amazon Web Services Support. /// + /// For more information about chat, see Chat + /// in the Amazon Connect Administrator Guide. + /// + /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. - /// May throw [ResourceConflictException]. + /// May throw [LimitExceededException]. /// - /// Parameter [evaluationId] : - /// A unique identifier for the contact evaluation. + /// Parameter [contactFlowId] : + /// The identifier of the flow for initiating the chat. To see the + /// ContactFlowId in the Amazon Connect admin website, on the navigation menu + /// go to Routing, Contact Flows. Choose the flow. On the flow + /// page, under the name of the flow, choose Show additional flow + /// information. The ContactFlowId is the last part of the ARN, shown here + /// in bold: + /// + /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [answers] : - /// A map of question identifiers to answer value. + /// Parameter [participantDetails] : + /// Information identifying the participant. /// - /// Parameter [notes] : - /// A map of question identifiers to note value. - Future submitContactEvaluation({ - required String evaluationId, + /// Parameter [attributes] : + /// A custom key-value pair using an attribute map. The attributes are + /// standard Amazon Connect attributes. They can be accessed in flows just + /// like any other contact attributes. + /// + /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per + /// contact. Attribute keys can include only alphanumeric, dash, and + /// underscore characters. + /// + /// Parameter [chatDurationInMinutes] : + /// The total duration of the newly started chat session. If not specified, + /// the chat session duration defaults to 25 hour. The minimum configurable + /// time is 60 minutes. The maximum configurable time is 10,080 minutes (7 + /// days). + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [initialMessage] : + /// The initial message to be sent to the newly created chat. If you have a + /// Lex bot in your flow, the initial message is not delivered to the Lex bot. + /// + /// Parameter [persistentChat] : + /// Enable persistent chats. For more information about enabling persistent + /// chat, and for example use cases and how to configure for them, see Enable + /// persistent chat. + /// + /// Parameter [relatedContactId] : + /// The unique identifier for an Amazon Connect contact. This identifier is + /// related to the chat starting. + /// + /// You cannot provide data for both RelatedContactId and PersistentChat. + /// + /// + /// Parameter [segmentAttributes] : + /// A set of system defined key-value pairs stored on individual contact + /// segments using an attribute map. The attributes are standard Amazon + /// Connect attributes. They can be accessed in flows. + /// + /// Attribute keys can include only alphanumeric, -, and _. + /// + /// This field can be used to show channel subtype, such as + /// connect:Guide. + /// + /// The types + /// application/vnd.amazonaws.connect.message.interactive and + /// application/vnd.amazonaws.connect.message.interactive.response + /// must be present in the SupportedMessagingContentTypes field of this API in + /// order to set SegmentAttributes as { "connect:Subtype": + /// {"valueString" : "connect:Guide" }}. + /// + /// + /// Parameter [supportedMessagingContentTypes] : + /// The supported chat message content types. Supported types are + /// text/plain, text/markdown, + /// application/json, + /// application/vnd.amazonaws.connect.message.interactive, and + /// application/vnd.amazonaws.connect.message.interactive.response. + /// + /// Content types must always contain text/plain. You can then + /// put any other supported type in the list. For example, all the following + /// lists are valid because they contain text/plain: + /// [text/plain, text/markdown, application/json], + /// [text/markdown, text/plain], [text/plain, + /// application/json, + /// application/vnd.amazonaws.connect.message.interactive.response]. + /// + /// The type + /// application/vnd.amazonaws.connect.message.interactive is + /// required to use the Show + /// view flow block. + /// + Future startChatContact({ + required String contactFlowId, required String instanceId, - Map? answers, - Map? notes, + required ParticipantDetails participantDetails, + Map? attributes, + int? chatDurationInMinutes, + String? clientToken, + ChatMessage? initialMessage, + PersistentChat? persistentChat, + String? relatedContactId, + Map? segmentAttributes, + List? supportedMessagingContentTypes, }) async { + _s.validateNumRange( + 'chatDurationInMinutes', + chatDurationInMinutes, + 60, + 10080, + ); final $payload = { - if (answers != null) 'Answers': answers, - if (notes != null) 'Notes': notes, + 'ContactFlowId': contactFlowId, + 'InstanceId': instanceId, + 'ParticipantDetails': participantDetails, + if (attributes != null) 'Attributes': attributes, + if (chatDurationInMinutes != null) + 'ChatDurationInMinutes': chatDurationInMinutes, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (initialMessage != null) 'InitialMessage': initialMessage, + if (persistentChat != null) 'PersistentChat': persistentChat, + if (relatedContactId != null) 'RelatedContactId': relatedContactId, + if (segmentAttributes != null) 'SegmentAttributes': segmentAttributes, + if (supportedMessagingContentTypes != null) + 'SupportedMessagingContentTypes': supportedMessagingContentTypes, }; final response = await _protocol.send( payload: $payload, - method: 'POST', - requestUri: - '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}/submit', + method: 'PUT', + requestUri: '/contact/chat', exceptionFnMap: _exceptionFns, ); - return SubmitContactEvaluationResponse.fromJson(response); + return StartChatContactResponse.fromJson(response); } - /// When a contact is being recorded, this API suspends recording the call. - /// For example, you might suspend the call recording while collecting - /// sensitive information, such as a credit card number. Then use - /// ResumeContactRecording to restart recording. + /// Starts an empty evaluation in the specified Amazon Connect instance, using + /// the given evaluation form for the particular contact. The evaluation form + /// version used for the contact evaluation corresponds to the currently + /// activated version. If no version is activated for the evaluation form, the + /// contact evaluation cannot be started. + /// + /// Evaluations created through the public API do not contain answer values + /// suggested from automation. + /// /// - /// The period of time that the recording is suspended is filled with silence - /// in the final recording. + /// May throw [InternalServiceException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceConflictException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. + /// + /// Parameter [evaluationFormId] : + /// The unique identifier for the evaluation form. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + Future startContactEvaluation({ + required String contactId, + required String evaluationFormId, + required String instanceId, + String? clientToken, + }) async { + final $payload = { + 'ContactId': contactId, + 'EvaluationFormId': evaluationFormId, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/contact-evaluations/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); + return StartContactEvaluationResponse.fromJson(response); + } + + /// Starts recording the contact: + /// + ///
        + ///
      • + /// If the API is called before the agent joins the call, recording + /// starts when the agent joins the call. + ///
      • + ///
      • + /// If the API is called after the agent joins the call, recording + /// starts at the time of the API call. + ///
      • + ///
      + /// StartContactRecording is a one-time action. For example, if you use + /// StopContactRecording to stop recording an ongoing call, you can't use + /// StartContactRecording to restart it. For scenarios where the recording has + /// started and you want to suspend and resume it, such as when collecting + /// sensitive information (for example, a credit card number), use + /// SuspendContactRecording and ResumeContactRecording. + /// + /// You can use this API to override the recording behavior configured in the + /// Set + /// recording behavior block. /// /// Only voice recordings are supported at this time. /// /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServiceException]. /// @@ -7659,332 +10781,591 @@ class Connect { /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future suspendContactRecording({ + /// + /// Parameter [voiceRecordingConfiguration] : + /// The person being recorded. + Future startContactRecording({ required String contactId, required String initialContactId, required String instanceId, + required VoiceRecordingConfiguration voiceRecordingConfiguration, }) async { final $payload = { 'ContactId': contactId, 'InitialContactId': initialContactId, 'InstanceId': instanceId, + 'VoiceRecordingConfiguration': voiceRecordingConfiguration, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/contact/suspend-recording', + requestUri: '/contact/start-recording', exceptionFnMap: _exceptionFns, ); } - /// Adds the specified tags to the specified resource. - /// - /// Some of the supported resource types are agents, routing profiles, queues, - /// quick connects, contact flows, agent statuses, hours of operation, phone - /// numbers, security profiles, and task templates. For a complete list, see - /// Tagging - /// resources in Amazon Connect. + /// Initiates real-time message streaming for a new chat contact. /// - /// For sample policies that use tags, see Amazon - /// Connect Identity-Based Policy Examples in the Amazon Connect + /// For more information about message streaming, see Enable + /// real-time chat message streaming in the Amazon Connect /// Administrator Guide. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [InternalServiceException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// May throw [LimitExceededException]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource. + /// Parameter [chatStreamingConfiguration] : + /// The streaming configuration, such as the Amazon SNS streaming endpoint. /// - /// Parameter [tags] : - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - Future tagResource({ - required String resourceArn, - required Map tags, + /// Parameter [contactId] : + /// The identifier of the contact. This is the identifier of the contact + /// associated with the first interaction with the contact center. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + Future startContactStreaming({ + required ChatStreamingConfiguration chatStreamingConfiguration, + required String contactId, + required String instanceId, + String? clientToken, }) async { final $payload = { - 'tags': tags, + 'ChatStreamingConfiguration': chatStreamingConfiguration, + 'ContactId': contactId, + 'InstanceId': instanceId, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + requestUri: '/contact/start-streaming', exceptionFnMap: _exceptionFns, ); + return StartContactStreamingResponse.fromJson(response); } - /// Transfers contacts from one agent or queue to another agent or queue at - /// any point after a contact is created. You can transfer a contact to - /// another queue by providing the flow which orchestrates the contact to the - /// destination queue. This gives you more control over contact handling and - /// helps you adhere to the service level agreement (SLA) guaranteed to your - /// customers. - /// - /// Note the following requirements: + /// Places an outbound call to a contact, and then initiates the flow. It + /// performs the actions in the flow that's specified (in + /// ContactFlowId). /// - ///
        - ///
      • - /// Transfer is supported for only TASK contacts. - ///
      • - ///
      • - /// Do not use both QueueId and UserId in the same - /// call. - ///
      • - ///
      • - /// The following flow types are supported: Inbound flow, Transfer to agent - /// flow, and Transfer to queue flow. - ///
      • - ///
      • - /// The TransferContact API can be called only on active - /// contacts. - ///
      • - ///
      • - /// A contact cannot be transferred more than 11 times. - ///
      • - ///
      + /// Agents do not initiate the outbound API, which means that they do not dial + /// the contact. If the flow places an outbound call to a contact, and then + /// puts the contact in queue, the call is then routed to the agent, like any + /// other inbound case. + /// + /// There is a 60-second dialing timeout for this operation. If the call is + /// not connected after 60 seconds, it fails. + /// + /// UK numbers with a 447 prefix are not allowed by default. Before you can + /// dial these UK mobile numbers, you must submit a service quota increase + /// request. For more information, see Amazon + /// Connect Service Quotas in the Amazon Connect Administrator + /// Guide. + /// + /// Campaign calls are not allowed by default. Before you can make a call with + /// TrafficType = CAMPAIGN, you must submit a + /// service quota increase request to the quota Amazon + /// Connect campaigns. + /// /// /// May throw [InvalidRequestException]. - /// May throw [IdempotencyException]. - /// May throw [AccessDeniedException]. + /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ServiceQuotaExceededException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [LimitExceededException]. + /// May throw [DestinationNotAllowedException]. + /// May throw [OutboundContactNotPermittedException]. /// /// Parameter [contactFlowId] : - /// The identifier of the flow. + /// The identifier of the flow for the outbound call. To see the ContactFlowId + /// in the Amazon Connect admin website, on the navigation menu go to + /// Routing, Contact Flows. Choose the flow. On the flow page, + /// under the name of the flow, choose Show additional flow + /// information. The ContactFlowId is the last part of the ARN, shown here + /// in bold: /// - /// Parameter [contactId] : - /// The identifier of the contact in this instance of Amazon Connect. + /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx + /// + /// Parameter [destinationPhoneNumber] : + /// The phone number of the customer, in E.164 format. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// + /// Parameter [answerMachineDetectionConfig] : + /// Configuration of the answering machine detection for this outbound call. + /// + /// Parameter [attributes] : + /// A custom key-value pair using an attribute map. The attributes are + /// standard Amazon Connect attributes, and can be accessed in flows just like + /// any other contact attributes. + /// + /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per + /// contact. Attribute keys can include only alphanumeric, dash, and + /// underscore characters. + /// + /// Parameter [campaignId] : + /// The campaign identifier of the outbound communication. + /// /// Parameter [clientToken] : /// A unique, case-sensitive identifier that you provide to ensure the /// idempotency of the request. If not provided, the Amazon Web Services SDK /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. + /// retries safe with idempotent APIs. The token is valid for 7 days after + /// creation. If a contact is already started, the contact ID is returned. + /// + /// Parameter [description] : + /// A description of the voice contact that is shown to an agent in the + /// Contact Control Panel (CCP). + /// + /// Parameter [name] : + /// The name of a voice contact that is shown to an agent in the Contact + /// Control Panel (CCP). /// /// Parameter [queueId] : - /// The identifier for the queue. + /// The queue for the call. If you specify a queue, the phone displayed for + /// caller ID is the phone number specified in the queue. If you do not + /// specify a queue, the queue defined in the flow is used. If you do not + /// specify a queue, you must specify a source phone number. /// - /// Parameter [userId] : - /// The identifier for the user. - Future transferContact({ + /// Parameter [references] : + /// A formatted URL that is shown to an agent in the Contact Control Panel + /// (CCP). Contacts can have the following reference types at the time of + /// creation: URL | NUMBER | STRING | + /// DATE | EMAIL. ATTACHMENT is not a + /// supported reference type during voice contact creation. + /// + /// Parameter [relatedContactId] : + /// The contactId that is related to this contact. Linking voice, + /// task, or chat by using RelatedContactID copies over contact + /// attributes from the related contact to the new contact. All updates to + /// user-defined attributes in the new contact are limited to the individual + /// contact ID. There are no limits to the number of contacts that can be + /// linked by using RelatedContactId. + /// + /// Parameter [sourcePhoneNumber] : + /// The phone number associated with the Amazon Connect instance, in E.164 + /// format. If you do not specify a source phone number, you must specify a + /// queue. + /// + /// Parameter [trafficType] : + /// Denotes the class of traffic. Calls with different traffic types are + /// handled differently by Amazon Connect. The default value is + /// GENERAL. Use CAMPAIGN if + /// EnableAnswerMachineDetection is set to true. For + /// all other cases, use GENERAL. + Future startOutboundVoiceContact({ required String contactFlowId, - required String contactId, + required String destinationPhoneNumber, required String instanceId, + AnswerMachineDetectionConfig? answerMachineDetectionConfig, + Map? attributes, + String? campaignId, String? clientToken, + String? description, + String? name, String? queueId, - String? userId, + Map? references, + String? relatedContactId, + String? sourcePhoneNumber, + TrafficType? trafficType, }) async { final $payload = { 'ContactFlowId': contactFlowId, - 'ContactId': contactId, + 'DestinationPhoneNumber': destinationPhoneNumber, 'InstanceId': instanceId, + if (answerMachineDetectionConfig != null) + 'AnswerMachineDetectionConfig': answerMachineDetectionConfig, + if (attributes != null) 'Attributes': attributes, + if (campaignId != null) 'CampaignId': campaignId, 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'Description': description, + if (name != null) 'Name': name, if (queueId != null) 'QueueId': queueId, - if (userId != null) 'UserId': userId, + if (references != null) 'References': references, + if (relatedContactId != null) 'RelatedContactId': relatedContactId, + if (sourcePhoneNumber != null) 'SourcePhoneNumber': sourcePhoneNumber, + if (trafficType != null) 'TrafficType': trafficType.toValue(), }; final response = await _protocol.send( payload: $payload, - method: 'POST', - requestUri: '/contact/transfer', + method: 'PUT', + requestUri: '/contact/outbound-voice', exceptionFnMap: _exceptionFns, ); - return TransferContactResponse.fromJson(response); + return StartOutboundVoiceContactResponse.fromJson(response); } - /// Removes the specified tags from the specified resource. + /// Initiates a flow to start a new task contact. For more information about + /// task contacts, see Concepts: + /// Tasks in Amazon Connect in the Amazon Connect Administrator + /// Guide. /// - /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [InternalServiceException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. + /// When using PreviousContactId and + /// RelatedContactId input parameters, note the following: /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) of the resource. + ///
        + ///
      • + /// PreviousContactId /// - /// Parameter [tagKeys] : - /// The tag keys. - Future untagResource({ - required String resourceArn, - required List tagKeys, - }) async { - final $query = >{ - 'tagKeys': tagKeys, - }; - await _protocol.send( - payload: null, - method: 'DELETE', - requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', - queryParams: $query, - exceptionFnMap: _exceptionFns, - ); - } - - /// This API is in preview release for Amazon Connect and is subject to - /// change. + ///
          + ///
        • + /// Any updates to user-defined task contact attributes on any contact linked + /// through the same PreviousContactId will affect every contact + /// in the chain. + ///
        • + ///
        • + /// There can be a maximum of 12 linked task contacts in a chain. That is, 12 + /// task contacts can be created that share the same + /// PreviousContactId. + ///
        • + ///
      • + ///
      • + /// RelatedContactId /// - /// Updates agent status. + ///
          + ///
        • + /// Copies contact attributes from the related task contact to the new + /// contact. + ///
        • + ///
        • + /// Any update on attributes in a new task contact does not update attributes + /// on previous contact. + ///
        • + ///
        • + /// There’s no limit on the number of task contacts that can be created that + /// use the same RelatedContactId. + ///
        • + ///
      • + ///
      + /// In addition, when calling StartTaskContact include only one of these + /// parameters: ContactFlowID, QuickConnectID, or + /// TaskTemplateID. Only one parameter is required as long as the + /// task template has a flow configured to run it. If more than one parameter + /// is specified, or only the TaskTemplateID is specified but it + /// does not have a flow configured, the request returns an error because + /// Amazon Connect cannot identify the unique flow to run when the task is + /// created. + /// + /// A ServiceQuotaExceededException occurs when the number of + /// open tasks exceeds the active tasks quota or there are already 12 tasks + /// referencing the same PreviousContactId. For more information + /// about service quotas for task contacts, see Amazon + /// Connect service quotas in the Amazon Connect Administrator + /// Guide. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. - /// May throw [LimitExceededException]. /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [InternalServiceException]. /// - /// Parameter [agentStatusId] : - /// The identifier of the agent status. - /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// + /// Parameter [name] : + /// The name of a task that is shown to an agent in the Contact Control Panel + /// (CCP). + /// + /// Parameter [attributes] : + /// A custom key-value pair using an attribute map. The attributes are + /// standard Amazon Connect attributes, and can be accessed in flows just like + /// any other contact attributes. + /// + /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per + /// contact. Attribute keys can include only alphanumeric, dash, and + /// underscore characters. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [contactFlowId] : + /// The identifier of the flow for initiating the tasks. To see the + /// ContactFlowId in the Amazon Connect admin website, on the navigation menu + /// go to Routing, Contact Flows. Choose the flow. On the flow + /// page, under the name of the flow, choose Show additional flow + /// information. The ContactFlowId is the last part of the ARN, shown here + /// in bold: + /// + /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx + /// /// Parameter [description] : - /// The description of the agent status. + /// A description of the task that is shown to an agent in the Contact Control + /// Panel (CCP). /// - /// Parameter [displayOrder] : - /// The display order of the agent status. + /// Parameter [previousContactId] : + /// The identifier of the previous chat, voice, or task contact. Any updates + /// to user-defined attributes to task contacts linked using the same + /// PreviousContactID will affect every contact in the chain. + /// There can be a maximum of 12 linked task contacts in a chain. /// - /// Parameter [name] : - /// The name of the agent status. + /// Parameter [quickConnectId] : + /// The identifier for the quick connect. Tasks that are created by using + /// QuickConnectId will use the flow that is defined on agent or + /// queue quick connect. For more information about quick connects, see Create + /// quick connects. /// - /// Parameter [resetOrderNumber] : - /// A number indicating the reset order of the agent status. + /// Parameter [references] : + /// A formatted URL that is shown to an agent in the Contact Control Panel + /// (CCP). Tasks can have the following reference types at the time of + /// creation: URL | NUMBER | STRING | + /// DATE | EMAIL. ATTACHMENT is not a + /// supported reference type during task creation. /// - /// Parameter [state] : - /// The state of the agent status. - Future updateAgentStatus({ - required String agentStatusId, + /// Parameter [relatedContactId] : + /// The contactId that is related + /// to this contact. Linking tasks together by using + /// RelatedContactID copies over contact attributes from the + /// related task contact to the new task contact. All updates to user-defined + /// attributes in the new task contact are limited to the individual contact + /// ID, unlike what happens when tasks are linked by using + /// PreviousContactID. There are no limits to the number of + /// contacts that can be linked by using RelatedContactId. + /// + /// Parameter [scheduledTime] : + /// The timestamp, in Unix Epoch seconds format, at which to start running the + /// inbound flow. The scheduled time cannot be in the past. It must be within + /// up to 6 days in future. + /// + /// Parameter [taskTemplateId] : + /// A unique identifier for the task template. For more information about task + /// templates, see Create + /// task templates in the Amazon Connect Administrator Guide. + Future startTaskContact({ required String instanceId, - String? description, - int? displayOrder, - String? name, - bool? resetOrderNumber, - AgentStatusState? state, + required String name, + Map? attributes, + String? clientToken, + String? contactFlowId, + String? description, + String? previousContactId, + String? quickConnectId, + Map? references, + String? relatedContactId, + DateTime? scheduledTime, + String? taskTemplateId, }) async { - _s.validateNumRange( - 'displayOrder', - displayOrder, - 1, - 50, - ); final $payload = { + 'InstanceId': instanceId, + 'Name': name, + if (attributes != null) 'Attributes': attributes, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (contactFlowId != null) 'ContactFlowId': contactFlowId, if (description != null) 'Description': description, - if (displayOrder != null) 'DisplayOrder': displayOrder, - if (name != null) 'Name': name, - if (resetOrderNumber != null) 'ResetOrderNumber': resetOrderNumber, - if (state != null) 'State': state.toValue(), + if (previousContactId != null) 'PreviousContactId': previousContactId, + if (quickConnectId != null) 'QuickConnectId': quickConnectId, + if (references != null) 'References': references, + if (relatedContactId != null) 'RelatedContactId': relatedContactId, + if (scheduledTime != null) + 'ScheduledTime': unixTimestampToJson(scheduledTime), + if (taskTemplateId != null) 'TaskTemplateId': taskTemplateId, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, - method: 'POST', - requestUri: - '/agent-status/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(agentStatusId)}', + method: 'PUT', + requestUri: '/contact/task', exceptionFnMap: _exceptionFns, ); + return StartTaskContactResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Adds or updates user-defined contact information associated with the - /// specified contact. At least one field to be updated must be present in the - /// request. - /// - /// You can add or update user-defined contact information for both ongoing - /// and completed contacts. - /// + /// Places an inbound in-app, web, or video call to a contact, and then + /// initiates the flow. It performs the actions in the flow that are specified + /// (in ContactFlowId) and present in the Amazon Connect instance (specified + /// as InstanceId). /// + /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [LimitExceededException]. /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. - /// May throw [ThrottlingException]. /// - /// Parameter [contactId] : - /// The identifier of the contact. This is the identifier of the contact - /// associated with the first interaction with your contact center. + /// Parameter [contactFlowId] : + /// The identifier of the flow for the call. To see the ContactFlowId in the + /// Amazon Connect admin website, on the navigation menu go to Routing, + /// Contact Flows. Choose the flow. On the flow page, under the name of + /// the flow, choose Show additional flow information. The + /// ContactFlowId is the last part of the ARN, shown here in bold: + /// + /// arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [description] : - /// The description of the contact. + /// Parameter [allowedCapabilities] : + /// Information about the video sharing capabilities of the participants + /// (customer, agent). /// - /// Parameter [name] : - /// The name of the contact. + /// Parameter [attributes] : + /// A custom key-value pair using an attribute map. The attributes are + /// standard Amazon Connect attributes, and can be accessed in flows just like + /// any other contact attributes. + /// + /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per + /// contact. Attribute keys can include only alphanumeric, -, and _ + /// characters. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// The token is valid for 7 days after creation. If a contact is already + /// started, the contact ID is returned. + /// + /// Parameter [description] : + /// A description of the task that is shown to an agent in the Contact Control + /// Panel (CCP). /// /// Parameter [references] : - /// Well-formed data on contact, shown to agents on Contact Control Panel - /// (CCP). - Future updateContact({ - required String contactId, + /// A formatted URL that is shown to an agent in the Contact Control Panel + /// (CCP). Tasks can have the following reference types at the time of + /// creation: URL | NUMBER | STRING | + /// DATE | EMAIL. ATTACHMENT is not a + /// supported reference type during task creation. + /// + /// Parameter [relatedContactId] : + /// The unique identifier for an Amazon Connect contact. This identifier is + /// related to the contact starting. + Future startWebRTCContact({ + required String contactFlowId, required String instanceId, + required ParticipantDetails participantDetails, + AllowedCapabilities? allowedCapabilities, + Map? attributes, + String? clientToken, String? description, - String? name, Map? references, + String? relatedContactId, }) async { final $payload = { + 'ContactFlowId': contactFlowId, + 'InstanceId': instanceId, + 'ParticipantDetails': participantDetails, + if (allowedCapabilities != null) + 'AllowedCapabilities': allowedCapabilities, + if (attributes != null) 'Attributes': attributes, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), if (description != null) 'Description': description, - if (name != null) 'Name': name, if (references != null) 'References': references, + if (relatedContactId != null) 'RelatedContactId': relatedContactId, }; final response = await _protocol.send( payload: $payload, - method: 'POST', - requestUri: - '/contacts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', + method: 'PUT', + requestUri: '/contact/webrtc', exceptionFnMap: _exceptionFns, ); + return StartWebRTCContactResponse.fromJson(response); } - /// Creates or updates user-defined contact attributes associated with the - /// specified contact. - /// - /// You can create or update user-defined attributes for both ongoing and - /// completed contacts. For example, while the call is active, you can update - /// the customer's name or the reason the customer called. You can add notes - /// about steps that the agent took during the call that display to the next - /// agent that takes the call. You can also update attributes for a contact - /// using data from your CRM application and save the data with the contact in - /// Amazon Connect. You could also flag calls for additional analysis, such as - /// legal review or to identify abusive callers. + /// Ends the specified contact. Use this API to stop queued callbacks. It does + /// not work for voice contacts that use the following initiation methods: /// - /// Contact attributes are available in Amazon Connect for 24 months, and are - /// then deleted. For information about contact record retention and the - /// maximum size of the contact record attributes section, see Feature - /// specifications in the Amazon Connect Administrator Guide. + ///
        + ///
      • + /// DISCONNECT + ///
      • + ///
      • + /// TRANSFER + ///
      • + ///
      • + /// QUEUE_TRANSFER + ///
      • + ///
      • + /// EXTERNAL_OUTBOUND + ///
      • + ///
      • + /// MONITOR + ///
      • + ///
      + /// Chat and task contacts can be terminated in any state, regardless of + /// initiation method. /// /// May throw [InvalidRequestException]. + /// May throw [ContactNotFoundException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [InternalServiceException]. /// - /// Parameter [attributes] : - /// The Amazon Connect attributes. These attributes can be accessed in flows - /// just like any other contact attributes. + /// Parameter [contactId] : + /// The ID of the contact. /// - /// You can have up to 32,768 UTF-8 bytes across all attributes for a contact. - /// Attribute keys can include only alphanumeric, dash, and underscore - /// characters. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [disconnectReason] : + /// The reason a contact can be disconnected. Only Amazon Connect outbound + /// campaigns can provide this field. + Future stopContact({ + required String contactId, + required String instanceId, + DisconnectReason? disconnectReason, + }) async { + final $payload = { + 'ContactId': contactId, + 'InstanceId': instanceId, + if (disconnectReason != null) 'DisconnectReason': disconnectReason, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/contact/stop', + exceptionFnMap: _exceptionFns, + ); + } + + /// Stops recording a call when a contact is being recorded. + /// StopContactRecording is a one-time action. If you use StopContactRecording + /// to stop recording an ongoing call, you can't use StartContactRecording to + /// restart it. For scenarios where the recording has started and you want to + /// suspend it for sensitive information (for example, to collect a credit + /// card number), and then restart it, use SuspendContactRecording and + /// ResumeContactRecording. + /// + /// Only voice recordings are supported at this time. + /// + /// May throw [InvalidRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact. /// /// Parameter [initialContactId] : /// The identifier of the contact. This is the identifier of the contact @@ -7994,29 +11375,72 @@ class Connect { /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future updateContactAttributes({ - required Map attributes, + Future stopContactRecording({ + required String contactId, required String initialContactId, required String instanceId, }) async { final $payload = { - 'Attributes': attributes, + 'ContactId': contactId, 'InitialContactId': initialContactId, 'InstanceId': instanceId, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/contact/attributes', + requestUri: '/contact/stop-recording', exceptionFnMap: _exceptionFns, ); } - /// Updates details about a contact evaluation in the specified Amazon Connect - /// instance. A contact evaluation must be in draft state. Answers included in - /// the request are merged with existing answers for the given evaluation. An - /// answer or note can be deleted by passing an empty object ({}) - /// to the question identifier. + /// Ends message streaming on a specified contact. To restart message + /// streaming on that contact, call the StartContactStreaming + /// API. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact. This is the identifier of the contact that + /// is associated with the first interaction with the contact center. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [streamingId] : + /// The identifier of the streaming configuration enabled. + Future stopContactStreaming({ + required String contactId, + required String instanceId, + required String streamingId, + }) async { + final $payload = { + 'ContactId': contactId, + 'InstanceId': instanceId, + 'StreamingId': streamingId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/contact/stop-streaming', + exceptionFnMap: _exceptionFns, + ); + } + + /// Submits a contact evaluation in the specified Amazon Connect instance. + /// Answers included in the request are merged with existing answers for the + /// given evaluation. If no answers or notes are passed, the evaluation is + /// submitted with the existing answers and notes. You can delete an answer or + /// note by passing an empty object ({}) to the question + /// identifier. + /// + /// If a contact evaluation is already in submitted state, this operation will + /// trigger a resubmission. /// /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. @@ -8037,7 +11461,7 @@ class Connect { /// /// Parameter [notes] : /// A map of question identifiers to note value. - Future updateContactEvaluation({ + Future submitContactEvaluation({ required String evaluationId, required String instanceId, Map? answers, @@ -8051,761 +11475,754 @@ class Connect { payload: $payload, method: 'POST', requestUri: - '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}', + '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}/submit', exceptionFnMap: _exceptionFns, ); - return UpdateContactEvaluationResponse.fromJson(response); + return SubmitContactEvaluationResponse.fromJson(response); } - /// Updates the specified flow. + /// When a contact is being recorded, this API suspends recording whatever is + /// selected in the flow configuration: call, screen, or both. If only call + /// recording or only screen recording is enabled, then it would be suspended. + /// For example, you might suspend the screen recording while collecting + /// sensitive information, such as a credit card number. Then use + /// ResumeContactRecording to restart recording the screen. /// - /// You can also create and update flows using the Amazon - /// Connect Flow language. + /// The period of time that the recording is suspended is filled with silence + /// in the final recording. + /// + /// Voice and screen recordings are supported. /// /// May throw [InvalidRequestException]. - /// May throw [InvalidContactFlowException]. - /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [contactFlowId] : - /// The identifier of the flow. + /// Parameter [contactId] : + /// The identifier of the contact. /// - /// Parameter [content] : - /// The JSON string that represents flow's content. For an example, see Example - /// contact flow in Amazon Connect Flow language. + /// Parameter [initialContactId] : + /// The identifier of the contact. This is the identifier of the contact + /// associated with the first interaction with the contact center. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. - Future updateContactFlowContent({ - required String contactFlowId, - required String content, + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + Future suspendContactRecording({ + required String contactId, + required String initialContactId, required String instanceId, }) async { final $payload = { - 'Content': content, + 'ContactId': contactId, + 'InitialContactId': initialContactId, + 'InstanceId': instanceId, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/content', + requestUri: '/contact/suspend-recording', exceptionFnMap: _exceptionFns, ); } - /// Updates metadata about specified flow. + /// Adds the specified tags to the contact resource. For more information + /// about this API is used, see Set + /// up granular billing for a detailed view of your Amazon Connect usage. /// /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. /// - /// Parameter [contactFlowId] : - /// The identifier of the flow. + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [contactFlowState] : - /// The state of flow. - /// - /// Parameter [description] : - /// The description of the flow. - /// - /// Parameter [name] : - /// The name of the flow. - Future updateContactFlowMetadata({ - required String contactFlowId, + /// Parameter [tags] : + /// The tags to be assigned to the contact resource. For example, { "Tags": + /// {"key1":"value1", "key2":"value2"} }. + /// + /// Authorization is not supported by this tag. + /// + Future tagContact({ + required String contactId, required String instanceId, - ContactFlowState? contactFlowState, - String? description, - String? name, + required Map tags, }) async { final $payload = { - if (contactFlowState != null) - 'ContactFlowState': contactFlowState.toValue(), - if (description != null) 'Description': description, - if (name != null) 'Name': name, + 'ContactId': contactId, + 'InstanceId': instanceId, + 'Tags': tags, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/metadata', + requestUri: '/contact/tags', exceptionFnMap: _exceptionFns, ); } - /// Updates specified flow module for the specified Amazon Connect instance. + /// Adds the specified tags to the specified resource. + /// + /// Some of the supported resource types are agents, routing profiles, queues, + /// quick connects, contact flows, agent statuses, hours of operation, phone + /// numbers, security profiles, and task templates. For a complete list, see + /// Tagging + /// resources in Amazon Connect. + /// + /// For sample policies that use tags, see Amazon + /// Connect Identity-Based Policy Examples in the Amazon Connect + /// Administrator Guide. /// - /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. - /// May throw [InvalidContactFlowModuleException]. + /// May throw [InvalidParameterException]. + /// May throw [InternalServiceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. /// - /// Parameter [contactFlowModuleId] : - /// The identifier of the flow module. - /// - /// Parameter [content] : - /// The content of the flow module. + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource. /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future updateContactFlowModuleContent({ - required String contactFlowModuleId, - required String content, - required String instanceId, + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + Future tagResource({ + required String resourceArn, + required Map tags, }) async { final $payload = { - 'Content': content, + 'tags': tags, }; - final response = await _protocol.send( + await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/contact-flow-modules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowModuleId)}/content', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', exceptionFnMap: _exceptionFns, ); } - /// Updates metadata about specified flow module. + /// Transfers contacts from one agent or queue to another agent or queue at + /// any point after a contact is created. You can transfer a contact to + /// another queue by providing the flow which orchestrates the contact to the + /// destination queue. This gives you more control over contact handling and + /// helps you adhere to the service level agreement (SLA) guaranteed to your + /// customers. + /// + /// Note the following requirements: + /// + ///
        + ///
      • + /// Transfer is supported for only TASK contacts. + ///
      • + ///
      • + /// Do not use both QueueId and UserId in the same + /// call. + ///
      • + ///
      • + /// The following flow types are supported: Inbound flow, Transfer to agent + /// flow, and Transfer to queue flow. + ///
      • + ///
      • + /// The TransferContact API can be called only on active + /// contacts. + ///
      • + ///
      • + /// A contact cannot be transferred more than 11 times. + ///
      • + ///
      /// - /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. + /// May throw [IdempotencyException]. + /// May throw [AccessDeniedException]. /// May throw [ResourceNotFoundException]. + /// May throw [ServiceQuotaExceededException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [contactFlowModuleId] : - /// The identifier of the flow module. + /// Parameter [contactFlowId] : + /// The identifier of the flow. + /// + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [description] : - /// The description of the flow module. + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. /// - /// Parameter [name] : - /// The name of the flow module. + /// Parameter [queueId] : + /// The identifier for the queue. /// - /// Parameter [state] : - /// The state of flow module. - Future updateContactFlowModuleMetadata({ - required String contactFlowModuleId, + /// Parameter [userId] : + /// The identifier for the user. This can be the ID or the ARN of the user. + Future transferContact({ + required String contactFlowId, + required String contactId, required String instanceId, - String? description, - String? name, - ContactFlowModuleState? state, + String? clientToken, + String? queueId, + String? userId, }) async { final $payload = { - if (description != null) 'Description': description, - if (name != null) 'Name': name, - if (state != null) 'State': state.toValue(), + 'ContactFlowId': contactFlowId, + 'ContactId': contactId, + 'InstanceId': instanceId, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (queueId != null) 'QueueId': queueId, + if (userId != null) 'UserId': userId, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/contact-flow-modules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowModuleId)}/metadata', + requestUri: '/contact/transfer', exceptionFnMap: _exceptionFns, ); + return TransferContactResponse.fromJson(response); } - /// The name of the flow. - /// - /// You can also create and update flows using the Amazon - /// Connect Flow language. + /// Removes the specified tags from the contact resource. For more information + /// about this API is used, see Set + /// up granular billing for a detailed view of your Amazon Connect usage. /// /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [InvalidParameterException]. + /// May throw [ThrottlingException]. /// - /// Parameter [contactFlowId] : - /// The identifier of the flow. + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. - /// - /// Parameter [description] : - /// The description of the flow. + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [name] : - /// The name of the flow. - Future updateContactFlowName({ - required String contactFlowId, + /// Parameter [tagKeys] : + /// A list of tag keys. Existing tags on the contact whose keys are members of + /// this list will be removed. + Future untagContact({ + required String contactId, required String instanceId, - String? description, - String? name, + required List tagKeys, }) async { - final $payload = { - if (description != null) 'Description': description, - if (name != null) 'Name': name, + final $query = >{ + 'TagKeys': tagKeys, }; final response = await _protocol.send( - payload: $payload, - method: 'POST', + payload: null, + method: 'DELETE', requestUri: - '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/name', + '/contact/tags/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); } - /// Updates the scheduled time of a task contact that is already scheduled. + /// Removes the specified tags from the specified resource. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [InternalServiceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [LimitExceededException]. - /// May throw [InternalServiceException]. - /// - /// Parameter [contactId] : - /// The identifier of the contact. /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) of the resource. /// - /// Parameter [scheduledTime] : - /// The timestamp, in Unix Epoch seconds format, at which to start running the - /// inbound flow. The scheduled time cannot be in the past. It must be within - /// up to 6 days in future. - Future updateContactSchedule({ - required String contactId, - required String instanceId, - required DateTime scheduledTime, + /// Parameter [tagKeys] : + /// The tag keys. + Future untagResource({ + required String resourceArn, + required List tagKeys, }) async { - final $payload = { - 'ContactId': contactId, - 'InstanceId': instanceId, - 'ScheduledTime': unixTimestampToJson(scheduledTime), + final $query = >{ + 'tagKeys': tagKeys, }; - final response = await _protocol.send( - payload: $payload, - method: 'POST', - requestUri: '/contact/schedule', + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); } - /// Updates details about a specific evaluation form version in the specified - /// Amazon Connect instance. Question and section identifiers cannot be - /// duplicated within the same evaluation form. + /// This API is in preview release for Amazon Connect and is subject to + /// change. /// - /// This operation does not support partial updates. Instead it does a full - /// update of evaluation form content. + /// Updates agent status. /// + /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. + /// May throw [LimitExceededException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. - /// May throw [ServiceQuotaExceededException]. - /// May throw [ResourceConflictException]. - /// - /// Parameter [evaluationFormId] : - /// The unique identifier for the evaluation form. /// - /// Parameter [evaluationFormVersion] : - /// A version of the evaluation form to update. + /// Parameter [agentStatusId] : + /// The identifier of the agent status. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [items] : - /// Items that are part of the evaluation form. The total number of sections - /// and questions must not exceed 100 each. Questions must be contained in a - /// section. - /// - /// Parameter [title] : - /// A title of the evaluation form. + /// Parameter [description] : + /// The description of the agent status. /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. + /// Parameter [displayOrder] : + /// The display order of the agent status. /// - /// Parameter [createNewVersion] : - /// A flag indicating whether the operation must create a new version. + /// Parameter [name] : + /// The name of the agent status. /// - /// Parameter [description] : - /// The description of the evaluation form. + /// Parameter [resetOrderNumber] : + /// A number indicating the reset order of the agent status. /// - /// Parameter [scoringStrategy] : - /// A scoring strategy of the evaluation form. - Future updateEvaluationForm({ - required String evaluationFormId, - required int evaluationFormVersion, + /// Parameter [state] : + /// The state of the agent status. + Future updateAgentStatus({ + required String agentStatusId, required String instanceId, - required List items, - required String title, - String? clientToken, - bool? createNewVersion, String? description, - EvaluationFormScoringStrategy? scoringStrategy, + int? displayOrder, + String? name, + bool? resetOrderNumber, + AgentStatusState? state, }) async { _s.validateNumRange( - 'evaluationFormVersion', - evaluationFormVersion, + 'displayOrder', + displayOrder, 1, - 1152921504606846976, - isRequired: true, + 50, ); final $payload = { - 'EvaluationFormVersion': evaluationFormVersion, - 'Items': items, - 'Title': title, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - if (createNewVersion != null) 'CreateNewVersion': createNewVersion, if (description != null) 'Description': description, - if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, + if (displayOrder != null) 'DisplayOrder': displayOrder, + if (name != null) 'Name': name, + if (resetOrderNumber != null) 'ResetOrderNumber': resetOrderNumber, + if (state != null) 'State': state.toValue(), }; - final response = await _protocol.send( + await _protocol.send( payload: $payload, - method: 'PUT', + method: 'POST', requestUri: - '/evaluation-forms/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationFormId)}', + '/agent-status/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(agentStatusId)}', exceptionFnMap: _exceptionFns, ); - return UpdateEvaluationFormResponse.fromJson(response); } /// This API is in preview release for Amazon Connect and is subject to /// change. /// - /// Updates the hours of operation. + /// Adds or updates user-defined contact information associated with the + /// specified contact. At least one field to be updated must be present in the + /// request. + /// + /// You can add or update user-defined contact information for both ongoing + /// and completed contacts. + /// /// - /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. /// - /// Parameter [hoursOfOperationId] : - /// The identifier of the hours of operation. + /// Parameter [contactId] : + /// The identifier of the contact. This is the identifier of the contact + /// associated with the first interaction with your contact center. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [config] : - /// Configuration information of the hours of operation. - /// /// Parameter [description] : - /// The description of the hours of operation. + /// The description of the contact. /// /// Parameter [name] : - /// The name of the hours of operation. + /// The name of the contact. /// - /// Parameter [timeZone] : - /// The time zone of the hours of operation. - Future updateHoursOfOperation({ - required String hoursOfOperationId, + /// Parameter [references] : + /// Well-formed data on contact, shown to agents on Contact Control Panel + /// (CCP). + Future updateContact({ + required String contactId, required String instanceId, - List? config, String? description, String? name, - String? timeZone, + Map? references, }) async { final $payload = { - if (config != null) 'Config': config, if (description != null) 'Description': description, if (name != null) 'Name': name, - if (timeZone != null) 'TimeZone': timeZone, + if (references != null) 'References': references, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/hours-of-operations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(hoursOfOperationId)}', + '/contacts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. + /// Creates or updates user-defined contact attributes associated with the + /// specified contact. /// - /// Updates the value for the specified attribute type. + /// You can create or update user-defined attributes for both ongoing and + /// completed contacts. For example, while the call is active, you can update + /// the customer's name or the reason the customer called. You can add notes + /// about steps that the agent took during the call that display to the next + /// agent that takes the call. You can also update attributes for a contact + /// using data from your CRM application and save the data with the contact in + /// Amazon Connect. You could also flag calls for additional analysis, such as + /// legal review or to identify abusive callers. + /// + /// Contact attributes are available in Amazon Connect for 24 months, and are + /// then deleted. For information about contact record retention and the + /// maximum size of the contact record attributes section, see Feature + /// specifications in the Amazon Connect Administrator Guide. /// - /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. /// - /// Parameter [attributeType] : - /// The type of attribute. - /// - /// Only allowlisted customers can consume USE_CUSTOM_TTS_VOICES. To access - /// this feature, contact Amazon Web Services Support for allowlisting. - /// + /// Parameter [attributes] : + /// The Amazon Connect attributes. These attributes can be accessed in flows + /// just like any other contact attributes. + /// + /// You can have up to 32,768 UTF-8 bytes across all attributes for a contact. + /// Attribute keys can include only alphanumeric, dash, and underscore + /// characters. + /// + /// When the attributes for a contact exceed 32 KB, the contact is routed down + /// the Error branch of the flow. As a mitigation, consider the following + /// options: + /// + ///
        + ///
      • + /// Remove unnecessary attributes by setting their values to empty. + ///
      • + ///
      • + /// If the attributes are only used in one flow and don't need to be referred + /// to outside of that flow (for example, by a Lambda or another flow), then + /// use flow attributes. This way you aren't needlessly persisting the 32 KB + /// of information from one flow to another. For more information, see Flow + /// block: Set contact attributes in the Amazon Connect Administrator + /// Guide. + ///
      • + ///
      + /// + /// Parameter [initialContactId] : + /// The identifier of the contact. This is the identifier of the contact + /// associated with the first interaction with the contact center. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - /// - /// Parameter [value] : - /// The value for the attribute. Maximum character limit is 100. - Future updateInstanceAttribute({ - required InstanceAttributeType attributeType, + Future updateContactAttributes({ + required Map attributes, + required String initialContactId, required String instanceId, - required String value, }) async { final $payload = { - 'Value': value, + 'Attributes': attributes, + 'InitialContactId': initialContactId, + 'InstanceId': instanceId, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/instance/${Uri.encodeComponent(instanceId)}/attribute/${Uri.encodeComponent(attributeType.toValue())}', + requestUri: '/contact/attributes', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Updates an existing configuration for a resource type. This API is - /// idempotent. + /// Updates details about a contact evaluation in the specified Amazon Connect + /// instance. A contact evaluation must be in draft state. Answers included in + /// the request are merged with existing answers for the given evaluation. An + /// answer or note can be deleted by passing an empty object ({}) + /// to the question identifier. /// - /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. - /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// May throw [ResourceConflictException]. /// - /// Parameter [associationId] : - /// The existing association identifier that uniquely identifies the resource - /// type and storage config for the given instance ID. + /// Parameter [evaluationId] : + /// A unique identifier for the contact evaluation. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [resourceType] : - /// A valid resource type. - Future updateInstanceStorageConfig({ - required String associationId, + /// Parameter [answers] : + /// A map of question identifiers to answer value. + /// + /// Parameter [notes] : + /// A map of question identifiers to note value. + Future updateContactEvaluation({ + required String evaluationId, required String instanceId, - required InstanceStorageResourceType resourceType, - required InstanceStorageConfig storageConfig, + Map? answers, + Map? notes, }) async { - final $query = >{ - 'resourceType': [resourceType.toValue()], - }; final $payload = { - 'StorageConfig': storageConfig, + if (answers != null) 'Answers': answers, + if (notes != null) 'Notes': notes, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/instance/${Uri.encodeComponent(instanceId)}/storage-config/${Uri.encodeComponent(associationId)}', - queryParams: $query, + '/contact-evaluations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationId)}', exceptionFnMap: _exceptionFns, ); + return UpdateContactEvaluationResponse.fromJson(response); } - /// Updates timeouts for when human chat participants are to be considered - /// idle, and when agents are automatically disconnected from a chat due to - /// idleness. You can set four timers: + /// Updates the specified flow. /// - ///
        - ///
      • - /// Customer idle timeout - ///
      • - ///
      • - /// Customer auto-disconnect timeout - ///
      • - ///
      • - /// Agent idle timeout - ///
      • - ///
      • - /// Agent auto-disconnect timeout - ///
      • - ///
      - /// For more information about how chat timeouts work, see Set - /// up chat timeouts for human participants. + /// You can also create and update flows using the Amazon + /// Connect Flow language. + /// + /// Use the $SAVED alias in the request to describe the + /// SAVED content of a Flow. For example, + /// arn:aws:.../contact-flow/{id}:$SAVED. Once a contact flow is + /// published, $SAVED needs to be supplied to view saved content + /// that has not been published. /// /// May throw [InvalidRequestException]. + /// May throw [InvalidContactFlowException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [channelConfiguration] : - /// The Amazon Connect channel you want to configure. + /// Parameter [contactFlowId] : + /// The identifier of the flow. /// - /// Parameter [contactId] : - /// The identifier of the contact in this instance of Amazon Connect. + /// Parameter [content] : + /// The JSON string that represents the content of the flow. For an example, + /// see Example + /// flow in Amazon Connect Flow language. + /// + /// Length Constraints: Minimum length of 1. Maximum length of 256000. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future updateParticipantRoleConfig({ - required UpdateParticipantRoleConfigChannelInfo channelConfiguration, - required String contactId, + /// The identifier of the Amazon Connect instance. + Future updateContactFlowContent({ + required String contactFlowId, + required String content, required String instanceId, }) async { final $payload = { - 'ChannelConfiguration': channelConfiguration, + 'Content': content, }; final response = await _protocol.send( payload: $payload, - method: 'PUT', + method: 'POST', requestUri: - '/contact/participant-role-config/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', - exceptionFnMap: _exceptionFns, - ); - } - - /// Updates your claimed phone number from its current Amazon Connect instance - /// or traffic distribution group to another Amazon Connect instance or - /// traffic distribution group in the same Amazon Web Services Region. - /// - /// After using this API, you must verify that the phone number is attached to - /// the correct flow in the target instance or traffic distribution group. You - /// need to do this because the API switches only the phone number to a new - /// instance or traffic distribution group. It doesn't migrate the flow - /// configuration of the phone number, too. - /// - /// You can call DescribePhoneNumber - /// API to verify the status of a previous UpdatePhoneNumber - /// operation. - /// - /// - /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. - /// May throw [ResourceInUseException]. - /// May throw [IdempotencyException]. - /// May throw [AccessDeniedException]. - /// - /// Parameter [phoneNumberId] : - /// A unique identifier for the phone number. - /// - /// Parameter [targetArn] : - /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. - /// - /// Parameter [clientToken] : - /// A unique, case-sensitive identifier that you provide to ensure the - /// idempotency of the request. If not provided, the Amazon Web Services SDK - /// populates this field. For more information about idempotency, see Making - /// retries safe with idempotent APIs. - Future updatePhoneNumber({ - required String phoneNumberId, - required String targetArn, - String? clientToken, - }) async { - final $payload = { - 'TargetArn': targetArn, - 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), - }; - final response = await _protocol.send( - payload: $payload, - method: 'PUT', - requestUri: '/phone-number/${Uri.encodeComponent(phoneNumberId)}', + '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/content', exceptionFnMap: _exceptionFns, ); - return UpdatePhoneNumberResponse.fromJson(response); } - /// Updates a prompt. + /// Updates metadata about specified flow. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [contactFlowId] : + /// The identifier of the flow. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [promptId] : - /// A unique identifier for the prompt. + /// Parameter [contactFlowState] : + /// The state of flow. /// /// Parameter [description] : - /// A description of the prompt. + /// The description of the flow. /// /// Parameter [name] : - /// The name of the prompt. - /// - /// Parameter [s3Uri] : - /// The URI for the S3 bucket where the prompt is stored. - Future updatePrompt({ + /// The name of the flow. + Future updateContactFlowMetadata({ + required String contactFlowId, required String instanceId, - required String promptId, + ContactFlowState? contactFlowState, String? description, String? name, - String? s3Uri, }) async { final $payload = { + if (contactFlowState != null) + 'ContactFlowState': contactFlowState.toValue(), if (description != null) 'Description': description, if (name != null) 'Name': name, - if (s3Uri != null) 'S3Uri': s3Uri, }; final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/prompts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(promptId)}', + '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/metadata', exceptionFnMap: _exceptionFns, ); - return UpdatePromptResponse.fromJson(response); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. + /// Updates specified flow module for the specified Amazon Connect instance. /// - /// Updates the hours of operation for the specified queue. + /// Use the $SAVED alias in the request to describe the + /// SAVED content of a Flow. For example, + /// arn:aws:.../contact-flow/{id}:$SAVED. Once a contact flow is + /// published, $SAVED needs to be supplied to view saved content + /// that has not been published. /// + /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. + /// May throw [InvalidContactFlowModuleException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [hoursOfOperationId] : - /// The identifier for the hours of operation. + /// Parameter [contactFlowModuleId] : + /// The identifier of the flow module. + /// + /// Parameter [content] : + /// The JSON string that represents the content of the flow. For an example, + /// see Example + /// flow in Amazon Connect Flow language. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - /// - /// Parameter [queueId] : - /// The identifier for the queue. - Future updateQueueHoursOfOperation({ - required String hoursOfOperationId, + Future updateContactFlowModuleContent({ + required String contactFlowModuleId, + required String content, required String instanceId, - required String queueId, }) async { final $payload = { - 'HoursOfOperationId': hoursOfOperationId, + 'Content': content, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/hours-of-operation', + '/contact-flow-modules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowModuleId)}/content', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Updates the maximum number of contacts allowed in a queue before it is - /// considered full. + /// Updates metadata about specified flow module. /// + /// May throw [AccessDeniedException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [contactFlowModuleId] : + /// The identifier of the flow module. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [queueId] : - /// The identifier for the queue. + /// Parameter [description] : + /// The description of the flow module. /// - /// Parameter [maxContacts] : - /// The maximum number of contacts that can be in the queue before it is - /// considered full. - Future updateQueueMaxContacts({ + /// Parameter [name] : + /// The name of the flow module. + /// + /// Parameter [state] : + /// The state of flow module. + Future updateContactFlowModuleMetadata({ + required String contactFlowModuleId, required String instanceId, - required String queueId, - int? maxContacts, + String? description, + String? name, + ContactFlowModuleState? state, }) async { - _s.validateNumRange( - 'maxContacts', - maxContacts, - 0, - 1152921504606846976, - ); final $payload = { - if (maxContacts != null) 'MaxContacts': maxContacts, + if (description != null) 'Description': description, + if (name != null) 'Name': name, + if (state != null) 'State': state.toValue(), }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/max-contacts', + '/contact-flow-modules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowModuleId)}/metadata', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. + /// The name of the flow. /// - /// Updates the name and description of a queue. At least Name or - /// Description must be provided. + /// You can also create and update flows using the Amazon + /// Connect Flow language. /// - /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// Parameter [contactFlowId] : + /// The identifier of the flow. /// - /// Parameter [queueId] : - /// The identifier for the queue. + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. /// /// Parameter [description] : - /// The description of the queue. + /// The description of the flow. /// /// Parameter [name] : - /// The name of the queue. - Future updateQueueName({ + /// The name of the flow. + Future updateContactFlowName({ + required String contactFlowId, required String instanceId, - required String queueId, String? description, String? name, }) async { @@ -8813,399 +12230,554 @@ class Connect { if (description != null) 'Description': description, if (name != null) 'Name': name, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/name', + '/contact-flows/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactFlowId)}/name', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Updates the outbound caller ID name, number, and outbound whisper flow for - /// a specified queue. - /// - /// If the number being used in the input is claimed to a traffic distribution - /// group, and you are calling this API using an instance in the Amazon Web - /// Services Region where the traffic distribution group was created, you can - /// use either a full phone number ARN or UUID value for the - /// OutboundCallerIdNumberId value of the OutboundCallerConfig - /// request body parameter. However, if the number is claimed to a traffic - /// distribution group and you are calling this API using an instance in the - /// alternate Amazon Web Services Region associated with the traffic - /// distribution group, you must provide a full phone number ARN. If a UUID is - /// provided in this scenario, you will receive a - /// ResourceNotFoundException. - /// + /// Updates routing priority and age on the contact (QueuePriority and + /// QueueTimeAdjustmentInSeconds). These properties can be used to + /// change a customer's position in the queue. For example, you can move a + /// contact to the back of the queue by setting a lower routing priority + /// relative to other contacts in queue; or you can move a contact to the + /// front of the queue by increasing the routing age which will make the + /// contact look artificially older and therefore higher up in the + /// first-in-first-out routing order. Note that adjusting the routing age of a + /// contact affects only its position in queue, and not its actual queue wait + /// time as reported through metrics. These properties can also be updated by + /// using the + /// Set routing priority / age flow block. + /// + /// Either QueuePriority or QueueTimeAdjustmentInSeconds should + /// be provided within the request body, but not both. + /// /// - /// May throw [InvalidRequestException]. + /// May throw [ResourceConflictException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [outboundCallerConfig] : - /// The outbound caller ID name, number, and outbound whisper flow. - /// - /// Parameter [queueId] : - /// The identifier for the queue. - Future updateQueueOutboundCallerConfig({ + /// Parameter [queuePriority] : + /// Priority of the contact in the queue. The default priority for new + /// contacts is 5. You can raise the priority of a contact compared to other + /// contacts in the queue by assigning them a higher priority, such as 1 or 2. + /// + /// Parameter [queueTimeAdjustmentSeconds] : + /// The number of seconds to add or subtract from the contact's routing age. + /// Contacts are routed to agents on a first-come, first-serve basis. This + /// means that changing their amount of time in queue compared to others also + /// changes their position in queue. + Future updateContactRoutingData({ + required String contactId, required String instanceId, - required OutboundCallerConfig outboundCallerConfig, - required String queueId, + int? queuePriority, + int? queueTimeAdjustmentSeconds, }) async { + _s.validateNumRange( + 'queuePriority', + queuePriority, + 1, + 9223372036854776000.0, + ); final $payload = { - 'OutboundCallerConfig': outboundCallerConfig, + if (queuePriority != null) 'QueuePriority': queuePriority, + if (queueTimeAdjustmentSeconds != null) + 'QueueTimeAdjustmentSeconds': queueTimeAdjustmentSeconds, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/outbound-caller-config', + '/contacts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}/routing-data', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Updates the status of the queue. + /// Updates the scheduled time of a task contact that is already scheduled. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. + /// May throw [LimitExceededException]. /// May throw [InternalServiceException]. /// + /// Parameter [contactId] : + /// The identifier of the contact. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [queueId] : - /// The identifier for the queue. - /// - /// Parameter [status] : - /// The status of the queue. - Future updateQueueStatus({ + /// Parameter [scheduledTime] : + /// The timestamp, in Unix Epoch seconds format, at which to start running the + /// inbound flow. The scheduled time cannot be in the past. It must be within + /// up to 6 days in future. + Future updateContactSchedule({ + required String contactId, required String instanceId, - required String queueId, - required QueueStatus status, + required DateTime scheduledTime, }) async { final $payload = { - 'Status': status.toValue(), + 'ContactId': contactId, + 'InstanceId': instanceId, + 'ScheduledTime': unixTimestampToJson(scheduledTime), }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: - '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/status', + requestUri: '/contact/schedule', exceptionFnMap: _exceptionFns, ); } - /// Updates the configuration settings for the specified quick connect. + /// Updates details about a specific evaluation form version in the specified + /// Amazon Connect instance. Question and section identifiers cannot be + /// duplicated within the same evaluation form. + /// + /// This operation does not support partial updates. Instead it does a full + /// update of evaluation form content. /// - /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ResourceConflictException]. + /// + /// Parameter [evaluationFormId] : + /// The unique identifier for the evaluation form. + /// + /// Parameter [evaluationFormVersion] : + /// A version of the evaluation form to update. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [quickConnectConfig] : - /// Information about the configuration settings for the quick connect. + /// Parameter [items] : + /// Items that are part of the evaluation form. The total number of sections + /// and questions must not exceed 100 each. Questions must be contained in a + /// section. /// - /// Parameter [quickConnectId] : - /// The identifier for the quick connect. - Future updateQuickConnectConfig({ + /// Parameter [title] : + /// A title of the evaluation form. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [createNewVersion] : + /// A flag indicating whether the operation must create a new version. + /// + /// Parameter [description] : + /// The description of the evaluation form. + /// + /// Parameter [scoringStrategy] : + /// A scoring strategy of the evaluation form. + Future updateEvaluationForm({ + required String evaluationFormId, + required int evaluationFormVersion, required String instanceId, - required QuickConnectConfig quickConnectConfig, - required String quickConnectId, + required List items, + required String title, + String? clientToken, + bool? createNewVersion, + String? description, + EvaluationFormScoringStrategy? scoringStrategy, }) async { + _s.validateNumRange( + 'evaluationFormVersion', + evaluationFormVersion, + 1, + 1152921504606846976, + isRequired: true, + ); final $payload = { - 'QuickConnectConfig': quickConnectConfig, + 'EvaluationFormVersion': evaluationFormVersion, + 'Items': items, + 'Title': title, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (createNewVersion != null) 'CreateNewVersion': createNewVersion, + if (description != null) 'Description': description, + if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, - method: 'POST', + method: 'PUT', requestUri: - '/quick-connects/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(quickConnectId)}/config', + '/evaluation-forms/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(evaluationFormId)}', exceptionFnMap: _exceptionFns, ); + return UpdateEvaluationFormResponse.fromJson(response); } - /// Updates the name and description of a quick connect. The request accepts - /// the following data in JSON format. At least Name or - /// Description must be provided. + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates the hours of operation. /// + /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [hoursOfOperationId] : + /// The identifier of the hours of operation. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [quickConnectId] : - /// The identifier for the quick connect. + /// Parameter [config] : + /// Configuration information of the hours of operation. /// /// Parameter [description] : - /// The description of the quick connect. + /// The description of the hours of operation. /// /// Parameter [name] : - /// The name of the quick connect. - Future updateQuickConnectName({ + /// The name of the hours of operation. + /// + /// Parameter [timeZone] : + /// The time zone of the hours of operation. + Future updateHoursOfOperation({ + required String hoursOfOperationId, required String instanceId, - required String quickConnectId, + List? config, String? description, String? name, + String? timeZone, }) async { final $payload = { + if (config != null) 'Config': config, if (description != null) 'Description': description, if (name != null) 'Name': name, + if (timeZone != null) 'TimeZone': timeZone, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/quick-connects/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(quickConnectId)}/name', + '/hours-of-operations/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(hoursOfOperationId)}', exceptionFnMap: _exceptionFns, ); } - /// Updates the channels that agents can handle in the Contact Control Panel - /// (CCP) for a routing profile. + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates the value for the specified attribute type. /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. + /// + /// Parameter [attributeType] : + /// The type of attribute. + /// + /// Only allowlisted customers can consume USE_CUSTOM_TTS_VOICES. To access + /// this feature, contact Amazon Web Services Support for allowlisting. + /// /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [mediaConcurrencies] : - /// The channels that agents can handle in the Contact Control Panel (CCP). - /// - /// Parameter [routingProfileId] : - /// The identifier of the routing profile. - Future updateRoutingProfileConcurrency({ + /// Parameter [value] : + /// The value for the attribute. Maximum character limit is 100. + Future updateInstanceAttribute({ + required InstanceAttributeType attributeType, required String instanceId, - required List mediaConcurrencies, - required String routingProfileId, + required String value, }) async { final $payload = { - 'MediaConcurrencies': mediaConcurrencies, + 'Value': value, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/concurrency', + '/instance/${Uri.encodeComponent(instanceId)}/attribute/${Uri.encodeComponent(attributeType.toValue())}', exceptionFnMap: _exceptionFns, ); } - /// Updates the default outbound queue of a routing profile. + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates an existing configuration for a resource type. This API is + /// idempotent. /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. /// - /// Parameter [defaultOutboundQueueId] : - /// The identifier for the default outbound queue. + /// Parameter [associationId] : + /// The existing association identifier that uniquely identifies the resource + /// type and storage config for the given instance ID. /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [routingProfileId] : - /// The identifier of the routing profile. - Future updateRoutingProfileDefaultOutboundQueue({ - required String defaultOutboundQueueId, + /// Parameter [resourceType] : + /// A valid resource type. + Future updateInstanceStorageConfig({ + required String associationId, required String instanceId, - required String routingProfileId, + required InstanceStorageResourceType resourceType, + required InstanceStorageConfig storageConfig, }) async { + final $query = >{ + 'resourceType': [resourceType.toValue()], + }; final $payload = { - 'DefaultOutboundQueueId': defaultOutboundQueueId, + 'StorageConfig': storageConfig, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/default-outbound-queue', + '/instance/${Uri.encodeComponent(instanceId)}/storage-config/${Uri.encodeComponent(associationId)}', + queryParams: $query, exceptionFnMap: _exceptionFns, ); } - /// Updates the name and description of a routing profile. The request accepts - /// the following data in JSON format. At least Name or - /// Description must be provided. + /// Updates timeouts for when human chat participants are to be considered + /// idle, and when agents are automatically disconnected from a chat due to + /// idleness. You can set four timers: /// - /// May throw [DuplicateResourceException]. - /// May throw [InvalidRequestException]. - /// May throw [InvalidParameterException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ThrottlingException]. + ///
        + ///
      • + /// Customer idle timeout + ///
      • + ///
      • + /// Customer auto-disconnect timeout + ///
      • + ///
      • + /// Agent idle timeout + ///
      • + ///
      • + /// Agent auto-disconnect timeout + ///
      • + ///
      + /// For more information about how chat timeouts work, see Set + /// up chat timeouts for human participants. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [channelConfiguration] : + /// The Amazon Connect channel you want to configure. + /// + /// Parameter [contactId] : + /// The identifier of the contact in this instance of Amazon Connect. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - /// - /// Parameter [routingProfileId] : - /// The identifier of the routing profile. - /// - /// Parameter [description] : - /// The description of the routing profile. Must not be more than 250 - /// characters. - /// - /// Parameter [name] : - /// The name of the routing profile. Must not be more than 127 characters. - Future updateRoutingProfileName({ + Future updateParticipantRoleConfig({ + required UpdateParticipantRoleConfigChannelInfo channelConfiguration, + required String contactId, required String instanceId, - required String routingProfileId, - String? description, - String? name, }) async { final $payload = { - if (description != null) 'Description': description, - if (name != null) 'Name': name, + 'ChannelConfiguration': channelConfiguration, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, - method: 'POST', + method: 'PUT', requestUri: - '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/name', + '/contact/participant-role-config/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(contactId)}', exceptionFnMap: _exceptionFns, ); } - /// Updates the properties associated with a set of queues for a routing - /// profile. + /// Updates your claimed phone number from its current Amazon Connect instance + /// or traffic distribution group to another Amazon Connect instance or + /// traffic distribution group in the same Amazon Web Services Region. + /// + /// After using this API, you must verify that the phone number is attached to + /// the correct flow in the target instance or traffic distribution group. You + /// need to do this because the API switches only the phone number to a new + /// instance or traffic distribution group. It doesn't migrate the flow + /// configuration of the phone number, too. + /// + /// You can call DescribePhoneNumber + /// API to verify the status of a previous UpdatePhoneNumber + /// operation. + /// /// - /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. + /// May throw [ResourceInUseException]. + /// May throw [IdempotencyException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [phoneNumberId] : + /// A unique identifier for the phone number. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// the instance ID in the Amazon Resource Name (ARN) of the instance. You + /// must enter InstanceId or TargetArn. /// - /// Parameter [queueConfigs] : - /// The queues to be updated for this routing profile. Queues must first be - /// associated to the routing profile. You can do this using - /// AssociateRoutingProfileQueues. + /// Parameter [targetArn] : + /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic + /// distribution groups that phone number inbound traffic is routed through. + /// You must enter InstanceId or TargetArn. + Future updatePhoneNumber({ + required String phoneNumberId, + String? clientToken, + String? instanceId, + String? targetArn, + }) async { + final $payload = { + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (instanceId != null) 'InstanceId': instanceId, + if (targetArn != null) 'TargetArn': targetArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/phone-number/${Uri.encodeComponent(phoneNumberId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdatePhoneNumberResponse.fromJson(response); + } + + /// Updates a phone number’s metadata. + /// + /// To verify the status of a previous UpdatePhoneNumberMetadata operation, + /// call the DescribePhoneNumber + /// API. + /// /// - /// Parameter [routingProfileId] : - /// The identifier of the routing profile. - Future updateRoutingProfileQueues({ - required String instanceId, - required List queueConfigs, - required String routingProfileId, + /// May throw [InvalidParameterException]. + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceInUseException]. + /// May throw [IdempotencyException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [phoneNumberId] : + /// The Amazon Resource Name (ARN) or resource ID of the phone number. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that you provide to ensure the + /// idempotency of the request. If not provided, the Amazon Web Services SDK + /// populates this field. For more information about idempotency, see Making + /// retries safe with idempotent APIs. + /// + /// Parameter [phoneNumberDescription] : + /// The description of the phone number. + Future updatePhoneNumberMetadata({ + required String phoneNumberId, + String? clientToken, + String? phoneNumberDescription, }) async { final $payload = { - 'QueueConfigs': queueConfigs, + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (phoneNumberDescription != null) + 'PhoneNumberDescription': phoneNumberDescription, }; await _protocol.send( payload: $payload, - method: 'POST', + method: 'PUT', requestUri: - '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/queues', + '/phone-number/${Uri.encodeComponent(phoneNumberId)}/metadata', exceptionFnMap: _exceptionFns, ); } - /// Updates a rule for the specified Amazon Connect instance. - /// - /// Use the Rules - /// Function language to code conditions for the rule. + /// Updates a predefined attribute for the specified Amazon Connect instance. /// /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [InternalServiceException]. /// May throw [ThrottlingException]. - /// May throw [AccessDeniedException]. - /// May throw [ResourceConflictException]. - /// - /// Parameter [actions] : - /// A list of actions to be run when the rule is triggered. - /// - /// Parameter [function] : - /// The conditions of the rule. + /// May throw [InternalServiceException]. /// /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. /// /// Parameter [name] : - /// The name of the rule. You can change the name only if - /// TriggerEventSource is one of the following values: - /// OnZendeskTicketCreate | - /// OnZendeskTicketStatusUpdate | - /// OnSalesforceCaseCreate + /// The name of the predefined attribute. /// - /// Parameter [publishStatus] : - /// The publish status of the rule. - /// - /// Parameter [ruleId] : - /// A unique identifier for the rule. - Future updateRule({ - required List actions, - required String function, + /// Parameter [values] : + /// The values of the predefined attribute. + Future updatePredefinedAttribute({ required String instanceId, required String name, - required RulePublishStatus publishStatus, - required String ruleId, + PredefinedAttributeValues? values, }) async { final $payload = { - 'Actions': actions, - 'Function': function, - 'Name': name, - 'PublishStatus': publishStatus.toValue(), + if (values != null) 'Values': values, }; await _protocol.send( payload: $payload, - method: 'PUT', + method: 'POST', requestUri: - '/rules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(ruleId)}', + '/predefined-attributes/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(name)}', exceptionFnMap: _exceptionFns, ); } - /// This API is in preview release for Amazon Connect and is subject to - /// change. - /// - /// Updates a security profile. + /// Updates a prompt. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9218,162 +12790,85 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [securityProfileId] : - /// The identifier for the security profle. - /// - /// Parameter [allowedAccessControlTags] : - /// The list of tags that a security profile uses to restrict access to - /// resources in Amazon Connect. + /// Parameter [promptId] : + /// A unique identifier for the prompt. /// /// Parameter [description] : - /// The description of the security profile. + /// A description of the prompt. /// - /// Parameter [permissions] : - /// The permissions granted to a security profile. For a list of valid - /// permissions, see List - /// of security profile permissions. + /// Parameter [name] : + /// The name of the prompt. /// - /// Parameter [tagRestrictedResources] : - /// The list of resources that a security profile applies tag restrictions to - /// in Amazon Connect. - Future updateSecurityProfile({ + /// Parameter [s3Uri] : + /// The URI for the S3 bucket where the prompt is stored. You can provide S3 + /// pre-signed URLs returned by the GetPromptFile + /// API instead of providing S3 URIs. + Future updatePrompt({ required String instanceId, - required String securityProfileId, - Map? allowedAccessControlTags, + required String promptId, String? description, - List? permissions, - List? tagRestrictedResources, + String? name, + String? s3Uri, }) async { final $payload = { - if (allowedAccessControlTags != null) - 'AllowedAccessControlTags': allowedAccessControlTags, if (description != null) 'Description': description, - if (permissions != null) 'Permissions': permissions, - if (tagRestrictedResources != null) - 'TagRestrictedResources': tagRestrictedResources, + if (name != null) 'Name': name, + if (s3Uri != null) 'S3Uri': s3Uri, }; - await _protocol.send( + final response = await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/security-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(securityProfileId)}', + '/prompts/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(promptId)}', exceptionFnMap: _exceptionFns, ); + return UpdatePromptResponse.fromJson(response); } - /// Updates details about a specific task template in the specified Amazon - /// Connect instance. This operation does not support partial updates. Instead - /// it does a full update of template content. + /// This API is in preview release for Amazon Connect and is subject to + /// change. /// - /// May throw [PropertyValidationException]. + /// Updates the hours of operation for the specified queue. + /// + /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. - /// May throw [ServiceQuotaExceededException]. /// May throw [InternalServiceException]. /// - /// Parameter [instanceId] : - /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [taskTemplateId] : - /// A unique identifier for the task template. - /// - /// Parameter [constraints] : - /// Constraints that are applicable to the fields listed. - /// - /// Parameter [contactFlowId] : - /// The identifier of the flow that runs by default when a task is created by - /// referencing this template. - /// - /// Parameter [defaults] : - /// The default values for fields when a task is created by referencing this - /// template. - /// - /// Parameter [description] : - /// The description of the task template. - /// - /// Parameter [fields] : - /// Fields that are part of the template. - /// - /// Parameter [name] : - /// The name of the task template. - /// - /// Parameter [status] : - /// Marks a template as ACTIVE or INACTIVE for a - /// task to refer to it. Tasks can only be created from ACTIVE - /// templates. If a template is marked as INACTIVE, then a task - /// that refers to this template cannot be created. - Future updateTaskTemplate({ + /// Parameter [queueId] : + /// The identifier for the queue. + Future updateQueueHoursOfOperation({ + required String hoursOfOperationId, required String instanceId, - required String taskTemplateId, - TaskTemplateConstraints? constraints, - String? contactFlowId, - TaskTemplateDefaults? defaults, - String? description, - List? fields, - String? name, - TaskTemplateStatus? status, + required String queueId, }) async { final $payload = { - if (constraints != null) 'Constraints': constraints, - if (contactFlowId != null) 'ContactFlowId': contactFlowId, - if (defaults != null) 'Defaults': defaults, - if (description != null) 'Description': description, - if (fields != null) 'Fields': fields, - if (name != null) 'Name': name, - if (status != null) 'Status': status.toValue(), + 'HoursOfOperationId': hoursOfOperationId, }; - final response = await _protocol.send( + await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/instance/${Uri.encodeComponent(instanceId)}/task/template/${Uri.encodeComponent(taskTemplateId)}', + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/hours-of-operation', exceptionFnMap: _exceptionFns, ); - return UpdateTaskTemplateResponse.fromJson(response); } - /// Updates the traffic distribution for a given traffic distribution group. - /// - /// For more information about updating a traffic distribution group, see Update - /// telephony traffic distribution across Amazon Web Services Regions in - /// the Amazon Connect Administrator Guide. - /// - /// May throw [InvalidRequestException]. - /// May throw [AccessDeniedException]. - /// May throw [ResourceNotFoundException]. - /// May throw [ResourceConflictException]. - /// May throw [ThrottlingException]. - /// May throw [InternalServiceException]. - /// - /// Parameter [id] : - /// The identifier of the traffic distribution group. This can be the ID or - /// the ARN if the API is being called in the Region where the traffic - /// distribution group was created. The ARN must be provided if the call is - /// from the replicated Region. + /// This API is in preview release for Amazon Connect and is subject to + /// change. /// - /// Parameter [telephonyConfig] : - /// The distribution of traffic between the instance and its replica(s). - Future updateTrafficDistribution({ - required String id, - TelephonyConfig? telephonyConfig, - }) async { - final $payload = { - if (telephonyConfig != null) 'TelephonyConfig': telephonyConfig, - }; - final response = await _protocol.send( - payload: $payload, - method: 'PUT', - requestUri: '/traffic-distribution/${Uri.encodeComponent(id)}', - exceptionFnMap: _exceptionFns, - ); - } - - /// Assigns the specified hierarchy group to the specified user. + /// Updates the maximum number of contacts allowed in a queue before it is + /// considered full. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9386,109 +12881,151 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [userId] : - /// The identifier of the user account. + /// Parameter [queueId] : + /// The identifier for the queue. /// - /// Parameter [hierarchyGroupId] : - /// The identifier of the hierarchy group. - Future updateUserHierarchy({ + /// Parameter [maxContacts] : + /// The maximum number of contacts that can be in the queue before it is + /// considered full. + Future updateQueueMaxContacts({ required String instanceId, - required String userId, - String? hierarchyGroupId, + required String queueId, + int? maxContacts, }) async { + _s.validateNumRange( + 'maxContacts', + maxContacts, + 0, + 1152921504606846976, + ); final $payload = { - if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId, + if (maxContacts != null) 'MaxContacts': maxContacts, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/hierarchy', + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/max-contacts', exceptionFnMap: _exceptionFns, ); } - /// Updates the name of the user hierarchy group. + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates the name and description of a queue. At least Name or + /// Description must be provided. /// + /// May throw [DuplicateResourceException]. /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. - /// May throw [DuplicateResourceException]. /// May throw [ResourceNotFoundException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [hierarchyGroupId] : - /// The identifier of the hierarchy group. - /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// + /// Parameter [queueId] : + /// The identifier for the queue. + /// + /// Parameter [description] : + /// The description of the queue. + /// /// Parameter [name] : - /// The name of the hierarchy group. Must not be more than 100 characters. - Future updateUserHierarchyGroupName({ - required String hierarchyGroupId, + /// The name of the queue. + Future updateQueueName({ required String instanceId, - required String name, + required String queueId, + String? description, + String? name, }) async { final $payload = { - 'Name': name, + if (description != null) 'Description': description, + if (name != null) 'Name': name, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/user-hierarchy-groups/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(hierarchyGroupId)}/name', + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/name', exceptionFnMap: _exceptionFns, ); } - /// Updates the user hierarchy structure: add, remove, and rename user - /// hierarchy levels. + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates the outbound caller ID name, number, and outbound whisper flow for + /// a specified queue. + /// + ///
        + ///
      • + /// If the phone number is claimed to a traffic distribution group that was + /// created in the same Region as the Amazon Connect instance where you are + /// calling this API, then you can use a full phone number ARN or a UUID for + /// OutboundCallerIdNumberId. However, if the phone number is + /// claimed to a traffic distribution group that is in one Region, and you are + /// calling this API from an instance in another Amazon Web Services Region + /// that is associated with the traffic distribution group, you must provide a + /// full phone number ARN. If a UUID is provided in this scenario, you will + /// receive a ResourceNotFoundException. + ///
      • + ///
      • + /// Only use the phone number ARN format that doesn't contain + /// instance in the path, for example, + /// arn:aws:connect:us-east-1:1234567890:phone-number/uuid. This + /// is the same ARN format that is returned when you call the ListPhoneNumbersV2 + /// API. + ///
      • + ///
      • + /// If you plan to use IAM policies to allow/deny access to this API for phone + /// number resources claimed to a traffic distribution group, see Allow + /// or Deny queue API actions for phone numbers in a replica Region. + ///
      • + ///
      /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. /// May throw [ResourceNotFoundException]. - /// May throw [ResourceInUseException]. /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [hierarchyStructure] : - /// The hierarchy levels to update. - /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. - Future updateUserHierarchyStructure({ - required HierarchyStructureUpdate hierarchyStructure, + /// + /// Parameter [outboundCallerConfig] : + /// The outbound caller ID name, number, and outbound whisper flow. + /// + /// Parameter [queueId] : + /// The identifier for the queue. + Future updateQueueOutboundCallerConfig({ required String instanceId, + required OutboundCallerConfig outboundCallerConfig, + required String queueId, }) async { final $payload = { - 'HierarchyStructure': hierarchyStructure, + 'OutboundCallerConfig': outboundCallerConfig, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/user-hierarchy-structure/${Uri.encodeComponent(instanceId)}', + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/outbound-caller-config', exceptionFnMap: _exceptionFns, ); } - /// Updates the identity information for the specified user. - /// - /// We strongly recommend limiting who has the ability to invoke - /// UpdateUserIdentityInfo. Someone with that ability can change - /// the login credentials of other users by changing their email address. This - /// poses a security risk to your organization. They can change the email - /// address of a user to the attacker's email address, and then reset the - /// password through email. For more information, see Best - /// Practices for Security Profiles in the Amazon Connect Administrator - /// Guide. - /// + /// This API is in preview release for Amazon Connect and is subject to + /// change. + /// + /// Updates the status of the queue. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9496,34 +13033,34 @@ class Connect { /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// - /// Parameter [identityInfo] : - /// The identity information for the user. - /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [userId] : - /// The identifier of the user account. - Future updateUserIdentityInfo({ - required UserIdentityInfo identityInfo, + /// Parameter [queueId] : + /// The identifier for the queue. + /// + /// Parameter [status] : + /// The status of the queue. + Future updateQueueStatus({ required String instanceId, - required String userId, + required String queueId, + required QueueStatus status, }) async { final $payload = { - 'IdentityInfo': identityInfo, + 'Status': status.toValue(), }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/identity-info', + '/queues/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(queueId)}/status', exceptionFnMap: _exceptionFns, ); } - /// Updates the phone configuration settings for the specified user. + /// Updates the configuration settings for the specified quick connect. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9536,29 +13073,31 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [phoneConfig] : - /// Information about phone configuration settings for the user. + /// Parameter [quickConnectConfig] : + /// Information about the configuration settings for the quick connect. /// - /// Parameter [userId] : - /// The identifier of the user account. - Future updateUserPhoneConfig({ + /// Parameter [quickConnectId] : + /// The identifier for the quick connect. + Future updateQuickConnectConfig({ required String instanceId, - required UserPhoneConfig phoneConfig, - required String userId, + required QuickConnectConfig quickConnectConfig, + required String quickConnectId, }) async { final $payload = { - 'PhoneConfig': phoneConfig, + 'QuickConnectConfig': quickConnectConfig, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/phone-config', + '/quick-connects/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(quickConnectId)}/config', exceptionFnMap: _exceptionFns, ); } - /// Assigns the specified routing profile to the specified user. + /// Updates the name and description of a quick connect. The request accepts + /// the following data in JSON format. At least Name or + /// Description must be provided. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9571,29 +13110,36 @@ class Connect { /// href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [routingProfileId] : - /// The identifier of the routing profile for the user. - /// - /// Parameter [userId] : - /// The identifier of the user account. - Future updateUserRoutingProfile({ + /// Parameter [quickConnectId] : + /// The identifier for the quick connect. + /// + /// Parameter [description] : + /// The description of the quick connect. + /// + /// Parameter [name] : + /// The name of the quick connect. + Future updateQuickConnectName({ required String instanceId, - required String routingProfileId, - required String userId, + required String quickConnectId, + String? description, + String? name, }) async { final $payload = { - 'RoutingProfileId': routingProfileId, + if (description != null) 'Description': description, + if (name != null) 'Name': name, }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/routing-profile', + '/quick-connects/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(quickConnectId)}/name', exceptionFnMap: _exceptionFns, ); } - /// Assigns the specified security profiles to the specified user. + /// Whether agents with this routing profile will have their routing order + /// calculated based on time since their last inbound contact or + /// longest idle time. /// /// May throw [InvalidRequestException]. /// May throw [InvalidParameterException]. @@ -9601,9781 +13147,14770 @@ class Connect { /// May throw [ThrottlingException]. /// May throw [InternalServiceException]. /// + /// Parameter [agentAvailabilityTimer] : + /// Whether agents with this routing profile will have their routing order + /// calculated based on time since their last inbound contact or + /// longest idle time. + /// /// Parameter [instanceId] : /// The identifier of the Amazon Connect instance. You can find /// the instance ID in the Amazon Resource Name (ARN) of the instance. /// - /// Parameter [securityProfileIds] : - /// The identifiers of the security profiles for the user. - /// - /// Parameter [userId] : - /// The identifier of the user account. - Future updateUserSecurityProfiles({ + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + Future updateRoutingProfileAgentAvailabilityTimer({ + required AgentAvailabilityTimer agentAvailabilityTimer, required String instanceId, - required List securityProfileIds, - required String userId, + required String routingProfileId, }) async { final $payload = { - 'SecurityProfileIds': securityProfileIds, + 'AgentAvailabilityTimer': agentAvailabilityTimer.toValue(), }; await _protocol.send( payload: $payload, method: 'POST', requestUri: - '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/security-profiles', + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/agent-availability-timer', exceptionFnMap: _exceptionFns, ); } -} - -/// Information about an action. -class ActionSummary { - /// The action type. - final ActionType actionType; - - ActionSummary({ - required this.actionType, - }); - factory ActionSummary.fromJson(Map json) { - return ActionSummary( - actionType: (json['ActionType'] as String).toActionType(), + /// Updates the channels that agents can handle in the Contact Control Panel + /// (CCP) for a routing profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [mediaConcurrencies] : + /// The channels that agents can handle in the Contact Control Panel (CCP). + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + Future updateRoutingProfileConcurrency({ + required String instanceId, + required List mediaConcurrencies, + required String routingProfileId, + }) async { + final $payload = { + 'MediaConcurrencies': mediaConcurrencies, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/concurrency', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final actionType = this.actionType; - return { - 'ActionType': actionType.toValue(), + /// Updates the default outbound queue of a routing profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [defaultOutboundQueueId] : + /// The identifier for the default outbound queue. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + Future updateRoutingProfileDefaultOutboundQueue({ + required String defaultOutboundQueueId, + required String instanceId, + required String routingProfileId, + }) async { + final $payload = { + 'DefaultOutboundQueueId': defaultOutboundQueueId, }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/default-outbound-queue', + exceptionFnMap: _exceptionFns, + ); } -} - -enum ActionType { - createTask, - assignContactCategory, - generateEventbridgeEvent, - sendNotification, -} - -extension ActionTypeValueExtension on ActionType { - String toValue() { - switch (this) { - case ActionType.createTask: - return 'CREATE_TASK'; - case ActionType.assignContactCategory: - return 'ASSIGN_CONTACT_CATEGORY'; - case ActionType.generateEventbridgeEvent: - return 'GENERATE_EVENTBRIDGE_EVENT'; - case ActionType.sendNotification: - return 'SEND_NOTIFICATION'; - } - } -} -extension ActionTypeFromString on String { - ActionType toActionType() { - switch (this) { - case 'CREATE_TASK': - return ActionType.createTask; - case 'ASSIGN_CONTACT_CATEGORY': - return ActionType.assignContactCategory; - case 'GENERATE_EVENTBRIDGE_EVENT': - return ActionType.generateEventbridgeEvent; - case 'SEND_NOTIFICATION': - return ActionType.sendNotification; - } - throw Exception('$this is not known in enum ActionType'); + /// Updates the name and description of a routing profile. The request accepts + /// the following data in JSON format. At least Name or + /// Description must be provided. + /// + /// May throw [DuplicateResourceException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + /// + /// Parameter [description] : + /// The description of the routing profile. Must not be more than 250 + /// characters. + /// + /// Parameter [name] : + /// The name of the routing profile. Must not be more than 127 characters. + Future updateRoutingProfileName({ + required String instanceId, + required String routingProfileId, + String? description, + String? name, + }) async { + final $payload = { + if (description != null) 'Description': description, + if (name != null) 'Name': name, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/name', + exceptionFnMap: _exceptionFns, + ); } -} - -class ActivateEvaluationFormResponse { - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; - - /// The unique identifier for the evaluation form. - final String evaluationFormId; - - /// A version of the evaluation form. - final int evaluationFormVersion; - ActivateEvaluationFormResponse({ - required this.evaluationFormArn, - required this.evaluationFormId, - required this.evaluationFormVersion, - }); - - factory ActivateEvaluationFormResponse.fromJson(Map json) { - return ActivateEvaluationFormResponse( - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormVersion: json['EvaluationFormVersion'] as int, + /// Updates the properties associated with a set of queues for a routing + /// profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [queueConfigs] : + /// The queues to be updated for this routing profile. Queues must first be + /// associated to the routing profile. You can do this using + /// AssociateRoutingProfileQueues. + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile. + Future updateRoutingProfileQueues({ + required String instanceId, + required List queueConfigs, + required String routingProfileId, + }) async { + final $payload = { + 'QueueConfigs': queueConfigs, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/routing-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(routingProfileId)}/queues', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; - final evaluationFormVersion = this.evaluationFormVersion; - return { - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, - 'EvaluationFormVersion': evaluationFormVersion, + /// Updates a rule for the specified Amazon Connect instance. + /// + /// Use the Rules + /// Function language to code conditions for the rule. + /// + /// May throw [InvalidRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceConflictException]. + /// + /// Parameter [actions] : + /// A list of actions to be run when the rule is triggered. + /// + /// Parameter [function] : + /// The conditions of the rule. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the rule. You can change the name only if + /// TriggerEventSource is one of the following values: + /// OnZendeskTicketCreate | + /// OnZendeskTicketStatusUpdate | + /// OnSalesforceCaseCreate + /// + /// Parameter [publishStatus] : + /// The publish status of the rule. + /// + /// Parameter [ruleId] : + /// A unique identifier for the rule. + Future updateRule({ + required List actions, + required String function, + required String instanceId, + required String name, + required RulePublishStatus publishStatus, + required String ruleId, + }) async { + final $payload = { + 'Actions': actions, + 'Function': function, + 'Name': name, + 'PublishStatus': publishStatus.toValue(), }; - } -} - -/// Information about the contact -/// associated to the user. -class AgentContactReference { - /// The state - /// of the contact. - final ContactState? agentContactState; - - /// The channel of the contact. - final Channel? channel; - - /// The time at which the contact was connected to an agent. - final DateTime? connectedToAgentTimestamp; - - /// The identifier of the contact in this instance of Amazon Connect. - final String? contactId; - - /// How the contact was initiated. - final ContactInitiationMethod? initiationMethod; - final QueueReference? queue; - - /// The epoch timestamp when the contact state started. - final DateTime? stateStartTimestamp; - - AgentContactReference({ - this.agentContactState, - this.channel, - this.connectedToAgentTimestamp, - this.contactId, - this.initiationMethod, - this.queue, - this.stateStartTimestamp, - }); - - factory AgentContactReference.fromJson(Map json) { - return AgentContactReference( - agentContactState: - (json['AgentContactState'] as String?)?.toContactState(), - channel: (json['Channel'] as String?)?.toChannel(), - connectedToAgentTimestamp: - timeStampFromJson(json['ConnectedToAgentTimestamp']), - contactId: json['ContactId'] as String?, - initiationMethod: - (json['InitiationMethod'] as String?)?.toContactInitiationMethod(), - queue: json['Queue'] != null - ? QueueReference.fromJson(json['Queue'] as Map) - : null, - stateStartTimestamp: timeStampFromJson(json['StateStartTimestamp']), + await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/rules/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(ruleId)}', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final agentContactState = this.agentContactState; - final channel = this.channel; - final connectedToAgentTimestamp = this.connectedToAgentTimestamp; - final contactId = this.contactId; - final initiationMethod = this.initiationMethod; - final queue = this.queue; - final stateStartTimestamp = this.stateStartTimestamp; - return { - if (agentContactState != null) - 'AgentContactState': agentContactState.toValue(), - if (channel != null) 'Channel': channel.toValue(), - if (connectedToAgentTimestamp != null) - 'ConnectedToAgentTimestamp': - unixTimestampToJson(connectedToAgentTimestamp), - if (contactId != null) 'ContactId': contactId, - if (initiationMethod != null) - 'InitiationMethod': initiationMethod.toValue(), - if (queue != null) 'Queue': queue, - if (stateStartTimestamp != null) - 'StateStartTimestamp': unixTimestampToJson(stateStartTimestamp), + /// Updates a security profile. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [securityProfileId] : + /// The identifier for the security profle. + /// + /// Parameter [allowedAccessControlHierarchyGroupId] : + /// The identifier of the hierarchy group that a security profile uses to + /// restrict access to resources in Amazon Connect. + /// + /// Parameter [allowedAccessControlTags] : + /// The list of tags that a security profile uses to restrict access to + /// resources in Amazon Connect. + /// + /// Parameter [applications] : + /// A list of the third-party application's metadata. + /// + /// Parameter [description] : + /// The description of the security profile. + /// + /// Parameter [hierarchyRestrictedResources] : + /// The list of resources that a security profile applies hierarchy + /// restrictions to in Amazon Connect. Following are acceptable ResourceNames: + /// User. + /// + /// Parameter [permissions] : + /// The permissions granted to a security profile. For a list of valid + /// permissions, see List + /// of security profile permissions. + /// + /// Parameter [tagRestrictedResources] : + /// The list of resources that a security profile applies tag restrictions to + /// in Amazon Connect. + Future updateSecurityProfile({ + required String instanceId, + required String securityProfileId, + String? allowedAccessControlHierarchyGroupId, + Map? allowedAccessControlTags, + List? applications, + String? description, + List? hierarchyRestrictedResources, + List? permissions, + List? tagRestrictedResources, + }) async { + final $payload = { + if (allowedAccessControlHierarchyGroupId != null) + 'AllowedAccessControlHierarchyGroupId': + allowedAccessControlHierarchyGroupId, + if (allowedAccessControlTags != null) + 'AllowedAccessControlTags': allowedAccessControlTags, + if (applications != null) 'Applications': applications, + if (description != null) 'Description': description, + if (hierarchyRestrictedResources != null) + 'HierarchyRestrictedResources': hierarchyRestrictedResources, + if (permissions != null) 'Permissions': permissions, + if (tagRestrictedResources != null) + 'TagRestrictedResources': tagRestrictedResources, }; - } -} - -/// Information about the agent who accepted the contact. -class AgentInfo { - /// The timestamp when the contact was connected to the agent. - final DateTime? connectedToAgentTimestamp; - - /// The identifier of the agent who accepted the contact. - final String? id; - - AgentInfo({ - this.connectedToAgentTimestamp, - this.id, - }); - - factory AgentInfo.fromJson(Map json) { - return AgentInfo( - connectedToAgentTimestamp: - timeStampFromJson(json['ConnectedToAgentTimestamp']), - id: json['Id'] as String?, + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/security-profiles/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(securityProfileId)}', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final connectedToAgentTimestamp = this.connectedToAgentTimestamp; - final id = this.id; - return { - if (connectedToAgentTimestamp != null) - 'ConnectedToAgentTimestamp': - unixTimestampToJson(connectedToAgentTimestamp), - if (id != null) 'Id': id, - }; - } -} - -/// Contains information about an agent status. -class AgentStatus { - /// The Amazon Resource Name (ARN) of the agent status. - final String? agentStatusARN; - - /// The identifier of the agent status. - final String? agentStatusId; - - /// The description of the agent status. - final String? description; - - /// The display order of the agent status. - final int? displayOrder; - - /// The name of the agent status. - final String? name; - - /// The state of the agent status. - final AgentStatusState? state; - - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; - - /// The type of agent status. - final AgentStatusType? type; - - AgentStatus({ - this.agentStatusARN, - this.agentStatusId, - this.description, - this.displayOrder, - this.name, - this.state, - this.tags, - this.type, - }); - - factory AgentStatus.fromJson(Map json) { - return AgentStatus( - agentStatusARN: json['AgentStatusARN'] as String?, - agentStatusId: json['AgentStatusId'] as String?, - description: json['Description'] as String?, - displayOrder: json['DisplayOrder'] as int?, - name: json['Name'] as String?, - state: (json['State'] as String?)?.toAgentStatusState(), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - type: (json['Type'] as String?)?.toAgentStatusType(), - ); - } - - Map toJson() { - final agentStatusARN = this.agentStatusARN; - final agentStatusId = this.agentStatusId; - final description = this.description; - final displayOrder = this.displayOrder; - final name = this.name; - final state = this.state; - final tags = this.tags; - final type = this.type; - return { - if (agentStatusARN != null) 'AgentStatusARN': agentStatusARN, - if (agentStatusId != null) 'AgentStatusId': agentStatusId, + /// Updates details about a specific task template in the specified Amazon + /// Connect instance. This operation does not support partial updates. Instead + /// it does a full update of template content. + /// + /// May throw [PropertyValidationException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [taskTemplateId] : + /// A unique identifier for the task template. + /// + /// Parameter [constraints] : + /// Constraints that are applicable to the fields listed. + /// + /// Parameter [contactFlowId] : + /// The identifier of the flow that runs by default when a task is created by + /// referencing this template. + /// + /// Parameter [defaults] : + /// The default values for fields when a task is created by referencing this + /// template. + /// + /// Parameter [description] : + /// The description of the task template. + /// + /// Parameter [fields] : + /// Fields that are part of the template. + /// + /// Parameter [name] : + /// The name of the task template. + /// + /// Parameter [status] : + /// Marks a template as ACTIVE or INACTIVE for a + /// task to refer to it. Tasks can only be created from ACTIVE + /// templates. If a template is marked as INACTIVE, then a task + /// that refers to this template cannot be created. + Future updateTaskTemplate({ + required String instanceId, + required String taskTemplateId, + TaskTemplateConstraints? constraints, + String? contactFlowId, + TaskTemplateDefaults? defaults, + String? description, + List? fields, + String? name, + TaskTemplateStatus? status, + }) async { + final $payload = { + if (constraints != null) 'Constraints': constraints, + if (contactFlowId != null) 'ContactFlowId': contactFlowId, + if (defaults != null) 'Defaults': defaults, if (description != null) 'Description': description, - if (displayOrder != null) 'DisplayOrder': displayOrder, + if (fields != null) 'Fields': fields, if (name != null) 'Name': name, - if (state != null) 'State': state.toValue(), - if (tags != null) 'Tags': tags, - if (type != null) 'Type': type.toValue(), + if (status != null) 'Status': status.toValue(), }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/instance/${Uri.encodeComponent(instanceId)}/task/template/${Uri.encodeComponent(taskTemplateId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateTaskTemplateResponse.fromJson(response); } -} - -/// Information about the agent's status. -class AgentStatusReference { - /// The Amazon Resource Name (ARN) of the agent's status. - final String? statusArn; - - /// The name of the agent status. - final String? statusName; - /// The start timestamp of the agent's status. - final DateTime? statusStartTimestamp; - - AgentStatusReference({ - this.statusArn, - this.statusName, - this.statusStartTimestamp, - }); - - factory AgentStatusReference.fromJson(Map json) { - return AgentStatusReference( - statusArn: json['StatusArn'] as String?, - statusName: json['StatusName'] as String?, - statusStartTimestamp: timeStampFromJson(json['StatusStartTimestamp']), + /// Updates the traffic distribution for a given traffic distribution group. + /// + /// The SignInConfig distribution is available only on a default + /// TrafficDistributionGroup (see the IsDefault + /// parameter in the TrafficDistributionGroup + /// data type). If you call UpdateTrafficDistribution with a + /// modified SignInConfig and a non-default + /// TrafficDistributionGroup, an + /// InvalidRequestException is returned. + /// + /// For more information about updating a traffic distribution group, see Update + /// telephony traffic distribution across Amazon Web Services Regions in + /// the Amazon Connect Administrator Guide. + /// + /// May throw [InvalidRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceConflictException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [id] : + /// The identifier of the traffic distribution group. This can be the ID or + /// the ARN if the API is being called in the Region where the traffic + /// distribution group was created. The ARN must be provided if the call is + /// from the replicated Region. + /// + /// Parameter [agentConfig] : + /// The distribution of agents between the instance and its replica(s). + /// + /// Parameter [signInConfig] : + /// The distribution that determines which Amazon Web Services Regions should + /// be used to sign in agents in to both the instance and its replica(s). + /// + /// Parameter [telephonyConfig] : + /// The distribution of traffic between the instance and its replica(s). + Future updateTrafficDistribution({ + required String id, + AgentConfig? agentConfig, + SignInConfig? signInConfig, + TelephonyConfig? telephonyConfig, + }) async { + final $payload = { + if (agentConfig != null) 'AgentConfig': agentConfig, + if (signInConfig != null) 'SignInConfig': signInConfig, + if (telephonyConfig != null) 'TelephonyConfig': telephonyConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/traffic-distribution/${Uri.encodeComponent(id)}', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final statusArn = this.statusArn; - final statusName = this.statusName; - final statusStartTimestamp = this.statusStartTimestamp; - return { - if (statusArn != null) 'StatusArn': statusArn, - if (statusName != null) 'StatusName': statusName, - if (statusStartTimestamp != null) - 'StatusStartTimestamp': unixTimestampToJson(statusStartTimestamp), + /// Assigns the specified hierarchy group to the specified user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [userId] : + /// The identifier of the user account. + /// + /// Parameter [hierarchyGroupId] : + /// The identifier of the hierarchy group. + Future updateUserHierarchy({ + required String instanceId, + required String userId, + String? hierarchyGroupId, + }) async { + final $payload = { + if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId, }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/hierarchy', + exceptionFnMap: _exceptionFns, + ); } -} - -enum AgentStatusState { - enabled, - disabled, -} -extension AgentStatusStateValueExtension on AgentStatusState { - String toValue() { - switch (this) { - case AgentStatusState.enabled: - return 'ENABLED'; - case AgentStatusState.disabled: - return 'DISABLED'; - } + /// Updates the name of the user hierarchy group. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [DuplicateResourceException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [hierarchyGroupId] : + /// The identifier of the hierarchy group. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [name] : + /// The name of the hierarchy group. Must not be more than 100 characters. + Future updateUserHierarchyGroupName({ + required String hierarchyGroupId, + required String instanceId, + required String name, + }) async { + final $payload = { + 'Name': name, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/user-hierarchy-groups/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(hierarchyGroupId)}/name', + exceptionFnMap: _exceptionFns, + ); } -} -extension AgentStatusStateFromString on String { - AgentStatusState toAgentStatusState() { - switch (this) { - case 'ENABLED': - return AgentStatusState.enabled; - case 'DISABLED': - return AgentStatusState.disabled; - } - throw Exception('$this is not known in enum AgentStatusState'); + /// Updates the user hierarchy structure: add, remove, and rename user + /// hierarchy levels. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ResourceInUseException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [hierarchyStructure] : + /// The hierarchy levels to update. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + Future updateUserHierarchyStructure({ + required HierarchyStructureUpdate hierarchyStructure, + required String instanceId, + }) async { + final $payload = { + 'HierarchyStructure': hierarchyStructure, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/user-hierarchy-structure/${Uri.encodeComponent(instanceId)}', + exceptionFnMap: _exceptionFns, + ); } -} - -/// Summary information for an agent status. -class AgentStatusSummary { - /// The Amazon Resource Name (ARN) for the agent status. - final String? arn; - - /// The identifier for an agent status. - final String? id; - - /// The name of the agent status. - final String? name; - - /// The type of the agent status. - final AgentStatusType? type; - - AgentStatusSummary({ - this.arn, - this.id, - this.name, - this.type, - }); - factory AgentStatusSummary.fromJson(Map json) { - return AgentStatusSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - type: (json['Type'] as String?)?.toAgentStatusType(), + /// Updates the identity information for the specified user. + /// + /// We strongly recommend limiting who has the ability to invoke + /// UpdateUserIdentityInfo. Someone with that ability can change + /// the login credentials of other users by changing their email address. This + /// poses a security risk to your organization. They can change the email + /// address of a user to the attacker's email address, and then reset the + /// password through email. For more information, see Best + /// Practices for Security Profiles in the Amazon Connect Administrator + /// Guide. + /// + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [identityInfo] : + /// The identity information for the user. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [userId] : + /// The identifier of the user account. + Future updateUserIdentityInfo({ + required UserIdentityInfo identityInfo, + required String instanceId, + required String userId, + }) async { + final $payload = { + 'IdentityInfo': identityInfo, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/identity-info', + exceptionFnMap: _exceptionFns, ); } - Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; - final type = this.type; - return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (type != null) 'Type': type.toValue(), + /// Updates the phone configuration settings for the specified user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [phoneConfig] : + /// Information about phone configuration settings for the user. + /// + /// Parameter [userId] : + /// The identifier of the user account. + Future updateUserPhoneConfig({ + required String instanceId, + required UserPhoneConfig phoneConfig, + required String userId, + }) async { + final $payload = { + 'PhoneConfig': phoneConfig, }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/phone-config', + exceptionFnMap: _exceptionFns, + ); } -} - -enum AgentStatusType { - routable, - custom, - offline, -} -extension AgentStatusTypeValueExtension on AgentStatusType { - String toValue() { - switch (this) { - case AgentStatusType.routable: - return 'ROUTABLE'; - case AgentStatusType.custom: - return 'CUSTOM'; - case AgentStatusType.offline: - return 'OFFLINE'; - } + /// Updates the properties associated with the proficiencies of a user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instance + /// ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [userId] : + /// The identifier of the user account. + /// + /// Parameter [userProficiencies] : + /// The proficiencies to be updated for the user. Proficiencies must first be + /// associated to the user. You can do this using AssociateUserProficiencies + /// API. + Future updateUserProficiencies({ + required String instanceId, + required String userId, + required List userProficiencies, + }) async { + final $payload = { + 'UserProficiencies': userProficiencies, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/proficiencies', + exceptionFnMap: _exceptionFns, + ); } -} -extension AgentStatusTypeFromString on String { - AgentStatusType toAgentStatusType() { - switch (this) { - case 'ROUTABLE': - return AgentStatusType.routable; - case 'CUSTOM': - return AgentStatusType.custom; - case 'OFFLINE': - return AgentStatusType.offline; - } - throw Exception('$this is not known in enum AgentStatusType'); + /// Assigns the specified routing profile to the specified user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [routingProfileId] : + /// The identifier of the routing profile for the user. + /// + /// Parameter [userId] : + /// The identifier of the user account. + Future updateUserRoutingProfile({ + required String instanceId, + required String routingProfileId, + required String userId, + }) async { + final $payload = { + 'RoutingProfileId': routingProfileId, + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/routing-profile', + exceptionFnMap: _exceptionFns, + ); } -} - -/// Configuration of the answering machine detection. -class AnswerMachineDetectionConfig { - /// Wait for the answering machine prompt. - final bool? awaitAnswerMachinePrompt; - - /// The flag to indicate if answer machine detection analysis needs to be - /// performed for a voice call. If set to true, - /// TrafficType must be set as CAMPAIGN. - final bool? enableAnswerMachineDetection; - - AnswerMachineDetectionConfig({ - this.awaitAnswerMachinePrompt, - this.enableAnswerMachineDetection, - }); - Map toJson() { - final awaitAnswerMachinePrompt = this.awaitAnswerMachinePrompt; - final enableAnswerMachineDetection = this.enableAnswerMachineDetection; - return { - if (awaitAnswerMachinePrompt != null) - 'AwaitAnswerMachinePrompt': awaitAnswerMachinePrompt, - if (enableAnswerMachineDetection != null) - 'EnableAnswerMachineDetection': enableAnswerMachineDetection, + /// Assigns the specified security profiles to the specified user. + /// + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServiceException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + /// + /// Parameter [securityProfileIds] : + /// The identifiers of the security profiles for the user. + /// + /// Parameter [userId] : + /// The identifier of the user account. + Future updateUserSecurityProfiles({ + required String instanceId, + required List securityProfileIds, + required String userId, + }) async { + final $payload = { + 'SecurityProfileIds': securityProfileIds, }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/users/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(userId)}/security-profiles', + exceptionFnMap: _exceptionFns, + ); } -} - -/// This action must be set if TriggerEventSource is one of the -/// following values: OnPostCallAnalysisAvailable | -/// OnRealTimeCallAnalysisAvailable | -/// OnPostChatAnalysisAvailable. Contact is categorized using the -/// rule name. -/// -/// RuleName is used as ContactCategory. -class AssignContactCategoryActionDefinition { - AssignContactCategoryActionDefinition(); - - factory AssignContactCategoryActionDefinition.fromJson( - Map _) { - return AssignContactCategoryActionDefinition(); - } - - Map toJson() { - return {}; - } -} - -class AssociateDefaultVocabularyResponse { - AssociateDefaultVocabularyResponse(); - factory AssociateDefaultVocabularyResponse.fromJson(Map _) { - return AssociateDefaultVocabularyResponse(); + /// Updates the view content of the given view identifier in the specified + /// Amazon Connect instance. + /// + /// It performs content validation if Status is set to + /// SAVED and performs full content validation if + /// Status is PUBLISHED. Note that the + /// $SAVED alias' content will always be updated, but the + /// $LATEST alias' content will only be updated if + /// Status is PUBLISHED. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [content] : + /// View content containing all content necessary to render a view except for + /// runtime input data and the runtime input schema, which is auto-generated + /// by this operation. + /// + /// The total uncompressed content has a maximum file size of 400kB. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [status] : + /// Indicates the view status as either SAVED or + /// PUBLISHED. The PUBLISHED status will initiate + /// validation on the content. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + Future updateViewContent({ + required ViewInputContent content, + required String instanceId, + required ViewStatus status, + required String viewId, + }) async { + final $payload = { + 'Content': content, + 'Status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateViewContentResponse.fromJson(response); } - Map toJson() { - return {}; + /// Updates the view metadata. Note that either Name or + /// Description must be provided. + /// + /// May throw [AccessDeniedException]. + /// May throw [InvalidRequestException]. + /// May throw [InvalidParameterException]. + /// May throw [ResourceNotFoundException]. + /// May throw [InternalServiceException]. + /// May throw [TooManyRequestsException]. + /// May throw [DuplicateResourceException]. + /// May throw [ResourceInUseException]. + /// + /// Parameter [instanceId] : + /// The identifier of the Amazon Connect instance. You can find the instanceId + /// in the ARN of the instance. + /// + /// Parameter [viewId] : + /// The identifier of the view. Both ViewArn and + /// ViewId can be used. + /// + /// Parameter [description] : + /// The description of the view. + /// + /// Parameter [name] : + /// The name of the view. + Future updateViewMetadata({ + required String instanceId, + required String viewId, + String? description, + String? name, + }) async { + final $payload = { + if (description != null) 'Description': description, + if (name != null) 'Name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}/metadata', + exceptionFnMap: _exceptionFns, + ); } } -class AssociateInstanceStorageConfigResponse { - /// The existing association identifier that uniquely identifies the resource - /// type and storage config for the given instance ID. - final String? associationId; +/// Information about an action. +class ActionSummary { + /// The action type. + final ActionType actionType; - AssociateInstanceStorageConfigResponse({ - this.associationId, + ActionSummary({ + required this.actionType, }); - factory AssociateInstanceStorageConfigResponse.fromJson( - Map json) { - return AssociateInstanceStorageConfigResponse( - associationId: json['AssociationId'] as String?, + factory ActionSummary.fromJson(Map json) { + return ActionSummary( + actionType: (json['ActionType'] as String).toActionType(), ); } Map toJson() { - final associationId = this.associationId; + final actionType = this.actionType; return { - if (associationId != null) 'AssociationId': associationId, + 'ActionType': actionType.toValue(), }; } } -class AssociateSecurityKeyResponse { - /// The existing association identifier that uniquely identifies the resource - /// type and storage config for the given instance ID. - final String? associationId; - - AssociateSecurityKeyResponse({ - this.associationId, - }); +enum ActionType { + createTask, + assignContactCategory, + generateEventbridgeEvent, + sendNotification, + createCase, + updateCase, + endAssociatedTasks, + submitAutoEvaluation, +} - factory AssociateSecurityKeyResponse.fromJson(Map json) { - return AssociateSecurityKeyResponse( - associationId: json['AssociationId'] as String?, - ); +extension ActionTypeValueExtension on ActionType { + String toValue() { + switch (this) { + case ActionType.createTask: + return 'CREATE_TASK'; + case ActionType.assignContactCategory: + return 'ASSIGN_CONTACT_CATEGORY'; + case ActionType.generateEventbridgeEvent: + return 'GENERATE_EVENTBRIDGE_EVENT'; + case ActionType.sendNotification: + return 'SEND_NOTIFICATION'; + case ActionType.createCase: + return 'CREATE_CASE'; + case ActionType.updateCase: + return 'UPDATE_CASE'; + case ActionType.endAssociatedTasks: + return 'END_ASSOCIATED_TASKS'; + case ActionType.submitAutoEvaluation: + return 'SUBMIT_AUTO_EVALUATION'; + } } +} - Map toJson() { - final associationId = this.associationId; - return { - if (associationId != null) 'AssociationId': associationId, - }; +extension ActionTypeFromString on String { + ActionType toActionType() { + switch (this) { + case 'CREATE_TASK': + return ActionType.createTask; + case 'ASSIGN_CONTACT_CATEGORY': + return ActionType.assignContactCategory; + case 'GENERATE_EVENTBRIDGE_EVENT': + return ActionType.generateEventbridgeEvent; + case 'SEND_NOTIFICATION': + return ActionType.sendNotification; + case 'CREATE_CASE': + return ActionType.createCase; + case 'UPDATE_CASE': + return ActionType.updateCase; + case 'END_ASSOCIATED_TASKS': + return ActionType.endAssociatedTasks; + case 'SUBMIT_AUTO_EVALUATION': + return ActionType.submitAutoEvaluation; + } + throw Exception('$this is not known in enum ActionType'); } } -/// Information about a reference when the referenceType is -/// ATTACHMENT. Otherwise, null. -class AttachmentReference { - /// Identifier of the attachment reference. - final String? name; +class ActivateEvaluationFormResponse { + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; - /// Status of the attachment reference type. - final ReferenceStatus? status; + /// The unique identifier for the evaluation form. + final String evaluationFormId; - /// The location path of the attachment reference. - final String? value; + /// A version of the evaluation form. + final int evaluationFormVersion; - AttachmentReference({ - this.name, - this.status, - this.value, + ActivateEvaluationFormResponse({ + required this.evaluationFormArn, + required this.evaluationFormId, + required this.evaluationFormVersion, }); - factory AttachmentReference.fromJson(Map json) { - return AttachmentReference( - name: json['Name'] as String?, - status: (json['Status'] as String?)?.toReferenceStatus(), - value: json['Value'] as String?, + factory ActivateEvaluationFormResponse.fromJson(Map json) { + return ActivateEvaluationFormResponse( + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormVersion: json['EvaluationFormVersion'] as int, ); } Map toJson() { - final name = this.name; - final status = this.status; - final value = this.value; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormVersion = this.evaluationFormVersion; return { - if (name != null) 'Name': name, - if (status != null) 'Status': status.toValue(), - if (value != null) 'Value': value, + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormVersion': evaluationFormVersion, }; } } -/// A toggle for an individual feature at the instance level. -class Attribute { - /// The type of attribute. - final InstanceAttributeType? attributeType; +enum AgentAvailabilityTimer { + timeSinceLastActivity, + timeSinceLastInbound, +} - /// The value of the attribute. - final String? value; +extension AgentAvailabilityTimerValueExtension on AgentAvailabilityTimer { + String toValue() { + switch (this) { + case AgentAvailabilityTimer.timeSinceLastActivity: + return 'TIME_SINCE_LAST_ACTIVITY'; + case AgentAvailabilityTimer.timeSinceLastInbound: + return 'TIME_SINCE_LAST_INBOUND'; + } + } +} - Attribute({ - this.attributeType, - this.value, +extension AgentAvailabilityTimerFromString on String { + AgentAvailabilityTimer toAgentAvailabilityTimer() { + switch (this) { + case 'TIME_SINCE_LAST_ACTIVITY': + return AgentAvailabilityTimer.timeSinceLastActivity; + case 'TIME_SINCE_LAST_INBOUND': + return AgentAvailabilityTimer.timeSinceLastInbound; + } + throw Exception('$this is not known in enum AgentAvailabilityTimer'); + } +} + +/// The distribution of agents between the instance and its replica(s). +class AgentConfig { + /// Information about traffic distributions. + final List distributions; + + AgentConfig({ + required this.distributions, }); - factory Attribute.fromJson(Map json) { - return Attribute( - attributeType: - (json['AttributeType'] as String?)?.toInstanceAttributeType(), - value: json['Value'] as String?, + factory AgentConfig.fromJson(Map json) { + return AgentConfig( + distributions: (json['Distributions'] as List) + .whereNotNull() + .map((e) => Distribution.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final attributeType = this.attributeType; - final value = this.value; + final distributions = this.distributions; return { - if (attributeType != null) 'AttributeType': attributeType.toValue(), - if (value != null) 'Value': value, + 'Distributions': distributions, }; } } -/// Information about available phone numbers. -class AvailableNumberSummary { - /// The phone number. Phone numbers are formatted [+] [country code] - /// [subscriber number including area code]. - final String? phoneNumber; +/// Information about the contact +/// associated to the user. +class AgentContactReference { + /// The state + /// of the contact. + /// + /// When AgentContactState is set to CONNECTED_ONHOLD, + /// StateStartTimestamp is not changed. Instead, + /// StateStartTimestamp reflects the time the contact was + /// CONNECTED to the agent. + /// + final ContactState? agentContactState; - /// The ISO country code. - final PhoneNumberCountryCode? phoneNumberCountryCode; + /// The channel of the contact. + final Channel? channel; - /// The type of phone number. - final PhoneNumberType? phoneNumberType; + /// The time at which the contact was connected to an agent. + final DateTime? connectedToAgentTimestamp; - AvailableNumberSummary({ - this.phoneNumber, - this.phoneNumberCountryCode, - this.phoneNumberType, + /// The identifier of the contact in this instance of Amazon Connect. + final String? contactId; + + /// How the contact was initiated. + final ContactInitiationMethod? initiationMethod; + final QueueReference? queue; + + /// The epoch timestamp when the contact state started. + final DateTime? stateStartTimestamp; + + AgentContactReference({ + this.agentContactState, + this.channel, + this.connectedToAgentTimestamp, + this.contactId, + this.initiationMethod, + this.queue, + this.stateStartTimestamp, }); - factory AvailableNumberSummary.fromJson(Map json) { - return AvailableNumberSummary( - phoneNumber: json['PhoneNumber'] as String?, - phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) - ?.toPhoneNumberCountryCode(), - phoneNumberType: - (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + factory AgentContactReference.fromJson(Map json) { + return AgentContactReference( + agentContactState: + (json['AgentContactState'] as String?)?.toContactState(), + channel: (json['Channel'] as String?)?.toChannel(), + connectedToAgentTimestamp: + timeStampFromJson(json['ConnectedToAgentTimestamp']), + contactId: json['ContactId'] as String?, + initiationMethod: + (json['InitiationMethod'] as String?)?.toContactInitiationMethod(), + queue: json['Queue'] != null + ? QueueReference.fromJson(json['Queue'] as Map) + : null, + stateStartTimestamp: timeStampFromJson(json['StateStartTimestamp']), ); } Map toJson() { - final phoneNumber = this.phoneNumber; - final phoneNumberCountryCode = this.phoneNumberCountryCode; - final phoneNumberType = this.phoneNumberType; + final agentContactState = this.agentContactState; + final channel = this.channel; + final connectedToAgentTimestamp = this.connectedToAgentTimestamp; + final contactId = this.contactId; + final initiationMethod = this.initiationMethod; + final queue = this.queue; + final stateStartTimestamp = this.stateStartTimestamp; return { - if (phoneNumber != null) 'PhoneNumber': phoneNumber, - if (phoneNumberCountryCode != null) - 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), - if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + if (agentContactState != null) + 'AgentContactState': agentContactState.toValue(), + if (channel != null) 'Channel': channel.toValue(), + if (connectedToAgentTimestamp != null) + 'ConnectedToAgentTimestamp': + unixTimestampToJson(connectedToAgentTimestamp), + if (contactId != null) 'ContactId': contactId, + if (initiationMethod != null) + 'InitiationMethod': initiationMethod.toValue(), + if (queue != null) 'Queue': queue, + if (stateStartTimestamp != null) + 'StateStartTimestamp': unixTimestampToJson(stateStartTimestamp), }; } } -enum BehaviorType { - routeCurrentChannelOnly, - routeAnyChannel, -} +/// Information about an agent hierarchy group. +class AgentHierarchyGroup { + /// The Amazon Resource Name (ARN) of the group. + final String? arn; -extension BehaviorTypeValueExtension on BehaviorType { - String toValue() { - switch (this) { - case BehaviorType.routeCurrentChannelOnly: - return 'ROUTE_CURRENT_CHANNEL_ONLY'; - case BehaviorType.routeAnyChannel: - return 'ROUTE_ANY_CHANNEL'; - } + AgentHierarchyGroup({ + this.arn, + }); + + factory AgentHierarchyGroup.fromJson(Map json) { + return AgentHierarchyGroup( + arn: json['Arn'] as String?, + ); } -} -extension BehaviorTypeFromString on String { - BehaviorType toBehaviorType() { - switch (this) { - case 'ROUTE_CURRENT_CHANNEL_ONLY': - return BehaviorType.routeCurrentChannelOnly; - case 'ROUTE_ANY_CHANNEL': - return BehaviorType.routeAnyChannel; - } - throw Exception('$this is not known in enum BehaviorType'); + Map toJson() { + final arn = this.arn; + return { + if (arn != null) 'Arn': arn, + }; } } -enum Channel { - voice, - chat, - task, -} +/// A structure that defines search criteria for contacts using agent hierarchy +/// group levels. For more information about agent hierarchies, see Set +/// Up Agent Hierarchies in the Amazon Connect Administrator Guide. +class AgentHierarchyGroups { + /// The identifiers for level 1 hierarchy groups. + final List? l1Ids; -extension ChannelValueExtension on Channel { - String toValue() { - switch (this) { - case Channel.voice: - return 'VOICE'; - case Channel.chat: - return 'CHAT'; - case Channel.task: - return 'TASK'; - } - } -} + /// The identifiers for level 2 hierarchy groups. + final List? l2Ids; -extension ChannelFromString on String { - Channel toChannel() { - switch (this) { - case 'VOICE': - return Channel.voice; - case 'CHAT': - return Channel.chat; - case 'TASK': - return Channel.task; - } - throw Exception('$this is not known in enum Channel'); - } -} + /// The identifiers for level 3 hierarchy groups. + final List? l3Ids; -/// A chat message. -class ChatMessage { - /// The content of the chat message. - /// - ///
        - ///
      • - /// For text/plain and text/markdown, the Length - /// Constraints are Minimum of 1, Maximum of 1024. - ///
      • - ///
      • - /// For application/json, the Length Constraints are Minimum of 1, - /// Maximum of 12000. - ///
      • - ///
      • - /// For - /// application/vnd.amazonaws.connect.message.interactive.response, - /// the Length Constraints are Minimum of 1, Maximum of 12288. - ///
      • - ///
      - final String content; + /// The identifiers for level 4 hierarchy groups. + final List? l4Ids; - /// The type of the content. Supported types are text/plain, - /// text/markdown, application/json, and - /// application/vnd.amazonaws.connect.message.interactive.response. - final String contentType; + /// The identifiers for level 5 hierarchy groups. + final List? l5Ids; - ChatMessage({ - required this.content, - required this.contentType, + AgentHierarchyGroups({ + this.l1Ids, + this.l2Ids, + this.l3Ids, + this.l4Ids, + this.l5Ids, }); Map toJson() { - final content = this.content; - final contentType = this.contentType; + final l1Ids = this.l1Ids; + final l2Ids = this.l2Ids; + final l3Ids = this.l3Ids; + final l4Ids = this.l4Ids; + final l5Ids = this.l5Ids; return { - 'Content': content, - 'ContentType': contentType, + if (l1Ids != null) 'L1Ids': l1Ids, + if (l2Ids != null) 'L2Ids': l2Ids, + if (l3Ids != null) 'L3Ids': l3Ids, + if (l4Ids != null) 'L4Ids': l4Ids, + if (l5Ids != null) 'L5Ids': l5Ids, }; } } -/// Configuration information for the chat participant role. -class ChatParticipantRoleConfig { - /// A list of participant timers. You can specify any unique combination of role - /// and timer type. Duplicate entries error out the request with a 400. - final List participantTimerConfigList; +/// Information about the agent who accepted the contact. +class AgentInfo { + /// Agent pause duration for a contact in seconds. + final int? agentPauseDurationInSeconds; + final ParticipantCapabilities? capabilities; - ChatParticipantRoleConfig({ - required this.participantTimerConfigList, + /// The timestamp when the contact was connected to the agent. + final DateTime? connectedToAgentTimestamp; + + /// Information regarding Agent’s device. + final DeviceInfo? deviceInfo; + + /// The agent hierarchy groups for the agent. + final HierarchyGroups? hierarchyGroups; + + /// The identifier of the agent who accepted the contact. + final String? id; + + AgentInfo({ + this.agentPauseDurationInSeconds, + this.capabilities, + this.connectedToAgentTimestamp, + this.deviceInfo, + this.hierarchyGroups, + this.id, }); + factory AgentInfo.fromJson(Map json) { + return AgentInfo( + agentPauseDurationInSeconds: json['AgentPauseDurationInSeconds'] as int?, + capabilities: json['Capabilities'] != null + ? ParticipantCapabilities.fromJson( + json['Capabilities'] as Map) + : null, + connectedToAgentTimestamp: + timeStampFromJson(json['ConnectedToAgentTimestamp']), + deviceInfo: json['DeviceInfo'] != null + ? DeviceInfo.fromJson(json['DeviceInfo'] as Map) + : null, + hierarchyGroups: json['HierarchyGroups'] != null + ? HierarchyGroups.fromJson( + json['HierarchyGroups'] as Map) + : null, + id: json['Id'] as String?, + ); + } + Map toJson() { - final participantTimerConfigList = this.participantTimerConfigList; + final agentPauseDurationInSeconds = this.agentPauseDurationInSeconds; + final capabilities = this.capabilities; + final connectedToAgentTimestamp = this.connectedToAgentTimestamp; + final deviceInfo = this.deviceInfo; + final hierarchyGroups = this.hierarchyGroups; + final id = this.id; return { - 'ParticipantTimerConfigList': participantTimerConfigList, + if (agentPauseDurationInSeconds != null) + 'AgentPauseDurationInSeconds': agentPauseDurationInSeconds, + if (capabilities != null) 'Capabilities': capabilities, + if (connectedToAgentTimestamp != null) + 'ConnectedToAgentTimestamp': + unixTimestampToJson(connectedToAgentTimestamp), + if (deviceInfo != null) 'DeviceInfo': deviceInfo, + if (hierarchyGroups != null) 'HierarchyGroups': hierarchyGroups, + if (id != null) 'Id': id, }; } } -/// The streaming configuration, such as the Amazon SNS streaming endpoint. -class ChatStreamingConfiguration { - /// The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The Amazon - /// Resource Name (ARN) of the streaming endpoint that is used to publish - /// real-time message streaming for chat conversations. - final String streamingEndpointArn; - - ChatStreamingConfiguration({ - required this.streamingEndpointArn, - }); - - Map toJson() { - final streamingEndpointArn = this.streamingEndpointArn; - return { - 'StreamingEndpointArn': streamingEndpointArn, - }; - } -} - -class ClaimPhoneNumberResponse { - /// The Amazon Resource Name (ARN) of the phone number. - final String? phoneNumberArn; - - /// A unique identifier for the phone number. - final String? phoneNumberId; +/// Information about the quality of the Agent's media connection +class AgentQualityMetrics { + /// Information about the audio quality of the Agent + final AudioQualityMetricsInfo? audio; - ClaimPhoneNumberResponse({ - this.phoneNumberArn, - this.phoneNumberId, + AgentQualityMetrics({ + this.audio, }); - factory ClaimPhoneNumberResponse.fromJson(Map json) { - return ClaimPhoneNumberResponse( - phoneNumberArn: json['PhoneNumberArn'] as String?, - phoneNumberId: json['PhoneNumberId'] as String?, + factory AgentQualityMetrics.fromJson(Map json) { + return AgentQualityMetrics( + audio: json['Audio'] != null + ? AudioQualityMetricsInfo.fromJson( + json['Audio'] as Map) + : null, ); } Map toJson() { - final phoneNumberArn = this.phoneNumberArn; - final phoneNumberId = this.phoneNumberId; + final audio = this.audio; return { - if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, - if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, + if (audio != null) 'Audio': audio, }; } } -/// Information about a phone number that has been claimed to your Amazon -/// Connect instance or traffic distribution group. -class ClaimedPhoneNumberSummary { - /// The phone number. Phone numbers are formatted [+] [country code] - /// [subscriber number including area code]. - final String? phoneNumber; +/// Contains information about an agent status. +class AgentStatus { + /// The Amazon Resource Name (ARN) of the agent status. + final String? agentStatusARN; - /// The Amazon Resource Name (ARN) of the phone number. - final String? phoneNumberArn; + /// The identifier of the agent status. + final String? agentStatusId; - /// The ISO country code. - final PhoneNumberCountryCode? phoneNumberCountryCode; + /// The description of the agent status. + final String? description; - /// The description of the phone number. - final String? phoneNumberDescription; + /// The display order of the agent status. + final int? displayOrder; - /// A unique identifier for the phone number. - final String? phoneNumberId; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; - /// The status of the phone number. - /// - ///
        - ///
      • - /// CLAIMED means the previous ClaimedPhoneNumber - /// or UpdatePhoneNumber - /// operation succeeded. - ///
      • - ///
      • - /// IN_PROGRESS means a ClaimedPhoneNumber - /// or UpdatePhoneNumber - /// operation is still in progress and has not yet completed. You can call DescribePhoneNumber - /// at a later time to verify if the previous operation has completed. - ///
      • - ///
      • - /// FAILED indicates that the previous ClaimedPhoneNumber - /// or UpdatePhoneNumber - /// operation has failed. It will include a message indicating the failure - /// reason. A common reason for a failure may be that the TargetArn - /// value you are claiming or updating a phone number to has reached its limit - /// of total claimed numbers. If you received a FAILED status from - /// a ClaimPhoneNumber API call, you have one day to retry claiming - /// the phone number before the number is released back to the inventory for - /// other customers to claim. - ///
      • - ///
      - /// You will not be billed for the phone number during the 1-day period if - /// number claiming fails. - /// - final PhoneNumberStatus? phoneNumberStatus; + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; - /// The type of phone number. - final PhoneNumberType? phoneNumberType; + /// The name of the agent status. + final String? name; + + /// The state of the agent status. + final AgentStatusState? state; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; - /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. - final String? targetArn; + /// The type of agent status. + final AgentStatusType? type; - ClaimedPhoneNumberSummary({ - this.phoneNumber, - this.phoneNumberArn, - this.phoneNumberCountryCode, - this.phoneNumberDescription, - this.phoneNumberId, - this.phoneNumberStatus, - this.phoneNumberType, + AgentStatus({ + this.agentStatusARN, + this.agentStatusId, + this.description, + this.displayOrder, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.state, this.tags, - this.targetArn, + this.type, }); - factory ClaimedPhoneNumberSummary.fromJson(Map json) { - return ClaimedPhoneNumberSummary( - phoneNumber: json['PhoneNumber'] as String?, - phoneNumberArn: json['PhoneNumberArn'] as String?, - phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) - ?.toPhoneNumberCountryCode(), - phoneNumberDescription: json['PhoneNumberDescription'] as String?, - phoneNumberId: json['PhoneNumberId'] as String?, - phoneNumberStatus: json['PhoneNumberStatus'] != null - ? PhoneNumberStatus.fromJson( - json['PhoneNumberStatus'] as Map) - : null, - phoneNumberType: - (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + factory AgentStatus.fromJson(Map json) { + return AgentStatus( + agentStatusARN: json['AgentStatusARN'] as String?, + agentStatusId: json['AgentStatusId'] as String?, + description: json['Description'] as String?, + displayOrder: json['DisplayOrder'] as int?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + state: (json['State'] as String?)?.toAgentStatusState(), tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), - targetArn: json['TargetArn'] as String?, + type: (json['Type'] as String?)?.toAgentStatusType(), ); } Map toJson() { - final phoneNumber = this.phoneNumber; - final phoneNumberArn = this.phoneNumberArn; - final phoneNumberCountryCode = this.phoneNumberCountryCode; - final phoneNumberDescription = this.phoneNumberDescription; - final phoneNumberId = this.phoneNumberId; - final phoneNumberStatus = this.phoneNumberStatus; - final phoneNumberType = this.phoneNumberType; + final agentStatusARN = this.agentStatusARN; + final agentStatusId = this.agentStatusId; + final description = this.description; + final displayOrder = this.displayOrder; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final state = this.state; final tags = this.tags; - final targetArn = this.targetArn; + final type = this.type; return { - if (phoneNumber != null) 'PhoneNumber': phoneNumber, - if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, - if (phoneNumberCountryCode != null) - 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), - if (phoneNumberDescription != null) - 'PhoneNumberDescription': phoneNumberDescription, - if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, - if (phoneNumberStatus != null) 'PhoneNumberStatus': phoneNumberStatus, - if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + if (agentStatusARN != null) 'AgentStatusARN': agentStatusARN, + if (agentStatusId != null) 'AgentStatusId': agentStatusId, + if (description != null) 'Description': description, + if (displayOrder != null) 'DisplayOrder': displayOrder, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (state != null) 'State': state.toValue(), if (tags != null) 'Tags': tags, - if (targetArn != null) 'TargetArn': targetArn, + if (type != null) 'Type': type.toValue(), }; } } -enum Comparison { - lt, +/// Information about the agent's status. +class AgentStatusReference { + /// The Amazon Resource Name (ARN) of the agent's status. + final String? statusArn; + + /// The name of the agent status. + final String? statusName; + + /// The start timestamp of the agent's status. + final DateTime? statusStartTimestamp; + + AgentStatusReference({ + this.statusArn, + this.statusName, + this.statusStartTimestamp, + }); + + factory AgentStatusReference.fromJson(Map json) { + return AgentStatusReference( + statusArn: json['StatusArn'] as String?, + statusName: json['StatusName'] as String?, + statusStartTimestamp: timeStampFromJson(json['StatusStartTimestamp']), + ); + } + + Map toJson() { + final statusArn = this.statusArn; + final statusName = this.statusName; + final statusStartTimestamp = this.statusStartTimestamp; + return { + if (statusArn != null) 'StatusArn': statusArn, + if (statusName != null) 'StatusName': statusName, + if (statusStartTimestamp != null) + 'StatusStartTimestamp': unixTimestampToJson(statusStartTimestamp), + }; + } } -extension ComparisonValueExtension on Comparison { +enum AgentStatusState { + enabled, + disabled, +} + +extension AgentStatusStateValueExtension on AgentStatusState { String toValue() { switch (this) { - case Comparison.lt: - return 'LT'; + case AgentStatusState.enabled: + return 'ENABLED'; + case AgentStatusState.disabled: + return 'DISABLED'; } } } -extension ComparisonFromString on String { - Comparison toComparison() { +extension AgentStatusStateFromString on String { + AgentStatusState toAgentStatusState() { switch (this) { - case 'LT': - return Comparison.lt; + case 'ENABLED': + return AgentStatusState.enabled; + case 'DISABLED': + return AgentStatusState.disabled; } - throw Exception('$this is not known in enum Comparison'); + throw Exception('$this is not known in enum AgentStatusState'); } } -/// Contains information about a contact. -class Contact { - /// Information about the agent who accepted the contact. - final AgentInfo? agentInfo; - - /// The Amazon Resource Name (ARN) for the contact. +/// Summary information for an agent status. +class AgentStatusSummary { + /// The Amazon Resource Name (ARN) for the agent status. final String? arn; - /// How the contact reached your contact center. - final Channel? channel; - - /// The description of the contact. - final String? description; - - /// The timestamp when the customer endpoint disconnected from Amazon Connect. - final DateTime? disconnectTimestamp; - - /// The identifier for the contact. + /// The identifier for an agent status. final String? id; - /// If this contact is related to other contacts, this is the ID of the initial - /// contact. - final String? initialContactId; - - /// Indicates how the contact was initiated. - final ContactInitiationMethod? initiationMethod; - - /// The date and time this contact was initiated, in UTC time. For - /// INBOUND, this is when the contact arrived. For - /// OUTBOUND, this is when the agent began dialing. For - /// CALLBACK, this is when the callback contact was created. For - /// TRANSFER and QUEUE_TRANSFER, this is when the - /// transfer was initiated. For API, this is when the request - /// arrived. - final DateTime? initiationTimestamp; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; - /// The timestamp when contact was last updated. - final DateTime? lastUpdateTimestamp; + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; - /// The name of the contact. + /// The name of the agent status. final String? name; - /// If this contact is not the first contact, this is the ID of the previous - /// contact. - final String? previousContactId; - - /// If this contact was queued, this contains information about the queue. - final QueueInfo? queueInfo; - - /// The contactId that is related - /// to this contact. - final String? relatedContactId; - - /// The timestamp, in Unix epoch time format, at which to start running the - /// inbound flow. - final DateTime? scheduledTimestamp; - - /// Information about Amazon Connect Wisdom. - final WisdomInfo? wisdomInfo; + /// The type of the agent status. + final AgentStatusType? type; - Contact({ - this.agentInfo, + AgentStatusSummary({ this.arn, - this.channel, - this.description, - this.disconnectTimestamp, this.id, - this.initialContactId, - this.initiationMethod, - this.initiationTimestamp, - this.lastUpdateTimestamp, + this.lastModifiedRegion, + this.lastModifiedTime, this.name, - this.previousContactId, - this.queueInfo, - this.relatedContactId, - this.scheduledTimestamp, - this.wisdomInfo, + this.type, }); - factory Contact.fromJson(Map json) { - return Contact( - agentInfo: json['AgentInfo'] != null - ? AgentInfo.fromJson(json['AgentInfo'] as Map) - : null, + factory AgentStatusSummary.fromJson(Map json) { + return AgentStatusSummary( arn: json['Arn'] as String?, - channel: (json['Channel'] as String?)?.toChannel(), - description: json['Description'] as String?, - disconnectTimestamp: timeStampFromJson(json['DisconnectTimestamp']), id: json['Id'] as String?, - initialContactId: json['InitialContactId'] as String?, - initiationMethod: - (json['InitiationMethod'] as String?)?.toContactInitiationMethod(), - initiationTimestamp: timeStampFromJson(json['InitiationTimestamp']), - lastUpdateTimestamp: timeStampFromJson(json['LastUpdateTimestamp']), + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), name: json['Name'] as String?, - previousContactId: json['PreviousContactId'] as String?, - queueInfo: json['QueueInfo'] != null - ? QueueInfo.fromJson(json['QueueInfo'] as Map) - : null, - relatedContactId: json['RelatedContactId'] as String?, - scheduledTimestamp: timeStampFromJson(json['ScheduledTimestamp']), - wisdomInfo: json['WisdomInfo'] != null - ? WisdomInfo.fromJson(json['WisdomInfo'] as Map) - : null, + type: (json['Type'] as String?)?.toAgentStatusType(), ); } Map toJson() { - final agentInfo = this.agentInfo; final arn = this.arn; - final channel = this.channel; - final description = this.description; - final disconnectTimestamp = this.disconnectTimestamp; final id = this.id; - final initialContactId = this.initialContactId; - final initiationMethod = this.initiationMethod; - final initiationTimestamp = this.initiationTimestamp; - final lastUpdateTimestamp = this.lastUpdateTimestamp; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; final name = this.name; - final previousContactId = this.previousContactId; - final queueInfo = this.queueInfo; - final relatedContactId = this.relatedContactId; - final scheduledTimestamp = this.scheduledTimestamp; - final wisdomInfo = this.wisdomInfo; + final type = this.type; return { - if (agentInfo != null) 'AgentInfo': agentInfo, if (arn != null) 'Arn': arn, - if (channel != null) 'Channel': channel.toValue(), - if (description != null) 'Description': description, - if (disconnectTimestamp != null) - 'DisconnectTimestamp': unixTimestampToJson(disconnectTimestamp), if (id != null) 'Id': id, - if (initialContactId != null) 'InitialContactId': initialContactId, - if (initiationMethod != null) - 'InitiationMethod': initiationMethod.toValue(), - if (initiationTimestamp != null) - 'InitiationTimestamp': unixTimestampToJson(initiationTimestamp), - if (lastUpdateTimestamp != null) - 'LastUpdateTimestamp': unixTimestampToJson(lastUpdateTimestamp), + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), if (name != null) 'Name': name, - if (previousContactId != null) 'PreviousContactId': previousContactId, - if (queueInfo != null) 'QueueInfo': queueInfo, - if (relatedContactId != null) 'RelatedContactId': relatedContactId, - if (scheduledTimestamp != null) - 'ScheduledTimestamp': unixTimestampToJson(scheduledTimestamp), - if (wisdomInfo != null) 'WisdomInfo': wisdomInfo, + if (type != null) 'Type': type.toValue(), }; } } -/// Filters user data based on the contact information that is associated to the -/// users. It contains a list of contact -/// states. -class ContactFilter { - /// A list of up to 9 contact - /// states. - final List? contactStates; +enum AgentStatusType { + routable, + custom, + offline, +} - ContactFilter({ - this.contactStates, - }); +extension AgentStatusTypeValueExtension on AgentStatusType { + String toValue() { + switch (this) { + case AgentStatusType.routable: + return 'ROUTABLE'; + case AgentStatusType.custom: + return 'CUSTOM'; + case AgentStatusType.offline: + return 'OFFLINE'; + } + } +} - Map toJson() { - final contactStates = this.contactStates; - return { - if (contactStates != null) - 'ContactStates': contactStates.map((e) => e.toValue()).toList(), - }; +extension AgentStatusTypeFromString on String { + AgentStatusType toAgentStatusType() { + switch (this) { + case 'ROUTABLE': + return AgentStatusType.routable; + case 'CUSTOM': + return AgentStatusType.custom; + case 'OFFLINE': + return AgentStatusType.offline; + } + throw Exception('$this is not known in enum AgentStatusType'); } } -/// Contains information about a flow. -class ContactFlow { - /// The Amazon Resource Name (ARN) of the flow. - final String? arn; +/// Information about the capabilities enabled for participants of the contact. +class AllowedCapabilities { + /// Information about the agent's video sharing capabilities. + final ParticipantCapabilities? agent; - /// The content of the flow. - final String? content; + /// Information about the customer's video sharing capabilities. + final ParticipantCapabilities? customer; - /// The description of the flow. - final String? description; + AllowedCapabilities({ + this.agent, + this.customer, + }); - /// The identifier of the flow. - final String? id; + Map toJson() { + final agent = this.agent; + final customer = this.customer; + return { + if (agent != null) 'Agent': agent, + if (customer != null) 'Customer': customer, + }; + } +} - /// The name of the flow. - final String? name; +/// This API is in preview release for Amazon Connect and is subject to change. +/// +/// Information about associations that are successfully created: +/// DataSetId, TargetAccountId, +/// ResourceShareId, ResourceShareArn. +class AnalyticsDataAssociationResult { + /// The identifier of the dataset. + final String? dataSetId; - /// The type of flow. - final ContactFlowState? state; + /// The Amazon Resource Name (ARN) of the Resource Access Manager share. + final String? resourceShareArn; - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; + /// The Resource Access Manager share ID. + final String? resourceShareId; - /// The type of the flow. For descriptions of the available types, see Choose - /// a flow type in the Amazon Connect Administrator Guide. - final ContactFlowType? type; + /// The identifier of the target account. + final String? targetAccountId; - ContactFlow({ - this.arn, - this.content, - this.description, - this.id, - this.name, - this.state, - this.tags, - this.type, + AnalyticsDataAssociationResult({ + this.dataSetId, + this.resourceShareArn, + this.resourceShareId, + this.targetAccountId, }); - factory ContactFlow.fromJson(Map json) { - return ContactFlow( - arn: json['Arn'] as String?, - content: json['Content'] as String?, - description: json['Description'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - state: (json['State'] as String?)?.toContactFlowState(), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - type: (json['Type'] as String?)?.toContactFlowType(), + factory AnalyticsDataAssociationResult.fromJson(Map json) { + return AnalyticsDataAssociationResult( + dataSetId: json['DataSetId'] as String?, + resourceShareArn: json['ResourceShareArn'] as String?, + resourceShareId: json['ResourceShareId'] as String?, + targetAccountId: json['TargetAccountId'] as String?, ); } Map toJson() { - final arn = this.arn; - final content = this.content; - final description = this.description; - final id = this.id; - final name = this.name; - final state = this.state; - final tags = this.tags; - final type = this.type; + final dataSetId = this.dataSetId; + final resourceShareArn = this.resourceShareArn; + final resourceShareId = this.resourceShareId; + final targetAccountId = this.targetAccountId; return { - if (arn != null) 'Arn': arn, - if (content != null) 'Content': content, - if (description != null) 'Description': description, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (state != null) 'State': state.toValue(), - if (tags != null) 'Tags': tags, - if (type != null) 'Type': type.toValue(), + if (dataSetId != null) 'DataSetId': dataSetId, + if (resourceShareArn != null) 'ResourceShareArn': resourceShareArn, + if (resourceShareId != null) 'ResourceShareId': resourceShareId, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, }; } } -/// Contains information about a flow module. -class ContactFlowModule { - /// The Amazon Resource Name (ARN). - final String? arn; - - /// The content of the flow module. - final String? content; +/// Configuration of the answering machine detection. +class AnswerMachineDetectionConfig { + /// Wait for the answering machine prompt. + final bool? awaitAnswerMachinePrompt; - /// The description of the flow module. - final String? description; + /// The flag to indicate if answer machine detection analysis needs to be + /// performed for a voice call. If set to true, + /// TrafficType must be set as CAMPAIGN. + final bool? enableAnswerMachineDetection; - /// The identifier of the flow module. - final String? id; + AnswerMachineDetectionConfig({ + this.awaitAnswerMachinePrompt, + this.enableAnswerMachineDetection, + }); - /// The name of the flow module. - final String? name; + Map toJson() { + final awaitAnswerMachinePrompt = this.awaitAnswerMachinePrompt; + final enableAnswerMachineDetection = this.enableAnswerMachineDetection; + return { + if (awaitAnswerMachinePrompt != null) + 'AwaitAnswerMachinePrompt': awaitAnswerMachinePrompt, + if (enableAnswerMachineDetection != null) + 'EnableAnswerMachineDetection': enableAnswerMachineDetection, + }; + } +} - /// The type of flow module. - final ContactFlowModuleState? state; +enum AnsweringMachineDetectionStatus { + answered, + undetected, + error, + humanAnswered, + sitToneDetected, + sitToneBusy, + sitToneInvalidNumber, + faxMachineDetected, + voicemailBeep, + voicemailNoBeep, + amdUnresolved, + amdUnanswered, + amdError, + amdNotApplicable, +} + +extension AnsweringMachineDetectionStatusValueExtension + on AnsweringMachineDetectionStatus { + String toValue() { + switch (this) { + case AnsweringMachineDetectionStatus.answered: + return 'ANSWERED'; + case AnsweringMachineDetectionStatus.undetected: + return 'UNDETECTED'; + case AnsweringMachineDetectionStatus.error: + return 'ERROR'; + case AnsweringMachineDetectionStatus.humanAnswered: + return 'HUMAN_ANSWERED'; + case AnsweringMachineDetectionStatus.sitToneDetected: + return 'SIT_TONE_DETECTED'; + case AnsweringMachineDetectionStatus.sitToneBusy: + return 'SIT_TONE_BUSY'; + case AnsweringMachineDetectionStatus.sitToneInvalidNumber: + return 'SIT_TONE_INVALID_NUMBER'; + case AnsweringMachineDetectionStatus.faxMachineDetected: + return 'FAX_MACHINE_DETECTED'; + case AnsweringMachineDetectionStatus.voicemailBeep: + return 'VOICEMAIL_BEEP'; + case AnsweringMachineDetectionStatus.voicemailNoBeep: + return 'VOICEMAIL_NO_BEEP'; + case AnsweringMachineDetectionStatus.amdUnresolved: + return 'AMD_UNRESOLVED'; + case AnsweringMachineDetectionStatus.amdUnanswered: + return 'AMD_UNANSWERED'; + case AnsweringMachineDetectionStatus.amdError: + return 'AMD_ERROR'; + case AnsweringMachineDetectionStatus.amdNotApplicable: + return 'AMD_NOT_APPLICABLE'; + } + } +} - /// The status of the flow module. - final ContactFlowModuleStatus? status; +extension AnsweringMachineDetectionStatusFromString on String { + AnsweringMachineDetectionStatus toAnsweringMachineDetectionStatus() { + switch (this) { + case 'ANSWERED': + return AnsweringMachineDetectionStatus.answered; + case 'UNDETECTED': + return AnsweringMachineDetectionStatus.undetected; + case 'ERROR': + return AnsweringMachineDetectionStatus.error; + case 'HUMAN_ANSWERED': + return AnsweringMachineDetectionStatus.humanAnswered; + case 'SIT_TONE_DETECTED': + return AnsweringMachineDetectionStatus.sitToneDetected; + case 'SIT_TONE_BUSY': + return AnsweringMachineDetectionStatus.sitToneBusy; + case 'SIT_TONE_INVALID_NUMBER': + return AnsweringMachineDetectionStatus.sitToneInvalidNumber; + case 'FAX_MACHINE_DETECTED': + return AnsweringMachineDetectionStatus.faxMachineDetected; + case 'VOICEMAIL_BEEP': + return AnsweringMachineDetectionStatus.voicemailBeep; + case 'VOICEMAIL_NO_BEEP': + return AnsweringMachineDetectionStatus.voicemailNoBeep; + case 'AMD_UNRESOLVED': + return AnsweringMachineDetectionStatus.amdUnresolved; + case 'AMD_UNANSWERED': + return AnsweringMachineDetectionStatus.amdUnanswered; + case 'AMD_ERROR': + return AnsweringMachineDetectionStatus.amdError; + case 'AMD_NOT_APPLICABLE': + return AnsweringMachineDetectionStatus.amdNotApplicable; + } + throw Exception( + '$this is not known in enum AnsweringMachineDetectionStatus'); + } +} - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; +/// This API is in preview release for Amazon Connect and is subject to change. +/// +/// A third-party application's metadata. +class Application { + /// The permissions that the agent is granted on the application. Only the + /// ACCESS permission is supported. + final List? applicationPermissions; - ContactFlowModule({ - this.arn, - this.content, - this.description, - this.id, - this.name, - this.state, - this.status, - this.tags, + /// Namespace of the application that you want to give access to. + final String? namespace; + + Application({ + this.applicationPermissions, + this.namespace, }); - factory ContactFlowModule.fromJson(Map json) { - return ContactFlowModule( - arn: json['Arn'] as String?, - content: json['Content'] as String?, - description: json['Description'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - state: (json['State'] as String?)?.toContactFlowModuleState(), - status: (json['Status'] as String?)?.toContactFlowModuleStatus(), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory Application.fromJson(Map json) { + return Application( + applicationPermissions: (json['ApplicationPermissions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + namespace: json['Namespace'] as String?, ); } Map toJson() { - final arn = this.arn; - final content = this.content; - final description = this.description; - final id = this.id; - final name = this.name; - final state = this.state; - final status = this.status; - final tags = this.tags; + final applicationPermissions = this.applicationPermissions; + final namespace = this.namespace; return { - if (arn != null) 'Arn': arn, - if (content != null) 'Content': content, - if (description != null) 'Description': description, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (state != null) 'State': state.toValue(), - if (status != null) 'Status': status.toValue(), - if (tags != null) 'Tags': tags, + if (applicationPermissions != null) + 'ApplicationPermissions': applicationPermissions, + if (namespace != null) 'Namespace': namespace, }; } } -enum ContactFlowModuleState { - active, - archived, +enum ArtifactStatus { + approved, + rejected, + inProgress, } -extension ContactFlowModuleStateValueExtension on ContactFlowModuleState { +extension ArtifactStatusValueExtension on ArtifactStatus { String toValue() { switch (this) { - case ContactFlowModuleState.active: - return 'ACTIVE'; - case ContactFlowModuleState.archived: - return 'ARCHIVED'; + case ArtifactStatus.approved: + return 'APPROVED'; + case ArtifactStatus.rejected: + return 'REJECTED'; + case ArtifactStatus.inProgress: + return 'IN_PROGRESS'; } } } -extension ContactFlowModuleStateFromString on String { - ContactFlowModuleState toContactFlowModuleState() { +extension ArtifactStatusFromString on String { + ArtifactStatus toArtifactStatus() { switch (this) { - case 'ACTIVE': - return ContactFlowModuleState.active; - case 'ARCHIVED': - return ContactFlowModuleState.archived; + case 'APPROVED': + return ArtifactStatus.approved; + case 'REJECTED': + return ArtifactStatus.rejected; + case 'IN_PROGRESS': + return ArtifactStatus.inProgress; } - throw Exception('$this is not known in enum ContactFlowModuleState'); + throw Exception('$this is not known in enum ArtifactStatus'); } } -enum ContactFlowModuleStatus { - published, - saved, -} +/// This action must be set if TriggerEventSource is one of the +/// following values: OnPostCallAnalysisAvailable | +/// OnRealTimeCallAnalysisAvailable | +/// OnRealTimeChatAnalysisAvailable | +/// OnPostChatAnalysisAvailable. Contact is categorized using the +/// rule name. +/// +/// RuleName is used as ContactCategory. +class AssignContactCategoryActionDefinition { + AssignContactCategoryActionDefinition(); -extension ContactFlowModuleStatusValueExtension on ContactFlowModuleStatus { - String toValue() { - switch (this) { - case ContactFlowModuleStatus.published: - return 'PUBLISHED'; - case ContactFlowModuleStatus.saved: - return 'SAVED'; - } + factory AssignContactCategoryActionDefinition.fromJson( + Map _) { + return AssignContactCategoryActionDefinition(); } -} -extension ContactFlowModuleStatusFromString on String { - ContactFlowModuleStatus toContactFlowModuleStatus() { - switch (this) { - case 'PUBLISHED': - return ContactFlowModuleStatus.published; - case 'SAVED': - return ContactFlowModuleStatus.saved; - } - throw Exception('$this is not known in enum ContactFlowModuleStatus'); + Map toJson() { + return {}; } } -/// Contains summary information about a flow. -class ContactFlowModuleSummary { - /// The Amazon Resource Name (ARN) of the flow module. - final String? arn; +class AssociateAnalyticsDataSetResponse { + /// The identifier of the dataset that was associated. + final String? dataSetId; - /// The identifier of the flow module. - final String? id; + /// The Amazon Resource Name (ARN) of the Resource Access Manager share. + final String? resourceShareArn; - /// The name of the flow module. - final String? name; + /// The Resource Access Manager share ID that is generated. + final String? resourceShareId; - /// The type of flow module. - final ContactFlowModuleState? state; + /// The identifier of the target account. + final String? targetAccountId; - ContactFlowModuleSummary({ - this.arn, - this.id, - this.name, - this.state, + AssociateAnalyticsDataSetResponse({ + this.dataSetId, + this.resourceShareArn, + this.resourceShareId, + this.targetAccountId, }); - factory ContactFlowModuleSummary.fromJson(Map json) { - return ContactFlowModuleSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - state: (json['State'] as String?)?.toContactFlowModuleState(), + factory AssociateAnalyticsDataSetResponse.fromJson( + Map json) { + return AssociateAnalyticsDataSetResponse( + dataSetId: json['DataSetId'] as String?, + resourceShareArn: json['ResourceShareArn'] as String?, + resourceShareId: json['ResourceShareId'] as String?, + targetAccountId: json['TargetAccountId'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; - final state = this.state; + final dataSetId = this.dataSetId; + final resourceShareArn = this.resourceShareArn; + final resourceShareId = this.resourceShareId; + final targetAccountId = this.targetAccountId; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (state != null) 'State': state.toValue(), + if (dataSetId != null) 'DataSetId': dataSetId, + if (resourceShareArn != null) 'ResourceShareArn': resourceShareArn, + if (resourceShareId != null) 'ResourceShareId': resourceShareId, + if (targetAccountId != null) 'TargetAccountId': targetAccountId, }; } } -enum ContactFlowState { - active, - archived, -} +class AssociateDefaultVocabularyResponse { + AssociateDefaultVocabularyResponse(); -extension ContactFlowStateValueExtension on ContactFlowState { - String toValue() { - switch (this) { - case ContactFlowState.active: - return 'ACTIVE'; - case ContactFlowState.archived: - return 'ARCHIVED'; - } + factory AssociateDefaultVocabularyResponse.fromJson(Map _) { + return AssociateDefaultVocabularyResponse(); } -} -extension ContactFlowStateFromString on String { - ContactFlowState toContactFlowState() { - switch (this) { - case 'ACTIVE': - return ContactFlowState.active; - case 'ARCHIVED': - return ContactFlowState.archived; - } - throw Exception('$this is not known in enum ContactFlowState'); + Map toJson() { + return {}; } } -/// Contains summary information about a flow. -/// -/// You can also create and update flows using the Amazon -/// Connect Flow language. -class ContactFlowSummary { - /// The Amazon Resource Name (ARN) of the flow. - final String? arn; - - /// The type of flow. - final ContactFlowState? contactFlowState; +class AssociateFlowResponse { + AssociateFlowResponse(); - /// The type of flow. - final ContactFlowType? contactFlowType; + factory AssociateFlowResponse.fromJson(Map _) { + return AssociateFlowResponse(); + } - /// The identifier of the flow. - final String? id; + Map toJson() { + return {}; + } +} - /// The name of the flow. - final String? name; +class AssociateInstanceStorageConfigResponse { + /// The existing association identifier that uniquely identifies the resource + /// type and storage config for the given instance ID. + final String? associationId; - ContactFlowSummary({ - this.arn, - this.contactFlowState, - this.contactFlowType, - this.id, - this.name, + AssociateInstanceStorageConfigResponse({ + this.associationId, }); - factory ContactFlowSummary.fromJson(Map json) { - return ContactFlowSummary( - arn: json['Arn'] as String?, - contactFlowState: - (json['ContactFlowState'] as String?)?.toContactFlowState(), - contactFlowType: - (json['ContactFlowType'] as String?)?.toContactFlowType(), - id: json['Id'] as String?, - name: json['Name'] as String?, + factory AssociateInstanceStorageConfigResponse.fromJson( + Map json) { + return AssociateInstanceStorageConfigResponse( + associationId: json['AssociationId'] as String?, ); } Map toJson() { - final arn = this.arn; - final contactFlowState = this.contactFlowState; - final contactFlowType = this.contactFlowType; - final id = this.id; - final name = this.name; + final associationId = this.associationId; return { - if (arn != null) 'Arn': arn, - if (contactFlowState != null) - 'ContactFlowState': contactFlowState.toValue(), - if (contactFlowType != null) 'ContactFlowType': contactFlowType.toValue(), - if (id != null) 'Id': id, - if (name != null) 'Name': name, + if (associationId != null) 'AssociationId': associationId, }; } } -enum ContactFlowType { - contactFlow, - customerQueue, - customerHold, - customerWhisper, - agentHold, - agentWhisper, - outboundWhisper, - agentTransfer, - queueTransfer, -} +class AssociateSecurityKeyResponse { + /// The existing association identifier that uniquely identifies the resource + /// type and storage config for the given instance ID. + final String? associationId; -extension ContactFlowTypeValueExtension on ContactFlowType { - String toValue() { - switch (this) { - case ContactFlowType.contactFlow: - return 'CONTACT_FLOW'; - case ContactFlowType.customerQueue: - return 'CUSTOMER_QUEUE'; - case ContactFlowType.customerHold: - return 'CUSTOMER_HOLD'; - case ContactFlowType.customerWhisper: - return 'CUSTOMER_WHISPER'; - case ContactFlowType.agentHold: - return 'AGENT_HOLD'; - case ContactFlowType.agentWhisper: - return 'AGENT_WHISPER'; - case ContactFlowType.outboundWhisper: - return 'OUTBOUND_WHISPER'; - case ContactFlowType.agentTransfer: - return 'AGENT_TRANSFER'; - case ContactFlowType.queueTransfer: - return 'QUEUE_TRANSFER'; - } + AssociateSecurityKeyResponse({ + this.associationId, + }); + + factory AssociateSecurityKeyResponse.fromJson(Map json) { + return AssociateSecurityKeyResponse( + associationId: json['AssociationId'] as String?, + ); } -} -extension ContactFlowTypeFromString on String { - ContactFlowType toContactFlowType() { - switch (this) { - case 'CONTACT_FLOW': - return ContactFlowType.contactFlow; - case 'CUSTOMER_QUEUE': - return ContactFlowType.customerQueue; - case 'CUSTOMER_HOLD': - return ContactFlowType.customerHold; - case 'CUSTOMER_WHISPER': - return ContactFlowType.customerWhisper; - case 'AGENT_HOLD': - return ContactFlowType.agentHold; - case 'AGENT_WHISPER': - return ContactFlowType.agentWhisper; - case 'OUTBOUND_WHISPER': - return ContactFlowType.outboundWhisper; - case 'AGENT_TRANSFER': - return ContactFlowType.agentTransfer; - case 'QUEUE_TRANSFER': - return ContactFlowType.queueTransfer; - } - throw Exception('$this is not known in enum ContactFlowType'); + Map toJson() { + final associationId = this.associationId; + return { + if (associationId != null) 'AssociationId': associationId, + }; } } -enum ContactInitiationMethod { - inbound, - outbound, - transfer, - queueTransfer, - callback, - api, - disconnect, - monitor, -} +class AssociateTrafficDistributionGroupUserResponse { + AssociateTrafficDistributionGroupUserResponse(); -extension ContactInitiationMethodValueExtension on ContactInitiationMethod { - String toValue() { - switch (this) { - case ContactInitiationMethod.inbound: - return 'INBOUND'; - case ContactInitiationMethod.outbound: - return 'OUTBOUND'; - case ContactInitiationMethod.transfer: - return 'TRANSFER'; - case ContactInitiationMethod.queueTransfer: - return 'QUEUE_TRANSFER'; - case ContactInitiationMethod.callback: - return 'CALLBACK'; - case ContactInitiationMethod.api: - return 'API'; - case ContactInitiationMethod.disconnect: - return 'DISCONNECT'; - case ContactInitiationMethod.monitor: - return 'MONITOR'; - } + factory AssociateTrafficDistributionGroupUserResponse.fromJson( + Map _) { + return AssociateTrafficDistributionGroupUserResponse(); } -} -extension ContactInitiationMethodFromString on String { - ContactInitiationMethod toContactInitiationMethod() { - switch (this) { - case 'INBOUND': - return ContactInitiationMethod.inbound; - case 'OUTBOUND': - return ContactInitiationMethod.outbound; - case 'TRANSFER': - return ContactInitiationMethod.transfer; - case 'QUEUE_TRANSFER': - return ContactInitiationMethod.queueTransfer; - case 'CALLBACK': - return ContactInitiationMethod.callback; - case 'API': - return ContactInitiationMethod.api; - case 'DISCONNECT': - return ContactInitiationMethod.disconnect; - case 'MONITOR': - return ContactInitiationMethod.monitor; - } - throw Exception('$this is not known in enum ContactInitiationMethod'); + Map toJson() { + return {}; } } -enum ContactState { - incoming, - pending, - connecting, - connected, - connectedOnhold, - missed, - error, - ended, - rejected, -} +/// Information about the attached file. +class AttachedFile { + /// The time of Creation of the file resource as an ISO timestamp. It's + /// specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For + /// example, 2024-05-03T02:41:28.172Z. + final String creationTime; -extension ContactStateValueExtension on ContactState { - String toValue() { - switch (this) { - case ContactState.incoming: - return 'INCOMING'; - case ContactState.pending: - return 'PENDING'; - case ContactState.connecting: - return 'CONNECTING'; - case ContactState.connected: - return 'CONNECTED'; - case ContactState.connectedOnhold: - return 'CONNECTED_ONHOLD'; - case ContactState.missed: - return 'MISSED'; - case ContactState.error: - return 'ERROR'; - case ContactState.ended: - return 'ENDED'; - case ContactState.rejected: - return 'REJECTED'; - } - } -} + /// The unique identifier of the attached file resource (ARN). + final String fileArn; -extension ContactStateFromString on String { - ContactState toContactState() { - switch (this) { - case 'INCOMING': - return ContactState.incoming; - case 'PENDING': - return ContactState.pending; - case 'CONNECTING': - return ContactState.connecting; - case 'CONNECTED': - return ContactState.connected; - case 'CONNECTED_ONHOLD': - return ContactState.connectedOnhold; - case 'MISSED': - return ContactState.missed; - case 'ERROR': - return ContactState.error; - case 'ENDED': - return ContactState.ended; - case 'REJECTED': - return ContactState.rejected; - } - throw Exception('$this is not known in enum ContactState'); - } -} + /// The unique identifier of the attached file resource. + final String fileId; -/// An object that can be used to specify Tag conditions inside the -/// SearchFilter. This accepts an OR of -/// AND (List of List) input where: -/// -///
        -///
      • -/// Top level list specifies conditions that need to be applied with -/// OR operator -///
      • -///
      • -/// Inner list specifies conditions that need to be applied with -/// AND operator. -///
      • -///
      -class ControlPlaneTagFilter { - /// A list of conditions which would be applied together with an - /// AND condition. - final List? andConditions; + /// A case-sensitive name of the attached file being uploaded. + final String fileName; - /// A list of conditions which would be applied together with an OR - /// condition. - final List>? orConditions; + /// The size of the attached file in bytes. + final int fileSizeInBytes; - /// A leaf node condition which can be used to specify a tag condition. - final TagCondition? tagCondition; + /// The current status of the attached file. + final FileStatusType fileStatus; - ControlPlaneTagFilter({ - this.andConditions, - this.orConditions, - this.tagCondition, + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + /// + /// This value must be a valid ARN. + /// + final String? associatedResourceArn; + + /// Represents the identity that created the file. + final CreatedByInfo? createdBy; + + /// The use case for the file. + final FileUseCaseType? fileUseCaseType; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + AttachedFile({ + required this.creationTime, + required this.fileArn, + required this.fileId, + required this.fileName, + required this.fileSizeInBytes, + required this.fileStatus, + this.associatedResourceArn, + this.createdBy, + this.fileUseCaseType, + this.tags, }); + factory AttachedFile.fromJson(Map json) { + return AttachedFile( + creationTime: json['CreationTime'] as String, + fileArn: json['FileArn'] as String, + fileId: json['FileId'] as String, + fileName: json['FileName'] as String, + fileSizeInBytes: json['FileSizeInBytes'] as int, + fileStatus: (json['FileStatus'] as String).toFileStatusType(), + associatedResourceArn: json['AssociatedResourceArn'] as String?, + createdBy: json['CreatedBy'] != null + ? CreatedByInfo.fromJson(json['CreatedBy'] as Map) + : null, + fileUseCaseType: + (json['FileUseCaseType'] as String?)?.toFileUseCaseType(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + Map toJson() { - final andConditions = this.andConditions; - final orConditions = this.orConditions; - final tagCondition = this.tagCondition; + final creationTime = this.creationTime; + final fileArn = this.fileArn; + final fileId = this.fileId; + final fileName = this.fileName; + final fileSizeInBytes = this.fileSizeInBytes; + final fileStatus = this.fileStatus; + final associatedResourceArn = this.associatedResourceArn; + final createdBy = this.createdBy; + final fileUseCaseType = this.fileUseCaseType; + final tags = this.tags; return { - if (andConditions != null) 'AndConditions': andConditions, - if (orConditions != null) 'OrConditions': orConditions, - if (tagCondition != null) 'TagCondition': tagCondition, + 'CreationTime': creationTime, + 'FileArn': fileArn, + 'FileId': fileId, + 'FileName': fileName, + 'FileSizeInBytes': fileSizeInBytes, + 'FileStatus': fileStatus.toValue(), + if (associatedResourceArn != null) + 'AssociatedResourceArn': associatedResourceArn, + if (createdBy != null) 'CreatedBy': createdBy, + if (fileUseCaseType != null) 'FileUseCaseType': fileUseCaseType.toValue(), + if (tags != null) 'Tags': tags, }; } } -class CreateAgentStatusResponse { - /// The Amazon Resource Name (ARN) of the agent status. - final String? agentStatusARN; +/// Error describing a failure to retrieve attached file metadata through +/// BatchGetAttachedFileMetadata action. +class AttachedFileError { + /// Status code describing the failure. + final String? errorCode; - /// The identifier of the agent status. - final String? agentStatusId; + /// Why the attached file couldn't be retrieved. + final String? errorMessage; - CreateAgentStatusResponse({ - this.agentStatusARN, - this.agentStatusId, + /// The unique identifier of the attached file resource. + final String? fileId; + + AttachedFileError({ + this.errorCode, + this.errorMessage, + this.fileId, }); - factory CreateAgentStatusResponse.fromJson(Map json) { - return CreateAgentStatusResponse( - agentStatusARN: json['AgentStatusARN'] as String?, - agentStatusId: json['AgentStatusId'] as String?, + factory AttachedFileError.fromJson(Map json) { + return AttachedFileError( + errorCode: json['ErrorCode'] as String?, + errorMessage: json['ErrorMessage'] as String?, + fileId: json['FileId'] as String?, ); } Map toJson() { - final agentStatusARN = this.agentStatusARN; - final agentStatusId = this.agentStatusId; + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; + final fileId = this.fileId; return { - if (agentStatusARN != null) 'AgentStatusARN': agentStatusARN, - if (agentStatusId != null) 'AgentStatusId': agentStatusId, + if (errorCode != null) 'ErrorCode': errorCode, + if (errorMessage != null) 'ErrorMessage': errorMessage, + if (fileId != null) 'FileId': fileId, }; } } -class CreateContactFlowModuleResponse { - /// The Amazon Resource Name (ARN) of the flow module. - final String? arn; +/// Information about a reference when the referenceType is +/// ATTACHMENT. Otherwise, null. +class AttachmentReference { + /// Identifier of the attachment reference. + final String? name; - /// The identifier of the flow module. - final String? id; + /// Status of the attachment reference type. + final ReferenceStatus? status; - CreateContactFlowModuleResponse({ - this.arn, - this.id, + /// The location path of the attachment reference. + final String? value; + + AttachmentReference({ + this.name, + this.status, + this.value, }); - factory CreateContactFlowModuleResponse.fromJson(Map json) { - return CreateContactFlowModuleResponse( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory AttachmentReference.fromJson(Map json) { + return AttachmentReference( + name: json['Name'] as String?, + status: (json['Status'] as String?)?.toReferenceStatus(), + value: json['Value'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; + final name = this.name; + final status = this.status; + final value = this.value; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (status != null) 'Status': status.toValue(), + if (value != null) 'Value': value, }; } } -class CreateContactFlowResponse { - /// The Amazon Resource Name (ARN) of the flow. - final String? contactFlowArn; +/// The attendee information, including attendee ID and join token. +class Attendee { + /// The Amazon Chime SDK attendee ID. + final String? attendeeId; - /// The identifier of the flow. - final String? contactFlowId; + /// The join token used by the Amazon Chime SDK attendee. + final String? joinToken; - CreateContactFlowResponse({ - this.contactFlowArn, - this.contactFlowId, + Attendee({ + this.attendeeId, + this.joinToken, }); - factory CreateContactFlowResponse.fromJson(Map json) { - return CreateContactFlowResponse( - contactFlowArn: json['ContactFlowArn'] as String?, - contactFlowId: json['ContactFlowId'] as String?, + factory Attendee.fromJson(Map json) { + return Attendee( + attendeeId: json['AttendeeId'] as String?, + joinToken: json['JoinToken'] as String?, ); } Map toJson() { - final contactFlowArn = this.contactFlowArn; - final contactFlowId = this.contactFlowId; + final attendeeId = this.attendeeId; + final joinToken = this.joinToken; return { - if (contactFlowArn != null) 'ContactFlowArn': contactFlowArn, - if (contactFlowId != null) 'ContactFlowId': contactFlowId, + if (attendeeId != null) 'AttendeeId': attendeeId, + if (joinToken != null) 'JoinToken': joinToken, }; } } -class CreateEvaluationFormResponse { - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; +/// A toggle for an individual feature at the instance level. +class Attribute { + /// The type of attribute. + final InstanceAttributeType? attributeType; - /// The unique identifier for the evaluation form. - final String evaluationFormId; + /// The value of the attribute. + final String? value; - CreateEvaluationFormResponse({ - required this.evaluationFormArn, - required this.evaluationFormId, + Attribute({ + this.attributeType, + this.value, }); - factory CreateEvaluationFormResponse.fromJson(Map json) { - return CreateEvaluationFormResponse( - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, + factory Attribute.fromJson(Map json) { + return Attribute( + attributeType: + (json['AttributeType'] as String?)?.toInstanceAttributeType(), + value: json['Value'] as String?, ); } Map toJson() { - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; + final attributeType = this.attributeType; + final value = this.value; return { - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, + if (attributeType != null) 'AttributeType': attributeType.toValue(), + if (value != null) 'Value': value, }; } } -class CreateHoursOfOperationResponse { - /// The Amazon Resource Name (ARN) for the hours of operation. - final String? hoursOfOperationArn; +/// A list of conditions which would be applied together with an +/// AND condition. +class AttributeAndCondition { + final HierarchyGroupCondition? hierarchyGroupCondition; - /// The identifier for the hours of operation. - final String? hoursOfOperationId; + /// A leaf node condition which can be used to specify a tag condition. + final List? tagConditions; - CreateHoursOfOperationResponse({ - this.hoursOfOperationArn, - this.hoursOfOperationId, + AttributeAndCondition({ + this.hierarchyGroupCondition, + this.tagConditions, }); - factory CreateHoursOfOperationResponse.fromJson(Map json) { - return CreateHoursOfOperationResponse( - hoursOfOperationArn: json['HoursOfOperationArn'] as String?, - hoursOfOperationId: json['HoursOfOperationId'] as String?, - ); - } - Map toJson() { - final hoursOfOperationArn = this.hoursOfOperationArn; - final hoursOfOperationId = this.hoursOfOperationId; + final hierarchyGroupCondition = this.hierarchyGroupCondition; + final tagConditions = this.tagConditions; return { - if (hoursOfOperationArn != null) - 'HoursOfOperationArn': hoursOfOperationArn, - if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, + if (hierarchyGroupCondition != null) + 'HierarchyGroupCondition': hierarchyGroupCondition, + if (tagConditions != null) 'TagConditions': tagConditions, }; } } -class CreateInstanceResponse { - /// The Amazon Resource Name (ARN) of the instance. - final String? arn; +/// An object to specify the predefined attribute condition. +class AttributeCondition { + /// The operator of the condition. + final String? comparisonOperator; - /// The identifier for the instance. - final String? id; + /// The name of predefined attribute. + final String? name; - CreateInstanceResponse({ - this.arn, - this.id, + /// The proficiency level of the condition. + final double? proficiencyLevel; + + /// The value of predefined attribute. + final String? value; + + AttributeCondition({ + this.comparisonOperator, + this.name, + this.proficiencyLevel, + this.value, }); - factory CreateInstanceResponse.fromJson(Map json) { - return CreateInstanceResponse( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory AttributeCondition.fromJson(Map json) { + return AttributeCondition( + comparisonOperator: json['ComparisonOperator'] as String?, + name: json['Name'] as String?, + proficiencyLevel: json['ProficiencyLevel'] as double?, + value: json['Value'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; + final comparisonOperator = this.comparisonOperator; + final name = this.name; + final proficiencyLevel = this.proficiencyLevel; + final value = this.value; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, + if (comparisonOperator != null) 'ComparisonOperator': comparisonOperator, + if (name != null) 'Name': name, + if (proficiencyLevel != null) 'ProficiencyLevel': proficiencyLevel, + if (value != null) 'Value': value, }; } } -class CreateIntegrationAssociationResponse { - /// The Amazon Resource Name (ARN) for the association. - final String? integrationAssociationArn; - - /// The identifier for the integration association. - final String? integrationAssociationId; +/// Has audio-specific configurations as the operating parameter for Echo +/// Reduction. +class AudioFeatures { + /// Makes echo reduction available to clients who connect to the meeting. + final MeetingFeatureStatus? echoReduction; - CreateIntegrationAssociationResponse({ - this.integrationAssociationArn, - this.integrationAssociationId, + AudioFeatures({ + this.echoReduction, }); - factory CreateIntegrationAssociationResponse.fromJson( - Map json) { - return CreateIntegrationAssociationResponse( - integrationAssociationArn: json['IntegrationAssociationArn'] as String?, - integrationAssociationId: json['IntegrationAssociationId'] as String?, + factory AudioFeatures.fromJson(Map json) { + return AudioFeatures( + echoReduction: + (json['EchoReduction'] as String?)?.toMeetingFeatureStatus(), ); } Map toJson() { - final integrationAssociationArn = this.integrationAssociationArn; - final integrationAssociationId = this.integrationAssociationId; + final echoReduction = this.echoReduction; return { - if (integrationAssociationArn != null) - 'IntegrationAssociationArn': integrationAssociationArn, - if (integrationAssociationId != null) - 'IntegrationAssociationId': integrationAssociationId, + if (echoReduction != null) 'EchoReduction': echoReduction.toValue(), }; } } -class CreateParticipantResponse { - /// The token used by the chat participant to call - /// CreateParticipantConnection. The participant token is valid for - /// the lifetime of a chat participant. - final ParticipantTokenCredentials? participantCredentials; +/// Contains information for score and potential quality issues for Audio +class AudioQualityMetricsInfo { + /// List of potential issues causing degradation of quality on a media + /// connection. If the service did not detect any potential quality issues the + /// list is empty. + /// + /// Valid values: HighPacketLoss | HighRoundTripTime | + /// HighJitterBuffer + final List? potentialQualityIssues; - /// The identifier for a chat participant. The participantId for a chat - /// participant is the same throughout the chat lifecycle. - final String? participantId; + /// Number measuring the estimated quality of the media connection. + final double? qualityScore; - CreateParticipantResponse({ - this.participantCredentials, - this.participantId, + AudioQualityMetricsInfo({ + this.potentialQualityIssues, + this.qualityScore, }); - factory CreateParticipantResponse.fromJson(Map json) { - return CreateParticipantResponse( - participantCredentials: json['ParticipantCredentials'] != null - ? ParticipantTokenCredentials.fromJson( - json['ParticipantCredentials'] as Map) - : null, - participantId: json['ParticipantId'] as String?, + factory AudioQualityMetricsInfo.fromJson(Map json) { + return AudioQualityMetricsInfo( + potentialQualityIssues: (json['PotentialQualityIssues'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + qualityScore: json['QualityScore'] as double?, ); } Map toJson() { - final participantCredentials = this.participantCredentials; - final participantId = this.participantId; + final potentialQualityIssues = this.potentialQualityIssues; + final qualityScore = this.qualityScore; return { - if (participantCredentials != null) - 'ParticipantCredentials': participantCredentials, - if (participantId != null) 'ParticipantId': participantId, + if (potentialQualityIssues != null) + 'PotentialQualityIssues': potentialQualityIssues, + if (qualityScore != null) 'QualityScore': qualityScore, }; } } -class CreatePromptResponse { - /// The Amazon Resource Name (ARN) of the prompt. - final String? promptARN; +/// Information about available phone numbers. +class AvailableNumberSummary { + /// The phone number. Phone numbers are formatted [+] [country code] + /// [subscriber number including area code]. + final String? phoneNumber; - /// A unique identifier for the prompt. - final String? promptId; + /// The ISO country code. + final PhoneNumberCountryCode? phoneNumberCountryCode; - CreatePromptResponse({ - this.promptARN, - this.promptId, + /// The type of phone number. + final PhoneNumberType? phoneNumberType; + + AvailableNumberSummary({ + this.phoneNumber, + this.phoneNumberCountryCode, + this.phoneNumberType, }); - factory CreatePromptResponse.fromJson(Map json) { - return CreatePromptResponse( - promptARN: json['PromptARN'] as String?, - promptId: json['PromptId'] as String?, + factory AvailableNumberSummary.fromJson(Map json) { + return AvailableNumberSummary( + phoneNumber: json['PhoneNumber'] as String?, + phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) + ?.toPhoneNumberCountryCode(), + phoneNumberType: + (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), ); } Map toJson() { - final promptARN = this.promptARN; - final promptId = this.promptId; + final phoneNumber = this.phoneNumber; + final phoneNumberCountryCode = this.phoneNumberCountryCode; + final phoneNumberType = this.phoneNumberType; return { - if (promptARN != null) 'PromptARN': promptARN, - if (promptId != null) 'PromptId': promptId, + if (phoneNumber != null) 'PhoneNumber': phoneNumber, + if (phoneNumberCountryCode != null) + 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), + if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), }; } } -class CreateQueueResponse { - /// The Amazon Resource Name (ARN) of the queue. - final String? queueArn; +class BatchAssociateAnalyticsDataSetResponse { + /// Information about associations that are successfully created: + /// DataSetId, TargetAccountId, + /// ResourceShareId, ResourceShareArn. + final List? created; - /// The identifier for the queue. - final String? queueId; + /// A list of errors for datasets that aren't successfully associated with the + /// target account. + final List? errors; - CreateQueueResponse({ - this.queueArn, - this.queueId, + BatchAssociateAnalyticsDataSetResponse({ + this.created, + this.errors, }); - factory CreateQueueResponse.fromJson(Map json) { - return CreateQueueResponse( - queueArn: json['QueueArn'] as String?, - queueId: json['QueueId'] as String?, + factory BatchAssociateAnalyticsDataSetResponse.fromJson( + Map json) { + return BatchAssociateAnalyticsDataSetResponse( + created: (json['Created'] as List?) + ?.whereNotNull() + .map((e) => AnalyticsDataAssociationResult.fromJson( + e as Map)) + .toList(), + errors: (json['Errors'] as List?) + ?.whereNotNull() + .map((e) => ErrorResult.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final queueArn = this.queueArn; - final queueId = this.queueId; + final created = this.created; + final errors = this.errors; return { - if (queueArn != null) 'QueueArn': queueArn, - if (queueId != null) 'QueueId': queueId, + if (created != null) 'Created': created, + if (errors != null) 'Errors': errors, }; } } -class CreateQuickConnectResponse { - /// The Amazon Resource Name (ARN) for the quick connect. - final String? quickConnectARN; +class BatchDisassociateAnalyticsDataSetResponse { + /// An array of successfully disassociated dataset identifiers. + final List? deleted; - /// The identifier for the quick connect. - final String? quickConnectId; + /// A list of errors for any datasets not successfully removed. + final List? errors; - CreateQuickConnectResponse({ - this.quickConnectARN, - this.quickConnectId, + BatchDisassociateAnalyticsDataSetResponse({ + this.deleted, + this.errors, }); - factory CreateQuickConnectResponse.fromJson(Map json) { - return CreateQuickConnectResponse( - quickConnectARN: json['QuickConnectARN'] as String?, - quickConnectId: json['QuickConnectId'] as String?, + factory BatchDisassociateAnalyticsDataSetResponse.fromJson( + Map json) { + return BatchDisassociateAnalyticsDataSetResponse( + deleted: (json['Deleted'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + errors: (json['Errors'] as List?) + ?.whereNotNull() + .map((e) => ErrorResult.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final quickConnectARN = this.quickConnectARN; - final quickConnectId = this.quickConnectId; + final deleted = this.deleted; + final errors = this.errors; return { - if (quickConnectARN != null) 'QuickConnectARN': quickConnectARN, - if (quickConnectId != null) 'QuickConnectId': quickConnectId, + if (deleted != null) 'Deleted': deleted, + if (errors != null) 'Errors': errors, }; } } -class CreateRoutingProfileResponse { - /// The Amazon Resource Name (ARN) of the routing profile. - final String? routingProfileArn; +class BatchGetAttachedFileMetadataResponse { + /// List of errors of attached files that could not be retrieved. + final List? errors; - /// The identifier of the routing profile. - final String? routingProfileId; + /// List of attached files that were successfully retrieved. + final List? files; - CreateRoutingProfileResponse({ - this.routingProfileArn, - this.routingProfileId, + BatchGetAttachedFileMetadataResponse({ + this.errors, + this.files, }); - factory CreateRoutingProfileResponse.fromJson(Map json) { - return CreateRoutingProfileResponse( - routingProfileArn: json['RoutingProfileArn'] as String?, - routingProfileId: json['RoutingProfileId'] as String?, + factory BatchGetAttachedFileMetadataResponse.fromJson( + Map json) { + return BatchGetAttachedFileMetadataResponse( + errors: (json['Errors'] as List?) + ?.whereNotNull() + .map((e) => AttachedFileError.fromJson(e as Map)) + .toList(), + files: (json['Files'] as List?) + ?.whereNotNull() + .map((e) => AttachedFile.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final routingProfileArn = this.routingProfileArn; - final routingProfileId = this.routingProfileId; + final errors = this.errors; + final files = this.files; return { - if (routingProfileArn != null) 'RoutingProfileArn': routingProfileArn, - if (routingProfileId != null) 'RoutingProfileId': routingProfileId, + if (errors != null) 'Errors': errors, + if (files != null) 'Files': files, }; } } -class CreateRuleResponse { - /// The Amazon Resource Name (ARN) of the rule. - final String ruleArn; - - /// A unique identifier for the rule. - final String ruleId; +class BatchGetFlowAssociationResponse { + /// Information about flow associations. + final List? flowAssociationSummaryList; - CreateRuleResponse({ - required this.ruleArn, - required this.ruleId, + BatchGetFlowAssociationResponse({ + this.flowAssociationSummaryList, }); - factory CreateRuleResponse.fromJson(Map json) { - return CreateRuleResponse( - ruleArn: json['RuleArn'] as String, - ruleId: json['RuleId'] as String, + factory BatchGetFlowAssociationResponse.fromJson(Map json) { + return BatchGetFlowAssociationResponse( + flowAssociationSummaryList: (json['FlowAssociationSummaryList'] as List?) + ?.whereNotNull() + .map( + (e) => FlowAssociationSummary.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final ruleArn = this.ruleArn; - final ruleId = this.ruleId; + final flowAssociationSummaryList = this.flowAssociationSummaryList; return { - 'RuleArn': ruleArn, - 'RuleId': ruleId, + if (flowAssociationSummaryList != null) + 'FlowAssociationSummaryList': flowAssociationSummaryList, }; } } -class CreateSecurityProfileResponse { - /// The Amazon Resource Name (ARN) for the security profile. - final String? securityProfileArn; +class BatchPutContactResponse { + /// List of requests for which contact creation failed. + final List? failedRequestList; - /// The identifier for the security profle. - final String? securityProfileId; + /// List of requests for which contact was successfully created. + final List? successfulRequestList; - CreateSecurityProfileResponse({ - this.securityProfileArn, - this.securityProfileId, + BatchPutContactResponse({ + this.failedRequestList, + this.successfulRequestList, }); - factory CreateSecurityProfileResponse.fromJson(Map json) { - return CreateSecurityProfileResponse( - securityProfileArn: json['SecurityProfileArn'] as String?, - securityProfileId: json['SecurityProfileId'] as String?, + factory BatchPutContactResponse.fromJson(Map json) { + return BatchPutContactResponse( + failedRequestList: (json['FailedRequestList'] as List?) + ?.whereNotNull() + .map((e) => FailedRequest.fromJson(e as Map)) + .toList(), + successfulRequestList: (json['SuccessfulRequestList'] as List?) + ?.whereNotNull() + .map((e) => SuccessfulRequest.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final securityProfileArn = this.securityProfileArn; - final securityProfileId = this.securityProfileId; + final failedRequestList = this.failedRequestList; + final successfulRequestList = this.successfulRequestList; return { - if (securityProfileArn != null) 'SecurityProfileArn': securityProfileArn, - if (securityProfileId != null) 'SecurityProfileId': securityProfileId, + if (failedRequestList != null) 'FailedRequestList': failedRequestList, + if (successfulRequestList != null) + 'SuccessfulRequestList': successfulRequestList, }; } } -class CreateTaskTemplateResponse { - /// The Amazon Resource Name (ARN) for the task template resource. - final String arn; - - /// The identifier of the task template resource. - final String id; - - CreateTaskTemplateResponse({ - required this.arn, - required this.id, - }); +enum BehaviorType { + routeCurrentChannelOnly, + routeAnyChannel, +} - factory CreateTaskTemplateResponse.fromJson(Map json) { - return CreateTaskTemplateResponse( - arn: json['Arn'] as String, - id: json['Id'] as String, - ); +extension BehaviorTypeValueExtension on BehaviorType { + String toValue() { + switch (this) { + case BehaviorType.routeCurrentChannelOnly: + return 'ROUTE_CURRENT_CHANNEL_ONLY'; + case BehaviorType.routeAnyChannel: + return 'ROUTE_ANY_CHANNEL'; + } } +} - Map toJson() { - final arn = this.arn; - final id = this.id; - return { - 'Arn': arn, - 'Id': id, - }; +extension BehaviorTypeFromString on String { + BehaviorType toBehaviorType() { + switch (this) { + case 'ROUTE_CURRENT_CHANNEL_ONLY': + return BehaviorType.routeCurrentChannelOnly; + case 'ROUTE_ANY_CHANNEL': + return BehaviorType.routeAnyChannel; + } + throw Exception('$this is not known in enum BehaviorType'); } } -class CreateTrafficDistributionGroupResponse { - /// The Amazon Resource Name (ARN) of the traffic distribution group. - final String? arn; - - /// The identifier of the traffic distribution group. This can be the ID or the - /// ARN if the API is being called in the Region where the traffic distribution - /// group was created. The ARN must be provided if the call is from the - /// replicated Region. - final String? id; +/// Information associated with a campaign. +class Campaign { + /// A unique identifier for a campaign. + final String? campaignId; - CreateTrafficDistributionGroupResponse({ - this.arn, - this.id, + Campaign({ + this.campaignId, }); - factory CreateTrafficDistributionGroupResponse.fromJson( - Map json) { - return CreateTrafficDistributionGroupResponse( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory Campaign.fromJson(Map json) { + return Campaign( + campaignId: json['CampaignId'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; + final campaignId = this.campaignId; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, + if (campaignId != null) 'CampaignId': campaignId, }; } } -class CreateUseCaseResponse { - /// The Amazon Resource Name (ARN) for the use case. - final String? useCaseArn; - - /// The identifier of the use case. - final String? useCaseId; - - CreateUseCaseResponse({ - this.useCaseArn, - this.useCaseId, - }); +enum Channel { + voice, + chat, + task, +} - factory CreateUseCaseResponse.fromJson(Map json) { - return CreateUseCaseResponse( - useCaseArn: json['UseCaseArn'] as String?, - useCaseId: json['UseCaseId'] as String?, - ); +extension ChannelValueExtension on Channel { + String toValue() { + switch (this) { + case Channel.voice: + return 'VOICE'; + case Channel.chat: + return 'CHAT'; + case Channel.task: + return 'TASK'; + } } +} - Map toJson() { - final useCaseArn = this.useCaseArn; - final useCaseId = this.useCaseId; - return { - if (useCaseArn != null) 'UseCaseArn': useCaseArn, - if (useCaseId != null) 'UseCaseId': useCaseId, - }; +extension ChannelFromString on String { + Channel toChannel() { + switch (this) { + case 'VOICE': + return Channel.voice; + case 'CHAT': + return Channel.chat; + case 'TASK': + return Channel.task; + } + throw Exception('$this is not known in enum Channel'); } } -class CreateUserHierarchyGroupResponse { - /// The Amazon Resource Name (ARN) of the hierarchy group. - final String? hierarchyGroupArn; +/// Chat integration event containing payload to perform different chat actions +/// such as: +/// +///
        +///
      • +/// Sending a chat message +///
      • +///
      • +/// Sending a chat event, such as typing +///
      • +///
      • +/// Disconnecting from a chat +///
      • +///
      +class ChatEvent { + /// Type of chat integration event. + final ChatEventType type; - /// The identifier of the hierarchy group. - final String? hierarchyGroupId; + /// Content of the message or event. This is required when Type is + /// MESSAGE and for certain ContentTypes when + /// Type is EVENT. + /// + ///
        + ///
      • + /// For allowed message content, see the Content parameter in the + /// SendMessage + /// topic in the Amazon Connect Participant Service API Reference. + ///
      • + ///
      • + /// For allowed event content, see the Content parameter in the SendEvent + /// topic in the Amazon Connect Participant Service API Reference. + ///
      • + ///
      + final String? content; - CreateUserHierarchyGroupResponse({ - this.hierarchyGroupArn, - this.hierarchyGroupId, - }); + /// Type of content. This is required when Type is + /// MESSAGE or EVENT. + /// + ///
        + ///
      • + /// For allowed message content types, see the ContentType + /// parameter in the SendMessage + /// topic in the Amazon Connect Participant Service API Reference. + ///
      • + ///
      • + /// For allowed event content types, see the ContentType parameter + /// in the SendEvent + /// topic in the Amazon Connect Participant Service API Reference. + ///
      • + ///
      + final String? contentType; - factory CreateUserHierarchyGroupResponse.fromJson(Map json) { - return CreateUserHierarchyGroupResponse( - hierarchyGroupArn: json['HierarchyGroupArn'] as String?, - hierarchyGroupId: json['HierarchyGroupId'] as String?, - ); - } + ChatEvent({ + required this.type, + this.content, + this.contentType, + }); Map toJson() { - final hierarchyGroupArn = this.hierarchyGroupArn; - final hierarchyGroupId = this.hierarchyGroupId; + final type = this.type; + final content = this.content; + final contentType = this.contentType; return { - if (hierarchyGroupArn != null) 'HierarchyGroupArn': hierarchyGroupArn, - if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId, + 'Type': type.toValue(), + if (content != null) 'Content': content, + if (contentType != null) 'ContentType': contentType, }; } } -class CreateUserResponse { - /// The Amazon Resource Name (ARN) of the user account. - final String? userArn; - - /// The identifier of the user account. - final String? userId; - - CreateUserResponse({ - this.userArn, - this.userId, - }); +enum ChatEventType { + disconnect, + message, + event, +} - factory CreateUserResponse.fromJson(Map json) { - return CreateUserResponse( - userArn: json['UserArn'] as String?, - userId: json['UserId'] as String?, - ); +extension ChatEventTypeValueExtension on ChatEventType { + String toValue() { + switch (this) { + case ChatEventType.disconnect: + return 'DISCONNECT'; + case ChatEventType.message: + return 'MESSAGE'; + case ChatEventType.event: + return 'EVENT'; + } } +} - Map toJson() { - final userArn = this.userArn; - final userId = this.userId; - return { - if (userArn != null) 'UserArn': userArn, - if (userId != null) 'UserId': userId, - }; +extension ChatEventTypeFromString on String { + ChatEventType toChatEventType() { + switch (this) { + case 'DISCONNECT': + return ChatEventType.disconnect; + case 'MESSAGE': + return ChatEventType.message; + case 'EVENT': + return ChatEventType.event; + } + throw Exception('$this is not known in enum ChatEventType'); } } -class CreateVocabularyResponse { - /// The current state of the custom vocabulary. - final VocabularyState state; - - /// The Amazon Resource Name (ARN) of the custom vocabulary. - final String vocabularyArn; +/// A chat message. +class ChatMessage { + /// The content of the chat message. + /// + ///
        + ///
      • + /// For text/plain and text/markdown, the Length + /// Constraints are Minimum of 1, Maximum of 1024. + ///
      • + ///
      • + /// For application/json, the Length Constraints are Minimum of 1, + /// Maximum of 12000. + ///
      • + ///
      • + /// For + /// application/vnd.amazonaws.connect.message.interactive.response, + /// the Length Constraints are Minimum of 1, Maximum of 12288. + ///
      • + ///
      + final String content; - /// The identifier of the custom vocabulary. - final String vocabularyId; + /// The type of the content. Supported types are text/plain, + /// text/markdown, application/json, and + /// application/vnd.amazonaws.connect.message.interactive.response. + final String contentType; - CreateVocabularyResponse({ - required this.state, - required this.vocabularyArn, - required this.vocabularyId, + ChatMessage({ + required this.content, + required this.contentType, }); - factory CreateVocabularyResponse.fromJson(Map json) { - return CreateVocabularyResponse( - state: (json['State'] as String).toVocabularyState(), - vocabularyArn: json['VocabularyArn'] as String, - vocabularyId: json['VocabularyId'] as String, - ); - } - Map toJson() { - final state = this.state; - final vocabularyArn = this.vocabularyArn; - final vocabularyId = this.vocabularyId; + final content = this.content; + final contentType = this.contentType; return { - 'State': state.toValue(), - 'VocabularyArn': vocabularyArn, - 'VocabularyId': vocabularyId, + 'Content': content, + 'ContentType': contentType, }; } } -/// Contains credentials to use for federation. -class Credentials { - /// An access token generated for a federated user to access Amazon Connect. - final String? accessToken; - - /// A token generated with an expiration time for the session a user is logged - /// in to Amazon Connect. - final DateTime? accessTokenExpiration; - - /// Renews a token generated for a user to access the Amazon Connect instance. - final String? refreshToken; - - /// Renews the expiration timer for a generated token. - final DateTime? refreshTokenExpiration; +/// Configuration information for the chat participant role. +class ChatParticipantRoleConfig { + /// A list of participant timers. You can specify any unique combination of role + /// and timer type. Duplicate entries error out the request with a 400. + final List participantTimerConfigList; - Credentials({ - this.accessToken, - this.accessTokenExpiration, - this.refreshToken, - this.refreshTokenExpiration, + ChatParticipantRoleConfig({ + required this.participantTimerConfigList, }); - factory Credentials.fromJson(Map json) { - return Credentials( - accessToken: json['AccessToken'] as String?, - accessTokenExpiration: timeStampFromJson(json['AccessTokenExpiration']), - refreshToken: json['RefreshToken'] as String?, - refreshTokenExpiration: timeStampFromJson(json['RefreshTokenExpiration']), - ); - } - Map toJson() { - final accessToken = this.accessToken; - final accessTokenExpiration = this.accessTokenExpiration; - final refreshToken = this.refreshToken; - final refreshTokenExpiration = this.refreshTokenExpiration; + final participantTimerConfigList = this.participantTimerConfigList; return { - if (accessToken != null) 'AccessToken': accessToken, - if (accessTokenExpiration != null) - 'AccessTokenExpiration': unixTimestampToJson(accessTokenExpiration), - if (refreshToken != null) 'RefreshToken': refreshToken, - if (refreshTokenExpiration != null) - 'RefreshTokenExpiration': unixTimestampToJson(refreshTokenExpiration), + 'ParticipantTimerConfigList': participantTimerConfigList, }; } } -/// Defines the cross-channel routing behavior that allows an agent working on a -/// contact in one channel to be offered a contact from a different channel. -class CrossChannelBehavior { - /// Specifies the other channels that can be routed to an agent handling their - /// current channel. - final BehaviorType behaviorType; +/// The streaming configuration, such as the Amazon SNS streaming endpoint. +class ChatStreamingConfiguration { + /// The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The Amazon + /// Resource Name (ARN) of the streaming endpoint that is used to publish + /// real-time message streaming for chat conversations. + final String streamingEndpointArn; - CrossChannelBehavior({ - required this.behaviorType, + ChatStreamingConfiguration({ + required this.streamingEndpointArn, }); - factory CrossChannelBehavior.fromJson(Map json) { - return CrossChannelBehavior( - behaviorType: (json['BehaviorType'] as String).toBehaviorType(), - ); - } - Map toJson() { - final behaviorType = this.behaviorType; + final streamingEndpointArn = this.streamingEndpointArn; return { - 'BehaviorType': behaviorType.toValue(), + 'StreamingEndpointArn': streamingEndpointArn, }; } } -/// Contains information about a real-time metric. For a description of each -/// metric, see Real-time -/// Metrics Definitions in the Amazon Connect Administrator Guide. -class CurrentMetric { - /// The name of the metric. - final CurrentMetricName? name; +class ClaimPhoneNumberResponse { + /// The Amazon Resource Name (ARN) of the phone number. + final String? phoneNumberArn; - /// The unit for the metric. - final Unit? unit; + /// A unique identifier for the phone number. + final String? phoneNumberId; - CurrentMetric({ - this.name, - this.unit, + ClaimPhoneNumberResponse({ + this.phoneNumberArn, + this.phoneNumberId, }); - factory CurrentMetric.fromJson(Map json) { - return CurrentMetric( - name: (json['Name'] as String?)?.toCurrentMetricName(), - unit: (json['Unit'] as String?)?.toUnit(), + factory ClaimPhoneNumberResponse.fromJson(Map json) { + return ClaimPhoneNumberResponse( + phoneNumberArn: json['PhoneNumberArn'] as String?, + phoneNumberId: json['PhoneNumberId'] as String?, ); } Map toJson() { - final name = this.name; - final unit = this.unit; + final phoneNumberArn = this.phoneNumberArn; + final phoneNumberId = this.phoneNumberId; return { - if (name != null) 'Name': name.toValue(), - if (unit != null) 'Unit': unit.toValue(), + if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, + if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, }; } } -/// Contains the data for a real-time metric. -class CurrentMetricData { - /// Information about the metric. - final CurrentMetric? metric; - - /// The value of the metric. - final double? value; +/// Information about a phone number that has been claimed to your Amazon +/// Connect instance or traffic distribution group. +class ClaimedPhoneNumberSummary { + /// The identifier of the Amazon Connect instance that phone numbers are claimed + /// to. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? instanceId; - CurrentMetricData({ - this.metric, - this.value, - }); + /// The phone number. Phone numbers are formatted [+] [country code] + /// [subscriber number including area code]. + final String? phoneNumber; - factory CurrentMetricData.fromJson(Map json) { - return CurrentMetricData( - metric: json['Metric'] != null - ? CurrentMetric.fromJson(json['Metric'] as Map) - : null, - value: json['Value'] as double?, - ); - } + /// The Amazon Resource Name (ARN) of the phone number. + final String? phoneNumberArn; - Map toJson() { - final metric = this.metric; - final value = this.value; - return { - if (metric != null) 'Metric': metric, - if (value != null) 'Value': value, - }; - } -} + /// The ISO country code. + final PhoneNumberCountryCode? phoneNumberCountryCode; -/// The current metric names. -enum CurrentMetricName { - agentsOnline, - agentsAvailable, - agentsOnCall, - agentsNonProductive, - agentsAfterContactWork, - agentsError, - agentsStaffed, - contactsInQueue, - oldestContactAge, - contactsScheduled, - agentsOnContact, - slotsActive, - slotsAvailable, -} + /// The description of the phone number. + final String? phoneNumberDescription; -extension CurrentMetricNameValueExtension on CurrentMetricName { - String toValue() { - switch (this) { - case CurrentMetricName.agentsOnline: - return 'AGENTS_ONLINE'; - case CurrentMetricName.agentsAvailable: - return 'AGENTS_AVAILABLE'; - case CurrentMetricName.agentsOnCall: - return 'AGENTS_ON_CALL'; - case CurrentMetricName.agentsNonProductive: - return 'AGENTS_NON_PRODUCTIVE'; - case CurrentMetricName.agentsAfterContactWork: - return 'AGENTS_AFTER_CONTACT_WORK'; - case CurrentMetricName.agentsError: - return 'AGENTS_ERROR'; - case CurrentMetricName.agentsStaffed: - return 'AGENTS_STAFFED'; - case CurrentMetricName.contactsInQueue: - return 'CONTACTS_IN_QUEUE'; - case CurrentMetricName.oldestContactAge: - return 'OLDEST_CONTACT_AGE'; - case CurrentMetricName.contactsScheduled: - return 'CONTACTS_SCHEDULED'; - case CurrentMetricName.agentsOnContact: - return 'AGENTS_ON_CONTACT'; - case CurrentMetricName.slotsActive: - return 'SLOTS_ACTIVE'; - case CurrentMetricName.slotsAvailable: - return 'SLOTS_AVAILABLE'; - } - } -} + /// A unique identifier for the phone number. + final String? phoneNumberId; -extension CurrentMetricNameFromString on String { - CurrentMetricName toCurrentMetricName() { - switch (this) { - case 'AGENTS_ONLINE': - return CurrentMetricName.agentsOnline; - case 'AGENTS_AVAILABLE': - return CurrentMetricName.agentsAvailable; - case 'AGENTS_ON_CALL': - return CurrentMetricName.agentsOnCall; - case 'AGENTS_NON_PRODUCTIVE': - return CurrentMetricName.agentsNonProductive; - case 'AGENTS_AFTER_CONTACT_WORK': - return CurrentMetricName.agentsAfterContactWork; - case 'AGENTS_ERROR': - return CurrentMetricName.agentsError; - case 'AGENTS_STAFFED': - return CurrentMetricName.agentsStaffed; - case 'CONTACTS_IN_QUEUE': - return CurrentMetricName.contactsInQueue; - case 'OLDEST_CONTACT_AGE': - return CurrentMetricName.oldestContactAge; - case 'CONTACTS_SCHEDULED': - return CurrentMetricName.contactsScheduled; - case 'AGENTS_ON_CONTACT': - return CurrentMetricName.agentsOnContact; - case 'SLOTS_ACTIVE': - return CurrentMetricName.slotsActive; - case 'SLOTS_AVAILABLE': - return CurrentMetricName.slotsAvailable; - } - throw Exception('$this is not known in enum CurrentMetricName'); - } -} + /// The status of the phone number. + /// + ///
        + ///
      • + /// CLAIMED means the previous ClaimPhoneNumber + /// or UpdatePhoneNumber + /// operation succeeded. + ///
      • + ///
      • + /// IN_PROGRESS means a ClaimPhoneNumber, + /// UpdatePhoneNumber, + /// or UpdatePhoneNumberMetadata + /// operation is still in progress and has not yet completed. You can call DescribePhoneNumber + /// at a later time to verify if the previous operation has completed. + ///
      • + ///
      • + /// FAILED indicates that the previous ClaimPhoneNumber + /// or UpdatePhoneNumber + /// operation has failed. It will include a message indicating the failure + /// reason. A common reason for a failure may be that the TargetArn + /// value you are claiming or updating a phone number to has reached its limit + /// of total claimed numbers. If you received a FAILED status from + /// a ClaimPhoneNumber API call, you have one day to retry claiming + /// the phone number before the number is released back to the inventory for + /// other customers to claim. + ///
      • + ///
      + /// You will not be billed for the phone number during the 1-day period if + /// number claiming fails. + /// + final PhoneNumberStatus? phoneNumberStatus; -/// Contains information about a set of real-time metrics. -class CurrentMetricResult { - /// The set of metrics. - final List? collections; + /// The type of phone number. + final PhoneNumberType? phoneNumberType; - /// The dimensions for the metrics. - final Dimensions? dimensions; + /// The claimed phone number ARN that was previously imported from the external + /// service, such as Amazon Pinpoint. If it is from Amazon Pinpoint, it looks + /// like the ARN of the phone number that was imported from Amazon Pinpoint. + final String? sourcePhoneNumberArn; - CurrentMetricResult({ - this.collections, - this.dimensions, + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic + /// distribution groups that phone number inbound traffic is routed through. + final String? targetArn; + + ClaimedPhoneNumberSummary({ + this.instanceId, + this.phoneNumber, + this.phoneNumberArn, + this.phoneNumberCountryCode, + this.phoneNumberDescription, + this.phoneNumberId, + this.phoneNumberStatus, + this.phoneNumberType, + this.sourcePhoneNumberArn, + this.tags, + this.targetArn, }); - factory CurrentMetricResult.fromJson(Map json) { - return CurrentMetricResult( - collections: (json['Collections'] as List?) - ?.whereNotNull() - .map((e) => CurrentMetricData.fromJson(e as Map)) - .toList(), - dimensions: json['Dimensions'] != null - ? Dimensions.fromJson(json['Dimensions'] as Map) + factory ClaimedPhoneNumberSummary.fromJson(Map json) { + return ClaimedPhoneNumberSummary( + instanceId: json['InstanceId'] as String?, + phoneNumber: json['PhoneNumber'] as String?, + phoneNumberArn: json['PhoneNumberArn'] as String?, + phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) + ?.toPhoneNumberCountryCode(), + phoneNumberDescription: json['PhoneNumberDescription'] as String?, + phoneNumberId: json['PhoneNumberId'] as String?, + phoneNumberStatus: json['PhoneNumberStatus'] != null + ? PhoneNumberStatus.fromJson( + json['PhoneNumberStatus'] as Map) : null, + phoneNumberType: + (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + sourcePhoneNumberArn: json['SourcePhoneNumberArn'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + targetArn: json['TargetArn'] as String?, ); } Map toJson() { - final collections = this.collections; - final dimensions = this.dimensions; + final instanceId = this.instanceId; + final phoneNumber = this.phoneNumber; + final phoneNumberArn = this.phoneNumberArn; + final phoneNumberCountryCode = this.phoneNumberCountryCode; + final phoneNumberDescription = this.phoneNumberDescription; + final phoneNumberId = this.phoneNumberId; + final phoneNumberStatus = this.phoneNumberStatus; + final phoneNumberType = this.phoneNumberType; + final sourcePhoneNumberArn = this.sourcePhoneNumberArn; + final tags = this.tags; + final targetArn = this.targetArn; return { - if (collections != null) 'Collections': collections, - if (dimensions != null) 'Dimensions': dimensions, + if (instanceId != null) 'InstanceId': instanceId, + if (phoneNumber != null) 'PhoneNumber': phoneNumber, + if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, + if (phoneNumberCountryCode != null) + 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), + if (phoneNumberDescription != null) + 'PhoneNumberDescription': phoneNumberDescription, + if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, + if (phoneNumberStatus != null) 'PhoneNumberStatus': phoneNumberStatus, + if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + if (sourcePhoneNumberArn != null) + 'SourcePhoneNumberArn': sourcePhoneNumberArn, + if (tags != null) 'Tags': tags, + if (targetArn != null) 'TargetArn': targetArn, }; } } -/// The way to sort the resulting response based on metrics. By default -/// resources are sorted based on AGENTS_ONLINE, -/// DESCENDING. The metric collection is sorted based on the input -/// metrics. -class CurrentMetricSortCriteria { - final CurrentMetricName? sortByMetric; +enum Comparison { + lt, +} - /// The way to sort. - final SortOrder? sortOrder; +extension ComparisonValueExtension on Comparison { + String toValue() { + switch (this) { + case Comparison.lt: + return 'LT'; + } + } +} - CurrentMetricSortCriteria({ - this.sortByMetric, - this.sortOrder, - }); +extension ComparisonFromString on String { + Comparison toComparison() { + switch (this) { + case 'LT': + return Comparison.lt; + } + throw Exception('$this is not known in enum Comparison'); + } +} + +/// Response from CompleteAttachedFileUpload API +class CompleteAttachedFileUploadResponse { + CompleteAttachedFileUploadResponse(); + + factory CompleteAttachedFileUploadResponse.fromJson(Map _) { + return CompleteAttachedFileUploadResponse(); + } Map toJson() { - final sortByMetric = this.sortByMetric; - final sortOrder = this.sortOrder; - return { - if (sortByMetric != null) 'SortByMetric': sortByMetric.toValue(), - if (sortOrder != null) 'SortOrder': sortOrder.toValue(), - }; + return {}; } } -/// Information about a reference when the referenceType is -/// DATE. Otherwise, null. -class DateReference { - /// Identifier of the date reference. - final String? name; +/// Information required to join the call. +class ConnectionData { + /// The attendee information, including attendee ID and join token. + final Attendee? attendee; - /// A valid date. - final String? value; + /// A meeting created using the Amazon Chime SDK. + final Meeting? meeting; - DateReference({ - this.name, - this.value, + ConnectionData({ + this.attendee, + this.meeting, }); - factory DateReference.fromJson(Map json) { - return DateReference( - name: json['Name'] as String?, - value: json['Value'] as String?, + factory ConnectionData.fromJson(Map json) { + return ConnectionData( + attendee: json['Attendee'] != null + ? Attendee.fromJson(json['Attendee'] as Map) + : null, + meeting: json['Meeting'] != null + ? Meeting.fromJson(json['Meeting'] as Map) + : null, ); } Map toJson() { - final name = this.name; - final value = this.value; + final attendee = this.attendee; + final meeting = this.meeting; return { - if (name != null) 'Name': name, - if (value != null) 'Value': value, + if (attendee != null) 'Attendee': attendee, + if (meeting != null) 'Meeting': meeting, }; } } -class DeactivateEvaluationFormResponse { - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; - - /// The unique identifier for the evaluation form. - final String evaluationFormId; +/// Contains information about a contact. +class Contact { + /// Information about the agent who accepted the contact. + final AgentInfo? agentInfo; - /// The version of the deactivated evaluation form resource. - final int evaluationFormVersion; + /// Indicates how an outbound + /// campaign call is actually disposed if the contact is connected to Amazon + /// Connect. + final AnsweringMachineDetectionStatus? answeringMachineDetectionStatus; - DeactivateEvaluationFormResponse({ - required this.evaluationFormArn, - required this.evaluationFormId, - required this.evaluationFormVersion, - }); + /// The Amazon Resource Name (ARN) for the contact. + final String? arn; + final Campaign? campaign; - factory DeactivateEvaluationFormResponse.fromJson(Map json) { - return DeactivateEvaluationFormResponse( - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormVersion: json['EvaluationFormVersion'] as int, - ); - } + /// How the contact reached your contact center. + final Channel? channel; - Map toJson() { - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; - final evaluationFormVersion = this.evaluationFormVersion; - return { - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, - 'EvaluationFormVersion': evaluationFormVersion, - }; - } -} + /// The timestamp when customer endpoint connected to Amazon Connect. + final DateTime? connectedToSystemTimestamp; -/// Contains information about a default vocabulary. -class DefaultVocabulary { - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - final String instanceId; + /// Information about the Customer on the contact. + final Customer? customer; - /// The language code of the vocabulary entries. For a list of languages and - /// their corresponding language codes, see What - /// is Amazon Transcribe? - final VocabularyLanguageCode languageCode; + /// Information about customer’s voice activity. + final CustomerVoiceActivity? customerVoiceActivity; - /// The identifier of the custom vocabulary. - final String vocabularyId; + /// The description of the contact. + final String? description; - /// A unique name of the custom vocabulary. - final String vocabularyName; + /// Information about the call disconnect experience. + final DisconnectDetails? disconnectDetails; - DefaultVocabulary({ - required this.instanceId, - required this.languageCode, - required this.vocabularyId, - required this.vocabularyName, - }); + /// The timestamp when the customer endpoint disconnected from Amazon Connect. + final DateTime? disconnectTimestamp; - factory DefaultVocabulary.fromJson(Map json) { - return DefaultVocabulary( - instanceId: json['InstanceId'] as String, - languageCode: (json['LanguageCode'] as String).toVocabularyLanguageCode(), - vocabularyId: json['VocabularyId'] as String, - vocabularyName: json['VocabularyName'] as String, - ); - } + /// The identifier for the contact. + final String? id; - Map toJson() { - final instanceId = this.instanceId; - final languageCode = this.languageCode; - final vocabularyId = this.vocabularyId; - final vocabularyName = this.vocabularyName; - return { - 'InstanceId': instanceId, - 'LanguageCode': languageCode.toValue(), - 'VocabularyId': vocabularyId, - 'VocabularyName': vocabularyName, - }; - } -} + /// If this contact is related to other contacts, this is the ID of the initial + /// contact. + final String? initialContactId; -class DeleteContactFlowModuleResponse { - DeleteContactFlowModuleResponse(); + /// Indicates how the contact was initiated. + final ContactInitiationMethod? initiationMethod; - factory DeleteContactFlowModuleResponse.fromJson(Map _) { - return DeleteContactFlowModuleResponse(); - } + /// The date and time this contact was initiated, in UTC time. For + /// INBOUND, this is when the contact arrived. For + /// OUTBOUND, this is when the agent began dialing. For + /// CALLBACK, this is when the callback contact was created. For + /// TRANSFER and QUEUE_TRANSFER, this is when the + /// transfer was initiated. For API, this is when the request + /// arrived. For EXTERNAL_OUTBOUND, this is when the agent started + /// dialing the external participant. For MONITOR, this is when the + /// supervisor started listening to a contact. + final DateTime? initiationTimestamp; - Map toJson() { - return {}; - } -} + /// The timestamp when the contact was last paused. + final DateTime? lastPausedTimestamp; -class DeleteContactFlowResponse { - DeleteContactFlowResponse(); + /// The timestamp when the contact was last resumed. + final DateTime? lastResumedTimestamp; - factory DeleteContactFlowResponse.fromJson(Map _) { - return DeleteContactFlowResponse(); - } + /// The timestamp when contact was last updated. + final DateTime? lastUpdateTimestamp; - Map toJson() { - return {}; - } -} + /// The name of the contact. + final String? name; -class DeleteTaskTemplateResponse { - DeleteTaskTemplateResponse(); + /// If this contact is not the first contact, this is the ID of the previous + /// contact. + final String? previousContactId; - factory DeleteTaskTemplateResponse.fromJson(Map _) { - return DeleteTaskTemplateResponse(); - } + /// Information about the quality of the participant's media connection. + final QualityMetrics? qualityMetrics; - Map toJson() { - return {}; - } -} + /// If this contact was queued, this contains information about the queue. + final QueueInfo? queueInfo; -class DeleteTrafficDistributionGroupResponse { - DeleteTrafficDistributionGroupResponse(); + /// An integer that represents the queue priority to be applied to the contact + /// (lower priorities are routed preferentially). Cannot be specified if the + /// QueueTimeAdjustmentSeconds is specified. Must be statically defined, must be + /// larger than zero, and a valid integer value. Default Value is 5. + final int? queuePriority; - factory DeleteTrafficDistributionGroupResponse.fromJson( - Map _) { - return DeleteTrafficDistributionGroupResponse(); - } + /// An integer that represents the queue time adjust to be applied to the + /// contact, in seconds (longer / larger queue time are routed preferentially). + /// Cannot be specified if the QueuePriority is specified. Must be statically + /// defined and a valid integer value. + final int? queueTimeAdjustmentSeconds; - Map toJson() { - return {}; - } -} + /// The contactId that is related + /// to this contact. + final String? relatedContactId; -class DeleteVocabularyResponse { - /// The current state of the custom vocabulary. - final VocabularyState state; + /// Latest routing criteria on the contact. + final RoutingCriteria? routingCriteria; - /// The Amazon Resource Name (ARN) of the custom vocabulary. - final String vocabularyArn; + /// The timestamp, in Unix epoch time format, at which to start running the + /// inbound flow. + final DateTime? scheduledTimestamp; - /// The identifier of the custom vocabulary. - final String vocabularyId; + /// A set of system defined key-value pairs stored on individual contact + /// segments using an attribute map. The attributes are standard Amazon Connect + /// attributes and can be accessed in flows. Attribute keys can include only + /// alphanumeric, -, and _ characters. This field can be used to show channel + /// subtype. For example, connect:Guide or + /// connect:SMS. + final Map? segmentAttributes; - DeleteVocabularyResponse({ - required this.state, - required this.vocabularyArn, - required this.vocabularyId, - }); + /// Tags associated with the contact. This contains both Amazon Web Services + /// generated and user-defined tags. + final Map? tags; - factory DeleteVocabularyResponse.fromJson(Map json) { - return DeleteVocabularyResponse( - state: (json['State'] as String).toVocabularyState(), - vocabularyArn: json['VocabularyArn'] as String, - vocabularyId: json['VocabularyId'] as String, - ); - } + /// Total pause count for a contact. + final int? totalPauseCount; - Map toJson() { - final state = this.state; - final vocabularyArn = this.vocabularyArn; - final vocabularyId = this.vocabularyId; - return { - 'State': state.toValue(), - 'VocabularyArn': vocabularyArn, - 'VocabularyId': vocabularyId, - }; - } -} + /// Total pause duration for a contact in seconds. + final int? totalPauseDurationInSeconds; -class DescribeAgentStatusResponse { - /// The agent status. - final AgentStatus? agentStatus; + /// Information about Amazon Connect Wisdom. + final WisdomInfo? wisdomInfo; - DescribeAgentStatusResponse({ - this.agentStatus, + Contact({ + this.agentInfo, + this.answeringMachineDetectionStatus, + this.arn, + this.campaign, + this.channel, + this.connectedToSystemTimestamp, + this.customer, + this.customerVoiceActivity, + this.description, + this.disconnectDetails, + this.disconnectTimestamp, + this.id, + this.initialContactId, + this.initiationMethod, + this.initiationTimestamp, + this.lastPausedTimestamp, + this.lastResumedTimestamp, + this.lastUpdateTimestamp, + this.name, + this.previousContactId, + this.qualityMetrics, + this.queueInfo, + this.queuePriority, + this.queueTimeAdjustmentSeconds, + this.relatedContactId, + this.routingCriteria, + this.scheduledTimestamp, + this.segmentAttributes, + this.tags, + this.totalPauseCount, + this.totalPauseDurationInSeconds, + this.wisdomInfo, }); - factory DescribeAgentStatusResponse.fromJson(Map json) { - return DescribeAgentStatusResponse( - agentStatus: json['AgentStatus'] != null - ? AgentStatus.fromJson(json['AgentStatus'] as Map) + factory Contact.fromJson(Map json) { + return Contact( + agentInfo: json['AgentInfo'] != null + ? AgentInfo.fromJson(json['AgentInfo'] as Map) + : null, + answeringMachineDetectionStatus: + (json['AnsweringMachineDetectionStatus'] as String?) + ?.toAnsweringMachineDetectionStatus(), + arn: json['Arn'] as String?, + campaign: json['Campaign'] != null + ? Campaign.fromJson(json['Campaign'] as Map) + : null, + channel: (json['Channel'] as String?)?.toChannel(), + connectedToSystemTimestamp: + timeStampFromJson(json['ConnectedToSystemTimestamp']), + customer: json['Customer'] != null + ? Customer.fromJson(json['Customer'] as Map) + : null, + customerVoiceActivity: json['CustomerVoiceActivity'] != null + ? CustomerVoiceActivity.fromJson( + json['CustomerVoiceActivity'] as Map) + : null, + description: json['Description'] as String?, + disconnectDetails: json['DisconnectDetails'] != null + ? DisconnectDetails.fromJson( + json['DisconnectDetails'] as Map) + : null, + disconnectTimestamp: timeStampFromJson(json['DisconnectTimestamp']), + id: json['Id'] as String?, + initialContactId: json['InitialContactId'] as String?, + initiationMethod: + (json['InitiationMethod'] as String?)?.toContactInitiationMethod(), + initiationTimestamp: timeStampFromJson(json['InitiationTimestamp']), + lastPausedTimestamp: timeStampFromJson(json['LastPausedTimestamp']), + lastResumedTimestamp: timeStampFromJson(json['LastResumedTimestamp']), + lastUpdateTimestamp: timeStampFromJson(json['LastUpdateTimestamp']), + name: json['Name'] as String?, + previousContactId: json['PreviousContactId'] as String?, + qualityMetrics: json['QualityMetrics'] != null + ? QualityMetrics.fromJson( + json['QualityMetrics'] as Map) + : null, + queueInfo: json['QueueInfo'] != null + ? QueueInfo.fromJson(json['QueueInfo'] as Map) + : null, + queuePriority: json['QueuePriority'] as int?, + queueTimeAdjustmentSeconds: json['QueueTimeAdjustmentSeconds'] as int?, + relatedContactId: json['RelatedContactId'] as String?, + routingCriteria: json['RoutingCriteria'] != null + ? RoutingCriteria.fromJson( + json['RoutingCriteria'] as Map) + : null, + scheduledTimestamp: timeStampFromJson(json['ScheduledTimestamp']), + segmentAttributes: (json['SegmentAttributes'] as Map?) + ?.map((k, e) => MapEntry( + k, SegmentAttributeValue.fromJson(e as Map))), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + totalPauseCount: json['TotalPauseCount'] as int?, + totalPauseDurationInSeconds: json['TotalPauseDurationInSeconds'] as int?, + wisdomInfo: json['WisdomInfo'] != null + ? WisdomInfo.fromJson(json['WisdomInfo'] as Map) : null, ); } Map toJson() { - final agentStatus = this.agentStatus; + final agentInfo = this.agentInfo; + final answeringMachineDetectionStatus = + this.answeringMachineDetectionStatus; + final arn = this.arn; + final campaign = this.campaign; + final channel = this.channel; + final connectedToSystemTimestamp = this.connectedToSystemTimestamp; + final customer = this.customer; + final customerVoiceActivity = this.customerVoiceActivity; + final description = this.description; + final disconnectDetails = this.disconnectDetails; + final disconnectTimestamp = this.disconnectTimestamp; + final id = this.id; + final initialContactId = this.initialContactId; + final initiationMethod = this.initiationMethod; + final initiationTimestamp = this.initiationTimestamp; + final lastPausedTimestamp = this.lastPausedTimestamp; + final lastResumedTimestamp = this.lastResumedTimestamp; + final lastUpdateTimestamp = this.lastUpdateTimestamp; + final name = this.name; + final previousContactId = this.previousContactId; + final qualityMetrics = this.qualityMetrics; + final queueInfo = this.queueInfo; + final queuePriority = this.queuePriority; + final queueTimeAdjustmentSeconds = this.queueTimeAdjustmentSeconds; + final relatedContactId = this.relatedContactId; + final routingCriteria = this.routingCriteria; + final scheduledTimestamp = this.scheduledTimestamp; + final segmentAttributes = this.segmentAttributes; + final tags = this.tags; + final totalPauseCount = this.totalPauseCount; + final totalPauseDurationInSeconds = this.totalPauseDurationInSeconds; + final wisdomInfo = this.wisdomInfo; return { - if (agentStatus != null) 'AgentStatus': agentStatus, - }; - } -} - -class DescribeContactEvaluationResponse { - /// Information about the evaluation form completed for a specific contact. - final Evaluation evaluation; - - /// Information about the evaluation form. - final EvaluationFormContent evaluationForm; - - DescribeContactEvaluationResponse({ - required this.evaluation, - required this.evaluationForm, - }); - - factory DescribeContactEvaluationResponse.fromJson( - Map json) { - return DescribeContactEvaluationResponse( - evaluation: - Evaluation.fromJson(json['Evaluation'] as Map), - evaluationForm: EvaluationFormContent.fromJson( - json['EvaluationForm'] as Map), - ); - } - - Map toJson() { - final evaluation = this.evaluation; - final evaluationForm = this.evaluationForm; - return { - 'Evaluation': evaluation, - 'EvaluationForm': evaluationForm, + if (agentInfo != null) 'AgentInfo': agentInfo, + if (answeringMachineDetectionStatus != null) + 'AnsweringMachineDetectionStatus': + answeringMachineDetectionStatus.toValue(), + if (arn != null) 'Arn': arn, + if (campaign != null) 'Campaign': campaign, + if (channel != null) 'Channel': channel.toValue(), + if (connectedToSystemTimestamp != null) + 'ConnectedToSystemTimestamp': + unixTimestampToJson(connectedToSystemTimestamp), + if (customer != null) 'Customer': customer, + if (customerVoiceActivity != null) + 'CustomerVoiceActivity': customerVoiceActivity, + if (description != null) 'Description': description, + if (disconnectDetails != null) 'DisconnectDetails': disconnectDetails, + if (disconnectTimestamp != null) + 'DisconnectTimestamp': unixTimestampToJson(disconnectTimestamp), + if (id != null) 'Id': id, + if (initialContactId != null) 'InitialContactId': initialContactId, + if (initiationMethod != null) + 'InitiationMethod': initiationMethod.toValue(), + if (initiationTimestamp != null) + 'InitiationTimestamp': unixTimestampToJson(initiationTimestamp), + if (lastPausedTimestamp != null) + 'LastPausedTimestamp': unixTimestampToJson(lastPausedTimestamp), + if (lastResumedTimestamp != null) + 'LastResumedTimestamp': unixTimestampToJson(lastResumedTimestamp), + if (lastUpdateTimestamp != null) + 'LastUpdateTimestamp': unixTimestampToJson(lastUpdateTimestamp), + if (name != null) 'Name': name, + if (previousContactId != null) 'PreviousContactId': previousContactId, + if (qualityMetrics != null) 'QualityMetrics': qualityMetrics, + if (queueInfo != null) 'QueueInfo': queueInfo, + if (queuePriority != null) 'QueuePriority': queuePriority, + if (queueTimeAdjustmentSeconds != null) + 'QueueTimeAdjustmentSeconds': queueTimeAdjustmentSeconds, + if (relatedContactId != null) 'RelatedContactId': relatedContactId, + if (routingCriteria != null) 'RoutingCriteria': routingCriteria, + if (scheduledTimestamp != null) + 'ScheduledTimestamp': unixTimestampToJson(scheduledTimestamp), + if (segmentAttributes != null) 'SegmentAttributes': segmentAttributes, + if (tags != null) 'Tags': tags, + if (totalPauseCount != null) 'TotalPauseCount': totalPauseCount, + if (totalPauseDurationInSeconds != null) + 'TotalPauseDurationInSeconds': totalPauseDurationInSeconds, + if (wisdomInfo != null) 'WisdomInfo': wisdomInfo, }; } } -class DescribeContactFlowModuleResponse { - /// Information about the flow module. - final ContactFlowModule? contactFlowModule; +/// A structure that defines search criteria for contacts using analysis outputs +/// from Amazon Connect Contact Lens. +class ContactAnalysis { + /// Search criteria based on transcript analyzed by Amazon Connect Contact Lens. + final Transcript? transcript; - DescribeContactFlowModuleResponse({ - this.contactFlowModule, + ContactAnalysis({ + this.transcript, }); - factory DescribeContactFlowModuleResponse.fromJson( - Map json) { - return DescribeContactFlowModuleResponse( - contactFlowModule: json['ContactFlowModule'] != null - ? ContactFlowModule.fromJson( - json['ContactFlowModule'] as Map) - : null, - ); - } - Map toJson() { - final contactFlowModule = this.contactFlowModule; + final transcript = this.transcript; return { - if (contactFlowModule != null) 'ContactFlowModule': contactFlowModule, + if (transcript != null) 'Transcript': transcript, }; } } -class DescribeContactFlowResponse { - /// Information about the flow. - final ContactFlow? contactFlow; +/// Request object with information to create a contact. +class ContactDataRequest { + /// List of attributes to be stored in a contact. + final Map? attributes; - DescribeContactFlowResponse({ - this.contactFlow, - }); + /// Structure to store information associated with a campaign. + final Campaign? campaign; - factory DescribeContactFlowResponse.fromJson(Map json) { - return DescribeContactFlowResponse( - contactFlow: json['ContactFlow'] != null - ? ContactFlow.fromJson(json['ContactFlow'] as Map) - : null, - ); - } + /// Endpoint of the customer for which contact will be initiated. + final Endpoint? customerEndpoint; - Map toJson() { - final contactFlow = this.contactFlow; - return { - if (contactFlow != null) 'ContactFlow': contactFlow, - }; - } -} + /// The identifier of the queue associated with the Amazon Connect instance in + /// which contacts that are created will be queued. + final String? queueId; -class DescribeContactResponse { - /// Information about the contact. - final Contact? contact; + /// Identifier to uniquely identify individual requests in the batch. + final String? requestIdentifier; - DescribeContactResponse({ - this.contact, - }); + /// Endpoint associated with the Amazon Connect instance from which outbound + /// contact will be initiated for the campaign. + final Endpoint? systemEndpoint; - factory DescribeContactResponse.fromJson(Map json) { - return DescribeContactResponse( - contact: json['Contact'] != null - ? Contact.fromJson(json['Contact'] as Map) - : null, - ); - } + ContactDataRequest({ + this.attributes, + this.campaign, + this.customerEndpoint, + this.queueId, + this.requestIdentifier, + this.systemEndpoint, + }); Map toJson() { - final contact = this.contact; + final attributes = this.attributes; + final campaign = this.campaign; + final customerEndpoint = this.customerEndpoint; + final queueId = this.queueId; + final requestIdentifier = this.requestIdentifier; + final systemEndpoint = this.systemEndpoint; return { - if (contact != null) 'Contact': contact, + if (attributes != null) 'Attributes': attributes, + if (campaign != null) 'Campaign': campaign, + if (customerEndpoint != null) 'CustomerEndpoint': customerEndpoint, + if (queueId != null) 'QueueId': queueId, + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + if (systemEndpoint != null) 'SystemEndpoint': systemEndpoint, }; } } -class DescribeEvaluationFormResponse { - /// Information about the evaluation form. - final EvaluationForm evaluationForm; +/// Filters user data based on the contact information that is associated to the +/// users. It contains a list of contact +/// states. +class ContactFilter { + /// A list of up to 9 contact + /// states. + final List? contactStates; - DescribeEvaluationFormResponse({ - required this.evaluationForm, + ContactFilter({ + this.contactStates, }); - factory DescribeEvaluationFormResponse.fromJson(Map json) { - return DescribeEvaluationFormResponse( - evaluationForm: EvaluationForm.fromJson( - json['EvaluationForm'] as Map), - ); - } - Map toJson() { - final evaluationForm = this.evaluationForm; + final contactStates = this.contactStates; return { - 'EvaluationForm': evaluationForm, + if (contactStates != null) + 'ContactStates': contactStates.map((e) => e.toValue()).toList(), }; } } -class DescribeHoursOfOperationResponse { - /// The hours of operation. - final HoursOfOperation? hoursOfOperation; +/// Contains information about a flow. +class ContactFlow { + /// The Amazon Resource Name (ARN) of the flow. + final String? arn; - DescribeHoursOfOperationResponse({ - this.hoursOfOperation, - }); + /// The JSON string that represents the content of the flow. For an example, see + /// Example + /// flow in Amazon Connect Flow language. + /// + /// Length Constraints: Minimum length of 1. Maximum length of 256000. + final String? content; - factory DescribeHoursOfOperationResponse.fromJson(Map json) { - return DescribeHoursOfOperationResponse( - hoursOfOperation: json['HoursOfOperation'] != null - ? HoursOfOperation.fromJson( - json['HoursOfOperation'] as Map) - : null, - ); - } + /// The description of the flow. + final String? description; - Map toJson() { - final hoursOfOperation = this.hoursOfOperation; - return { - if (hoursOfOperation != null) 'HoursOfOperation': hoursOfOperation, - }; - } -} + /// The identifier of the flow. + final String? id; -class DescribeInstanceAttributeResponse { - /// The type of attribute. - final Attribute? attribute; + /// The name of the flow. + final String? name; - DescribeInstanceAttributeResponse({ - this.attribute, - }); + /// The type of flow. + final ContactFlowState? state; - factory DescribeInstanceAttributeResponse.fromJson( - Map json) { - return DescribeInstanceAttributeResponse( - attribute: json['Attribute'] != null - ? Attribute.fromJson(json['Attribute'] as Map) - : null, - ); - } + /// The status of the contact flow. + final ContactFlowStatus? status; - Map toJson() { - final attribute = this.attribute; - return { - if (attribute != null) 'Attribute': attribute, - }; - } -} + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; -class DescribeInstanceResponse { - /// The name of the instance. - final Instance? instance; + /// The type of the flow. For descriptions of the available types, see Choose + /// a flow type in the Amazon Connect Administrator Guide. + final ContactFlowType? type; - DescribeInstanceResponse({ - this.instance, + ContactFlow({ + this.arn, + this.content, + this.description, + this.id, + this.name, + this.state, + this.status, + this.tags, + this.type, }); - factory DescribeInstanceResponse.fromJson(Map json) { - return DescribeInstanceResponse( - instance: json['Instance'] != null - ? Instance.fromJson(json['Instance'] as Map) - : null, + factory ContactFlow.fromJson(Map json) { + return ContactFlow( + arn: json['Arn'] as String?, + content: json['Content'] as String?, + description: json['Description'] as String?, + id: json['Id'] as String?, + name: json['Name'] as String?, + state: (json['State'] as String?)?.toContactFlowState(), + status: (json['Status'] as String?)?.toContactFlowStatus(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + type: (json['Type'] as String?)?.toContactFlowType(), ); } Map toJson() { - final instance = this.instance; + final arn = this.arn; + final content = this.content; + final description = this.description; + final id = this.id; + final name = this.name; + final state = this.state; + final status = this.status; + final tags = this.tags; + final type = this.type; return { - if (instance != null) 'Instance': instance, + if (arn != null) 'Arn': arn, + if (content != null) 'Content': content, + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (state != null) 'State': state.toValue(), + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, + if (type != null) 'Type': type.toValue(), }; } } -class DescribeInstanceStorageConfigResponse { - /// A valid storage type. - final InstanceStorageConfig? storageConfig; +/// Contains information about a flow module. +class ContactFlowModule { + /// The Amazon Resource Name (ARN). + final String? arn; - DescribeInstanceStorageConfigResponse({ - this.storageConfig, + /// The JSON string that represents the content of the flow. For an example, see + /// Example + /// flow in Amazon Connect Flow language. + final String? content; + + /// The description of the flow module. + final String? description; + + /// The identifier of the flow module. + final String? id; + + /// The name of the flow module. + final String? name; + + /// The type of flow module. + final ContactFlowModuleState? state; + + /// The status of the flow module. + final ContactFlowModuleStatus? status; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + ContactFlowModule({ + this.arn, + this.content, + this.description, + this.id, + this.name, + this.state, + this.status, + this.tags, }); - factory DescribeInstanceStorageConfigResponse.fromJson( - Map json) { - return DescribeInstanceStorageConfigResponse( - storageConfig: json['StorageConfig'] != null - ? InstanceStorageConfig.fromJson( - json['StorageConfig'] as Map) - : null, + factory ContactFlowModule.fromJson(Map json) { + return ContactFlowModule( + arn: json['Arn'] as String?, + content: json['Content'] as String?, + description: json['Description'] as String?, + id: json['Id'] as String?, + name: json['Name'] as String?, + state: (json['State'] as String?)?.toContactFlowModuleState(), + status: (json['Status'] as String?)?.toContactFlowModuleStatus(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final storageConfig = this.storageConfig; + final arn = this.arn; + final content = this.content; + final description = this.description; + final id = this.id; + final name = this.name; + final state = this.state; + final status = this.status; + final tags = this.tags; return { - if (storageConfig != null) 'StorageConfig': storageConfig, + if (arn != null) 'Arn': arn, + if (content != null) 'Content': content, + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (state != null) 'State': state.toValue(), + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, }; } } -class DescribePhoneNumberResponse { - /// Information about a phone number that's been claimed to your Amazon Connect - /// instance or traffic distribution group. - final ClaimedPhoneNumberSummary? claimedPhoneNumberSummary; +/// The search criteria to be used to return flow modules. +class ContactFlowModuleSearchCriteria { + /// A list of conditions which would be applied together with an + /// AND condition. + final List? andConditions; - DescribePhoneNumberResponse({ - this.claimedPhoneNumberSummary, - }); + /// A list of conditions which would be applied together with an OR + /// condition. + final List? orConditions; + final StringCondition? stringCondition; - factory DescribePhoneNumberResponse.fromJson(Map json) { - return DescribePhoneNumberResponse( - claimedPhoneNumberSummary: json['ClaimedPhoneNumberSummary'] != null - ? ClaimedPhoneNumberSummary.fromJson( - json['ClaimedPhoneNumberSummary'] as Map) - : null, - ); - } + ContactFlowModuleSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, + }); Map toJson() { - final claimedPhoneNumberSummary = this.claimedPhoneNumberSummary; + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; return { - if (claimedPhoneNumberSummary != null) - 'ClaimedPhoneNumberSummary': claimedPhoneNumberSummary, + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, }; } } -class DescribePromptResponse { - /// Information about the prompt. - final Prompt? prompt; +/// The search criteria to be used to return flow modules. +class ContactFlowModuleSearchFilter { + final ControlPlaneTagFilter? tagFilter; - DescribePromptResponse({ - this.prompt, + ContactFlowModuleSearchFilter({ + this.tagFilter, }); - factory DescribePromptResponse.fromJson(Map json) { - return DescribePromptResponse( - prompt: json['Prompt'] != null - ? Prompt.fromJson(json['Prompt'] as Map) - : null, - ); - } - Map toJson() { - final prompt = this.prompt; + final tagFilter = this.tagFilter; return { - if (prompt != null) 'Prompt': prompt, + if (tagFilter != null) 'TagFilter': tagFilter, }; } } -class DescribeQueueResponse { - /// The name of the queue. - final Queue? queue; - - DescribeQueueResponse({ - this.queue, - }); +enum ContactFlowModuleState { + active, + archived, +} - factory DescribeQueueResponse.fromJson(Map json) { - return DescribeQueueResponse( - queue: json['Queue'] != null - ? Queue.fromJson(json['Queue'] as Map) - : null, - ); +extension ContactFlowModuleStateValueExtension on ContactFlowModuleState { + String toValue() { + switch (this) { + case ContactFlowModuleState.active: + return 'ACTIVE'; + case ContactFlowModuleState.archived: + return 'ARCHIVED'; + } } +} - Map toJson() { - final queue = this.queue; - return { - if (queue != null) 'Queue': queue, - }; +extension ContactFlowModuleStateFromString on String { + ContactFlowModuleState toContactFlowModuleState() { + switch (this) { + case 'ACTIVE': + return ContactFlowModuleState.active; + case 'ARCHIVED': + return ContactFlowModuleState.archived; + } + throw Exception('$this is not known in enum ContactFlowModuleState'); } } -class DescribeQuickConnectResponse { - /// Information about the quick connect. - final QuickConnect? quickConnect; - - DescribeQuickConnectResponse({ - this.quickConnect, - }); +enum ContactFlowModuleStatus { + published, + saved, +} - factory DescribeQuickConnectResponse.fromJson(Map json) { - return DescribeQuickConnectResponse( - quickConnect: json['QuickConnect'] != null - ? QuickConnect.fromJson(json['QuickConnect'] as Map) - : null, - ); +extension ContactFlowModuleStatusValueExtension on ContactFlowModuleStatus { + String toValue() { + switch (this) { + case ContactFlowModuleStatus.published: + return 'PUBLISHED'; + case ContactFlowModuleStatus.saved: + return 'SAVED'; + } } +} - Map toJson() { - final quickConnect = this.quickConnect; - return { - if (quickConnect != null) 'QuickConnect': quickConnect, - }; +extension ContactFlowModuleStatusFromString on String { + ContactFlowModuleStatus toContactFlowModuleStatus() { + switch (this) { + case 'PUBLISHED': + return ContactFlowModuleStatus.published; + case 'SAVED': + return ContactFlowModuleStatus.saved; + } + throw Exception('$this is not known in enum ContactFlowModuleStatus'); } } -class DescribeRoutingProfileResponse { - /// The routing profile. - final RoutingProfile? routingProfile; +/// Contains summary information about a flow. +class ContactFlowModuleSummary { + /// The Amazon Resource Name (ARN) of the flow module. + final String? arn; - DescribeRoutingProfileResponse({ - this.routingProfile, + /// The identifier of the flow module. + final String? id; + + /// The name of the flow module. + final String? name; + + /// The type of flow module. + final ContactFlowModuleState? state; + + ContactFlowModuleSummary({ + this.arn, + this.id, + this.name, + this.state, }); - factory DescribeRoutingProfileResponse.fromJson(Map json) { - return DescribeRoutingProfileResponse( - routingProfile: json['RoutingProfile'] != null - ? RoutingProfile.fromJson( - json['RoutingProfile'] as Map) - : null, + factory ContactFlowModuleSummary.fromJson(Map json) { + return ContactFlowModuleSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + name: json['Name'] as String?, + state: (json['State'] as String?)?.toContactFlowModuleState(), ); } Map toJson() { - final routingProfile = this.routingProfile; + final arn = this.arn; + final id = this.id; + final name = this.name; + final state = this.state; return { - if (routingProfile != null) 'RoutingProfile': routingProfile, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (state != null) 'State': state.toValue(), }; } } -class DescribeRuleResponse { - /// Information about the rule. - final Rule rule; +/// The search criteria to be used to return contact flows. +class ContactFlowSearchCriteria { + /// A list of conditions which would be applied together with an + /// AND condition. + final List? andConditions; - DescribeRuleResponse({ - required this.rule, - }); + /// A list of conditions which would be applied together with an OR + /// condition. + final List? orConditions; - factory DescribeRuleResponse.fromJson(Map json) { - return DescribeRuleResponse( - rule: Rule.fromJson(json['Rule'] as Map), - ); - } + /// The state of the flow. + final ContactFlowState? stateCondition; - Map toJson() { - final rule = this.rule; - return { - 'Rule': rule, - }; - } -} + /// The status of the flow. + final ContactFlowStatus? statusCondition; + final StringCondition? stringCondition; -class DescribeSecurityProfileResponse { - /// The security profile. - final SecurityProfile? securityProfile; + /// The type of flow. + final ContactFlowType? typeCondition; - DescribeSecurityProfileResponse({ - this.securityProfile, + ContactFlowSearchCriteria({ + this.andConditions, + this.orConditions, + this.stateCondition, + this.statusCondition, + this.stringCondition, + this.typeCondition, }); - factory DescribeSecurityProfileResponse.fromJson(Map json) { - return DescribeSecurityProfileResponse( - securityProfile: json['SecurityProfile'] != null - ? SecurityProfile.fromJson( - json['SecurityProfile'] as Map) - : null, - ); - } - Map toJson() { - final securityProfile = this.securityProfile; + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stateCondition = this.stateCondition; + final statusCondition = this.statusCondition; + final stringCondition = this.stringCondition; + final typeCondition = this.typeCondition; return { - if (securityProfile != null) 'SecurityProfile': securityProfile, + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stateCondition != null) 'StateCondition': stateCondition.toValue(), + if (statusCondition != null) 'StatusCondition': statusCondition.toValue(), + if (stringCondition != null) 'StringCondition': stringCondition, + if (typeCondition != null) 'TypeCondition': typeCondition.toValue(), }; } } -class DescribeTrafficDistributionGroupResponse { - /// Information about the traffic distribution group. - final TrafficDistributionGroup? trafficDistributionGroup; +/// Filters to be applied to search results. +class ContactFlowSearchFilter { + final ControlPlaneTagFilter? tagFilter; - DescribeTrafficDistributionGroupResponse({ - this.trafficDistributionGroup, + ContactFlowSearchFilter({ + this.tagFilter, }); - factory DescribeTrafficDistributionGroupResponse.fromJson( - Map json) { - return DescribeTrafficDistributionGroupResponse( - trafficDistributionGroup: json['TrafficDistributionGroup'] != null - ? TrafficDistributionGroup.fromJson( - json['TrafficDistributionGroup'] as Map) - : null, - ); - } - Map toJson() { - final trafficDistributionGroup = this.trafficDistributionGroup; + final tagFilter = this.tagFilter; return { - if (trafficDistributionGroup != null) - 'TrafficDistributionGroup': trafficDistributionGroup, + if (tagFilter != null) 'TagFilter': tagFilter, }; } } -class DescribeUserHierarchyGroupResponse { - /// Information about the hierarchy group. - final HierarchyGroup? hierarchyGroup; - - DescribeUserHierarchyGroupResponse({ - this.hierarchyGroup, - }); - - factory DescribeUserHierarchyGroupResponse.fromJson( - Map json) { - return DescribeUserHierarchyGroupResponse( - hierarchyGroup: json['HierarchyGroup'] != null - ? HierarchyGroup.fromJson( - json['HierarchyGroup'] as Map) - : null, - ); - } - - Map toJson() { - final hierarchyGroup = this.hierarchyGroup; - return { - if (hierarchyGroup != null) 'HierarchyGroup': hierarchyGroup, - }; - } +enum ContactFlowState { + active, + archived, } -class DescribeUserHierarchyStructureResponse { - /// Information about the hierarchy structure. - final HierarchyStructure? hierarchyStructure; - - DescribeUserHierarchyStructureResponse({ - this.hierarchyStructure, - }); - - factory DescribeUserHierarchyStructureResponse.fromJson( - Map json) { - return DescribeUserHierarchyStructureResponse( - hierarchyStructure: json['HierarchyStructure'] != null - ? HierarchyStructure.fromJson( - json['HierarchyStructure'] as Map) - : null, - ); +extension ContactFlowStateValueExtension on ContactFlowState { + String toValue() { + switch (this) { + case ContactFlowState.active: + return 'ACTIVE'; + case ContactFlowState.archived: + return 'ARCHIVED'; + } } +} - Map toJson() { - final hierarchyStructure = this.hierarchyStructure; - return { - if (hierarchyStructure != null) 'HierarchyStructure': hierarchyStructure, - }; +extension ContactFlowStateFromString on String { + ContactFlowState toContactFlowState() { + switch (this) { + case 'ACTIVE': + return ContactFlowState.active; + case 'ARCHIVED': + return ContactFlowState.archived; + } + throw Exception('$this is not known in enum ContactFlowState'); } } -class DescribeUserResponse { - /// Information about the user account and configuration settings. - final User? user; - - DescribeUserResponse({ - this.user, - }); +enum ContactFlowStatus { + published, + saved, +} - factory DescribeUserResponse.fromJson(Map json) { - return DescribeUserResponse( - user: json['User'] != null - ? User.fromJson(json['User'] as Map) - : null, - ); +extension ContactFlowStatusValueExtension on ContactFlowStatus { + String toValue() { + switch (this) { + case ContactFlowStatus.published: + return 'PUBLISHED'; + case ContactFlowStatus.saved: + return 'SAVED'; + } } +} - Map toJson() { - final user = this.user; - return { - if (user != null) 'User': user, - }; +extension ContactFlowStatusFromString on String { + ContactFlowStatus toContactFlowStatus() { + switch (this) { + case 'PUBLISHED': + return ContactFlowStatus.published; + case 'SAVED': + return ContactFlowStatus.saved; + } + throw Exception('$this is not known in enum ContactFlowStatus'); } } -class DescribeVocabularyResponse { - /// A list of specific words that you want Contact Lens for Amazon Connect to - /// recognize in your audio input. They are generally domain-specific words and - /// phrases, words that Contact Lens is not recognizing, or proper nouns. - final Vocabulary vocabulary; +/// Contains summary information about a flow. +/// +/// You can also create and update flows using the Amazon +/// Connect Flow language. +class ContactFlowSummary { + /// The Amazon Resource Name (ARN) of the flow. + final String? arn; - DescribeVocabularyResponse({ - required this.vocabulary, - }); + /// The type of flow. + final ContactFlowState? contactFlowState; - factory DescribeVocabularyResponse.fromJson(Map json) { - return DescribeVocabularyResponse( - vocabulary: - Vocabulary.fromJson(json['Vocabulary'] as Map), - ); - } + /// The status of the contact flow. + final ContactFlowStatus? contactFlowStatus; - Map toJson() { - final vocabulary = this.vocabulary; - return { - 'Vocabulary': vocabulary, - }; - } -} + /// The type of flow. + final ContactFlowType? contactFlowType; -/// Contains information about the dimensions for a set of metrics. -class Dimensions { - /// The channel used for grouping and filters. - final Channel? channel; + /// The identifier of the flow. + final String? id; - /// Information about the queue for which metrics are returned. - final QueueReference? queue; - final RoutingProfileReference? routingProfile; + /// The name of the flow. + final String? name; - Dimensions({ - this.channel, - this.queue, - this.routingProfile, + ContactFlowSummary({ + this.arn, + this.contactFlowState, + this.contactFlowStatus, + this.contactFlowType, + this.id, + this.name, }); - factory Dimensions.fromJson(Map json) { - return Dimensions( - channel: (json['Channel'] as String?)?.toChannel(), - queue: json['Queue'] != null - ? QueueReference.fromJson(json['Queue'] as Map) - : null, - routingProfile: json['RoutingProfile'] != null - ? RoutingProfileReference.fromJson( - json['RoutingProfile'] as Map) - : null, + factory ContactFlowSummary.fromJson(Map json) { + return ContactFlowSummary( + arn: json['Arn'] as String?, + contactFlowState: + (json['ContactFlowState'] as String?)?.toContactFlowState(), + contactFlowStatus: + (json['ContactFlowStatus'] as String?)?.toContactFlowStatus(), + contactFlowType: + (json['ContactFlowType'] as String?)?.toContactFlowType(), + id: json['Id'] as String?, + name: json['Name'] as String?, ); } Map toJson() { - final channel = this.channel; - final queue = this.queue; - final routingProfile = this.routingProfile; + final arn = this.arn; + final contactFlowState = this.contactFlowState; + final contactFlowStatus = this.contactFlowStatus; + final contactFlowType = this.contactFlowType; + final id = this.id; + final name = this.name; return { - if (channel != null) 'Channel': channel.toValue(), - if (queue != null) 'Queue': queue, - if (routingProfile != null) 'RoutingProfile': routingProfile, + if (arn != null) 'Arn': arn, + if (contactFlowState != null) + 'ContactFlowState': contactFlowState.toValue(), + if (contactFlowStatus != null) + 'ContactFlowStatus': contactFlowStatus.toValue(), + if (contactFlowType != null) 'ContactFlowType': contactFlowType.toValue(), + if (id != null) 'Id': id, + if (name != null) 'Name': name, }; } } -enum DirectoryType { - saml, - connectManaged, - existingDirectory, +enum ContactFlowType { + contactFlow, + customerQueue, + customerHold, + customerWhisper, + agentHold, + agentWhisper, + outboundWhisper, + agentTransfer, + queueTransfer, } -extension DirectoryTypeValueExtension on DirectoryType { +extension ContactFlowTypeValueExtension on ContactFlowType { String toValue() { switch (this) { - case DirectoryType.saml: - return 'SAML'; - case DirectoryType.connectManaged: - return 'CONNECT_MANAGED'; - case DirectoryType.existingDirectory: - return 'EXISTING_DIRECTORY'; + case ContactFlowType.contactFlow: + return 'CONTACT_FLOW'; + case ContactFlowType.customerQueue: + return 'CUSTOMER_QUEUE'; + case ContactFlowType.customerHold: + return 'CUSTOMER_HOLD'; + case ContactFlowType.customerWhisper: + return 'CUSTOMER_WHISPER'; + case ContactFlowType.agentHold: + return 'AGENT_HOLD'; + case ContactFlowType.agentWhisper: + return 'AGENT_WHISPER'; + case ContactFlowType.outboundWhisper: + return 'OUTBOUND_WHISPER'; + case ContactFlowType.agentTransfer: + return 'AGENT_TRANSFER'; + case ContactFlowType.queueTransfer: + return 'QUEUE_TRANSFER'; } } } -extension DirectoryTypeFromString on String { - DirectoryType toDirectoryType() { +extension ContactFlowTypeFromString on String { + ContactFlowType toContactFlowType() { switch (this) { - case 'SAML': - return DirectoryType.saml; - case 'CONNECT_MANAGED': - return DirectoryType.connectManaged; - case 'EXISTING_DIRECTORY': - return DirectoryType.existingDirectory; + case 'CONTACT_FLOW': + return ContactFlowType.contactFlow; + case 'CUSTOMER_QUEUE': + return ContactFlowType.customerQueue; + case 'CUSTOMER_HOLD': + return ContactFlowType.customerHold; + case 'CUSTOMER_WHISPER': + return ContactFlowType.customerWhisper; + case 'AGENT_HOLD': + return ContactFlowType.agentHold; + case 'AGENT_WHISPER': + return ContactFlowType.agentWhisper; + case 'OUTBOUND_WHISPER': + return ContactFlowType.outboundWhisper; + case 'AGENT_TRANSFER': + return ContactFlowType.agentTransfer; + case 'QUEUE_TRANSFER': + return ContactFlowType.queueTransfer; } - throw Exception('$this is not known in enum DirectoryType'); + throw Exception('$this is not known in enum ContactFlowType'); } } -class DismissUserContactResponse { - DismissUserContactResponse(); +enum ContactInitiationMethod { + inbound, + outbound, + transfer, + queueTransfer, + callback, + api, + disconnect, + monitor, + externalOutbound, +} - factory DismissUserContactResponse.fromJson(Map _) { - return DismissUserContactResponse(); +extension ContactInitiationMethodValueExtension on ContactInitiationMethod { + String toValue() { + switch (this) { + case ContactInitiationMethod.inbound: + return 'INBOUND'; + case ContactInitiationMethod.outbound: + return 'OUTBOUND'; + case ContactInitiationMethod.transfer: + return 'TRANSFER'; + case ContactInitiationMethod.queueTransfer: + return 'QUEUE_TRANSFER'; + case ContactInitiationMethod.callback: + return 'CALLBACK'; + case ContactInitiationMethod.api: + return 'API'; + case ContactInitiationMethod.disconnect: + return 'DISCONNECT'; + case ContactInitiationMethod.monitor: + return 'MONITOR'; + case ContactInitiationMethod.externalOutbound: + return 'EXTERNAL_OUTBOUND'; + } } +} - Map toJson() { - return {}; +extension ContactInitiationMethodFromString on String { + ContactInitiationMethod toContactInitiationMethod() { + switch (this) { + case 'INBOUND': + return ContactInitiationMethod.inbound; + case 'OUTBOUND': + return ContactInitiationMethod.outbound; + case 'TRANSFER': + return ContactInitiationMethod.transfer; + case 'QUEUE_TRANSFER': + return ContactInitiationMethod.queueTransfer; + case 'CALLBACK': + return ContactInitiationMethod.callback; + case 'API': + return ContactInitiationMethod.api; + case 'DISCONNECT': + return ContactInitiationMethod.disconnect; + case 'MONITOR': + return ContactInitiationMethod.monitor; + case 'EXTERNAL_OUTBOUND': + return ContactInitiationMethod.externalOutbound; + } + throw Exception('$this is not known in enum ContactInitiationMethod'); } } -/// Information about a traffic distribution. -class Distribution { - /// The percentage of the traffic that is distributed, in increments of 10. - final int percentage; +/// Information of returned contact. +class ContactSearchSummary { + /// Information about the agent who accepted the contact. + final ContactSearchSummaryAgentInfo? agentInfo; - /// The Amazon Web Services Region where the traffic is distributed. - final String region; + /// The Amazon Resource Name (ARN) of the contact. + final String? arn; - Distribution({ - required this.percentage, - required this.region, + /// How the contact reached your contact center. + final Channel? channel; + + /// The timestamp when the customer endpoint disconnected from Amazon Connect. + final DateTime? disconnectTimestamp; + + /// The identifier of the contact summary. + final String? id; + + /// If this contact is related to other contacts, this is the ID of the initial + /// contact. + final String? initialContactId; + + /// Indicates how the contact was initiated. + final ContactInitiationMethod? initiationMethod; + + /// The date and time this contact was initiated, in UTC time. For + /// INBOUND, this is when the contact arrived. For + /// OUTBOUND, this is when the agent began dialing. For + /// CALLBACK, this is when the callback contact was created. For + /// TRANSFER and QUEUE_TRANSFER, this is when the + /// transfer was initiated. For API, this is when the request arrived. For + /// EXTERNAL_OUTBOUND, this is when the agent started dialing the + /// external participant. For MONITOR, this is when the supervisor + /// started listening to a contact. + final DateTime? initiationTimestamp; + + /// If this contact is not the first contact, this is the ID of the previous + /// contact. + final String? previousContactId; + + /// If this contact was queued, this contains information about the queue. + final ContactSearchSummaryQueueInfo? queueInfo; + + /// The timestamp, in Unix epoch time format, at which to start running the + /// inbound flow. + final DateTime? scheduledTimestamp; + + ContactSearchSummary({ + this.agentInfo, + this.arn, + this.channel, + this.disconnectTimestamp, + this.id, + this.initialContactId, + this.initiationMethod, + this.initiationTimestamp, + this.previousContactId, + this.queueInfo, + this.scheduledTimestamp, }); - factory Distribution.fromJson(Map json) { - return Distribution( - percentage: json['Percentage'] as int, - region: json['Region'] as String, + factory ContactSearchSummary.fromJson(Map json) { + return ContactSearchSummary( + agentInfo: json['AgentInfo'] != null + ? ContactSearchSummaryAgentInfo.fromJson( + json['AgentInfo'] as Map) + : null, + arn: json['Arn'] as String?, + channel: (json['Channel'] as String?)?.toChannel(), + disconnectTimestamp: timeStampFromJson(json['DisconnectTimestamp']), + id: json['Id'] as String?, + initialContactId: json['InitialContactId'] as String?, + initiationMethod: + (json['InitiationMethod'] as String?)?.toContactInitiationMethod(), + initiationTimestamp: timeStampFromJson(json['InitiationTimestamp']), + previousContactId: json['PreviousContactId'] as String?, + queueInfo: json['QueueInfo'] != null + ? ContactSearchSummaryQueueInfo.fromJson( + json['QueueInfo'] as Map) + : null, + scheduledTimestamp: timeStampFromJson(json['ScheduledTimestamp']), ); } Map toJson() { - final percentage = this.percentage; - final region = this.region; + final agentInfo = this.agentInfo; + final arn = this.arn; + final channel = this.channel; + final disconnectTimestamp = this.disconnectTimestamp; + final id = this.id; + final initialContactId = this.initialContactId; + final initiationMethod = this.initiationMethod; + final initiationTimestamp = this.initiationTimestamp; + final previousContactId = this.previousContactId; + final queueInfo = this.queueInfo; + final scheduledTimestamp = this.scheduledTimestamp; return { - 'Percentage': percentage, - 'Region': region, + if (agentInfo != null) 'AgentInfo': agentInfo, + if (arn != null) 'Arn': arn, + if (channel != null) 'Channel': channel.toValue(), + if (disconnectTimestamp != null) + 'DisconnectTimestamp': unixTimestampToJson(disconnectTimestamp), + if (id != null) 'Id': id, + if (initialContactId != null) 'InitialContactId': initialContactId, + if (initiationMethod != null) + 'InitiationMethod': initiationMethod.toValue(), + if (initiationTimestamp != null) + 'InitiationTimestamp': unixTimestampToJson(initiationTimestamp), + if (previousContactId != null) 'PreviousContactId': previousContactId, + if (queueInfo != null) 'QueueInfo': queueInfo, + if (scheduledTimestamp != null) + 'ScheduledTimestamp': unixTimestampToJson(scheduledTimestamp), }; } } -/// Information about a reference when the referenceType is -/// EMAIL. Otherwise, null. -class EmailReference { - /// Identifier of the email reference. - final String? name; +/// Information about the agent who accepted the contact. +class ContactSearchSummaryAgentInfo { + /// The timestamp when the contact was connected to the agent. + final DateTime? connectedToAgentTimestamp; - /// A valid email address. - final String? value; + /// The identifier of the agent who accepted the contact. + final String? id; - EmailReference({ - this.name, - this.value, + ContactSearchSummaryAgentInfo({ + this.connectedToAgentTimestamp, + this.id, }); - factory EmailReference.fromJson(Map json) { - return EmailReference( - name: json['Name'] as String?, - value: json['Value'] as String?, + factory ContactSearchSummaryAgentInfo.fromJson(Map json) { + return ContactSearchSummaryAgentInfo( + connectedToAgentTimestamp: + timeStampFromJson(json['ConnectedToAgentTimestamp']), + id: json['Id'] as String?, ); } Map toJson() { - final name = this.name; - final value = this.value; + final connectedToAgentTimestamp = this.connectedToAgentTimestamp; + final id = this.id; return { - if (name != null) 'Name': name, - if (value != null) 'Value': value, + if (connectedToAgentTimestamp != null) + 'ConnectedToAgentTimestamp': + unixTimestampToJson(connectedToAgentTimestamp), + if (id != null) 'Id': id, }; } } -/// The encryption configuration. -class EncryptionConfig { - /// The type of encryption. - final EncryptionType encryptionType; +/// If this contact was queued, this contains information about the queue. +class ContactSearchSummaryQueueInfo { + /// The timestamp when the contact was added to the queue. + final DateTime? enqueueTimestamp; - /// The full ARN of the encryption key. - /// - /// Be sure to provide the full ARN of the encryption key, not just the ID. - /// - /// Amazon Connect supports only KMS keys with the default key spec of - /// SYMMETRIC_DEFAULT . - /// - final String keyId; + /// The unique identifier for the queue. + final String? id; - EncryptionConfig({ - required this.encryptionType, - required this.keyId, + ContactSearchSummaryQueueInfo({ + this.enqueueTimestamp, + this.id, }); - factory EncryptionConfig.fromJson(Map json) { - return EncryptionConfig( - encryptionType: (json['EncryptionType'] as String).toEncryptionType(), - keyId: json['KeyId'] as String, + factory ContactSearchSummaryQueueInfo.fromJson(Map json) { + return ContactSearchSummaryQueueInfo( + enqueueTimestamp: timeStampFromJson(json['EnqueueTimestamp']), + id: json['Id'] as String?, ); } Map toJson() { - final encryptionType = this.encryptionType; - final keyId = this.keyId; + final enqueueTimestamp = this.enqueueTimestamp; + final id = this.id; return { - 'EncryptionType': encryptionType.toValue(), - 'KeyId': keyId, + if (enqueueTimestamp != null) + 'EnqueueTimestamp': unixTimestampToJson(enqueueTimestamp), + if (id != null) 'Id': id, }; } } -enum EncryptionType { - kms, +enum ContactState { + incoming, + pending, + connecting, + connected, + connectedOnhold, + missed, + error, + ended, + rejected, } -extension EncryptionTypeValueExtension on EncryptionType { +extension ContactStateValueExtension on ContactState { String toValue() { switch (this) { - case EncryptionType.kms: - return 'KMS'; + case ContactState.incoming: + return 'INCOMING'; + case ContactState.pending: + return 'PENDING'; + case ContactState.connecting: + return 'CONNECTING'; + case ContactState.connected: + return 'CONNECTED'; + case ContactState.connectedOnhold: + return 'CONNECTED_ONHOLD'; + case ContactState.missed: + return 'MISSED'; + case ContactState.error: + return 'ERROR'; + case ContactState.ended: + return 'ENDED'; + case ContactState.rejected: + return 'REJECTED'; } } } -extension EncryptionTypeFromString on String { - EncryptionType toEncryptionType() { +extension ContactStateFromString on String { + ContactState toContactState() { switch (this) { - case 'KMS': - return EncryptionType.kms; + case 'INCOMING': + return ContactState.incoming; + case 'PENDING': + return ContactState.pending; + case 'CONNECTING': + return ContactState.connecting; + case 'CONNECTED': + return ContactState.connected; + case 'CONNECTED_ONHOLD': + return ContactState.connectedOnhold; + case 'MISSED': + return ContactState.missed; + case 'ERROR': + return ContactState.error; + case 'ENDED': + return ContactState.ended; + case 'REJECTED': + return ContactState.rejected; } - throw Exception('$this is not known in enum EncryptionType'); + throw Exception('$this is not known in enum ContactState'); } } -/// Information about a contact evaluation. -class Evaluation { - /// A map of question identifiers to answer value. - final Map answers; +/// An object that can be used to specify Tag conditions inside the +/// SearchFilter. This accepts an OR of +/// AND (List of List) input where: +/// +///
        +///
      • +/// Top level list specifies conditions that need to be applied with +/// OR operator +///
      • +///
      • +/// Inner list specifies conditions that need to be applied with +/// AND operator. +///
      • +///
      +class ControlPlaneTagFilter { + /// A list of conditions which would be applied together with an + /// AND condition. + final List? andConditions; - /// The timestamp for when the evaluation was created. - final DateTime createdTime; + /// A list of conditions which would be applied together with an OR + /// condition. + final List>? orConditions; - /// The Amazon Resource Name (ARN) for the contact evaluation resource. - final String evaluationArn; + /// A leaf node condition which can be used to specify a tag condition. + final TagCondition? tagCondition; - /// A unique identifier for the contact evaluation. - final String evaluationId; + ControlPlaneTagFilter({ + this.andConditions, + this.orConditions, + this.tagCondition, + }); - /// The timestamp for when the evaluation was last updated. - final DateTime lastModifiedTime; + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final tagCondition = this.tagCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (tagCondition != null) 'TagCondition': tagCondition, + }; + } +} - /// Metadata about the contact evaluation. - final EvaluationMetadata metadata; +/// An object that can be used to specify Tag conditions or Hierarchy Group +/// conditions inside the SearchFilter. +/// +/// This accepts an OR of AND (List of List) input +/// where: +/// +///
        +///
      • +/// The top level list specifies conditions that need to be applied with +/// OR operator +///
      • +///
      • +/// The inner list specifies conditions that need to be applied with +/// AND operator. +///
      • +///
      +/// Only one field can be populated. Maximum number of allowed Tag conditions is +/// 25. Maximum number of allowed Hierarchy Group conditions is 20. +/// +class ControlPlaneUserAttributeFilter { + /// A list of conditions which would be applied together with an + /// AND condition. + final AttributeAndCondition? andCondition; + final HierarchyGroupCondition? hierarchyGroupCondition; - /// A map of question identifiers to note value. - final Map notes; + /// A list of conditions which would be applied together with an OR + /// condition. + final List? orConditions; + final TagCondition? tagCondition; - /// The status of the contact evaluation. - final EvaluationStatus status; + ControlPlaneUserAttributeFilter({ + this.andCondition, + this.hierarchyGroupCondition, + this.orConditions, + this.tagCondition, + }); - /// A map of item (section or question) identifiers to score value. - final Map? scores; + Map toJson() { + final andCondition = this.andCondition; + final hierarchyGroupCondition = this.hierarchyGroupCondition; + final orConditions = this.orConditions; + final tagCondition = this.tagCondition; + return { + if (andCondition != null) 'AndCondition': andCondition, + if (hierarchyGroupCondition != null) + 'HierarchyGroupCondition': hierarchyGroupCondition, + if (orConditions != null) 'OrConditions': orConditions, + if (tagCondition != null) 'TagCondition': tagCondition, + }; + } +} - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; +class CreateAgentStatusResponse { + /// The Amazon Resource Name (ARN) of the agent status. + final String? agentStatusARN; - Evaluation({ - required this.answers, - required this.createdTime, - required this.evaluationArn, - required this.evaluationId, - required this.lastModifiedTime, - required this.metadata, - required this.notes, - required this.status, - this.scores, - this.tags, + /// The identifier of the agent status. + final String? agentStatusId; + + CreateAgentStatusResponse({ + this.agentStatusARN, + this.agentStatusId, }); - factory Evaluation.fromJson(Map json) { - return Evaluation( - answers: (json['Answers'] as Map).map((k, e) => MapEntry( - k, EvaluationAnswerOutput.fromJson(e as Map))), - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - evaluationArn: json['EvaluationArn'] as String, - evaluationId: json['EvaluationId'] as String, - lastModifiedTime: - nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), - metadata: - EvaluationMetadata.fromJson(json['Metadata'] as Map), - notes: (json['Notes'] as Map).map((k, e) => - MapEntry(k, EvaluationNote.fromJson(e as Map))), - status: (json['Status'] as String).toEvaluationStatus(), - scores: (json['Scores'] as Map?)?.map((k, e) => - MapEntry(k, EvaluationScore.fromJson(e as Map))), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory CreateAgentStatusResponse.fromJson(Map json) { + return CreateAgentStatusResponse( + agentStatusARN: json['AgentStatusARN'] as String?, + agentStatusId: json['AgentStatusId'] as String?, ); } Map toJson() { - final answers = this.answers; - final createdTime = this.createdTime; - final evaluationArn = this.evaluationArn; - final evaluationId = this.evaluationId; - final lastModifiedTime = this.lastModifiedTime; - final metadata = this.metadata; - final notes = this.notes; - final status = this.status; - final scores = this.scores; - final tags = this.tags; + final agentStatusARN = this.agentStatusARN; + final agentStatusId = this.agentStatusId; return { - 'Answers': answers, - 'CreatedTime': unixTimestampToJson(createdTime), - 'EvaluationArn': evaluationArn, - 'EvaluationId': evaluationId, - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - 'Metadata': metadata, - 'Notes': notes, - 'Status': status.toValue(), - if (scores != null) 'Scores': scores, - if (tags != null) 'Tags': tags, + if (agentStatusARN != null) 'AgentStatusARN': agentStatusARN, + if (agentStatusId != null) 'AgentStatusId': agentStatusId, }; } } -/// Information about answer data for a contact evaluation. Answer data must be -/// either string, numeric, or not applicable. -class EvaluationAnswerData { - /// The flag to mark the question as not applicable. - final bool? notApplicable; - - /// The numeric value for an answer in a contact evaluation. - final double? numericValue; +/// The CreateCase action definition. +class CreateCaseActionDefinition { + /// An array of objects with Field ID and Value data. + final List fields; - /// The string value for an answer in a contact evaluation. - final String? stringValue; + /// A unique identifier of a template. + final String templateId; - EvaluationAnswerData({ - this.notApplicable, - this.numericValue, - this.stringValue, + CreateCaseActionDefinition({ + required this.fields, + required this.templateId, }); - factory EvaluationAnswerData.fromJson(Map json) { - return EvaluationAnswerData( - notApplicable: json['NotApplicable'] as bool?, - numericValue: json['NumericValue'] as double?, - stringValue: json['StringValue'] as String?, + factory CreateCaseActionDefinition.fromJson(Map json) { + return CreateCaseActionDefinition( + fields: (json['Fields'] as List) + .whereNotNull() + .map((e) => FieldValue.fromJson(e as Map)) + .toList(), + templateId: json['TemplateId'] as String, ); } Map toJson() { - final notApplicable = this.notApplicable; - final numericValue = this.numericValue; - final stringValue = this.stringValue; + final fields = this.fields; + final templateId = this.templateId; return { - if (notApplicable != null) 'NotApplicable': notApplicable, - if (numericValue != null) 'NumericValue': numericValue, - if (stringValue != null) 'StringValue': stringValue, + 'Fields': fields, + 'TemplateId': templateId, }; } } -/// Information about input answers for a contact evaluation. -class EvaluationAnswerInput { - /// The value for an answer in a contact evaluation. - final EvaluationAnswerData? value; +class CreateContactFlowModuleResponse { + /// The Amazon Resource Name (ARN) of the flow module. + final String? arn; - EvaluationAnswerInput({ - this.value, + /// The identifier of the flow module. + final String? id; + + CreateContactFlowModuleResponse({ + this.arn, + this.id, }); + factory CreateContactFlowModuleResponse.fromJson(Map json) { + return CreateContactFlowModuleResponse( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + ); + } + Map toJson() { - final value = this.value; + final arn = this.arn; + final id = this.id; return { - if (value != null) 'Value': value, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, }; } } -/// Information about output answers for a contact evaluation. -class EvaluationAnswerOutput { - /// The system suggested value for an answer in a contact evaluation. - final EvaluationAnswerData? systemSuggestedValue; +class CreateContactFlowResponse { + /// The Amazon Resource Name (ARN) of the flow. + final String? contactFlowArn; - /// The value for an answer in a contact evaluation. - final EvaluationAnswerData? value; + /// The identifier of the flow. + final String? contactFlowId; - EvaluationAnswerOutput({ - this.systemSuggestedValue, - this.value, + CreateContactFlowResponse({ + this.contactFlowArn, + this.contactFlowId, }); - factory EvaluationAnswerOutput.fromJson(Map json) { - return EvaluationAnswerOutput( - systemSuggestedValue: json['SystemSuggestedValue'] != null - ? EvaluationAnswerData.fromJson( - json['SystemSuggestedValue'] as Map) - : null, - value: json['Value'] != null - ? EvaluationAnswerData.fromJson(json['Value'] as Map) - : null, + factory CreateContactFlowResponse.fromJson(Map json) { + return CreateContactFlowResponse( + contactFlowArn: json['ContactFlowArn'] as String?, + contactFlowId: json['ContactFlowId'] as String?, ); } Map toJson() { - final systemSuggestedValue = this.systemSuggestedValue; - final value = this.value; + final contactFlowArn = this.contactFlowArn; + final contactFlowId = this.contactFlowId; return { - if (systemSuggestedValue != null) - 'SystemSuggestedValue': systemSuggestedValue, - if (value != null) 'Value': value, + if (contactFlowArn != null) 'ContactFlowArn': contactFlowArn, + if (contactFlowId != null) 'ContactFlowId': contactFlowId, }; } } -/// Information about the evaluation form. -class EvaluationForm { - /// The Amazon Resource Name (ARN) of the user who created the evaluation form. - final String createdBy; - - /// The timestamp for when the evaluation form was created. - final DateTime createdTime; - +class CreateEvaluationFormResponse { /// The Amazon Resource Name (ARN) for the evaluation form resource. final String evaluationFormArn; /// The unique identifier for the evaluation form. final String evaluationFormId; - /// A version of the evaluation form. - final int evaluationFormVersion; - - /// Items that are part of the evaluation form. The total number of sections and - /// questions must not exceed 100 each. Questions must be contained in a - /// section. - final List items; - - /// The Amazon Resource Name (ARN) of the user who last updated the evaluation - /// form. - final String lastModifiedBy; - - /// The timestamp for when the evaluation form was last updated. - final DateTime lastModifiedTime; - - /// The flag indicating whether the evaluation form is locked for changes. - final bool locked; - - /// The status of the evaluation form. - final EvaluationFormVersionStatus status; - - /// A title of the evaluation form. - final String title; - - /// The description of the evaluation form. - final String? description; - - /// A scoring strategy of the evaluation form. - final EvaluationFormScoringStrategy? scoringStrategy; - - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; - - EvaluationForm({ - required this.createdBy, - required this.createdTime, + CreateEvaluationFormResponse({ required this.evaluationFormArn, required this.evaluationFormId, - required this.evaluationFormVersion, - required this.items, - required this.lastModifiedBy, - required this.lastModifiedTime, - required this.locked, - required this.status, - required this.title, - this.description, - this.scoringStrategy, - this.tags, }); - factory EvaluationForm.fromJson(Map json) { - return EvaluationForm( - createdBy: json['CreatedBy'] as String, - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + factory CreateEvaluationFormResponse.fromJson(Map json) { + return CreateEvaluationFormResponse( evaluationFormArn: json['EvaluationFormArn'] as String, evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormVersion: json['EvaluationFormVersion'] as int, - items: (json['Items'] as List) - .whereNotNull() - .map((e) => EvaluationFormItem.fromJson(e as Map)) - .toList(), - lastModifiedBy: json['LastModifiedBy'] as String, - lastModifiedTime: - nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), - locked: json['Locked'] as bool, - status: (json['Status'] as String).toEvaluationFormVersionStatus(), - title: json['Title'] as String, - description: json['Description'] as String?, - scoringStrategy: json['ScoringStrategy'] != null - ? EvaluationFormScoringStrategy.fromJson( - json['ScoringStrategy'] as Map) - : null, - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final createdBy = this.createdBy; - final createdTime = this.createdTime; final evaluationFormArn = this.evaluationFormArn; final evaluationFormId = this.evaluationFormId; - final evaluationFormVersion = this.evaluationFormVersion; - final items = this.items; - final lastModifiedBy = this.lastModifiedBy; - final lastModifiedTime = this.lastModifiedTime; - final locked = this.locked; - final status = this.status; - final title = this.title; - final description = this.description; - final scoringStrategy = this.scoringStrategy; - final tags = this.tags; return { - 'CreatedBy': createdBy, - 'CreatedTime': unixTimestampToJson(createdTime), 'EvaluationFormArn': evaluationFormArn, 'EvaluationFormId': evaluationFormId, - 'EvaluationFormVersion': evaluationFormVersion, - 'Items': items, - 'LastModifiedBy': lastModifiedBy, - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - 'Locked': locked, - 'Status': status.toValue(), - 'Title': title, - if (description != null) 'Description': description, - if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, - if (tags != null) 'Tags': tags, }; } } -/// Information about an evaluation form used in a contact evaluation. -class EvaluationFormContent { - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; +class CreateHoursOfOperationResponse { + /// The Amazon Resource Name (ARN) for the hours of operation. + final String? hoursOfOperationArn; - /// The unique identifier for the evaluation form. - final String evaluationFormId; + /// The identifier for the hours of operation. + final String? hoursOfOperationId; - /// A version of the evaluation form. - final int evaluationFormVersion; + CreateHoursOfOperationResponse({ + this.hoursOfOperationArn, + this.hoursOfOperationId, + }); - /// Items that are part of the evaluation form. The total number of sections and - /// questions must not exceed 100 each. Questions must be contained in a - /// section. - final List items; + factory CreateHoursOfOperationResponse.fromJson(Map json) { + return CreateHoursOfOperationResponse( + hoursOfOperationArn: json['HoursOfOperationArn'] as String?, + hoursOfOperationId: json['HoursOfOperationId'] as String?, + ); + } - /// A title of the evaluation form. - final String title; + Map toJson() { + final hoursOfOperationArn = this.hoursOfOperationArn; + final hoursOfOperationId = this.hoursOfOperationId; + return { + if (hoursOfOperationArn != null) + 'HoursOfOperationArn': hoursOfOperationArn, + if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, + }; + } +} - /// The description of the evaluation form. - final String? description; +class CreateInstanceResponse { + /// The Amazon Resource Name (ARN) of the instance. + final String? arn; - /// A scoring strategy of the evaluation form. - final EvaluationFormScoringStrategy? scoringStrategy; + /// The identifier for the instance. + final String? id; - EvaluationFormContent({ - required this.evaluationFormArn, - required this.evaluationFormId, - required this.evaluationFormVersion, - required this.items, - required this.title, - this.description, - this.scoringStrategy, + CreateInstanceResponse({ + this.arn, + this.id, }); - factory EvaluationFormContent.fromJson(Map json) { - return EvaluationFormContent( - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormVersion: json['EvaluationFormVersion'] as int, - items: (json['Items'] as List) - .whereNotNull() - .map((e) => EvaluationFormItem.fromJson(e as Map)) - .toList(), - title: json['Title'] as String, - description: json['Description'] as String?, - scoringStrategy: json['ScoringStrategy'] != null - ? EvaluationFormScoringStrategy.fromJson( - json['ScoringStrategy'] as Map) - : null, + factory CreateInstanceResponse.fromJson(Map json) { + return CreateInstanceResponse( + arn: json['Arn'] as String?, + id: json['Id'] as String?, ); } Map toJson() { - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; - final evaluationFormVersion = this.evaluationFormVersion; - final items = this.items; - final title = this.title; - final description = this.description; - final scoringStrategy = this.scoringStrategy; + final arn = this.arn; + final id = this.id; return { - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, - 'EvaluationFormVersion': evaluationFormVersion, - 'Items': items, - 'Title': title, - if (description != null) 'Description': description, - if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, }; } } -/// Information about an item from an evaluation form. The item must be either a -/// section or a question. -class EvaluationFormItem { - /// The information of the question. - final EvaluationFormQuestion? question; +class CreateIntegrationAssociationResponse { + /// The Amazon Resource Name (ARN) for the association. + final String? integrationAssociationArn; - /// The information of the section. - final EvaluationFormSection? section; + /// The identifier for the integration association. + final String? integrationAssociationId; - EvaluationFormItem({ - this.question, - this.section, + CreateIntegrationAssociationResponse({ + this.integrationAssociationArn, + this.integrationAssociationId, }); - factory EvaluationFormItem.fromJson(Map json) { - return EvaluationFormItem( - question: json['Question'] != null - ? EvaluationFormQuestion.fromJson( - json['Question'] as Map) - : null, - section: json['Section'] != null - ? EvaluationFormSection.fromJson( - json['Section'] as Map) - : null, + factory CreateIntegrationAssociationResponse.fromJson( + Map json) { + return CreateIntegrationAssociationResponse( + integrationAssociationArn: json['IntegrationAssociationArn'] as String?, + integrationAssociationId: json['IntegrationAssociationId'] as String?, ); } Map toJson() { - final question = this.question; - final section = this.section; + final integrationAssociationArn = this.integrationAssociationArn; + final integrationAssociationId = this.integrationAssociationId; return { - if (question != null) 'Question': question, - if (section != null) 'Section': section, + if (integrationAssociationArn != null) + 'IntegrationAssociationArn': integrationAssociationArn, + if (integrationAssociationId != null) + 'IntegrationAssociationId': integrationAssociationId, }; } } -/// Information about the automation configuration in numeric questions. -class EvaluationFormNumericQuestionAutomation { - /// The property value of the automation. - final NumericQuestionPropertyValueAutomation? propertyValue; +class CreateParticipantResponse { + /// The token used by the chat participant to call + /// CreateParticipantConnection. The participant token is valid for + /// the lifetime of a chat participant. + final ParticipantTokenCredentials? participantCredentials; - EvaluationFormNumericQuestionAutomation({ - this.propertyValue, + /// The identifier for a chat participant. The participantId for a chat + /// participant is the same throughout the chat lifecycle. + final String? participantId; + + CreateParticipantResponse({ + this.participantCredentials, + this.participantId, }); - factory EvaluationFormNumericQuestionAutomation.fromJson( - Map json) { - return EvaluationFormNumericQuestionAutomation( - propertyValue: json['PropertyValue'] != null - ? NumericQuestionPropertyValueAutomation.fromJson( - json['PropertyValue'] as Map) + factory CreateParticipantResponse.fromJson(Map json) { + return CreateParticipantResponse( + participantCredentials: json['ParticipantCredentials'] != null + ? ParticipantTokenCredentials.fromJson( + json['ParticipantCredentials'] as Map) : null, + participantId: json['ParticipantId'] as String?, ); } Map toJson() { - final propertyValue = this.propertyValue; + final participantCredentials = this.participantCredentials; + final participantId = this.participantId; return { - if (propertyValue != null) 'PropertyValue': propertyValue, + if (participantCredentials != null) + 'ParticipantCredentials': participantCredentials, + if (participantId != null) 'ParticipantId': participantId, }; } } -/// Information about the option range used for scoring in numeric questions. -class EvaluationFormNumericQuestionOption { - /// The maximum answer value of the range option. - final int maxValue; - - /// The minimum answer value of the range option. - final int minValue; - - /// The flag to mark the option as automatic fail. If an automatic fail answer - /// is provided, the overall evaluation gets a score of 0. - final bool? automaticFail; - - /// The score assigned to answer values within the range option. - final int? score; +class CreatePersistentContactAssociationResponse { + /// The contactId from which a persistent chat session is started. This field is + /// populated only for persistent chat. + final String? continuedFromContactId; - EvaluationFormNumericQuestionOption({ - required this.maxValue, - required this.minValue, - this.automaticFail, - this.score, + CreatePersistentContactAssociationResponse({ + this.continuedFromContactId, }); - factory EvaluationFormNumericQuestionOption.fromJson( + factory CreatePersistentContactAssociationResponse.fromJson( Map json) { - return EvaluationFormNumericQuestionOption( - maxValue: json['MaxValue'] as int, - minValue: json['MinValue'] as int, - automaticFail: json['AutomaticFail'] as bool?, - score: json['Score'] as int?, + return CreatePersistentContactAssociationResponse( + continuedFromContactId: json['ContinuedFromContactId'] as String?, ); } Map toJson() { - final maxValue = this.maxValue; - final minValue = this.minValue; - final automaticFail = this.automaticFail; - final score = this.score; + final continuedFromContactId = this.continuedFromContactId; return { - 'MaxValue': maxValue, - 'MinValue': minValue, - if (automaticFail != null) 'AutomaticFail': automaticFail, - if (score != null) 'Score': score, + if (continuedFromContactId != null) + 'ContinuedFromContactId': continuedFromContactId, }; } } -/// Information about properties for a numeric question in an evaluation form. -class EvaluationFormNumericQuestionProperties { - /// The maximum answer value. - final int maxValue; - - /// The minimum answer value. - final int minValue; - - /// The automation properties of the numeric question. - final EvaluationFormNumericQuestionAutomation? automation; +class CreatePromptResponse { + /// The Amazon Resource Name (ARN) of the prompt. + final String? promptARN; - /// The scoring options of the numeric question. - final List? options; + /// A unique identifier for the prompt. + final String? promptId; - EvaluationFormNumericQuestionProperties({ - required this.maxValue, - required this.minValue, - this.automation, - this.options, + CreatePromptResponse({ + this.promptARN, + this.promptId, }); - factory EvaluationFormNumericQuestionProperties.fromJson( - Map json) { - return EvaluationFormNumericQuestionProperties( - maxValue: json['MaxValue'] as int, - minValue: json['MinValue'] as int, - automation: json['Automation'] != null - ? EvaluationFormNumericQuestionAutomation.fromJson( - json['Automation'] as Map) - : null, - options: (json['Options'] as List?) - ?.whereNotNull() - .map((e) => EvaluationFormNumericQuestionOption.fromJson( - e as Map)) - .toList(), + factory CreatePromptResponse.fromJson(Map json) { + return CreatePromptResponse( + promptARN: json['PromptARN'] as String?, + promptId: json['PromptId'] as String?, ); } Map toJson() { - final maxValue = this.maxValue; - final minValue = this.minValue; - final automation = this.automation; - final options = this.options; + final promptARN = this.promptARN; + final promptId = this.promptId; return { - 'MaxValue': maxValue, - 'MinValue': minValue, - if (automation != null) 'Automation': automation, - if (options != null) 'Options': options, + if (promptARN != null) 'PromptARN': promptARN, + if (promptId != null) 'PromptId': promptId, }; } } -/// Information about a question from an evaluation form. -class EvaluationFormQuestion { - /// The type of the question. - final EvaluationFormQuestionType questionType; - - /// The identifier of the question. An identifier must be unique within the - /// evaluation form. - final String refId; - - /// The title of the question. - final String title; +class CreateQueueResponse { + /// The Amazon Resource Name (ARN) of the queue. + final String? queueArn; - /// The instructions of the section. - final String? instructions; + /// The identifier for the queue. + final String? queueId; - /// The flag to enable not applicable answers to the question. - final bool? notApplicableEnabled; + CreateQueueResponse({ + this.queueArn, + this.queueId, + }); - /// The properties of the type of question. Text questions do not have to define - /// question type properties. - final EvaluationFormQuestionTypeProperties? questionTypeProperties; - - /// The scoring weight of the section. - final double? weight; - - EvaluationFormQuestion({ - required this.questionType, - required this.refId, - required this.title, - this.instructions, - this.notApplicableEnabled, - this.questionTypeProperties, - this.weight, - }); - - factory EvaluationFormQuestion.fromJson(Map json) { - return EvaluationFormQuestion( - questionType: - (json['QuestionType'] as String).toEvaluationFormQuestionType(), - refId: json['RefId'] as String, - title: json['Title'] as String, - instructions: json['Instructions'] as String?, - notApplicableEnabled: json['NotApplicableEnabled'] as bool?, - questionTypeProperties: json['QuestionTypeProperties'] != null - ? EvaluationFormQuestionTypeProperties.fromJson( - json['QuestionTypeProperties'] as Map) - : null, - weight: json['Weight'] as double?, - ); - } + factory CreateQueueResponse.fromJson(Map json) { + return CreateQueueResponse( + queueArn: json['QueueArn'] as String?, + queueId: json['QueueId'] as String?, + ); + } Map toJson() { - final questionType = this.questionType; - final refId = this.refId; - final title = this.title; - final instructions = this.instructions; - final notApplicableEnabled = this.notApplicableEnabled; - final questionTypeProperties = this.questionTypeProperties; - final weight = this.weight; + final queueArn = this.queueArn; + final queueId = this.queueId; return { - 'QuestionType': questionType.toValue(), - 'RefId': refId, - 'Title': title, - if (instructions != null) 'Instructions': instructions, - if (notApplicableEnabled != null) - 'NotApplicableEnabled': notApplicableEnabled, - if (questionTypeProperties != null) - 'QuestionTypeProperties': questionTypeProperties, - if (weight != null) 'Weight': weight, + if (queueArn != null) 'QueueArn': queueArn, + if (queueId != null) 'QueueId': queueId, }; } } -enum EvaluationFormQuestionType { - text, - singleselect, - numeric, -} +class CreateQuickConnectResponse { + /// The Amazon Resource Name (ARN) for the quick connect. + final String? quickConnectARN; -extension EvaluationFormQuestionTypeValueExtension - on EvaluationFormQuestionType { - String toValue() { - switch (this) { - case EvaluationFormQuestionType.text: - return 'TEXT'; - case EvaluationFormQuestionType.singleselect: - return 'SINGLESELECT'; - case EvaluationFormQuestionType.numeric: - return 'NUMERIC'; - } + /// The identifier for the quick connect. + final String? quickConnectId; + + CreateQuickConnectResponse({ + this.quickConnectARN, + this.quickConnectId, + }); + + factory CreateQuickConnectResponse.fromJson(Map json) { + return CreateQuickConnectResponse( + quickConnectARN: json['QuickConnectARN'] as String?, + quickConnectId: json['QuickConnectId'] as String?, + ); } -} -extension EvaluationFormQuestionTypeFromString on String { - EvaluationFormQuestionType toEvaluationFormQuestionType() { - switch (this) { - case 'TEXT': - return EvaluationFormQuestionType.text; - case 'SINGLESELECT': - return EvaluationFormQuestionType.singleselect; - case 'NUMERIC': - return EvaluationFormQuestionType.numeric; - } - throw Exception('$this is not known in enum EvaluationFormQuestionType'); + Map toJson() { + final quickConnectARN = this.quickConnectARN; + final quickConnectId = this.quickConnectId; + return { + if (quickConnectARN != null) 'QuickConnectARN': quickConnectARN, + if (quickConnectId != null) 'QuickConnectId': quickConnectId, + }; } } -/// Information about properties for a question in an evaluation form. The -/// question type properties must be either for a numeric question or a single -/// select question. -class EvaluationFormQuestionTypeProperties { - /// The properties of the numeric question. - final EvaluationFormNumericQuestionProperties? numeric; +class CreateRoutingProfileResponse { + /// The Amazon Resource Name (ARN) of the routing profile. + final String? routingProfileArn; - /// The properties of the numeric question. - final EvaluationFormSingleSelectQuestionProperties? singleSelect; + /// The identifier of the routing profile. + final String? routingProfileId; - EvaluationFormQuestionTypeProperties({ - this.numeric, - this.singleSelect, + CreateRoutingProfileResponse({ + this.routingProfileArn, + this.routingProfileId, }); - factory EvaluationFormQuestionTypeProperties.fromJson( - Map json) { - return EvaluationFormQuestionTypeProperties( - numeric: json['Numeric'] != null - ? EvaluationFormNumericQuestionProperties.fromJson( - json['Numeric'] as Map) - : null, - singleSelect: json['SingleSelect'] != null - ? EvaluationFormSingleSelectQuestionProperties.fromJson( - json['SingleSelect'] as Map) - : null, + factory CreateRoutingProfileResponse.fromJson(Map json) { + return CreateRoutingProfileResponse( + routingProfileArn: json['RoutingProfileArn'] as String?, + routingProfileId: json['RoutingProfileId'] as String?, ); } Map toJson() { - final numeric = this.numeric; - final singleSelect = this.singleSelect; + final routingProfileArn = this.routingProfileArn; + final routingProfileId = this.routingProfileId; return { - if (numeric != null) 'Numeric': numeric, - if (singleSelect != null) 'SingleSelect': singleSelect, + if (routingProfileArn != null) 'RoutingProfileArn': routingProfileArn, + if (routingProfileId != null) 'RoutingProfileId': routingProfileId, }; } } -enum EvaluationFormScoringMode { - questionOnly, - sectionOnly, -} - -extension EvaluationFormScoringModeValueExtension on EvaluationFormScoringMode { - String toValue() { - switch (this) { - case EvaluationFormScoringMode.questionOnly: - return 'QUESTION_ONLY'; - case EvaluationFormScoringMode.sectionOnly: - return 'SECTION_ONLY'; - } - } -} +class CreateRuleResponse { + /// The Amazon Resource Name (ARN) of the rule. + final String ruleArn; -extension EvaluationFormScoringModeFromString on String { - EvaluationFormScoringMode toEvaluationFormScoringMode() { - switch (this) { - case 'QUESTION_ONLY': - return EvaluationFormScoringMode.questionOnly; - case 'SECTION_ONLY': - return EvaluationFormScoringMode.sectionOnly; - } - throw Exception('$this is not known in enum EvaluationFormScoringMode'); - } -} + /// A unique identifier for the rule. + final String ruleId; -enum EvaluationFormScoringStatus { - enabled, - disabled, -} + CreateRuleResponse({ + required this.ruleArn, + required this.ruleId, + }); -extension EvaluationFormScoringStatusValueExtension - on EvaluationFormScoringStatus { - String toValue() { - switch (this) { - case EvaluationFormScoringStatus.enabled: - return 'ENABLED'; - case EvaluationFormScoringStatus.disabled: - return 'DISABLED'; - } + factory CreateRuleResponse.fromJson(Map json) { + return CreateRuleResponse( + ruleArn: json['RuleArn'] as String, + ruleId: json['RuleId'] as String, + ); } -} -extension EvaluationFormScoringStatusFromString on String { - EvaluationFormScoringStatus toEvaluationFormScoringStatus() { - switch (this) { - case 'ENABLED': - return EvaluationFormScoringStatus.enabled; - case 'DISABLED': - return EvaluationFormScoringStatus.disabled; - } - throw Exception('$this is not known in enum EvaluationFormScoringStatus'); + Map toJson() { + final ruleArn = this.ruleArn; + final ruleId = this.ruleId; + return { + 'RuleArn': ruleArn, + 'RuleId': ruleId, + }; } } -/// Information about scoring strategy for an evaluation form. -class EvaluationFormScoringStrategy { - /// The scoring mode of the evaluation form. - final EvaluationFormScoringMode mode; +class CreateSecurityProfileResponse { + /// The Amazon Resource Name (ARN) for the security profile. + final String? securityProfileArn; - /// The scoring status of the evaluation form. - final EvaluationFormScoringStatus status; + /// The identifier for the security profle. + final String? securityProfileId; - EvaluationFormScoringStrategy({ - required this.mode, - required this.status, + CreateSecurityProfileResponse({ + this.securityProfileArn, + this.securityProfileId, }); - factory EvaluationFormScoringStrategy.fromJson(Map json) { - return EvaluationFormScoringStrategy( - mode: (json['Mode'] as String).toEvaluationFormScoringMode(), - status: (json['Status'] as String).toEvaluationFormScoringStatus(), + factory CreateSecurityProfileResponse.fromJson(Map json) { + return CreateSecurityProfileResponse( + securityProfileArn: json['SecurityProfileArn'] as String?, + securityProfileId: json['SecurityProfileId'] as String?, ); } Map toJson() { - final mode = this.mode; - final status = this.status; + final securityProfileArn = this.securityProfileArn; + final securityProfileId = this.securityProfileId; return { - 'Mode': mode.toValue(), - 'Status': status.toValue(), + if (securityProfileArn != null) 'SecurityProfileArn': securityProfileArn, + if (securityProfileId != null) 'SecurityProfileId': securityProfileId, }; } } -/// Information about a section from an evaluation form. A section can contain -/// sections and/or questions. Evaluation forms can only contain sections and -/// subsections (two level nesting). -class EvaluationFormSection { - /// The items of the section. - final List items; +class CreateTaskTemplateResponse { + /// The Amazon Resource Name (ARN) for the task template resource. + final String arn; - /// The identifier of the section. An identifier must be unique within the - /// evaluation form. - final String refId; - - /// The title of the section. - final String title; - - /// The instructions of the section. - final String? instructions; - - /// The scoring weight of the section. - final double? weight; + /// The identifier of the task template resource. + final String id; - EvaluationFormSection({ - required this.items, - required this.refId, - required this.title, - this.instructions, - this.weight, + CreateTaskTemplateResponse({ + required this.arn, + required this.id, }); - factory EvaluationFormSection.fromJson(Map json) { - return EvaluationFormSection( - items: (json['Items'] as List) - .whereNotNull() - .map((e) => EvaluationFormItem.fromJson(e as Map)) - .toList(), - refId: json['RefId'] as String, - title: json['Title'] as String, - instructions: json['Instructions'] as String?, - weight: json['Weight'] as double?, + factory CreateTaskTemplateResponse.fromJson(Map json) { + return CreateTaskTemplateResponse( + arn: json['Arn'] as String, + id: json['Id'] as String, ); } Map toJson() { - final items = this.items; - final refId = this.refId; - final title = this.title; - final instructions = this.instructions; - final weight = this.weight; + final arn = this.arn; + final id = this.id; return { - 'Items': items, - 'RefId': refId, - 'Title': title, - if (instructions != null) 'Instructions': instructions, - if (weight != null) 'Weight': weight, + 'Arn': arn, + 'Id': id, }; } } -/// Information about the automation configuration in single select questions. -/// Automation options are evaluated in order, and the first matched option is -/// applied. If no automation option matches, and there is a default option, -/// then the default option is applied. -class EvaluationFormSingleSelectQuestionAutomation { - /// The automation options of the single select question. - final List options; +class CreateTrafficDistributionGroupResponse { + /// The Amazon Resource Name (ARN) of the traffic distribution group. + final String? arn; - /// The identifier of the default answer option, when none of the automation - /// options match the criteria. - final String? defaultOptionRefId; + /// The identifier of the traffic distribution group. This can be the ID or the + /// ARN if the API is being called in the Region where the traffic distribution + /// group was created. The ARN must be provided if the call is from the + /// replicated Region. + final String? id; - EvaluationFormSingleSelectQuestionAutomation({ - required this.options, - this.defaultOptionRefId, + CreateTrafficDistributionGroupResponse({ + this.arn, + this.id, }); - factory EvaluationFormSingleSelectQuestionAutomation.fromJson( + factory CreateTrafficDistributionGroupResponse.fromJson( Map json) { - return EvaluationFormSingleSelectQuestionAutomation( - options: (json['Options'] as List) - .whereNotNull() - .map((e) => - EvaluationFormSingleSelectQuestionAutomationOption.fromJson( - e as Map)) - .toList(), - defaultOptionRefId: json['DefaultOptionRefId'] as String?, + return CreateTrafficDistributionGroupResponse( + arn: json['Arn'] as String?, + id: json['Id'] as String?, ); } Map toJson() { - final options = this.options; - final defaultOptionRefId = this.defaultOptionRefId; + final arn = this.arn; + final id = this.id; return { - 'Options': options, - if (defaultOptionRefId != null) 'DefaultOptionRefId': defaultOptionRefId, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, }; } } -/// Information about the automation option of a single select question. -class EvaluationFormSingleSelectQuestionAutomationOption { - /// The automation option based on a rule category for the single select - /// question. - final SingleSelectQuestionRuleCategoryAutomation? ruleCategory; +class CreateUseCaseResponse { + /// The Amazon Resource Name (ARN) for the use case. + final String? useCaseArn; - EvaluationFormSingleSelectQuestionAutomationOption({ - this.ruleCategory, + /// The identifier of the use case. + final String? useCaseId; + + CreateUseCaseResponse({ + this.useCaseArn, + this.useCaseId, }); - factory EvaluationFormSingleSelectQuestionAutomationOption.fromJson( - Map json) { - return EvaluationFormSingleSelectQuestionAutomationOption( - ruleCategory: json['RuleCategory'] != null - ? SingleSelectQuestionRuleCategoryAutomation.fromJson( - json['RuleCategory'] as Map) - : null, + factory CreateUseCaseResponse.fromJson(Map json) { + return CreateUseCaseResponse( + useCaseArn: json['UseCaseArn'] as String?, + useCaseId: json['UseCaseId'] as String?, ); } Map toJson() { - final ruleCategory = this.ruleCategory; + final useCaseArn = this.useCaseArn; + final useCaseId = this.useCaseId; return { - if (ruleCategory != null) 'RuleCategory': ruleCategory, + if (useCaseArn != null) 'UseCaseArn': useCaseArn, + if (useCaseId != null) 'UseCaseId': useCaseId, }; } } -enum EvaluationFormSingleSelectQuestionDisplayMode { - dropdown, - radio, -} +class CreateUserHierarchyGroupResponse { + /// The Amazon Resource Name (ARN) of the hierarchy group. + final String? hierarchyGroupArn; -extension EvaluationFormSingleSelectQuestionDisplayModeValueExtension - on EvaluationFormSingleSelectQuestionDisplayMode { - String toValue() { - switch (this) { - case EvaluationFormSingleSelectQuestionDisplayMode.dropdown: - return 'DROPDOWN'; - case EvaluationFormSingleSelectQuestionDisplayMode.radio: - return 'RADIO'; - } + /// The identifier of the hierarchy group. + final String? hierarchyGroupId; + + CreateUserHierarchyGroupResponse({ + this.hierarchyGroupArn, + this.hierarchyGroupId, + }); + + factory CreateUserHierarchyGroupResponse.fromJson(Map json) { + return CreateUserHierarchyGroupResponse( + hierarchyGroupArn: json['HierarchyGroupArn'] as String?, + hierarchyGroupId: json['HierarchyGroupId'] as String?, + ); } -} -extension EvaluationFormSingleSelectQuestionDisplayModeFromString on String { - EvaluationFormSingleSelectQuestionDisplayMode - toEvaluationFormSingleSelectQuestionDisplayMode() { - switch (this) { - case 'DROPDOWN': - return EvaluationFormSingleSelectQuestionDisplayMode.dropdown; - case 'RADIO': - return EvaluationFormSingleSelectQuestionDisplayMode.radio; - } - throw Exception( - '$this is not known in enum EvaluationFormSingleSelectQuestionDisplayMode'); + Map toJson() { + final hierarchyGroupArn = this.hierarchyGroupArn; + final hierarchyGroupId = this.hierarchyGroupId; + return { + if (hierarchyGroupArn != null) 'HierarchyGroupArn': hierarchyGroupArn, + if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId, + }; } } -/// Information about the automation configuration in single select questions. -class EvaluationFormSingleSelectQuestionOption { - /// The identifier of the answer option. An identifier must be unique within the - /// question. - final String refId; - - /// The title of the answer option. - final String text; - - /// The flag to mark the option as automatic fail. If an automatic fail answer - /// is provided, the overall evaluation gets a score of 0. - final bool? automaticFail; +class CreateUserResponse { + /// The Amazon Resource Name (ARN) of the user account. + final String? userArn; - /// The score assigned to the answer option. - final int? score; + /// The identifier of the user account. + final String? userId; - EvaluationFormSingleSelectQuestionOption({ - required this.refId, - required this.text, - this.automaticFail, - this.score, + CreateUserResponse({ + this.userArn, + this.userId, }); - factory EvaluationFormSingleSelectQuestionOption.fromJson( - Map json) { - return EvaluationFormSingleSelectQuestionOption( - refId: json['RefId'] as String, - text: json['Text'] as String, - automaticFail: json['AutomaticFail'] as bool?, - score: json['Score'] as int?, + factory CreateUserResponse.fromJson(Map json) { + return CreateUserResponse( + userArn: json['UserArn'] as String?, + userId: json['UserId'] as String?, ); } Map toJson() { - final refId = this.refId; - final text = this.text; - final automaticFail = this.automaticFail; - final score = this.score; + final userArn = this.userArn; + final userId = this.userId; return { - 'RefId': refId, - 'Text': text, - if (automaticFail != null) 'AutomaticFail': automaticFail, - if (score != null) 'Score': score, + if (userArn != null) 'UserArn': userArn, + if (userId != null) 'UserId': userId, }; } } -/// Information about the options in single select questions. -class EvaluationFormSingleSelectQuestionProperties { - /// The answer options of the single select question. - final List options; - - /// The display mode of the single select question. - final EvaluationFormSingleSelectQuestionAutomation? automation; - - /// The display mode of the single select question. - final EvaluationFormSingleSelectQuestionDisplayMode? displayAs; +class CreateViewResponse { + /// A view resource object. Contains metadata and content necessary to render + /// the view. + final View? view; - EvaluationFormSingleSelectQuestionProperties({ - required this.options, - this.automation, - this.displayAs, + CreateViewResponse({ + this.view, }); - factory EvaluationFormSingleSelectQuestionProperties.fromJson( - Map json) { - return EvaluationFormSingleSelectQuestionProperties( - options: (json['Options'] as List) - .whereNotNull() - .map((e) => EvaluationFormSingleSelectQuestionOption.fromJson( - e as Map)) - .toList(), - automation: json['Automation'] != null - ? EvaluationFormSingleSelectQuestionAutomation.fromJson( - json['Automation'] as Map) + factory CreateViewResponse.fromJson(Map json) { + return CreateViewResponse( + view: json['View'] != null + ? View.fromJson(json['View'] as Map) : null, - displayAs: (json['DisplayAs'] as String?) - ?.toEvaluationFormSingleSelectQuestionDisplayMode(), ); } Map toJson() { - final options = this.options; - final automation = this.automation; - final displayAs = this.displayAs; + final view = this.view; return { - 'Options': options, - if (automation != null) 'Automation': automation, - if (displayAs != null) 'DisplayAs': displayAs.toValue(), + if (view != null) 'View': view, }; } } -/// Summary information about an evaluation form. -class EvaluationFormSummary { - /// The Amazon Resource Name (ARN) of the user who created the evaluation form. - final String createdBy; - - /// The timestamp for when the evaluation form was created. - final DateTime createdTime; - - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; - - /// The unique identifier for the evaluation form. - final String evaluationFormId; - - /// The Amazon Resource Name (ARN) of the user who last updated the evaluation - /// form. - final String lastModifiedBy; +class CreateViewVersionResponse { + /// All view data is contained within the View object. + final View? view; - /// The timestamp for when the evaluation form was last updated. - final DateTime lastModifiedTime; + CreateViewVersionResponse({ + this.view, + }); - /// The version number of the latest evaluation form version. - final int latestVersion; + factory CreateViewVersionResponse.fromJson(Map json) { + return CreateViewVersionResponse( + view: json['View'] != null + ? View.fromJson(json['View'] as Map) + : null, + ); + } - /// A title of the evaluation form. - final String title; + Map toJson() { + final view = this.view; + return { + if (view != null) 'View': view, + }; + } +} - /// The version of the active evaluation form version. - final int? activeVersion; +class CreateVocabularyResponse { + /// The current state of the custom vocabulary. + final VocabularyState state; - /// The Amazon Resource Name (ARN) of the user who last activated the evaluation - /// form. - final String? lastActivatedBy; + /// The Amazon Resource Name (ARN) of the custom vocabulary. + final String vocabularyArn; - /// The timestamp for when the evaluation form was last activated. - final DateTime? lastActivatedTime; + /// The identifier of the custom vocabulary. + final String vocabularyId; - EvaluationFormSummary({ - required this.createdBy, - required this.createdTime, - required this.evaluationFormArn, - required this.evaluationFormId, - required this.lastModifiedBy, - required this.lastModifiedTime, - required this.latestVersion, - required this.title, - this.activeVersion, - this.lastActivatedBy, - this.lastActivatedTime, + CreateVocabularyResponse({ + required this.state, + required this.vocabularyArn, + required this.vocabularyId, }); - factory EvaluationFormSummary.fromJson(Map json) { - return EvaluationFormSummary( - createdBy: json['CreatedBy'] as String, - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - lastModifiedBy: json['LastModifiedBy'] as String, - lastModifiedTime: - nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), - latestVersion: json['LatestVersion'] as int, - title: json['Title'] as String, - activeVersion: json['ActiveVersion'] as int?, - lastActivatedBy: json['LastActivatedBy'] as String?, - lastActivatedTime: timeStampFromJson(json['LastActivatedTime']), + factory CreateVocabularyResponse.fromJson(Map json) { + return CreateVocabularyResponse( + state: (json['State'] as String).toVocabularyState(), + vocabularyArn: json['VocabularyArn'] as String, + vocabularyId: json['VocabularyId'] as String, ); } Map toJson() { - final createdBy = this.createdBy; - final createdTime = this.createdTime; - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; - final lastModifiedBy = this.lastModifiedBy; - final lastModifiedTime = this.lastModifiedTime; - final latestVersion = this.latestVersion; - final title = this.title; - final activeVersion = this.activeVersion; - final lastActivatedBy = this.lastActivatedBy; - final lastActivatedTime = this.lastActivatedTime; + final state = this.state; + final vocabularyArn = this.vocabularyArn; + final vocabularyId = this.vocabularyId; return { - 'CreatedBy': createdBy, - 'CreatedTime': unixTimestampToJson(createdTime), - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, - 'LastModifiedBy': lastModifiedBy, - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - 'LatestVersion': latestVersion, - 'Title': title, - if (activeVersion != null) 'ActiveVersion': activeVersion, - if (lastActivatedBy != null) 'LastActivatedBy': lastActivatedBy, - if (lastActivatedTime != null) - 'LastActivatedTime': unixTimestampToJson(lastActivatedTime), + 'State': state.toValue(), + 'VocabularyArn': vocabularyArn, + 'VocabularyId': vocabularyId, }; } } -enum EvaluationFormVersionStatus { - draft, - active, -} +/// Information on the identity that created the file. +class CreatedByInfo { + /// STS or IAM ARN representing the identity of API Caller. SDK users cannot + /// populate this and this value is calculated automatically if + /// ConnectUserArn is not provided. + final String? awsIdentityArn; -extension EvaluationFormVersionStatusValueExtension - on EvaluationFormVersionStatus { - String toValue() { - switch (this) { - case EvaluationFormVersionStatus.draft: - return 'DRAFT'; - case EvaluationFormVersionStatus.active: - return 'ACTIVE'; - } + /// An agent ARN representing a connect + /// user. + final String? connectUserArn; + + CreatedByInfo({ + this.awsIdentityArn, + this.connectUserArn, + }); + + factory CreatedByInfo.fromJson(Map json) { + return CreatedByInfo( + awsIdentityArn: json['AWSIdentityArn'] as String?, + connectUserArn: json['ConnectUserArn'] as String?, + ); } -} -extension EvaluationFormVersionStatusFromString on String { - EvaluationFormVersionStatus toEvaluationFormVersionStatus() { - switch (this) { - case 'DRAFT': - return EvaluationFormVersionStatus.draft; - case 'ACTIVE': - return EvaluationFormVersionStatus.active; - } - throw Exception('$this is not known in enum EvaluationFormVersionStatus'); + Map toJson() { + final awsIdentityArn = this.awsIdentityArn; + final connectUserArn = this.connectUserArn; + return { + if (awsIdentityArn != null) 'AWSIdentityArn': awsIdentityArn, + if (connectUserArn != null) 'ConnectUserArn': connectUserArn, + }; } } -/// Summary information about an evaluation form. -class EvaluationFormVersionSummary { - /// The Amazon Resource Name (ARN) of the user who created the evaluation form. - final String createdBy; - - /// The timestamp for when the evaluation form was created. - final DateTime createdTime; +/// Contains credentials to use for federation. +class Credentials { + /// An access token generated for a federated user to access Amazon Connect. + final String? accessToken; - /// The Amazon Resource Name (ARN) for the evaluation form resource. - final String evaluationFormArn; + /// A token generated with an expiration time for the session a user is logged + /// in to Amazon Connect. + final DateTime? accessTokenExpiration; - /// The unique identifier for the evaluation form. - final String evaluationFormId; + /// Renews a token generated for a user to access the Amazon Connect instance. + final String? refreshToken; - /// A version of the evaluation form. - final int evaluationFormVersion; + /// Renews the expiration timer for a generated token. + final DateTime? refreshTokenExpiration; - /// The Amazon Resource Name (ARN) of the user who last updated the evaluation - /// form. - final String lastModifiedBy; + Credentials({ + this.accessToken, + this.accessTokenExpiration, + this.refreshToken, + this.refreshTokenExpiration, + }); - /// The timestamp for when the evaluation form was last updated. - final DateTime lastModifiedTime; + factory Credentials.fromJson(Map json) { + return Credentials( + accessToken: json['AccessToken'] as String?, + accessTokenExpiration: timeStampFromJson(json['AccessTokenExpiration']), + refreshToken: json['RefreshToken'] as String?, + refreshTokenExpiration: timeStampFromJson(json['RefreshTokenExpiration']), + ); + } - /// The flag indicating whether the evaluation form is locked for changes. - final bool locked; + Map toJson() { + final accessToken = this.accessToken; + final accessTokenExpiration = this.accessTokenExpiration; + final refreshToken = this.refreshToken; + final refreshTokenExpiration = this.refreshTokenExpiration; + return { + if (accessToken != null) 'AccessToken': accessToken, + if (accessTokenExpiration != null) + 'AccessTokenExpiration': unixTimestampToJson(accessTokenExpiration), + if (refreshToken != null) 'RefreshToken': refreshToken, + if (refreshTokenExpiration != null) + 'RefreshTokenExpiration': unixTimestampToJson(refreshTokenExpiration), + }; + } +} - /// The status of the evaluation form. - final EvaluationFormVersionStatus status; +/// Defines the cross-channel routing behavior that allows an agent working on a +/// contact in one channel to be offered a contact from a different channel. +class CrossChannelBehavior { + /// Specifies the other channels that can be routed to an agent handling their + /// current channel. + final BehaviorType behaviorType; - EvaluationFormVersionSummary({ - required this.createdBy, - required this.createdTime, - required this.evaluationFormArn, - required this.evaluationFormId, - required this.evaluationFormVersion, - required this.lastModifiedBy, - required this.lastModifiedTime, - required this.locked, - required this.status, + CrossChannelBehavior({ + required this.behaviorType, }); - factory EvaluationFormVersionSummary.fromJson(Map json) { - return EvaluationFormVersionSummary( - createdBy: json['CreatedBy'] as String, - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - evaluationFormArn: json['EvaluationFormArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormVersion: json['EvaluationFormVersion'] as int, - lastModifiedBy: json['LastModifiedBy'] as String, - lastModifiedTime: - nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), - locked: json['Locked'] as bool, - status: (json['Status'] as String).toEvaluationFormVersionStatus(), + factory CrossChannelBehavior.fromJson(Map json) { + return CrossChannelBehavior( + behaviorType: (json['BehaviorType'] as String).toBehaviorType(), ); } Map toJson() { - final createdBy = this.createdBy; - final createdTime = this.createdTime; - final evaluationFormArn = this.evaluationFormArn; - final evaluationFormId = this.evaluationFormId; - final evaluationFormVersion = this.evaluationFormVersion; - final lastModifiedBy = this.lastModifiedBy; - final lastModifiedTime = this.lastModifiedTime; - final locked = this.locked; - final status = this.status; + final behaviorType = this.behaviorType; return { - 'CreatedBy': createdBy, - 'CreatedTime': unixTimestampToJson(createdTime), - 'EvaluationFormArn': evaluationFormArn, - 'EvaluationFormId': evaluationFormId, - 'EvaluationFormVersion': evaluationFormVersion, - 'LastModifiedBy': lastModifiedBy, - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - 'Locked': locked, - 'Status': status.toValue(), + 'BehaviorType': behaviorType.toValue(), }; } } -/// Metadata information about a contact evaluation. -class EvaluationMetadata { - /// The identifier of the contact in this instance of Amazon Connect. - final String contactId; - - /// The Amazon Resource Name (ARN) of the user who last updated the evaluation. - final String evaluatorArn; - - /// The identifier of the agent who performed the contact. - final String? contactAgentId; +/// Contains information about a real-time metric. For a description of each +/// metric, see Real-time +/// Metrics Definitions in the Amazon Connect Administrator Guide. +class CurrentMetric { + /// The name of the metric. + final CurrentMetricName? name; - /// The overall score of the contact evaluation. - final EvaluationScore? score; + /// The unit for the metric. + final Unit? unit; - EvaluationMetadata({ - required this.contactId, - required this.evaluatorArn, - this.contactAgentId, - this.score, + CurrentMetric({ + this.name, + this.unit, }); - factory EvaluationMetadata.fromJson(Map json) { - return EvaluationMetadata( - contactId: json['ContactId'] as String, - evaluatorArn: json['EvaluatorArn'] as String, - contactAgentId: json['ContactAgentId'] as String?, - score: json['Score'] != null - ? EvaluationScore.fromJson(json['Score'] as Map) - : null, + factory CurrentMetric.fromJson(Map json) { + return CurrentMetric( + name: (json['Name'] as String?)?.toCurrentMetricName(), + unit: (json['Unit'] as String?)?.toUnit(), ); } Map toJson() { - final contactId = this.contactId; - final evaluatorArn = this.evaluatorArn; - final contactAgentId = this.contactAgentId; - final score = this.score; + final name = this.name; + final unit = this.unit; return { - 'ContactId': contactId, - 'EvaluatorArn': evaluatorArn, - if (contactAgentId != null) 'ContactAgentId': contactAgentId, - if (score != null) 'Score': score, + if (name != null) 'Name': name.toValue(), + if (unit != null) 'Unit': unit.toValue(), }; } } -/// Information about notes for a contact evaluation. -class EvaluationNote { - /// The note for an item (section or question) in a contact evaluation. - final String? value; +/// Contains the data for a real-time metric. +class CurrentMetricData { + /// Information about the metric. + final CurrentMetric? metric; - EvaluationNote({ + /// The value of the metric. + final double? value; + + CurrentMetricData({ + this.metric, this.value, }); - factory EvaluationNote.fromJson(Map json) { - return EvaluationNote( - value: json['Value'] as String?, + factory CurrentMetricData.fromJson(Map json) { + return CurrentMetricData( + metric: json['Metric'] != null + ? CurrentMetric.fromJson(json['Metric'] as Map) + : null, + value: json['Value'] as double?, ); } Map toJson() { + final metric = this.metric; final value = this.value; return { + if (metric != null) 'Metric': metric, if (value != null) 'Value': value, }; } } -/// Information about scores of a contact evaluation item (section or question). -class EvaluationScore { - /// The flag that marks the item as automatic fail. If the item or a child item - /// gets an automatic fail answer, this flag will be true. - final bool? automaticFail; +/// The current metric names. +enum CurrentMetricName { + agentsOnline, + agentsAvailable, + agentsOnCall, + agentsNonProductive, + agentsAfterContactWork, + agentsError, + agentsStaffed, + contactsInQueue, + oldestContactAge, + contactsScheduled, + agentsOnContact, + slotsActive, + slotsAvailable, +} - /// The flag to mark the item as not applicable for scoring. - final bool? notApplicable; +extension CurrentMetricNameValueExtension on CurrentMetricName { + String toValue() { + switch (this) { + case CurrentMetricName.agentsOnline: + return 'AGENTS_ONLINE'; + case CurrentMetricName.agentsAvailable: + return 'AGENTS_AVAILABLE'; + case CurrentMetricName.agentsOnCall: + return 'AGENTS_ON_CALL'; + case CurrentMetricName.agentsNonProductive: + return 'AGENTS_NON_PRODUCTIVE'; + case CurrentMetricName.agentsAfterContactWork: + return 'AGENTS_AFTER_CONTACT_WORK'; + case CurrentMetricName.agentsError: + return 'AGENTS_ERROR'; + case CurrentMetricName.agentsStaffed: + return 'AGENTS_STAFFED'; + case CurrentMetricName.contactsInQueue: + return 'CONTACTS_IN_QUEUE'; + case CurrentMetricName.oldestContactAge: + return 'OLDEST_CONTACT_AGE'; + case CurrentMetricName.contactsScheduled: + return 'CONTACTS_SCHEDULED'; + case CurrentMetricName.agentsOnContact: + return 'AGENTS_ON_CONTACT'; + case CurrentMetricName.slotsActive: + return 'SLOTS_ACTIVE'; + case CurrentMetricName.slotsAvailable: + return 'SLOTS_AVAILABLE'; + } + } +} - /// The score percentage for an item in a contact evaluation. - final double? percentage; +extension CurrentMetricNameFromString on String { + CurrentMetricName toCurrentMetricName() { + switch (this) { + case 'AGENTS_ONLINE': + return CurrentMetricName.agentsOnline; + case 'AGENTS_AVAILABLE': + return CurrentMetricName.agentsAvailable; + case 'AGENTS_ON_CALL': + return CurrentMetricName.agentsOnCall; + case 'AGENTS_NON_PRODUCTIVE': + return CurrentMetricName.agentsNonProductive; + case 'AGENTS_AFTER_CONTACT_WORK': + return CurrentMetricName.agentsAfterContactWork; + case 'AGENTS_ERROR': + return CurrentMetricName.agentsError; + case 'AGENTS_STAFFED': + return CurrentMetricName.agentsStaffed; + case 'CONTACTS_IN_QUEUE': + return CurrentMetricName.contactsInQueue; + case 'OLDEST_CONTACT_AGE': + return CurrentMetricName.oldestContactAge; + case 'CONTACTS_SCHEDULED': + return CurrentMetricName.contactsScheduled; + case 'AGENTS_ON_CONTACT': + return CurrentMetricName.agentsOnContact; + case 'SLOTS_ACTIVE': + return CurrentMetricName.slotsActive; + case 'SLOTS_AVAILABLE': + return CurrentMetricName.slotsAvailable; + } + throw Exception('$this is not known in enum CurrentMetricName'); + } +} - EvaluationScore({ - this.automaticFail, - this.notApplicable, - this.percentage, +/// Contains information about a set of real-time metrics. +class CurrentMetricResult { + /// The set of metrics. + final List? collections; + + /// The dimensions for the metrics. + final Dimensions? dimensions; + + CurrentMetricResult({ + this.collections, + this.dimensions, }); - factory EvaluationScore.fromJson(Map json) { - return EvaluationScore( - automaticFail: json['AutomaticFail'] as bool?, - notApplicable: json['NotApplicable'] as bool?, - percentage: json['Percentage'] as double?, + factory CurrentMetricResult.fromJson(Map json) { + return CurrentMetricResult( + collections: (json['Collections'] as List?) + ?.whereNotNull() + .map((e) => CurrentMetricData.fromJson(e as Map)) + .toList(), + dimensions: json['Dimensions'] != null + ? Dimensions.fromJson(json['Dimensions'] as Map) + : null, ); } Map toJson() { - final automaticFail = this.automaticFail; - final notApplicable = this.notApplicable; - final percentage = this.percentage; + final collections = this.collections; + final dimensions = this.dimensions; return { - if (automaticFail != null) 'AutomaticFail': automaticFail, - if (notApplicable != null) 'NotApplicable': notApplicable, - if (percentage != null) 'Percentage': percentage, + if (collections != null) 'Collections': collections, + if (dimensions != null) 'Dimensions': dimensions, }; } } -enum EvaluationStatus { - draft, - submitted, -} +/// The way to sort the resulting response based on metrics. By default +/// resources are sorted based on AGENTS_ONLINE, +/// DESCENDING. The metric collection is sorted based on the input +/// metrics. +class CurrentMetricSortCriteria { + final CurrentMetricName? sortByMetric; -extension EvaluationStatusValueExtension on EvaluationStatus { - String toValue() { - switch (this) { - case EvaluationStatus.draft: - return 'DRAFT'; - case EvaluationStatus.submitted: - return 'SUBMITTED'; - } - } -} + /// The way to sort. + final SortOrder? sortOrder; -extension EvaluationStatusFromString on String { - EvaluationStatus toEvaluationStatus() { - switch (this) { - case 'DRAFT': - return EvaluationStatus.draft; - case 'SUBMITTED': - return EvaluationStatus.submitted; - } - throw Exception('$this is not known in enum EvaluationStatus'); + CurrentMetricSortCriteria({ + this.sortByMetric, + this.sortOrder, + }); + + Map toJson() { + final sortByMetric = this.sortByMetric; + final sortOrder = this.sortOrder; + return { + if (sortByMetric != null) 'SortByMetric': sortByMetric.toValue(), + if (sortOrder != null) 'SortOrder': sortOrder.toValue(), + }; } } -/// Summary information about a contact evaluation. -class EvaluationSummary { - /// The timestamp for when the evaluation was created. - final DateTime createdTime; +/// Information about the Customer on the contact. +class Customer { + final ParticipantCapabilities? capabilities; - /// The Amazon Resource Name (ARN) for the contact evaluation resource. - final String evaluationArn; + /// Information regarding Customer’s device. + final DeviceInfo? deviceInfo; - /// The unique identifier for the evaluation form. - final String evaluationFormId; - - /// A title of the evaluation form. - final String evaluationFormTitle; - - /// A unique identifier for the contact evaluation. - final String evaluationId; - - /// The Amazon Resource Name (ARN) of the user who last updated the evaluation. - final String evaluatorArn; - - /// The timestamp for when the evaluation was last updated. - final DateTime lastModifiedTime; - - /// The status of the contact evaluation. - final EvaluationStatus status; - - /// The overall score of the contact evaluation. - final EvaluationScore? score; - - EvaluationSummary({ - required this.createdTime, - required this.evaluationArn, - required this.evaluationFormId, - required this.evaluationFormTitle, - required this.evaluationId, - required this.evaluatorArn, - required this.lastModifiedTime, - required this.status, - this.score, + Customer({ + this.capabilities, + this.deviceInfo, }); - factory EvaluationSummary.fromJson(Map json) { - return EvaluationSummary( - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - evaluationArn: json['EvaluationArn'] as String, - evaluationFormId: json['EvaluationFormId'] as String, - evaluationFormTitle: json['EvaluationFormTitle'] as String, - evaluationId: json['EvaluationId'] as String, - evaluatorArn: json['EvaluatorArn'] as String, - lastModifiedTime: - nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), - status: (json['Status'] as String).toEvaluationStatus(), - score: json['Score'] != null - ? EvaluationScore.fromJson(json['Score'] as Map) + factory Customer.fromJson(Map json) { + return Customer( + capabilities: json['Capabilities'] != null + ? ParticipantCapabilities.fromJson( + json['Capabilities'] as Map) + : null, + deviceInfo: json['DeviceInfo'] != null + ? DeviceInfo.fromJson(json['DeviceInfo'] as Map) : null, ); } Map toJson() { - final createdTime = this.createdTime; - final evaluationArn = this.evaluationArn; - final evaluationFormId = this.evaluationFormId; - final evaluationFormTitle = this.evaluationFormTitle; - final evaluationId = this.evaluationId; - final evaluatorArn = this.evaluatorArn; - final lastModifiedTime = this.lastModifiedTime; - final status = this.status; - final score = this.score; + final capabilities = this.capabilities; + final deviceInfo = this.deviceInfo; return { - 'CreatedTime': unixTimestampToJson(createdTime), - 'EvaluationArn': evaluationArn, - 'EvaluationFormId': evaluationFormId, - 'EvaluationFormTitle': evaluationFormTitle, - 'EvaluationId': evaluationId, - 'EvaluatorArn': evaluatorArn, - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - 'Status': status.toValue(), - if (score != null) 'Score': score, + if (capabilities != null) 'Capabilities': capabilities, + if (deviceInfo != null) 'DeviceInfo': deviceInfo, }; } } -/// The EventBridge action definition. -class EventBridgeActionDefinition { - /// The name. - final String name; +/// Information about the quality of the Customer's media connection +class CustomerQualityMetrics { + /// Information about the audio quality of the Customer + final AudioQualityMetricsInfo? audio; - EventBridgeActionDefinition({ - required this.name, + CustomerQualityMetrics({ + this.audio, }); - factory EventBridgeActionDefinition.fromJson(Map json) { - return EventBridgeActionDefinition( - name: json['Name'] as String, + factory CustomerQualityMetrics.fromJson(Map json) { + return CustomerQualityMetrics( + audio: json['Audio'] != null + ? AudioQualityMetricsInfo.fromJson( + json['Audio'] as Map) + : null, ); } Map toJson() { - final name = this.name; + final audio = this.audio; return { - 'Name': name, + if (audio != null) 'Audio': audio, }; } } -enum EventSourceName { - onPostCallAnalysisAvailable, - onRealTimeCallAnalysisAvailable, - onPostChatAnalysisAvailable, - onZendeskTicketCreate, - onZendeskTicketStatusUpdate, - onSalesforceCaseCreate, - onContactEvaluationSubmit, -} - -extension EventSourceNameValueExtension on EventSourceName { - String toValue() { - switch (this) { - case EventSourceName.onPostCallAnalysisAvailable: - return 'OnPostCallAnalysisAvailable'; - case EventSourceName.onRealTimeCallAnalysisAvailable: - return 'OnRealTimeCallAnalysisAvailable'; - case EventSourceName.onPostChatAnalysisAvailable: - return 'OnPostChatAnalysisAvailable'; - case EventSourceName.onZendeskTicketCreate: - return 'OnZendeskTicketCreate'; - case EventSourceName.onZendeskTicketStatusUpdate: - return 'OnZendeskTicketStatusUpdate'; - case EventSourceName.onSalesforceCaseCreate: - return 'OnSalesforceCaseCreate'; - case EventSourceName.onContactEvaluationSubmit: - return 'OnContactEvaluationSubmit'; - } - } -} - -extension EventSourceNameFromString on String { - EventSourceName toEventSourceName() { - switch (this) { - case 'OnPostCallAnalysisAvailable': - return EventSourceName.onPostCallAnalysisAvailable; - case 'OnRealTimeCallAnalysisAvailable': - return EventSourceName.onRealTimeCallAnalysisAvailable; - case 'OnPostChatAnalysisAvailable': - return EventSourceName.onPostChatAnalysisAvailable; - case 'OnZendeskTicketCreate': - return EventSourceName.onZendeskTicketCreate; - case 'OnZendeskTicketStatusUpdate': - return EventSourceName.onZendeskTicketStatusUpdate; - case 'OnSalesforceCaseCreate': - return EventSourceName.onSalesforceCaseCreate; - case 'OnContactEvaluationSubmit': - return EventSourceName.onContactEvaluationSubmit; - } - throw Exception('$this is not known in enum EventSourceName'); - } -} - -/// Contains the filter to apply when retrieving metrics with the GetMetricDataV2 -/// API. -class FilterV2 { - /// The key to use for filtering data. For example, QUEUE, - /// ROUTING_PROFILE, AGENT, CHANNEL, - /// AGENT_HIERARCHY_LEVEL_ONE, - /// AGENT_HIERARCHY_LEVEL_TWO, - /// AGENT_HIERARCHY_LEVEL_THREE, - /// AGENT_HIERARCHY_LEVEL_FOUR, - /// AGENT_HIERARCHY_LEVEL_FIVE. There must be at least 1 key and a - /// maximum 5 keys. - final String? filterKey; +/// Information about customer’s voice activity. +class CustomerVoiceActivity { + /// Timestamp that measures the end of the customer greeting from an outbound + /// voice call. + final DateTime? greetingEndTimestamp; - /// The identifiers to use for filtering data. For example, if you have a filter - /// key of QUEUE, you would add queue IDs or ARNs in - /// FilterValues. - final List? filterValues; + /// Timestamp that measures the beginning of the customer greeting from an + /// outbound voice call. + final DateTime? greetingStartTimestamp; - FilterV2({ - this.filterKey, - this.filterValues, + CustomerVoiceActivity({ + this.greetingEndTimestamp, + this.greetingStartTimestamp, }); + factory CustomerVoiceActivity.fromJson(Map json) { + return CustomerVoiceActivity( + greetingEndTimestamp: timeStampFromJson(json['GreetingEndTimestamp']), + greetingStartTimestamp: timeStampFromJson(json['GreetingStartTimestamp']), + ); + } + Map toJson() { - final filterKey = this.filterKey; - final filterValues = this.filterValues; + final greetingEndTimestamp = this.greetingEndTimestamp; + final greetingStartTimestamp = this.greetingStartTimestamp; return { - if (filterKey != null) 'FilterKey': filterKey, - if (filterValues != null) 'FilterValues': filterValues, + if (greetingEndTimestamp != null) + 'GreetingEndTimestamp': unixTimestampToJson(greetingEndTimestamp), + if (greetingStartTimestamp != null) + 'GreetingStartTimestamp': unixTimestampToJson(greetingStartTimestamp), }; } } -/// Contains the filter to apply when retrieving metrics. -class Filters { - /// The channel to use to filter the metrics. - final List? channels; - - /// The queues to use to filter the metrics. You should specify at least one - /// queue, and can specify up to 100 queues per request. The - /// GetCurrentMetricsData API in particular requires a queue when - /// you include a Filter in your request. - final List? queues; +/// Information about a reference when the referenceType is +/// DATE. Otherwise, null. +class DateReference { + /// Identifier of the date reference. + final String? name; - /// A list of up to 100 routing profile IDs or ARNs. - final List? routingProfiles; + /// A valid date. + final String? value; - Filters({ - this.channels, - this.queues, - this.routingProfiles, + DateReference({ + this.name, + this.value, }); + factory DateReference.fromJson(Map json) { + return DateReference( + name: json['Name'] as String?, + value: json['Value'] as String?, + ); + } + Map toJson() { - final channels = this.channels; - final queues = this.queues; - final routingProfiles = this.routingProfiles; + final name = this.name; + final value = this.value; return { - if (channels != null) - 'Channels': channels.map((e) => e.toValue()).toList(), - if (queues != null) 'Queues': queues, - if (routingProfiles != null) 'RoutingProfiles': routingProfiles, + if (name != null) 'Name': name, + if (value != null) 'Value': value, }; } } -class GetContactAttributesResponse { - /// Information about the attributes. - final Map? attributes; +class DeactivateEvaluationFormResponse { + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; - GetContactAttributesResponse({ - this.attributes, + /// The unique identifier for the evaluation form. + final String evaluationFormId; + + /// The version of the deactivated evaluation form resource. + final int evaluationFormVersion; + + DeactivateEvaluationFormResponse({ + required this.evaluationFormArn, + required this.evaluationFormId, + required this.evaluationFormVersion, }); - factory GetContactAttributesResponse.fromJson(Map json) { - return GetContactAttributesResponse( - attributes: (json['Attributes'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory DeactivateEvaluationFormResponse.fromJson(Map json) { + return DeactivateEvaluationFormResponse( + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormVersion: json['EvaluationFormVersion'] as int, ); } Map toJson() { - final attributes = this.attributes; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormVersion = this.evaluationFormVersion; return { - if (attributes != null) 'Attributes': attributes, + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormVersion': evaluationFormVersion, }; } } -class GetCurrentMetricDataResponse { - /// The total count of the result, regardless of the current page size. - final int? approximateTotalCount; +/// Contains information about a default vocabulary. +class DefaultVocabulary { + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String instanceId; - /// The time at which the metrics were retrieved and cached for pagination. - final DateTime? dataSnapshotTime; + /// The language code of the vocabulary entries. For a list of languages and + /// their corresponding language codes, see What + /// is Amazon Transcribe? + final VocabularyLanguageCode languageCode; - /// Information about the real-time metrics. - final List? metricResults; + /// The identifier of the custom vocabulary. + final String vocabularyId; - /// If there are additional results, this is the token for the next set of - /// results. - /// - /// The token expires after 5 minutes from the time it is created. Subsequent - /// requests that use the token must use the same request parameters as the - /// request that generated the token. - final String? nextToken; + /// A unique name of the custom vocabulary. + final String vocabularyName; - GetCurrentMetricDataResponse({ - this.approximateTotalCount, - this.dataSnapshotTime, - this.metricResults, - this.nextToken, + DefaultVocabulary({ + required this.instanceId, + required this.languageCode, + required this.vocabularyId, + required this.vocabularyName, }); - factory GetCurrentMetricDataResponse.fromJson(Map json) { - return GetCurrentMetricDataResponse( - approximateTotalCount: json['ApproximateTotalCount'] as int?, - dataSnapshotTime: timeStampFromJson(json['DataSnapshotTime']), - metricResults: (json['MetricResults'] as List?) - ?.whereNotNull() - .map((e) => CurrentMetricResult.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory DefaultVocabulary.fromJson(Map json) { + return DefaultVocabulary( + instanceId: json['InstanceId'] as String, + languageCode: (json['LanguageCode'] as String).toVocabularyLanguageCode(), + vocabularyId: json['VocabularyId'] as String, + vocabularyName: json['VocabularyName'] as String, ); } Map toJson() { - final approximateTotalCount = this.approximateTotalCount; - final dataSnapshotTime = this.dataSnapshotTime; - final metricResults = this.metricResults; - final nextToken = this.nextToken; + final instanceId = this.instanceId; + final languageCode = this.languageCode; + final vocabularyId = this.vocabularyId; + final vocabularyName = this.vocabularyName; return { - if (approximateTotalCount != null) - 'ApproximateTotalCount': approximateTotalCount, - if (dataSnapshotTime != null) - 'DataSnapshotTime': unixTimestampToJson(dataSnapshotTime), - if (metricResults != null) 'MetricResults': metricResults, - if (nextToken != null) 'NextToken': nextToken, + 'InstanceId': instanceId, + 'LanguageCode': languageCode.toValue(), + 'VocabularyId': vocabularyId, + 'VocabularyName': vocabularyName, }; } } -class GetCurrentUserDataResponse { - /// The total count of the result, regardless of the current page size. - final int? approximateTotalCount; +/// Response from DeleteAttachedFile API +class DeleteAttachedFileResponse { + DeleteAttachedFileResponse(); - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + factory DeleteAttachedFileResponse.fromJson(Map _) { + return DeleteAttachedFileResponse(); + } - /// A list of the user data that is returned. - final List? userDataList; + Map toJson() { + return {}; + } +} - GetCurrentUserDataResponse({ - this.approximateTotalCount, - this.nextToken, - this.userDataList, - }); +class DeleteContactFlowModuleResponse { + DeleteContactFlowModuleResponse(); - factory GetCurrentUserDataResponse.fromJson(Map json) { - return GetCurrentUserDataResponse( - approximateTotalCount: json['ApproximateTotalCount'] as int?, - nextToken: json['NextToken'] as String?, - userDataList: (json['UserDataList'] as List?) - ?.whereNotNull() - .map((e) => UserData.fromJson(e as Map)) - .toList(), - ); + factory DeleteContactFlowModuleResponse.fromJson(Map _) { + return DeleteContactFlowModuleResponse(); } Map toJson() { - final approximateTotalCount = this.approximateTotalCount; - final nextToken = this.nextToken; - final userDataList = this.userDataList; - return { - if (approximateTotalCount != null) - 'ApproximateTotalCount': approximateTotalCount, - if (nextToken != null) 'NextToken': nextToken, - if (userDataList != null) 'UserDataList': userDataList, - }; + return {}; } } -class GetFederationTokenResponse { - /// The credentials to use for federation. - final Credentials? credentials; +class DeleteContactFlowResponse { + DeleteContactFlowResponse(); - /// The URL to sign into the user's instance. - final String? signInUrl; + factory DeleteContactFlowResponse.fromJson(Map _) { + return DeleteContactFlowResponse(); + } - /// The Amazon Resource Name (ARN) of the user. - final String? userArn; + Map toJson() { + return {}; + } +} - /// The identifier for the user. - final String? userId; +class DeleteTaskTemplateResponse { + DeleteTaskTemplateResponse(); - GetFederationTokenResponse({ - this.credentials, - this.signInUrl, - this.userArn, - this.userId, - }); + factory DeleteTaskTemplateResponse.fromJson(Map _) { + return DeleteTaskTemplateResponse(); + } - factory GetFederationTokenResponse.fromJson(Map json) { - return GetFederationTokenResponse( - credentials: json['Credentials'] != null - ? Credentials.fromJson(json['Credentials'] as Map) - : null, - signInUrl: json['SignInUrl'] as String?, - userArn: json['UserArn'] as String?, - userId: json['UserId'] as String?, - ); + Map toJson() { + return {}; + } +} + +class DeleteTrafficDistributionGroupResponse { + DeleteTrafficDistributionGroupResponse(); + + factory DeleteTrafficDistributionGroupResponse.fromJson( + Map _) { + return DeleteTrafficDistributionGroupResponse(); } Map toJson() { - final credentials = this.credentials; - final signInUrl = this.signInUrl; - final userArn = this.userArn; - final userId = this.userId; - return { - if (credentials != null) 'Credentials': credentials, - if (signInUrl != null) 'SignInUrl': signInUrl, - if (userArn != null) 'UserArn': userArn, - if (userId != null) 'UserId': userId, - }; + return {}; } } -class GetMetricDataResponse { - /// Information about the historical metrics. - /// - /// If no grouping is specified, a summary of metric data is returned. - final List? metricResults; +class DeleteViewResponse { + DeleteViewResponse(); - /// If there are additional results, this is the token for the next set of - /// results. - /// - /// The token expires after 5 minutes from the time it is created. Subsequent - /// requests that use the token must use the same request parameters as the - /// request that generated the token. - final String? nextToken; + factory DeleteViewResponse.fromJson(Map _) { + return DeleteViewResponse(); + } - GetMetricDataResponse({ - this.metricResults, - this.nextToken, - }); + Map toJson() { + return {}; + } +} - factory GetMetricDataResponse.fromJson(Map json) { - return GetMetricDataResponse( - metricResults: (json['MetricResults'] as List?) - ?.whereNotNull() - .map( - (e) => HistoricalMetricResult.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, - ); +class DeleteViewVersionResponse { + DeleteViewVersionResponse(); + + factory DeleteViewVersionResponse.fromJson(Map _) { + return DeleteViewVersionResponse(); } Map toJson() { - final metricResults = this.metricResults; - final nextToken = this.nextToken; - return { - if (metricResults != null) 'MetricResults': metricResults, - if (nextToken != null) 'NextToken': nextToken, - }; + return {}; } } -class GetMetricDataV2Response { - /// Information about the metrics requested in the API request If no grouping is - /// specified, a summary of metric data is returned. - final List? metricResults; +class DeleteVocabularyResponse { + /// The current state of the custom vocabulary. + final VocabularyState state; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The Amazon Resource Name (ARN) of the custom vocabulary. + final String vocabularyArn; - GetMetricDataV2Response({ - this.metricResults, - this.nextToken, + /// The identifier of the custom vocabulary. + final String vocabularyId; + + DeleteVocabularyResponse({ + required this.state, + required this.vocabularyArn, + required this.vocabularyId, }); - factory GetMetricDataV2Response.fromJson(Map json) { - return GetMetricDataV2Response( - metricResults: (json['MetricResults'] as List?) - ?.whereNotNull() - .map((e) => MetricResultV2.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory DeleteVocabularyResponse.fromJson(Map json) { + return DeleteVocabularyResponse( + state: (json['State'] as String).toVocabularyState(), + vocabularyArn: json['VocabularyArn'] as String, + vocabularyId: json['VocabularyId'] as String, ); } Map toJson() { - final metricResults = this.metricResults; - final nextToken = this.nextToken; + final state = this.state; + final vocabularyArn = this.vocabularyArn; + final vocabularyId = this.vocabularyId; return { - if (metricResults != null) 'MetricResults': metricResults, - if (nextToken != null) 'NextToken': nextToken, + 'State': state.toValue(), + 'VocabularyArn': vocabularyArn, + 'VocabularyId': vocabularyId, }; } } -class GetPromptFileResponse { - /// A generated URL to the prompt that can be given to an unauthorized user so - /// they can access the prompt in S3. - final String? promptPresignedUrl; +class DescribeAgentStatusResponse { + /// The agent status. + final AgentStatus? agentStatus; - GetPromptFileResponse({ - this.promptPresignedUrl, + DescribeAgentStatusResponse({ + this.agentStatus, }); - factory GetPromptFileResponse.fromJson(Map json) { - return GetPromptFileResponse( - promptPresignedUrl: json['PromptPresignedUrl'] as String?, + factory DescribeAgentStatusResponse.fromJson(Map json) { + return DescribeAgentStatusResponse( + agentStatus: json['AgentStatus'] != null + ? AgentStatus.fromJson(json['AgentStatus'] as Map) + : null, ); } Map toJson() { - final promptPresignedUrl = this.promptPresignedUrl; + final agentStatus = this.agentStatus; return { - if (promptPresignedUrl != null) 'PromptPresignedUrl': promptPresignedUrl, + if (agentStatus != null) 'AgentStatus': agentStatus, }; } } -class GetTaskTemplateResponse { - /// The Amazon Resource Name (ARN). - final String arn; - - /// A unique identifier for the task template. - final String id; - - /// The name of the task template. - final String name; - - /// Constraints that are applicable to the fields listed. - final TaskTemplateConstraints? constraints; +class DescribeContactEvaluationResponse { + /// Information about the evaluation form completed for a specific contact. + final Evaluation evaluation; - /// The identifier of the flow that runs by default when a task is created by - /// referencing this template. - final String? contactFlowId; + /// Information about the evaluation form. + final EvaluationFormContent evaluationForm; - /// The timestamp when the task template was created. - final DateTime? createdTime; + DescribeContactEvaluationResponse({ + required this.evaluation, + required this.evaluationForm, + }); - /// The default values for fields when a task is created by referencing this - /// template. - final TaskTemplateDefaults? defaults; + factory DescribeContactEvaluationResponse.fromJson( + Map json) { + return DescribeContactEvaluationResponse( + evaluation: + Evaluation.fromJson(json['Evaluation'] as Map), + evaluationForm: EvaluationFormContent.fromJson( + json['EvaluationForm'] as Map), + ); + } - /// The description of the task template. - final String? description; + Map toJson() { + final evaluation = this.evaluation; + final evaluationForm = this.evaluationForm; + return { + 'Evaluation': evaluation, + 'EvaluationForm': evaluationForm, + }; + } +} - /// Fields that are part of the template. - final List? fields; +class DescribeContactFlowModuleResponse { + /// Information about the flow module. + final ContactFlowModule? contactFlowModule; - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - final String? instanceId; + DescribeContactFlowModuleResponse({ + this.contactFlowModule, + }); - /// The timestamp when the task template was last modified. - final DateTime? lastModifiedTime; + factory DescribeContactFlowModuleResponse.fromJson( + Map json) { + return DescribeContactFlowModuleResponse( + contactFlowModule: json['ContactFlowModule'] != null + ? ContactFlowModule.fromJson( + json['ContactFlowModule'] as Map) + : null, + ); + } - /// Marks a template as ACTIVE or INACTIVE for a task - /// to refer to it. Tasks can only be created from ACTIVE - /// templates. If a template is marked as INACTIVE, then a task - /// that refers to this template cannot be created. - final TaskTemplateStatus? status; + Map toJson() { + final contactFlowModule = this.contactFlowModule; + return { + if (contactFlowModule != null) 'ContactFlowModule': contactFlowModule, + }; + } +} - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; +class DescribeContactFlowResponse { + /// Information about the flow. + final ContactFlow? contactFlow; - GetTaskTemplateResponse({ - required this.arn, - required this.id, - required this.name, - this.constraints, - this.contactFlowId, - this.createdTime, - this.defaults, - this.description, - this.fields, - this.instanceId, - this.lastModifiedTime, - this.status, - this.tags, + DescribeContactFlowResponse({ + this.contactFlow, }); - factory GetTaskTemplateResponse.fromJson(Map json) { - return GetTaskTemplateResponse( - arn: json['Arn'] as String, - id: json['Id'] as String, - name: json['Name'] as String, - constraints: json['Constraints'] != null - ? TaskTemplateConstraints.fromJson( - json['Constraints'] as Map) - : null, - contactFlowId: json['ContactFlowId'] as String?, - createdTime: timeStampFromJson(json['CreatedTime']), - defaults: json['Defaults'] != null - ? TaskTemplateDefaults.fromJson( - json['Defaults'] as Map) + factory DescribeContactFlowResponse.fromJson(Map json) { + return DescribeContactFlowResponse( + contactFlow: json['ContactFlow'] != null + ? ContactFlow.fromJson(json['ContactFlow'] as Map) : null, - description: json['Description'] as String?, - fields: (json['Fields'] as List?) - ?.whereNotNull() - .map((e) => TaskTemplateField.fromJson(e as Map)) - .toList(), - instanceId: json['InstanceId'] as String?, - lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), - status: (json['Status'] as String?)?.toTaskTemplateStatus(), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; - final constraints = this.constraints; - final contactFlowId = this.contactFlowId; - final createdTime = this.createdTime; - final defaults = this.defaults; - final description = this.description; - final fields = this.fields; - final instanceId = this.instanceId; - final lastModifiedTime = this.lastModifiedTime; - final status = this.status; - final tags = this.tags; + final contactFlow = this.contactFlow; return { - 'Arn': arn, - 'Id': id, - 'Name': name, - if (constraints != null) 'Constraints': constraints, - if (contactFlowId != null) 'ContactFlowId': contactFlowId, - if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), - if (defaults != null) 'Defaults': defaults, - if (description != null) 'Description': description, - if (fields != null) 'Fields': fields, - if (instanceId != null) 'InstanceId': instanceId, - if (lastModifiedTime != null) - 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), - if (status != null) 'Status': status.toValue(), - if (tags != null) 'Tags': tags, + if (contactFlow != null) 'ContactFlow': contactFlow, }; } } -class GetTrafficDistributionResponse { - /// The Amazon Resource Name (ARN) of the traffic distribution group. - final String? arn; - - /// The identifier of the traffic distribution group. This can be the ID or the - /// ARN if the API is being called in the Region where the traffic distribution - /// group was created. The ARN must be provided if the call is from the - /// replicated Region. - final String? id; - - /// The distribution of traffic between the instance and its replicas. - final TelephonyConfig? telephonyConfig; +class DescribeContactResponse { + /// Information about the contact. + final Contact? contact; - GetTrafficDistributionResponse({ - this.arn, - this.id, - this.telephonyConfig, + DescribeContactResponse({ + this.contact, }); - factory GetTrafficDistributionResponse.fromJson(Map json) { - return GetTrafficDistributionResponse( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - telephonyConfig: json['TelephonyConfig'] != null - ? TelephonyConfig.fromJson( - json['TelephonyConfig'] as Map) + factory DescribeContactResponse.fromJson(Map json) { + return DescribeContactResponse( + contact: json['Contact'] != null + ? Contact.fromJson(json['Contact'] as Map) : null, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final telephonyConfig = this.telephonyConfig; + final contact = this.contact; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (telephonyConfig != null) 'TelephonyConfig': telephonyConfig, + if (contact != null) 'Contact': contact, }; } } -enum Grouping { - queue, - channel, - routingProfile, -} +class DescribeEvaluationFormResponse { + /// Information about the evaluation form. + final EvaluationForm evaluationForm; -extension GroupingValueExtension on Grouping { - String toValue() { - switch (this) { - case Grouping.queue: - return 'QUEUE'; - case Grouping.channel: - return 'CHANNEL'; - case Grouping.routingProfile: - return 'ROUTING_PROFILE'; - } + DescribeEvaluationFormResponse({ + required this.evaluationForm, + }); + + factory DescribeEvaluationFormResponse.fromJson(Map json) { + return DescribeEvaluationFormResponse( + evaluationForm: EvaluationForm.fromJson( + json['EvaluationForm'] as Map), + ); } -} -extension GroupingFromString on String { - Grouping toGrouping() { - switch (this) { - case 'QUEUE': - return Grouping.queue; - case 'CHANNEL': - return Grouping.channel; - case 'ROUTING_PROFILE': - return Grouping.routingProfile; - } - throw Exception('$this is not known in enum Grouping'); + Map toJson() { + final evaluationForm = this.evaluationForm; + return { + 'EvaluationForm': evaluationForm, + }; } } -/// Contains information about a hierarchy group. -class HierarchyGroup { - /// The Amazon Resource Name (ARN) of the hierarchy group. - final String? arn; - - /// Information about the levels in the hierarchy group. - final HierarchyPath? hierarchyPath; +class DescribeHoursOfOperationResponse { + /// The hours of operation. + final HoursOfOperation? hoursOfOperation; - /// The identifier of the hierarchy group. - final String? id; - - /// The identifier of the level in the hierarchy group. - final String? levelId; - - /// The name of the hierarchy group. - final String? name; - - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; - - HierarchyGroup({ - this.arn, - this.hierarchyPath, - this.id, - this.levelId, - this.name, - this.tags, + DescribeHoursOfOperationResponse({ + this.hoursOfOperation, }); - factory HierarchyGroup.fromJson(Map json) { - return HierarchyGroup( - arn: json['Arn'] as String?, - hierarchyPath: json['HierarchyPath'] != null - ? HierarchyPath.fromJson( - json['HierarchyPath'] as Map) + factory DescribeHoursOfOperationResponse.fromJson(Map json) { + return DescribeHoursOfOperationResponse( + hoursOfOperation: json['HoursOfOperation'] != null + ? HoursOfOperation.fromJson( + json['HoursOfOperation'] as Map) : null, - id: json['Id'] as String?, - levelId: json['LevelId'] as String?, - name: json['Name'] as String?, - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final arn = this.arn; - final hierarchyPath = this.hierarchyPath; - final id = this.id; - final levelId = this.levelId; - final name = this.name; - final tags = this.tags; + final hoursOfOperation = this.hoursOfOperation; return { - if (arn != null) 'Arn': arn, - if (hierarchyPath != null) 'HierarchyPath': hierarchyPath, - if (id != null) 'Id': id, - if (levelId != null) 'LevelId': levelId, - if (name != null) 'Name': name, - if (tags != null) 'Tags': tags, + if (hoursOfOperation != null) 'HoursOfOperation': hoursOfOperation, }; } } -/// A leaf node condition which can be used to specify a hierarchy group -/// condition. -class HierarchyGroupCondition { - /// The type of hierarchy group match. - final HierarchyGroupMatchType? hierarchyGroupMatchType; - - /// The value in the hierarchy group condition. - final String? value; +class DescribeInstanceAttributeResponse { + /// The type of attribute. + final Attribute? attribute; - HierarchyGroupCondition({ - this.hierarchyGroupMatchType, - this.value, + DescribeInstanceAttributeResponse({ + this.attribute, }); + factory DescribeInstanceAttributeResponse.fromJson( + Map json) { + return DescribeInstanceAttributeResponse( + attribute: json['Attribute'] != null + ? Attribute.fromJson(json['Attribute'] as Map) + : null, + ); + } + Map toJson() { - final hierarchyGroupMatchType = this.hierarchyGroupMatchType; - final value = this.value; + final attribute = this.attribute; return { - if (hierarchyGroupMatchType != null) - 'HierarchyGroupMatchType': hierarchyGroupMatchType.toValue(), - if (value != null) 'Value': value, + if (attribute != null) 'Attribute': attribute, }; } } -enum HierarchyGroupMatchType { - exact, - withChildGroups, -} +class DescribeInstanceResponse { + /// The name of the instance. + final Instance? instance; -extension HierarchyGroupMatchTypeValueExtension on HierarchyGroupMatchType { - String toValue() { - switch (this) { - case HierarchyGroupMatchType.exact: - return 'EXACT'; - case HierarchyGroupMatchType.withChildGroups: - return 'WITH_CHILD_GROUPS'; - } + DescribeInstanceResponse({ + this.instance, + }); + + factory DescribeInstanceResponse.fromJson(Map json) { + return DescribeInstanceResponse( + instance: json['Instance'] != null + ? Instance.fromJson(json['Instance'] as Map) + : null, + ); } -} -extension HierarchyGroupMatchTypeFromString on String { - HierarchyGroupMatchType toHierarchyGroupMatchType() { - switch (this) { - case 'EXACT': - return HierarchyGroupMatchType.exact; - case 'WITH_CHILD_GROUPS': - return HierarchyGroupMatchType.withChildGroups; - } - throw Exception('$this is not known in enum HierarchyGroupMatchType'); + Map toJson() { + final instance = this.instance; + return { + if (instance != null) 'Instance': instance, + }; } } -/// Contains summary information about a hierarchy group. -class HierarchyGroupSummary { - /// The Amazon Resource Name (ARN) of the hierarchy group. - final String? arn; - - /// The identifier of the hierarchy group. - final String? id; - - /// The name of the hierarchy group. - final String? name; +class DescribeInstanceStorageConfigResponse { + /// A valid storage type. + final InstanceStorageConfig? storageConfig; - HierarchyGroupSummary({ - this.arn, - this.id, - this.name, + DescribeInstanceStorageConfigResponse({ + this.storageConfig, }); - factory HierarchyGroupSummary.fromJson(Map json) { - return HierarchyGroupSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, + factory DescribeInstanceStorageConfigResponse.fromJson( + Map json) { + return DescribeInstanceStorageConfigResponse( + storageConfig: json['StorageConfig'] != null + ? InstanceStorageConfig.fromJson( + json['StorageConfig'] as Map) + : null, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; + final storageConfig = this.storageConfig; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, + if (storageConfig != null) 'StorageConfig': storageConfig, }; } } -/// Information about the hierarchy group. -class HierarchyGroupSummaryReference { - /// The Amazon Resource Name (ARN) for the hierarchy group. - final String? arn; - - /// The unique identifier for the hierarchy group. - final String? id; +class DescribePhoneNumberResponse { + /// Information about a phone number that's been claimed to your Amazon Connect + /// instance or traffic distribution group. + final ClaimedPhoneNumberSummary? claimedPhoneNumberSummary; - HierarchyGroupSummaryReference({ - this.arn, - this.id, + DescribePhoneNumberResponse({ + this.claimedPhoneNumberSummary, }); - factory HierarchyGroupSummaryReference.fromJson(Map json) { - return HierarchyGroupSummaryReference( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory DescribePhoneNumberResponse.fromJson(Map json) { + return DescribePhoneNumberResponse( + claimedPhoneNumberSummary: json['ClaimedPhoneNumberSummary'] != null + ? ClaimedPhoneNumberSummary.fromJson( + json['ClaimedPhoneNumberSummary'] as Map) + : null, ); } Map toJson() { - final arn = this.arn; - final id = this.id; + final claimedPhoneNumberSummary = this.claimedPhoneNumberSummary; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, + if (claimedPhoneNumberSummary != null) + 'ClaimedPhoneNumberSummary': claimedPhoneNumberSummary, }; } } -/// Contains information about a hierarchy level. -class HierarchyLevel { - /// The Amazon Resource Name (ARN) of the hierarchy level. - final String? arn; - - /// The identifier of the hierarchy level. - final String? id; - - /// The name of the hierarchy level. - final String? name; +class DescribePredefinedAttributeResponse { + /// Information about the predefined attribute. + final PredefinedAttribute? predefinedAttribute; - HierarchyLevel({ - this.arn, - this.id, - this.name, + DescribePredefinedAttributeResponse({ + this.predefinedAttribute, }); - factory HierarchyLevel.fromJson(Map json) { - return HierarchyLevel( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, + factory DescribePredefinedAttributeResponse.fromJson( + Map json) { + return DescribePredefinedAttributeResponse( + predefinedAttribute: json['PredefinedAttribute'] != null + ? PredefinedAttribute.fromJson( + json['PredefinedAttribute'] as Map) + : null, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; + final predefinedAttribute = this.predefinedAttribute; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, + if (predefinedAttribute != null) + 'PredefinedAttribute': predefinedAttribute, }; } } -/// Contains information about the hierarchy level to update. -class HierarchyLevelUpdate { - /// The name of the user hierarchy level. Must not be more than 50 characters. - final String name; +class DescribePromptResponse { + /// Information about the prompt. + final Prompt? prompt; - HierarchyLevelUpdate({ - required this.name, + DescribePromptResponse({ + this.prompt, }); + factory DescribePromptResponse.fromJson(Map json) { + return DescribePromptResponse( + prompt: json['Prompt'] != null + ? Prompt.fromJson(json['Prompt'] as Map) + : null, + ); + } + Map toJson() { - final name = this.name; + final prompt = this.prompt; return { - 'Name': name, + if (prompt != null) 'Prompt': prompt, }; } } -/// Contains information about the levels of a hierarchy group. -class HierarchyPath { - /// Information about level five. - final HierarchyGroupSummary? levelFive; +class DescribeQueueResponse { + /// The name of the queue. + final Queue? queue; - /// Information about level four. - final HierarchyGroupSummary? levelFour; + DescribeQueueResponse({ + this.queue, + }); - /// Information about level one. - final HierarchyGroupSummary? levelOne; + factory DescribeQueueResponse.fromJson(Map json) { + return DescribeQueueResponse( + queue: json['Queue'] != null + ? Queue.fromJson(json['Queue'] as Map) + : null, + ); + } - /// Information about level three. - final HierarchyGroupSummary? levelThree; + Map toJson() { + final queue = this.queue; + return { + if (queue != null) 'Queue': queue, + }; + } +} - /// Information about level two. - final HierarchyGroupSummary? levelTwo; +class DescribeQuickConnectResponse { + /// Information about the quick connect. + final QuickConnect? quickConnect; - HierarchyPath({ - this.levelFive, - this.levelFour, - this.levelOne, - this.levelThree, - this.levelTwo, + DescribeQuickConnectResponse({ + this.quickConnect, }); - factory HierarchyPath.fromJson(Map json) { - return HierarchyPath( - levelFive: json['LevelFive'] != null - ? HierarchyGroupSummary.fromJson( - json['LevelFive'] as Map) - : null, - levelFour: json['LevelFour'] != null - ? HierarchyGroupSummary.fromJson( - json['LevelFour'] as Map) - : null, - levelOne: json['LevelOne'] != null - ? HierarchyGroupSummary.fromJson( - json['LevelOne'] as Map) - : null, - levelThree: json['LevelThree'] != null - ? HierarchyGroupSummary.fromJson( - json['LevelThree'] as Map) - : null, - levelTwo: json['LevelTwo'] != null - ? HierarchyGroupSummary.fromJson( - json['LevelTwo'] as Map) + factory DescribeQuickConnectResponse.fromJson(Map json) { + return DescribeQuickConnectResponse( + quickConnect: json['QuickConnect'] != null + ? QuickConnect.fromJson(json['QuickConnect'] as Map) : null, ); } Map toJson() { - final levelFive = this.levelFive; - final levelFour = this.levelFour; - final levelOne = this.levelOne; - final levelThree = this.levelThree; - final levelTwo = this.levelTwo; + final quickConnect = this.quickConnect; return { - if (levelFive != null) 'LevelFive': levelFive, - if (levelFour != null) 'LevelFour': levelFour, - if (levelOne != null) 'LevelOne': levelOne, - if (levelThree != null) 'LevelThree': levelThree, - if (levelTwo != null) 'LevelTwo': levelTwo, + if (quickConnect != null) 'QuickConnect': quickConnect, }; } } -/// Information about the levels in the hierarchy group. -class HierarchyPathReference { - /// Information about level five. - final HierarchyGroupSummaryReference? levelFive; - - /// Information about level four. - final HierarchyGroupSummaryReference? levelFour; - - /// Information about level one. - final HierarchyGroupSummaryReference? levelOne; - - /// Information about level three. - final HierarchyGroupSummaryReference? levelThree; - - /// Information about level two. - final HierarchyGroupSummaryReference? levelTwo; +class DescribeRoutingProfileResponse { + /// The routing profile. + final RoutingProfile? routingProfile; - HierarchyPathReference({ - this.levelFive, - this.levelFour, - this.levelOne, - this.levelThree, - this.levelTwo, + DescribeRoutingProfileResponse({ + this.routingProfile, }); - factory HierarchyPathReference.fromJson(Map json) { - return HierarchyPathReference( - levelFive: json['LevelFive'] != null - ? HierarchyGroupSummaryReference.fromJson( - json['LevelFive'] as Map) - : null, - levelFour: json['LevelFour'] != null - ? HierarchyGroupSummaryReference.fromJson( - json['LevelFour'] as Map) - : null, - levelOne: json['LevelOne'] != null - ? HierarchyGroupSummaryReference.fromJson( - json['LevelOne'] as Map) - : null, - levelThree: json['LevelThree'] != null - ? HierarchyGroupSummaryReference.fromJson( - json['LevelThree'] as Map) - : null, - levelTwo: json['LevelTwo'] != null - ? HierarchyGroupSummaryReference.fromJson( - json['LevelTwo'] as Map) + factory DescribeRoutingProfileResponse.fromJson(Map json) { + return DescribeRoutingProfileResponse( + routingProfile: json['RoutingProfile'] != null + ? RoutingProfile.fromJson( + json['RoutingProfile'] as Map) : null, ); } Map toJson() { - final levelFive = this.levelFive; - final levelFour = this.levelFour; - final levelOne = this.levelOne; - final levelThree = this.levelThree; - final levelTwo = this.levelTwo; + final routingProfile = this.routingProfile; return { - if (levelFive != null) 'LevelFive': levelFive, - if (levelFour != null) 'LevelFour': levelFour, - if (levelOne != null) 'LevelOne': levelOne, - if (levelThree != null) 'LevelThree': levelThree, - if (levelTwo != null) 'LevelTwo': levelTwo, + if (routingProfile != null) 'RoutingProfile': routingProfile, }; } } -/// Contains information about a hierarchy structure. -class HierarchyStructure { - /// Information about level five. - final HierarchyLevel? levelFive; +class DescribeRuleResponse { + /// Information about the rule. + final Rule rule; - /// Information about level four. - final HierarchyLevel? levelFour; + DescribeRuleResponse({ + required this.rule, + }); - /// Information about level one. - final HierarchyLevel? levelOne; + factory DescribeRuleResponse.fromJson(Map json) { + return DescribeRuleResponse( + rule: Rule.fromJson(json['Rule'] as Map), + ); + } - /// Information about level three. - final HierarchyLevel? levelThree; + Map toJson() { + final rule = this.rule; + return { + 'Rule': rule, + }; + } +} - /// Information about level two. - final HierarchyLevel? levelTwo; +class DescribeSecurityProfileResponse { + /// The security profile. + final SecurityProfile? securityProfile; - HierarchyStructure({ - this.levelFive, - this.levelFour, - this.levelOne, - this.levelThree, - this.levelTwo, + DescribeSecurityProfileResponse({ + this.securityProfile, }); - factory HierarchyStructure.fromJson(Map json) { - return HierarchyStructure( - levelFive: json['LevelFive'] != null - ? HierarchyLevel.fromJson(json['LevelFive'] as Map) - : null, - levelFour: json['LevelFour'] != null - ? HierarchyLevel.fromJson(json['LevelFour'] as Map) - : null, - levelOne: json['LevelOne'] != null - ? HierarchyLevel.fromJson(json['LevelOne'] as Map) - : null, - levelThree: json['LevelThree'] != null - ? HierarchyLevel.fromJson(json['LevelThree'] as Map) - : null, - levelTwo: json['LevelTwo'] != null - ? HierarchyLevel.fromJson(json['LevelTwo'] as Map) + factory DescribeSecurityProfileResponse.fromJson(Map json) { + return DescribeSecurityProfileResponse( + securityProfile: json['SecurityProfile'] != null + ? SecurityProfile.fromJson( + json['SecurityProfile'] as Map) : null, ); } Map toJson() { - final levelFive = this.levelFive; - final levelFour = this.levelFour; - final levelOne = this.levelOne; - final levelThree = this.levelThree; - final levelTwo = this.levelTwo; + final securityProfile = this.securityProfile; return { - if (levelFive != null) 'LevelFive': levelFive, - if (levelFour != null) 'LevelFour': levelFour, - if (levelOne != null) 'LevelOne': levelOne, - if (levelThree != null) 'LevelThree': levelThree, - if (levelTwo != null) 'LevelTwo': levelTwo, + if (securityProfile != null) 'SecurityProfile': securityProfile, }; } } -/// Contains information about the level hierarchy to update. -class HierarchyStructureUpdate { - /// The update for level five. - final HierarchyLevelUpdate? levelFive; +class DescribeTrafficDistributionGroupResponse { + /// Information about the traffic distribution group. + final TrafficDistributionGroup? trafficDistributionGroup; - /// The update for level four. - final HierarchyLevelUpdate? levelFour; + DescribeTrafficDistributionGroupResponse({ + this.trafficDistributionGroup, + }); - /// The update for level one. - final HierarchyLevelUpdate? levelOne; + factory DescribeTrafficDistributionGroupResponse.fromJson( + Map json) { + return DescribeTrafficDistributionGroupResponse( + trafficDistributionGroup: json['TrafficDistributionGroup'] != null + ? TrafficDistributionGroup.fromJson( + json['TrafficDistributionGroup'] as Map) + : null, + ); + } - /// The update for level three. - final HierarchyLevelUpdate? levelThree; + Map toJson() { + final trafficDistributionGroup = this.trafficDistributionGroup; + return { + if (trafficDistributionGroup != null) + 'TrafficDistributionGroup': trafficDistributionGroup, + }; + } +} - /// The update for level two. - final HierarchyLevelUpdate? levelTwo; +class DescribeUserHierarchyGroupResponse { + /// Information about the hierarchy group. + final HierarchyGroup? hierarchyGroup; - HierarchyStructureUpdate({ - this.levelFive, - this.levelFour, - this.levelOne, - this.levelThree, - this.levelTwo, + DescribeUserHierarchyGroupResponse({ + this.hierarchyGroup, }); - Map toJson() { - final levelFive = this.levelFive; - final levelFour = this.levelFour; - final levelOne = this.levelOne; - final levelThree = this.levelThree; - final levelTwo = this.levelTwo; + factory DescribeUserHierarchyGroupResponse.fromJson( + Map json) { + return DescribeUserHierarchyGroupResponse( + hierarchyGroup: json['HierarchyGroup'] != null + ? HierarchyGroup.fromJson( + json['HierarchyGroup'] as Map) + : null, + ); + } + + Map toJson() { + final hierarchyGroup = this.hierarchyGroup; return { - if (levelFive != null) 'LevelFive': levelFive, - if (levelFour != null) 'LevelFour': levelFour, - if (levelOne != null) 'LevelOne': levelOne, - if (levelThree != null) 'LevelThree': levelThree, - if (levelTwo != null) 'LevelTwo': levelTwo, + if (hierarchyGroup != null) 'HierarchyGroup': hierarchyGroup, }; } } -/// Contains information about a historical metric. For a description of each -/// metric, see Historical -/// Metrics Definitions in the Amazon Connect Administrator Guide. -class HistoricalMetric { - /// The name of the metric. - final HistoricalMetricName? name; +class DescribeUserHierarchyStructureResponse { + /// Information about the hierarchy structure. + final HierarchyStructure? hierarchyStructure; - /// The statistic for the metric. - final Statistic? statistic; + DescribeUserHierarchyStructureResponse({ + this.hierarchyStructure, + }); - /// The threshold for the metric, used with service level metrics. - final Threshold? threshold; + factory DescribeUserHierarchyStructureResponse.fromJson( + Map json) { + return DescribeUserHierarchyStructureResponse( + hierarchyStructure: json['HierarchyStructure'] != null + ? HierarchyStructure.fromJson( + json['HierarchyStructure'] as Map) + : null, + ); + } - /// The unit for the metric. - final Unit? unit; + Map toJson() { + final hierarchyStructure = this.hierarchyStructure; + return { + if (hierarchyStructure != null) 'HierarchyStructure': hierarchyStructure, + }; + } +} - HistoricalMetric({ - this.name, - this.statistic, - this.threshold, - this.unit, +class DescribeUserResponse { + /// Information about the user account and configuration settings. + final User? user; + + DescribeUserResponse({ + this.user, }); - factory HistoricalMetric.fromJson(Map json) { - return HistoricalMetric( - name: (json['Name'] as String?)?.toHistoricalMetricName(), - statistic: (json['Statistic'] as String?)?.toStatistic(), - threshold: json['Threshold'] != null - ? Threshold.fromJson(json['Threshold'] as Map) + factory DescribeUserResponse.fromJson(Map json) { + return DescribeUserResponse( + user: json['User'] != null + ? User.fromJson(json['User'] as Map) : null, - unit: (json['Unit'] as String?)?.toUnit(), ); } Map toJson() { - final name = this.name; - final statistic = this.statistic; - final threshold = this.threshold; - final unit = this.unit; + final user = this.user; return { - if (name != null) 'Name': name.toValue(), - if (statistic != null) 'Statistic': statistic.toValue(), - if (threshold != null) 'Threshold': threshold, - if (unit != null) 'Unit': unit.toValue(), + if (user != null) 'User': user, }; } } -/// Contains the data for a historical metric. -class HistoricalMetricData { - /// Information about the metric. - final HistoricalMetric? metric; +class DescribeViewResponse { + /// All view data is contained within the View object. + final View? view; - /// The value of the metric. - final double? value; - - HistoricalMetricData({ - this.metric, - this.value, + DescribeViewResponse({ + this.view, }); - factory HistoricalMetricData.fromJson(Map json) { - return HistoricalMetricData( - metric: json['Metric'] != null - ? HistoricalMetric.fromJson(json['Metric'] as Map) + factory DescribeViewResponse.fromJson(Map json) { + return DescribeViewResponse( + view: json['View'] != null + ? View.fromJson(json['View'] as Map) : null, - value: json['Value'] as double?, ); } Map toJson() { - final metric = this.metric; - final value = this.value; + final view = this.view; return { - if (metric != null) 'Metric': metric, - if (value != null) 'Value': value, + if (view != null) 'View': view, }; } } -/// The historical metric names. -enum HistoricalMetricName { - contactsQueued, - contactsHandled, - contactsAbandoned, - contactsConsulted, - contactsAgentHungUpFirst, - contactsHandledIncoming, - contactsHandledOutbound, - contactsHoldAbandons, - contactsTransferredIn, - contactsTransferredOut, - contactsTransferredInFromQueue, - contactsTransferredOutFromQueue, - contactsMissed, - callbackContactsHandled, - apiContactsHandled, - occupancy, - handleTime, - afterContactWorkTime, - queuedTime, - abandonTime, - queueAnswerTime, - holdTime, - interactionTime, - interactionAndHoldTime, - serviceLevel, +class DescribeVocabularyResponse { + /// A list of specific words that you want Contact Lens for Amazon Connect to + /// recognize in your audio input. They are generally domain-specific words and + /// phrases, words that Contact Lens is not recognizing, or proper nouns. + final Vocabulary vocabulary; + + DescribeVocabularyResponse({ + required this.vocabulary, + }); + + factory DescribeVocabularyResponse.fromJson(Map json) { + return DescribeVocabularyResponse( + vocabulary: + Vocabulary.fromJson(json['Vocabulary'] as Map), + ); + } + + Map toJson() { + final vocabulary = this.vocabulary; + return { + 'Vocabulary': vocabulary, + }; + } } -extension HistoricalMetricNameValueExtension on HistoricalMetricName { - String toValue() { - switch (this) { - case HistoricalMetricName.contactsQueued: - return 'CONTACTS_QUEUED'; - case HistoricalMetricName.contactsHandled: - return 'CONTACTS_HANDLED'; - case HistoricalMetricName.contactsAbandoned: - return 'CONTACTS_ABANDONED'; - case HistoricalMetricName.contactsConsulted: - return 'CONTACTS_CONSULTED'; - case HistoricalMetricName.contactsAgentHungUpFirst: - return 'CONTACTS_AGENT_HUNG_UP_FIRST'; - case HistoricalMetricName.contactsHandledIncoming: - return 'CONTACTS_HANDLED_INCOMING'; - case HistoricalMetricName.contactsHandledOutbound: - return 'CONTACTS_HANDLED_OUTBOUND'; - case HistoricalMetricName.contactsHoldAbandons: - return 'CONTACTS_HOLD_ABANDONS'; - case HistoricalMetricName.contactsTransferredIn: - return 'CONTACTS_TRANSFERRED_IN'; - case HistoricalMetricName.contactsTransferredOut: - return 'CONTACTS_TRANSFERRED_OUT'; - case HistoricalMetricName.contactsTransferredInFromQueue: - return 'CONTACTS_TRANSFERRED_IN_FROM_QUEUE'; - case HistoricalMetricName.contactsTransferredOutFromQueue: - return 'CONTACTS_TRANSFERRED_OUT_FROM_QUEUE'; - case HistoricalMetricName.contactsMissed: - return 'CONTACTS_MISSED'; - case HistoricalMetricName.callbackContactsHandled: - return 'CALLBACK_CONTACTS_HANDLED'; - case HistoricalMetricName.apiContactsHandled: - return 'API_CONTACTS_HANDLED'; - case HistoricalMetricName.occupancy: - return 'OCCUPANCY'; - case HistoricalMetricName.handleTime: - return 'HANDLE_TIME'; - case HistoricalMetricName.afterContactWorkTime: - return 'AFTER_CONTACT_WORK_TIME'; - case HistoricalMetricName.queuedTime: - return 'QUEUED_TIME'; - case HistoricalMetricName.abandonTime: - return 'ABANDON_TIME'; - case HistoricalMetricName.queueAnswerTime: - return 'QUEUE_ANSWER_TIME'; - case HistoricalMetricName.holdTime: - return 'HOLD_TIME'; - case HistoricalMetricName.interactionTime: - return 'INTERACTION_TIME'; - case HistoricalMetricName.interactionAndHoldTime: - return 'INTERACTION_AND_HOLD_TIME'; - case HistoricalMetricName.serviceLevel: - return 'SERVICE_LEVEL'; - } +/// Information regarding the device. +class DeviceInfo { + /// Operating system that the participant used for the call. + final String? operatingSystem; + + /// Name of the platform that the participant used for the call. + final String? platformName; + + /// Version of the platform that the participant used for the call. + final String? platformVersion; + + DeviceInfo({ + this.operatingSystem, + this.platformName, + this.platformVersion, + }); + + factory DeviceInfo.fromJson(Map json) { + return DeviceInfo( + operatingSystem: json['OperatingSystem'] as String?, + platformName: json['PlatformName'] as String?, + platformVersion: json['PlatformVersion'] as String?, + ); + } + + Map toJson() { + final operatingSystem = this.operatingSystem; + final platformName = this.platformName; + final platformVersion = this.platformVersion; + return { + if (operatingSystem != null) 'OperatingSystem': operatingSystem, + if (platformName != null) 'PlatformName': platformName, + if (platformVersion != null) 'PlatformVersion': platformVersion, + }; } } -extension HistoricalMetricNameFromString on String { - HistoricalMetricName toHistoricalMetricName() { - switch (this) { - case 'CONTACTS_QUEUED': - return HistoricalMetricName.contactsQueued; - case 'CONTACTS_HANDLED': - return HistoricalMetricName.contactsHandled; - case 'CONTACTS_ABANDONED': - return HistoricalMetricName.contactsAbandoned; - case 'CONTACTS_CONSULTED': - return HistoricalMetricName.contactsConsulted; - case 'CONTACTS_AGENT_HUNG_UP_FIRST': - return HistoricalMetricName.contactsAgentHungUpFirst; - case 'CONTACTS_HANDLED_INCOMING': - return HistoricalMetricName.contactsHandledIncoming; - case 'CONTACTS_HANDLED_OUTBOUND': - return HistoricalMetricName.contactsHandledOutbound; - case 'CONTACTS_HOLD_ABANDONS': - return HistoricalMetricName.contactsHoldAbandons; - case 'CONTACTS_TRANSFERRED_IN': - return HistoricalMetricName.contactsTransferredIn; - case 'CONTACTS_TRANSFERRED_OUT': - return HistoricalMetricName.contactsTransferredOut; - case 'CONTACTS_TRANSFERRED_IN_FROM_QUEUE': - return HistoricalMetricName.contactsTransferredInFromQueue; - case 'CONTACTS_TRANSFERRED_OUT_FROM_QUEUE': - return HistoricalMetricName.contactsTransferredOutFromQueue; - case 'CONTACTS_MISSED': - return HistoricalMetricName.contactsMissed; - case 'CALLBACK_CONTACTS_HANDLED': - return HistoricalMetricName.callbackContactsHandled; - case 'API_CONTACTS_HANDLED': - return HistoricalMetricName.apiContactsHandled; - case 'OCCUPANCY': - return HistoricalMetricName.occupancy; - case 'HANDLE_TIME': - return HistoricalMetricName.handleTime; - case 'AFTER_CONTACT_WORK_TIME': - return HistoricalMetricName.afterContactWorkTime; - case 'QUEUED_TIME': - return HistoricalMetricName.queuedTime; - case 'ABANDON_TIME': - return HistoricalMetricName.abandonTime; - case 'QUEUE_ANSWER_TIME': - return HistoricalMetricName.queueAnswerTime; - case 'HOLD_TIME': - return HistoricalMetricName.holdTime; - case 'INTERACTION_TIME': - return HistoricalMetricName.interactionTime; - case 'INTERACTION_AND_HOLD_TIME': - return HistoricalMetricName.interactionAndHoldTime; - case 'SERVICE_LEVEL': - return HistoricalMetricName.serviceLevel; - } - throw Exception('$this is not known in enum HistoricalMetricName'); - } -} +/// Contains information about the dimensions for a set of metrics. +class Dimensions { + /// The channel used for grouping and filters. + final Channel? channel; -/// Contains information about the historical metrics retrieved. -class HistoricalMetricResult { - /// The set of metrics. - final List? collections; + /// Information about the queue for which metrics are returned. + final QueueReference? queue; + final RoutingProfileReference? routingProfile; - /// The dimension for the metrics. - final Dimensions? dimensions; + /// The expression of a step in a routing criteria. + final String? routingStepExpression; - HistoricalMetricResult({ - this.collections, - this.dimensions, + Dimensions({ + this.channel, + this.queue, + this.routingProfile, + this.routingStepExpression, }); - factory HistoricalMetricResult.fromJson(Map json) { - return HistoricalMetricResult( - collections: (json['Collections'] as List?) - ?.whereNotNull() - .map((e) => HistoricalMetricData.fromJson(e as Map)) - .toList(), - dimensions: json['Dimensions'] != null - ? Dimensions.fromJson(json['Dimensions'] as Map) + factory Dimensions.fromJson(Map json) { + return Dimensions( + channel: (json['Channel'] as String?)?.toChannel(), + queue: json['Queue'] != null + ? QueueReference.fromJson(json['Queue'] as Map) : null, + routingProfile: json['RoutingProfile'] != null + ? RoutingProfileReference.fromJson( + json['RoutingProfile'] as Map) + : null, + routingStepExpression: json['RoutingStepExpression'] as String?, ); } Map toJson() { - final collections = this.collections; - final dimensions = this.dimensions; + final channel = this.channel; + final queue = this.queue; + final routingProfile = this.routingProfile; + final routingStepExpression = this.routingStepExpression; return { - if (collections != null) 'Collections': collections, - if (dimensions != null) 'Dimensions': dimensions, + if (channel != null) 'Channel': channel.toValue(), + if (queue != null) 'Queue': queue, + if (routingProfile != null) 'RoutingProfile': routingProfile, + if (routingStepExpression != null) + 'RoutingStepExpression': routingStepExpression, }; } } -/// Information about of the hours of operation. -class HoursOfOperation { - /// Configuration information for the hours of operation. - final List? config; +enum DirectoryType { + saml, + connectManaged, + existingDirectory, +} - /// The description for the hours of operation. - final String? description; +extension DirectoryTypeValueExtension on DirectoryType { + String toValue() { + switch (this) { + case DirectoryType.saml: + return 'SAML'; + case DirectoryType.connectManaged: + return 'CONNECT_MANAGED'; + case DirectoryType.existingDirectory: + return 'EXISTING_DIRECTORY'; + } + } +} - /// The Amazon Resource Name (ARN) for the hours of operation. - final String? hoursOfOperationArn; +extension DirectoryTypeFromString on String { + DirectoryType toDirectoryType() { + switch (this) { + case 'SAML': + return DirectoryType.saml; + case 'CONNECT_MANAGED': + return DirectoryType.connectManaged; + case 'EXISTING_DIRECTORY': + return DirectoryType.existingDirectory; + } + throw Exception('$this is not known in enum DirectoryType'); + } +} - /// The identifier for the hours of operation. - final String? hoursOfOperationId; +class DisassociateFlowResponse { + DisassociateFlowResponse(); - /// The name for the hours of operation. - final String? name; + factory DisassociateFlowResponse.fromJson(Map _) { + return DisassociateFlowResponse(); + } - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; + Map toJson() { + return {}; + } +} - /// The time zone for the hours of operation. - final String? timeZone; +class DisassociateTrafficDistributionGroupUserResponse { + DisassociateTrafficDistributionGroupUserResponse(); - HoursOfOperation({ - this.config, - this.description, - this.hoursOfOperationArn, - this.hoursOfOperationId, - this.name, - this.tags, - this.timeZone, + factory DisassociateTrafficDistributionGroupUserResponse.fromJson( + Map _) { + return DisassociateTrafficDistributionGroupUserResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Information about the call disconnect experience. +class DisconnectDetails { + /// Indicates the potential disconnection issues for a call. This field is not + /// populated if the service does not detect potential issues. + final String? potentialDisconnectIssue; + + DisconnectDetails({ + this.potentialDisconnectIssue, }); - factory HoursOfOperation.fromJson(Map json) { - return HoursOfOperation( - config: (json['Config'] as List?) - ?.whereNotNull() - .map( - (e) => HoursOfOperationConfig.fromJson(e as Map)) - .toList(), - description: json['Description'] as String?, - hoursOfOperationArn: json['HoursOfOperationArn'] as String?, - hoursOfOperationId: json['HoursOfOperationId'] as String?, - name: json['Name'] as String?, - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), - timeZone: json['TimeZone'] as String?, + factory DisconnectDetails.fromJson(Map json) { + return DisconnectDetails( + potentialDisconnectIssue: json['PotentialDisconnectIssue'] as String?, ); } Map toJson() { - final config = this.config; - final description = this.description; - final hoursOfOperationArn = this.hoursOfOperationArn; - final hoursOfOperationId = this.hoursOfOperationId; - final name = this.name; - final tags = this.tags; - final timeZone = this.timeZone; + final potentialDisconnectIssue = this.potentialDisconnectIssue; return { - if (config != null) 'Config': config, - if (description != null) 'Description': description, - if (hoursOfOperationArn != null) - 'HoursOfOperationArn': hoursOfOperationArn, - if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, - if (name != null) 'Name': name, - if (tags != null) 'Tags': tags, - if (timeZone != null) 'TimeZone': timeZone, + if (potentialDisconnectIssue != null) + 'PotentialDisconnectIssue': potentialDisconnectIssue, }; } } -/// Contains information about the hours of operation. -class HoursOfOperationConfig { - /// The day that the hours of operation applies to. - final HoursOfOperationDays day; +/// Contains details about why a contact was disconnected. Only Amazon Connect +/// outbound campaigns can provide this field. +class DisconnectReason { + /// A code that indicates how the contact was terminated. + final String? code; - /// The end time that your contact center closes. - final HoursOfOperationTimeSlice endTime; + DisconnectReason({ + this.code, + }); - /// The start time that your contact center opens. - final HoursOfOperationTimeSlice startTime; + Map toJson() { + final code = this.code; + return { + if (code != null) 'Code': code, + }; + } +} - HoursOfOperationConfig({ - required this.day, - required this.endTime, - required this.startTime, +class DismissUserContactResponse { + DismissUserContactResponse(); + + factory DismissUserContactResponse.fromJson(Map _) { + return DismissUserContactResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Information about a traffic distribution. +class Distribution { + /// The percentage of the traffic that is distributed, in increments of 10. + final int percentage; + + /// The Amazon Web Services Region where the traffic is distributed. + final String region; + + Distribution({ + required this.percentage, + required this.region, }); - factory HoursOfOperationConfig.fromJson(Map json) { - return HoursOfOperationConfig( - day: (json['Day'] as String).toHoursOfOperationDays(), - endTime: HoursOfOperationTimeSlice.fromJson( - json['EndTime'] as Map), - startTime: HoursOfOperationTimeSlice.fromJson( - json['StartTime'] as Map), + factory Distribution.fromJson(Map json) { + return Distribution( + percentage: json['Percentage'] as int, + region: json['Region'] as String, ); } Map toJson() { - final day = this.day; - final endTime = this.endTime; - final startTime = this.startTime; + final percentage = this.percentage; + final region = this.region; return { - 'Day': day.toValue(), - 'EndTime': endTime, - 'StartTime': startTime, + 'Percentage': percentage, + 'Region': region, }; } } -enum HoursOfOperationDays { - sunday, - monday, - tuesday, - wednesday, - thursday, - friday, - saturday, +/// Metadata used to download the attached file. +class DownloadUrlMetadata { + /// A pre-signed URL that should be used to download the attached file. + final String? url; + + /// The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 + /// format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. + final String? urlExpiry; + + DownloadUrlMetadata({ + this.url, + this.urlExpiry, + }); + + factory DownloadUrlMetadata.fromJson(Map json) { + return DownloadUrlMetadata( + url: json['Url'] as String?, + urlExpiry: json['UrlExpiry'] as String?, + ); + } + + Map toJson() { + final url = this.url; + final urlExpiry = this.urlExpiry; + return { + if (url != null) 'Url': url, + if (urlExpiry != null) 'UrlExpiry': urlExpiry, + }; + } } -extension HoursOfOperationDaysValueExtension on HoursOfOperationDays { - String toValue() { - switch (this) { - case HoursOfOperationDays.sunday: - return 'SUNDAY'; - case HoursOfOperationDays.monday: - return 'MONDAY'; - case HoursOfOperationDays.tuesday: - return 'TUESDAY'; - case HoursOfOperationDays.wednesday: - return 'WEDNESDAY'; - case HoursOfOperationDays.thursday: - return 'THURSDAY'; - case HoursOfOperationDays.friday: - return 'FRIDAY'; - case HoursOfOperationDays.saturday: - return 'SATURDAY'; - } - } -} - -extension HoursOfOperationDaysFromString on String { - HoursOfOperationDays toHoursOfOperationDays() { - switch (this) { - case 'SUNDAY': - return HoursOfOperationDays.sunday; - case 'MONDAY': - return HoursOfOperationDays.monday; - case 'TUESDAY': - return HoursOfOperationDays.tuesday; - case 'WEDNESDAY': - return HoursOfOperationDays.wednesday; - case 'THURSDAY': - return HoursOfOperationDays.thursday; - case 'FRIDAY': - return HoursOfOperationDays.friday; - case 'SATURDAY': - return HoursOfOperationDays.saturday; - } - throw Exception('$this is not known in enum HoursOfOperationDays'); - } -} - -/// Contains summary information about hours of operation for a contact center. -class HoursOfOperationSummary { - /// The Amazon Resource Name (ARN) of the hours of operation. - final String? arn; - - /// The identifier of the hours of operation. - final String? id; - - /// The name of the hours of operation. +/// Information about a reference when the referenceType is +/// EMAIL. Otherwise, null. +class EmailReference { + /// Identifier of the email reference. final String? name; - HoursOfOperationSummary({ - this.arn, - this.id, + /// A valid email address. + final String? value; + + EmailReference({ this.name, + this.value, }); - factory HoursOfOperationSummary.fromJson(Map json) { - return HoursOfOperationSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory EmailReference.fromJson(Map json) { + return EmailReference( name: json['Name'] as String?, + value: json['Value'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; final name = this.name; + final value = this.value; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, if (name != null) 'Name': name, + if (value != null) 'Value': value, }; } } -/// The start time or end time for an hours of operation. -class HoursOfOperationTimeSlice { - /// The hours. - final int hours; +/// An empty value. +class EmptyFieldValue { + EmptyFieldValue(); - /// The minutes. - final int minutes; + factory EmptyFieldValue.fromJson(Map _) { + return EmptyFieldValue(); + } - HoursOfOperationTimeSlice({ - required this.hours, - required this.minutes, + Map toJson() { + return {}; + } +} + +/// The encryption configuration. +class EncryptionConfig { + /// The type of encryption. + final EncryptionType encryptionType; + + /// The full ARN of the encryption key. + /// + /// Be sure to provide the full ARN of the encryption key, not just the ID. + /// + /// Amazon Connect supports only KMS keys with the default key spec of + /// SYMMETRIC_DEFAULT . + /// + final String keyId; + + EncryptionConfig({ + required this.encryptionType, + required this.keyId, }); - factory HoursOfOperationTimeSlice.fromJson(Map json) { - return HoursOfOperationTimeSlice( - hours: json['Hours'] as int, - minutes: json['Minutes'] as int, + factory EncryptionConfig.fromJson(Map json) { + return EncryptionConfig( + encryptionType: (json['EncryptionType'] as String).toEncryptionType(), + keyId: json['KeyId'] as String, ); } Map toJson() { - final hours = this.hours; - final minutes = this.minutes; + final encryptionType = this.encryptionType; + final keyId = this.keyId; return { - 'Hours': hours, - 'Minutes': minutes, + 'EncryptionType': encryptionType.toValue(), + 'KeyId': keyId, }; } } -/// The Amazon Connect instance. -class Instance { - /// The Amazon Resource Name (ARN) of the instance. - final String? arn; +enum EncryptionType { + kms, +} - /// When the instance was created. - final DateTime? createdTime; +extension EncryptionTypeValueExtension on EncryptionType { + String toValue() { + switch (this) { + case EncryptionType.kms: + return 'KMS'; + } + } +} - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - final String? id; +extension EncryptionTypeFromString on String { + EncryptionType toEncryptionType() { + switch (this) { + case 'KMS': + return EncryptionType.kms; + } + throw Exception('$this is not known in enum EncryptionType'); + } +} - /// The identity management type. - final DirectoryType? identityManagementType; +/// End associated tasks related to a case. +class EndAssociatedTasksActionDefinition { + EndAssociatedTasksActionDefinition(); - /// Whether inbound calls are enabled. - final bool? inboundCallsEnabled; + factory EndAssociatedTasksActionDefinition.fromJson(Map _) { + return EndAssociatedTasksActionDefinition(); + } - /// The alias of instance. - final String? instanceAlias; + Map toJson() { + return {}; + } +} - /// The state of the instance. - final InstanceStatus? instanceStatus; +/// Information about the endpoint. +class Endpoint { + /// Address of the endpoint. + final String? address; - /// Whether outbound calls are enabled. - final bool? outboundCallsEnabled; + /// Type of the endpoint. + final EndpointType? type; - /// The service role of the instance. - final String? serviceRole; + Endpoint({ + this.address, + this.type, + }); - /// Relevant details why the instance was not successfully created. - final InstanceStatusReason? statusReason; + Map toJson() { + final address = this.address; + final type = this.type; + return { + if (address != null) 'Address': address, + if (type != null) 'Type': type.toValue(), + }; + } +} - Instance({ - this.arn, - this.createdTime, - this.id, - this.identityManagementType, - this.inboundCallsEnabled, - this.instanceAlias, - this.instanceStatus, - this.outboundCallsEnabled, - this.serviceRole, - this.statusReason, +enum EndpointType { + telephoneNumber, + voip, + contactFlow, +} + +extension EndpointTypeValueExtension on EndpointType { + String toValue() { + switch (this) { + case EndpointType.telephoneNumber: + return 'TELEPHONE_NUMBER'; + case EndpointType.voip: + return 'VOIP'; + case EndpointType.contactFlow: + return 'CONTACT_FLOW'; + } + } +} + +extension EndpointTypeFromString on String { + EndpointType toEndpointType() { + switch (this) { + case 'TELEPHONE_NUMBER': + return EndpointType.telephoneNumber; + case 'VOIP': + return EndpointType.voip; + case 'CONTACT_FLOW': + return EndpointType.contactFlow; + } + throw Exception('$this is not known in enum EndpointType'); + } +} + +/// This API is in preview release for Amazon Connect and is subject to change. +/// +/// List of errors for dataset association failures. +class ErrorResult { + /// The error code. + final String? errorCode; + + /// The corresponding error message for the error code. + final String? errorMessage; + + ErrorResult({ + this.errorCode, + this.errorMessage, }); - factory Instance.fromJson(Map json) { - return Instance( - arn: json['Arn'] as String?, - createdTime: timeStampFromJson(json['CreatedTime']), - id: json['Id'] as String?, - identityManagementType: - (json['IdentityManagementType'] as String?)?.toDirectoryType(), - inboundCallsEnabled: json['InboundCallsEnabled'] as bool?, - instanceAlias: json['InstanceAlias'] as String?, - instanceStatus: (json['InstanceStatus'] as String?)?.toInstanceStatus(), - outboundCallsEnabled: json['OutboundCallsEnabled'] as bool?, - serviceRole: json['ServiceRole'] as String?, - statusReason: json['StatusReason'] != null - ? InstanceStatusReason.fromJson( - json['StatusReason'] as Map) - : null, + factory ErrorResult.fromJson(Map json) { + return ErrorResult( + errorCode: json['ErrorCode'] as String?, + errorMessage: json['ErrorMessage'] as String?, ); } Map toJson() { - final arn = this.arn; - final createdTime = this.createdTime; - final id = this.id; - final identityManagementType = this.identityManagementType; - final inboundCallsEnabled = this.inboundCallsEnabled; - final instanceAlias = this.instanceAlias; - final instanceStatus = this.instanceStatus; - final outboundCallsEnabled = this.outboundCallsEnabled; - final serviceRole = this.serviceRole; - final statusReason = this.statusReason; + final errorCode = this.errorCode; + final errorMessage = this.errorMessage; return { - if (arn != null) 'Arn': arn, - if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), - if (id != null) 'Id': id, - if (identityManagementType != null) - 'IdentityManagementType': identityManagementType.toValue(), - if (inboundCallsEnabled != null) - 'InboundCallsEnabled': inboundCallsEnabled, - if (instanceAlias != null) 'InstanceAlias': instanceAlias, - if (instanceStatus != null) 'InstanceStatus': instanceStatus.toValue(), - if (outboundCallsEnabled != null) - 'OutboundCallsEnabled': outboundCallsEnabled, - if (serviceRole != null) 'ServiceRole': serviceRole, - if (statusReason != null) 'StatusReason': statusReason, + if (errorCode != null) 'ErrorCode': errorCode, + if (errorMessage != null) 'ErrorMessage': errorMessage, }; } } -enum InstanceAttributeType { - inboundCalls, - outboundCalls, - contactflowLogs, - contactLens, - autoResolveBestVoices, - useCustomTtsVoices, - earlyMedia, - multiPartyConference, - highVolumeOutbound, - enhancedContactMonitoring, -} +/// Information about a contact evaluation. +class Evaluation { + /// A map of question identifiers to answer value. + final Map answers; -extension InstanceAttributeTypeValueExtension on InstanceAttributeType { - String toValue() { - switch (this) { - case InstanceAttributeType.inboundCalls: - return 'INBOUND_CALLS'; - case InstanceAttributeType.outboundCalls: - return 'OUTBOUND_CALLS'; - case InstanceAttributeType.contactflowLogs: - return 'CONTACTFLOW_LOGS'; - case InstanceAttributeType.contactLens: - return 'CONTACT_LENS'; - case InstanceAttributeType.autoResolveBestVoices: - return 'AUTO_RESOLVE_BEST_VOICES'; - case InstanceAttributeType.useCustomTtsVoices: - return 'USE_CUSTOM_TTS_VOICES'; - case InstanceAttributeType.earlyMedia: - return 'EARLY_MEDIA'; - case InstanceAttributeType.multiPartyConference: - return 'MULTI_PARTY_CONFERENCE'; - case InstanceAttributeType.highVolumeOutbound: - return 'HIGH_VOLUME_OUTBOUND'; - case InstanceAttributeType.enhancedContactMonitoring: - return 'ENHANCED_CONTACT_MONITORING'; - } - } -} + /// The timestamp for when the evaluation was created. + final DateTime createdTime; -extension InstanceAttributeTypeFromString on String { - InstanceAttributeType toInstanceAttributeType() { - switch (this) { - case 'INBOUND_CALLS': - return InstanceAttributeType.inboundCalls; - case 'OUTBOUND_CALLS': - return InstanceAttributeType.outboundCalls; - case 'CONTACTFLOW_LOGS': - return InstanceAttributeType.contactflowLogs; - case 'CONTACT_LENS': - return InstanceAttributeType.contactLens; - case 'AUTO_RESOLVE_BEST_VOICES': - return InstanceAttributeType.autoResolveBestVoices; - case 'USE_CUSTOM_TTS_VOICES': - return InstanceAttributeType.useCustomTtsVoices; - case 'EARLY_MEDIA': - return InstanceAttributeType.earlyMedia; - case 'MULTI_PARTY_CONFERENCE': - return InstanceAttributeType.multiPartyConference; - case 'HIGH_VOLUME_OUTBOUND': - return InstanceAttributeType.highVolumeOutbound; - case 'ENHANCED_CONTACT_MONITORING': - return InstanceAttributeType.enhancedContactMonitoring; - } - throw Exception('$this is not known in enum InstanceAttributeType'); - } -} + /// The Amazon Resource Name (ARN) for the contact evaluation resource. + final String evaluationArn; -enum InstanceStatus { - creationInProgress, - active, - creationFailed, -} + /// A unique identifier for the contact evaluation. + final String evaluationId; -extension InstanceStatusValueExtension on InstanceStatus { - String toValue() { - switch (this) { - case InstanceStatus.creationInProgress: - return 'CREATION_IN_PROGRESS'; - case InstanceStatus.active: - return 'ACTIVE'; - case InstanceStatus.creationFailed: - return 'CREATION_FAILED'; - } - } -} + /// The timestamp for when the evaluation was last updated. + final DateTime lastModifiedTime; -extension InstanceStatusFromString on String { - InstanceStatus toInstanceStatus() { - switch (this) { - case 'CREATION_IN_PROGRESS': - return InstanceStatus.creationInProgress; - case 'ACTIVE': - return InstanceStatus.active; - case 'CREATION_FAILED': - return InstanceStatus.creationFailed; - } - throw Exception('$this is not known in enum InstanceStatus'); - } -} + /// Metadata about the contact evaluation. + final EvaluationMetadata metadata; -/// Relevant details why the instance was not successfully created. -class InstanceStatusReason { - /// The message. - final String? message; + /// A map of question identifiers to note value. + final Map notes; - InstanceStatusReason({ - this.message, + /// The status of the contact evaluation. + final EvaluationStatus status; + + /// A map of item (section or question) identifiers to score value. + final Map? scores; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + Evaluation({ + required this.answers, + required this.createdTime, + required this.evaluationArn, + required this.evaluationId, + required this.lastModifiedTime, + required this.metadata, + required this.notes, + required this.status, + this.scores, + this.tags, }); - factory InstanceStatusReason.fromJson(Map json) { - return InstanceStatusReason( - message: json['Message'] as String?, + factory Evaluation.fromJson(Map json) { + return Evaluation( + answers: (json['Answers'] as Map).map((k, e) => MapEntry( + k, EvaluationAnswerOutput.fromJson(e as Map))), + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + evaluationArn: json['EvaluationArn'] as String, + evaluationId: json['EvaluationId'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), + metadata: + EvaluationMetadata.fromJson(json['Metadata'] as Map), + notes: (json['Notes'] as Map).map((k, e) => + MapEntry(k, EvaluationNote.fromJson(e as Map))), + status: (json['Status'] as String).toEvaluationStatus(), + scores: (json['Scores'] as Map?)?.map((k, e) => + MapEntry(k, EvaluationScore.fromJson(e as Map))), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final message = this.message; + final answers = this.answers; + final createdTime = this.createdTime; + final evaluationArn = this.evaluationArn; + final evaluationId = this.evaluationId; + final lastModifiedTime = this.lastModifiedTime; + final metadata = this.metadata; + final notes = this.notes; + final status = this.status; + final scores = this.scores; + final tags = this.tags; return { - if (message != null) 'Message': message, + 'Answers': answers, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EvaluationArn': evaluationArn, + 'EvaluationId': evaluationId, + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + 'Metadata': metadata, + 'Notes': notes, + 'Status': status.toValue(), + if (scores != null) 'Scores': scores, + if (tags != null) 'Tags': tags, }; } } -/// The storage configuration for the instance. -class InstanceStorageConfig { - /// A valid storage type. - final StorageType storageType; - - /// The existing association identifier that uniquely identifies the resource - /// type and storage config for the given instance ID. - final String? associationId; - - /// The configuration of the Kinesis Firehose delivery stream. - final KinesisFirehoseConfig? kinesisFirehoseConfig; - - /// The configuration of the Kinesis data stream. - final KinesisStreamConfig? kinesisStreamConfig; +/// Information about answer data for a contact evaluation. Answer data must be +/// either string, numeric, or not applicable. +class EvaluationAnswerData { + /// The flag to mark the question as not applicable. + final bool? notApplicable; - /// The configuration of the Kinesis video stream. - final KinesisVideoStreamConfig? kinesisVideoStreamConfig; + /// The numeric value for an answer in a contact evaluation. + final double? numericValue; - /// The S3 bucket configuration. - final S3Config? s3Config; + /// The string value for an answer in a contact evaluation. + final String? stringValue; - InstanceStorageConfig({ - required this.storageType, - this.associationId, - this.kinesisFirehoseConfig, - this.kinesisStreamConfig, - this.kinesisVideoStreamConfig, - this.s3Config, + EvaluationAnswerData({ + this.notApplicable, + this.numericValue, + this.stringValue, }); - factory InstanceStorageConfig.fromJson(Map json) { - return InstanceStorageConfig( - storageType: (json['StorageType'] as String).toStorageType(), - associationId: json['AssociationId'] as String?, - kinesisFirehoseConfig: json['KinesisFirehoseConfig'] != null - ? KinesisFirehoseConfig.fromJson( - json['KinesisFirehoseConfig'] as Map) - : null, - kinesisStreamConfig: json['KinesisStreamConfig'] != null - ? KinesisStreamConfig.fromJson( - json['KinesisStreamConfig'] as Map) - : null, - kinesisVideoStreamConfig: json['KinesisVideoStreamConfig'] != null - ? KinesisVideoStreamConfig.fromJson( - json['KinesisVideoStreamConfig'] as Map) - : null, - s3Config: json['S3Config'] != null - ? S3Config.fromJson(json['S3Config'] as Map) - : null, + factory EvaluationAnswerData.fromJson(Map json) { + return EvaluationAnswerData( + notApplicable: json['NotApplicable'] as bool?, + numericValue: json['NumericValue'] as double?, + stringValue: json['StringValue'] as String?, ); } Map toJson() { - final storageType = this.storageType; - final associationId = this.associationId; - final kinesisFirehoseConfig = this.kinesisFirehoseConfig; - final kinesisStreamConfig = this.kinesisStreamConfig; - final kinesisVideoStreamConfig = this.kinesisVideoStreamConfig; - final s3Config = this.s3Config; + final notApplicable = this.notApplicable; + final numericValue = this.numericValue; + final stringValue = this.stringValue; return { - 'StorageType': storageType.toValue(), - if (associationId != null) 'AssociationId': associationId, - if (kinesisFirehoseConfig != null) - 'KinesisFirehoseConfig': kinesisFirehoseConfig, - if (kinesisStreamConfig != null) - 'KinesisStreamConfig': kinesisStreamConfig, - if (kinesisVideoStreamConfig != null) - 'KinesisVideoStreamConfig': kinesisVideoStreamConfig, - if (s3Config != null) 'S3Config': s3Config, + if (notApplicable != null) 'NotApplicable': notApplicable, + if (numericValue != null) 'NumericValue': numericValue, + if (stringValue != null) 'StringValue': stringValue, }; } } -enum InstanceStorageResourceType { - chatTranscripts, - callRecordings, - scheduledReports, - mediaStreams, - contactTraceRecords, - agentEvents, - realTimeContactAnalysisSegments, - attachments, - contactEvaluations, -} +/// Information about input answers for a contact evaluation. +class EvaluationAnswerInput { + /// The value for an answer in a contact evaluation. + final EvaluationAnswerData? value; -extension InstanceStorageResourceTypeValueExtension - on InstanceStorageResourceType { - String toValue() { - switch (this) { - case InstanceStorageResourceType.chatTranscripts: - return 'CHAT_TRANSCRIPTS'; - case InstanceStorageResourceType.callRecordings: - return 'CALL_RECORDINGS'; - case InstanceStorageResourceType.scheduledReports: - return 'SCHEDULED_REPORTS'; - case InstanceStorageResourceType.mediaStreams: - return 'MEDIA_STREAMS'; - case InstanceStorageResourceType.contactTraceRecords: - return 'CONTACT_TRACE_RECORDS'; - case InstanceStorageResourceType.agentEvents: - return 'AGENT_EVENTS'; - case InstanceStorageResourceType.realTimeContactAnalysisSegments: - return 'REAL_TIME_CONTACT_ANALYSIS_SEGMENTS'; - case InstanceStorageResourceType.attachments: - return 'ATTACHMENTS'; - case InstanceStorageResourceType.contactEvaluations: - return 'CONTACT_EVALUATIONS'; - } - } -} + EvaluationAnswerInput({ + this.value, + }); -extension InstanceStorageResourceTypeFromString on String { - InstanceStorageResourceType toInstanceStorageResourceType() { - switch (this) { - case 'CHAT_TRANSCRIPTS': - return InstanceStorageResourceType.chatTranscripts; - case 'CALL_RECORDINGS': - return InstanceStorageResourceType.callRecordings; - case 'SCHEDULED_REPORTS': - return InstanceStorageResourceType.scheduledReports; - case 'MEDIA_STREAMS': - return InstanceStorageResourceType.mediaStreams; - case 'CONTACT_TRACE_RECORDS': - return InstanceStorageResourceType.contactTraceRecords; - case 'AGENT_EVENTS': - return InstanceStorageResourceType.agentEvents; - case 'REAL_TIME_CONTACT_ANALYSIS_SEGMENTS': - return InstanceStorageResourceType.realTimeContactAnalysisSegments; - case 'ATTACHMENTS': - return InstanceStorageResourceType.attachments; - case 'CONTACT_EVALUATIONS': - return InstanceStorageResourceType.contactEvaluations; - } - throw Exception('$this is not known in enum InstanceStorageResourceType'); + Map toJson() { + final value = this.value; + return { + if (value != null) 'Value': value, + }; } } -/// Information about the instance. -class InstanceSummary { - /// The Amazon Resource Name (ARN) of the instance. - final String? arn; - - /// When the instance was created. - final DateTime? createdTime; - - /// The identifier of the instance. - final String? id; - - /// The identity management type of the instance. - final DirectoryType? identityManagementType; - - /// Whether inbound calls are enabled. - final bool? inboundCallsEnabled; - - /// The alias of the instance. - final String? instanceAlias; - - /// The state of the instance. - final InstanceStatus? instanceStatus; - - /// Whether outbound calls are enabled. - final bool? outboundCallsEnabled; +/// Information about output answers for a contact evaluation. +class EvaluationAnswerOutput { + /// The system suggested value for an answer in a contact evaluation. + final EvaluationAnswerData? systemSuggestedValue; - /// The service role of the instance. - final String? serviceRole; + /// The value for an answer in a contact evaluation. + final EvaluationAnswerData? value; - InstanceSummary({ - this.arn, - this.createdTime, - this.id, - this.identityManagementType, - this.inboundCallsEnabled, - this.instanceAlias, - this.instanceStatus, - this.outboundCallsEnabled, - this.serviceRole, + EvaluationAnswerOutput({ + this.systemSuggestedValue, + this.value, }); - factory InstanceSummary.fromJson(Map json) { - return InstanceSummary( - arn: json['Arn'] as String?, - createdTime: timeStampFromJson(json['CreatedTime']), - id: json['Id'] as String?, - identityManagementType: - (json['IdentityManagementType'] as String?)?.toDirectoryType(), - inboundCallsEnabled: json['InboundCallsEnabled'] as bool?, - instanceAlias: json['InstanceAlias'] as String?, - instanceStatus: (json['InstanceStatus'] as String?)?.toInstanceStatus(), - outboundCallsEnabled: json['OutboundCallsEnabled'] as bool?, - serviceRole: json['ServiceRole'] as String?, + factory EvaluationAnswerOutput.fromJson(Map json) { + return EvaluationAnswerOutput( + systemSuggestedValue: json['SystemSuggestedValue'] != null + ? EvaluationAnswerData.fromJson( + json['SystemSuggestedValue'] as Map) + : null, + value: json['Value'] != null + ? EvaluationAnswerData.fromJson(json['Value'] as Map) + : null, ); } Map toJson() { - final arn = this.arn; - final createdTime = this.createdTime; - final id = this.id; - final identityManagementType = this.identityManagementType; - final inboundCallsEnabled = this.inboundCallsEnabled; - final instanceAlias = this.instanceAlias; - final instanceStatus = this.instanceStatus; - final outboundCallsEnabled = this.outboundCallsEnabled; - final serviceRole = this.serviceRole; + final systemSuggestedValue = this.systemSuggestedValue; + final value = this.value; return { - if (arn != null) 'Arn': arn, - if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), - if (id != null) 'Id': id, - if (identityManagementType != null) - 'IdentityManagementType': identityManagementType.toValue(), - if (inboundCallsEnabled != null) - 'InboundCallsEnabled': inboundCallsEnabled, - if (instanceAlias != null) 'InstanceAlias': instanceAlias, - if (instanceStatus != null) 'InstanceStatus': instanceStatus.toValue(), - if (outboundCallsEnabled != null) - 'OutboundCallsEnabled': outboundCallsEnabled, - if (serviceRole != null) 'ServiceRole': serviceRole, + if (systemSuggestedValue != null) + 'SystemSuggestedValue': systemSuggestedValue, + if (value != null) 'Value': value, }; } } -/// Contains summary information about the associated AppIntegrations. -class IntegrationAssociationSummary { - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - final String? instanceId; +/// Information about the evaluation form. +class EvaluationForm { + /// The Amazon Resource Name (ARN) of the user who created the evaluation form. + final String createdBy; - /// The Amazon Resource Name (ARN) for the AppIntegration. - final String? integrationArn; + /// The timestamp for when the evaluation form was created. + final DateTime createdTime; - /// The Amazon Resource Name (ARN) for the AppIntegration association. - final String? integrationAssociationArn; + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; - /// The identifier for the AppIntegration association. - final String? integrationAssociationId; + /// The unique identifier for the evaluation form. + final String evaluationFormId; - /// The integration type. - final IntegrationType? integrationType; + /// A version of the evaluation form. + final int evaluationFormVersion; - /// The user-provided, friendly name for the external application. - final String? sourceApplicationName; + /// Items that are part of the evaluation form. The total number of sections and + /// questions must not exceed 100 each. Questions must be contained in a + /// section. + final List items; - /// The URL for the external application. - final String? sourceApplicationUrl; + /// The Amazon Resource Name (ARN) of the user who last updated the evaluation + /// form. + final String lastModifiedBy; - /// The name of the source. - final SourceType? sourceType; + /// The timestamp for when the evaluation form was last updated. + final DateTime lastModifiedTime; - IntegrationAssociationSummary({ - this.instanceId, - this.integrationArn, - this.integrationAssociationArn, - this.integrationAssociationId, - this.integrationType, - this.sourceApplicationName, - this.sourceApplicationUrl, - this.sourceType, - }); + /// The flag indicating whether the evaluation form is locked for changes. + final bool locked; - factory IntegrationAssociationSummary.fromJson(Map json) { - return IntegrationAssociationSummary( - instanceId: json['InstanceId'] as String?, - integrationArn: json['IntegrationArn'] as String?, - integrationAssociationArn: json['IntegrationAssociationArn'] as String?, - integrationAssociationId: json['IntegrationAssociationId'] as String?, - integrationType: - (json['IntegrationType'] as String?)?.toIntegrationType(), - sourceApplicationName: json['SourceApplicationName'] as String?, - sourceApplicationUrl: json['SourceApplicationUrl'] as String?, - sourceType: (json['SourceType'] as String?)?.toSourceType(), - ); - } + /// The status of the evaluation form. + final EvaluationFormVersionStatus status; - Map toJson() { - final instanceId = this.instanceId; - final integrationArn = this.integrationArn; - final integrationAssociationArn = this.integrationAssociationArn; - final integrationAssociationId = this.integrationAssociationId; - final integrationType = this.integrationType; - final sourceApplicationName = this.sourceApplicationName; - final sourceApplicationUrl = this.sourceApplicationUrl; - final sourceType = this.sourceType; - return { - if (instanceId != null) 'InstanceId': instanceId, - if (integrationArn != null) 'IntegrationArn': integrationArn, - if (integrationAssociationArn != null) - 'IntegrationAssociationArn': integrationAssociationArn, - if (integrationAssociationId != null) - 'IntegrationAssociationId': integrationAssociationId, - if (integrationType != null) 'IntegrationType': integrationType.toValue(), - if (sourceApplicationName != null) - 'SourceApplicationName': sourceApplicationName, - if (sourceApplicationUrl != null) - 'SourceApplicationUrl': sourceApplicationUrl, - if (sourceType != null) 'SourceType': sourceType.toValue(), - }; - } -} - -enum IntegrationType { - event, - voiceId, - pinpointApp, - wisdomAssistant, - wisdomKnowledgeBase, - casesDomain, -} + /// A title of the evaluation form. + final String title; -extension IntegrationTypeValueExtension on IntegrationType { - String toValue() { - switch (this) { - case IntegrationType.event: - return 'EVENT'; - case IntegrationType.voiceId: - return 'VOICE_ID'; - case IntegrationType.pinpointApp: - return 'PINPOINT_APP'; - case IntegrationType.wisdomAssistant: - return 'WISDOM_ASSISTANT'; - case IntegrationType.wisdomKnowledgeBase: - return 'WISDOM_KNOWLEDGE_BASE'; - case IntegrationType.casesDomain: - return 'CASES_DOMAIN'; - } - } -} + /// The description of the evaluation form. + final String? description; -extension IntegrationTypeFromString on String { - IntegrationType toIntegrationType() { - switch (this) { - case 'EVENT': - return IntegrationType.event; - case 'VOICE_ID': - return IntegrationType.voiceId; - case 'PINPOINT_APP': - return IntegrationType.pinpointApp; - case 'WISDOM_ASSISTANT': - return IntegrationType.wisdomAssistant; - case 'WISDOM_KNOWLEDGE_BASE': - return IntegrationType.wisdomKnowledgeBase; - case 'CASES_DOMAIN': - return IntegrationType.casesDomain; - } - throw Exception('$this is not known in enum IntegrationType'); - } -} + /// A scoring strategy of the evaluation form. + final EvaluationFormScoringStrategy? scoringStrategy; -/// A field that is invisible to an agent. -class InvisibleFieldInfo { - /// Identifier of the invisible field. - final TaskTemplateFieldIdentifier? id; + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; - InvisibleFieldInfo({ - this.id, + EvaluationForm({ + required this.createdBy, + required this.createdTime, + required this.evaluationFormArn, + required this.evaluationFormId, + required this.evaluationFormVersion, + required this.items, + required this.lastModifiedBy, + required this.lastModifiedTime, + required this.locked, + required this.status, + required this.title, + this.description, + this.scoringStrategy, + this.tags, }); - factory InvisibleFieldInfo.fromJson(Map json) { - return InvisibleFieldInfo( - id: json['Id'] != null - ? TaskTemplateFieldIdentifier.fromJson( - json['Id'] as Map) + factory EvaluationForm.fromJson(Map json) { + return EvaluationForm( + createdBy: json['CreatedBy'] as String, + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormVersion: json['EvaluationFormVersion'] as int, + items: (json['Items'] as List) + .whereNotNull() + .map((e) => EvaluationFormItem.fromJson(e as Map)) + .toList(), + lastModifiedBy: json['LastModifiedBy'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), + locked: json['Locked'] as bool, + status: (json['Status'] as String).toEvaluationFormVersionStatus(), + title: json['Title'] as String, + description: json['Description'] as String?, + scoringStrategy: json['ScoringStrategy'] != null + ? EvaluationFormScoringStrategy.fromJson( + json['ScoringStrategy'] as Map) : null, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final id = this.id; + final createdBy = this.createdBy; + final createdTime = this.createdTime; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormVersion = this.evaluationFormVersion; + final items = this.items; + final lastModifiedBy = this.lastModifiedBy; + final lastModifiedTime = this.lastModifiedTime; + final locked = this.locked; + final status = this.status; + final title = this.title; + final description = this.description; + final scoringStrategy = this.scoringStrategy; + final tags = this.tags; return { - if (id != null) 'Id': id, + 'CreatedBy': createdBy, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormVersion': evaluationFormVersion, + 'Items': items, + 'LastModifiedBy': lastModifiedBy, + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + 'Locked': locked, + 'Status': status.toValue(), + 'Title': title, + if (description != null) 'Description': description, + if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, + if (tags != null) 'Tags': tags, }; } } -/// Configuration information of a Kinesis Data Firehose delivery stream. -class KinesisFirehoseConfig { - /// The Amazon Resource Name (ARN) of the delivery stream. - final String firehoseArn; +/// Information about an evaluation form used in a contact evaluation. +class EvaluationFormContent { + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; - KinesisFirehoseConfig({ - required this.firehoseArn, + /// The unique identifier for the evaluation form. + final String evaluationFormId; + + /// A version of the evaluation form. + final int evaluationFormVersion; + + /// Items that are part of the evaluation form. The total number of sections and + /// questions must not exceed 100 each. Questions must be contained in a + /// section. + final List items; + + /// A title of the evaluation form. + final String title; + + /// The description of the evaluation form. + final String? description; + + /// A scoring strategy of the evaluation form. + final EvaluationFormScoringStrategy? scoringStrategy; + + EvaluationFormContent({ + required this.evaluationFormArn, + required this.evaluationFormId, + required this.evaluationFormVersion, + required this.items, + required this.title, + this.description, + this.scoringStrategy, }); - factory KinesisFirehoseConfig.fromJson(Map json) { - return KinesisFirehoseConfig( - firehoseArn: json['FirehoseArn'] as String, + factory EvaluationFormContent.fromJson(Map json) { + return EvaluationFormContent( + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormVersion: json['EvaluationFormVersion'] as int, + items: (json['Items'] as List) + .whereNotNull() + .map((e) => EvaluationFormItem.fromJson(e as Map)) + .toList(), + title: json['Title'] as String, + description: json['Description'] as String?, + scoringStrategy: json['ScoringStrategy'] != null + ? EvaluationFormScoringStrategy.fromJson( + json['ScoringStrategy'] as Map) + : null, ); } Map toJson() { - final firehoseArn = this.firehoseArn; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormVersion = this.evaluationFormVersion; + final items = this.items; + final title = this.title; + final description = this.description; + final scoringStrategy = this.scoringStrategy; return { - 'FirehoseArn': firehoseArn, + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormVersion': evaluationFormVersion, + 'Items': items, + 'Title': title, + if (description != null) 'Description': description, + if (scoringStrategy != null) 'ScoringStrategy': scoringStrategy, }; } } -/// Configuration information of a Kinesis data stream. -class KinesisStreamConfig { - /// The Amazon Resource Name (ARN) of the data stream. - final String streamArn; +/// Information about an item from an evaluation form. The item must be either a +/// section or a question. +class EvaluationFormItem { + /// The information of the question. + final EvaluationFormQuestion? question; - KinesisStreamConfig({ - required this.streamArn, + /// The information of the section. + final EvaluationFormSection? section; + + EvaluationFormItem({ + this.question, + this.section, }); - factory KinesisStreamConfig.fromJson(Map json) { - return KinesisStreamConfig( - streamArn: json['StreamArn'] as String, + factory EvaluationFormItem.fromJson(Map json) { + return EvaluationFormItem( + question: json['Question'] != null + ? EvaluationFormQuestion.fromJson( + json['Question'] as Map) + : null, + section: json['Section'] != null + ? EvaluationFormSection.fromJson( + json['Section'] as Map) + : null, ); } Map toJson() { - final streamArn = this.streamArn; + final question = this.question; + final section = this.section; return { - 'StreamArn': streamArn, + if (question != null) 'Question': question, + if (section != null) 'Section': section, }; } } -/// Configuration information of a Kinesis video stream. -class KinesisVideoStreamConfig { - /// The encryption configuration. - final EncryptionConfig encryptionConfig; +/// Information about the automation configuration in numeric questions. +class EvaluationFormNumericQuestionAutomation { + /// The property value of the automation. + final NumericQuestionPropertyValueAutomation? propertyValue; - /// The prefix of the video stream. - final String prefix; + EvaluationFormNumericQuestionAutomation({ + this.propertyValue, + }); - /// The number of hours data is retained in the stream. Kinesis Video Streams - /// retains the data in a data store that is associated with the stream. - /// - /// The default value is 0, indicating that the stream does not persist data. - final int retentionPeriodHours; - - KinesisVideoStreamConfig({ - required this.encryptionConfig, - required this.prefix, - required this.retentionPeriodHours, - }); - - factory KinesisVideoStreamConfig.fromJson(Map json) { - return KinesisVideoStreamConfig( - encryptionConfig: EncryptionConfig.fromJson( - json['EncryptionConfig'] as Map), - prefix: json['Prefix'] as String, - retentionPeriodHours: json['RetentionPeriodHours'] as int, + factory EvaluationFormNumericQuestionAutomation.fromJson( + Map json) { + return EvaluationFormNumericQuestionAutomation( + propertyValue: json['PropertyValue'] != null + ? NumericQuestionPropertyValueAutomation.fromJson( + json['PropertyValue'] as Map) + : null, ); } Map toJson() { - final encryptionConfig = this.encryptionConfig; - final prefix = this.prefix; - final retentionPeriodHours = this.retentionPeriodHours; + final propertyValue = this.propertyValue; return { - 'EncryptionConfig': encryptionConfig, - 'Prefix': prefix, - 'RetentionPeriodHours': retentionPeriodHours, + if (propertyValue != null) 'PropertyValue': propertyValue, }; } } -/// Configuration information of an Amazon Lex bot. -class LexBot { - /// The Amazon Web Services Region where the Amazon Lex bot was created. - final String lexRegion; +/// Information about the option range used for scoring in numeric questions. +class EvaluationFormNumericQuestionOption { + /// The maximum answer value of the range option. + final int maxValue; - /// The name of the Amazon Lex bot. - final String name; + /// The minimum answer value of the range option. + final int minValue; - LexBot({ - required this.lexRegion, - required this.name, + /// The flag to mark the option as automatic fail. If an automatic fail answer + /// is provided, the overall evaluation gets a score of 0. + final bool? automaticFail; + + /// The score assigned to answer values within the range option. + final int? score; + + EvaluationFormNumericQuestionOption({ + required this.maxValue, + required this.minValue, + this.automaticFail, + this.score, }); - factory LexBot.fromJson(Map json) { - return LexBot( - lexRegion: json['LexRegion'] as String, - name: json['Name'] as String, + factory EvaluationFormNumericQuestionOption.fromJson( + Map json) { + return EvaluationFormNumericQuestionOption( + maxValue: json['MaxValue'] as int, + minValue: json['MinValue'] as int, + automaticFail: json['AutomaticFail'] as bool?, + score: json['Score'] as int?, ); } Map toJson() { - final lexRegion = this.lexRegion; - final name = this.name; + final maxValue = this.maxValue; + final minValue = this.minValue; + final automaticFail = this.automaticFail; + final score = this.score; return { - 'LexRegion': lexRegion, - 'Name': name, + 'MaxValue': maxValue, + 'MinValue': minValue, + if (automaticFail != null) 'AutomaticFail': automaticFail, + if (score != null) 'Score': score, }; } } -/// Configuration information of an Amazon Lex or Amazon Lex V2 bot. -class LexBotConfig { - final LexBot? lexBot; +/// Information about properties for a numeric question in an evaluation form. +class EvaluationFormNumericQuestionProperties { + /// The maximum answer value. + final int maxValue; - /// Configuration information of an Amazon Lex V2 bot. - final LexV2Bot? lexV2Bot; + /// The minimum answer value. + final int minValue; - LexBotConfig({ - this.lexBot, - this.lexV2Bot, + /// The automation properties of the numeric question. + final EvaluationFormNumericQuestionAutomation? automation; + + /// The scoring options of the numeric question. + final List? options; + + EvaluationFormNumericQuestionProperties({ + required this.maxValue, + required this.minValue, + this.automation, + this.options, }); - factory LexBotConfig.fromJson(Map json) { - return LexBotConfig( - lexBot: json['LexBot'] != null - ? LexBot.fromJson(json['LexBot'] as Map) - : null, - lexV2Bot: json['LexV2Bot'] != null - ? LexV2Bot.fromJson(json['LexV2Bot'] as Map) + factory EvaluationFormNumericQuestionProperties.fromJson( + Map json) { + return EvaluationFormNumericQuestionProperties( + maxValue: json['MaxValue'] as int, + minValue: json['MinValue'] as int, + automation: json['Automation'] != null + ? EvaluationFormNumericQuestionAutomation.fromJson( + json['Automation'] as Map) : null, + options: (json['Options'] as List?) + ?.whereNotNull() + .map((e) => EvaluationFormNumericQuestionOption.fromJson( + e as Map)) + .toList(), ); } Map toJson() { - final lexBot = this.lexBot; - final lexV2Bot = this.lexV2Bot; + final maxValue = this.maxValue; + final minValue = this.minValue; + final automation = this.automation; + final options = this.options; return { - if (lexBot != null) 'LexBot': lexBot, - if (lexV2Bot != null) 'LexV2Bot': lexV2Bot, + 'MaxValue': maxValue, + 'MinValue': minValue, + if (automation != null) 'Automation': automation, + if (options != null) 'Options': options, }; } } -/// Configuration information of an Amazon Lex V2 bot. -class LexV2Bot { - /// The Amazon Resource Name (ARN) of the Amazon Lex V2 bot. - final String? aliasArn; +/// Information about a question from an evaluation form. +class EvaluationFormQuestion { + /// The type of the question. + final EvaluationFormQuestionType questionType; - LexV2Bot({ - this.aliasArn, + /// The identifier of the question. An identifier must be unique within the + /// evaluation form. + final String refId; + + /// The title of the question. + final String title; + + /// The instructions of the section. + final String? instructions; + + /// The flag to enable not applicable answers to the question. + final bool? notApplicableEnabled; + + /// The properties of the type of question. Text questions do not have to define + /// question type properties. + final EvaluationFormQuestionTypeProperties? questionTypeProperties; + + /// The scoring weight of the section. + final double? weight; + + EvaluationFormQuestion({ + required this.questionType, + required this.refId, + required this.title, + this.instructions, + this.notApplicableEnabled, + this.questionTypeProperties, + this.weight, }); - factory LexV2Bot.fromJson(Map json) { - return LexV2Bot( - aliasArn: json['AliasArn'] as String?, + factory EvaluationFormQuestion.fromJson(Map json) { + return EvaluationFormQuestion( + questionType: + (json['QuestionType'] as String).toEvaluationFormQuestionType(), + refId: json['RefId'] as String, + title: json['Title'] as String, + instructions: json['Instructions'] as String?, + notApplicableEnabled: json['NotApplicableEnabled'] as bool?, + questionTypeProperties: json['QuestionTypeProperties'] != null + ? EvaluationFormQuestionTypeProperties.fromJson( + json['QuestionTypeProperties'] as Map) + : null, + weight: json['Weight'] as double?, ); } Map toJson() { - final aliasArn = this.aliasArn; + final questionType = this.questionType; + final refId = this.refId; + final title = this.title; + final instructions = this.instructions; + final notApplicableEnabled = this.notApplicableEnabled; + final questionTypeProperties = this.questionTypeProperties; + final weight = this.weight; return { - if (aliasArn != null) 'AliasArn': aliasArn, + 'QuestionType': questionType.toValue(), + 'RefId': refId, + 'Title': title, + if (instructions != null) 'Instructions': instructions, + if (notApplicableEnabled != null) + 'NotApplicableEnabled': notApplicableEnabled, + if (questionTypeProperties != null) + 'QuestionTypeProperties': questionTypeProperties, + if (weight != null) 'Weight': weight, }; } } -enum LexVersion { - v1, - v2, +enum EvaluationFormQuestionType { + text, + singleselect, + numeric, } -extension LexVersionValueExtension on LexVersion { +extension EvaluationFormQuestionTypeValueExtension + on EvaluationFormQuestionType { String toValue() { switch (this) { - case LexVersion.v1: - return 'V1'; - case LexVersion.v2: - return 'V2'; + case EvaluationFormQuestionType.text: + return 'TEXT'; + case EvaluationFormQuestionType.singleselect: + return 'SINGLESELECT'; + case EvaluationFormQuestionType.numeric: + return 'NUMERIC'; } } } -extension LexVersionFromString on String { - LexVersion toLexVersion() { +extension EvaluationFormQuestionTypeFromString on String { + EvaluationFormQuestionType toEvaluationFormQuestionType() { switch (this) { - case 'V1': - return LexVersion.v1; - case 'V2': - return LexVersion.v2; + case 'TEXT': + return EvaluationFormQuestionType.text; + case 'SINGLESELECT': + return EvaluationFormQuestionType.singleselect; + case 'NUMERIC': + return EvaluationFormQuestionType.numeric; } - throw Exception('$this is not known in enum LexVersion'); + throw Exception('$this is not known in enum EvaluationFormQuestionType'); } } -class ListAgentStatusResponse { - /// A summary of agent statuses. - final List? agentStatusSummaryList; +/// Information about properties for a question in an evaluation form. The +/// question type properties must be either for a numeric question or a single +/// select question. +class EvaluationFormQuestionTypeProperties { + /// The properties of the numeric question. + final EvaluationFormNumericQuestionProperties? numeric; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The properties of the numeric question. + final EvaluationFormSingleSelectQuestionProperties? singleSelect; - ListAgentStatusResponse({ - this.agentStatusSummaryList, - this.nextToken, + EvaluationFormQuestionTypeProperties({ + this.numeric, + this.singleSelect, }); - factory ListAgentStatusResponse.fromJson(Map json) { - return ListAgentStatusResponse( - agentStatusSummaryList: (json['AgentStatusSummaryList'] as List?) - ?.whereNotNull() - .map((e) => AgentStatusSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormQuestionTypeProperties.fromJson( + Map json) { + return EvaluationFormQuestionTypeProperties( + numeric: json['Numeric'] != null + ? EvaluationFormNumericQuestionProperties.fromJson( + json['Numeric'] as Map) + : null, + singleSelect: json['SingleSelect'] != null + ? EvaluationFormSingleSelectQuestionProperties.fromJson( + json['SingleSelect'] as Map) + : null, ); } Map toJson() { - final agentStatusSummaryList = this.agentStatusSummaryList; - final nextToken = this.nextToken; + final numeric = this.numeric; + final singleSelect = this.singleSelect; return { - if (agentStatusSummaryList != null) - 'AgentStatusSummaryList': agentStatusSummaryList, - if (nextToken != null) 'NextToken': nextToken, + if (numeric != null) 'Numeric': numeric, + if (singleSelect != null) 'SingleSelect': singleSelect, }; } } -class ListApprovedOriginsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +enum EvaluationFormScoringMode { + questionOnly, + sectionOnly, +} - /// The approved origins. - final List? origins; +extension EvaluationFormScoringModeValueExtension on EvaluationFormScoringMode { + String toValue() { + switch (this) { + case EvaluationFormScoringMode.questionOnly: + return 'QUESTION_ONLY'; + case EvaluationFormScoringMode.sectionOnly: + return 'SECTION_ONLY'; + } + } +} - ListApprovedOriginsResponse({ - this.nextToken, - this.origins, - }); +extension EvaluationFormScoringModeFromString on String { + EvaluationFormScoringMode toEvaluationFormScoringMode() { + switch (this) { + case 'QUESTION_ONLY': + return EvaluationFormScoringMode.questionOnly; + case 'SECTION_ONLY': + return EvaluationFormScoringMode.sectionOnly; + } + throw Exception('$this is not known in enum EvaluationFormScoringMode'); + } +} - factory ListApprovedOriginsResponse.fromJson(Map json) { - return ListApprovedOriginsResponse( - nextToken: json['NextToken'] as String?, - origins: (json['Origins'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - ); +enum EvaluationFormScoringStatus { + enabled, + disabled, +} + +extension EvaluationFormScoringStatusValueExtension + on EvaluationFormScoringStatus { + String toValue() { + switch (this) { + case EvaluationFormScoringStatus.enabled: + return 'ENABLED'; + case EvaluationFormScoringStatus.disabled: + return 'DISABLED'; + } } +} - Map toJson() { - final nextToken = this.nextToken; - final origins = this.origins; - return { - if (nextToken != null) 'NextToken': nextToken, - if (origins != null) 'Origins': origins, - }; +extension EvaluationFormScoringStatusFromString on String { + EvaluationFormScoringStatus toEvaluationFormScoringStatus() { + switch (this) { + case 'ENABLED': + return EvaluationFormScoringStatus.enabled; + case 'DISABLED': + return EvaluationFormScoringStatus.disabled; + } + throw Exception('$this is not known in enum EvaluationFormScoringStatus'); } } -class ListBotsResponse { - /// The names and Amazon Web Services Regions of the Amazon Lex or Amazon Lex V2 - /// bots associated with the specified instance. - final List? lexBots; +/// Information about scoring strategy for an evaluation form. +class EvaluationFormScoringStrategy { + /// The scoring mode of the evaluation form. + final EvaluationFormScoringMode mode; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The scoring status of the evaluation form. + final EvaluationFormScoringStatus status; - ListBotsResponse({ - this.lexBots, - this.nextToken, + EvaluationFormScoringStrategy({ + required this.mode, + required this.status, }); - factory ListBotsResponse.fromJson(Map json) { - return ListBotsResponse( - lexBots: (json['LexBots'] as List?) - ?.whereNotNull() - .map((e) => LexBotConfig.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormScoringStrategy.fromJson(Map json) { + return EvaluationFormScoringStrategy( + mode: (json['Mode'] as String).toEvaluationFormScoringMode(), + status: (json['Status'] as String).toEvaluationFormScoringStatus(), ); } Map toJson() { - final lexBots = this.lexBots; - final nextToken = this.nextToken; + final mode = this.mode; + final status = this.status; return { - if (lexBots != null) 'LexBots': lexBots, - if (nextToken != null) 'NextToken': nextToken, + 'Mode': mode.toValue(), + 'Status': status.toValue(), }; } } -class ListContactEvaluationsResponse { - /// Provides details about a list of contact evaluations belonging to an - /// instance. - final List evaluationSummaryList; +/// Information about a section from an evaluation form. A section can contain +/// sections and/or questions. Evaluation forms can only contain sections and +/// subsections (two level nesting). +class EvaluationFormSection { + /// The items of the section. + final List items; - /// If there are additional results, this is the token for the next set of - /// results. - /// - /// This is always returned as null in the response. - /// - final String? nextToken; + /// The identifier of the section. An identifier must be unique within the + /// evaluation form. + final String refId; - ListContactEvaluationsResponse({ - required this.evaluationSummaryList, - this.nextToken, + /// The title of the section. + final String title; + + /// The instructions of the section. + final String? instructions; + + /// The scoring weight of the section. + final double? weight; + + EvaluationFormSection({ + required this.items, + required this.refId, + required this.title, + this.instructions, + this.weight, }); - factory ListContactEvaluationsResponse.fromJson(Map json) { - return ListContactEvaluationsResponse( - evaluationSummaryList: (json['EvaluationSummaryList'] as List) + factory EvaluationFormSection.fromJson(Map json) { + return EvaluationFormSection( + items: (json['Items'] as List) .whereNotNull() - .map((e) => EvaluationSummary.fromJson(e as Map)) + .map((e) => EvaluationFormItem.fromJson(e as Map)) .toList(), - nextToken: json['NextToken'] as String?, + refId: json['RefId'] as String, + title: json['Title'] as String, + instructions: json['Instructions'] as String?, + weight: json['Weight'] as double?, ); } Map toJson() { - final evaluationSummaryList = this.evaluationSummaryList; - final nextToken = this.nextToken; + final items = this.items; + final refId = this.refId; + final title = this.title; + final instructions = this.instructions; + final weight = this.weight; return { - 'EvaluationSummaryList': evaluationSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'Items': items, + 'RefId': refId, + 'Title': title, + if (instructions != null) 'Instructions': instructions, + if (weight != null) 'Weight': weight, }; } } -class ListContactFlowModulesResponse { - /// Information about the flow module. - final List? contactFlowModulesSummaryList; +/// Information about the automation configuration in single select questions. +/// Automation options are evaluated in order, and the first matched option is +/// applied. If no automation option matches, and there is a default option, +/// then the default option is applied. +class EvaluationFormSingleSelectQuestionAutomation { + /// The automation options of the single select question. + final List options; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The identifier of the default answer option, when none of the automation + /// options match the criteria. + final String? defaultOptionRefId; - ListContactFlowModulesResponse({ - this.contactFlowModulesSummaryList, - this.nextToken, + EvaluationFormSingleSelectQuestionAutomation({ + required this.options, + this.defaultOptionRefId, }); - factory ListContactFlowModulesResponse.fromJson(Map json) { - return ListContactFlowModulesResponse( - contactFlowModulesSummaryList: - (json['ContactFlowModulesSummaryList'] as List?) - ?.whereNotNull() - .map((e) => - ContactFlowModuleSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormSingleSelectQuestionAutomation.fromJson( + Map json) { + return EvaluationFormSingleSelectQuestionAutomation( + options: (json['Options'] as List) + .whereNotNull() + .map((e) => + EvaluationFormSingleSelectQuestionAutomationOption.fromJson( + e as Map)) + .toList(), + defaultOptionRefId: json['DefaultOptionRefId'] as String?, ); } Map toJson() { - final contactFlowModulesSummaryList = this.contactFlowModulesSummaryList; - final nextToken = this.nextToken; + final options = this.options; + final defaultOptionRefId = this.defaultOptionRefId; return { - if (contactFlowModulesSummaryList != null) - 'ContactFlowModulesSummaryList': contactFlowModulesSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'Options': options, + if (defaultOptionRefId != null) 'DefaultOptionRefId': defaultOptionRefId, }; } } -class ListContactFlowsResponse { - /// Information about the flows. - final List? contactFlowSummaryList; - - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// Information about the automation option of a single select question. +class EvaluationFormSingleSelectQuestionAutomationOption { + /// The automation option based on a rule category for the single select + /// question. + final SingleSelectQuestionRuleCategoryAutomation? ruleCategory; - ListContactFlowsResponse({ - this.contactFlowSummaryList, - this.nextToken, + EvaluationFormSingleSelectQuestionAutomationOption({ + this.ruleCategory, }); - factory ListContactFlowsResponse.fromJson(Map json) { - return ListContactFlowsResponse( - contactFlowSummaryList: (json['ContactFlowSummaryList'] as List?) - ?.whereNotNull() - .map((e) => ContactFlowSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormSingleSelectQuestionAutomationOption.fromJson( + Map json) { + return EvaluationFormSingleSelectQuestionAutomationOption( + ruleCategory: json['RuleCategory'] != null + ? SingleSelectQuestionRuleCategoryAutomation.fromJson( + json['RuleCategory'] as Map) + : null, ); } Map toJson() { - final contactFlowSummaryList = this.contactFlowSummaryList; - final nextToken = this.nextToken; + final ruleCategory = this.ruleCategory; return { - if (contactFlowSummaryList != null) - 'ContactFlowSummaryList': contactFlowSummaryList, - if (nextToken != null) 'NextToken': nextToken, + if (ruleCategory != null) 'RuleCategory': ruleCategory, }; } } -class ListContactReferencesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - /// - /// This is always returned as null in the response. - /// - final String? nextToken; - - /// Information about the flows. - final List? referenceSummaryList; - - ListContactReferencesResponse({ - this.nextToken, - this.referenceSummaryList, - }); +enum EvaluationFormSingleSelectQuestionDisplayMode { + dropdown, + radio, +} - factory ListContactReferencesResponse.fromJson(Map json) { - return ListContactReferencesResponse( - nextToken: json['NextToken'] as String?, - referenceSummaryList: (json['ReferenceSummaryList'] as List?) - ?.whereNotNull() - .map((e) => ReferenceSummary.fromJson(e as Map)) - .toList(), - ); +extension EvaluationFormSingleSelectQuestionDisplayModeValueExtension + on EvaluationFormSingleSelectQuestionDisplayMode { + String toValue() { + switch (this) { + case EvaluationFormSingleSelectQuestionDisplayMode.dropdown: + return 'DROPDOWN'; + case EvaluationFormSingleSelectQuestionDisplayMode.radio: + return 'RADIO'; + } } +} - Map toJson() { - final nextToken = this.nextToken; - final referenceSummaryList = this.referenceSummaryList; - return { - if (nextToken != null) 'NextToken': nextToken, - if (referenceSummaryList != null) - 'ReferenceSummaryList': referenceSummaryList, - }; +extension EvaluationFormSingleSelectQuestionDisplayModeFromString on String { + EvaluationFormSingleSelectQuestionDisplayMode + toEvaluationFormSingleSelectQuestionDisplayMode() { + switch (this) { + case 'DROPDOWN': + return EvaluationFormSingleSelectQuestionDisplayMode.dropdown; + case 'RADIO': + return EvaluationFormSingleSelectQuestionDisplayMode.radio; + } + throw Exception( + '$this is not known in enum EvaluationFormSingleSelectQuestionDisplayMode'); } } -class ListDefaultVocabulariesResponse { - /// A list of default vocabularies. - final List defaultVocabularyList; - - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - ListDefaultVocabulariesResponse({ - required this.defaultVocabularyList, - this.nextToken, - }); - - factory ListDefaultVocabulariesResponse.fromJson(Map json) { - return ListDefaultVocabulariesResponse( - defaultVocabularyList: (json['DefaultVocabularyList'] as List) - .whereNotNull() - .map((e) => DefaultVocabulary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, - ); - } +/// Information about the automation configuration in single select questions. +class EvaluationFormSingleSelectQuestionOption { + /// The identifier of the answer option. An identifier must be unique within the + /// question. + final String refId; - Map toJson() { - final defaultVocabularyList = this.defaultVocabularyList; - final nextToken = this.nextToken; - return { - 'DefaultVocabularyList': defaultVocabularyList, - if (nextToken != null) 'NextToken': nextToken, - }; - } -} + /// The title of the answer option. + final String text; -class ListEvaluationFormVersionsResponse { - /// Provides details about a list of evaluation forms belonging to an instance. - final List evaluationFormVersionSummaryList; + /// The flag to mark the option as automatic fail. If an automatic fail answer + /// is provided, the overall evaluation gets a score of 0. + final bool? automaticFail; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The score assigned to the answer option. + final int? score; - ListEvaluationFormVersionsResponse({ - required this.evaluationFormVersionSummaryList, - this.nextToken, + EvaluationFormSingleSelectQuestionOption({ + required this.refId, + required this.text, + this.automaticFail, + this.score, }); - factory ListEvaluationFormVersionsResponse.fromJson( + factory EvaluationFormSingleSelectQuestionOption.fromJson( Map json) { - return ListEvaluationFormVersionsResponse( - evaluationFormVersionSummaryList: - (json['EvaluationFormVersionSummaryList'] as List) - .whereNotNull() - .map((e) => EvaluationFormVersionSummary.fromJson( - e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + return EvaluationFormSingleSelectQuestionOption( + refId: json['RefId'] as String, + text: json['Text'] as String, + automaticFail: json['AutomaticFail'] as bool?, + score: json['Score'] as int?, ); } Map toJson() { - final evaluationFormVersionSummaryList = - this.evaluationFormVersionSummaryList; - final nextToken = this.nextToken; + final refId = this.refId; + final text = this.text; + final automaticFail = this.automaticFail; + final score = this.score; return { - 'EvaluationFormVersionSummaryList': evaluationFormVersionSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'RefId': refId, + 'Text': text, + if (automaticFail != null) 'AutomaticFail': automaticFail, + if (score != null) 'Score': score, }; } } -class ListEvaluationFormsResponse { - /// Provides details about a list of evaluation forms belonging to an instance. - final List evaluationFormSummaryList; +/// Information about the options in single select questions. +class EvaluationFormSingleSelectQuestionProperties { + /// The answer options of the single select question. + final List options; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The display mode of the single select question. + final EvaluationFormSingleSelectQuestionAutomation? automation; - ListEvaluationFormsResponse({ - required this.evaluationFormSummaryList, - this.nextToken, + /// The display mode of the single select question. + final EvaluationFormSingleSelectQuestionDisplayMode? displayAs; + + EvaluationFormSingleSelectQuestionProperties({ + required this.options, + this.automation, + this.displayAs, }); - factory ListEvaluationFormsResponse.fromJson(Map json) { - return ListEvaluationFormsResponse( - evaluationFormSummaryList: (json['EvaluationFormSummaryList'] as List) + factory EvaluationFormSingleSelectQuestionProperties.fromJson( + Map json) { + return EvaluationFormSingleSelectQuestionProperties( + options: (json['Options'] as List) .whereNotNull() - .map((e) => EvaluationFormSummary.fromJson(e as Map)) + .map((e) => EvaluationFormSingleSelectQuestionOption.fromJson( + e as Map)) .toList(), - nextToken: json['NextToken'] as String?, + automation: json['Automation'] != null + ? EvaluationFormSingleSelectQuestionAutomation.fromJson( + json['Automation'] as Map) + : null, + displayAs: (json['DisplayAs'] as String?) + ?.toEvaluationFormSingleSelectQuestionDisplayMode(), ); } Map toJson() { - final evaluationFormSummaryList = this.evaluationFormSummaryList; - final nextToken = this.nextToken; + final options = this.options; + final automation = this.automation; + final displayAs = this.displayAs; return { - 'EvaluationFormSummaryList': evaluationFormSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'Options': options, + if (automation != null) 'Automation': automation, + if (displayAs != null) 'DisplayAs': displayAs.toValue(), }; } } -class ListHoursOfOperationsResponse { - /// Information about the hours of operation. - final List? hoursOfOperationSummaryList; +/// Summary information about an evaluation form. +class EvaluationFormSummary { + /// The Amazon Resource Name (ARN) of the user who created the evaluation form. + final String createdBy; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The timestamp for when the evaluation form was created. + final DateTime createdTime; - ListHoursOfOperationsResponse({ - this.hoursOfOperationSummaryList, - this.nextToken, - }); + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; - factory ListHoursOfOperationsResponse.fromJson(Map json) { - return ListHoursOfOperationsResponse( - hoursOfOperationSummaryList: - (json['HoursOfOperationSummaryList'] as List?) - ?.whereNotNull() - .map((e) => - HoursOfOperationSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, - ); - } + /// The unique identifier for the evaluation form. + final String evaluationFormId; - Map toJson() { - final hoursOfOperationSummaryList = this.hoursOfOperationSummaryList; - final nextToken = this.nextToken; - return { - if (hoursOfOperationSummaryList != null) - 'HoursOfOperationSummaryList': hoursOfOperationSummaryList, - if (nextToken != null) 'NextToken': nextToken, - }; - } -} + /// The Amazon Resource Name (ARN) of the user who last updated the evaluation + /// form. + final String lastModifiedBy; -class ListInstanceAttributesResponse { - /// The attribute types. - final List? attributes; + /// The timestamp for when the evaluation form was last updated. + final DateTime lastModifiedTime; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The version number of the latest evaluation form version. + final int latestVersion; - ListInstanceAttributesResponse({ - this.attributes, - this.nextToken, + /// A title of the evaluation form. + final String title; + + /// The version of the active evaluation form version. + final int? activeVersion; + + /// The Amazon Resource Name (ARN) of the user who last activated the evaluation + /// form. + final String? lastActivatedBy; + + /// The timestamp for when the evaluation form was last activated. + final DateTime? lastActivatedTime; + + EvaluationFormSummary({ + required this.createdBy, + required this.createdTime, + required this.evaluationFormArn, + required this.evaluationFormId, + required this.lastModifiedBy, + required this.lastModifiedTime, + required this.latestVersion, + required this.title, + this.activeVersion, + this.lastActivatedBy, + this.lastActivatedTime, }); - factory ListInstanceAttributesResponse.fromJson(Map json) { - return ListInstanceAttributesResponse( - attributes: (json['Attributes'] as List?) - ?.whereNotNull() - .map((e) => Attribute.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormSummary.fromJson(Map json) { + return EvaluationFormSummary( + createdBy: json['CreatedBy'] as String, + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + lastModifiedBy: json['LastModifiedBy'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), + latestVersion: json['LatestVersion'] as int, + title: json['Title'] as String, + activeVersion: json['ActiveVersion'] as int?, + lastActivatedBy: json['LastActivatedBy'] as String?, + lastActivatedTime: timeStampFromJson(json['LastActivatedTime']), ); } Map toJson() { - final attributes = this.attributes; - final nextToken = this.nextToken; + final createdBy = this.createdBy; + final createdTime = this.createdTime; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final lastModifiedBy = this.lastModifiedBy; + final lastModifiedTime = this.lastModifiedTime; + final latestVersion = this.latestVersion; + final title = this.title; + final activeVersion = this.activeVersion; + final lastActivatedBy = this.lastActivatedBy; + final lastActivatedTime = this.lastActivatedTime; return { - if (attributes != null) 'Attributes': attributes, - if (nextToken != null) 'NextToken': nextToken, + 'CreatedBy': createdBy, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'LastModifiedBy': lastModifiedBy, + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + 'LatestVersion': latestVersion, + 'Title': title, + if (activeVersion != null) 'ActiveVersion': activeVersion, + if (lastActivatedBy != null) 'LastActivatedBy': lastActivatedBy, + if (lastActivatedTime != null) + 'LastActivatedTime': unixTimestampToJson(lastActivatedTime), }; } } -class ListInstanceStorageConfigsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - /// A valid storage type. - final List? storageConfigs; - - ListInstanceStorageConfigsResponse({ - this.nextToken, - this.storageConfigs, - }); +enum EvaluationFormVersionStatus { + draft, + active, +} - factory ListInstanceStorageConfigsResponse.fromJson( - Map json) { - return ListInstanceStorageConfigsResponse( - nextToken: json['NextToken'] as String?, - storageConfigs: (json['StorageConfigs'] as List?) - ?.whereNotNull() - .map((e) => InstanceStorageConfig.fromJson(e as Map)) - .toList(), - ); +extension EvaluationFormVersionStatusValueExtension + on EvaluationFormVersionStatus { + String toValue() { + switch (this) { + case EvaluationFormVersionStatus.draft: + return 'DRAFT'; + case EvaluationFormVersionStatus.active: + return 'ACTIVE'; + } } +} - Map toJson() { - final nextToken = this.nextToken; - final storageConfigs = this.storageConfigs; - return { - if (nextToken != null) 'NextToken': nextToken, - if (storageConfigs != null) 'StorageConfigs': storageConfigs, - }; +extension EvaluationFormVersionStatusFromString on String { + EvaluationFormVersionStatus toEvaluationFormVersionStatus() { + switch (this) { + case 'DRAFT': + return EvaluationFormVersionStatus.draft; + case 'ACTIVE': + return EvaluationFormVersionStatus.active; + } + throw Exception('$this is not known in enum EvaluationFormVersionStatus'); } } -class ListInstancesResponse { - /// Information about the instances. - final List? instanceSummaryList; +/// Summary information about an evaluation form. +class EvaluationFormVersionSummary { + /// The Amazon Resource Name (ARN) of the user who created the evaluation form. + final String createdBy; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The timestamp for when the evaluation form was created. + final DateTime createdTime; - ListInstancesResponse({ - this.instanceSummaryList, - this.nextToken, + /// The Amazon Resource Name (ARN) for the evaluation form resource. + final String evaluationFormArn; + + /// The unique identifier for the evaluation form. + final String evaluationFormId; + + /// A version of the evaluation form. + final int evaluationFormVersion; + + /// The Amazon Resource Name (ARN) of the user who last updated the evaluation + /// form. + final String lastModifiedBy; + + /// The timestamp for when the evaluation form was last updated. + final DateTime lastModifiedTime; + + /// The flag indicating whether the evaluation form is locked for changes. + final bool locked; + + /// The status of the evaluation form. + final EvaluationFormVersionStatus status; + + EvaluationFormVersionSummary({ + required this.createdBy, + required this.createdTime, + required this.evaluationFormArn, + required this.evaluationFormId, + required this.evaluationFormVersion, + required this.lastModifiedBy, + required this.lastModifiedTime, + required this.locked, + required this.status, }); - factory ListInstancesResponse.fromJson(Map json) { - return ListInstancesResponse( - instanceSummaryList: (json['InstanceSummaryList'] as List?) - ?.whereNotNull() - .map((e) => InstanceSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationFormVersionSummary.fromJson(Map json) { + return EvaluationFormVersionSummary( + createdBy: json['CreatedBy'] as String, + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + evaluationFormArn: json['EvaluationFormArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormVersion: json['EvaluationFormVersion'] as int, + lastModifiedBy: json['LastModifiedBy'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), + locked: json['Locked'] as bool, + status: (json['Status'] as String).toEvaluationFormVersionStatus(), ); } Map toJson() { - final instanceSummaryList = this.instanceSummaryList; - final nextToken = this.nextToken; + final createdBy = this.createdBy; + final createdTime = this.createdTime; + final evaluationFormArn = this.evaluationFormArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormVersion = this.evaluationFormVersion; + final lastModifiedBy = this.lastModifiedBy; + final lastModifiedTime = this.lastModifiedTime; + final locked = this.locked; + final status = this.status; return { - if (instanceSummaryList != null) - 'InstanceSummaryList': instanceSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'CreatedBy': createdBy, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EvaluationFormArn': evaluationFormArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormVersion': evaluationFormVersion, + 'LastModifiedBy': lastModifiedBy, + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + 'Locked': locked, + 'Status': status.toValue(), }; } } -class ListIntegrationAssociationsResponse { - /// The associations. - final List? integrationAssociationSummaryList; +/// Metadata information about a contact evaluation. +class EvaluationMetadata { + /// The identifier of the contact in this instance of Amazon Connect. + final String contactId; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The Amazon Resource Name (ARN) of the user who last updated the evaluation. + final String evaluatorArn; - ListIntegrationAssociationsResponse({ - this.integrationAssociationSummaryList, - this.nextToken, + /// The identifier of the agent who performed the contact. + final String? contactAgentId; + + /// The overall score of the contact evaluation. + final EvaluationScore? score; + + EvaluationMetadata({ + required this.contactId, + required this.evaluatorArn, + this.contactAgentId, + this.score, }); - factory ListIntegrationAssociationsResponse.fromJson( - Map json) { - return ListIntegrationAssociationsResponse( - integrationAssociationSummaryList: - (json['IntegrationAssociationSummaryList'] as List?) - ?.whereNotNull() - .map((e) => IntegrationAssociationSummary.fromJson( - e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationMetadata.fromJson(Map json) { + return EvaluationMetadata( + contactId: json['ContactId'] as String, + evaluatorArn: json['EvaluatorArn'] as String, + contactAgentId: json['ContactAgentId'] as String?, + score: json['Score'] != null + ? EvaluationScore.fromJson(json['Score'] as Map) + : null, ); } Map toJson() { - final integrationAssociationSummaryList = - this.integrationAssociationSummaryList; - final nextToken = this.nextToken; + final contactId = this.contactId; + final evaluatorArn = this.evaluatorArn; + final contactAgentId = this.contactAgentId; + final score = this.score; return { - if (integrationAssociationSummaryList != null) - 'IntegrationAssociationSummaryList': integrationAssociationSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'ContactId': contactId, + 'EvaluatorArn': evaluatorArn, + if (contactAgentId != null) 'ContactAgentId': contactAgentId, + if (score != null) 'Score': score, }; } } -class ListLambdaFunctionsResponse { - /// The Lambdafunction ARNs associated with the specified instance. - final List? lambdaFunctions; - - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// Information about notes for a contact evaluation. +class EvaluationNote { + /// The note for an item (section or question) in a contact evaluation. + /// + /// Even though a note in an evaluation can have up to 3072 chars, there is also + /// a limit on the total number of chars for all the notes in the evaluation + /// combined. Assuming there are N questions in the evaluation being submitted, + /// then the max char limit for all notes combined is N x 1024. + /// + final String? value; - ListLambdaFunctionsResponse({ - this.lambdaFunctions, - this.nextToken, + EvaluationNote({ + this.value, }); - factory ListLambdaFunctionsResponse.fromJson(Map json) { - return ListLambdaFunctionsResponse( - lambdaFunctions: (json['LambdaFunctions'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationNote.fromJson(Map json) { + return EvaluationNote( + value: json['Value'] as String?, ); } Map toJson() { - final lambdaFunctions = this.lambdaFunctions; - final nextToken = this.nextToken; + final value = this.value; return { - if (lambdaFunctions != null) 'LambdaFunctions': lambdaFunctions, - if (nextToken != null) 'NextToken': nextToken, + if (value != null) 'Value': value, }; } } -class ListLexBotsResponse { - /// The names and Amazon Web Services Regions of the Amazon Lex bots associated - /// with the specified instance. - final List? lexBots; +/// Information about scores of a contact evaluation item (section or question). +class EvaluationScore { + /// The flag that marks the item as automatic fail. If the item or a child item + /// gets an automatic fail answer, this flag will be true. + final bool? automaticFail; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// The flag to mark the item as not applicable for scoring. + final bool? notApplicable; - ListLexBotsResponse({ - this.lexBots, - this.nextToken, + /// The score percentage for an item in a contact evaluation. + final double? percentage; + + EvaluationScore({ + this.automaticFail, + this.notApplicable, + this.percentage, }); - factory ListLexBotsResponse.fromJson(Map json) { - return ListLexBotsResponse( - lexBots: (json['LexBots'] as List?) - ?.whereNotNull() - .map((e) => LexBot.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationScore.fromJson(Map json) { + return EvaluationScore( + automaticFail: json['AutomaticFail'] as bool?, + notApplicable: json['NotApplicable'] as bool?, + percentage: json['Percentage'] as double?, ); } Map toJson() { - final lexBots = this.lexBots; - final nextToken = this.nextToken; + final automaticFail = this.automaticFail; + final notApplicable = this.notApplicable; + final percentage = this.percentage; return { - if (lexBots != null) 'LexBots': lexBots, - if (nextToken != null) 'NextToken': nextToken, + if (automaticFail != null) 'AutomaticFail': automaticFail, + if (notApplicable != null) 'NotApplicable': notApplicable, + if (percentage != null) 'Percentage': percentage, }; } } -class ListPhoneNumbersResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - /// Information about the phone numbers. - final List? phoneNumberSummaryList; - - ListPhoneNumbersResponse({ - this.nextToken, - this.phoneNumberSummaryList, - }); +enum EvaluationStatus { + draft, + submitted, +} - factory ListPhoneNumbersResponse.fromJson(Map json) { - return ListPhoneNumbersResponse( - nextToken: json['NextToken'] as String?, - phoneNumberSummaryList: (json['PhoneNumberSummaryList'] as List?) - ?.whereNotNull() - .map((e) => PhoneNumberSummary.fromJson(e as Map)) - .toList(), - ); +extension EvaluationStatusValueExtension on EvaluationStatus { + String toValue() { + switch (this) { + case EvaluationStatus.draft: + return 'DRAFT'; + case EvaluationStatus.submitted: + return 'SUBMITTED'; + } } +} - Map toJson() { - final nextToken = this.nextToken; - final phoneNumberSummaryList = this.phoneNumberSummaryList; - return { - if (nextToken != null) 'NextToken': nextToken, - if (phoneNumberSummaryList != null) - 'PhoneNumberSummaryList': phoneNumberSummaryList, - }; +extension EvaluationStatusFromString on String { + EvaluationStatus toEvaluationStatus() { + switch (this) { + case 'DRAFT': + return EvaluationStatus.draft; + case 'SUBMITTED': + return EvaluationStatus.submitted; + } + throw Exception('$this is not known in enum EvaluationStatus'); } } -/// Information about phone numbers that have been claimed to your Amazon -/// Connect instance or traffic distribution group. -class ListPhoneNumbersSummary { - /// The phone number. Phone numbers are formatted [+] [country code] - /// [subscriber number including area code]. - final String? phoneNumber; +/// Summary information about a contact evaluation. +class EvaluationSummary { + /// The timestamp for when the evaluation was created. + final DateTime createdTime; - /// The Amazon Resource Name (ARN) of the phone number. - final String? phoneNumberArn; + /// The Amazon Resource Name (ARN) for the contact evaluation resource. + final String evaluationArn; - /// The ISO country code. - final PhoneNumberCountryCode? phoneNumberCountryCode; + /// The unique identifier for the evaluation form. + final String evaluationFormId; - /// A unique identifier for the phone number. - final String? phoneNumberId; + /// A title of the evaluation form. + final String evaluationFormTitle; - /// The type of phone number. - final PhoneNumberType? phoneNumberType; + /// A unique identifier for the contact evaluation. + final String evaluationId; - /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic - /// distribution groups that phone numbers are claimed to. - final String? targetArn; + /// The Amazon Resource Name (ARN) of the user who last updated the evaluation. + final String evaluatorArn; - ListPhoneNumbersSummary({ - this.phoneNumber, - this.phoneNumberArn, - this.phoneNumberCountryCode, - this.phoneNumberId, - this.phoneNumberType, - this.targetArn, - }); + /// The timestamp for when the evaluation was last updated. + final DateTime lastModifiedTime; - factory ListPhoneNumbersSummary.fromJson(Map json) { - return ListPhoneNumbersSummary( - phoneNumber: json['PhoneNumber'] as String?, - phoneNumberArn: json['PhoneNumberArn'] as String?, - phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) - ?.toPhoneNumberCountryCode(), - phoneNumberId: json['PhoneNumberId'] as String?, - phoneNumberType: - (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), - targetArn: json['TargetArn'] as String?, - ); - } + /// The status of the contact evaluation. + final EvaluationStatus status; - Map toJson() { - final phoneNumber = this.phoneNumber; - final phoneNumberArn = this.phoneNumberArn; - final phoneNumberCountryCode = this.phoneNumberCountryCode; - final phoneNumberId = this.phoneNumberId; - final phoneNumberType = this.phoneNumberType; - final targetArn = this.targetArn; - return { - if (phoneNumber != null) 'PhoneNumber': phoneNumber, - if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, - if (phoneNumberCountryCode != null) - 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), - if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, - if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), - if (targetArn != null) 'TargetArn': targetArn, - }; - } -} + /// The overall score of the contact evaluation. + final EvaluationScore? score; -class ListPhoneNumbersV2Response { - /// Information about phone numbers that have been claimed to your Amazon - /// Connect instances or traffic distribution groups. - final List? listPhoneNumbersSummaryList; - - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - ListPhoneNumbersV2Response({ - this.listPhoneNumbersSummaryList, - this.nextToken, + EvaluationSummary({ + required this.createdTime, + required this.evaluationArn, + required this.evaluationFormId, + required this.evaluationFormTitle, + required this.evaluationId, + required this.evaluatorArn, + required this.lastModifiedTime, + required this.status, + this.score, }); - factory ListPhoneNumbersV2Response.fromJson(Map json) { - return ListPhoneNumbersV2Response( - listPhoneNumbersSummaryList: - (json['ListPhoneNumbersSummaryList'] as List?) - ?.whereNotNull() - .map((e) => - ListPhoneNumbersSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory EvaluationSummary.fromJson(Map json) { + return EvaluationSummary( + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + evaluationArn: json['EvaluationArn'] as String, + evaluationFormId: json['EvaluationFormId'] as String, + evaluationFormTitle: json['EvaluationFormTitle'] as String, + evaluationId: json['EvaluationId'] as String, + evaluatorArn: json['EvaluatorArn'] as String, + lastModifiedTime: + nonNullableTimeStampFromJson(json['LastModifiedTime'] as Object), + status: (json['Status'] as String).toEvaluationStatus(), + score: json['Score'] != null + ? EvaluationScore.fromJson(json['Score'] as Map) + : null, ); } Map toJson() { - final listPhoneNumbersSummaryList = this.listPhoneNumbersSummaryList; - final nextToken = this.nextToken; + final createdTime = this.createdTime; + final evaluationArn = this.evaluationArn; + final evaluationFormId = this.evaluationFormId; + final evaluationFormTitle = this.evaluationFormTitle; + final evaluationId = this.evaluationId; + final evaluatorArn = this.evaluatorArn; + final lastModifiedTime = this.lastModifiedTime; + final status = this.status; + final score = this.score; return { - if (listPhoneNumbersSummaryList != null) - 'ListPhoneNumbersSummaryList': listPhoneNumbersSummaryList, - if (nextToken != null) 'NextToken': nextToken, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EvaluationArn': evaluationArn, + 'EvaluationFormId': evaluationFormId, + 'EvaluationFormTitle': evaluationFormTitle, + 'EvaluationId': evaluationId, + 'EvaluatorArn': evaluatorArn, + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + 'Status': status.toValue(), + if (score != null) 'Score': score, }; } } -class ListPromptsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - /// Information about the prompts. - final List? promptSummaryList; +/// The EventBridge action definition. +class EventBridgeActionDefinition { + /// The name. + final String name; - ListPromptsResponse({ - this.nextToken, - this.promptSummaryList, + EventBridgeActionDefinition({ + required this.name, }); - factory ListPromptsResponse.fromJson(Map json) { - return ListPromptsResponse( - nextToken: json['NextToken'] as String?, - promptSummaryList: (json['PromptSummaryList'] as List?) - ?.whereNotNull() - .map((e) => PromptSummary.fromJson(e as Map)) - .toList(), + factory EventBridgeActionDefinition.fromJson(Map json) { + return EventBridgeActionDefinition( + name: json['Name'] as String, ); } Map toJson() { - final nextToken = this.nextToken; - final promptSummaryList = this.promptSummaryList; + final name = this.name; return { - if (nextToken != null) 'NextToken': nextToken, - if (promptSummaryList != null) 'PromptSummaryList': promptSummaryList, + 'Name': name, }; } } -class ListQueueQuickConnectsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; - - /// Information about the quick connects. - final List? quickConnectSummaryList; - - ListQueueQuickConnectsResponse({ - this.nextToken, - this.quickConnectSummaryList, - }); +enum EventSourceName { + onPostCallAnalysisAvailable, + onRealTimeCallAnalysisAvailable, + onRealTimeChatAnalysisAvailable, + onPostChatAnalysisAvailable, + onZendeskTicketCreate, + onZendeskTicketStatusUpdate, + onSalesforceCaseCreate, + onContactEvaluationSubmit, + onMetricDataUpdate, + onCaseCreate, + onCaseUpdate, +} - factory ListQueueQuickConnectsResponse.fromJson(Map json) { - return ListQueueQuickConnectsResponse( - nextToken: json['NextToken'] as String?, - quickConnectSummaryList: (json['QuickConnectSummaryList'] as List?) - ?.whereNotNull() - .map((e) => QuickConnectSummary.fromJson(e as Map)) - .toList(), - ); +extension EventSourceNameValueExtension on EventSourceName { + String toValue() { + switch (this) { + case EventSourceName.onPostCallAnalysisAvailable: + return 'OnPostCallAnalysisAvailable'; + case EventSourceName.onRealTimeCallAnalysisAvailable: + return 'OnRealTimeCallAnalysisAvailable'; + case EventSourceName.onRealTimeChatAnalysisAvailable: + return 'OnRealTimeChatAnalysisAvailable'; + case EventSourceName.onPostChatAnalysisAvailable: + return 'OnPostChatAnalysisAvailable'; + case EventSourceName.onZendeskTicketCreate: + return 'OnZendeskTicketCreate'; + case EventSourceName.onZendeskTicketStatusUpdate: + return 'OnZendeskTicketStatusUpdate'; + case EventSourceName.onSalesforceCaseCreate: + return 'OnSalesforceCaseCreate'; + case EventSourceName.onContactEvaluationSubmit: + return 'OnContactEvaluationSubmit'; + case EventSourceName.onMetricDataUpdate: + return 'OnMetricDataUpdate'; + case EventSourceName.onCaseCreate: + return 'OnCaseCreate'; + case EventSourceName.onCaseUpdate: + return 'OnCaseUpdate'; + } } +} - Map toJson() { - final nextToken = this.nextToken; - final quickConnectSummaryList = this.quickConnectSummaryList; - return { - if (nextToken != null) 'NextToken': nextToken, - if (quickConnectSummaryList != null) - 'QuickConnectSummaryList': quickConnectSummaryList, - }; +extension EventSourceNameFromString on String { + EventSourceName toEventSourceName() { + switch (this) { + case 'OnPostCallAnalysisAvailable': + return EventSourceName.onPostCallAnalysisAvailable; + case 'OnRealTimeCallAnalysisAvailable': + return EventSourceName.onRealTimeCallAnalysisAvailable; + case 'OnRealTimeChatAnalysisAvailable': + return EventSourceName.onRealTimeChatAnalysisAvailable; + case 'OnPostChatAnalysisAvailable': + return EventSourceName.onPostChatAnalysisAvailable; + case 'OnZendeskTicketCreate': + return EventSourceName.onZendeskTicketCreate; + case 'OnZendeskTicketStatusUpdate': + return EventSourceName.onZendeskTicketStatusUpdate; + case 'OnSalesforceCaseCreate': + return EventSourceName.onSalesforceCaseCreate; + case 'OnContactEvaluationSubmit': + return EventSourceName.onContactEvaluationSubmit; + case 'OnMetricDataUpdate': + return EventSourceName.onMetricDataUpdate; + case 'OnCaseCreate': + return EventSourceName.onCaseCreate; + case 'OnCaseUpdate': + return EventSourceName.onCaseUpdate; + } + throw Exception('$this is not known in enum EventSourceName'); } } -class ListQueuesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// An object to specify the expiration of a routing step. +class Expiry { + /// The number of seconds to wait before expiring the routing step. + final int? durationInSeconds; - /// Information about the queues. - final List? queueSummaryList; + /// The timestamp indicating when the routing step expires. + final DateTime? expiryTimestamp; - ListQueuesResponse({ - this.nextToken, - this.queueSummaryList, + Expiry({ + this.durationInSeconds, + this.expiryTimestamp, }); - factory ListQueuesResponse.fromJson(Map json) { - return ListQueuesResponse( - nextToken: json['NextToken'] as String?, - queueSummaryList: (json['QueueSummaryList'] as List?) - ?.whereNotNull() - .map((e) => QueueSummary.fromJson(e as Map)) - .toList(), + factory Expiry.fromJson(Map json) { + return Expiry( + durationInSeconds: json['DurationInSeconds'] as int?, + expiryTimestamp: timeStampFromJson(json['ExpiryTimestamp']), ); } Map toJson() { - final nextToken = this.nextToken; - final queueSummaryList = this.queueSummaryList; + final durationInSeconds = this.durationInSeconds; + final expiryTimestamp = this.expiryTimestamp; return { - if (nextToken != null) 'NextToken': nextToken, - if (queueSummaryList != null) 'QueueSummaryList': queueSummaryList, + if (durationInSeconds != null) 'DurationInSeconds': durationInSeconds, + if (expiryTimestamp != null) + 'ExpiryTimestamp': unixTimestampToJson(expiryTimestamp), }; } } -class ListQuickConnectsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// A tagged union to specify expression for a routing step. +class Expression { + /// List of routing expressions which will be AND-ed together. + final List? andExpression; - /// Information about the quick connects. - final List? quickConnectSummaryList; + /// An object to specify the predefined attribute condition. + final AttributeCondition? attributeCondition; - ListQuickConnectsResponse({ - this.nextToken, - this.quickConnectSummaryList, + /// List of routing expressions which will be OR-ed together. + final List? orExpression; + + Expression({ + this.andExpression, + this.attributeCondition, + this.orExpression, }); - factory ListQuickConnectsResponse.fromJson(Map json) { - return ListQuickConnectsResponse( - nextToken: json['NextToken'] as String?, - quickConnectSummaryList: (json['QuickConnectSummaryList'] as List?) + factory Expression.fromJson(Map json) { + return Expression( + andExpression: (json['AndExpression'] as List?) ?.whereNotNull() - .map((e) => QuickConnectSummary.fromJson(e as Map)) + .map((e) => Expression.fromJson(e as Map)) + .toList(), + attributeCondition: json['AttributeCondition'] != null + ? AttributeCondition.fromJson( + json['AttributeCondition'] as Map) + : null, + orExpression: (json['OrExpression'] as List?) + ?.whereNotNull() + .map((e) => Expression.fromJson(e as Map)) .toList(), ); } Map toJson() { - final nextToken = this.nextToken; - final quickConnectSummaryList = this.quickConnectSummaryList; + final andExpression = this.andExpression; + final attributeCondition = this.attributeCondition; + final orExpression = this.orExpression; return { - if (nextToken != null) 'NextToken': nextToken, - if (quickConnectSummaryList != null) - 'QuickConnectSummaryList': quickConnectSummaryList, + if (andExpression != null) 'AndExpression': andExpression, + if (attributeCondition != null) 'AttributeCondition': attributeCondition, + if (orExpression != null) 'OrExpression': orExpression, }; } } -class ListRoutingProfileQueuesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// Request for which contact failed to be generated. +class FailedRequest { + /// Reason code for the failure. + final FailureReasonCode? failureReasonCode; - /// Information about the routing profiles. - final List? - routingProfileQueueConfigSummaryList; + /// Why the request to create a contact failed. + final String? failureReasonMessage; - ListRoutingProfileQueuesResponse({ - this.nextToken, - this.routingProfileQueueConfigSummaryList, + /// Request identifier provided in the API call in the ContactDataRequest to + /// create a contact. + final String? requestIdentifier; + + FailedRequest({ + this.failureReasonCode, + this.failureReasonMessage, + this.requestIdentifier, }); - factory ListRoutingProfileQueuesResponse.fromJson(Map json) { - return ListRoutingProfileQueuesResponse( - nextToken: json['NextToken'] as String?, - routingProfileQueueConfigSummaryList: - (json['RoutingProfileQueueConfigSummaryList'] as List?) - ?.whereNotNull() - .map((e) => RoutingProfileQueueConfigSummary.fromJson( - e as Map)) - .toList(), + factory FailedRequest.fromJson(Map json) { + return FailedRequest( + failureReasonCode: + (json['FailureReasonCode'] as String?)?.toFailureReasonCode(), + failureReasonMessage: json['FailureReasonMessage'] as String?, + requestIdentifier: json['RequestIdentifier'] as String?, ); } Map toJson() { - final nextToken = this.nextToken; - final routingProfileQueueConfigSummaryList = - this.routingProfileQueueConfigSummaryList; + final failureReasonCode = this.failureReasonCode; + final failureReasonMessage = this.failureReasonMessage; + final requestIdentifier = this.requestIdentifier; return { - if (nextToken != null) 'NextToken': nextToken, - if (routingProfileQueueConfigSummaryList != null) - 'RoutingProfileQueueConfigSummaryList': - routingProfileQueueConfigSummaryList, + if (failureReasonCode != null) + 'FailureReasonCode': failureReasonCode.toValue(), + if (failureReasonMessage != null) + 'FailureReasonMessage': failureReasonMessage, + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, }; } } -class ListRoutingProfilesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +enum FailureReasonCode { + invalidAttributeKey, + invalidCustomerEndpoint, + invalidSystemEndpoint, + invalidQueue, + missingCampaign, + missingCustomerEndpoint, + missingQueueIdAndSystemEndpoint, + requestThrottled, + idempotencyException, + internalError, +} - /// Information about the routing profiles. - final List? routingProfileSummaryList; +extension FailureReasonCodeValueExtension on FailureReasonCode { + String toValue() { + switch (this) { + case FailureReasonCode.invalidAttributeKey: + return 'INVALID_ATTRIBUTE_KEY'; + case FailureReasonCode.invalidCustomerEndpoint: + return 'INVALID_CUSTOMER_ENDPOINT'; + case FailureReasonCode.invalidSystemEndpoint: + return 'INVALID_SYSTEM_ENDPOINT'; + case FailureReasonCode.invalidQueue: + return 'INVALID_QUEUE'; + case FailureReasonCode.missingCampaign: + return 'MISSING_CAMPAIGN'; + case FailureReasonCode.missingCustomerEndpoint: + return 'MISSING_CUSTOMER_ENDPOINT'; + case FailureReasonCode.missingQueueIdAndSystemEndpoint: + return 'MISSING_QUEUE_ID_AND_SYSTEM_ENDPOINT'; + case FailureReasonCode.requestThrottled: + return 'REQUEST_THROTTLED'; + case FailureReasonCode.idempotencyException: + return 'IDEMPOTENCY_EXCEPTION'; + case FailureReasonCode.internalError: + return 'INTERNAL_ERROR'; + } + } +} - ListRoutingProfilesResponse({ - this.nextToken, - this.routingProfileSummaryList, +extension FailureReasonCodeFromString on String { + FailureReasonCode toFailureReasonCode() { + switch (this) { + case 'INVALID_ATTRIBUTE_KEY': + return FailureReasonCode.invalidAttributeKey; + case 'INVALID_CUSTOMER_ENDPOINT': + return FailureReasonCode.invalidCustomerEndpoint; + case 'INVALID_SYSTEM_ENDPOINT': + return FailureReasonCode.invalidSystemEndpoint; + case 'INVALID_QUEUE': + return FailureReasonCode.invalidQueue; + case 'MISSING_CAMPAIGN': + return FailureReasonCode.missingCampaign; + case 'MISSING_CUSTOMER_ENDPOINT': + return FailureReasonCode.missingCustomerEndpoint; + case 'MISSING_QUEUE_ID_AND_SYSTEM_ENDPOINT': + return FailureReasonCode.missingQueueIdAndSystemEndpoint; + case 'REQUEST_THROTTLED': + return FailureReasonCode.requestThrottled; + case 'IDEMPOTENCY_EXCEPTION': + return FailureReasonCode.idempotencyException; + case 'INTERNAL_ERROR': + return FailureReasonCode.internalError; + } + throw Exception('$this is not known in enum FailureReasonCode'); + } +} + +/// Object for case field values. +class FieldValue { + /// Unique identifier of a field. + final String id; + + /// Union of potential field value types. + final FieldValueUnion value; + + FieldValue({ + required this.id, + required this.value, }); - factory ListRoutingProfilesResponse.fromJson(Map json) { - return ListRoutingProfilesResponse( - nextToken: json['NextToken'] as String?, - routingProfileSummaryList: (json['RoutingProfileSummaryList'] as List?) - ?.whereNotNull() - .map((e) => RoutingProfileSummary.fromJson(e as Map)) - .toList(), + factory FieldValue.fromJson(Map json) { + return FieldValue( + id: json['Id'] as String, + value: FieldValueUnion.fromJson(json['Value'] as Map), ); } Map toJson() { - final nextToken = this.nextToken; - final routingProfileSummaryList = this.routingProfileSummaryList; + final id = this.id; + final value = this.value; return { - if (nextToken != null) 'NextToken': nextToken, - if (routingProfileSummaryList != null) - 'RoutingProfileSummaryList': routingProfileSummaryList, + 'Id': id, + 'Value': value, }; } } -class ListRulesResponse { - /// Summary information about a rule. - final List ruleSummaryList; +/// Object to store union of Field values. +class FieldValueUnion { + /// A Boolean number value type. + final bool? booleanValue; - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; + /// a Double number value type. + final double? doubleValue; - ListRulesResponse({ - required this.ruleSummaryList, - this.nextToken, + /// An empty value. + final EmptyFieldValue? emptyValue; + + /// String value type. + final String? stringValue; + + FieldValueUnion({ + this.booleanValue, + this.doubleValue, + this.emptyValue, + this.stringValue, }); - factory ListRulesResponse.fromJson(Map json) { - return ListRulesResponse( - ruleSummaryList: (json['RuleSummaryList'] as List) - .whereNotNull() - .map((e) => RuleSummary.fromJson(e as Map)) - .toList(), - nextToken: json['NextToken'] as String?, + factory FieldValueUnion.fromJson(Map json) { + return FieldValueUnion( + booleanValue: json['BooleanValue'] as bool?, + doubleValue: json['DoubleValue'] as double?, + emptyValue: json['EmptyValue'] != null + ? EmptyFieldValue.fromJson(json['EmptyValue'] as Map) + : null, + stringValue: json['StringValue'] as String?, ); } Map toJson() { - final ruleSummaryList = this.ruleSummaryList; - final nextToken = this.nextToken; + final booleanValue = this.booleanValue; + final doubleValue = this.doubleValue; + final emptyValue = this.emptyValue; + final stringValue = this.stringValue; return { - 'RuleSummaryList': ruleSummaryList, - if (nextToken != null) 'NextToken': nextToken, + if (booleanValue != null) 'BooleanValue': booleanValue, + if (doubleValue != null) 'DoubleValue': doubleValue, + if (emptyValue != null) 'EmptyValue': emptyValue, + if (stringValue != null) 'StringValue': stringValue, }; } } -class ListSecurityKeysResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +enum FileStatusType { + approved, + rejected, + processing, + failed, +} - /// The security keys. - final List? securityKeys; +extension FileStatusTypeValueExtension on FileStatusType { + String toValue() { + switch (this) { + case FileStatusType.approved: + return 'APPROVED'; + case FileStatusType.rejected: + return 'REJECTED'; + case FileStatusType.processing: + return 'PROCESSING'; + case FileStatusType.failed: + return 'FAILED'; + } + } +} - ListSecurityKeysResponse({ - this.nextToken, - this.securityKeys, - }); +extension FileStatusTypeFromString on String { + FileStatusType toFileStatusType() { + switch (this) { + case 'APPROVED': + return FileStatusType.approved; + case 'REJECTED': + return FileStatusType.rejected; + case 'PROCESSING': + return FileStatusType.processing; + case 'FAILED': + return FileStatusType.failed; + } + throw Exception('$this is not known in enum FileStatusType'); + } +} - factory ListSecurityKeysResponse.fromJson(Map json) { - return ListSecurityKeysResponse( - nextToken: json['NextToken'] as String?, - securityKeys: (json['SecurityKeys'] as List?) - ?.whereNotNull() - .map((e) => SecurityKey.fromJson(e as Map)) - .toList(), - ); +enum FileUseCaseType { + attachment, +} + +extension FileUseCaseTypeValueExtension on FileUseCaseType { + String toValue() { + switch (this) { + case FileUseCaseType.attachment: + return 'ATTACHMENT'; + } + } +} + +extension FileUseCaseTypeFromString on String { + FileUseCaseType toFileUseCaseType() { + switch (this) { + case 'ATTACHMENT': + return FileUseCaseType.attachment; + } + throw Exception('$this is not known in enum FileUseCaseType'); } +} + +/// Contains the filter to apply when retrieving metrics with the GetMetricDataV2 +/// API. +class FilterV2 { + /// The key to use for filtering data. For example, QUEUE, + /// ROUTING_PROFILE, AGENT, CHANNEL, + /// AGENT_HIERARCHY_LEVEL_ONE, + /// AGENT_HIERARCHY_LEVEL_TWO, + /// AGENT_HIERARCHY_LEVEL_THREE, + /// AGENT_HIERARCHY_LEVEL_FOUR, + /// AGENT_HIERARCHY_LEVEL_FIVE. There must be at least 1 key and a + /// maximum 5 keys. + final String? filterKey; + + /// The identifiers to use for filtering data. For example, if you have a filter + /// key of QUEUE, you would add queue IDs or ARNs in + /// FilterValues. + final List? filterValues; + + FilterV2({ + this.filterKey, + this.filterValues, + }); Map toJson() { - final nextToken = this.nextToken; - final securityKeys = this.securityKeys; + final filterKey = this.filterKey; + final filterValues = this.filterValues; return { - if (nextToken != null) 'NextToken': nextToken, - if (securityKeys != null) 'SecurityKeys': securityKeys, + if (filterKey != null) 'FilterKey': filterKey, + if (filterValues != null) 'FilterValues': filterValues, }; } } -class ListSecurityProfilePermissionsResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +/// Contains the filter to apply when retrieving metrics. +class Filters { + /// The channel to use to filter the metrics. + final List? channels; - /// The permissions granted to the security profile. For a complete list of - /// valid permissions, see List - /// of security profile permissions. - final List? permissions; + /// The queues to use to filter the metrics. You should specify at least one + /// queue, and can specify up to 100 queues per request. The + /// GetCurrentMetricsData API in particular requires a queue when + /// you include a Filter in your request. + final List? queues; - ListSecurityProfilePermissionsResponse({ - this.nextToken, - this.permissions, - }); + /// A list of up to 100 routing profile IDs or ARNs. + final List? routingProfiles; - factory ListSecurityProfilePermissionsResponse.fromJson( - Map json) { - return ListSecurityProfilePermissionsResponse( - nextToken: json['NextToken'] as String?, - permissions: (json['Permissions'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - ); - } + /// A list of expressions as a filter, in which an expression is an object of a + /// step in a routing criteria. + final List? routingStepExpressions; + + Filters({ + this.channels, + this.queues, + this.routingProfiles, + this.routingStepExpressions, + }); Map toJson() { - final nextToken = this.nextToken; - final permissions = this.permissions; + final channels = this.channels; + final queues = this.queues; + final routingProfiles = this.routingProfiles; + final routingStepExpressions = this.routingStepExpressions; return { - if (nextToken != null) 'NextToken': nextToken, - if (permissions != null) 'Permissions': permissions, + if (channels != null) + 'Channels': channels.map((e) => e.toValue()).toList(), + if (queues != null) 'Queues': queues, + if (routingProfiles != null) 'RoutingProfiles': routingProfiles, + if (routingStepExpressions != null) + 'RoutingStepExpressions': routingStepExpressions, }; } } -class ListSecurityProfilesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - final String? nextToken; +enum FlowAssociationResourceType { + smsPhoneNumber, +} - /// Information about the security profiles. - final List? securityProfileSummaryList; +extension FlowAssociationResourceTypeValueExtension + on FlowAssociationResourceType { + String toValue() { + switch (this) { + case FlowAssociationResourceType.smsPhoneNumber: + return 'SMS_PHONE_NUMBER'; + } + } +} - ListSecurityProfilesResponse({ - this.nextToken, - this.securityProfileSummaryList, +extension FlowAssociationResourceTypeFromString on String { + FlowAssociationResourceType toFlowAssociationResourceType() { + switch (this) { + case 'SMS_PHONE_NUMBER': + return FlowAssociationResourceType.smsPhoneNumber; + } + throw Exception('$this is not known in enum FlowAssociationResourceType'); + } +} + +/// Information about flow associations. +class FlowAssociationSummary { + /// The identifier of the flow. + final String? flowId; + + /// The identifier of the resource. + final String? resourceId; + + /// The type of resource association. + final ListFlowAssociationResourceType? resourceType; + + FlowAssociationSummary({ + this.flowId, + this.resourceId, + this.resourceType, }); - factory ListSecurityProfilesResponse.fromJson(Map json) { - return ListSecurityProfilesResponse( - nextToken: json['NextToken'] as String?, - securityProfileSummaryList: (json['SecurityProfileSummaryList'] as List?) - ?.whereNotNull() - .map( - (e) => SecurityProfileSummary.fromJson(e as Map)) - .toList(), + factory FlowAssociationSummary.fromJson(Map json) { + return FlowAssociationSummary( + flowId: json['FlowId'] as String?, + resourceId: json['ResourceId'] as String?, + resourceType: (json['ResourceType'] as String?) + ?.toListFlowAssociationResourceType(), ); } Map toJson() { - final nextToken = this.nextToken; - final securityProfileSummaryList = this.securityProfileSummaryList; + final flowId = this.flowId; + final resourceId = this.resourceId; + final resourceType = this.resourceType; return { - if (nextToken != null) 'NextToken': nextToken, - if (securityProfileSummaryList != null) - 'SecurityProfileSummaryList': securityProfileSummaryList, + if (flowId != null) 'FlowId': flowId, + if (resourceId != null) 'ResourceId': resourceId, + if (resourceType != null) 'ResourceType': resourceType.toValue(), }; } } -class ListTagsForResourceResponse { - /// Information about the tags. +/// Response from GetAttachedFile API. +class GetAttachedFileResponse { + /// The size of the attached file in bytes. + final int fileSizeInBytes; + + /// The resource to which the attached file is (being) uploaded to. Cases + /// are the only current supported resource. + final String? associatedResourceArn; + + /// Represents the identity that created the file. + final CreatedByInfo? createdBy; + + /// The time of Creation of the file resource as an ISO timestamp. It's + /// specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For + /// example, 2024-05-03T02:41:28.172Z. + final String? creationTime; + + /// URL and expiry to be used when downloading the attached file. + final DownloadUrlMetadata? downloadUrlMetadata; + + /// The unique identifier of the attached file resource (ARN). + final String? fileArn; + + /// The unique identifier of the attached file resource. + final String? fileId; + + /// A case-sensitive name of the attached file being uploaded. + final String? fileName; + + /// The current status of the attached file. + final FileStatusType? fileStatus; + + /// The use case for the file. + final FileUseCaseType? fileUseCaseType; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; - ListTagsForResourceResponse({ + GetAttachedFileResponse({ + required this.fileSizeInBytes, + this.associatedResourceArn, + this.createdBy, + this.creationTime, + this.downloadUrlMetadata, + this.fileArn, + this.fileId, + this.fileName, + this.fileStatus, + this.fileUseCaseType, this.tags, }); - factory ListTagsForResourceResponse.fromJson(Map json) { - return ListTagsForResourceResponse( - tags: (json['tags'] as Map?) + factory GetAttachedFileResponse.fromJson(Map json) { + return GetAttachedFileResponse( + fileSizeInBytes: json['FileSizeInBytes'] as int, + associatedResourceArn: json['AssociatedResourceArn'] as String?, + createdBy: json['CreatedBy'] != null + ? CreatedByInfo.fromJson(json['CreatedBy'] as Map) + : null, + creationTime: json['CreationTime'] as String?, + downloadUrlMetadata: json['DownloadUrlMetadata'] != null + ? DownloadUrlMetadata.fromJson( + json['DownloadUrlMetadata'] as Map) + : null, + fileArn: json['FileArn'] as String?, + fileId: json['FileId'] as String?, + fileName: json['FileName'] as String?, + fileStatus: (json['FileStatus'] as String?)?.toFileStatusType(), + fileUseCaseType: + (json['FileUseCaseType'] as String?)?.toFileUseCaseType(), + tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { + final fileSizeInBytes = this.fileSizeInBytes; + final associatedResourceArn = this.associatedResourceArn; + final createdBy = this.createdBy; + final creationTime = this.creationTime; + final downloadUrlMetadata = this.downloadUrlMetadata; + final fileArn = this.fileArn; + final fileId = this.fileId; + final fileName = this.fileName; + final fileStatus = this.fileStatus; + final fileUseCaseType = this.fileUseCaseType; final tags = this.tags; return { - if (tags != null) 'tags': tags, + 'FileSizeInBytes': fileSizeInBytes, + if (associatedResourceArn != null) + 'AssociatedResourceArn': associatedResourceArn, + if (createdBy != null) 'CreatedBy': createdBy, + if (creationTime != null) 'CreationTime': creationTime, + if (downloadUrlMetadata != null) + 'DownloadUrlMetadata': downloadUrlMetadata, + if (fileArn != null) 'FileArn': fileArn, + if (fileId != null) 'FileId': fileId, + if (fileName != null) 'FileName': fileName, + if (fileStatus != null) 'FileStatus': fileStatus.toValue(), + if (fileUseCaseType != null) 'FileUseCaseType': fileUseCaseType.toValue(), + if (tags != null) 'Tags': tags, }; } } -class ListTaskTemplatesResponse { - /// If there are additional results, this is the token for the next set of - /// results. - /// - /// This is always returned as a null in the response. - /// - final String? nextToken; - - /// Provides details about a list of task templates belonging to an instance. - final List? taskTemplates; +class GetContactAttributesResponse { + /// Information about the attributes. + final Map? attributes; - ListTaskTemplatesResponse({ - this.nextToken, - this.taskTemplates, + GetContactAttributesResponse({ + this.attributes, }); - factory ListTaskTemplatesResponse.fromJson(Map json) { - return ListTaskTemplatesResponse( - nextToken: json['NextToken'] as String?, - taskTemplates: (json['TaskTemplates'] as List?) - ?.whereNotNull() - .map((e) => TaskTemplateMetadata.fromJson(e as Map)) - .toList(), + factory GetContactAttributesResponse.fromJson(Map json) { + return GetContactAttributesResponse( + attributes: (json['Attributes'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final nextToken = this.nextToken; - final taskTemplates = this.taskTemplates; + final attributes = this.attributes; return { - if (nextToken != null) 'NextToken': nextToken, - if (taskTemplates != null) 'TaskTemplates': taskTemplates, + if (attributes != null) 'Attributes': attributes, }; } } -class ListTrafficDistributionGroupsResponse { +class GetCurrentMetricDataResponse { + /// The total count of the result, regardless of the current page size. + final int? approximateTotalCount; + + /// The time at which the metrics were retrieved and cached for pagination. + final DateTime? dataSnapshotTime; + + /// Information about the real-time metrics. + final List? metricResults; + /// If there are additional results, this is the token for the next set of /// results. + /// + /// The token expires after 5 minutes from the time it is created. Subsequent + /// requests that use the token must use the same request parameters as the + /// request that generated the token. final String? nextToken; - /// A list of traffic distribution groups. - final List? - trafficDistributionGroupSummaryList; - - ListTrafficDistributionGroupsResponse({ + GetCurrentMetricDataResponse({ + this.approximateTotalCount, + this.dataSnapshotTime, + this.metricResults, this.nextToken, - this.trafficDistributionGroupSummaryList, }); - factory ListTrafficDistributionGroupsResponse.fromJson( - Map json) { - return ListTrafficDistributionGroupsResponse( + factory GetCurrentMetricDataResponse.fromJson(Map json) { + return GetCurrentMetricDataResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + dataSnapshotTime: timeStampFromJson(json['DataSnapshotTime']), + metricResults: (json['MetricResults'] as List?) + ?.whereNotNull() + .map((e) => CurrentMetricResult.fromJson(e as Map)) + .toList(), nextToken: json['NextToken'] as String?, - trafficDistributionGroupSummaryList: - (json['TrafficDistributionGroupSummaryList'] as List?) - ?.whereNotNull() - .map((e) => TrafficDistributionGroupSummary.fromJson( - e as Map)) - .toList(), ); } Map toJson() { + final approximateTotalCount = this.approximateTotalCount; + final dataSnapshotTime = this.dataSnapshotTime; + final metricResults = this.metricResults; final nextToken = this.nextToken; - final trafficDistributionGroupSummaryList = - this.trafficDistributionGroupSummaryList; return { + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (dataSnapshotTime != null) + 'DataSnapshotTime': unixTimestampToJson(dataSnapshotTime), + if (metricResults != null) 'MetricResults': metricResults, if (nextToken != null) 'NextToken': nextToken, - if (trafficDistributionGroupSummaryList != null) - 'TrafficDistributionGroupSummaryList': - trafficDistributionGroupSummaryList, }; } } -class ListUseCasesResponse { +class GetCurrentUserDataResponse { + /// The total count of the result, regardless of the current page size. + final int? approximateTotalCount; + /// If there are additional results, this is the token for the next set of /// results. final String? nextToken; - /// The use cases. - final List? useCaseSummaryList; + /// A list of the user data that is returned. + final List? userDataList; - ListUseCasesResponse({ + GetCurrentUserDataResponse({ + this.approximateTotalCount, this.nextToken, - this.useCaseSummaryList, + this.userDataList, }); - factory ListUseCasesResponse.fromJson(Map json) { - return ListUseCasesResponse( + factory GetCurrentUserDataResponse.fromJson(Map json) { + return GetCurrentUserDataResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, nextToken: json['NextToken'] as String?, - useCaseSummaryList: (json['UseCaseSummaryList'] as List?) + userDataList: (json['UserDataList'] as List?) ?.whereNotNull() - .map((e) => UseCase.fromJson(e as Map)) + .map((e) => UserData.fromJson(e as Map)) .toList(), ); } Map toJson() { + final approximateTotalCount = this.approximateTotalCount; final nextToken = this.nextToken; - final useCaseSummaryList = this.useCaseSummaryList; + final userDataList = this.userDataList; return { + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, if (nextToken != null) 'NextToken': nextToken, - if (useCaseSummaryList != null) 'UseCaseSummaryList': useCaseSummaryList, + if (userDataList != null) 'UserDataList': userDataList, }; } } -class ListUserHierarchyGroupsResponse { +class GetFederationTokenResponse { + /// The credentials to use for federation. + final Credentials? credentials; + + /// The URL to sign into the user's instance. + final String? signInUrl; + + /// The Amazon Resource Name (ARN) of the user. + final String? userArn; + + /// The identifier for the user. This can be the ID or the ARN of the user. + final String? userId; + + GetFederationTokenResponse({ + this.credentials, + this.signInUrl, + this.userArn, + this.userId, + }); + + factory GetFederationTokenResponse.fromJson(Map json) { + return GetFederationTokenResponse( + credentials: json['Credentials'] != null + ? Credentials.fromJson(json['Credentials'] as Map) + : null, + signInUrl: json['SignInUrl'] as String?, + userArn: json['UserArn'] as String?, + userId: json['UserId'] as String?, + ); + } + + Map toJson() { + final credentials = this.credentials; + final signInUrl = this.signInUrl; + final userArn = this.userArn; + final userId = this.userId; + return { + if (credentials != null) 'Credentials': credentials, + if (signInUrl != null) 'SignInUrl': signInUrl, + if (userArn != null) 'UserArn': userArn, + if (userId != null) 'UserId': userId, + }; + } +} + +class GetFlowAssociationResponse { + /// The identifier of the flow. + final String? flowId; + + /// The identifier of the resource. + final String? resourceId; + + /// A valid resource type. + final FlowAssociationResourceType? resourceType; + + GetFlowAssociationResponse({ + this.flowId, + this.resourceId, + this.resourceType, + }); + + factory GetFlowAssociationResponse.fromJson(Map json) { + return GetFlowAssociationResponse( + flowId: json['FlowId'] as String?, + resourceId: json['ResourceId'] as String?, + resourceType: + (json['ResourceType'] as String?)?.toFlowAssociationResourceType(), + ); + } + + Map toJson() { + final flowId = this.flowId; + final resourceId = this.resourceId; + final resourceType = this.resourceType; + return { + if (flowId != null) 'FlowId': flowId, + if (resourceId != null) 'ResourceId': resourceId, + if (resourceType != null) 'ResourceType': resourceType.toValue(), + }; + } +} + +class GetMetricDataResponse { + /// Information about the historical metrics. + /// + /// If no grouping is specified, a summary of metric data is returned. + final List? metricResults; + /// If there are additional results, this is the token for the next set of /// results. + /// + /// The token expires after 5 minutes from the time it is created. Subsequent + /// requests that use the token must use the same request parameters as the + /// request that generated the token. final String? nextToken; - /// Information about the hierarchy groups. - final List? userHierarchyGroupSummaryList; - - ListUserHierarchyGroupsResponse({ + GetMetricDataResponse({ + this.metricResults, this.nextToken, - this.userHierarchyGroupSummaryList, }); - factory ListUserHierarchyGroupsResponse.fromJson(Map json) { - return ListUserHierarchyGroupsResponse( - nextToken: json['NextToken'] as String?, - userHierarchyGroupSummaryList: (json['UserHierarchyGroupSummaryList'] - as List?) + factory GetMetricDataResponse.fromJson(Map json) { + return GetMetricDataResponse( + metricResults: (json['MetricResults'] as List?) ?.whereNotNull() - .map((e) => HierarchyGroupSummary.fromJson(e as Map)) + .map( + (e) => HistoricalMetricResult.fromJson(e as Map)) .toList(), + nextToken: json['NextToken'] as String?, ); } Map toJson() { + final metricResults = this.metricResults; final nextToken = this.nextToken; - final userHierarchyGroupSummaryList = this.userHierarchyGroupSummaryList; return { + if (metricResults != null) 'MetricResults': metricResults, if (nextToken != null) 'NextToken': nextToken, - if (userHierarchyGroupSummaryList != null) - 'UserHierarchyGroupSummaryList': userHierarchyGroupSummaryList, }; } } -class ListUsersResponse { +class GetMetricDataV2Response { + /// Information about the metrics requested in the API request If no grouping is + /// specified, a summary of metric data is returned. + final List? metricResults; + /// If there are additional results, this is the token for the next set of /// results. final String? nextToken; - /// Information about the users. - final List? userSummaryList; - - ListUsersResponse({ + GetMetricDataV2Response({ + this.metricResults, this.nextToken, - this.userSummaryList, }); - factory ListUsersResponse.fromJson(Map json) { - return ListUsersResponse( - nextToken: json['NextToken'] as String?, - userSummaryList: (json['UserSummaryList'] as List?) + factory GetMetricDataV2Response.fromJson(Map json) { + return GetMetricDataV2Response( + metricResults: (json['MetricResults'] as List?) ?.whereNotNull() - .map((e) => UserSummary.fromJson(e as Map)) + .map((e) => MetricResultV2.fromJson(e as Map)) .toList(), + nextToken: json['NextToken'] as String?, ); } Map toJson() { + final metricResults = this.metricResults; final nextToken = this.nextToken; - final userSummaryList = this.userSummaryList; return { + if (metricResults != null) 'MetricResults': metricResults, if (nextToken != null) 'NextToken': nextToken, - if (userSummaryList != null) 'UserSummaryList': userSummaryList, }; } } -/// Contains information about which channels are supported, and how many -/// contacts an agent can have on a channel simultaneously. -class MediaConcurrency { - /// The channels that agents can handle in the Contact Control Panel (CCP). - final Channel channel; +class GetPromptFileResponse { + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; - /// The number of contacts an agent can have on a channel simultaneously. - /// - /// Valid Range for VOICE: Minimum value of 1. Maximum value of 1. - /// - /// Valid Range for CHAT: Minimum value of 1. Maximum value of 10. - /// - /// Valid Range for TASK: Minimum value of 1. Maximum value of 10. - final int concurrency; + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; - /// Defines the cross-channel routing behavior for each channel that is enabled - /// for this Routing Profile. For example, this allows you to offer an agent a - /// different contact from another channel when they are currently working with - /// a contact from a Voice channel. - final CrossChannelBehavior? crossChannelBehavior; + /// A generated URL to the prompt that can be given to an unauthorized user so + /// they can access the prompt in S3. + final String? promptPresignedUrl; - MediaConcurrency({ - required this.channel, - required this.concurrency, - this.crossChannelBehavior, + GetPromptFileResponse({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.promptPresignedUrl, }); - factory MediaConcurrency.fromJson(Map json) { - return MediaConcurrency( - channel: (json['Channel'] as String).toChannel(), - concurrency: json['Concurrency'] as int, - crossChannelBehavior: json['CrossChannelBehavior'] != null - ? CrossChannelBehavior.fromJson( - json['CrossChannelBehavior'] as Map) - : null, + factory GetPromptFileResponse.fromJson(Map json) { + return GetPromptFileResponse( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + promptPresignedUrl: json['PromptPresignedUrl'] as String?, ); } Map toJson() { - final channel = this.channel; - final concurrency = this.concurrency; - final crossChannelBehavior = this.crossChannelBehavior; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final promptPresignedUrl = this.promptPresignedUrl; return { - 'Channel': channel.toValue(), - 'Concurrency': concurrency, - if (crossChannelBehavior != null) - 'CrossChannelBehavior': crossChannelBehavior, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (promptPresignedUrl != null) 'PromptPresignedUrl': promptPresignedUrl, }; } } -/// Contains the name, thresholds, and metric filters. -class MetricDataV2 { - /// The metric name, thresholds, and metric filters of the returned metric. - final MetricV2? metric; +class GetTaskTemplateResponse { + /// The Amazon Resource Name (ARN). + final String arn; - /// The corresponding value of the metric returned in the response. - final double? value; + /// A unique identifier for the task template. + final String id; - MetricDataV2({ - this.metric, - this.value, - }); + /// The name of the task template. + final String name; - factory MetricDataV2.fromJson(Map json) { - return MetricDataV2( - metric: json['Metric'] != null - ? MetricV2.fromJson(json['Metric'] as Map) - : null, - value: json['Value'] as double?, - ); - } + /// Constraints that are applicable to the fields listed. + final TaskTemplateConstraints? constraints; - Map toJson() { - final metric = this.metric; - final value = this.value; - return { - if (metric != null) 'Metric': metric, - if (value != null) 'Value': value, - }; - } -} + /// The identifier of the flow that runs by default when a task is created by + /// referencing this template. + final String? contactFlowId; -/// Contains information about the filter used when retrieving metrics. -/// MetricFiltersV2 can be used on the following metrics: -/// AVG_AGENT_CONNECTING_TIME, CONTACTS_CREATED, -/// CONTACTS_HANDLED, SUM_CONTACTS_DISCONNECTED. -class MetricFilterV2 { - /// The key to use for filtering data. - /// - /// Valid metric filter keys: INITIATION_METHOD, - /// DISCONNECT_REASON. These are the same values as the - /// InitiationMethod and DisconnectReason in the - /// contact record. For more information, see ContactTraceRecord - /// in the Amazon Connect Administrator's Guide. - final String? metricFilterKey; + /// The timestamp when the task template was created. + final DateTime? createdTime; - /// The values to use for filtering data. - /// - /// Valid metric filter values for INITIATION_METHOD: - /// INBOUND | OUTBOUND | TRANSFER | - /// QUEUE_TRANSFER | CALLBACK | API - /// - /// Valid metric filter values for DISCONNECT_REASON: - /// CUSTOMER_DISCONNECT | AGENT_DISCONNECT | - /// THIRD_PARTY_DISCONNECT | TELECOM_PROBLEM | - /// BARGED | CONTACT_FLOW_DISCONNECT | - /// OTHER | EXPIRED | API - final List? metricFilterValues; + /// The default values for fields when a task is created by referencing this + /// template. + final TaskTemplateDefaults? defaults; - MetricFilterV2({ - this.metricFilterKey, - this.metricFilterValues, - }); + /// The description of the task template. + final String? description; - factory MetricFilterV2.fromJson(Map json) { - return MetricFilterV2( - metricFilterKey: json['MetricFilterKey'] as String?, - metricFilterValues: (json['MetricFilterValues'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - ); - } + /// Fields that are part of the template. + final List? fields; - Map toJson() { - final metricFilterKey = this.metricFilterKey; - final metricFilterValues = this.metricFilterValues; - return { - if (metricFilterKey != null) 'MetricFilterKey': metricFilterKey, - if (metricFilterValues != null) 'MetricFilterValues': metricFilterValues, - }; - } -} + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? instanceId; -/// Contains information about the metric results. -class MetricResultV2 { - /// The set of metrics. - final List? collections; + /// The timestamp when the task template was last modified. + final DateTime? lastModifiedTime; - /// The dimension for the metrics. - final Map? dimensions; + /// Marks a template as ACTIVE or INACTIVE for a task + /// to refer to it. Tasks can only be created from ACTIVE + /// templates. If a template is marked as INACTIVE, then a task + /// that refers to this template cannot be created. + final TaskTemplateStatus? status; - MetricResultV2({ - this.collections, - this.dimensions, + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + GetTaskTemplateResponse({ + required this.arn, + required this.id, + required this.name, + this.constraints, + this.contactFlowId, + this.createdTime, + this.defaults, + this.description, + this.fields, + this.instanceId, + this.lastModifiedTime, + this.status, + this.tags, }); - factory MetricResultV2.fromJson(Map json) { - return MetricResultV2( - collections: (json['Collections'] as List?) + factory GetTaskTemplateResponse.fromJson(Map json) { + return GetTaskTemplateResponse( + arn: json['Arn'] as String, + id: json['Id'] as String, + name: json['Name'] as String, + constraints: json['Constraints'] != null + ? TaskTemplateConstraints.fromJson( + json['Constraints'] as Map) + : null, + contactFlowId: json['ContactFlowId'] as String?, + createdTime: timeStampFromJson(json['CreatedTime']), + defaults: json['Defaults'] != null + ? TaskTemplateDefaults.fromJson( + json['Defaults'] as Map) + : null, + description: json['Description'] as String?, + fields: (json['Fields'] as List?) ?.whereNotNull() - .map((e) => MetricDataV2.fromJson(e as Map)) + .map((e) => TaskTemplateField.fromJson(e as Map)) .toList(), - dimensions: (json['Dimensions'] as Map?) + instanceId: json['InstanceId'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + status: (json['Status'] as String?)?.toTaskTemplateStatus(), + tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final collections = this.collections; - final dimensions = this.dimensions; + final arn = this.arn; + final id = this.id; + final name = this.name; + final constraints = this.constraints; + final contactFlowId = this.contactFlowId; + final createdTime = this.createdTime; + final defaults = this.defaults; + final description = this.description; + final fields = this.fields; + final instanceId = this.instanceId; + final lastModifiedTime = this.lastModifiedTime; + final status = this.status; + final tags = this.tags; return { - if (collections != null) 'Collections': collections, - if (dimensions != null) 'Dimensions': dimensions, + 'Arn': arn, + 'Id': id, + 'Name': name, + if (constraints != null) 'Constraints': constraints, + if (contactFlowId != null) 'ContactFlowId': contactFlowId, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (defaults != null) 'Defaults': defaults, + if (description != null) 'Description': description, + if (fields != null) 'Fields': fields, + if (instanceId != null) 'InstanceId': instanceId, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, }; } } -/// Contains information about the metric. -class MetricV2 { - /// Contains the filters to be used when returning data. - final List? metricFilters; +class GetTrafficDistributionResponse { + /// The distribution of agents between the instance and its replica(s). + final AgentConfig? agentConfig; - /// The name of the metric. - /// - /// This parameter is required. The following Required = No is incorrect. - /// - final String? name; + /// The Amazon Resource Name (ARN) of the traffic distribution group. + final String? arn; - /// Contains information about the threshold for service level metrics. - final List? threshold; + /// The identifier of the traffic distribution group. This can be the ID or the + /// ARN if the API is being called in the Region where the traffic distribution + /// group was created. The ARN must be provided if the call is from the + /// replicated Region. + final String? id; - MetricV2({ - this.metricFilters, - this.name, - this.threshold, - }); + /// The distribution that determines which Amazon Web Services Regions should be + /// used to sign in agents in to both the instance and its replica(s). + final SignInConfig? signInConfig; - factory MetricV2.fromJson(Map json) { - return MetricV2( - metricFilters: (json['MetricFilters'] as List?) - ?.whereNotNull() - .map((e) => MetricFilterV2.fromJson(e as Map)) - .toList(), - name: json['Name'] as String?, - threshold: (json['Threshold'] as List?) - ?.whereNotNull() - .map((e) => ThresholdV2.fromJson(e as Map)) - .toList(), + /// The distribution of traffic between the instance and its replicas. + final TelephonyConfig? telephonyConfig; + + GetTrafficDistributionResponse({ + this.agentConfig, + this.arn, + this.id, + this.signInConfig, + this.telephonyConfig, + }); + + factory GetTrafficDistributionResponse.fromJson(Map json) { + return GetTrafficDistributionResponse( + agentConfig: json['AgentConfig'] != null + ? AgentConfig.fromJson(json['AgentConfig'] as Map) + : null, + arn: json['Arn'] as String?, + id: json['Id'] as String?, + signInConfig: json['SignInConfig'] != null + ? SignInConfig.fromJson(json['SignInConfig'] as Map) + : null, + telephonyConfig: json['TelephonyConfig'] != null + ? TelephonyConfig.fromJson( + json['TelephonyConfig'] as Map) + : null, ); } Map toJson() { - final metricFilters = this.metricFilters; - final name = this.name; - final threshold = this.threshold; + final agentConfig = this.agentConfig; + final arn = this.arn; + final id = this.id; + final signInConfig = this.signInConfig; + final telephonyConfig = this.telephonyConfig; return { - if (metricFilters != null) 'MetricFilters': metricFilters, - if (name != null) 'Name': name, - if (threshold != null) 'Threshold': threshold, + if (agentConfig != null) 'AgentConfig': agentConfig, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (signInConfig != null) 'SignInConfig': signInConfig, + if (telephonyConfig != null) 'TelephonyConfig': telephonyConfig, }; } } -enum MonitorCapability { - silentMonitor, - barge, +enum Grouping { + queue, + channel, + routingProfile, + routingStepExpression, } -extension MonitorCapabilityValueExtension on MonitorCapability { +extension GroupingValueExtension on Grouping { String toValue() { switch (this) { - case MonitorCapability.silentMonitor: - return 'SILENT_MONITOR'; - case MonitorCapability.barge: - return 'BARGE'; + case Grouping.queue: + return 'QUEUE'; + case Grouping.channel: + return 'CHANNEL'; + case Grouping.routingProfile: + return 'ROUTING_PROFILE'; + case Grouping.routingStepExpression: + return 'ROUTING_STEP_EXPRESSION'; } } } -extension MonitorCapabilityFromString on String { - MonitorCapability toMonitorCapability() { +extension GroupingFromString on String { + Grouping toGrouping() { switch (this) { - case 'SILENT_MONITOR': - return MonitorCapability.silentMonitor; - case 'BARGE': - return MonitorCapability.barge; + case 'QUEUE': + return Grouping.queue; + case 'CHANNEL': + return Grouping.channel; + case 'ROUTING_PROFILE': + return Grouping.routingProfile; + case 'ROUTING_STEP_EXPRESSION': + return Grouping.routingStepExpression; } - throw Exception('$this is not known in enum MonitorCapability'); + throw Exception('$this is not known in enum Grouping'); } } -class MonitorContactResponse { - /// The ARN of the contact. - final String? contactArn; +/// Contains information about a hierarchy group. +class HierarchyGroup { + /// The Amazon Resource Name (ARN) of the hierarchy group. + final String? arn; - /// The identifier of the contact. - final String? contactId; + /// Information about the levels in the hierarchy group. + final HierarchyPath? hierarchyPath; - MonitorContactResponse({ - this.contactArn, - this.contactId, + /// The identifier of the hierarchy group. + final String? id; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The identifier of the level in the hierarchy group. + final String? levelId; + + /// The name of the hierarchy group. + final String? name; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + HierarchyGroup({ + this.arn, + this.hierarchyPath, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.levelId, + this.name, + this.tags, }); - factory MonitorContactResponse.fromJson(Map json) { - return MonitorContactResponse( - contactArn: json['ContactArn'] as String?, - contactId: json['ContactId'] as String?, + factory HierarchyGroup.fromJson(Map json) { + return HierarchyGroup( + arn: json['Arn'] as String?, + hierarchyPath: json['HierarchyPath'] != null + ? HierarchyPath.fromJson( + json['HierarchyPath'] as Map) + : null, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + levelId: json['LevelId'] as String?, + name: json['Name'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final contactArn = this.contactArn; - final contactId = this.contactId; + final arn = this.arn; + final hierarchyPath = this.hierarchyPath; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final levelId = this.levelId; + final name = this.name; + final tags = this.tags; return { - if (contactArn != null) 'ContactArn': contactArn, - if (contactId != null) 'ContactId': contactId, + if (arn != null) 'Arn': arn, + if (hierarchyPath != null) 'HierarchyPath': hierarchyPath, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (levelId != null) 'LevelId': levelId, + if (name != null) 'Name': name, + if (tags != null) 'Tags': tags, }; } } -enum NotificationContentType { - plainText, -} +/// A leaf node condition which can be used to specify a hierarchy group +/// condition. +class HierarchyGroupCondition { + /// The type of hierarchy group match. + final HierarchyGroupMatchType? hierarchyGroupMatchType; -extension NotificationContentTypeValueExtension on NotificationContentType { - String toValue() { - switch (this) { - case NotificationContentType.plainText: - return 'PLAIN_TEXT'; - } - } -} + /// The value in the hierarchy group condition. + final String? value; -extension NotificationContentTypeFromString on String { - NotificationContentType toNotificationContentType() { - switch (this) { - case 'PLAIN_TEXT': - return NotificationContentType.plainText; - } - throw Exception('$this is not known in enum NotificationContentType'); + HierarchyGroupCondition({ + this.hierarchyGroupMatchType, + this.value, + }); + + Map toJson() { + final hierarchyGroupMatchType = this.hierarchyGroupMatchType; + final value = this.value; + return { + if (hierarchyGroupMatchType != null) + 'HierarchyGroupMatchType': hierarchyGroupMatchType.toValue(), + if (value != null) 'Value': value, + }; } } -enum NotificationDeliveryType { - email, +enum HierarchyGroupMatchType { + exact, + withChildGroups, } -extension NotificationDeliveryTypeValueExtension on NotificationDeliveryType { +extension HierarchyGroupMatchTypeValueExtension on HierarchyGroupMatchType { String toValue() { switch (this) { - case NotificationDeliveryType.email: - return 'EMAIL'; + case HierarchyGroupMatchType.exact: + return 'EXACT'; + case HierarchyGroupMatchType.withChildGroups: + return 'WITH_CHILD_GROUPS'; } } } -extension NotificationDeliveryTypeFromString on String { - NotificationDeliveryType toNotificationDeliveryType() { +extension HierarchyGroupMatchTypeFromString on String { + HierarchyGroupMatchType toHierarchyGroupMatchType() { switch (this) { - case 'EMAIL': - return NotificationDeliveryType.email; + case 'EXACT': + return HierarchyGroupMatchType.exact; + case 'WITH_CHILD_GROUPS': + return HierarchyGroupMatchType.withChildGroups; } - throw Exception('$this is not known in enum NotificationDeliveryType'); + throw Exception('$this is not known in enum HierarchyGroupMatchType'); } } -/// The type of notification recipient. -class NotificationRecipientType { - /// A list of user IDs. - final List? userIds; +/// Contains summary information about a hierarchy group. +class HierarchyGroupSummary { + /// The Amazon Resource Name (ARN) of the hierarchy group. + final String? arn; - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. Amazon Connect - /// users with the specified tags will be notified. - final Map? userTags; + /// The identifier of the hierarchy group. + final String? id; - NotificationRecipientType({ - this.userIds, - this.userTags, + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the hierarchy group. + final String? name; + + HierarchyGroupSummary({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, }); - factory NotificationRecipientType.fromJson(Map json) { - return NotificationRecipientType( - userIds: (json['UserIds'] as List?) - ?.whereNotNull() - .map((e) => e as String) - .toList(), - userTags: (json['UserTags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory HierarchyGroupSummary.fromJson(Map json) { + return HierarchyGroupSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, ); } Map toJson() { - final userIds = this.userIds; - final userTags = this.userTags; + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; return { - if (userIds != null) 'UserIds': userIds, - if (userTags != null) 'UserTags': userTags, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, }; } } -/// Information about a reference when the referenceType is -/// NUMBER. Otherwise, null. -class NumberReference { - /// Identifier of the number reference. - final String? name; +/// Information about the hierarchy group. +class HierarchyGroupSummaryReference { + /// The Amazon Resource Name (ARN) for the hierarchy group. + final String? arn; - /// A valid number. - final String? value; + /// The unique identifier for the hierarchy group. + final String? id; - NumberReference({ - this.name, - this.value, + HierarchyGroupSummaryReference({ + this.arn, + this.id, }); - factory NumberReference.fromJson(Map json) { - return NumberReference( - name: json['Name'] as String?, - value: json['Value'] as String?, + factory HierarchyGroupSummaryReference.fromJson(Map json) { + return HierarchyGroupSummaryReference( + arn: json['Arn'] as String?, + id: json['Id'] as String?, ); } Map toJson() { - final name = this.name; - final value = this.value; + final arn = this.arn; + final id = this.id; return { - if (name != null) 'Name': name, - if (value != null) 'Value': value, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, }; } } -enum NumericQuestionPropertyAutomationLabel { - overallCustomerSentimentScore, - overallAgentSentimentScore, - nonTalkTime, - nonTalkTimePercentage, - numberOfInterruptions, - contactDuration, - agentInteractionDuration, - customerHoldTime, -} +/// Information about the agent hierarchy. Hierarchies can be configured with up +/// to five levels. +class HierarchyGroups { + /// The group at level one of the agent hierarchy. + final AgentHierarchyGroup? level1; -extension NumericQuestionPropertyAutomationLabelValueExtension - on NumericQuestionPropertyAutomationLabel { - String toValue() { - switch (this) { - case NumericQuestionPropertyAutomationLabel.overallCustomerSentimentScore: - return 'OVERALL_CUSTOMER_SENTIMENT_SCORE'; - case NumericQuestionPropertyAutomationLabel.overallAgentSentimentScore: - return 'OVERALL_AGENT_SENTIMENT_SCORE'; - case NumericQuestionPropertyAutomationLabel.nonTalkTime: - return 'NON_TALK_TIME'; - case NumericQuestionPropertyAutomationLabel.nonTalkTimePercentage: - return 'NON_TALK_TIME_PERCENTAGE'; - case NumericQuestionPropertyAutomationLabel.numberOfInterruptions: - return 'NUMBER_OF_INTERRUPTIONS'; - case NumericQuestionPropertyAutomationLabel.contactDuration: - return 'CONTACT_DURATION'; - case NumericQuestionPropertyAutomationLabel.agentInteractionDuration: - return 'AGENT_INTERACTION_DURATION'; - case NumericQuestionPropertyAutomationLabel.customerHoldTime: - return 'CUSTOMER_HOLD_TIME'; - } - } -} + /// The group at level two of the agent hierarchy. + final AgentHierarchyGroup? level2; -extension NumericQuestionPropertyAutomationLabelFromString on String { - NumericQuestionPropertyAutomationLabel - toNumericQuestionPropertyAutomationLabel() { - switch (this) { - case 'OVERALL_CUSTOMER_SENTIMENT_SCORE': - return NumericQuestionPropertyAutomationLabel - .overallCustomerSentimentScore; - case 'OVERALL_AGENT_SENTIMENT_SCORE': - return NumericQuestionPropertyAutomationLabel - .overallAgentSentimentScore; - case 'NON_TALK_TIME': - return NumericQuestionPropertyAutomationLabel.nonTalkTime; - case 'NON_TALK_TIME_PERCENTAGE': - return NumericQuestionPropertyAutomationLabel.nonTalkTimePercentage; - case 'NUMBER_OF_INTERRUPTIONS': - return NumericQuestionPropertyAutomationLabel.numberOfInterruptions; - case 'CONTACT_DURATION': - return NumericQuestionPropertyAutomationLabel.contactDuration; - case 'AGENT_INTERACTION_DURATION': - return NumericQuestionPropertyAutomationLabel.agentInteractionDuration; - case 'CUSTOMER_HOLD_TIME': - return NumericQuestionPropertyAutomationLabel.customerHoldTime; - } - throw Exception( - '$this is not known in enum NumericQuestionPropertyAutomationLabel'); - } -} + /// The group at level three of the agent hierarchy. + final AgentHierarchyGroup? level3; -/// Information about the property value used in automation of a numeric -/// questions. Label values are associated with minimum and maximum values for -/// the numeric question. -/// -///
        -///
      • -/// Sentiment scores have a minimum value of -5 and maximum value of 5. -///
      • -///
      • -/// Duration labels, such as NON_TALK_TIME, -/// CONTACT_DURATION, AGENT_INTERACTION_DURATION, -/// CUSTOMER_HOLD_TIME have a minimum value of 0 and maximum value -/// of 28800. -///
      • -///
      • -/// Percentages have a minimum value of 0 and maximum value of 100. -///
      • -///
      • -/// NUMBER_OF_INTERRUPTIONS has a minimum value of 0 and maximum -/// value of 1000. -///
      • -///
      -class NumericQuestionPropertyValueAutomation { - /// The property label of the automation. - final NumericQuestionPropertyAutomationLabel label; + /// The group at level four of the agent hierarchy. + final AgentHierarchyGroup? level4; - NumericQuestionPropertyValueAutomation({ - required this.label, + /// The group at level five of the agent hierarchy. + final AgentHierarchyGroup? level5; + + HierarchyGroups({ + this.level1, + this.level2, + this.level3, + this.level4, + this.level5, }); - factory NumericQuestionPropertyValueAutomation.fromJson( - Map json) { - return NumericQuestionPropertyValueAutomation( - label: - (json['Label'] as String).toNumericQuestionPropertyAutomationLabel(), + factory HierarchyGroups.fromJson(Map json) { + return HierarchyGroups( + level1: json['Level1'] != null + ? AgentHierarchyGroup.fromJson(json['Level1'] as Map) + : null, + level2: json['Level2'] != null + ? AgentHierarchyGroup.fromJson(json['Level2'] as Map) + : null, + level3: json['Level3'] != null + ? AgentHierarchyGroup.fromJson(json['Level3'] as Map) + : null, + level4: json['Level4'] != null + ? AgentHierarchyGroup.fromJson(json['Level4'] as Map) + : null, + level5: json['Level5'] != null + ? AgentHierarchyGroup.fromJson(json['Level5'] as Map) + : null, ); } Map toJson() { - final label = this.label; + final level1 = this.level1; + final level2 = this.level2; + final level3 = this.level3; + final level4 = this.level4; + final level5 = this.level5; return { - 'Label': label.toValue(), + if (level1 != null) 'Level1': level1, + if (level2 != null) 'Level2': level2, + if (level3 != null) 'Level3': level3, + if (level4 != null) 'Level4': level4, + if (level5 != null) 'Level5': level5, }; } } -/// The outbound caller ID name, number, and outbound whisper flow. -class OutboundCallerConfig { - /// The caller ID name. - final String? outboundCallerIdName; +/// Contains information about a hierarchy level. +class HierarchyLevel { + /// The Amazon Resource Name (ARN) of the hierarchy level. + final String? arn; - /// The caller ID number. - final String? outboundCallerIdNumberId; + /// The identifier of the hierarchy level. + final String? id; - /// The outbound whisper flow to be used during an outbound call. - final String? outboundFlowId; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; - OutboundCallerConfig({ - this.outboundCallerIdName, - this.outboundCallerIdNumberId, - this.outboundFlowId, + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the hierarchy level. + final String? name; + + HierarchyLevel({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, }); - factory OutboundCallerConfig.fromJson(Map json) { - return OutboundCallerConfig( - outboundCallerIdName: json['OutboundCallerIdName'] as String?, - outboundCallerIdNumberId: json['OutboundCallerIdNumberId'] as String?, - outboundFlowId: json['OutboundFlowId'] as String?, + factory HierarchyLevel.fromJson(Map json) { + return HierarchyLevel( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, ); } Map toJson() { - final outboundCallerIdName = this.outboundCallerIdName; - final outboundCallerIdNumberId = this.outboundCallerIdNumberId; - final outboundFlowId = this.outboundFlowId; + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; return { - if (outboundCallerIdName != null) - 'OutboundCallerIdName': outboundCallerIdName, - if (outboundCallerIdNumberId != null) - 'OutboundCallerIdNumberId': outboundCallerIdNumberId, - if (outboundFlowId != null) 'OutboundFlowId': outboundFlowId, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, }; } } -/// The customer's details. -class ParticipantDetails { - /// Display name of the participant. - final String displayName; +/// Contains information about the hierarchy level to update. +class HierarchyLevelUpdate { + /// The name of the user hierarchy level. Must not be more than 50 characters. + final String name; - ParticipantDetails({ - required this.displayName, + HierarchyLevelUpdate({ + required this.name, }); Map toJson() { - final displayName = this.displayName; + final name = this.name; return { - 'DisplayName': displayName, + 'Name': name, }; } } -/// The details to add for the participant. -class ParticipantDetailsToAdd { - /// The display name of the participant. - final String? displayName; +/// Contains information about the levels of a hierarchy group. +class HierarchyPath { + /// Information about level five. + final HierarchyGroupSummary? levelFive; - /// The role of the participant being added. - final ParticipantRole? participantRole; + /// Information about level four. + final HierarchyGroupSummary? levelFour; - ParticipantDetailsToAdd({ - this.displayName, - this.participantRole, - }); + /// Information about level one. + final HierarchyGroupSummary? levelOne; - Map toJson() { - final displayName = this.displayName; - final participantRole = this.participantRole; - return { - if (displayName != null) 'DisplayName': displayName, - if (participantRole != null) 'ParticipantRole': participantRole.toValue(), - }; - } -} + /// Information about level three. + final HierarchyGroupSummary? levelThree; -enum ParticipantRole { - agent, - customer, - system, - customBot, -} + /// Information about level two. + final HierarchyGroupSummary? levelTwo; -extension ParticipantRoleValueExtension on ParticipantRole { - String toValue() { - switch (this) { - case ParticipantRole.agent: - return 'AGENT'; - case ParticipantRole.customer: - return 'CUSTOMER'; - case ParticipantRole.system: - return 'SYSTEM'; - case ParticipantRole.customBot: - return 'CUSTOM_BOT'; - } - } -} + HierarchyPath({ + this.levelFive, + this.levelFour, + this.levelOne, + this.levelThree, + this.levelTwo, + }); -extension ParticipantRoleFromString on String { - ParticipantRole toParticipantRole() { - switch (this) { - case 'AGENT': - return ParticipantRole.agent; - case 'CUSTOMER': - return ParticipantRole.customer; - case 'SYSTEM': - return ParticipantRole.system; - case 'CUSTOM_BOT': - return ParticipantRole.customBot; - } - throw Exception('$this is not known in enum ParticipantRole'); + factory HierarchyPath.fromJson(Map json) { + return HierarchyPath( + levelFive: json['LevelFive'] != null + ? HierarchyGroupSummary.fromJson( + json['LevelFive'] as Map) + : null, + levelFour: json['LevelFour'] != null + ? HierarchyGroupSummary.fromJson( + json['LevelFour'] as Map) + : null, + levelOne: json['LevelOne'] != null + ? HierarchyGroupSummary.fromJson( + json['LevelOne'] as Map) + : null, + levelThree: json['LevelThree'] != null + ? HierarchyGroupSummary.fromJson( + json['LevelThree'] as Map) + : null, + levelTwo: json['LevelTwo'] != null + ? HierarchyGroupSummary.fromJson( + json['LevelTwo'] as Map) + : null, + ); } -} - -enum ParticipantTimerAction { - unset, -} -extension ParticipantTimerActionValueExtension on ParticipantTimerAction { - String toValue() { - switch (this) { - case ParticipantTimerAction.unset: - return 'Unset'; - } + Map toJson() { + final levelFive = this.levelFive; + final levelFour = this.levelFour; + final levelOne = this.levelOne; + final levelThree = this.levelThree; + final levelTwo = this.levelTwo; + return { + if (levelFive != null) 'LevelFive': levelFive, + if (levelFour != null) 'LevelFour': levelFour, + if (levelOne != null) 'LevelOne': levelOne, + if (levelThree != null) 'LevelThree': levelThree, + if (levelTwo != null) 'LevelTwo': levelTwo, + }; } } -extension ParticipantTimerActionFromString on String { - ParticipantTimerAction toParticipantTimerAction() { - switch (this) { - case 'Unset': - return ParticipantTimerAction.unset; - } - throw Exception('$this is not known in enum ParticipantTimerAction'); - } -} +/// Information about the levels in the hierarchy group. +class HierarchyPathReference { + /// Information about level five. + final HierarchyGroupSummaryReference? levelFive; -/// Configuration information for the timer. After the timer configuration is -/// set, it persists for the duration of the chat. It persists across new -/// contacts in the chain, for example, transfer contacts. -/// -/// For more information about how chat timeouts work, see Set -/// up chat timeouts for human participants. -class ParticipantTimerConfiguration { - /// The role of the participant in the chat conversation. - final TimerEligibleParticipantRoles participantRole; + /// Information about level four. + final HierarchyGroupSummaryReference? levelFour; - /// The type of timer. IDLE indicates the timer applies for - /// considering a human chat participant as idle. - /// DISCONNECT_NONCUSTOMER indicates the timer applies to - /// automatically disconnecting a chat participant due to idleness. - final ParticipantTimerType timerType; + /// Information about level one. + final HierarchyGroupSummaryReference? levelOne; - /// The value of the timer. Either the timer action (Unset to delete the timer), - /// or the duration of the timer in minutes. Only one value can be set. - final ParticipantTimerValue timerValue; + /// Information about level three. + final HierarchyGroupSummaryReference? levelThree; - ParticipantTimerConfiguration({ - required this.participantRole, - required this.timerType, - required this.timerValue, + /// Information about level two. + final HierarchyGroupSummaryReference? levelTwo; + + HierarchyPathReference({ + this.levelFive, + this.levelFour, + this.levelOne, + this.levelThree, + this.levelTwo, }); + factory HierarchyPathReference.fromJson(Map json) { + return HierarchyPathReference( + levelFive: json['LevelFive'] != null + ? HierarchyGroupSummaryReference.fromJson( + json['LevelFive'] as Map) + : null, + levelFour: json['LevelFour'] != null + ? HierarchyGroupSummaryReference.fromJson( + json['LevelFour'] as Map) + : null, + levelOne: json['LevelOne'] != null + ? HierarchyGroupSummaryReference.fromJson( + json['LevelOne'] as Map) + : null, + levelThree: json['LevelThree'] != null + ? HierarchyGroupSummaryReference.fromJson( + json['LevelThree'] as Map) + : null, + levelTwo: json['LevelTwo'] != null + ? HierarchyGroupSummaryReference.fromJson( + json['LevelTwo'] as Map) + : null, + ); + } + Map toJson() { - final participantRole = this.participantRole; - final timerType = this.timerType; - final timerValue = this.timerValue; + final levelFive = this.levelFive; + final levelFour = this.levelFour; + final levelOne = this.levelOne; + final levelThree = this.levelThree; + final levelTwo = this.levelTwo; return { - 'ParticipantRole': participantRole.toValue(), - 'TimerType': timerType.toValue(), - 'TimerValue': timerValue, + if (levelFive != null) 'LevelFive': levelFive, + if (levelFour != null) 'LevelFour': levelFour, + if (levelOne != null) 'LevelOne': levelOne, + if (levelThree != null) 'LevelThree': levelThree, + if (levelTwo != null) 'LevelTwo': levelTwo, }; } } -enum ParticipantTimerType { - idle, - disconnectNoncustomer, -} +/// Contains information about a hierarchy structure. +class HierarchyStructure { + /// Information about level five. + final HierarchyLevel? levelFive; -extension ParticipantTimerTypeValueExtension on ParticipantTimerType { - String toValue() { - switch (this) { - case ParticipantTimerType.idle: - return 'IDLE'; - case ParticipantTimerType.disconnectNoncustomer: - return 'DISCONNECT_NONCUSTOMER'; - } - } -} + /// Information about level four. + final HierarchyLevel? levelFour; -extension ParticipantTimerTypeFromString on String { - ParticipantTimerType toParticipantTimerType() { - switch (this) { - case 'IDLE': - return ParticipantTimerType.idle; - case 'DISCONNECT_NONCUSTOMER': - return ParticipantTimerType.disconnectNoncustomer; - } - throw Exception('$this is not known in enum ParticipantTimerType'); - } -} + /// Information about level one. + final HierarchyLevel? levelOne; -/// The value of the timer. Either the timer action (Unset to -/// delete the timer), or the duration of the timer in minutes. Only one value -/// can be set. -/// -/// For more information about how chat timeouts work, see Set -/// up chat timeouts for human participants. -class ParticipantTimerValue { - /// The timer action. Currently only one value is allowed: Unset. - /// It deletes a timer. - final ParticipantTimerAction? participantTimerAction; + /// Information about level three. + final HierarchyLevel? levelThree; - /// The duration of a timer, in minutes. - final int? participantTimerDurationInMinutes; + /// Information about level two. + final HierarchyLevel? levelTwo; - ParticipantTimerValue({ - this.participantTimerAction, - this.participantTimerDurationInMinutes, + HierarchyStructure({ + this.levelFive, + this.levelFour, + this.levelOne, + this.levelThree, + this.levelTwo, }); - Map toJson() { - final participantTimerAction = this.participantTimerAction; - final participantTimerDurationInMinutes = - this.participantTimerDurationInMinutes; - return { - if (participantTimerAction != null) - 'ParticipantTimerAction': participantTimerAction.toValue(), - if (participantTimerDurationInMinutes != null) - 'ParticipantTimerDurationInMinutes': participantTimerDurationInMinutes, - }; + factory HierarchyStructure.fromJson(Map json) { + return HierarchyStructure( + levelFive: json['LevelFive'] != null + ? HierarchyLevel.fromJson(json['LevelFive'] as Map) + : null, + levelFour: json['LevelFour'] != null + ? HierarchyLevel.fromJson(json['LevelFour'] as Map) + : null, + levelOne: json['LevelOne'] != null + ? HierarchyLevel.fromJson(json['LevelOne'] as Map) + : null, + levelThree: json['LevelThree'] != null + ? HierarchyLevel.fromJson(json['LevelThree'] as Map) + : null, + levelTwo: json['LevelTwo'] != null + ? HierarchyLevel.fromJson(json['LevelTwo'] as Map) + : null, + ); } -} -/// The credentials used by the participant. -class ParticipantTokenCredentials { - /// The expiration of the token. It's specified in ISO 8601 format: - /// yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. - final String? expiry; + Map toJson() { + final levelFive = this.levelFive; + final levelFour = this.levelFour; + final levelOne = this.levelOne; + final levelThree = this.levelThree; + final levelTwo = this.levelTwo; + return { + if (levelFive != null) 'LevelFive': levelFive, + if (levelFour != null) 'LevelFour': levelFour, + if (levelOne != null) 'LevelOne': levelOne, + if (levelThree != null) 'LevelThree': levelThree, + if (levelTwo != null) 'LevelTwo': levelTwo, + }; + } +} - /// The token used by the chat participant to call CreateParticipantConnection. - /// The participant token is valid for the lifetime of a chat participant. - final String? participantToken; +/// Contains information about the level hierarchy to update. +class HierarchyStructureUpdate { + /// The update for level five. + final HierarchyLevelUpdate? levelFive; - ParticipantTokenCredentials({ - this.expiry, - this.participantToken, + /// The update for level four. + final HierarchyLevelUpdate? levelFour; + + /// The update for level one. + final HierarchyLevelUpdate? levelOne; + + /// The update for level three. + final HierarchyLevelUpdate? levelThree; + + /// The update for level two. + final HierarchyLevelUpdate? levelTwo; + + HierarchyStructureUpdate({ + this.levelFive, + this.levelFour, + this.levelOne, + this.levelThree, + this.levelTwo, }); - factory ParticipantTokenCredentials.fromJson(Map json) { - return ParticipantTokenCredentials( - expiry: json['Expiry'] as String?, - participantToken: json['ParticipantToken'] as String?, + Map toJson() { + final levelFive = this.levelFive; + final levelFour = this.levelFour; + final levelOne = this.levelOne; + final levelThree = this.levelThree; + final levelTwo = this.levelTwo; + return { + if (levelFive != null) 'LevelFive': levelFive, + if (levelFour != null) 'LevelFour': levelFour, + if (levelOne != null) 'LevelOne': levelOne, + if (levelThree != null) 'LevelThree': levelThree, + if (levelTwo != null) 'LevelTwo': levelTwo, + }; + } +} + +/// Contains information about a historical metric. For a description of each +/// metric, see Historical +/// Metrics Definitions in the Amazon Connect Administrator Guide. +class HistoricalMetric { + /// The name of the metric. + final HistoricalMetricName? name; + + /// The statistic for the metric. + final Statistic? statistic; + + /// The threshold for the metric, used with service level metrics. + final Threshold? threshold; + + /// The unit for the metric. + final Unit? unit; + + HistoricalMetric({ + this.name, + this.statistic, + this.threshold, + this.unit, + }); + + factory HistoricalMetric.fromJson(Map json) { + return HistoricalMetric( + name: (json['Name'] as String?)?.toHistoricalMetricName(), + statistic: (json['Statistic'] as String?)?.toStatistic(), + threshold: json['Threshold'] != null + ? Threshold.fromJson(json['Threshold'] as Map) + : null, + unit: (json['Unit'] as String?)?.toUnit(), ); } Map toJson() { - final expiry = this.expiry; - final participantToken = this.participantToken; + final name = this.name; + final statistic = this.statistic; + final threshold = this.threshold; + final unit = this.unit; return { - if (expiry != null) 'Expiry': expiry, - if (participantToken != null) 'ParticipantToken': participantToken, + if (name != null) 'Name': name.toValue(), + if (statistic != null) 'Statistic': statistic.toValue(), + if (threshold != null) 'Threshold': threshold, + if (unit != null) 'Unit': unit.toValue(), }; } } -/// Enable persistent chats. For more information about enabling persistent -/// chat, and for example use cases and how to configure for them, see Enable -/// persistent chat. -class PersistentChat { - /// The contactId that is used for rehydration depends on the rehydration type. - /// RehydrationType is required for persistent chat. - /// - ///
        - ///
      • - /// ENTIRE_PAST_SESSION: Rehydrates a chat from the most recently - /// terminated past chat contact of the specified past ended chat session. To - /// use this type, provide the initialContactId of the past ended - /// chat session in the sourceContactId field. In this type, Amazon - /// Connect determines the most recent chat contact on the specified chat - /// session that has ended, and uses it to start a persistent chat. - ///
      • - ///
      • - /// FROM_SEGMENT: Rehydrates a chat from the past chat contact that - /// is specified in the sourceContactId field. - ///
      • - ///
      - /// The actual contactId used for rehydration is provided in the response of - /// this API. - final RehydrationType? rehydrationType; +/// Contains the data for a historical metric. +class HistoricalMetricData { + /// Information about the metric. + final HistoricalMetric? metric; - /// The contactId from which a persistent chat session must be started. - final String? sourceContactId; + /// The value of the metric. + final double? value; - PersistentChat({ - this.rehydrationType, - this.sourceContactId, + HistoricalMetricData({ + this.metric, + this.value, }); + factory HistoricalMetricData.fromJson(Map json) { + return HistoricalMetricData( + metric: json['Metric'] != null + ? HistoricalMetric.fromJson(json['Metric'] as Map) + : null, + value: json['Value'] as double?, + ); + } + Map toJson() { - final rehydrationType = this.rehydrationType; - final sourceContactId = this.sourceContactId; + final metric = this.metric; + final value = this.value; return { - if (rehydrationType != null) 'RehydrationType': rehydrationType.toValue(), - if (sourceContactId != null) 'SourceContactId': sourceContactId, + if (metric != null) 'Metric': metric, + if (value != null) 'Value': value, }; } } -enum PhoneNumberCountryCode { - af, - al, - dz, - as, - ad, - ao, - ai, - aq, - ag, - ar, - am, - aw, - au, - at, - az, - bs, - bh, - bd, - bb, - by, - be, - bz, - bj, - bm, - bt, - bo, - ba, - bw, - br, - io, - vg, - bn, - bg, - bf, - bi, - kh, - cm, - ca, - cv, - ky, - cf, - td, - cl, - cn, - cx, - cc, - co, - km, - ck, - cr, - hr, - cu, - cw, - cy, - cz, - cd, - dk, - dj, - dm, - $do, - tl, - ec, - eg, - sv, - gq, - er, - ee, - et, - fk, - fo, - fj, - fi, - fr, - pf, - ga, - gm, - ge, - de, - gh, - gi, - gr, - gl, - gd, - gu, - gt, - gg, - gn, - gw, - gy, - ht, - hn, - hk, - hu, - $is, - $in, - id, - ir, - iq, - ie, - im, - il, - it, - ci, - jm, - jp, - je, - jo, - kz, - ke, - ki, - kw, - kg, - la, - lv, - lb, - ls, - lr, - ly, - li, - lt, - lu, - mo, - mk, - mg, - mw, - my, - mv, - ml, - mt, - mh, - mr, - mu, - yt, - mx, - fm, - md, - mc, - mn, - me, - ms, - ma, - mz, - mm, - na, - nr, - np, - nl, - an, - nc, - nz, - ni, - ne, - ng, - nu, - kp, - mp, - no, - om, - pk, - pw, - pa, - pg, - py, - pe, - ph, - pn, - pl, - pt, - pr, - qa, - cg, - re, - ro, - ru, - rw, - bl, - sh, - kn, - lc, - mf, - pm, - vc, - ws, - sm, - st, - sa, - sn, - rs, - sc, - sl, - sg, - sx, - sk, - si, - sb, - so, - za, - kr, - es, - lk, - sd, - sr, - sj, - sz, - se, - ch, - sy, - tw, - tj, - tz, - th, - tg, - tk, - to, - tt, - tn, - tr, - tm, - tc, - tv, - vi, - ug, - ua, - ae, - gb, - us, - uy, - uz, - vu, - va, - ve, - vn, - wf, - eh, - ye, - zm, - zw, +/// The historical metric names. +enum HistoricalMetricName { + contactsQueued, + contactsHandled, + contactsAbandoned, + contactsConsulted, + contactsAgentHungUpFirst, + contactsHandledIncoming, + contactsHandledOutbound, + contactsHoldAbandons, + contactsTransferredIn, + contactsTransferredOut, + contactsTransferredInFromQueue, + contactsTransferredOutFromQueue, + contactsMissed, + callbackContactsHandled, + apiContactsHandled, + occupancy, + handleTime, + afterContactWorkTime, + queuedTime, + abandonTime, + queueAnswerTime, + holdTime, + interactionTime, + interactionAndHoldTime, + serviceLevel, } -extension PhoneNumberCountryCodeValueExtension on PhoneNumberCountryCode { +extension HistoricalMetricNameValueExtension on HistoricalMetricName { String toValue() { switch (this) { - case PhoneNumberCountryCode.af: - return 'AF'; - case PhoneNumberCountryCode.al: - return 'AL'; - case PhoneNumberCountryCode.dz: - return 'DZ'; - case PhoneNumberCountryCode.as: - return 'AS'; - case PhoneNumberCountryCode.ad: - return 'AD'; - case PhoneNumberCountryCode.ao: - return 'AO'; - case PhoneNumberCountryCode.ai: - return 'AI'; - case PhoneNumberCountryCode.aq: - return 'AQ'; - case PhoneNumberCountryCode.ag: - return 'AG'; - case PhoneNumberCountryCode.ar: - return 'AR'; - case PhoneNumberCountryCode.am: - return 'AM'; - case PhoneNumberCountryCode.aw: - return 'AW'; - case PhoneNumberCountryCode.au: - return 'AU'; - case PhoneNumberCountryCode.at: - return 'AT'; - case PhoneNumberCountryCode.az: - return 'AZ'; - case PhoneNumberCountryCode.bs: - return 'BS'; - case PhoneNumberCountryCode.bh: - return 'BH'; - case PhoneNumberCountryCode.bd: - return 'BD'; - case PhoneNumberCountryCode.bb: - return 'BB'; - case PhoneNumberCountryCode.by: - return 'BY'; - case PhoneNumberCountryCode.be: - return 'BE'; - case PhoneNumberCountryCode.bz: - return 'BZ'; - case PhoneNumberCountryCode.bj: - return 'BJ'; - case PhoneNumberCountryCode.bm: - return 'BM'; - case PhoneNumberCountryCode.bt: - return 'BT'; - case PhoneNumberCountryCode.bo: - return 'BO'; - case PhoneNumberCountryCode.ba: - return 'BA'; - case PhoneNumberCountryCode.bw: - return 'BW'; - case PhoneNumberCountryCode.br: - return 'BR'; - case PhoneNumberCountryCode.io: - return 'IO'; - case PhoneNumberCountryCode.vg: - return 'VG'; - case PhoneNumberCountryCode.bn: - return 'BN'; - case PhoneNumberCountryCode.bg: - return 'BG'; - case PhoneNumberCountryCode.bf: - return 'BF'; - case PhoneNumberCountryCode.bi: - return 'BI'; - case PhoneNumberCountryCode.kh: - return 'KH'; - case PhoneNumberCountryCode.cm: - return 'CM'; - case PhoneNumberCountryCode.ca: - return 'CA'; - case PhoneNumberCountryCode.cv: + case HistoricalMetricName.contactsQueued: + return 'CONTACTS_QUEUED'; + case HistoricalMetricName.contactsHandled: + return 'CONTACTS_HANDLED'; + case HistoricalMetricName.contactsAbandoned: + return 'CONTACTS_ABANDONED'; + case HistoricalMetricName.contactsConsulted: + return 'CONTACTS_CONSULTED'; + case HistoricalMetricName.contactsAgentHungUpFirst: + return 'CONTACTS_AGENT_HUNG_UP_FIRST'; + case HistoricalMetricName.contactsHandledIncoming: + return 'CONTACTS_HANDLED_INCOMING'; + case HistoricalMetricName.contactsHandledOutbound: + return 'CONTACTS_HANDLED_OUTBOUND'; + case HistoricalMetricName.contactsHoldAbandons: + return 'CONTACTS_HOLD_ABANDONS'; + case HistoricalMetricName.contactsTransferredIn: + return 'CONTACTS_TRANSFERRED_IN'; + case HistoricalMetricName.contactsTransferredOut: + return 'CONTACTS_TRANSFERRED_OUT'; + case HistoricalMetricName.contactsTransferredInFromQueue: + return 'CONTACTS_TRANSFERRED_IN_FROM_QUEUE'; + case HistoricalMetricName.contactsTransferredOutFromQueue: + return 'CONTACTS_TRANSFERRED_OUT_FROM_QUEUE'; + case HistoricalMetricName.contactsMissed: + return 'CONTACTS_MISSED'; + case HistoricalMetricName.callbackContactsHandled: + return 'CALLBACK_CONTACTS_HANDLED'; + case HistoricalMetricName.apiContactsHandled: + return 'API_CONTACTS_HANDLED'; + case HistoricalMetricName.occupancy: + return 'OCCUPANCY'; + case HistoricalMetricName.handleTime: + return 'HANDLE_TIME'; + case HistoricalMetricName.afterContactWorkTime: + return 'AFTER_CONTACT_WORK_TIME'; + case HistoricalMetricName.queuedTime: + return 'QUEUED_TIME'; + case HistoricalMetricName.abandonTime: + return 'ABANDON_TIME'; + case HistoricalMetricName.queueAnswerTime: + return 'QUEUE_ANSWER_TIME'; + case HistoricalMetricName.holdTime: + return 'HOLD_TIME'; + case HistoricalMetricName.interactionTime: + return 'INTERACTION_TIME'; + case HistoricalMetricName.interactionAndHoldTime: + return 'INTERACTION_AND_HOLD_TIME'; + case HistoricalMetricName.serviceLevel: + return 'SERVICE_LEVEL'; + } + } +} + +extension HistoricalMetricNameFromString on String { + HistoricalMetricName toHistoricalMetricName() { + switch (this) { + case 'CONTACTS_QUEUED': + return HistoricalMetricName.contactsQueued; + case 'CONTACTS_HANDLED': + return HistoricalMetricName.contactsHandled; + case 'CONTACTS_ABANDONED': + return HistoricalMetricName.contactsAbandoned; + case 'CONTACTS_CONSULTED': + return HistoricalMetricName.contactsConsulted; + case 'CONTACTS_AGENT_HUNG_UP_FIRST': + return HistoricalMetricName.contactsAgentHungUpFirst; + case 'CONTACTS_HANDLED_INCOMING': + return HistoricalMetricName.contactsHandledIncoming; + case 'CONTACTS_HANDLED_OUTBOUND': + return HistoricalMetricName.contactsHandledOutbound; + case 'CONTACTS_HOLD_ABANDONS': + return HistoricalMetricName.contactsHoldAbandons; + case 'CONTACTS_TRANSFERRED_IN': + return HistoricalMetricName.contactsTransferredIn; + case 'CONTACTS_TRANSFERRED_OUT': + return HistoricalMetricName.contactsTransferredOut; + case 'CONTACTS_TRANSFERRED_IN_FROM_QUEUE': + return HistoricalMetricName.contactsTransferredInFromQueue; + case 'CONTACTS_TRANSFERRED_OUT_FROM_QUEUE': + return HistoricalMetricName.contactsTransferredOutFromQueue; + case 'CONTACTS_MISSED': + return HistoricalMetricName.contactsMissed; + case 'CALLBACK_CONTACTS_HANDLED': + return HistoricalMetricName.callbackContactsHandled; + case 'API_CONTACTS_HANDLED': + return HistoricalMetricName.apiContactsHandled; + case 'OCCUPANCY': + return HistoricalMetricName.occupancy; + case 'HANDLE_TIME': + return HistoricalMetricName.handleTime; + case 'AFTER_CONTACT_WORK_TIME': + return HistoricalMetricName.afterContactWorkTime; + case 'QUEUED_TIME': + return HistoricalMetricName.queuedTime; + case 'ABANDON_TIME': + return HistoricalMetricName.abandonTime; + case 'QUEUE_ANSWER_TIME': + return HistoricalMetricName.queueAnswerTime; + case 'HOLD_TIME': + return HistoricalMetricName.holdTime; + case 'INTERACTION_TIME': + return HistoricalMetricName.interactionTime; + case 'INTERACTION_AND_HOLD_TIME': + return HistoricalMetricName.interactionAndHoldTime; + case 'SERVICE_LEVEL': + return HistoricalMetricName.serviceLevel; + } + throw Exception('$this is not known in enum HistoricalMetricName'); + } +} + +/// Contains information about the historical metrics retrieved. +class HistoricalMetricResult { + /// The set of metrics. + final List? collections; + + /// The dimension for the metrics. + final Dimensions? dimensions; + + HistoricalMetricResult({ + this.collections, + this.dimensions, + }); + + factory HistoricalMetricResult.fromJson(Map json) { + return HistoricalMetricResult( + collections: (json['Collections'] as List?) + ?.whereNotNull() + .map((e) => HistoricalMetricData.fromJson(e as Map)) + .toList(), + dimensions: json['Dimensions'] != null + ? Dimensions.fromJson(json['Dimensions'] as Map) + : null, + ); + } + + Map toJson() { + final collections = this.collections; + final dimensions = this.dimensions; + return { + if (collections != null) 'Collections': collections, + if (dimensions != null) 'Dimensions': dimensions, + }; + } +} + +/// Information about of the hours of operation. +class HoursOfOperation { + /// Configuration information for the hours of operation. + final List? config; + + /// The description for the hours of operation. + final String? description; + + /// The Amazon Resource Name (ARN) for the hours of operation. + final String? hoursOfOperationArn; + + /// The identifier for the hours of operation. + final String? hoursOfOperationId; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name for the hours of operation. + final String? name; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + /// The time zone for the hours of operation. + final String? timeZone; + + HoursOfOperation({ + this.config, + this.description, + this.hoursOfOperationArn, + this.hoursOfOperationId, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.tags, + this.timeZone, + }); + + factory HoursOfOperation.fromJson(Map json) { + return HoursOfOperation( + config: (json['Config'] as List?) + ?.whereNotNull() + .map( + (e) => HoursOfOperationConfig.fromJson(e as Map)) + .toList(), + description: json['Description'] as String?, + hoursOfOperationArn: json['HoursOfOperationArn'] as String?, + hoursOfOperationId: json['HoursOfOperationId'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + timeZone: json['TimeZone'] as String?, + ); + } + + Map toJson() { + final config = this.config; + final description = this.description; + final hoursOfOperationArn = this.hoursOfOperationArn; + final hoursOfOperationId = this.hoursOfOperationId; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final tags = this.tags; + final timeZone = this.timeZone; + return { + if (config != null) 'Config': config, + if (description != null) 'Description': description, + if (hoursOfOperationArn != null) + 'HoursOfOperationArn': hoursOfOperationArn, + if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (tags != null) 'Tags': tags, + if (timeZone != null) 'TimeZone': timeZone, + }; + } +} + +/// Contains information about the hours of operation. +class HoursOfOperationConfig { + /// The day that the hours of operation applies to. + final HoursOfOperationDays day; + + /// The end time that your contact center closes. + final HoursOfOperationTimeSlice endTime; + + /// The start time that your contact center opens. + final HoursOfOperationTimeSlice startTime; + + HoursOfOperationConfig({ + required this.day, + required this.endTime, + required this.startTime, + }); + + factory HoursOfOperationConfig.fromJson(Map json) { + return HoursOfOperationConfig( + day: (json['Day'] as String).toHoursOfOperationDays(), + endTime: HoursOfOperationTimeSlice.fromJson( + json['EndTime'] as Map), + startTime: HoursOfOperationTimeSlice.fromJson( + json['StartTime'] as Map), + ); + } + + Map toJson() { + final day = this.day; + final endTime = this.endTime; + final startTime = this.startTime; + return { + 'Day': day.toValue(), + 'EndTime': endTime, + 'StartTime': startTime, + }; + } +} + +enum HoursOfOperationDays { + sunday, + monday, + tuesday, + wednesday, + thursday, + friday, + saturday, +} + +extension HoursOfOperationDaysValueExtension on HoursOfOperationDays { + String toValue() { + switch (this) { + case HoursOfOperationDays.sunday: + return 'SUNDAY'; + case HoursOfOperationDays.monday: + return 'MONDAY'; + case HoursOfOperationDays.tuesday: + return 'TUESDAY'; + case HoursOfOperationDays.wednesday: + return 'WEDNESDAY'; + case HoursOfOperationDays.thursday: + return 'THURSDAY'; + case HoursOfOperationDays.friday: + return 'FRIDAY'; + case HoursOfOperationDays.saturday: + return 'SATURDAY'; + } + } +} + +extension HoursOfOperationDaysFromString on String { + HoursOfOperationDays toHoursOfOperationDays() { + switch (this) { + case 'SUNDAY': + return HoursOfOperationDays.sunday; + case 'MONDAY': + return HoursOfOperationDays.monday; + case 'TUESDAY': + return HoursOfOperationDays.tuesday; + case 'WEDNESDAY': + return HoursOfOperationDays.wednesday; + case 'THURSDAY': + return HoursOfOperationDays.thursday; + case 'FRIDAY': + return HoursOfOperationDays.friday; + case 'SATURDAY': + return HoursOfOperationDays.saturday; + } + throw Exception('$this is not known in enum HoursOfOperationDays'); + } +} + +/// The search criteria to be used to return hours of operations. +class HoursOfOperationSearchCriteria { + /// A list of conditions which would be applied together with an AND condition. + final List? andConditions; + + /// A list of conditions which would be applied together with an OR condition. + final List? orConditions; + + /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// name, description, timezone, and + /// resourceID. + /// + final StringCondition? stringCondition; + + HoursOfOperationSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, + }); + + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, + }; + } +} + +/// Filters to be applied to search results. +class HoursOfOperationSearchFilter { + final ControlPlaneTagFilter? tagFilter; + + HoursOfOperationSearchFilter({ + this.tagFilter, + }); + + Map toJson() { + final tagFilter = this.tagFilter; + return { + if (tagFilter != null) 'TagFilter': tagFilter, + }; + } +} + +/// Contains summary information about hours of operation for a contact center. +class HoursOfOperationSummary { + /// The Amazon Resource Name (ARN) of the hours of operation. + final String? arn; + + /// The identifier of the hours of operation. + final String? id; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the hours of operation. + final String? name; + + HoursOfOperationSummary({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + }); + + factory HoursOfOperationSummary.fromJson(Map json) { + return HoursOfOperationSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + }; + } +} + +/// The start time or end time for an hours of operation. +class HoursOfOperationTimeSlice { + /// The hours. + final int hours; + + /// The minutes. + final int minutes; + + HoursOfOperationTimeSlice({ + required this.hours, + required this.minutes, + }); + + factory HoursOfOperationTimeSlice.fromJson(Map json) { + return HoursOfOperationTimeSlice( + hours: json['Hours'] as int, + minutes: json['Minutes'] as int, + ); + } + + Map toJson() { + final hours = this.hours; + final minutes = this.minutes; + return { + 'Hours': hours, + 'Minutes': minutes, + }; + } +} + +class ImportPhoneNumberResponse { + /// The Amazon Resource Name (ARN) of the phone number. + final String? phoneNumberArn; + + /// A unique identifier for the phone number. + final String? phoneNumberId; + + ImportPhoneNumberResponse({ + this.phoneNumberArn, + this.phoneNumberId, + }); + + factory ImportPhoneNumberResponse.fromJson(Map json) { + return ImportPhoneNumberResponse( + phoneNumberArn: json['PhoneNumberArn'] as String?, + phoneNumberId: json['PhoneNumberId'] as String?, + ); + } + + Map toJson() { + final phoneNumberArn = this.phoneNumberArn; + final phoneNumberId = this.phoneNumberId; + return { + if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, + if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, + }; + } +} + +/// The Amazon Connect instance. +class Instance { + /// The Amazon Resource Name (ARN) of the instance. + final String? arn; + + /// When the instance was created. + final DateTime? createdTime; + + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? id; + + /// The identity management type. + final DirectoryType? identityManagementType; + + /// Whether inbound calls are enabled. + final bool? inboundCallsEnabled; + + /// This URL allows contact center users to access the Amazon Connect admin + /// website. + final String? instanceAccessUrl; + + /// The alias of instance. + final String? instanceAlias; + + /// The state of the instance. + final InstanceStatus? instanceStatus; + + /// Whether outbound calls are enabled. + final bool? outboundCallsEnabled; + + /// The service role of the instance. + final String? serviceRole; + + /// Relevant details why the instance was not successfully created. + final InstanceStatusReason? statusReason; + + /// The tags of an instance. + final Map? tags; + + Instance({ + this.arn, + this.createdTime, + this.id, + this.identityManagementType, + this.inboundCallsEnabled, + this.instanceAccessUrl, + this.instanceAlias, + this.instanceStatus, + this.outboundCallsEnabled, + this.serviceRole, + this.statusReason, + this.tags, + }); + + factory Instance.fromJson(Map json) { + return Instance( + arn: json['Arn'] as String?, + createdTime: timeStampFromJson(json['CreatedTime']), + id: json['Id'] as String?, + identityManagementType: + (json['IdentityManagementType'] as String?)?.toDirectoryType(), + inboundCallsEnabled: json['InboundCallsEnabled'] as bool?, + instanceAccessUrl: json['InstanceAccessUrl'] as String?, + instanceAlias: json['InstanceAlias'] as String?, + instanceStatus: (json['InstanceStatus'] as String?)?.toInstanceStatus(), + outboundCallsEnabled: json['OutboundCallsEnabled'] as bool?, + serviceRole: json['ServiceRole'] as String?, + statusReason: json['StatusReason'] != null + ? InstanceStatusReason.fromJson( + json['StatusReason'] as Map) + : null, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final arn = this.arn; + final createdTime = this.createdTime; + final id = this.id; + final identityManagementType = this.identityManagementType; + final inboundCallsEnabled = this.inboundCallsEnabled; + final instanceAccessUrl = this.instanceAccessUrl; + final instanceAlias = this.instanceAlias; + final instanceStatus = this.instanceStatus; + final outboundCallsEnabled = this.outboundCallsEnabled; + final serviceRole = this.serviceRole; + final statusReason = this.statusReason; + final tags = this.tags; + return { + if (arn != null) 'Arn': arn, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (id != null) 'Id': id, + if (identityManagementType != null) + 'IdentityManagementType': identityManagementType.toValue(), + if (inboundCallsEnabled != null) + 'InboundCallsEnabled': inboundCallsEnabled, + if (instanceAccessUrl != null) 'InstanceAccessUrl': instanceAccessUrl, + if (instanceAlias != null) 'InstanceAlias': instanceAlias, + if (instanceStatus != null) 'InstanceStatus': instanceStatus.toValue(), + if (outboundCallsEnabled != null) + 'OutboundCallsEnabled': outboundCallsEnabled, + if (serviceRole != null) 'ServiceRole': serviceRole, + if (statusReason != null) 'StatusReason': statusReason, + if (tags != null) 'Tags': tags, + }; + } +} + +enum InstanceAttributeType { + inboundCalls, + outboundCalls, + contactflowLogs, + contactLens, + autoResolveBestVoices, + useCustomTtsVoices, + earlyMedia, + multiPartyConference, + highVolumeOutbound, + enhancedContactMonitoring, + enhancedChatMonitoring, +} + +extension InstanceAttributeTypeValueExtension on InstanceAttributeType { + String toValue() { + switch (this) { + case InstanceAttributeType.inboundCalls: + return 'INBOUND_CALLS'; + case InstanceAttributeType.outboundCalls: + return 'OUTBOUND_CALLS'; + case InstanceAttributeType.contactflowLogs: + return 'CONTACTFLOW_LOGS'; + case InstanceAttributeType.contactLens: + return 'CONTACT_LENS'; + case InstanceAttributeType.autoResolveBestVoices: + return 'AUTO_RESOLVE_BEST_VOICES'; + case InstanceAttributeType.useCustomTtsVoices: + return 'USE_CUSTOM_TTS_VOICES'; + case InstanceAttributeType.earlyMedia: + return 'EARLY_MEDIA'; + case InstanceAttributeType.multiPartyConference: + return 'MULTI_PARTY_CONFERENCE'; + case InstanceAttributeType.highVolumeOutbound: + return 'HIGH_VOLUME_OUTBOUND'; + case InstanceAttributeType.enhancedContactMonitoring: + return 'ENHANCED_CONTACT_MONITORING'; + case InstanceAttributeType.enhancedChatMonitoring: + return 'ENHANCED_CHAT_MONITORING'; + } + } +} + +extension InstanceAttributeTypeFromString on String { + InstanceAttributeType toInstanceAttributeType() { + switch (this) { + case 'INBOUND_CALLS': + return InstanceAttributeType.inboundCalls; + case 'OUTBOUND_CALLS': + return InstanceAttributeType.outboundCalls; + case 'CONTACTFLOW_LOGS': + return InstanceAttributeType.contactflowLogs; + case 'CONTACT_LENS': + return InstanceAttributeType.contactLens; + case 'AUTO_RESOLVE_BEST_VOICES': + return InstanceAttributeType.autoResolveBestVoices; + case 'USE_CUSTOM_TTS_VOICES': + return InstanceAttributeType.useCustomTtsVoices; + case 'EARLY_MEDIA': + return InstanceAttributeType.earlyMedia; + case 'MULTI_PARTY_CONFERENCE': + return InstanceAttributeType.multiPartyConference; + case 'HIGH_VOLUME_OUTBOUND': + return InstanceAttributeType.highVolumeOutbound; + case 'ENHANCED_CONTACT_MONITORING': + return InstanceAttributeType.enhancedContactMonitoring; + case 'ENHANCED_CHAT_MONITORING': + return InstanceAttributeType.enhancedChatMonitoring; + } + throw Exception('$this is not known in enum InstanceAttributeType'); + } +} + +enum InstanceStatus { + creationInProgress, + active, + creationFailed, +} + +extension InstanceStatusValueExtension on InstanceStatus { + String toValue() { + switch (this) { + case InstanceStatus.creationInProgress: + return 'CREATION_IN_PROGRESS'; + case InstanceStatus.active: + return 'ACTIVE'; + case InstanceStatus.creationFailed: + return 'CREATION_FAILED'; + } + } +} + +extension InstanceStatusFromString on String { + InstanceStatus toInstanceStatus() { + switch (this) { + case 'CREATION_IN_PROGRESS': + return InstanceStatus.creationInProgress; + case 'ACTIVE': + return InstanceStatus.active; + case 'CREATION_FAILED': + return InstanceStatus.creationFailed; + } + throw Exception('$this is not known in enum InstanceStatus'); + } +} + +/// Relevant details why the instance was not successfully created. +class InstanceStatusReason { + /// The message. + final String? message; + + InstanceStatusReason({ + this.message, + }); + + factory InstanceStatusReason.fromJson(Map json) { + return InstanceStatusReason( + message: json['Message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'Message': message, + }; + } +} + +/// The storage configuration for the instance. +class InstanceStorageConfig { + /// A valid storage type. + final StorageType storageType; + + /// The existing association identifier that uniquely identifies the resource + /// type and storage config for the given instance ID. + final String? associationId; + + /// The configuration of the Kinesis Firehose delivery stream. + final KinesisFirehoseConfig? kinesisFirehoseConfig; + + /// The configuration of the Kinesis data stream. + final KinesisStreamConfig? kinesisStreamConfig; + + /// The configuration of the Kinesis video stream. + final KinesisVideoStreamConfig? kinesisVideoStreamConfig; + + /// The S3 bucket configuration. + final S3Config? s3Config; + + InstanceStorageConfig({ + required this.storageType, + this.associationId, + this.kinesisFirehoseConfig, + this.kinesisStreamConfig, + this.kinesisVideoStreamConfig, + this.s3Config, + }); + + factory InstanceStorageConfig.fromJson(Map json) { + return InstanceStorageConfig( + storageType: (json['StorageType'] as String).toStorageType(), + associationId: json['AssociationId'] as String?, + kinesisFirehoseConfig: json['KinesisFirehoseConfig'] != null + ? KinesisFirehoseConfig.fromJson( + json['KinesisFirehoseConfig'] as Map) + : null, + kinesisStreamConfig: json['KinesisStreamConfig'] != null + ? KinesisStreamConfig.fromJson( + json['KinesisStreamConfig'] as Map) + : null, + kinesisVideoStreamConfig: json['KinesisVideoStreamConfig'] != null + ? KinesisVideoStreamConfig.fromJson( + json['KinesisVideoStreamConfig'] as Map) + : null, + s3Config: json['S3Config'] != null + ? S3Config.fromJson(json['S3Config'] as Map) + : null, + ); + } + + Map toJson() { + final storageType = this.storageType; + final associationId = this.associationId; + final kinesisFirehoseConfig = this.kinesisFirehoseConfig; + final kinesisStreamConfig = this.kinesisStreamConfig; + final kinesisVideoStreamConfig = this.kinesisVideoStreamConfig; + final s3Config = this.s3Config; + return { + 'StorageType': storageType.toValue(), + if (associationId != null) 'AssociationId': associationId, + if (kinesisFirehoseConfig != null) + 'KinesisFirehoseConfig': kinesisFirehoseConfig, + if (kinesisStreamConfig != null) + 'KinesisStreamConfig': kinesisStreamConfig, + if (kinesisVideoStreamConfig != null) + 'KinesisVideoStreamConfig': kinesisVideoStreamConfig, + if (s3Config != null) 'S3Config': s3Config, + }; + } +} + +enum InstanceStorageResourceType { + chatTranscripts, + callRecordings, + scheduledReports, + mediaStreams, + contactTraceRecords, + agentEvents, + realTimeContactAnalysisSegments, + attachments, + contactEvaluations, + screenRecordings, + realTimeContactAnalysisChatSegments, + realTimeContactAnalysisVoiceSegments, +} + +extension InstanceStorageResourceTypeValueExtension + on InstanceStorageResourceType { + String toValue() { + switch (this) { + case InstanceStorageResourceType.chatTranscripts: + return 'CHAT_TRANSCRIPTS'; + case InstanceStorageResourceType.callRecordings: + return 'CALL_RECORDINGS'; + case InstanceStorageResourceType.scheduledReports: + return 'SCHEDULED_REPORTS'; + case InstanceStorageResourceType.mediaStreams: + return 'MEDIA_STREAMS'; + case InstanceStorageResourceType.contactTraceRecords: + return 'CONTACT_TRACE_RECORDS'; + case InstanceStorageResourceType.agentEvents: + return 'AGENT_EVENTS'; + case InstanceStorageResourceType.realTimeContactAnalysisSegments: + return 'REAL_TIME_CONTACT_ANALYSIS_SEGMENTS'; + case InstanceStorageResourceType.attachments: + return 'ATTACHMENTS'; + case InstanceStorageResourceType.contactEvaluations: + return 'CONTACT_EVALUATIONS'; + case InstanceStorageResourceType.screenRecordings: + return 'SCREEN_RECORDINGS'; + case InstanceStorageResourceType.realTimeContactAnalysisChatSegments: + return 'REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS'; + case InstanceStorageResourceType.realTimeContactAnalysisVoiceSegments: + return 'REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS'; + } + } +} + +extension InstanceStorageResourceTypeFromString on String { + InstanceStorageResourceType toInstanceStorageResourceType() { + switch (this) { + case 'CHAT_TRANSCRIPTS': + return InstanceStorageResourceType.chatTranscripts; + case 'CALL_RECORDINGS': + return InstanceStorageResourceType.callRecordings; + case 'SCHEDULED_REPORTS': + return InstanceStorageResourceType.scheduledReports; + case 'MEDIA_STREAMS': + return InstanceStorageResourceType.mediaStreams; + case 'CONTACT_TRACE_RECORDS': + return InstanceStorageResourceType.contactTraceRecords; + case 'AGENT_EVENTS': + return InstanceStorageResourceType.agentEvents; + case 'REAL_TIME_CONTACT_ANALYSIS_SEGMENTS': + return InstanceStorageResourceType.realTimeContactAnalysisSegments; + case 'ATTACHMENTS': + return InstanceStorageResourceType.attachments; + case 'CONTACT_EVALUATIONS': + return InstanceStorageResourceType.contactEvaluations; + case 'SCREEN_RECORDINGS': + return InstanceStorageResourceType.screenRecordings; + case 'REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS': + return InstanceStorageResourceType.realTimeContactAnalysisChatSegments; + case 'REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS': + return InstanceStorageResourceType.realTimeContactAnalysisVoiceSegments; + } + throw Exception('$this is not known in enum InstanceStorageResourceType'); + } +} + +/// Information about the instance. +class InstanceSummary { + /// The Amazon Resource Name (ARN) of the instance. + final String? arn; + + /// When the instance was created. + final DateTime? createdTime; + + /// The identifier of the instance. + final String? id; + + /// The identity management type of the instance. + final DirectoryType? identityManagementType; + + /// Whether inbound calls are enabled. + final bool? inboundCallsEnabled; + + /// This URL allows contact center users to access the Amazon Connect admin + /// website. + final String? instanceAccessUrl; + + /// The alias of the instance. + final String? instanceAlias; + + /// The state of the instance. + final InstanceStatus? instanceStatus; + + /// Whether outbound calls are enabled. + final bool? outboundCallsEnabled; + + /// The service role of the instance. + final String? serviceRole; + + InstanceSummary({ + this.arn, + this.createdTime, + this.id, + this.identityManagementType, + this.inboundCallsEnabled, + this.instanceAccessUrl, + this.instanceAlias, + this.instanceStatus, + this.outboundCallsEnabled, + this.serviceRole, + }); + + factory InstanceSummary.fromJson(Map json) { + return InstanceSummary( + arn: json['Arn'] as String?, + createdTime: timeStampFromJson(json['CreatedTime']), + id: json['Id'] as String?, + identityManagementType: + (json['IdentityManagementType'] as String?)?.toDirectoryType(), + inboundCallsEnabled: json['InboundCallsEnabled'] as bool?, + instanceAccessUrl: json['InstanceAccessUrl'] as String?, + instanceAlias: json['InstanceAlias'] as String?, + instanceStatus: (json['InstanceStatus'] as String?)?.toInstanceStatus(), + outboundCallsEnabled: json['OutboundCallsEnabled'] as bool?, + serviceRole: json['ServiceRole'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createdTime = this.createdTime; + final id = this.id; + final identityManagementType = this.identityManagementType; + final inboundCallsEnabled = this.inboundCallsEnabled; + final instanceAccessUrl = this.instanceAccessUrl; + final instanceAlias = this.instanceAlias; + final instanceStatus = this.instanceStatus; + final outboundCallsEnabled = this.outboundCallsEnabled; + final serviceRole = this.serviceRole; + return { + if (arn != null) 'Arn': arn, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (id != null) 'Id': id, + if (identityManagementType != null) + 'IdentityManagementType': identityManagementType.toValue(), + if (inboundCallsEnabled != null) + 'InboundCallsEnabled': inboundCallsEnabled, + if (instanceAccessUrl != null) 'InstanceAccessUrl': instanceAccessUrl, + if (instanceAlias != null) 'InstanceAlias': instanceAlias, + if (instanceStatus != null) 'InstanceStatus': instanceStatus.toValue(), + if (outboundCallsEnabled != null) + 'OutboundCallsEnabled': outboundCallsEnabled, + if (serviceRole != null) 'ServiceRole': serviceRole, + }; + } +} + +/// Contains summary information about the associated AppIntegrations. +class IntegrationAssociationSummary { + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? instanceId; + + /// The Amazon Resource Name (ARN) for the AppIntegration. + final String? integrationArn; + + /// The Amazon Resource Name (ARN) for the AppIntegration association. + final String? integrationAssociationArn; + + /// The identifier for the AppIntegration association. + final String? integrationAssociationId; + + /// The integration type. + final IntegrationType? integrationType; + + /// The user-provided, friendly name for the external application. + final String? sourceApplicationName; + + /// The URL for the external application. + final String? sourceApplicationUrl; + + /// The name of the source. + final SourceType? sourceType; + + IntegrationAssociationSummary({ + this.instanceId, + this.integrationArn, + this.integrationAssociationArn, + this.integrationAssociationId, + this.integrationType, + this.sourceApplicationName, + this.sourceApplicationUrl, + this.sourceType, + }); + + factory IntegrationAssociationSummary.fromJson(Map json) { + return IntegrationAssociationSummary( + instanceId: json['InstanceId'] as String?, + integrationArn: json['IntegrationArn'] as String?, + integrationAssociationArn: json['IntegrationAssociationArn'] as String?, + integrationAssociationId: json['IntegrationAssociationId'] as String?, + integrationType: + (json['IntegrationType'] as String?)?.toIntegrationType(), + sourceApplicationName: json['SourceApplicationName'] as String?, + sourceApplicationUrl: json['SourceApplicationUrl'] as String?, + sourceType: (json['SourceType'] as String?)?.toSourceType(), + ); + } + + Map toJson() { + final instanceId = this.instanceId; + final integrationArn = this.integrationArn; + final integrationAssociationArn = this.integrationAssociationArn; + final integrationAssociationId = this.integrationAssociationId; + final integrationType = this.integrationType; + final sourceApplicationName = this.sourceApplicationName; + final sourceApplicationUrl = this.sourceApplicationUrl; + final sourceType = this.sourceType; + return { + if (instanceId != null) 'InstanceId': instanceId, + if (integrationArn != null) 'IntegrationArn': integrationArn, + if (integrationAssociationArn != null) + 'IntegrationAssociationArn': integrationAssociationArn, + if (integrationAssociationId != null) + 'IntegrationAssociationId': integrationAssociationId, + if (integrationType != null) 'IntegrationType': integrationType.toValue(), + if (sourceApplicationName != null) + 'SourceApplicationName': sourceApplicationName, + if (sourceApplicationUrl != null) + 'SourceApplicationUrl': sourceApplicationUrl, + if (sourceType != null) 'SourceType': sourceType.toValue(), + }; + } +} + +enum IntegrationType { + event, + voiceId, + pinpointApp, + wisdomAssistant, + wisdomKnowledgeBase, + wisdomQuickResponses, + casesDomain, + application, + fileScanner, +} + +extension IntegrationTypeValueExtension on IntegrationType { + String toValue() { + switch (this) { + case IntegrationType.event: + return 'EVENT'; + case IntegrationType.voiceId: + return 'VOICE_ID'; + case IntegrationType.pinpointApp: + return 'PINPOINT_APP'; + case IntegrationType.wisdomAssistant: + return 'WISDOM_ASSISTANT'; + case IntegrationType.wisdomKnowledgeBase: + return 'WISDOM_KNOWLEDGE_BASE'; + case IntegrationType.wisdomQuickResponses: + return 'WISDOM_QUICK_RESPONSES'; + case IntegrationType.casesDomain: + return 'CASES_DOMAIN'; + case IntegrationType.application: + return 'APPLICATION'; + case IntegrationType.fileScanner: + return 'FILE_SCANNER'; + } + } +} + +extension IntegrationTypeFromString on String { + IntegrationType toIntegrationType() { + switch (this) { + case 'EVENT': + return IntegrationType.event; + case 'VOICE_ID': + return IntegrationType.voiceId; + case 'PINPOINT_APP': + return IntegrationType.pinpointApp; + case 'WISDOM_ASSISTANT': + return IntegrationType.wisdomAssistant; + case 'WISDOM_KNOWLEDGE_BASE': + return IntegrationType.wisdomKnowledgeBase; + case 'WISDOM_QUICK_RESPONSES': + return IntegrationType.wisdomQuickResponses; + case 'CASES_DOMAIN': + return IntegrationType.casesDomain; + case 'APPLICATION': + return IntegrationType.application; + case 'FILE_SCANNER': + return IntegrationType.fileScanner; + } + throw Exception('$this is not known in enum IntegrationType'); + } +} + +/// Information about the interval period to use for returning results. +class IntervalDetails { + /// IntervalPeriod: An aggregated grouping applied to request + /// metrics. Valid IntervalPeriod values are: + /// FIFTEEN_MIN | THIRTY_MIN | HOUR | + /// DAY | WEEK | TOTAL. + /// + /// For example, if IntervalPeriod is selected + /// THIRTY_MIN, StartTime and EndTime + /// differs by 1 day, then Amazon Connect returns 48 results in the response. + /// Each result is aggregated by the THIRTY_MIN period. By default Amazon + /// Connect aggregates results based on the TOTAL interval period. + /// + /// The following list describes restrictions on StartTime and + /// EndTime based on what IntervalPeriod is requested. + /// + ///
        + ///
      • + /// FIFTEEN_MIN: The difference between StartTime and + /// EndTime must be less than 3 days. + ///
      • + ///
      • + /// THIRTY_MIN: The difference between StartTime and + /// EndTime must be less than 3 days. + ///
      • + ///
      • + /// HOUR: The difference between StartTime and + /// EndTime must be less than 3 days. + ///
      • + ///
      • + /// DAY: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
      • + ///
      • + /// WEEK: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
      • + ///
      • + /// TOTAL: The difference between StartTime and + /// EndTime must be less than 35 days. + ///
      • + ///
      + final IntervalPeriod? intervalPeriod; + + /// The timezone applied to requested metrics. + final String? timeZone; + + IntervalDetails({ + this.intervalPeriod, + this.timeZone, + }); + + Map toJson() { + final intervalPeriod = this.intervalPeriod; + final timeZone = this.timeZone; + return { + if (intervalPeriod != null) 'IntervalPeriod': intervalPeriod.toValue(), + if (timeZone != null) 'TimeZone': timeZone, + }; + } +} + +enum IntervalPeriod { + fifteenMin, + thirtyMin, + hour, + day, + week, + total, +} + +extension IntervalPeriodValueExtension on IntervalPeriod { + String toValue() { + switch (this) { + case IntervalPeriod.fifteenMin: + return 'FIFTEEN_MIN'; + case IntervalPeriod.thirtyMin: + return 'THIRTY_MIN'; + case IntervalPeriod.hour: + return 'HOUR'; + case IntervalPeriod.day: + return 'DAY'; + case IntervalPeriod.week: + return 'WEEK'; + case IntervalPeriod.total: + return 'TOTAL'; + } + } +} + +extension IntervalPeriodFromString on String { + IntervalPeriod toIntervalPeriod() { + switch (this) { + case 'FIFTEEN_MIN': + return IntervalPeriod.fifteenMin; + case 'THIRTY_MIN': + return IntervalPeriod.thirtyMin; + case 'HOUR': + return IntervalPeriod.hour; + case 'DAY': + return IntervalPeriod.day; + case 'WEEK': + return IntervalPeriod.week; + case 'TOTAL': + return IntervalPeriod.total; + } + throw Exception('$this is not known in enum IntervalPeriod'); + } +} + +/// A field that is invisible to an agent. +class InvisibleFieldInfo { + /// Identifier of the invisible field. + final TaskTemplateFieldIdentifier? id; + + InvisibleFieldInfo({ + this.id, + }); + + factory InvisibleFieldInfo.fromJson(Map json) { + return InvisibleFieldInfo( + id: json['Id'] != null + ? TaskTemplateFieldIdentifier.fromJson( + json['Id'] as Map) + : null, + ); + } + + Map toJson() { + final id = this.id; + return { + if (id != null) 'Id': id, + }; + } +} + +/// Configuration information of a Kinesis Data Firehose delivery stream. +class KinesisFirehoseConfig { + /// The Amazon Resource Name (ARN) of the delivery stream. + final String firehoseArn; + + KinesisFirehoseConfig({ + required this.firehoseArn, + }); + + factory KinesisFirehoseConfig.fromJson(Map json) { + return KinesisFirehoseConfig( + firehoseArn: json['FirehoseArn'] as String, + ); + } + + Map toJson() { + final firehoseArn = this.firehoseArn; + return { + 'FirehoseArn': firehoseArn, + }; + } +} + +/// Configuration information of a Kinesis data stream. +class KinesisStreamConfig { + /// The Amazon Resource Name (ARN) of the data stream. + final String streamArn; + + KinesisStreamConfig({ + required this.streamArn, + }); + + factory KinesisStreamConfig.fromJson(Map json) { + return KinesisStreamConfig( + streamArn: json['StreamArn'] as String, + ); + } + + Map toJson() { + final streamArn = this.streamArn; + return { + 'StreamArn': streamArn, + }; + } +} + +/// Configuration information of a Kinesis video stream. +class KinesisVideoStreamConfig { + /// The encryption configuration. + final EncryptionConfig encryptionConfig; + + /// The prefix of the video stream. + final String prefix; + + /// The number of hours data is retained in the stream. Kinesis Video Streams + /// retains the data in a data store that is associated with the stream. + /// + /// The default value is 0, indicating that the stream does not persist data. + final int retentionPeriodHours; + + KinesisVideoStreamConfig({ + required this.encryptionConfig, + required this.prefix, + required this.retentionPeriodHours, + }); + + factory KinesisVideoStreamConfig.fromJson(Map json) { + return KinesisVideoStreamConfig( + encryptionConfig: EncryptionConfig.fromJson( + json['EncryptionConfig'] as Map), + prefix: json['Prefix'] as String, + retentionPeriodHours: json['RetentionPeriodHours'] as int, + ); + } + + Map toJson() { + final encryptionConfig = this.encryptionConfig; + final prefix = this.prefix; + final retentionPeriodHours = this.retentionPeriodHours; + return { + 'EncryptionConfig': encryptionConfig, + 'Prefix': prefix, + 'RetentionPeriodHours': retentionPeriodHours, + }; + } +} + +/// Configuration information of an Amazon Lex bot. +class LexBot { + /// The Amazon Web Services Region where the Amazon Lex bot was created. + final String lexRegion; + + /// The name of the Amazon Lex bot. + final String name; + + LexBot({ + required this.lexRegion, + required this.name, + }); + + factory LexBot.fromJson(Map json) { + return LexBot( + lexRegion: json['LexRegion'] as String, + name: json['Name'] as String, + ); + } + + Map toJson() { + final lexRegion = this.lexRegion; + final name = this.name; + return { + 'LexRegion': lexRegion, + 'Name': name, + }; + } +} + +/// Configuration information of an Amazon Lex or Amazon Lex V2 bot. +class LexBotConfig { + final LexBot? lexBot; + + /// Configuration information of an Amazon Lex V2 bot. + final LexV2Bot? lexV2Bot; + + LexBotConfig({ + this.lexBot, + this.lexV2Bot, + }); + + factory LexBotConfig.fromJson(Map json) { + return LexBotConfig( + lexBot: json['LexBot'] != null + ? LexBot.fromJson(json['LexBot'] as Map) + : null, + lexV2Bot: json['LexV2Bot'] != null + ? LexV2Bot.fromJson(json['LexV2Bot'] as Map) + : null, + ); + } + + Map toJson() { + final lexBot = this.lexBot; + final lexV2Bot = this.lexV2Bot; + return { + if (lexBot != null) 'LexBot': lexBot, + if (lexV2Bot != null) 'LexV2Bot': lexV2Bot, + }; + } +} + +/// Configuration information of an Amazon Lex V2 bot. +class LexV2Bot { + /// The Amazon Resource Name (ARN) of the Amazon Lex V2 bot. + final String? aliasArn; + + LexV2Bot({ + this.aliasArn, + }); + + factory LexV2Bot.fromJson(Map json) { + return LexV2Bot( + aliasArn: json['AliasArn'] as String?, + ); + } + + Map toJson() { + final aliasArn = this.aliasArn; + return { + if (aliasArn != null) 'AliasArn': aliasArn, + }; + } +} + +enum LexVersion { + v1, + v2, +} + +extension LexVersionValueExtension on LexVersion { + String toValue() { + switch (this) { + case LexVersion.v1: + return 'V1'; + case LexVersion.v2: + return 'V2'; + } + } +} + +extension LexVersionFromString on String { + LexVersion toLexVersion() { + switch (this) { + case 'V1': + return LexVersion.v1; + case 'V2': + return LexVersion.v2; + } + throw Exception('$this is not known in enum LexVersion'); + } +} + +class ListAgentStatusResponse { + /// A summary of agent statuses. + final List? agentStatusSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListAgentStatusResponse({ + this.agentStatusSummaryList, + this.nextToken, + }); + + factory ListAgentStatusResponse.fromJson(Map json) { + return ListAgentStatusResponse( + agentStatusSummaryList: (json['AgentStatusSummaryList'] as List?) + ?.whereNotNull() + .map((e) => AgentStatusSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final agentStatusSummaryList = this.agentStatusSummaryList; + final nextToken = this.nextToken; + return { + if (agentStatusSummaryList != null) + 'AgentStatusSummaryList': agentStatusSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListAnalyticsDataAssociationsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// An array of successful results: DataSetId, + /// TargetAccountId, ResourceShareId, + /// ResourceShareArn. This is a paginated API, so + /// nextToken is given if there are more results to be returned. + final List? results; + + ListAnalyticsDataAssociationsResponse({ + this.nextToken, + this.results, + }); + + factory ListAnalyticsDataAssociationsResponse.fromJson( + Map json) { + return ListAnalyticsDataAssociationsResponse( + nextToken: json['NextToken'] as String?, + results: (json['Results'] as List?) + ?.whereNotNull() + .map((e) => AnalyticsDataAssociationResult.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final results = this.results; + return { + if (nextToken != null) 'NextToken': nextToken, + if (results != null) 'Results': results, + }; + } +} + +class ListApprovedOriginsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// The approved origins. + final List? origins; + + ListApprovedOriginsResponse({ + this.nextToken, + this.origins, + }); + + factory ListApprovedOriginsResponse.fromJson(Map json) { + return ListApprovedOriginsResponse( + nextToken: json['NextToken'] as String?, + origins: (json['Origins'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final origins = this.origins; + return { + if (nextToken != null) 'NextToken': nextToken, + if (origins != null) 'Origins': origins, + }; + } +} + +class ListBotsResponse { + /// The names and Amazon Web Services Regions of the Amazon Lex or Amazon Lex V2 + /// bots associated with the specified instance. + final List? lexBots; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListBotsResponse({ + this.lexBots, + this.nextToken, + }); + + factory ListBotsResponse.fromJson(Map json) { + return ListBotsResponse( + lexBots: (json['LexBots'] as List?) + ?.whereNotNull() + .map((e) => LexBotConfig.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final lexBots = this.lexBots; + final nextToken = this.nextToken; + return { + if (lexBots != null) 'LexBots': lexBots, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListContactEvaluationsResponse { + /// Provides details about a list of contact evaluations belonging to an + /// instance. + final List evaluationSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + /// + /// This is always returned as null in the response. + /// + final String? nextToken; + + ListContactEvaluationsResponse({ + required this.evaluationSummaryList, + this.nextToken, + }); + + factory ListContactEvaluationsResponse.fromJson(Map json) { + return ListContactEvaluationsResponse( + evaluationSummaryList: (json['EvaluationSummaryList'] as List) + .whereNotNull() + .map((e) => EvaluationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final evaluationSummaryList = this.evaluationSummaryList; + final nextToken = this.nextToken; + return { + 'EvaluationSummaryList': evaluationSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListContactFlowModulesResponse { + /// Information about the flow module. + final List? contactFlowModulesSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListContactFlowModulesResponse({ + this.contactFlowModulesSummaryList, + this.nextToken, + }); + + factory ListContactFlowModulesResponse.fromJson(Map json) { + return ListContactFlowModulesResponse( + contactFlowModulesSummaryList: + (json['ContactFlowModulesSummaryList'] as List?) + ?.whereNotNull() + .map((e) => + ContactFlowModuleSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final contactFlowModulesSummaryList = this.contactFlowModulesSummaryList; + final nextToken = this.nextToken; + return { + if (contactFlowModulesSummaryList != null) + 'ContactFlowModulesSummaryList': contactFlowModulesSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListContactFlowsResponse { + /// Information about the flows. + final List? contactFlowSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListContactFlowsResponse({ + this.contactFlowSummaryList, + this.nextToken, + }); + + factory ListContactFlowsResponse.fromJson(Map json) { + return ListContactFlowsResponse( + contactFlowSummaryList: (json['ContactFlowSummaryList'] as List?) + ?.whereNotNull() + .map((e) => ContactFlowSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final contactFlowSummaryList = this.contactFlowSummaryList; + final nextToken = this.nextToken; + return { + if (contactFlowSummaryList != null) + 'ContactFlowSummaryList': contactFlowSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListContactReferencesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + /// + /// This is always returned as null in the response. + /// + final String? nextToken; + + /// Information about the flows. + final List? referenceSummaryList; + + ListContactReferencesResponse({ + this.nextToken, + this.referenceSummaryList, + }); + + factory ListContactReferencesResponse.fromJson(Map json) { + return ListContactReferencesResponse( + nextToken: json['NextToken'] as String?, + referenceSummaryList: (json['ReferenceSummaryList'] as List?) + ?.whereNotNull() + .map((e) => ReferenceSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final referenceSummaryList = this.referenceSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (referenceSummaryList != null) + 'ReferenceSummaryList': referenceSummaryList, + }; + } +} + +class ListDefaultVocabulariesResponse { + /// A list of default vocabularies. + final List defaultVocabularyList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListDefaultVocabulariesResponse({ + required this.defaultVocabularyList, + this.nextToken, + }); + + factory ListDefaultVocabulariesResponse.fromJson(Map json) { + return ListDefaultVocabulariesResponse( + defaultVocabularyList: (json['DefaultVocabularyList'] as List) + .whereNotNull() + .map((e) => DefaultVocabulary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final defaultVocabularyList = this.defaultVocabularyList; + final nextToken = this.nextToken; + return { + 'DefaultVocabularyList': defaultVocabularyList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListEvaluationFormVersionsResponse { + /// Provides details about a list of evaluation forms belonging to an instance. + final List evaluationFormVersionSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListEvaluationFormVersionsResponse({ + required this.evaluationFormVersionSummaryList, + this.nextToken, + }); + + factory ListEvaluationFormVersionsResponse.fromJson( + Map json) { + return ListEvaluationFormVersionsResponse( + evaluationFormVersionSummaryList: + (json['EvaluationFormVersionSummaryList'] as List) + .whereNotNull() + .map((e) => EvaluationFormVersionSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final evaluationFormVersionSummaryList = + this.evaluationFormVersionSummaryList; + final nextToken = this.nextToken; + return { + 'EvaluationFormVersionSummaryList': evaluationFormVersionSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListEvaluationFormsResponse { + /// Provides details about a list of evaluation forms belonging to an instance. + final List evaluationFormSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListEvaluationFormsResponse({ + required this.evaluationFormSummaryList, + this.nextToken, + }); + + factory ListEvaluationFormsResponse.fromJson(Map json) { + return ListEvaluationFormsResponse( + evaluationFormSummaryList: (json['EvaluationFormSummaryList'] as List) + .whereNotNull() + .map((e) => EvaluationFormSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final evaluationFormSummaryList = this.evaluationFormSummaryList; + final nextToken = this.nextToken; + return { + 'EvaluationFormSummaryList': evaluationFormSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +enum ListFlowAssociationResourceType { + voicePhoneNumber, +} + +extension ListFlowAssociationResourceTypeValueExtension + on ListFlowAssociationResourceType { + String toValue() { + switch (this) { + case ListFlowAssociationResourceType.voicePhoneNumber: + return 'VOICE_PHONE_NUMBER'; + } + } +} + +extension ListFlowAssociationResourceTypeFromString on String { + ListFlowAssociationResourceType toListFlowAssociationResourceType() { + switch (this) { + case 'VOICE_PHONE_NUMBER': + return ListFlowAssociationResourceType.voicePhoneNumber; + } + throw Exception( + '$this is not known in enum ListFlowAssociationResourceType'); + } +} + +class ListFlowAssociationsResponse { + /// Summary of flow associations. + final List? flowAssociationSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListFlowAssociationsResponse({ + this.flowAssociationSummaryList, + this.nextToken, + }); + + factory ListFlowAssociationsResponse.fromJson(Map json) { + return ListFlowAssociationsResponse( + flowAssociationSummaryList: (json['FlowAssociationSummaryList'] as List?) + ?.whereNotNull() + .map( + (e) => FlowAssociationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final flowAssociationSummaryList = this.flowAssociationSummaryList; + final nextToken = this.nextToken; + return { + if (flowAssociationSummaryList != null) + 'FlowAssociationSummaryList': flowAssociationSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListHoursOfOperationsResponse { + /// Information about the hours of operation. + final List? hoursOfOperationSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListHoursOfOperationsResponse({ + this.hoursOfOperationSummaryList, + this.nextToken, + }); + + factory ListHoursOfOperationsResponse.fromJson(Map json) { + return ListHoursOfOperationsResponse( + hoursOfOperationSummaryList: + (json['HoursOfOperationSummaryList'] as List?) + ?.whereNotNull() + .map((e) => + HoursOfOperationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final hoursOfOperationSummaryList = this.hoursOfOperationSummaryList; + final nextToken = this.nextToken; + return { + if (hoursOfOperationSummaryList != null) + 'HoursOfOperationSummaryList': hoursOfOperationSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListInstanceAttributesResponse { + /// The attribute types. + final List? attributes; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListInstanceAttributesResponse({ + this.attributes, + this.nextToken, + }); + + factory ListInstanceAttributesResponse.fromJson(Map json) { + return ListInstanceAttributesResponse( + attributes: (json['Attributes'] as List?) + ?.whereNotNull() + .map((e) => Attribute.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final attributes = this.attributes; + final nextToken = this.nextToken; + return { + if (attributes != null) 'Attributes': attributes, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListInstanceStorageConfigsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// A valid storage type. + final List? storageConfigs; + + ListInstanceStorageConfigsResponse({ + this.nextToken, + this.storageConfigs, + }); + + factory ListInstanceStorageConfigsResponse.fromJson( + Map json) { + return ListInstanceStorageConfigsResponse( + nextToken: json['NextToken'] as String?, + storageConfigs: (json['StorageConfigs'] as List?) + ?.whereNotNull() + .map((e) => InstanceStorageConfig.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final storageConfigs = this.storageConfigs; + return { + if (nextToken != null) 'NextToken': nextToken, + if (storageConfigs != null) 'StorageConfigs': storageConfigs, + }; + } +} + +class ListInstancesResponse { + /// Information about the instances. + final List? instanceSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListInstancesResponse({ + this.instanceSummaryList, + this.nextToken, + }); + + factory ListInstancesResponse.fromJson(Map json) { + return ListInstancesResponse( + instanceSummaryList: (json['InstanceSummaryList'] as List?) + ?.whereNotNull() + .map((e) => InstanceSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final instanceSummaryList = this.instanceSummaryList; + final nextToken = this.nextToken; + return { + if (instanceSummaryList != null) + 'InstanceSummaryList': instanceSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListIntegrationAssociationsResponse { + /// The associations. + final List? integrationAssociationSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListIntegrationAssociationsResponse({ + this.integrationAssociationSummaryList, + this.nextToken, + }); + + factory ListIntegrationAssociationsResponse.fromJson( + Map json) { + return ListIntegrationAssociationsResponse( + integrationAssociationSummaryList: + (json['IntegrationAssociationSummaryList'] as List?) + ?.whereNotNull() + .map((e) => IntegrationAssociationSummary.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final integrationAssociationSummaryList = + this.integrationAssociationSummaryList; + final nextToken = this.nextToken; + return { + if (integrationAssociationSummaryList != null) + 'IntegrationAssociationSummaryList': integrationAssociationSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListLambdaFunctionsResponse { + /// The Lambdafunction ARNs associated with the specified instance. + final List? lambdaFunctions; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListLambdaFunctionsResponse({ + this.lambdaFunctions, + this.nextToken, + }); + + factory ListLambdaFunctionsResponse.fromJson(Map json) { + return ListLambdaFunctionsResponse( + lambdaFunctions: (json['LambdaFunctions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final lambdaFunctions = this.lambdaFunctions; + final nextToken = this.nextToken; + return { + if (lambdaFunctions != null) 'LambdaFunctions': lambdaFunctions, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListLexBotsResponse { + /// The names and Amazon Web Services Regions of the Amazon Lex bots associated + /// with the specified instance. + final List? lexBots; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListLexBotsResponse({ + this.lexBots, + this.nextToken, + }); + + factory ListLexBotsResponse.fromJson(Map json) { + return ListLexBotsResponse( + lexBots: (json['LexBots'] as List?) + ?.whereNotNull() + .map((e) => LexBot.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final lexBots = this.lexBots; + final nextToken = this.nextToken; + return { + if (lexBots != null) 'LexBots': lexBots, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListPhoneNumbersResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the phone numbers. + final List? phoneNumberSummaryList; + + ListPhoneNumbersResponse({ + this.nextToken, + this.phoneNumberSummaryList, + }); + + factory ListPhoneNumbersResponse.fromJson(Map json) { + return ListPhoneNumbersResponse( + nextToken: json['NextToken'] as String?, + phoneNumberSummaryList: (json['PhoneNumberSummaryList'] as List?) + ?.whereNotNull() + .map((e) => PhoneNumberSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final phoneNumberSummaryList = this.phoneNumberSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (phoneNumberSummaryList != null) + 'PhoneNumberSummaryList': phoneNumberSummaryList, + }; + } +} + +/// Information about phone numbers that have been claimed to your Amazon +/// Connect instance or traffic distribution group. +class ListPhoneNumbersSummary { + /// The identifier of the Amazon Connect instance that phone numbers are claimed + /// to. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? instanceId; + + /// The phone number. Phone numbers are formatted [+] [country code] + /// [subscriber number including area code]. + final String? phoneNumber; + + /// The Amazon Resource Name (ARN) of the phone number. + final String? phoneNumberArn; + + /// The ISO country code. + final PhoneNumberCountryCode? phoneNumberCountryCode; + + /// The description of the phone number. + final String? phoneNumberDescription; + + /// A unique identifier for the phone number. + final String? phoneNumberId; + + /// The type of phone number. + final PhoneNumberType? phoneNumberType; + + /// The claimed phone number ARN that was previously imported from the external + /// service, such as Amazon Pinpoint. If it is from Amazon Pinpoint, it looks + /// like the ARN of the phone number that was imported from Amazon Pinpoint. + final String? sourcePhoneNumberArn; + + /// The Amazon Resource Name (ARN) for Amazon Connect instances or traffic + /// distribution groups that phone number inbound traffic is routed through. + final String? targetArn; + + ListPhoneNumbersSummary({ + this.instanceId, + this.phoneNumber, + this.phoneNumberArn, + this.phoneNumberCountryCode, + this.phoneNumberDescription, + this.phoneNumberId, + this.phoneNumberType, + this.sourcePhoneNumberArn, + this.targetArn, + }); + + factory ListPhoneNumbersSummary.fromJson(Map json) { + return ListPhoneNumbersSummary( + instanceId: json['InstanceId'] as String?, + phoneNumber: json['PhoneNumber'] as String?, + phoneNumberArn: json['PhoneNumberArn'] as String?, + phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) + ?.toPhoneNumberCountryCode(), + phoneNumberDescription: json['PhoneNumberDescription'] as String?, + phoneNumberId: json['PhoneNumberId'] as String?, + phoneNumberType: + (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + sourcePhoneNumberArn: json['SourcePhoneNumberArn'] as String?, + targetArn: json['TargetArn'] as String?, + ); + } + + Map toJson() { + final instanceId = this.instanceId; + final phoneNumber = this.phoneNumber; + final phoneNumberArn = this.phoneNumberArn; + final phoneNumberCountryCode = this.phoneNumberCountryCode; + final phoneNumberDescription = this.phoneNumberDescription; + final phoneNumberId = this.phoneNumberId; + final phoneNumberType = this.phoneNumberType; + final sourcePhoneNumberArn = this.sourcePhoneNumberArn; + final targetArn = this.targetArn; + return { + if (instanceId != null) 'InstanceId': instanceId, + if (phoneNumber != null) 'PhoneNumber': phoneNumber, + if (phoneNumberArn != null) 'PhoneNumberArn': phoneNumberArn, + if (phoneNumberCountryCode != null) + 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), + if (phoneNumberDescription != null) + 'PhoneNumberDescription': phoneNumberDescription, + if (phoneNumberId != null) 'PhoneNumberId': phoneNumberId, + if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + if (sourcePhoneNumberArn != null) + 'SourcePhoneNumberArn': sourcePhoneNumberArn, + if (targetArn != null) 'TargetArn': targetArn, + }; + } +} + +class ListPhoneNumbersV2Response { + /// Information about phone numbers that have been claimed to your Amazon + /// Connect instances or traffic distribution groups. + final List? listPhoneNumbersSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListPhoneNumbersV2Response({ + this.listPhoneNumbersSummaryList, + this.nextToken, + }); + + factory ListPhoneNumbersV2Response.fromJson(Map json) { + return ListPhoneNumbersV2Response( + listPhoneNumbersSummaryList: + (json['ListPhoneNumbersSummaryList'] as List?) + ?.whereNotNull() + .map((e) => + ListPhoneNumbersSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final listPhoneNumbersSummaryList = this.listPhoneNumbersSummaryList; + final nextToken = this.nextToken; + return { + if (listPhoneNumbersSummaryList != null) + 'ListPhoneNumbersSummaryList': listPhoneNumbersSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListPredefinedAttributesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Summary of the predefined attributes. + final List? predefinedAttributeSummaryList; + + ListPredefinedAttributesResponse({ + this.nextToken, + this.predefinedAttributeSummaryList, + }); + + factory ListPredefinedAttributesResponse.fromJson(Map json) { + return ListPredefinedAttributesResponse( + nextToken: json['NextToken'] as String?, + predefinedAttributeSummaryList: (json['PredefinedAttributeSummaryList'] + as List?) + ?.whereNotNull() + .map((e) => + PredefinedAttributeSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final predefinedAttributeSummaryList = this.predefinedAttributeSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (predefinedAttributeSummaryList != null) + 'PredefinedAttributeSummaryList': predefinedAttributeSummaryList, + }; + } +} + +class ListPromptsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the prompts. + final List? promptSummaryList; + + ListPromptsResponse({ + this.nextToken, + this.promptSummaryList, + }); + + factory ListPromptsResponse.fromJson(Map json) { + return ListPromptsResponse( + nextToken: json['NextToken'] as String?, + promptSummaryList: (json['PromptSummaryList'] as List?) + ?.whereNotNull() + .map((e) => PromptSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final promptSummaryList = this.promptSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (promptSummaryList != null) 'PromptSummaryList': promptSummaryList, + }; + } +} + +class ListQueueQuickConnectsResponse { + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the quick connects. + final List? quickConnectSummaryList; + + ListQueueQuickConnectsResponse({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.nextToken, + this.quickConnectSummaryList, + }); + + factory ListQueueQuickConnectsResponse.fromJson(Map json) { + return ListQueueQuickConnectsResponse( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + nextToken: json['NextToken'] as String?, + quickConnectSummaryList: (json['QuickConnectSummaryList'] as List?) + ?.whereNotNull() + .map((e) => QuickConnectSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final nextToken = this.nextToken; + final quickConnectSummaryList = this.quickConnectSummaryList; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (nextToken != null) 'NextToken': nextToken, + if (quickConnectSummaryList != null) + 'QuickConnectSummaryList': quickConnectSummaryList, + }; + } +} + +class ListQueuesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the queues. + final List? queueSummaryList; + + ListQueuesResponse({ + this.nextToken, + this.queueSummaryList, + }); + + factory ListQueuesResponse.fromJson(Map json) { + return ListQueuesResponse( + nextToken: json['NextToken'] as String?, + queueSummaryList: (json['QueueSummaryList'] as List?) + ?.whereNotNull() + .map((e) => QueueSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final queueSummaryList = this.queueSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (queueSummaryList != null) 'QueueSummaryList': queueSummaryList, + }; + } +} + +class ListQuickConnectsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the quick connects. + final List? quickConnectSummaryList; + + ListQuickConnectsResponse({ + this.nextToken, + this.quickConnectSummaryList, + }); + + factory ListQuickConnectsResponse.fromJson(Map json) { + return ListQuickConnectsResponse( + nextToken: json['NextToken'] as String?, + quickConnectSummaryList: (json['QuickConnectSummaryList'] as List?) + ?.whereNotNull() + .map((e) => QuickConnectSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final quickConnectSummaryList = this.quickConnectSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (quickConnectSummaryList != null) + 'QuickConnectSummaryList': quickConnectSummaryList, + }; + } +} + +class ListRealtimeContactAnalysisSegmentsV2Response { + /// The channel of the contact. Voice will not be returned. + final RealTimeContactAnalysisSupportedChannel channel; + + /// An analyzed transcript or category. + final List segments; + + /// Status of real-time contact analysis. + final RealTimeContactAnalysisStatus status; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListRealtimeContactAnalysisSegmentsV2Response({ + required this.channel, + required this.segments, + required this.status, + this.nextToken, + }); + + factory ListRealtimeContactAnalysisSegmentsV2Response.fromJson( + Map json) { + return ListRealtimeContactAnalysisSegmentsV2Response( + channel: (json['Channel'] as String) + .toRealTimeContactAnalysisSupportedChannel(), + segments: (json['Segments'] as List) + .whereNotNull() + .map((e) => RealtimeContactAnalysisSegment.fromJson( + e as Map)) + .toList(), + status: (json['Status'] as String).toRealTimeContactAnalysisStatus(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final channel = this.channel; + final segments = this.segments; + final status = this.status; + final nextToken = this.nextToken; + return { + 'Channel': channel.toValue(), + 'Segments': segments, + 'Status': status.toValue(), + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRoutingProfileQueuesResponse { + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the routing profiles. + final List? + routingProfileQueueConfigSummaryList; + + ListRoutingProfileQueuesResponse({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.nextToken, + this.routingProfileQueueConfigSummaryList, + }); + + factory ListRoutingProfileQueuesResponse.fromJson(Map json) { + return ListRoutingProfileQueuesResponse( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + nextToken: json['NextToken'] as String?, + routingProfileQueueConfigSummaryList: + (json['RoutingProfileQueueConfigSummaryList'] as List?) + ?.whereNotNull() + .map((e) => RoutingProfileQueueConfigSummary.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final nextToken = this.nextToken; + final routingProfileQueueConfigSummaryList = + this.routingProfileQueueConfigSummaryList; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (nextToken != null) 'NextToken': nextToken, + if (routingProfileQueueConfigSummaryList != null) + 'RoutingProfileQueueConfigSummaryList': + routingProfileQueueConfigSummaryList, + }; + } +} + +class ListRoutingProfilesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the routing profiles. + final List? routingProfileSummaryList; + + ListRoutingProfilesResponse({ + this.nextToken, + this.routingProfileSummaryList, + }); + + factory ListRoutingProfilesResponse.fromJson(Map json) { + return ListRoutingProfilesResponse( + nextToken: json['NextToken'] as String?, + routingProfileSummaryList: (json['RoutingProfileSummaryList'] as List?) + ?.whereNotNull() + .map((e) => RoutingProfileSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final routingProfileSummaryList = this.routingProfileSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (routingProfileSummaryList != null) + 'RoutingProfileSummaryList': routingProfileSummaryList, + }; + } +} + +class ListRulesResponse { + /// Summary information about a rule. + final List ruleSummaryList; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListRulesResponse({ + required this.ruleSummaryList, + this.nextToken, + }); + + factory ListRulesResponse.fromJson(Map json) { + return ListRulesResponse( + ruleSummaryList: (json['RuleSummaryList'] as List) + .whereNotNull() + .map((e) => RuleSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final ruleSummaryList = this.ruleSummaryList; + final nextToken = this.nextToken; + return { + 'RuleSummaryList': ruleSummaryList, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListSecurityKeysResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// The security keys. + final List? securityKeys; + + ListSecurityKeysResponse({ + this.nextToken, + this.securityKeys, + }); + + factory ListSecurityKeysResponse.fromJson(Map json) { + return ListSecurityKeysResponse( + nextToken: json['NextToken'] as String?, + securityKeys: (json['SecurityKeys'] as List?) + ?.whereNotNull() + .map((e) => SecurityKey.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final securityKeys = this.securityKeys; + return { + if (nextToken != null) 'NextToken': nextToken, + if (securityKeys != null) 'SecurityKeys': securityKeys, + }; + } +} + +class ListSecurityProfileApplicationsResponse { + /// A list of the third-party application's metadata. + final List? applications; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + ListSecurityProfileApplicationsResponse({ + this.applications, + this.lastModifiedRegion, + this.lastModifiedTime, + this.nextToken, + }); + + factory ListSecurityProfileApplicationsResponse.fromJson( + Map json) { + return ListSecurityProfileApplicationsResponse( + applications: (json['Applications'] as List?) + ?.whereNotNull() + .map((e) => Application.fromJson(e as Map)) + .toList(), + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final applications = this.applications; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final nextToken = this.nextToken; + return { + if (applications != null) 'Applications': applications, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListSecurityProfilePermissionsResponse { + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// The permissions granted to the security profile. For a complete list of + /// valid permissions, see List + /// of security profile permissions. + final List? permissions; + + ListSecurityProfilePermissionsResponse({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.nextToken, + this.permissions, + }); + + factory ListSecurityProfilePermissionsResponse.fromJson( + Map json) { + return ListSecurityProfilePermissionsResponse( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + nextToken: json['NextToken'] as String?, + permissions: (json['Permissions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final nextToken = this.nextToken; + final permissions = this.permissions; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (nextToken != null) 'NextToken': nextToken, + if (permissions != null) 'Permissions': permissions, + }; + } +} + +class ListSecurityProfilesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the security profiles. + final List? securityProfileSummaryList; + + ListSecurityProfilesResponse({ + this.nextToken, + this.securityProfileSummaryList, + }); + + factory ListSecurityProfilesResponse.fromJson(Map json) { + return ListSecurityProfilesResponse( + nextToken: json['NextToken'] as String?, + securityProfileSummaryList: (json['SecurityProfileSummaryList'] as List?) + ?.whereNotNull() + .map( + (e) => SecurityProfileSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final securityProfileSummaryList = this.securityProfileSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (securityProfileSummaryList != null) + 'SecurityProfileSummaryList': securityProfileSummaryList, + }; + } +} + +class ListTagsForResourceResponse { + /// Information about the tags. + final Map? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +class ListTaskTemplatesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + /// + /// This is always returned as a null in the response. + /// + final String? nextToken; + + /// Provides details about a list of task templates belonging to an instance. + final List? taskTemplates; + + ListTaskTemplatesResponse({ + this.nextToken, + this.taskTemplates, + }); + + factory ListTaskTemplatesResponse.fromJson(Map json) { + return ListTaskTemplatesResponse( + nextToken: json['NextToken'] as String?, + taskTemplates: (json['TaskTemplates'] as List?) + ?.whereNotNull() + .map((e) => TaskTemplateMetadata.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final taskTemplates = this.taskTemplates; + return { + if (nextToken != null) 'NextToken': nextToken, + if (taskTemplates != null) 'TaskTemplates': taskTemplates, + }; + } +} + +class ListTrafficDistributionGroupUsersResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// A list of traffic distribution group users. + final List? + trafficDistributionGroupUserSummaryList; + + ListTrafficDistributionGroupUsersResponse({ + this.nextToken, + this.trafficDistributionGroupUserSummaryList, + }); + + factory ListTrafficDistributionGroupUsersResponse.fromJson( + Map json) { + return ListTrafficDistributionGroupUsersResponse( + nextToken: json['NextToken'] as String?, + trafficDistributionGroupUserSummaryList: + (json['TrafficDistributionGroupUserSummaryList'] as List?) + ?.whereNotNull() + .map((e) => TrafficDistributionGroupUserSummary.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final trafficDistributionGroupUserSummaryList = + this.trafficDistributionGroupUserSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (trafficDistributionGroupUserSummaryList != null) + 'TrafficDistributionGroupUserSummaryList': + trafficDistributionGroupUserSummaryList, + }; + } +} + +class ListTrafficDistributionGroupsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// A list of traffic distribution groups. + final List? + trafficDistributionGroupSummaryList; + + ListTrafficDistributionGroupsResponse({ + this.nextToken, + this.trafficDistributionGroupSummaryList, + }); + + factory ListTrafficDistributionGroupsResponse.fromJson( + Map json) { + return ListTrafficDistributionGroupsResponse( + nextToken: json['NextToken'] as String?, + trafficDistributionGroupSummaryList: + (json['TrafficDistributionGroupSummaryList'] as List?) + ?.whereNotNull() + .map((e) => TrafficDistributionGroupSummary.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final trafficDistributionGroupSummaryList = + this.trafficDistributionGroupSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (trafficDistributionGroupSummaryList != null) + 'TrafficDistributionGroupSummaryList': + trafficDistributionGroupSummaryList, + }; + } +} + +class ListUseCasesResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// The use cases. + final List? useCaseSummaryList; + + ListUseCasesResponse({ + this.nextToken, + this.useCaseSummaryList, + }); + + factory ListUseCasesResponse.fromJson(Map json) { + return ListUseCasesResponse( + nextToken: json['NextToken'] as String?, + useCaseSummaryList: (json['UseCaseSummaryList'] as List?) + ?.whereNotNull() + .map((e) => UseCase.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final useCaseSummaryList = this.useCaseSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (useCaseSummaryList != null) 'UseCaseSummaryList': useCaseSummaryList, + }; + } +} + +class ListUserHierarchyGroupsResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the hierarchy groups. + final List? userHierarchyGroupSummaryList; + + ListUserHierarchyGroupsResponse({ + this.nextToken, + this.userHierarchyGroupSummaryList, + }); + + factory ListUserHierarchyGroupsResponse.fromJson(Map json) { + return ListUserHierarchyGroupsResponse( + nextToken: json['NextToken'] as String?, + userHierarchyGroupSummaryList: (json['UserHierarchyGroupSummaryList'] + as List?) + ?.whereNotNull() + .map((e) => HierarchyGroupSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final userHierarchyGroupSummaryList = this.userHierarchyGroupSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (userHierarchyGroupSummaryList != null) + 'UserHierarchyGroupSummaryList': userHierarchyGroupSummaryList, + }; + } +} + +class ListUserProficienciesResponse { + /// The region in which a user's proficiencies were last modified. + final String? lastModifiedRegion; + + /// The last time that the user's proficiencies are were modified. + final DateTime? lastModifiedTime; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the user proficiencies. + final List? userProficiencyList; + + ListUserProficienciesResponse({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.nextToken, + this.userProficiencyList, + }); + + factory ListUserProficienciesResponse.fromJson(Map json) { + return ListUserProficienciesResponse( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + nextToken: json['NextToken'] as String?, + userProficiencyList: (json['UserProficiencyList'] as List?) + ?.whereNotNull() + .map((e) => UserProficiency.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final nextToken = this.nextToken; + final userProficiencyList = this.userProficiencyList; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (nextToken != null) 'NextToken': nextToken, + if (userProficiencyList != null) + 'UserProficiencyList': userProficiencyList, + }; + } +} + +class ListUsersResponse { + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the users. + final List? userSummaryList; + + ListUsersResponse({ + this.nextToken, + this.userSummaryList, + }); + + factory ListUsersResponse.fromJson(Map json) { + return ListUsersResponse( + nextToken: json['NextToken'] as String?, + userSummaryList: (json['UserSummaryList'] as List?) + ?.whereNotNull() + .map((e) => UserSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final userSummaryList = this.userSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (userSummaryList != null) 'UserSummaryList': userSummaryList, + }; + } +} + +class ListViewVersionsResponse { + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; + + /// A list of view version summaries. + final List? viewVersionSummaryList; + + ListViewVersionsResponse({ + this.nextToken, + this.viewVersionSummaryList, + }); + + factory ListViewVersionsResponse.fromJson(Map json) { + return ListViewVersionsResponse( + nextToken: json['NextToken'] as String?, + viewVersionSummaryList: (json['ViewVersionSummaryList'] as List?) + ?.whereNotNull() + .map((e) => ViewVersionSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final viewVersionSummaryList = this.viewVersionSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (viewVersionSummaryList != null) + 'ViewVersionSummaryList': viewVersionSummaryList, + }; + } +} + +class ListViewsResponse { + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; + + /// A list of view summaries. + final List? viewsSummaryList; + + ListViewsResponse({ + this.nextToken, + this.viewsSummaryList, + }); + + factory ListViewsResponse.fromJson(Map json) { + return ListViewsResponse( + nextToken: json['NextToken'] as String?, + viewsSummaryList: (json['ViewsSummaryList'] as List?) + ?.whereNotNull() + .map((e) => ViewSummary.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final viewsSummaryList = this.viewsSummaryList; + return { + if (nextToken != null) 'NextToken': nextToken, + if (viewsSummaryList != null) 'ViewsSummaryList': viewsSummaryList, + }; + } +} + +/// Contains information about which channels are supported, and how many +/// contacts an agent can have on a channel simultaneously. +class MediaConcurrency { + /// The channels that agents can handle in the Contact Control Panel (CCP). + final Channel channel; + + /// The number of contacts an agent can have on a channel simultaneously. + /// + /// Valid Range for VOICE: Minimum value of 1. Maximum value of 1. + /// + /// Valid Range for CHAT: Minimum value of 1. Maximum value of 10. + /// + /// Valid Range for TASK: Minimum value of 1. Maximum value of 10. + final int concurrency; + + /// Defines the cross-channel routing behavior for each channel that is enabled + /// for this Routing Profile. For example, this allows you to offer an agent a + /// different contact from another channel when they are currently working with + /// a contact from a Voice channel. + final CrossChannelBehavior? crossChannelBehavior; + + MediaConcurrency({ + required this.channel, + required this.concurrency, + this.crossChannelBehavior, + }); + + factory MediaConcurrency.fromJson(Map json) { + return MediaConcurrency( + channel: (json['Channel'] as String).toChannel(), + concurrency: json['Concurrency'] as int, + crossChannelBehavior: json['CrossChannelBehavior'] != null + ? CrossChannelBehavior.fromJson( + json['CrossChannelBehavior'] as Map) + : null, + ); + } + + Map toJson() { + final channel = this.channel; + final concurrency = this.concurrency; + final crossChannelBehavior = this.crossChannelBehavior; + return { + 'Channel': channel.toValue(), + 'Concurrency': concurrency, + if (crossChannelBehavior != null) + 'CrossChannelBehavior': crossChannelBehavior, + }; + } +} + +/// A set of endpoints used by clients to connect to the media service group for +/// an Amazon Chime SDK meeting. +class MediaPlacement { + /// The audio fallback URL. + final String? audioFallbackUrl; + + /// The audio host URL. + final String? audioHostUrl; + + /// The event ingestion URL to which you send client meeting events. + final String? eventIngestionUrl; + + /// The signaling URL. + final String? signalingUrl; + + /// The turn control URL. + final String? turnControlUrl; + + MediaPlacement({ + this.audioFallbackUrl, + this.audioHostUrl, + this.eventIngestionUrl, + this.signalingUrl, + this.turnControlUrl, + }); + + factory MediaPlacement.fromJson(Map json) { + return MediaPlacement( + audioFallbackUrl: json['AudioFallbackUrl'] as String?, + audioHostUrl: json['AudioHostUrl'] as String?, + eventIngestionUrl: json['EventIngestionUrl'] as String?, + signalingUrl: json['SignalingUrl'] as String?, + turnControlUrl: json['TurnControlUrl'] as String?, + ); + } + + Map toJson() { + final audioFallbackUrl = this.audioFallbackUrl; + final audioHostUrl = this.audioHostUrl; + final eventIngestionUrl = this.eventIngestionUrl; + final signalingUrl = this.signalingUrl; + final turnControlUrl = this.turnControlUrl; + return { + if (audioFallbackUrl != null) 'AudioFallbackUrl': audioFallbackUrl, + if (audioHostUrl != null) 'AudioHostUrl': audioHostUrl, + if (eventIngestionUrl != null) 'EventIngestionUrl': eventIngestionUrl, + if (signalingUrl != null) 'SignalingUrl': signalingUrl, + if (turnControlUrl != null) 'TurnControlUrl': turnControlUrl, + }; + } +} + +/// A meeting created using the Amazon Chime SDK. +class Meeting { + /// The media placement for the meeting. + final MediaPlacement? mediaPlacement; + + /// The Amazon Web Services Region in which you create the meeting. + final String? mediaRegion; + + /// The configuration settings of the features available to a meeting. + final MeetingFeaturesConfiguration? meetingFeatures; + + /// The Amazon Chime SDK meeting ID. + final String? meetingId; + + Meeting({ + this.mediaPlacement, + this.mediaRegion, + this.meetingFeatures, + this.meetingId, + }); + + factory Meeting.fromJson(Map json) { + return Meeting( + mediaPlacement: json['MediaPlacement'] != null + ? MediaPlacement.fromJson( + json['MediaPlacement'] as Map) + : null, + mediaRegion: json['MediaRegion'] as String?, + meetingFeatures: json['MeetingFeatures'] != null + ? MeetingFeaturesConfiguration.fromJson( + json['MeetingFeatures'] as Map) + : null, + meetingId: json['MeetingId'] as String?, + ); + } + + Map toJson() { + final mediaPlacement = this.mediaPlacement; + final mediaRegion = this.mediaRegion; + final meetingFeatures = this.meetingFeatures; + final meetingId = this.meetingId; + return { + if (mediaPlacement != null) 'MediaPlacement': mediaPlacement, + if (mediaRegion != null) 'MediaRegion': mediaRegion, + if (meetingFeatures != null) 'MeetingFeatures': meetingFeatures, + if (meetingId != null) 'MeetingId': meetingId, + }; + } +} + +enum MeetingFeatureStatus { + available, + unavailable, +} + +extension MeetingFeatureStatusValueExtension on MeetingFeatureStatus { + String toValue() { + switch (this) { + case MeetingFeatureStatus.available: + return 'AVAILABLE'; + case MeetingFeatureStatus.unavailable: + return 'UNAVAILABLE'; + } + } +} + +extension MeetingFeatureStatusFromString on String { + MeetingFeatureStatus toMeetingFeatureStatus() { + switch (this) { + case 'AVAILABLE': + return MeetingFeatureStatus.available; + case 'UNAVAILABLE': + return MeetingFeatureStatus.unavailable; + } + throw Exception('$this is not known in enum MeetingFeatureStatus'); + } +} + +/// The configuration settings of the features available to a meeting. +class MeetingFeaturesConfiguration { + /// The configuration settings for the audio features available to a meeting. + final AudioFeatures? audio; + + MeetingFeaturesConfiguration({ + this.audio, + }); + + factory MeetingFeaturesConfiguration.fromJson(Map json) { + return MeetingFeaturesConfiguration( + audio: json['Audio'] != null + ? AudioFeatures.fromJson(json['Audio'] as Map) + : null, + ); + } + + Map toJson() { + final audio = this.audio; + return { + if (audio != null) 'Audio': audio, + }; + } +} + +/// Contains the name, thresholds, and metric filters. +class MetricDataV2 { + /// The metric name, thresholds, and metric filters of the returned metric. + final MetricV2? metric; + + /// The corresponding value of the metric returned in the response. + final double? value; + + MetricDataV2({ + this.metric, + this.value, + }); + + factory MetricDataV2.fromJson(Map json) { + return MetricDataV2( + metric: json['Metric'] != null + ? MetricV2.fromJson(json['Metric'] as Map) + : null, + value: json['Value'] as double?, + ); + } + + Map toJson() { + final metric = this.metric; + final value = this.value; + return { + if (metric != null) 'Metric': metric, + if (value != null) 'Value': value, + }; + } +} + +/// Contains information about the filter used when retrieving metrics. +/// MetricFiltersV2 can be used on the following metrics: +/// AVG_AGENT_CONNECTING_TIME, CONTACTS_CREATED, +/// CONTACTS_HANDLED, SUM_CONTACTS_DISCONNECTED. +class MetricFilterV2 { + /// The key to use for filtering data. + /// + /// Valid metric filter keys: INITIATION_METHOD, + /// DISCONNECT_REASON. These are the same values as the + /// InitiationMethod and DisconnectReason in the + /// contact record. For more information, see ContactTraceRecord + /// in the Amazon Connect Administrator Guide. + final String? metricFilterKey; + + /// The values to use for filtering data. + /// + /// Valid metric filter values for INITIATION_METHOD: + /// INBOUND | OUTBOUND | TRANSFER | + /// QUEUE_TRANSFER | CALLBACK | API + /// + /// Valid metric filter values for DISCONNECT_REASON: + /// CUSTOMER_DISCONNECT | AGENT_DISCONNECT | + /// THIRD_PARTY_DISCONNECT | TELECOM_PROBLEM | + /// BARGED | CONTACT_FLOW_DISCONNECT | + /// OTHER | EXPIRED | API + final List? metricFilterValues; + + /// The flag to use to filter on requested metric filter values or to not filter + /// on requested metric filter values. By default the negate is + /// false, which indicates to filter on the requested metric + /// filter. + final bool? negate; + + MetricFilterV2({ + this.metricFilterKey, + this.metricFilterValues, + this.negate, + }); + + factory MetricFilterV2.fromJson(Map json) { + return MetricFilterV2( + metricFilterKey: json['MetricFilterKey'] as String?, + metricFilterValues: (json['MetricFilterValues'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + negate: json['Negate'] as bool?, + ); + } + + Map toJson() { + final metricFilterKey = this.metricFilterKey; + final metricFilterValues = this.metricFilterValues; + final negate = this.negate; + return { + if (metricFilterKey != null) 'MetricFilterKey': metricFilterKey, + if (metricFilterValues != null) 'MetricFilterValues': metricFilterValues, + if (negate != null) 'Negate': negate, + }; + } +} + +/// The interval period with the start and end time for the metrics. +class MetricInterval { + /// The timestamp, in UNIX Epoch time format. End time is based on the interval + /// period selected. For example, If IntervalPeriod is selected + /// THIRTY_MIN, StartTime and EndTime in + /// the API request differs by 1 day, then 48 results are returned in the + /// response. Each result is aggregated by the 30 minutes period, with each + /// StartTime and EndTime differing by 30 minutes. + final DateTime? endTime; + + /// The interval period provided in the API request. + final IntervalPeriod? interval; + + /// The timestamp, in UNIX Epoch time format. Start time is based on the + /// interval period selected. + final DateTime? startTime; + + MetricInterval({ + this.endTime, + this.interval, + this.startTime, + }); + + factory MetricInterval.fromJson(Map json) { + return MetricInterval( + endTime: timeStampFromJson(json['EndTime']), + interval: (json['Interval'] as String?)?.toIntervalPeriod(), + startTime: timeStampFromJson(json['StartTime']), + ); + } + + Map toJson() { + final endTime = this.endTime; + final interval = this.interval; + final startTime = this.startTime; + return { + if (endTime != null) 'EndTime': unixTimestampToJson(endTime), + if (interval != null) 'Interval': interval.toValue(), + if (startTime != null) 'StartTime': unixTimestampToJson(startTime), + }; + } +} + +/// Contains information about the metric results. +class MetricResultV2 { + /// The set of metrics. + final List? collections; + + /// The dimension for the metrics. + final Map? dimensions; + + /// The interval period with the start and end time for the metrics. + final MetricInterval? metricInterval; + + MetricResultV2({ + this.collections, + this.dimensions, + this.metricInterval, + }); + + factory MetricResultV2.fromJson(Map json) { + return MetricResultV2( + collections: (json['Collections'] as List?) + ?.whereNotNull() + .map((e) => MetricDataV2.fromJson(e as Map)) + .toList(), + dimensions: (json['Dimensions'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + metricInterval: json['MetricInterval'] != null + ? MetricInterval.fromJson( + json['MetricInterval'] as Map) + : null, + ); + } + + Map toJson() { + final collections = this.collections; + final dimensions = this.dimensions; + final metricInterval = this.metricInterval; + return { + if (collections != null) 'Collections': collections, + if (dimensions != null) 'Dimensions': dimensions, + if (metricInterval != null) 'MetricInterval': metricInterval, + }; + } +} + +/// Contains information about the metric. +class MetricV2 { + /// Contains the filters to be used when returning data. + final List? metricFilters; + + /// The name of the metric. + /// + /// This parameter is required. The following Required = No is incorrect. + /// + final String? name; + + /// Contains information about the threshold for service level metrics. + final List? threshold; + + MetricV2({ + this.metricFilters, + this.name, + this.threshold, + }); + + factory MetricV2.fromJson(Map json) { + return MetricV2( + metricFilters: (json['MetricFilters'] as List?) + ?.whereNotNull() + .map((e) => MetricFilterV2.fromJson(e as Map)) + .toList(), + name: json['Name'] as String?, + threshold: (json['Threshold'] as List?) + ?.whereNotNull() + .map((e) => ThresholdV2.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final metricFilters = this.metricFilters; + final name = this.name; + final threshold = this.threshold; + return { + if (metricFilters != null) 'MetricFilters': metricFilters, + if (name != null) 'Name': name, + if (threshold != null) 'Threshold': threshold, + }; + } +} + +enum MonitorCapability { + silentMonitor, + barge, +} + +extension MonitorCapabilityValueExtension on MonitorCapability { + String toValue() { + switch (this) { + case MonitorCapability.silentMonitor: + return 'SILENT_MONITOR'; + case MonitorCapability.barge: + return 'BARGE'; + } + } +} + +extension MonitorCapabilityFromString on String { + MonitorCapability toMonitorCapability() { + switch (this) { + case 'SILENT_MONITOR': + return MonitorCapability.silentMonitor; + case 'BARGE': + return MonitorCapability.barge; + } + throw Exception('$this is not known in enum MonitorCapability'); + } +} + +class MonitorContactResponse { + /// The ARN of the contact. + final String? contactArn; + + /// The identifier of the contact. + final String? contactId; + + MonitorContactResponse({ + this.contactArn, + this.contactId, + }); + + factory MonitorContactResponse.fromJson(Map json) { + return MonitorContactResponse( + contactArn: json['ContactArn'] as String?, + contactId: json['ContactId'] as String?, + ); + } + + Map toJson() { + final contactArn = this.contactArn; + final contactId = this.contactId; + return { + if (contactArn != null) 'ContactArn': contactArn, + if (contactId != null) 'ContactId': contactId, + }; + } +} + +/// Payload of chat properties to apply when starting a new contact. +class NewSessionDetails { + /// A custom key-value pair using an attribute map. The attributes are standard + /// Amazon Connect attributes. They can be accessed in flows just like any other + /// contact attributes. + /// + /// There can be up to 32,768 UTF-8 bytes across all key-value pairs per + /// contact. Attribute keys can include only alphanumeric, dash, and underscore + /// characters. + final Map? attributes; + final ParticipantDetails? participantDetails; + final ChatStreamingConfiguration? streamingConfiguration; + + /// The supported chat message content types. Supported types are + /// text/plain, text/markdown, + /// application/json, + /// application/vnd.amazonaws.connect.message.interactive, and + /// application/vnd.amazonaws.connect.message.interactive.response. + /// + /// Content types must always contain text/plain. You can then put + /// any other supported type in the list. For example, all the following lists + /// are valid because they contain text/plain: [text/plain, + /// text/markdown, application/json], [text/markdown, + /// text/plain], [text/plain, application/json, + /// application/vnd.amazonaws.connect.message.interactive.response]. + final List? supportedMessagingContentTypes; + + NewSessionDetails({ + this.attributes, + this.participantDetails, + this.streamingConfiguration, + this.supportedMessagingContentTypes, + }); + + Map toJson() { + final attributes = this.attributes; + final participantDetails = this.participantDetails; + final streamingConfiguration = this.streamingConfiguration; + final supportedMessagingContentTypes = this.supportedMessagingContentTypes; + return { + if (attributes != null) 'Attributes': attributes, + if (participantDetails != null) 'ParticipantDetails': participantDetails, + if (streamingConfiguration != null) + 'StreamingConfiguration': streamingConfiguration, + if (supportedMessagingContentTypes != null) + 'SupportedMessagingContentTypes': supportedMessagingContentTypes, + }; + } +} + +enum NotificationContentType { + plainText, +} + +extension NotificationContentTypeValueExtension on NotificationContentType { + String toValue() { + switch (this) { + case NotificationContentType.plainText: + return 'PLAIN_TEXT'; + } + } +} + +extension NotificationContentTypeFromString on String { + NotificationContentType toNotificationContentType() { + switch (this) { + case 'PLAIN_TEXT': + return NotificationContentType.plainText; + } + throw Exception('$this is not known in enum NotificationContentType'); + } +} + +enum NotificationDeliveryType { + email, +} + +extension NotificationDeliveryTypeValueExtension on NotificationDeliveryType { + String toValue() { + switch (this) { + case NotificationDeliveryType.email: + return 'EMAIL'; + } + } +} + +extension NotificationDeliveryTypeFromString on String { + NotificationDeliveryType toNotificationDeliveryType() { + switch (this) { + case 'EMAIL': + return NotificationDeliveryType.email; + } + throw Exception('$this is not known in enum NotificationDeliveryType'); + } +} + +/// The type of notification recipient. +class NotificationRecipientType { + /// A list of user IDs. + final List? userIds; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. Amazon Connect + /// users with the specified tags will be notified. + final Map? userTags; + + NotificationRecipientType({ + this.userIds, + this.userTags, + }); + + factory NotificationRecipientType.fromJson(Map json) { + return NotificationRecipientType( + userIds: (json['UserIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + userTags: (json['UserTags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final userIds = this.userIds; + final userTags = this.userTags; + return { + if (userIds != null) 'UserIds': userIds, + if (userTags != null) 'UserTags': userTags, + }; + } +} + +/// Information about a reference when the referenceType is +/// NUMBER. Otherwise, null. +class NumberReference { + /// Identifier of the number reference. + final String? name; + + /// A valid number. + final String? value; + + NumberReference({ + this.name, + this.value, + }); + + factory NumberReference.fromJson(Map json) { + return NumberReference( + name: json['Name'] as String?, + value: json['Value'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final value = this.value; + return { + if (name != null) 'Name': name, + if (value != null) 'Value': value, + }; + } +} + +enum NumericQuestionPropertyAutomationLabel { + overallCustomerSentimentScore, + overallAgentSentimentScore, + nonTalkTime, + nonTalkTimePercentage, + numberOfInterruptions, + contactDuration, + agentInteractionDuration, + customerHoldTime, +} + +extension NumericQuestionPropertyAutomationLabelValueExtension + on NumericQuestionPropertyAutomationLabel { + String toValue() { + switch (this) { + case NumericQuestionPropertyAutomationLabel.overallCustomerSentimentScore: + return 'OVERALL_CUSTOMER_SENTIMENT_SCORE'; + case NumericQuestionPropertyAutomationLabel.overallAgentSentimentScore: + return 'OVERALL_AGENT_SENTIMENT_SCORE'; + case NumericQuestionPropertyAutomationLabel.nonTalkTime: + return 'NON_TALK_TIME'; + case NumericQuestionPropertyAutomationLabel.nonTalkTimePercentage: + return 'NON_TALK_TIME_PERCENTAGE'; + case NumericQuestionPropertyAutomationLabel.numberOfInterruptions: + return 'NUMBER_OF_INTERRUPTIONS'; + case NumericQuestionPropertyAutomationLabel.contactDuration: + return 'CONTACT_DURATION'; + case NumericQuestionPropertyAutomationLabel.agentInteractionDuration: + return 'AGENT_INTERACTION_DURATION'; + case NumericQuestionPropertyAutomationLabel.customerHoldTime: + return 'CUSTOMER_HOLD_TIME'; + } + } +} + +extension NumericQuestionPropertyAutomationLabelFromString on String { + NumericQuestionPropertyAutomationLabel + toNumericQuestionPropertyAutomationLabel() { + switch (this) { + case 'OVERALL_CUSTOMER_SENTIMENT_SCORE': + return NumericQuestionPropertyAutomationLabel + .overallCustomerSentimentScore; + case 'OVERALL_AGENT_SENTIMENT_SCORE': + return NumericQuestionPropertyAutomationLabel + .overallAgentSentimentScore; + case 'NON_TALK_TIME': + return NumericQuestionPropertyAutomationLabel.nonTalkTime; + case 'NON_TALK_TIME_PERCENTAGE': + return NumericQuestionPropertyAutomationLabel.nonTalkTimePercentage; + case 'NUMBER_OF_INTERRUPTIONS': + return NumericQuestionPropertyAutomationLabel.numberOfInterruptions; + case 'CONTACT_DURATION': + return NumericQuestionPropertyAutomationLabel.contactDuration; + case 'AGENT_INTERACTION_DURATION': + return NumericQuestionPropertyAutomationLabel.agentInteractionDuration; + case 'CUSTOMER_HOLD_TIME': + return NumericQuestionPropertyAutomationLabel.customerHoldTime; + } + throw Exception( + '$this is not known in enum NumericQuestionPropertyAutomationLabel'); + } +} + +/// Information about the property value used in automation of a numeric +/// questions. Label values are associated with minimum and maximum values for +/// the numeric question. +/// +///
        +///
      • +/// Sentiment scores have a minimum value of -5 and maximum value of 5. +///
      • +///
      • +/// Duration labels, such as NON_TALK_TIME, +/// CONTACT_DURATION, AGENT_INTERACTION_DURATION, +/// CUSTOMER_HOLD_TIME have a minimum value of 0 and maximum value +/// of 28800. +///
      • +///
      • +/// Percentages have a minimum value of 0 and maximum value of 100. +///
      • +///
      • +/// NUMBER_OF_INTERRUPTIONS has a minimum value of 0 and maximum +/// value of 1000. +///
      • +///
      +class NumericQuestionPropertyValueAutomation { + /// The property label of the automation. + final NumericQuestionPropertyAutomationLabel label; + + NumericQuestionPropertyValueAutomation({ + required this.label, + }); + + factory NumericQuestionPropertyValueAutomation.fromJson( + Map json) { + return NumericQuestionPropertyValueAutomation( + label: + (json['Label'] as String).toNumericQuestionPropertyAutomationLabel(), + ); + } + + Map toJson() { + final label = this.label; + return { + 'Label': label.toValue(), + }; + } +} + +/// The outbound caller ID name, number, and outbound whisper flow. +class OutboundCallerConfig { + /// The caller ID name. + final String? outboundCallerIdName; + + /// The caller ID number. + final String? outboundCallerIdNumberId; + + /// The outbound whisper flow to be used during an outbound call. + final String? outboundFlowId; + + OutboundCallerConfig({ + this.outboundCallerIdName, + this.outboundCallerIdNumberId, + this.outboundFlowId, + }); + + factory OutboundCallerConfig.fromJson(Map json) { + return OutboundCallerConfig( + outboundCallerIdName: json['OutboundCallerIdName'] as String?, + outboundCallerIdNumberId: json['OutboundCallerIdNumberId'] as String?, + outboundFlowId: json['OutboundFlowId'] as String?, + ); + } + + Map toJson() { + final outboundCallerIdName = this.outboundCallerIdName; + final outboundCallerIdNumberId = this.outboundCallerIdNumberId; + final outboundFlowId = this.outboundFlowId; + return { + if (outboundCallerIdName != null) + 'OutboundCallerIdName': outboundCallerIdName, + if (outboundCallerIdNumberId != null) + 'OutboundCallerIdNumberId': outboundCallerIdNumberId, + if (outboundFlowId != null) 'OutboundFlowId': outboundFlowId, + }; + } +} + +/// The configuration for the allowed capabilities for participants present over +/// the call. +class ParticipantCapabilities { + /// The configuration having the video sharing capabilities for participants + /// over the call. + final VideoCapability? video; + + ParticipantCapabilities({ + this.video, + }); + + factory ParticipantCapabilities.fromJson(Map json) { + return ParticipantCapabilities( + video: (json['Video'] as String?)?.toVideoCapability(), + ); + } + + Map toJson() { + final video = this.video; + return { + if (video != null) 'Video': video.toValue(), + }; + } +} + +/// The customer's details. +class ParticipantDetails { + /// Display name of the participant. + final String displayName; + + ParticipantDetails({ + required this.displayName, + }); + + Map toJson() { + final displayName = this.displayName; + return { + 'DisplayName': displayName, + }; + } +} + +/// The details to add for the participant. +class ParticipantDetailsToAdd { + /// The display name of the participant. + final String? displayName; + + /// The role of the participant being added. + final ParticipantRole? participantRole; + + ParticipantDetailsToAdd({ + this.displayName, + this.participantRole, + }); + + Map toJson() { + final displayName = this.displayName; + final participantRole = this.participantRole; + return { + if (displayName != null) 'DisplayName': displayName, + if (participantRole != null) 'ParticipantRole': participantRole.toValue(), + }; + } +} + +enum ParticipantRole { + agent, + customer, + system, + customBot, + supervisor, +} + +extension ParticipantRoleValueExtension on ParticipantRole { + String toValue() { + switch (this) { + case ParticipantRole.agent: + return 'AGENT'; + case ParticipantRole.customer: + return 'CUSTOMER'; + case ParticipantRole.system: + return 'SYSTEM'; + case ParticipantRole.customBot: + return 'CUSTOM_BOT'; + case ParticipantRole.supervisor: + return 'SUPERVISOR'; + } + } +} + +extension ParticipantRoleFromString on String { + ParticipantRole toParticipantRole() { + switch (this) { + case 'AGENT': + return ParticipantRole.agent; + case 'CUSTOMER': + return ParticipantRole.customer; + case 'SYSTEM': + return ParticipantRole.system; + case 'CUSTOM_BOT': + return ParticipantRole.customBot; + case 'SUPERVISOR': + return ParticipantRole.supervisor; + } + throw Exception('$this is not known in enum ParticipantRole'); + } +} + +enum ParticipantTimerAction { + unset, +} + +extension ParticipantTimerActionValueExtension on ParticipantTimerAction { + String toValue() { + switch (this) { + case ParticipantTimerAction.unset: + return 'Unset'; + } + } +} + +extension ParticipantTimerActionFromString on String { + ParticipantTimerAction toParticipantTimerAction() { + switch (this) { + case 'Unset': + return ParticipantTimerAction.unset; + } + throw Exception('$this is not known in enum ParticipantTimerAction'); + } +} + +/// Configuration information for the timer. After the timer configuration is +/// set, it persists for the duration of the chat. It persists across new +/// contacts in the chain, for example, transfer contacts. +/// +/// For more information about how chat timeouts work, see Set +/// up chat timeouts for human participants. +class ParticipantTimerConfiguration { + /// The role of the participant in the chat conversation. + final TimerEligibleParticipantRoles participantRole; + + /// The type of timer. IDLE indicates the timer applies for + /// considering a human chat participant as idle. + /// DISCONNECT_NONCUSTOMER indicates the timer applies to + /// automatically disconnecting a chat participant due to idleness. + final ParticipantTimerType timerType; + + /// The value of the timer. Either the timer action (Unset to delete the timer), + /// or the duration of the timer in minutes. Only one value can be set. + final ParticipantTimerValue timerValue; + + ParticipantTimerConfiguration({ + required this.participantRole, + required this.timerType, + required this.timerValue, + }); + + Map toJson() { + final participantRole = this.participantRole; + final timerType = this.timerType; + final timerValue = this.timerValue; + return { + 'ParticipantRole': participantRole.toValue(), + 'TimerType': timerType.toValue(), + 'TimerValue': timerValue, + }; + } +} + +enum ParticipantTimerType { + idle, + disconnectNoncustomer, +} + +extension ParticipantTimerTypeValueExtension on ParticipantTimerType { + String toValue() { + switch (this) { + case ParticipantTimerType.idle: + return 'IDLE'; + case ParticipantTimerType.disconnectNoncustomer: + return 'DISCONNECT_NONCUSTOMER'; + } + } +} + +extension ParticipantTimerTypeFromString on String { + ParticipantTimerType toParticipantTimerType() { + switch (this) { + case 'IDLE': + return ParticipantTimerType.idle; + case 'DISCONNECT_NONCUSTOMER': + return ParticipantTimerType.disconnectNoncustomer; + } + throw Exception('$this is not known in enum ParticipantTimerType'); + } +} + +/// The value of the timer. Either the timer action (Unset to +/// delete the timer), or the duration of the timer in minutes. Only one value +/// can be set. +/// +/// For more information about how chat timeouts work, see Set +/// up chat timeouts for human participants. +class ParticipantTimerValue { + /// The timer action. Currently only one value is allowed: Unset. + /// It deletes a timer. + final ParticipantTimerAction? participantTimerAction; + + /// The duration of a timer, in minutes. + final int? participantTimerDurationInMinutes; + + ParticipantTimerValue({ + this.participantTimerAction, + this.participantTimerDurationInMinutes, + }); + + Map toJson() { + final participantTimerAction = this.participantTimerAction; + final participantTimerDurationInMinutes = + this.participantTimerDurationInMinutes; + return { + if (participantTimerAction != null) + 'ParticipantTimerAction': participantTimerAction.toValue(), + if (participantTimerDurationInMinutes != null) + 'ParticipantTimerDurationInMinutes': participantTimerDurationInMinutes, + }; + } +} + +/// The credentials used by the participant. +class ParticipantTokenCredentials { + /// The expiration of the token. It's specified in ISO 8601 format: + /// yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. + final String? expiry; + + /// The token used by the chat participant to call CreateParticipantConnection. + /// The participant token is valid for the lifetime of a chat participant. + final String? participantToken; + + ParticipantTokenCredentials({ + this.expiry, + this.participantToken, + }); + + factory ParticipantTokenCredentials.fromJson(Map json) { + return ParticipantTokenCredentials( + expiry: json['Expiry'] as String?, + participantToken: json['ParticipantToken'] as String?, + ); + } + + Map toJson() { + final expiry = this.expiry; + final participantToken = this.participantToken; + return { + if (expiry != null) 'Expiry': expiry, + if (participantToken != null) 'ParticipantToken': participantToken, + }; + } +} + +class PauseContactResponse { + PauseContactResponse(); + + factory PauseContactResponse.fromJson(Map _) { + return PauseContactResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Enable persistent chats. For more information about enabling persistent +/// chat, and for example use cases and how to configure for them, see Enable +/// persistent chat. +class PersistentChat { + /// The contactId that is used for rehydration depends on the rehydration type. + /// RehydrationType is required for persistent chat. + /// + ///
        + ///
      • + /// ENTIRE_PAST_SESSION: Rehydrates a chat from the most recently + /// terminated past chat contact of the specified past ended chat session. To + /// use this type, provide the initialContactId of the past ended + /// chat session in the sourceContactId field. In this type, Amazon + /// Connect determines the most recent chat contact on the specified chat + /// session that has ended, and uses it to start a persistent chat. + ///
      • + ///
      • + /// FROM_SEGMENT: Rehydrates a chat from the past chat contact that + /// is specified in the sourceContactId field. + ///
      • + ///
      + /// The actual contactId used for rehydration is provided in the response of + /// this API. + final RehydrationType? rehydrationType; + + /// The contactId from which a persistent chat session must be started. + final String? sourceContactId; + + PersistentChat({ + this.rehydrationType, + this.sourceContactId, + }); + + Map toJson() { + final rehydrationType = this.rehydrationType; + final sourceContactId = this.sourceContactId; + return { + if (rehydrationType != null) 'RehydrationType': rehydrationType.toValue(), + if (sourceContactId != null) 'SourceContactId': sourceContactId, + }; + } +} + +enum PhoneNumberCountryCode { + af, + al, + dz, + as, + ad, + ao, + ai, + aq, + ag, + ar, + am, + aw, + au, + at, + az, + bs, + bh, + bd, + bb, + by, + be, + bz, + bj, + bm, + bt, + bo, + ba, + bw, + br, + io, + vg, + bn, + bg, + bf, + bi, + kh, + cm, + ca, + cv, + ky, + cf, + td, + cl, + cn, + cx, + cc, + co, + km, + ck, + cr, + hr, + cu, + cw, + cy, + cz, + cd, + dk, + dj, + dm, + $do, + tl, + ec, + eg, + sv, + gq, + er, + ee, + et, + fk, + fo, + fj, + fi, + fr, + pf, + ga, + gm, + ge, + de, + gh, + gi, + gr, + gl, + gd, + gu, + gt, + gg, + gn, + gw, + gy, + ht, + hn, + hk, + hu, + $is, + $in, + id, + ir, + iq, + ie, + im, + il, + it, + ci, + jm, + jp, + je, + jo, + kz, + ke, + ki, + kw, + kg, + la, + lv, + lb, + ls, + lr, + ly, + li, + lt, + lu, + mo, + mk, + mg, + mw, + my, + mv, + ml, + mt, + mh, + mr, + mu, + yt, + mx, + fm, + md, + mc, + mn, + me, + ms, + ma, + mz, + mm, + na, + nr, + np, + nl, + an, + nc, + nz, + ni, + ne, + ng, + nu, + kp, + mp, + no, + om, + pk, + pw, + pa, + pg, + py, + pe, + ph, + pn, + pl, + pt, + pr, + qa, + cg, + re, + ro, + ru, + rw, + bl, + sh, + kn, + lc, + mf, + pm, + vc, + ws, + sm, + st, + sa, + sn, + rs, + sc, + sl, + sg, + sx, + sk, + si, + sb, + so, + za, + kr, + es, + lk, + sd, + sr, + sj, + sz, + se, + ch, + sy, + tw, + tj, + tz, + th, + tg, + tk, + to, + tt, + tn, + tr, + tm, + tc, + tv, + vi, + ug, + ua, + ae, + gb, + us, + uy, + uz, + vu, + va, + ve, + vn, + wf, + eh, + ye, + zm, + zw, +} + +extension PhoneNumberCountryCodeValueExtension on PhoneNumberCountryCode { + String toValue() { + switch (this) { + case PhoneNumberCountryCode.af: + return 'AF'; + case PhoneNumberCountryCode.al: + return 'AL'; + case PhoneNumberCountryCode.dz: + return 'DZ'; + case PhoneNumberCountryCode.as: + return 'AS'; + case PhoneNumberCountryCode.ad: + return 'AD'; + case PhoneNumberCountryCode.ao: + return 'AO'; + case PhoneNumberCountryCode.ai: + return 'AI'; + case PhoneNumberCountryCode.aq: + return 'AQ'; + case PhoneNumberCountryCode.ag: + return 'AG'; + case PhoneNumberCountryCode.ar: + return 'AR'; + case PhoneNumberCountryCode.am: + return 'AM'; + case PhoneNumberCountryCode.aw: + return 'AW'; + case PhoneNumberCountryCode.au: + return 'AU'; + case PhoneNumberCountryCode.at: + return 'AT'; + case PhoneNumberCountryCode.az: + return 'AZ'; + case PhoneNumberCountryCode.bs: + return 'BS'; + case PhoneNumberCountryCode.bh: + return 'BH'; + case PhoneNumberCountryCode.bd: + return 'BD'; + case PhoneNumberCountryCode.bb: + return 'BB'; + case PhoneNumberCountryCode.by: + return 'BY'; + case PhoneNumberCountryCode.be: + return 'BE'; + case PhoneNumberCountryCode.bz: + return 'BZ'; + case PhoneNumberCountryCode.bj: + return 'BJ'; + case PhoneNumberCountryCode.bm: + return 'BM'; + case PhoneNumberCountryCode.bt: + return 'BT'; + case PhoneNumberCountryCode.bo: + return 'BO'; + case PhoneNumberCountryCode.ba: + return 'BA'; + case PhoneNumberCountryCode.bw: + return 'BW'; + case PhoneNumberCountryCode.br: + return 'BR'; + case PhoneNumberCountryCode.io: + return 'IO'; + case PhoneNumberCountryCode.vg: + return 'VG'; + case PhoneNumberCountryCode.bn: + return 'BN'; + case PhoneNumberCountryCode.bg: + return 'BG'; + case PhoneNumberCountryCode.bf: + return 'BF'; + case PhoneNumberCountryCode.bi: + return 'BI'; + case PhoneNumberCountryCode.kh: + return 'KH'; + case PhoneNumberCountryCode.cm: + return 'CM'; + case PhoneNumberCountryCode.ca: + return 'CA'; + case PhoneNumberCountryCode.cv: return 'CV'; case PhoneNumberCountryCode.ky: return 'KY'; @@ -20255,503 +28790,2347 @@ extension PhoneNumberCountryCodeFromString on String { case 'ZW': return PhoneNumberCountryCode.zw; } - throw Exception('$this is not known in enum PhoneNumberCountryCode'); + throw Exception('$this is not known in enum PhoneNumberCountryCode'); + } +} + +/// Contains information about a phone number for a quick connect. +class PhoneNumberQuickConnectConfig { + /// The phone number in E.164 format. + final String phoneNumber; + + PhoneNumberQuickConnectConfig({ + required this.phoneNumber, + }); + + factory PhoneNumberQuickConnectConfig.fromJson(Map json) { + return PhoneNumberQuickConnectConfig( + phoneNumber: json['PhoneNumber'] as String, + ); + } + + Map toJson() { + final phoneNumber = this.phoneNumber; + return { + 'PhoneNumber': phoneNumber, + }; + } +} + +/// The status of the phone number. +/// +///
        +///
      • +/// CLAIMED means the previous ClaimPhoneNumber +/// or UpdatePhoneNumber +/// operation succeeded. +///
      • +///
      • +/// IN_PROGRESS means a ClaimPhoneNumber, +/// UpdatePhoneNumber, +/// or UpdatePhoneNumberMetadata +/// operation is still in progress and has not yet completed. You can call DescribePhoneNumber +/// at a later time to verify if the previous operation has completed. +///
      • +///
      • +/// FAILED indicates that the previous ClaimPhoneNumber +/// or UpdatePhoneNumber +/// operation has failed. It will include a message indicating the failure +/// reason. A common reason for a failure may be that the TargetArn +/// value you are claiming or updating a phone number to has reached its limit +/// of total claimed numbers. If you received a FAILED status from +/// a ClaimPhoneNumber API call, you have one day to retry claiming +/// the phone number before the number is released back to the inventory for +/// other customers to claim. +///
      • +///
      +class PhoneNumberStatus { + /// The status message. + final String? message; + + /// The status. + final PhoneNumberWorkflowStatus? status; + + PhoneNumberStatus({ + this.message, + this.status, + }); + + factory PhoneNumberStatus.fromJson(Map json) { + return PhoneNumberStatus( + message: json['Message'] as String?, + status: (json['Status'] as String?)?.toPhoneNumberWorkflowStatus(), + ); + } + + Map toJson() { + final message = this.message; + final status = this.status; + return { + if (message != null) 'Message': message, + if (status != null) 'Status': status.toValue(), + }; + } +} + +/// Contains summary information about a phone number for a contact center. +class PhoneNumberSummary { + /// The Amazon Resource Name (ARN) of the phone number. + final String? arn; + + /// The identifier of the phone number. + final String? id; + + /// The phone number. + final String? phoneNumber; + + /// The ISO country code. + final PhoneNumberCountryCode? phoneNumberCountryCode; + + /// The type of phone number. + final PhoneNumberType? phoneNumberType; + + PhoneNumberSummary({ + this.arn, + this.id, + this.phoneNumber, + this.phoneNumberCountryCode, + this.phoneNumberType, + }); + + factory PhoneNumberSummary.fromJson(Map json) { + return PhoneNumberSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + phoneNumber: json['PhoneNumber'] as String?, + phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) + ?.toPhoneNumberCountryCode(), + phoneNumberType: + (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + final phoneNumber = this.phoneNumber; + final phoneNumberCountryCode = this.phoneNumberCountryCode; + final phoneNumberType = this.phoneNumberType; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (phoneNumber != null) 'PhoneNumber': phoneNumber, + if (phoneNumberCountryCode != null) + 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), + if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + }; + } +} + +enum PhoneNumberType { + tollFree, + did, + uifn, + shared, + thirdPartyTf, + thirdPartyDid, + shortCode, +} + +extension PhoneNumberTypeValueExtension on PhoneNumberType { + String toValue() { + switch (this) { + case PhoneNumberType.tollFree: + return 'TOLL_FREE'; + case PhoneNumberType.did: + return 'DID'; + case PhoneNumberType.uifn: + return 'UIFN'; + case PhoneNumberType.shared: + return 'SHARED'; + case PhoneNumberType.thirdPartyTf: + return 'THIRD_PARTY_TF'; + case PhoneNumberType.thirdPartyDid: + return 'THIRD_PARTY_DID'; + case PhoneNumberType.shortCode: + return 'SHORT_CODE'; + } + } +} + +extension PhoneNumberTypeFromString on String { + PhoneNumberType toPhoneNumberType() { + switch (this) { + case 'TOLL_FREE': + return PhoneNumberType.tollFree; + case 'DID': + return PhoneNumberType.did; + case 'UIFN': + return PhoneNumberType.uifn; + case 'SHARED': + return PhoneNumberType.shared; + case 'THIRD_PARTY_TF': + return PhoneNumberType.thirdPartyTf; + case 'THIRD_PARTY_DID': + return PhoneNumberType.thirdPartyDid; + case 'SHORT_CODE': + return PhoneNumberType.shortCode; + } + throw Exception('$this is not known in enum PhoneNumberType'); + } +} + +enum PhoneNumberWorkflowStatus { + claimed, + inProgress, + failed, +} + +extension PhoneNumberWorkflowStatusValueExtension on PhoneNumberWorkflowStatus { + String toValue() { + switch (this) { + case PhoneNumberWorkflowStatus.claimed: + return 'CLAIMED'; + case PhoneNumberWorkflowStatus.inProgress: + return 'IN_PROGRESS'; + case PhoneNumberWorkflowStatus.failed: + return 'FAILED'; + } + } +} + +extension PhoneNumberWorkflowStatusFromString on String { + PhoneNumberWorkflowStatus toPhoneNumberWorkflowStatus() { + switch (this) { + case 'CLAIMED': + return PhoneNumberWorkflowStatus.claimed; + case 'IN_PROGRESS': + return PhoneNumberWorkflowStatus.inProgress; + case 'FAILED': + return PhoneNumberWorkflowStatus.failed; + } + throw Exception('$this is not known in enum PhoneNumberWorkflowStatus'); + } +} + +enum PhoneType { + softPhone, + deskPhone, +} + +extension PhoneTypeValueExtension on PhoneType { + String toValue() { + switch (this) { + case PhoneType.softPhone: + return 'SOFT_PHONE'; + case PhoneType.deskPhone: + return 'DESK_PHONE'; + } + } +} + +extension PhoneTypeFromString on String { + PhoneType toPhoneType() { + switch (this) { + case 'SOFT_PHONE': + return PhoneType.softPhone; + case 'DESK_PHONE': + return PhoneType.deskPhone; + } + throw Exception('$this is not known in enum PhoneType'); + } +} + +/// Information about a predefined attribute. +class PredefinedAttribute { + /// Last modified region. + final String? lastModifiedRegion; + + /// Last modified time. + final DateTime? lastModifiedTime; + + /// The name of the predefined attribute. + final String? name; + + /// The values of the predefined attribute. + final PredefinedAttributeValues? values; + + PredefinedAttribute({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.values, + }); + + factory PredefinedAttribute.fromJson(Map json) { + return PredefinedAttribute( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + values: json['Values'] != null + ? PredefinedAttributeValues.fromJson( + json['Values'] as Map) + : null, + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final values = this.values; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (values != null) 'Values': values, + }; + } +} + +/// The search criteria to be used to return predefined attributes. +class PredefinedAttributeSearchCriteria { + /// A list of conditions which would be applied together with an + /// AND condition. + final List? andConditions; + + /// A list of conditions which would be applied together with an OR + /// condition. + final List? orConditions; + final StringCondition? stringCondition; + + PredefinedAttributeSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, + }); + + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, + }; + } +} + +/// Summary of a predefined attribute. +class PredefinedAttributeSummary { + /// Last modified region. + final String? lastModifiedRegion; + + /// Last modified time. + final DateTime? lastModifiedTime; + + /// The name of the predefined attribute. + final String? name; + + PredefinedAttributeSummary({ + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + }); + + factory PredefinedAttributeSummary.fromJson(Map json) { + return PredefinedAttributeSummary( + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + ); + } + + Map toJson() { + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + return { + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + }; + } +} + +/// Information about values of a predefined attribute. +class PredefinedAttributeValues { + /// Predefined attribute values of type string list. + final List? stringList; + + PredefinedAttributeValues({ + this.stringList, + }); + + factory PredefinedAttributeValues.fromJson(Map json) { + return PredefinedAttributeValues( + stringList: (json['StringList'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final stringList = this.stringList; + return { + if (stringList != null) 'StringList': stringList, + }; + } +} + +/// Information about a prompt. +class Prompt { + /// The description of the prompt. + final String? description; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the prompt. + final String? name; + + /// The Amazon Resource Name (ARN) of the prompt. + final String? promptARN; + + /// A unique identifier for the prompt. + final String? promptId; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + Prompt({ + this.description, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.promptARN, + this.promptId, + this.tags, + }); + + factory Prompt.fromJson(Map json) { + return Prompt( + description: json['Description'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + promptARN: json['PromptARN'] as String?, + promptId: json['PromptId'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final description = this.description; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final promptARN = this.promptARN; + final promptId = this.promptId; + final tags = this.tags; + return { + if (description != null) 'Description': description, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (promptARN != null) 'PromptARN': promptARN, + if (promptId != null) 'PromptId': promptId, + if (tags != null) 'Tags': tags, + }; + } +} + +/// The search criteria to be used to return prompts. +class PromptSearchCriteria { + /// A list of conditions which would be applied together with an AND condition. + final List? andConditions; + + /// A list of conditions which would be applied together with an OR condition. + final List? orConditions; + + /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// name, description, and resourceID. + /// + final StringCondition? stringCondition; + + PromptSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, + }); + + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, + }; + } +} + +/// Filters to be applied to search results. +class PromptSearchFilter { + final ControlPlaneTagFilter? tagFilter; + + PromptSearchFilter({ + this.tagFilter, + }); + + Map toJson() { + final tagFilter = this.tagFilter; + return { + if (tagFilter != null) 'TagFilter': tagFilter, + }; + } +} + +/// Contains information about the prompt. +class PromptSummary { + /// The Amazon Resource Name (ARN) of the prompt. + final String? arn; + + /// The identifier of the prompt. + final String? id; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the prompt. + final String? name; + + PromptSummary({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + }); + + factory PromptSummary.fromJson(Map json) { + return PromptSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + }; + } +} + +class PutUserStatusResponse { + PutUserStatusResponse(); + + factory PutUserStatusResponse.fromJson(Map _) { + return PutUserStatusResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Information about the quality of the participant's media connection. +class QualityMetrics { + /// Information about the quality of Agent media connection. + final AgentQualityMetrics? agent; + + /// Information about the quality of Customer media connection. + final CustomerQualityMetrics? customer; + + QualityMetrics({ + this.agent, + this.customer, + }); + + factory QualityMetrics.fromJson(Map json) { + return QualityMetrics( + agent: json['Agent'] != null + ? AgentQualityMetrics.fromJson(json['Agent'] as Map) + : null, + customer: json['Customer'] != null + ? CustomerQualityMetrics.fromJson( + json['Customer'] as Map) + : null, + ); + } + + Map toJson() { + final agent = this.agent; + final customer = this.customer; + return { + if (agent != null) 'Agent': agent, + if (customer != null) 'Customer': customer, + }; + } +} + +/// Contains information about a queue. +class Queue { + /// The description of the queue. + final String? description; + + /// The identifier for the hours of operation. + final String? hoursOfOperationId; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The maximum number of contacts that can be in the queue before it is + /// considered full. + final int? maxContacts; + + /// The name of the queue. + final String? name; + + /// The outbound caller ID name, number, and outbound whisper flow. + final OutboundCallerConfig? outboundCallerConfig; + + /// The Amazon Resource Name (ARN) for the queue. + final String? queueArn; + + /// The identifier for the queue. + final String? queueId; + + /// The status of the queue. + final QueueStatus? status; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + Queue({ + this.description, + this.hoursOfOperationId, + this.lastModifiedRegion, + this.lastModifiedTime, + this.maxContacts, + this.name, + this.outboundCallerConfig, + this.queueArn, + this.queueId, + this.status, + this.tags, + }); + + factory Queue.fromJson(Map json) { + return Queue( + description: json['Description'] as String?, + hoursOfOperationId: json['HoursOfOperationId'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + maxContacts: json['MaxContacts'] as int?, + name: json['Name'] as String?, + outboundCallerConfig: json['OutboundCallerConfig'] != null + ? OutboundCallerConfig.fromJson( + json['OutboundCallerConfig'] as Map) + : null, + queueArn: json['QueueArn'] as String?, + queueId: json['QueueId'] as String?, + status: (json['Status'] as String?)?.toQueueStatus(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final description = this.description; + final hoursOfOperationId = this.hoursOfOperationId; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final maxContacts = this.maxContacts; + final name = this.name; + final outboundCallerConfig = this.outboundCallerConfig; + final queueArn = this.queueArn; + final queueId = this.queueId; + final status = this.status; + final tags = this.tags; + return { + if (description != null) 'Description': description, + if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (maxContacts != null) 'MaxContacts': maxContacts, + if (name != null) 'Name': name, + if (outboundCallerConfig != null) + 'OutboundCallerConfig': outboundCallerConfig, + if (queueArn != null) 'QueueArn': queueArn, + if (queueId != null) 'QueueId': queueId, + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, + }; + } +} + +/// If this contact was queued, this contains information about the queue. +class QueueInfo { + /// The timestamp when the contact was added to the queue. + final DateTime? enqueueTimestamp; + + /// The unique identifier for the queue. + final String? id; + + QueueInfo({ + this.enqueueTimestamp, + this.id, + }); + + factory QueueInfo.fromJson(Map json) { + return QueueInfo( + enqueueTimestamp: timeStampFromJson(json['EnqueueTimestamp']), + id: json['Id'] as String?, + ); + } + + Map toJson() { + final enqueueTimestamp = this.enqueueTimestamp; + final id = this.id; + return { + if (enqueueTimestamp != null) + 'EnqueueTimestamp': unixTimestampToJson(enqueueTimestamp), + if (id != null) 'Id': id, + }; + } +} + +/// Contains information about a queue for a quick connect. The flow must be of +/// type Transfer to Queue. +class QueueQuickConnectConfig { + /// The identifier of the flow. + final String contactFlowId; + + /// The identifier for the queue. + final String queueId; + + QueueQuickConnectConfig({ + required this.contactFlowId, + required this.queueId, + }); + + factory QueueQuickConnectConfig.fromJson(Map json) { + return QueueQuickConnectConfig( + contactFlowId: json['ContactFlowId'] as String, + queueId: json['QueueId'] as String, + ); + } + + Map toJson() { + final contactFlowId = this.contactFlowId; + final queueId = this.queueId; + return { + 'ContactFlowId': contactFlowId, + 'QueueId': queueId, + }; + } +} + +/// Contains information about a queue resource for which metrics are returned. +class QueueReference { + /// The Amazon Resource Name (ARN) of the queue. + final String? arn; + + /// The identifier of the queue. + final String? id; + + QueueReference({ + this.arn, + this.id, + }); + + factory QueueReference.fromJson(Map json) { + return QueueReference( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + }; + } +} + +/// The search criteria to be used to return queues. +/// +/// The name and description fields support "contains" +/// queries with a minimum of 2 characters and a maximum of 25 characters. Any +/// queries with character lengths outside of this range will throw invalid +/// results. +/// +class QueueSearchCriteria { + /// A list of conditions which would be applied together with an AND condition. + final List? andConditions; + + /// A list of conditions which would be applied together with an OR condition. + final List? orConditions; + + /// The type of queue. + final SearchableQueueType? queueTypeCondition; + + /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// name, description, and resourceID. + /// + final StringCondition? stringCondition; + + QueueSearchCriteria({ + this.andConditions, + this.orConditions, + this.queueTypeCondition, + this.stringCondition, + }); + + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final queueTypeCondition = this.queueTypeCondition; + final stringCondition = this.stringCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (queueTypeCondition != null) + 'QueueTypeCondition': queueTypeCondition.toValue(), + if (stringCondition != null) 'StringCondition': stringCondition, + }; + } +} + +/// Filters to be applied to search results. +class QueueSearchFilter { + final ControlPlaneTagFilter? tagFilter; + + QueueSearchFilter({ + this.tagFilter, + }); + + Map toJson() { + final tagFilter = this.tagFilter; + return { + if (tagFilter != null) 'TagFilter': tagFilter, + }; + } +} + +enum QueueStatus { + enabled, + disabled, +} + +extension QueueStatusValueExtension on QueueStatus { + String toValue() { + switch (this) { + case QueueStatus.enabled: + return 'ENABLED'; + case QueueStatus.disabled: + return 'DISABLED'; + } + } +} + +extension QueueStatusFromString on String { + QueueStatus toQueueStatus() { + switch (this) { + case 'ENABLED': + return QueueStatus.enabled; + case 'DISABLED': + return QueueStatus.disabled; + } + throw Exception('$this is not known in enum QueueStatus'); + } +} + +/// Contains summary information about a queue. +class QueueSummary { + /// The Amazon Resource Name (ARN) of the queue. + final String? arn; + + /// The identifier of the queue. + final String? id; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the queue. + final String? name; + + /// The type of queue. + final QueueType? queueType; + + QueueSummary({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.queueType, + }); + + factory QueueSummary.fromJson(Map json) { + return QueueSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + queueType: (json['QueueType'] as String?)?.toQueueType(), + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final queueType = this.queueType; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (queueType != null) 'QueueType': queueType.toValue(), + }; + } +} + +enum QueueType { + standard, + agent, +} + +extension QueueTypeValueExtension on QueueType { + String toValue() { + switch (this) { + case QueueType.standard: + return 'STANDARD'; + case QueueType.agent: + return 'AGENT'; + } + } +} + +extension QueueTypeFromString on String { + QueueType toQueueType() { + switch (this) { + case 'STANDARD': + return QueueType.standard; + case 'AGENT': + return QueueType.agent; + } + throw Exception('$this is not known in enum QueueType'); + } +} + +/// Contains information about a quick connect. +class QuickConnect { + /// The description. + final String? description; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the quick connect. + final String? name; + + /// The Amazon Resource Name (ARN) of the quick connect. + final String? quickConnectARN; + + /// Contains information about the quick connect. + final QuickConnectConfig? quickConnectConfig; + + /// The identifier for the quick connect. + final String? quickConnectId; + + /// The tags used to organize, track, or control access for this resource. For + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. + final Map? tags; + + QuickConnect({ + this.description, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.quickConnectARN, + this.quickConnectConfig, + this.quickConnectId, + this.tags, + }); + + factory QuickConnect.fromJson(Map json) { + return QuickConnect( + description: json['Description'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + quickConnectARN: json['QuickConnectARN'] as String?, + quickConnectConfig: json['QuickConnectConfig'] != null + ? QuickConnectConfig.fromJson( + json['QuickConnectConfig'] as Map) + : null, + quickConnectId: json['QuickConnectId'] as String?, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final description = this.description; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final quickConnectARN = this.quickConnectARN; + final quickConnectConfig = this.quickConnectConfig; + final quickConnectId = this.quickConnectId; + final tags = this.tags; + return { + if (description != null) 'Description': description, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (quickConnectARN != null) 'QuickConnectARN': quickConnectARN, + if (quickConnectConfig != null) 'QuickConnectConfig': quickConnectConfig, + if (quickConnectId != null) 'QuickConnectId': quickConnectId, + if (tags != null) 'Tags': tags, + }; + } +} + +/// Contains configuration settings for a quick connect. +class QuickConnectConfig { + /// The type of quick connect. In the Amazon Connect admin website, when you + /// create a quick connect, you are prompted to assign one of the following + /// types: Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE). + final QuickConnectType quickConnectType; + + /// The phone configuration. This is required only if QuickConnectType is + /// PHONE_NUMBER. + final PhoneNumberQuickConnectConfig? phoneConfig; + + /// The queue configuration. This is required only if QuickConnectType is QUEUE. + final QueueQuickConnectConfig? queueConfig; + + /// The user configuration. This is required only if QuickConnectType is USER. + final UserQuickConnectConfig? userConfig; + + QuickConnectConfig({ + required this.quickConnectType, + this.phoneConfig, + this.queueConfig, + this.userConfig, + }); + + factory QuickConnectConfig.fromJson(Map json) { + return QuickConnectConfig( + quickConnectType: + (json['QuickConnectType'] as String).toQuickConnectType(), + phoneConfig: json['PhoneConfig'] != null + ? PhoneNumberQuickConnectConfig.fromJson( + json['PhoneConfig'] as Map) + : null, + queueConfig: json['QueueConfig'] != null + ? QueueQuickConnectConfig.fromJson( + json['QueueConfig'] as Map) + : null, + userConfig: json['UserConfig'] != null + ? UserQuickConnectConfig.fromJson( + json['UserConfig'] as Map) + : null, + ); + } + + Map toJson() { + final quickConnectType = this.quickConnectType; + final phoneConfig = this.phoneConfig; + final queueConfig = this.queueConfig; + final userConfig = this.userConfig; + return { + 'QuickConnectType': quickConnectType.toValue(), + if (phoneConfig != null) 'PhoneConfig': phoneConfig, + if (queueConfig != null) 'QueueConfig': queueConfig, + if (userConfig != null) 'UserConfig': userConfig, + }; + } +} + +/// The search criteria to be used to return quick connects. +class QuickConnectSearchCriteria { + /// A list of conditions which would be applied together with an AND condition. + final List? andConditions; + + /// A list of conditions which would be applied together with an OR condition. + final List? orConditions; + + /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// name, description, and resourceID. + /// + final StringCondition? stringCondition; + + QuickConnectSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, + }); + + Map toJson() { + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; + return { + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, + }; + } +} + +/// Filters to be applied to search results. +class QuickConnectSearchFilter { + final ControlPlaneTagFilter? tagFilter; + + QuickConnectSearchFilter({ + this.tagFilter, + }); + + Map toJson() { + final tagFilter = this.tagFilter; + return { + if (tagFilter != null) 'TagFilter': tagFilter, + }; + } +} + +/// Contains summary information about a quick connect. +class QuickConnectSummary { + /// The Amazon Resource Name (ARN) of the quick connect. + final String? arn; + + /// The identifier for the quick connect. + final String? id; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The name of the quick connect. + final String? name; + + /// The type of quick connect. In the Amazon Connect admin website, when you + /// create a quick connect, you are prompted to assign one of the following + /// types: Agent (USER), External (PHONE_NUMBER), or Queue (QUEUE). + final QuickConnectType? quickConnectType; + + QuickConnectSummary({ + this.arn, + this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, + this.quickConnectType, + }); + + factory QuickConnectSummary.fromJson(Map json) { + return QuickConnectSummary( + arn: json['Arn'] as String?, + id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + quickConnectType: + (json['QuickConnectType'] as String?)?.toQuickConnectType(), + ); + } + + Map toJson() { + final arn = this.arn; + final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final quickConnectType = this.quickConnectType; + return { + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (quickConnectType != null) + 'QuickConnectType': quickConnectType.toValue(), + }; + } +} + +enum QuickConnectType { + user, + queue, + phoneNumber, +} + +extension QuickConnectTypeValueExtension on QuickConnectType { + String toValue() { + switch (this) { + case QuickConnectType.user: + return 'USER'; + case QuickConnectType.queue: + return 'QUEUE'; + case QuickConnectType.phoneNumber: + return 'PHONE_NUMBER'; + } + } +} + +extension QuickConnectTypeFromString on String { + QuickConnectType toQuickConnectType() { + switch (this) { + case 'USER': + return QuickConnectType.user; + case 'QUEUE': + return QuickConnectType.queue; + case 'PHONE_NUMBER': + return QuickConnectType.phoneNumber; + } + throw Exception('$this is not known in enum QuickConnectType'); } } -/// Contains information about a phone number for a quick connect. -class PhoneNumberQuickConnectConfig { - /// The phone number in E.164 format. - final String phoneNumber; +/// Indicates a field that is read-only to an agent. +class ReadOnlyFieldInfo { + /// Identifier of the read-only field. + final TaskTemplateFieldIdentifier? id; - PhoneNumberQuickConnectConfig({ - required this.phoneNumber, + ReadOnlyFieldInfo({ + this.id, }); - factory PhoneNumberQuickConnectConfig.fromJson(Map json) { - return PhoneNumberQuickConnectConfig( - phoneNumber: json['PhoneNumber'] as String, + factory ReadOnlyFieldInfo.fromJson(Map json) { + return ReadOnlyFieldInfo( + id: json['Id'] != null + ? TaskTemplateFieldIdentifier.fromJson( + json['Id'] as Map) + : null, ); } Map toJson() { - final phoneNumber = this.phoneNumber; + final id = this.id; return { - 'PhoneNumber': phoneNumber, + if (id != null) 'Id': id, }; } } -/// The status of the phone number. -/// -///
        -///
      • -/// CLAIMED means the previous ClaimedPhoneNumber -/// or UpdatePhoneNumber -/// operation succeeded. -///
      • -///
      • -/// IN_PROGRESS means a ClaimedPhoneNumber -/// or UpdatePhoneNumber -/// operation is still in progress and has not yet completed. You can call DescribePhoneNumber -/// at a later time to verify if the previous operation has completed. -///
      • -///
      • -/// FAILED indicates that the previous ClaimedPhoneNumber -/// or UpdatePhoneNumber -/// operation has failed. It will include a message indicating the failure -/// reason. A common reason for a failure may be that the TargetArn -/// value you are claiming or updating a phone number to has reached its limit -/// of total claimed numbers. If you received a FAILED status from -/// a ClaimPhoneNumber API call, you have one day to retry claiming -/// the phone number before the number is released back to the inventory for -/// other customers to claim. -///
      • -///
      -class PhoneNumberStatus { - /// The status message. - final String? message; +/// Object that describes attached file. +class RealTimeContactAnalysisAttachment { + /// A unique identifier for the attachment. + final String attachmentId; - /// The status. - final PhoneNumberWorkflowStatus? status; + /// A case-sensitive name of the attachment being uploaded. Can be redacted. + final String attachmentName; - PhoneNumberStatus({ - this.message, + /// Describes the MIME file type of the attachment. For a list of supported file + /// types, see Feature + /// specifications in the Amazon Connect Administrator Guide. + final String? contentType; + + /// Status of the attachment. + final ArtifactStatus? status; + + RealTimeContactAnalysisAttachment({ + required this.attachmentId, + required this.attachmentName, + this.contentType, this.status, }); - factory PhoneNumberStatus.fromJson(Map json) { - return PhoneNumberStatus( - message: json['Message'] as String?, - status: (json['Status'] as String?)?.toPhoneNumberWorkflowStatus(), + factory RealTimeContactAnalysisAttachment.fromJson( + Map json) { + return RealTimeContactAnalysisAttachment( + attachmentId: json['AttachmentId'] as String, + attachmentName: json['AttachmentName'] as String, + contentType: json['ContentType'] as String?, + status: (json['Status'] as String?)?.toArtifactStatus(), ); } Map toJson() { - final message = this.message; + final attachmentId = this.attachmentId; + final attachmentName = this.attachmentName; + final contentType = this.contentType; final status = this.status; return { - if (message != null) 'Message': message, + 'AttachmentId': attachmentId, + 'AttachmentName': attachmentName, + if (contentType != null) 'ContentType': contentType, if (status != null) 'Status': status.toValue(), }; } } -/// Contains summary information about a phone number for a contact center. -class PhoneNumberSummary { - /// The Amazon Resource Name (ARN) of the phone number. - final String? arn; +/// Provides information about the category rule that was matched. +class RealTimeContactAnalysisCategoryDetails { + /// List of PointOfInterest - objects describing a single match of a rule. + final List pointsOfInterest; + + RealTimeContactAnalysisCategoryDetails({ + required this.pointsOfInterest, + }); + + factory RealTimeContactAnalysisCategoryDetails.fromJson( + Map json) { + return RealTimeContactAnalysisCategoryDetails( + pointsOfInterest: (json['PointsOfInterest'] as List) + .whereNotNull() + .map((e) => RealTimeContactAnalysisPointOfInterest.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final pointsOfInterest = this.pointsOfInterest; + return { + 'PointsOfInterest': pointsOfInterest, + }; + } +} + +/// Begin and end offsets for a part of text. +class RealTimeContactAnalysisCharacterInterval { + /// The beginning of the character interval. + final int beginOffsetChar; + + /// The end of the character interval. + final int endOffsetChar; + + RealTimeContactAnalysisCharacterInterval({ + required this.beginOffsetChar, + required this.endOffsetChar, + }); + + factory RealTimeContactAnalysisCharacterInterval.fromJson( + Map json) { + return RealTimeContactAnalysisCharacterInterval( + beginOffsetChar: json['BeginOffsetChar'] as int, + endOffsetChar: json['EndOffsetChar'] as int, + ); + } + + Map toJson() { + final beginOffsetChar = this.beginOffsetChar; + final endOffsetChar = this.endOffsetChar; + return { + 'BeginOffsetChar': beginOffsetChar, + 'EndOffsetChar': endOffsetChar, + }; + } +} + +/// Potential issues that are detected based on an artificial intelligence +/// analysis of each turn in the conversation. +class RealTimeContactAnalysisIssueDetected { + /// List of the transcript items (segments) that are associated with a given + /// issue. + final List transcriptItems; + + RealTimeContactAnalysisIssueDetected({ + required this.transcriptItems, + }); + + factory RealTimeContactAnalysisIssueDetected.fromJson( + Map json) { + return RealTimeContactAnalysisIssueDetected( + transcriptItems: (json['TranscriptItems'] as List) + .whereNotNull() + .map((e) => RealTimeContactAnalysisTranscriptItemWithContent.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final transcriptItems = this.transcriptItems; + return { + 'TranscriptItems': transcriptItems, + }; + } +} + +enum RealTimeContactAnalysisOutputType { + raw, + redacted, +} + +extension RealTimeContactAnalysisOutputTypeValueExtension + on RealTimeContactAnalysisOutputType { + String toValue() { + switch (this) { + case RealTimeContactAnalysisOutputType.raw: + return 'Raw'; + case RealTimeContactAnalysisOutputType.redacted: + return 'Redacted'; + } + } +} + +extension RealTimeContactAnalysisOutputTypeFromString on String { + RealTimeContactAnalysisOutputType toRealTimeContactAnalysisOutputType() { + switch (this) { + case 'Raw': + return RealTimeContactAnalysisOutputType.raw; + case 'Redacted': + return RealTimeContactAnalysisOutputType.redacted; + } + throw Exception( + '$this is not known in enum RealTimeContactAnalysisOutputType'); + } +} + +/// The section of the contact transcript segment that category rule was +/// detected. +class RealTimeContactAnalysisPointOfInterest { + /// List of the transcript items (segments) that are associated with a given + /// point of interest. + final List? + transcriptItems; + + RealTimeContactAnalysisPointOfInterest({ + this.transcriptItems, + }); + + factory RealTimeContactAnalysisPointOfInterest.fromJson( + Map json) { + return RealTimeContactAnalysisPointOfInterest( + transcriptItems: (json['TranscriptItems'] as List?) + ?.whereNotNull() + .map((e) => RealTimeContactAnalysisTranscriptItemWithCharacterOffsets + .fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final transcriptItems = this.transcriptItems; + return { + if (transcriptItems != null) 'TranscriptItems': transcriptItems, + }; + } +} + +/// Segment containing list of attachments. +class RealTimeContactAnalysisSegmentAttachments { + /// List of objects describing an individual attachment. + final List attachments; + + /// The identifier of the segment. + final String id; + + /// The identifier of the participant. + final String participantId; + + /// The role of the participant. For example, is it a customer, agent, or + /// system. + final ParticipantRole participantRole; + + /// Field describing the time of the event. It can have different + /// representations of time. + final RealTimeContactAnalysisTimeData time; + + /// The display name of the participant. Can be redacted. + final String? displayName; + + RealTimeContactAnalysisSegmentAttachments({ + required this.attachments, + required this.id, + required this.participantId, + required this.participantRole, + required this.time, + this.displayName, + }); + + factory RealTimeContactAnalysisSegmentAttachments.fromJson( + Map json) { + return RealTimeContactAnalysisSegmentAttachments( + attachments: (json['Attachments'] as List) + .whereNotNull() + .map((e) => RealTimeContactAnalysisAttachment.fromJson( + e as Map)) + .toList(), + id: json['Id'] as String, + participantId: json['ParticipantId'] as String, + participantRole: (json['ParticipantRole'] as String).toParticipantRole(), + time: RealTimeContactAnalysisTimeData.fromJson( + json['Time'] as Map), + displayName: json['DisplayName'] as String?, + ); + } + + Map toJson() { + final attachments = this.attachments; + final id = this.id; + final participantId = this.participantId; + final participantRole = this.participantRole; + final time = this.time; + final displayName = this.displayName; + return { + 'Attachments': attachments, + 'Id': id, + 'ParticipantId': participantId, + 'ParticipantRole': participantRole.toValue(), + 'Time': time, + if (displayName != null) 'DisplayName': displayName, + }; + } +} + +/// The matched category rules. +class RealTimeContactAnalysisSegmentCategories { + /// Map between the name of the matched rule and + /// RealTimeContactAnalysisCategoryDetails. + final Map matchedDetails; + + RealTimeContactAnalysisSegmentCategories({ + required this.matchedDetails, + }); + + factory RealTimeContactAnalysisSegmentCategories.fromJson( + Map json) { + return RealTimeContactAnalysisSegmentCategories( + matchedDetails: (json['MatchedDetails'] as Map).map( + (k, e) => MapEntry( + k, + RealTimeContactAnalysisCategoryDetails.fromJson( + e as Map))), + ); + } + + Map toJson() { + final matchedDetails = this.matchedDetails; + return { + 'MatchedDetails': matchedDetails, + }; + } +} + +/// Segment type describing a contact event. +class RealTimeContactAnalysisSegmentEvent { + /// Type of the event. For example, + /// application/vnd.amazonaws.connect.event.participant.left. + final String eventType; + + /// The identifier of the contact event. + final String id; + + /// Field describing the time of the event. It can have different + /// representations of time. + final RealTimeContactAnalysisTimeData time; + + /// The display name of the participant. Can be redacted. + final String? displayName; + + /// The identifier of the participant. + final String? participantId; + + /// The role of the participant. For example, is it a customer, agent, or + /// system. + final ParticipantRole? participantRole; + + RealTimeContactAnalysisSegmentEvent({ + required this.eventType, + required this.id, + required this.time, + this.displayName, + this.participantId, + this.participantRole, + }); + + factory RealTimeContactAnalysisSegmentEvent.fromJson( + Map json) { + return RealTimeContactAnalysisSegmentEvent( + eventType: json['EventType'] as String, + id: json['Id'] as String, + time: RealTimeContactAnalysisTimeData.fromJson( + json['Time'] as Map), + displayName: json['DisplayName'] as String?, + participantId: json['ParticipantId'] as String?, + participantRole: + (json['ParticipantRole'] as String?)?.toParticipantRole(), + ); + } + + Map toJson() { + final eventType = this.eventType; + final id = this.id; + final time = this.time; + final displayName = this.displayName; + final participantId = this.participantId; + final participantRole = this.participantRole; + return { + 'EventType': eventType, + 'Id': id, + 'Time': time, + if (displayName != null) 'DisplayName': displayName, + if (participantId != null) 'ParticipantId': participantId, + if (participantRole != null) 'ParticipantRole': participantRole.toValue(), + }; + } +} + +/// Segment type containing a list of detected issues. +class RealTimeContactAnalysisSegmentIssues { + /// List of the issues detected. + final List issuesDetected; + + RealTimeContactAnalysisSegmentIssues({ + required this.issuesDetected, + }); + + factory RealTimeContactAnalysisSegmentIssues.fromJson( + Map json) { + return RealTimeContactAnalysisSegmentIssues( + issuesDetected: (json['IssuesDetected'] as List) + .whereNotNull() + .map((e) => RealTimeContactAnalysisIssueDetected.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final issuesDetected = this.issuesDetected; + return { + 'IssuesDetected': issuesDetected, + }; + } +} + +/// The analyzed transcript segment. +class RealTimeContactAnalysisSegmentTranscript { + /// The content of the transcript. Can be redacted. + final String content; + + /// The identifier of the transcript. + final String id; - /// The identifier of the phone number. - final String? id; + /// The identifier of the participant. + final String participantId; - /// The phone number. - final String? phoneNumber; + /// The role of the participant. For example, is it a customer, agent, or + /// system. + final ParticipantRole participantRole; - /// The ISO country code. - final PhoneNumberCountryCode? phoneNumberCountryCode; + /// Field describing the time of the event. It can have different + /// representations of time. + final RealTimeContactAnalysisTimeData time; - /// The type of phone number. - final PhoneNumberType? phoneNumberType; + /// The type of content of the item. For example, text/plain. + final String? contentType; - PhoneNumberSummary({ - this.arn, - this.id, - this.phoneNumber, - this.phoneNumberCountryCode, - this.phoneNumberType, + /// The display name of the participant. + final String? displayName; + + /// Object describing redaction that was applied to the transcript. If + /// transcript has the field it means part of the transcript was redacted. + final RealTimeContactAnalysisTranscriptItemRedaction? redaction; + + /// The sentiment detected for this piece of transcript. + final RealTimeContactAnalysisSentimentLabel? sentiment; + + RealTimeContactAnalysisSegmentTranscript({ + required this.content, + required this.id, + required this.participantId, + required this.participantRole, + required this.time, + this.contentType, + this.displayName, + this.redaction, + this.sentiment, }); - factory PhoneNumberSummary.fromJson(Map json) { - return PhoneNumberSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - phoneNumber: json['PhoneNumber'] as String?, - phoneNumberCountryCode: (json['PhoneNumberCountryCode'] as String?) - ?.toPhoneNumberCountryCode(), - phoneNumberType: - (json['PhoneNumberType'] as String?)?.toPhoneNumberType(), + factory RealTimeContactAnalysisSegmentTranscript.fromJson( + Map json) { + return RealTimeContactAnalysisSegmentTranscript( + content: json['Content'] as String, + id: json['Id'] as String, + participantId: json['ParticipantId'] as String, + participantRole: (json['ParticipantRole'] as String).toParticipantRole(), + time: RealTimeContactAnalysisTimeData.fromJson( + json['Time'] as Map), + contentType: json['ContentType'] as String?, + displayName: json['DisplayName'] as String?, + redaction: json['Redaction'] != null + ? RealTimeContactAnalysisTranscriptItemRedaction.fromJson( + json['Redaction'] as Map) + : null, + sentiment: (json['Sentiment'] as String?) + ?.toRealTimeContactAnalysisSentimentLabel(), ); } Map toJson() { - final arn = this.arn; + final content = this.content; final id = this.id; - final phoneNumber = this.phoneNumber; - final phoneNumberCountryCode = this.phoneNumberCountryCode; - final phoneNumberType = this.phoneNumberType; + final participantId = this.participantId; + final participantRole = this.participantRole; + final time = this.time; + final contentType = this.contentType; + final displayName = this.displayName; + final redaction = this.redaction; + final sentiment = this.sentiment; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (phoneNumber != null) 'PhoneNumber': phoneNumber, - if (phoneNumberCountryCode != null) - 'PhoneNumberCountryCode': phoneNumberCountryCode.toValue(), - if (phoneNumberType != null) 'PhoneNumberType': phoneNumberType.toValue(), + 'Content': content, + 'Id': id, + 'ParticipantId': participantId, + 'ParticipantRole': participantRole.toValue(), + 'Time': time, + if (contentType != null) 'ContentType': contentType, + if (displayName != null) 'DisplayName': displayName, + if (redaction != null) 'Redaction': redaction, + if (sentiment != null) 'Sentiment': sentiment.toValue(), }; } } -enum PhoneNumberType { - tollFree, - did, +enum RealTimeContactAnalysisSegmentType { + transcript, + categories, + issues, + event, + attachments, } -extension PhoneNumberTypeValueExtension on PhoneNumberType { +extension RealTimeContactAnalysisSegmentTypeValueExtension + on RealTimeContactAnalysisSegmentType { String toValue() { switch (this) { - case PhoneNumberType.tollFree: - return 'TOLL_FREE'; - case PhoneNumberType.did: - return 'DID'; + case RealTimeContactAnalysisSegmentType.transcript: + return 'Transcript'; + case RealTimeContactAnalysisSegmentType.categories: + return 'Categories'; + case RealTimeContactAnalysisSegmentType.issues: + return 'Issues'; + case RealTimeContactAnalysisSegmentType.event: + return 'Event'; + case RealTimeContactAnalysisSegmentType.attachments: + return 'Attachments'; } } } -extension PhoneNumberTypeFromString on String { - PhoneNumberType toPhoneNumberType() { +extension RealTimeContactAnalysisSegmentTypeFromString on String { + RealTimeContactAnalysisSegmentType toRealTimeContactAnalysisSegmentType() { switch (this) { - case 'TOLL_FREE': - return PhoneNumberType.tollFree; - case 'DID': - return PhoneNumberType.did; + case 'Transcript': + return RealTimeContactAnalysisSegmentType.transcript; + case 'Categories': + return RealTimeContactAnalysisSegmentType.categories; + case 'Issues': + return RealTimeContactAnalysisSegmentType.issues; + case 'Event': + return RealTimeContactAnalysisSegmentType.event; + case 'Attachments': + return RealTimeContactAnalysisSegmentType.attachments; } - throw Exception('$this is not known in enum PhoneNumberType'); + throw Exception( + '$this is not known in enum RealTimeContactAnalysisSegmentType'); } } -enum PhoneNumberWorkflowStatus { - claimed, +enum RealTimeContactAnalysisSentimentLabel { + positive, + negative, + neutral, +} + +extension RealTimeContactAnalysisSentimentLabelValueExtension + on RealTimeContactAnalysisSentimentLabel { + String toValue() { + switch (this) { + case RealTimeContactAnalysisSentimentLabel.positive: + return 'POSITIVE'; + case RealTimeContactAnalysisSentimentLabel.negative: + return 'NEGATIVE'; + case RealTimeContactAnalysisSentimentLabel.neutral: + return 'NEUTRAL'; + } + } +} + +extension RealTimeContactAnalysisSentimentLabelFromString on String { + RealTimeContactAnalysisSentimentLabel + toRealTimeContactAnalysisSentimentLabel() { + switch (this) { + case 'POSITIVE': + return RealTimeContactAnalysisSentimentLabel.positive; + case 'NEGATIVE': + return RealTimeContactAnalysisSentimentLabel.negative; + case 'NEUTRAL': + return RealTimeContactAnalysisSentimentLabel.neutral; + } + throw Exception( + '$this is not known in enum RealTimeContactAnalysisSentimentLabel'); + } +} + +enum RealTimeContactAnalysisStatus { inProgress, failed, + completed, } -extension PhoneNumberWorkflowStatusValueExtension on PhoneNumberWorkflowStatus { +extension RealTimeContactAnalysisStatusValueExtension + on RealTimeContactAnalysisStatus { String toValue() { switch (this) { - case PhoneNumberWorkflowStatus.claimed: - return 'CLAIMED'; - case PhoneNumberWorkflowStatus.inProgress: + case RealTimeContactAnalysisStatus.inProgress: return 'IN_PROGRESS'; - case PhoneNumberWorkflowStatus.failed: + case RealTimeContactAnalysisStatus.failed: return 'FAILED'; + case RealTimeContactAnalysisStatus.completed: + return 'COMPLETED'; } } } -extension PhoneNumberWorkflowStatusFromString on String { - PhoneNumberWorkflowStatus toPhoneNumberWorkflowStatus() { +extension RealTimeContactAnalysisStatusFromString on String { + RealTimeContactAnalysisStatus toRealTimeContactAnalysisStatus() { switch (this) { - case 'CLAIMED': - return PhoneNumberWorkflowStatus.claimed; case 'IN_PROGRESS': - return PhoneNumberWorkflowStatus.inProgress; + return RealTimeContactAnalysisStatus.inProgress; case 'FAILED': - return PhoneNumberWorkflowStatus.failed; + return RealTimeContactAnalysisStatus.failed; + case 'COMPLETED': + return RealTimeContactAnalysisStatus.completed; } - throw Exception('$this is not known in enum PhoneNumberWorkflowStatus'); + throw Exception('$this is not known in enum RealTimeContactAnalysisStatus'); } } -enum PhoneType { - softPhone, - deskPhone, +enum RealTimeContactAnalysisSupportedChannel { + voice, + chat, } -extension PhoneTypeValueExtension on PhoneType { +extension RealTimeContactAnalysisSupportedChannelValueExtension + on RealTimeContactAnalysisSupportedChannel { String toValue() { switch (this) { - case PhoneType.softPhone: - return 'SOFT_PHONE'; - case PhoneType.deskPhone: - return 'DESK_PHONE'; + case RealTimeContactAnalysisSupportedChannel.voice: + return 'VOICE'; + case RealTimeContactAnalysisSupportedChannel.chat: + return 'CHAT'; } } } -extension PhoneTypeFromString on String { - PhoneType toPhoneType() { +extension RealTimeContactAnalysisSupportedChannelFromString on String { + RealTimeContactAnalysisSupportedChannel + toRealTimeContactAnalysisSupportedChannel() { switch (this) { - case 'SOFT_PHONE': - return PhoneType.softPhone; - case 'DESK_PHONE': - return PhoneType.deskPhone; + case 'VOICE': + return RealTimeContactAnalysisSupportedChannel.voice; + case 'CHAT': + return RealTimeContactAnalysisSupportedChannel.chat; } - throw Exception('$this is not known in enum PhoneType'); + throw Exception( + '$this is not known in enum RealTimeContactAnalysisSupportedChannel'); } } -/// Information about a prompt. -class Prompt { - /// A description for the prompt. - final String? description; +/// Object describing time with which the segment is associated. It can have +/// different representations of time. Currently supported: absoluteTime +class RealTimeContactAnalysisTimeData { + /// Time represented in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, + /// 2019-11-08T02:41:28.172Z. + final DateTime? absoluteTime; - /// The name of the prompt. - final String? name; + RealTimeContactAnalysisTimeData({ + this.absoluteTime, + }); - /// The Amazon Resource Name (ARN) of the prompt. - final String? promptARN; + factory RealTimeContactAnalysisTimeData.fromJson(Map json) { + return RealTimeContactAnalysisTimeData( + absoluteTime: timeStampFromJson(json['AbsoluteTime']), + ); + } - /// A unique identifier for the prompt. - final String? promptId; + Map toJson() { + final absoluteTime = this.absoluteTime; + return { + if (absoluteTime != null) 'AbsoluteTime': iso8601ToJson(absoluteTime), + }; + } +} - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; +/// Object describing redaction applied to the segment. +class RealTimeContactAnalysisTranscriptItemRedaction { + /// List of character intervals each describing a part of the text that was + /// redacted. For OutputType.Raw, part of the original text that + /// contains data that can be redacted. For OutputType.Redacted, + /// part of the string with redaction tag. + final List? characterOffsets; - Prompt({ - this.description, - this.name, - this.promptARN, - this.promptId, - this.tags, + RealTimeContactAnalysisTranscriptItemRedaction({ + this.characterOffsets, }); - factory Prompt.fromJson(Map json) { - return Prompt( - description: json['Description'] as String?, - name: json['Name'] as String?, - promptARN: json['PromptARN'] as String?, - promptId: json['PromptId'] as String?, - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + factory RealTimeContactAnalysisTranscriptItemRedaction.fromJson( + Map json) { + return RealTimeContactAnalysisTranscriptItemRedaction( + characterOffsets: (json['CharacterOffsets'] as List?) + ?.whereNotNull() + .map((e) => RealTimeContactAnalysisCharacterInterval.fromJson( + e as Map)) + .toList(), ); } Map toJson() { - final description = this.description; - final name = this.name; - final promptARN = this.promptARN; - final promptId = this.promptId; - final tags = this.tags; + final characterOffsets = this.characterOffsets; return { - if (description != null) 'Description': description, - if (name != null) 'Name': name, - if (promptARN != null) 'PromptARN': promptARN, - if (promptId != null) 'PromptId': promptId, - if (tags != null) 'Tags': tags, + if (characterOffsets != null) 'CharacterOffsets': characterOffsets, }; } } -/// Contains information about the prompt. -class PromptSummary { - /// The Amazon Resource Name (ARN) of the prompt. - final String? arn; +/// Transcript representation containing Id and list of character intervals that +/// are associated with analysis data. For example, this object within a +/// RealTimeContactAnalysisPointOfInterest in +/// Category.MatchedDetails would have character interval +/// describing part of the text that matched category. +class RealTimeContactAnalysisTranscriptItemWithCharacterOffsets { + /// Transcript identifier. Matches the identifier from one of the + /// TranscriptSegments. + final String id; - /// The identifier of the prompt. - final String? id; + /// List of character intervals within transcript content/text. + final RealTimeContactAnalysisCharacterInterval? characterOffsets; - /// The name of the prompt. - final String? name; + RealTimeContactAnalysisTranscriptItemWithCharacterOffsets({ + required this.id, + this.characterOffsets, + }); - PromptSummary({ - this.arn, - this.id, - this.name, + factory RealTimeContactAnalysisTranscriptItemWithCharacterOffsets.fromJson( + Map json) { + return RealTimeContactAnalysisTranscriptItemWithCharacterOffsets( + id: json['Id'] as String, + characterOffsets: json['CharacterOffsets'] != null + ? RealTimeContactAnalysisCharacterInterval.fromJson( + json['CharacterOffsets'] as Map) + : null, + ); + } + + Map toJson() { + final id = this.id; + final characterOffsets = this.characterOffsets; + return { + 'Id': id, + if (characterOffsets != null) 'CharacterOffsets': characterOffsets, + }; + } +} + +/// Transcript representation containing Id, Content and list of character +/// intervals that are associated with analysis data. For example, this object +/// within an issue detected would describe both content that contains +/// identified issue and intervals where that content is taken from. +class RealTimeContactAnalysisTranscriptItemWithContent { + /// Transcript identifier. Matches the identifier from one of the + /// TranscriptSegments. + final String id; + final RealTimeContactAnalysisCharacterInterval? characterOffsets; + + /// Part of the transcript content that contains identified issue. Can be + /// redacted + final String? content; + + RealTimeContactAnalysisTranscriptItemWithContent({ + required this.id, + this.characterOffsets, + this.content, + }); + + factory RealTimeContactAnalysisTranscriptItemWithContent.fromJson( + Map json) { + return RealTimeContactAnalysisTranscriptItemWithContent( + id: json['Id'] as String, + characterOffsets: json['CharacterOffsets'] != null + ? RealTimeContactAnalysisCharacterInterval.fromJson( + json['CharacterOffsets'] as Map) + : null, + content: json['Content'] as String?, + ); + } + + Map toJson() { + final id = this.id; + final characterOffsets = this.characterOffsets; + final content = this.content; + return { + 'Id': id, + if (characterOffsets != null) 'CharacterOffsets': characterOffsets, + if (content != null) 'Content': content, + }; + } +} + +/// An analyzed segment for a real-time analysis session. +class RealtimeContactAnalysisSegment { + /// The analyzed attachments. + final RealTimeContactAnalysisSegmentAttachments? attachments; + final RealTimeContactAnalysisSegmentCategories? categories; + final RealTimeContactAnalysisSegmentEvent? event; + final RealTimeContactAnalysisSegmentIssues? issues; + final RealTimeContactAnalysisSegmentTranscript? transcript; + + RealtimeContactAnalysisSegment({ + this.attachments, + this.categories, + this.event, + this.issues, + this.transcript, + }); + + factory RealtimeContactAnalysisSegment.fromJson(Map json) { + return RealtimeContactAnalysisSegment( + attachments: json['Attachments'] != null + ? RealTimeContactAnalysisSegmentAttachments.fromJson( + json['Attachments'] as Map) + : null, + categories: json['Categories'] != null + ? RealTimeContactAnalysisSegmentCategories.fromJson( + json['Categories'] as Map) + : null, + event: json['Event'] != null + ? RealTimeContactAnalysisSegmentEvent.fromJson( + json['Event'] as Map) + : null, + issues: json['Issues'] != null + ? RealTimeContactAnalysisSegmentIssues.fromJson( + json['Issues'] as Map) + : null, + transcript: json['Transcript'] != null + ? RealTimeContactAnalysisSegmentTranscript.fromJson( + json['Transcript'] as Map) + : null, + ); + } + + Map toJson() { + final attachments = this.attachments; + final categories = this.categories; + final event = this.event; + final issues = this.issues; + final transcript = this.transcript; + return { + if (attachments != null) 'Attachments': attachments, + if (categories != null) 'Categories': categories, + if (event != null) 'Event': event, + if (issues != null) 'Issues': issues, + if (transcript != null) 'Transcript': transcript, + }; + } +} + +/// Well-formed data on a contact, used by agents to complete a contact request. +/// You can have up to 4,096 UTF-8 bytes across all references for a contact. +class Reference { + /// The type of the reference. DATE must be of type Epoch + /// timestamp. + final ReferenceType type; + + /// A valid value for the reference. For example, for a URL reference, a + /// formatted URL that is displayed to an agent in the Contact Control Panel + /// (CCP). + final String value; + + Reference({ + required this.type, + required this.value, }); - factory PromptSummary.fromJson(Map json) { - return PromptSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, + factory Reference.fromJson(Map json) { + return Reference( + type: (json['Type'] as String).toReferenceType(), + value: json['Value'] as String, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; + final type = this.type; + final value = this.value; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, + 'Type': type.toValue(), + 'Value': value, }; } } -class PutUserStatusResponse { - PutUserStatusResponse(); +enum ReferenceStatus { + approved, + rejected, +} - factory PutUserStatusResponse.fromJson(Map _) { - return PutUserStatusResponse(); +extension ReferenceStatusValueExtension on ReferenceStatus { + String toValue() { + switch (this) { + case ReferenceStatus.approved: + return 'APPROVED'; + case ReferenceStatus.rejected: + return 'REJECTED'; + } } +} - Map toJson() { - return {}; +extension ReferenceStatusFromString on String { + ReferenceStatus toReferenceStatus() { + switch (this) { + case 'APPROVED': + return ReferenceStatus.approved; + case 'REJECTED': + return ReferenceStatus.rejected; + } + throw Exception('$this is not known in enum ReferenceStatus'); } } -/// Contains information about a queue. -class Queue { - /// The description of the queue. - final String? description; - - /// The identifier for the hours of operation. - final String? hoursOfOperationId; - - /// The maximum number of contacts that can be in the queue before it is - /// considered full. - final int? maxContacts; - - /// The name of the queue. - final String? name; +/// Contains summary information about a reference. +/// ReferenceSummary contains only one non null field between the +/// URL and attachment based on the reference type. +class ReferenceSummary { + /// Information about the reference when the referenceType is + /// ATTACHMENT. Otherwise, null. + final AttachmentReference? attachment; - /// The outbound caller ID name, number, and outbound whisper flow. - final OutboundCallerConfig? outboundCallerConfig; + /// Information about a reference when the referenceType is + /// DATE. Otherwise, null. + final DateReference? date; - /// The Amazon Resource Name (ARN) for the queue. - final String? queueArn; + /// Information about a reference when the referenceType is + /// EMAIL. Otherwise, null. + final EmailReference? email; - /// The identifier for the queue. - final String? queueId; + /// Information about a reference when the referenceType is + /// NUMBER. Otherwise, null. + final NumberReference? number; - /// The status of the queue. - final QueueStatus? status; + /// Information about a reference when the referenceType is + /// STRING. Otherwise, null. + final StringReference? string; - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; + /// Information about the reference when the referenceType is + /// URL. Otherwise, null. + final UrlReference? url; - Queue({ - this.description, - this.hoursOfOperationId, - this.maxContacts, - this.name, - this.outboundCallerConfig, - this.queueArn, - this.queueId, - this.status, - this.tags, + ReferenceSummary({ + this.attachment, + this.date, + this.email, + this.number, + this.string, + this.url, }); - factory Queue.fromJson(Map json) { - return Queue( - description: json['Description'] as String?, - hoursOfOperationId: json['HoursOfOperationId'] as String?, - maxContacts: json['MaxContacts'] as int?, - name: json['Name'] as String?, - outboundCallerConfig: json['OutboundCallerConfig'] != null - ? OutboundCallerConfig.fromJson( - json['OutboundCallerConfig'] as Map) + factory ReferenceSummary.fromJson(Map json) { + return ReferenceSummary( + attachment: json['Attachment'] != null + ? AttachmentReference.fromJson( + json['Attachment'] as Map) + : null, + date: json['Date'] != null + ? DateReference.fromJson(json['Date'] as Map) + : null, + email: json['Email'] != null + ? EmailReference.fromJson(json['Email'] as Map) + : null, + number: json['Number'] != null + ? NumberReference.fromJson(json['Number'] as Map) + : null, + string: json['String'] != null + ? StringReference.fromJson(json['String'] as Map) + : null, + url: json['Url'] != null + ? UrlReference.fromJson(json['Url'] as Map) : null, - queueArn: json['QueueArn'] as String?, - queueId: json['QueueId'] as String?, - status: (json['Status'] as String?)?.toQueueStatus(), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final description = this.description; - final hoursOfOperationId = this.hoursOfOperationId; - final maxContacts = this.maxContacts; - final name = this.name; - final outboundCallerConfig = this.outboundCallerConfig; - final queueArn = this.queueArn; - final queueId = this.queueId; - final status = this.status; - final tags = this.tags; + final attachment = this.attachment; + final date = this.date; + final email = this.email; + final number = this.number; + final string = this.string; + final url = this.url; return { - if (description != null) 'Description': description, - if (hoursOfOperationId != null) 'HoursOfOperationId': hoursOfOperationId, - if (maxContacts != null) 'MaxContacts': maxContacts, - if (name != null) 'Name': name, - if (outboundCallerConfig != null) - 'OutboundCallerConfig': outboundCallerConfig, - if (queueArn != null) 'QueueArn': queueArn, - if (queueId != null) 'QueueId': queueId, - if (status != null) 'Status': status.toValue(), - if (tags != null) 'Tags': tags, + if (attachment != null) 'Attachment': attachment, + if (date != null) 'Date': date, + if (email != null) 'Email': email, + if (number != null) 'Number': number, + if (string != null) 'String': string, + if (url != null) 'Url': url, }; } } -/// If this contact was queued, this contains information about the queue. -class QueueInfo { - /// The timestamp when the contact was added to the queue. - final DateTime? enqueueTimestamp; - - /// The unique identifier for the queue. - final String? id; - - QueueInfo({ - this.enqueueTimestamp, - this.id, - }); - - factory QueueInfo.fromJson(Map json) { - return QueueInfo( - enqueueTimestamp: timeStampFromJson(json['EnqueueTimestamp']), - id: json['Id'] as String?, - ); - } +enum ReferenceType { + url, + attachment, + number, + string, + date, + email, +} - Map toJson() { - final enqueueTimestamp = this.enqueueTimestamp; - final id = this.id; - return { - if (enqueueTimestamp != null) - 'EnqueueTimestamp': unixTimestampToJson(enqueueTimestamp), - if (id != null) 'Id': id, - }; +extension ReferenceTypeValueExtension on ReferenceType { + String toValue() { + switch (this) { + case ReferenceType.url: + return 'URL'; + case ReferenceType.attachment: + return 'ATTACHMENT'; + case ReferenceType.number: + return 'NUMBER'; + case ReferenceType.string: + return 'STRING'; + case ReferenceType.date: + return 'DATE'; + case ReferenceType.email: + return 'EMAIL'; + } } } -/// Contains information about a queue for a quick connect. The flow must be of -/// type Transfer to Queue. -class QueueQuickConnectConfig { - /// The identifier of the flow. - final String contactFlowId; - - /// The identifier for the queue. - final String queueId; +extension ReferenceTypeFromString on String { + ReferenceType toReferenceType() { + switch (this) { + case 'URL': + return ReferenceType.url; + case 'ATTACHMENT': + return ReferenceType.attachment; + case 'NUMBER': + return ReferenceType.number; + case 'STRING': + return ReferenceType.string; + case 'DATE': + return ReferenceType.date; + case 'EMAIL': + return ReferenceType.email; + } + throw Exception('$this is not known in enum ReferenceType'); + } +} - QueueQuickConnectConfig({ - required this.contactFlowId, - required this.queueId, - }); +enum RehydrationType { + entirePastSession, + fromSegment, +} - factory QueueQuickConnectConfig.fromJson(Map json) { - return QueueQuickConnectConfig( - contactFlowId: json['ContactFlowId'] as String, - queueId: json['QueueId'] as String, - ); +extension RehydrationTypeValueExtension on RehydrationType { + String toValue() { + switch (this) { + case RehydrationType.entirePastSession: + return 'ENTIRE_PAST_SESSION'; + case RehydrationType.fromSegment: + return 'FROM_SEGMENT'; + } } +} - Map toJson() { - final contactFlowId = this.contactFlowId; - final queueId = this.queueId; - return { - 'ContactFlowId': contactFlowId, - 'QueueId': queueId, - }; +extension RehydrationTypeFromString on String { + RehydrationType toRehydrationType() { + switch (this) { + case 'ENTIRE_PAST_SESSION': + return RehydrationType.entirePastSession; + case 'FROM_SEGMENT': + return RehydrationType.fromSegment; + } + throw Exception('$this is not known in enum RehydrationType'); } } -/// Contains information about a queue resource for which metrics are returned. -class QueueReference { - /// The Amazon Resource Name (ARN) of the queue. +class ReplicateInstanceResponse { + /// The Amazon Resource Name (ARN) of the replicated instance. final String? arn; - /// The identifier of the queue. + /// The identifier of the replicated instance. You can find the + /// instanceId in the ARN of the instance. The replicated instance + /// has the same identifier as the instance it was replicated from. final String? id; - QueueReference({ + ReplicateInstanceResponse({ this.arn, this.id, }); - factory QueueReference.fromJson(Map json) { - return QueueReference( + factory ReplicateInstanceResponse.fromJson(Map json) { + return ReplicateInstanceResponse( arn: json['Arn'] as String?, id: json['Id'] as String?, ); @@ -20767,1435 +31146,1547 @@ class QueueReference { } } -/// The search criteria to be used to return queues. -/// -/// The name and description fields support "contains" -/// queries with a minimum of 2 characters and a maximum of 25 characters. Any -/// queries with character lengths outside of this range will throw invalid -/// results. -/// -class QueueSearchCriteria { - /// A list of conditions which would be applied together with an AND condition. - final List? andConditions; - - /// A list of conditions which would be applied together with an OR condition. - final List? orConditions; - - /// The type of queue. - final SearchableQueueType? queueTypeCondition; - final StringCondition? stringCondition; +/// Information about a required field. +class RequiredFieldInfo { + /// The unique identifier for the field. + final TaskTemplateFieldIdentifier? id; - QueueSearchCriteria({ - this.andConditions, - this.orConditions, - this.queueTypeCondition, - this.stringCondition, + RequiredFieldInfo({ + this.id, }); + factory RequiredFieldInfo.fromJson(Map json) { + return RequiredFieldInfo( + id: json['Id'] != null + ? TaskTemplateFieldIdentifier.fromJson( + json['Id'] as Map) + : null, + ); + } + Map toJson() { - final andConditions = this.andConditions; - final orConditions = this.orConditions; - final queueTypeCondition = this.queueTypeCondition; - final stringCondition = this.stringCondition; + final id = this.id; return { - if (andConditions != null) 'AndConditions': andConditions, - if (orConditions != null) 'OrConditions': orConditions, - if (queueTypeCondition != null) - 'QueueTypeCondition': queueTypeCondition.toValue(), - if (stringCondition != null) 'StringCondition': stringCondition, + if (id != null) 'Id': id, }; } } -/// Filters to be applied to search results. -class QueueSearchFilter { - final ControlPlaneTagFilter? tagFilter; +/// The search criteria to be used to search tags. +class ResourceTagsSearchCriteria { + /// The search criteria to be used to return tags. + final TagSearchCondition? tagSearchCondition; - QueueSearchFilter({ - this.tagFilter, + ResourceTagsSearchCriteria({ + this.tagSearchCondition, }); Map toJson() { - final tagFilter = this.tagFilter; + final tagSearchCondition = this.tagSearchCondition; return { - if (tagFilter != null) 'TagFilter': tagFilter, + if (tagSearchCondition != null) 'TagSearchCondition': tagSearchCondition, }; } } -enum QueueStatus { - enabled, - disabled, -} +class ResumeContactRecordingResponse { + ResumeContactRecordingResponse(); -extension QueueStatusValueExtension on QueueStatus { - String toValue() { - switch (this) { - case QueueStatus.enabled: - return 'ENABLED'; - case QueueStatus.disabled: - return 'DISABLED'; - } + factory ResumeContactRecordingResponse.fromJson(Map _) { + return ResumeContactRecordingResponse(); } -} -extension QueueStatusFromString on String { - QueueStatus toQueueStatus() { - switch (this) { - case 'ENABLED': - return QueueStatus.enabled; - case 'DISABLED': - return QueueStatus.disabled; - } - throw Exception('$this is not known in enum QueueStatus'); + Map toJson() { + return {}; } } -/// Contains summary information about a queue. -class QueueSummary { - /// The Amazon Resource Name (ARN) of the queue. - final String? arn; +class ResumeContactResponse { + ResumeContactResponse(); - /// The identifier of the queue. - final String? id; + factory ResumeContactResponse.fromJson(Map _) { + return ResumeContactResponse(); + } - /// The name of the queue. - final String? name; + Map toJson() { + return {}; + } +} - /// The type of queue. - final QueueType? queueType; +/// Latest routing criteria on the contact. +class RoutingCriteria { + /// The timestamp indicating when the routing criteria is set to active. A + /// routing criteria is activated when contact is transferred to a queue. + /// ActivationTimestamp will be set on routing criteria for contacts in agent + /// queue even though Routing criteria is never activated for contacts in agent + /// queue. + final DateTime? activationTimestamp; - QueueSummary({ - this.arn, - this.id, - this.name, - this.queueType, + /// Information about the index of the routing criteria. + final int? index; + + /// List of routing steps. When Amazon Connect does not find an available agent + /// meeting the requirements in a step for a given step duration, the routing + /// criteria will move on to the next step sequentially until a join is + /// completed with an agent. When all steps are exhausted, the contact will be + /// offered to any agent in the queue. + final List? steps; + + RoutingCriteria({ + this.activationTimestamp, + this.index, + this.steps, }); - factory QueueSummary.fromJson(Map json) { - return QueueSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - queueType: (json['QueueType'] as String?)?.toQueueType(), + factory RoutingCriteria.fromJson(Map json) { + return RoutingCriteria( + activationTimestamp: timeStampFromJson(json['ActivationTimestamp']), + index: json['Index'] as int?, + steps: (json['Steps'] as List?) + ?.whereNotNull() + .map((e) => Step.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; - final queueType = this.queueType; + final activationTimestamp = this.activationTimestamp; + final index = this.index; + final steps = this.steps; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (queueType != null) 'QueueType': queueType.toValue(), + if (activationTimestamp != null) + 'ActivationTimestamp': unixTimestampToJson(activationTimestamp), + if (index != null) 'Index': index, + if (steps != null) 'Steps': steps, }; } } -enum QueueType { - standard, - agent, +enum RoutingCriteriaStepStatus { + active, + inactive, + joined, + expired, } -extension QueueTypeValueExtension on QueueType { +extension RoutingCriteriaStepStatusValueExtension on RoutingCriteriaStepStatus { String toValue() { switch (this) { - case QueueType.standard: - return 'STANDARD'; - case QueueType.agent: - return 'AGENT'; + case RoutingCriteriaStepStatus.active: + return 'ACTIVE'; + case RoutingCriteriaStepStatus.inactive: + return 'INACTIVE'; + case RoutingCriteriaStepStatus.joined: + return 'JOINED'; + case RoutingCriteriaStepStatus.expired: + return 'EXPIRED'; } } } -extension QueueTypeFromString on String { - QueueType toQueueType() { +extension RoutingCriteriaStepStatusFromString on String { + RoutingCriteriaStepStatus toRoutingCriteriaStepStatus() { switch (this) { - case 'STANDARD': - return QueueType.standard; - case 'AGENT': - return QueueType.agent; + case 'ACTIVE': + return RoutingCriteriaStepStatus.active; + case 'INACTIVE': + return RoutingCriteriaStepStatus.inactive; + case 'JOINED': + return RoutingCriteriaStepStatus.joined; + case 'EXPIRED': + return RoutingCriteriaStepStatus.expired; } - throw Exception('$this is not known in enum QueueType'); + throw Exception('$this is not known in enum RoutingCriteriaStepStatus'); } } -/// Contains information about a quick connect. -class QuickConnect { - /// The description. +/// Contains information about a routing profile. +class RoutingProfile { + /// Whether agents with this routing profile will have their routing order + /// calculated based on time since their last inbound contact or + /// longest idle time. + final AgentAvailabilityTimer? agentAvailabilityTimer; + + /// The IDs of the associated queue. + final List? associatedQueueIds; + + /// The identifier of the default outbound queue for this routing profile. + final String? defaultOutboundQueueId; + + /// The description of the routing profile. final String? description; - /// The name of the quick connect. + /// The identifier of the Amazon Connect instance. You can find + /// the instance ID in the Amazon Resource Name (ARN) of the instance. + final String? instanceId; + + /// Whether this a default routing profile. + final bool? isDefault; + + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + + /// The channels agents can handle in the Contact Control Panel (CCP) for this + /// routing profile. + final List? mediaConcurrencies; + + /// The name of the routing profile. final String? name; - /// The Amazon Resource Name (ARN) of the quick connect. - final String? quickConnectARN; + /// The number of associated queues in routing profile. + final int? numberOfAssociatedQueues; - /// Contains information about the quick connect. - final QuickConnectConfig? quickConnectConfig; + /// The number of associated users in routing profile. + final int? numberOfAssociatedUsers; - /// The identifier for the quick connect. - final String? quickConnectId; + /// The Amazon Resource Name (ARN) of the routing profile. + final String? routingProfileArn; + + /// The identifier of the routing profile. + final String? routingProfileId; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; - QuickConnect({ + RoutingProfile({ + this.agentAvailabilityTimer, + this.associatedQueueIds, + this.defaultOutboundQueueId, this.description, + this.instanceId, + this.isDefault, + this.lastModifiedRegion, + this.lastModifiedTime, + this.mediaConcurrencies, this.name, - this.quickConnectARN, - this.quickConnectConfig, - this.quickConnectId, + this.numberOfAssociatedQueues, + this.numberOfAssociatedUsers, + this.routingProfileArn, + this.routingProfileId, this.tags, }); - factory QuickConnect.fromJson(Map json) { - return QuickConnect( + factory RoutingProfile.fromJson(Map json) { + return RoutingProfile( + agentAvailabilityTimer: (json['AgentAvailabilityTimer'] as String?) + ?.toAgentAvailabilityTimer(), + associatedQueueIds: (json['AssociatedQueueIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + defaultOutboundQueueId: json['DefaultOutboundQueueId'] as String?, description: json['Description'] as String?, + instanceId: json['InstanceId'] as String?, + isDefault: json['IsDefault'] as bool?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + mediaConcurrencies: (json['MediaConcurrencies'] as List?) + ?.whereNotNull() + .map((e) => MediaConcurrency.fromJson(e as Map)) + .toList(), name: json['Name'] as String?, - quickConnectARN: json['QuickConnectARN'] as String?, - quickConnectConfig: json['QuickConnectConfig'] != null - ? QuickConnectConfig.fromJson( - json['QuickConnectConfig'] as Map) - : null, - quickConnectId: json['QuickConnectId'] as String?, + numberOfAssociatedQueues: json['NumberOfAssociatedQueues'] as int?, + numberOfAssociatedUsers: json['NumberOfAssociatedUsers'] as int?, + routingProfileArn: json['RoutingProfileArn'] as String?, + routingProfileId: json['RoutingProfileId'] as String?, tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { + final agentAvailabilityTimer = this.agentAvailabilityTimer; + final associatedQueueIds = this.associatedQueueIds; + final defaultOutboundQueueId = this.defaultOutboundQueueId; final description = this.description; + final instanceId = this.instanceId; + final isDefault = this.isDefault; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final mediaConcurrencies = this.mediaConcurrencies; final name = this.name; - final quickConnectARN = this.quickConnectARN; - final quickConnectConfig = this.quickConnectConfig; - final quickConnectId = this.quickConnectId; + final numberOfAssociatedQueues = this.numberOfAssociatedQueues; + final numberOfAssociatedUsers = this.numberOfAssociatedUsers; + final routingProfileArn = this.routingProfileArn; + final routingProfileId = this.routingProfileId; final tags = this.tags; return { + if (agentAvailabilityTimer != null) + 'AgentAvailabilityTimer': agentAvailabilityTimer.toValue(), + if (associatedQueueIds != null) 'AssociatedQueueIds': associatedQueueIds, + if (defaultOutboundQueueId != null) + 'DefaultOutboundQueueId': defaultOutboundQueueId, if (description != null) 'Description': description, + if (instanceId != null) 'InstanceId': instanceId, + if (isDefault != null) 'IsDefault': isDefault, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (mediaConcurrencies != null) 'MediaConcurrencies': mediaConcurrencies, if (name != null) 'Name': name, - if (quickConnectARN != null) 'QuickConnectARN': quickConnectARN, - if (quickConnectConfig != null) 'QuickConnectConfig': quickConnectConfig, - if (quickConnectId != null) 'QuickConnectId': quickConnectId, + if (numberOfAssociatedQueues != null) + 'NumberOfAssociatedQueues': numberOfAssociatedQueues, + if (numberOfAssociatedUsers != null) + 'NumberOfAssociatedUsers': numberOfAssociatedUsers, + if (routingProfileArn != null) 'RoutingProfileArn': routingProfileArn, + if (routingProfileId != null) 'RoutingProfileId': routingProfileId, if (tags != null) 'Tags': tags, }; } } -/// Contains configuration settings for a quick connect. -class QuickConnectConfig { - /// The type of quick connect. In the Amazon Connect console, when you create a - /// quick connect, you are prompted to assign one of the following types: Agent - /// (USER), External (PHONE_NUMBER), or Queue (QUEUE). - final QuickConnectType quickConnectType; - - /// The phone configuration. This is required only if QuickConnectType is - /// PHONE_NUMBER. - final PhoneNumberQuickConnectConfig? phoneConfig; +/// Contains information about the queue and channel for which priority and +/// delay can be set. +class RoutingProfileQueueConfig { + /// The delay, in seconds, a contact should be in the queue before they are + /// routed to an available agent. For more information, see Queues: + /// priority and delay in the Amazon Connect Administrator Guide. + final int delay; - /// The queue configuration. This is required only if QuickConnectType is QUEUE. - final QueueQuickConnectConfig? queueConfig; + /// The order in which contacts are to be handled for the queue. For more + /// information, see Queues: + /// priority and delay. + final int priority; - /// The user configuration. This is required only if QuickConnectType is USER. - final UserQuickConnectConfig? userConfig; + /// Contains information about a queue resource. + final RoutingProfileQueueReference queueReference; - QuickConnectConfig({ - required this.quickConnectType, - this.phoneConfig, - this.queueConfig, - this.userConfig, + RoutingProfileQueueConfig({ + required this.delay, + required this.priority, + required this.queueReference, }); - factory QuickConnectConfig.fromJson(Map json) { - return QuickConnectConfig( - quickConnectType: - (json['QuickConnectType'] as String).toQuickConnectType(), - phoneConfig: json['PhoneConfig'] != null - ? PhoneNumberQuickConnectConfig.fromJson( - json['PhoneConfig'] as Map) - : null, - queueConfig: json['QueueConfig'] != null - ? QueueQuickConnectConfig.fromJson( - json['QueueConfig'] as Map) - : null, - userConfig: json['UserConfig'] != null - ? UserQuickConnectConfig.fromJson( - json['UserConfig'] as Map) - : null, - ); - } - Map toJson() { - final quickConnectType = this.quickConnectType; - final phoneConfig = this.phoneConfig; - final queueConfig = this.queueConfig; - final userConfig = this.userConfig; + final delay = this.delay; + final priority = this.priority; + final queueReference = this.queueReference; return { - 'QuickConnectType': quickConnectType.toValue(), - if (phoneConfig != null) 'PhoneConfig': phoneConfig, - if (queueConfig != null) 'QueueConfig': queueConfig, - if (userConfig != null) 'UserConfig': userConfig, + 'Delay': delay, + 'Priority': priority, + 'QueueReference': queueReference, }; } } -/// Contains summary information about a quick connect. -class QuickConnectSummary { - /// The Amazon Resource Name (ARN) of the quick connect. - final String? arn; +/// Contains summary information about a routing profile queue. +class RoutingProfileQueueConfigSummary { + /// The channels this queue supports. + final Channel channel; - /// The identifier for the quick connect. - final String? id; + /// The delay, in seconds, that a contact should be in the queue before they are + /// routed to an available agent. For more information, see Queues: + /// priority and delay in the Amazon Connect Administrator Guide. + final int delay; - /// The name of the quick connect. - final String? name; + /// The order in which contacts are to be handled for the queue. For more + /// information, see Queues: + /// priority and delay. + final int priority; - /// The type of quick connect. In the Amazon Connect console, when you create a - /// quick connect, you are prompted to assign one of the following types: Agent - /// (USER), External (PHONE_NUMBER), or Queue (QUEUE). - final QuickConnectType? quickConnectType; + /// The Amazon Resource Name (ARN) of the queue. + final String queueArn; - QuickConnectSummary({ - this.arn, - this.id, - this.name, - this.quickConnectType, + /// The identifier for the queue. + final String queueId; + + /// The name of the queue. + final String queueName; + + RoutingProfileQueueConfigSummary({ + required this.channel, + required this.delay, + required this.priority, + required this.queueArn, + required this.queueId, + required this.queueName, }); - factory QuickConnectSummary.fromJson(Map json) { - return QuickConnectSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, - quickConnectType: - (json['QuickConnectType'] as String?)?.toQuickConnectType(), + factory RoutingProfileQueueConfigSummary.fromJson(Map json) { + return RoutingProfileQueueConfigSummary( + channel: (json['Channel'] as String).toChannel(), + delay: json['Delay'] as int, + priority: json['Priority'] as int, + queueArn: json['QueueArn'] as String, + queueId: json['QueueId'] as String, + queueName: json['QueueName'] as String, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; - final quickConnectType = this.quickConnectType; + final channel = this.channel; + final delay = this.delay; + final priority = this.priority; + final queueArn = this.queueArn; + final queueId = this.queueId; + final queueName = this.queueName; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, - if (quickConnectType != null) - 'QuickConnectType': quickConnectType.toValue(), + 'Channel': channel.toValue(), + 'Delay': delay, + 'Priority': priority, + 'QueueArn': queueArn, + 'QueueId': queueId, + 'QueueName': queueName, }; } } -enum QuickConnectType { - user, - queue, - phoneNumber, -} - -extension QuickConnectTypeValueExtension on QuickConnectType { - String toValue() { - switch (this) { - case QuickConnectType.user: - return 'USER'; - case QuickConnectType.queue: - return 'QUEUE'; - case QuickConnectType.phoneNumber: - return 'PHONE_NUMBER'; - } - } -} - -extension QuickConnectTypeFromString on String { - QuickConnectType toQuickConnectType() { - switch (this) { - case 'USER': - return QuickConnectType.user; - case 'QUEUE': - return QuickConnectType.queue; - case 'PHONE_NUMBER': - return QuickConnectType.phoneNumber; - } - throw Exception('$this is not known in enum QuickConnectType'); - } -} +/// Contains the channel and queue identifier for a routing profile. +class RoutingProfileQueueReference { + /// The channels agents can handle in the Contact Control Panel (CCP) for this + /// routing profile. + final Channel channel; -/// Indicates a field that is read-only to an agent. -class ReadOnlyFieldInfo { - /// Identifier of the read-only field. - final TaskTemplateFieldIdentifier? id; + /// The identifier for the queue. + final String queueId; - ReadOnlyFieldInfo({ - this.id, + RoutingProfileQueueReference({ + required this.channel, + required this.queueId, }); - factory ReadOnlyFieldInfo.fromJson(Map json) { - return ReadOnlyFieldInfo( - id: json['Id'] != null - ? TaskTemplateFieldIdentifier.fromJson( - json['Id'] as Map) - : null, - ); - } - Map toJson() { - final id = this.id; + final channel = this.channel; + final queueId = this.queueId; return { - if (id != null) 'Id': id, + 'Channel': channel.toValue(), + 'QueueId': queueId, }; } } -/// Well-formed data on a contact, used by agents to complete a contact request. -/// You can have up to 4,096 UTF-8 bytes across all references for a contact. -class Reference { - /// The type of the reference. DATE must be of type Epoch - /// timestamp. - final ReferenceType type; +/// Information about the routing profile assigned to the user. +class RoutingProfileReference { + /// The Amazon Resource Name (ARN) of the routing profile. + final String? arn; - /// A valid value for the reference. For example, for a URL reference, a - /// formatted URL that is displayed to an agent in the Contact Control Panel - /// (CCP). - final String value; + /// The identifier of the routing profile. + final String? id; - Reference({ - required this.type, - required this.value, + RoutingProfileReference({ + this.arn, + this.id, }); - factory Reference.fromJson(Map json) { - return Reference( - type: (json['Type'] as String).toReferenceType(), - value: json['Value'] as String, + factory RoutingProfileReference.fromJson(Map json) { + return RoutingProfileReference( + arn: json['Arn'] as String?, + id: json['Id'] as String?, ); } Map toJson() { - final type = this.type; - final value = this.value; + final arn = this.arn; + final id = this.id; return { - 'Type': type.toValue(), - 'Value': value, + if (arn != null) 'Arn': arn, + if (id != null) 'Id': id, }; } } -enum ReferenceStatus { - approved, - rejected, -} - -extension ReferenceStatusValueExtension on ReferenceStatus { - String toValue() { - switch (this) { - case ReferenceStatus.approved: - return 'APPROVED'; - case ReferenceStatus.rejected: - return 'REJECTED'; - } - } -} - -extension ReferenceStatusFromString on String { - ReferenceStatus toReferenceStatus() { - switch (this) { - case 'APPROVED': - return ReferenceStatus.approved; - case 'REJECTED': - return ReferenceStatus.rejected; - } - throw Exception('$this is not known in enum ReferenceStatus'); - } -} - -/// Contains summary information about a reference. -/// ReferenceSummary contains only one non null field between the -/// URL and attachment based on the reference type. -class ReferenceSummary { - /// Information about the reference when the referenceType is - /// ATTACHMENT. Otherwise, null. - final AttachmentReference? attachment; - - /// Information about a reference when the referenceType is - /// DATE. Otherwise, null. - final DateReference? date; - - /// Information about a reference when the referenceType is - /// EMAIL. Otherwise, null. - final EmailReference? email; - - /// Information about a reference when the referenceType is - /// NUMBER. Otherwise, null. - final NumberReference? number; +/// The search criteria to be used to return routing profiles. +/// +/// The name and description fields support "contains" +/// queries with a minimum of 2 characters and a maximum of 25 characters. Any +/// queries with character lengths outside of this range will throw invalid +/// results. +/// +class RoutingProfileSearchCriteria { + /// A list of conditions which would be applied together with an AND condition. + final List? andConditions; - /// Information about a reference when the referenceType is - /// STRING. Otherwise, null. - final StringReference? string; + /// A list of conditions which would be applied together with an OR condition. + final List? orConditions; - /// Information about the reference when the referenceType is - /// URL. Otherwise, null. - final UrlReference? url; + /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// associatedQueueIds, name, + /// description, and resourceID. + /// + final StringCondition? stringCondition; - ReferenceSummary({ - this.attachment, - this.date, - this.email, - this.number, - this.string, - this.url, + RoutingProfileSearchCriteria({ + this.andConditions, + this.orConditions, + this.stringCondition, }); - factory ReferenceSummary.fromJson(Map json) { - return ReferenceSummary( - attachment: json['Attachment'] != null - ? AttachmentReference.fromJson( - json['Attachment'] as Map) - : null, - date: json['Date'] != null - ? DateReference.fromJson(json['Date'] as Map) - : null, - email: json['Email'] != null - ? EmailReference.fromJson(json['Email'] as Map) - : null, - number: json['Number'] != null - ? NumberReference.fromJson(json['Number'] as Map) - : null, - string: json['String'] != null - ? StringReference.fromJson(json['String'] as Map) - : null, - url: json['Url'] != null - ? UrlReference.fromJson(json['Url'] as Map) - : null, - ); - } - Map toJson() { - final attachment = this.attachment; - final date = this.date; - final email = this.email; - final number = this.number; - final string = this.string; - final url = this.url; + final andConditions = this.andConditions; + final orConditions = this.orConditions; + final stringCondition = this.stringCondition; return { - if (attachment != null) 'Attachment': attachment, - if (date != null) 'Date': date, - if (email != null) 'Email': email, - if (number != null) 'Number': number, - if (string != null) 'String': string, - if (url != null) 'Url': url, + if (andConditions != null) 'AndConditions': andConditions, + if (orConditions != null) 'OrConditions': orConditions, + if (stringCondition != null) 'StringCondition': stringCondition, }; } } -enum ReferenceType { - url, - attachment, - number, - string, - date, - email, -} +/// Filters to be applied to search results. +class RoutingProfileSearchFilter { + final ControlPlaneTagFilter? tagFilter; -extension ReferenceTypeValueExtension on ReferenceType { - String toValue() { - switch (this) { - case ReferenceType.url: - return 'URL'; - case ReferenceType.attachment: - return 'ATTACHMENT'; - case ReferenceType.number: - return 'NUMBER'; - case ReferenceType.string: - return 'STRING'; - case ReferenceType.date: - return 'DATE'; - case ReferenceType.email: - return 'EMAIL'; - } - } -} + RoutingProfileSearchFilter({ + this.tagFilter, + }); -extension ReferenceTypeFromString on String { - ReferenceType toReferenceType() { - switch (this) { - case 'URL': - return ReferenceType.url; - case 'ATTACHMENT': - return ReferenceType.attachment; - case 'NUMBER': - return ReferenceType.number; - case 'STRING': - return ReferenceType.string; - case 'DATE': - return ReferenceType.date; - case 'EMAIL': - return ReferenceType.email; - } - throw Exception('$this is not known in enum ReferenceType'); + Map toJson() { + final tagFilter = this.tagFilter; + return { + if (tagFilter != null) 'TagFilter': tagFilter, + }; } } -enum RehydrationType { - entirePastSession, - fromSegment, -} +/// Contains summary information about a routing profile. +class RoutingProfileSummary { + /// The Amazon Resource Name (ARN) of the routing profile. + final String? arn; -extension RehydrationTypeValueExtension on RehydrationType { - String toValue() { - switch (this) { - case RehydrationType.entirePastSession: - return 'ENTIRE_PAST_SESSION'; - case RehydrationType.fromSegment: - return 'FROM_SEGMENT'; - } - } -} + /// The identifier of the routing profile. + final String? id; -extension RehydrationTypeFromString on String { - RehydrationType toRehydrationType() { - switch (this) { - case 'ENTIRE_PAST_SESSION': - return RehydrationType.entirePastSession; - case 'FROM_SEGMENT': - return RehydrationType.fromSegment; - } - throw Exception('$this is not known in enum RehydrationType'); - } -} + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; -class ReplicateInstanceResponse { - /// The Amazon Resource Name (ARN) of the replicated instance. - final String? arn; + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; - /// The identifier of the replicated instance. You can find the - /// instanceId in the ARN of the instance. The replicated instance - /// has the same identifier as the instance it was replicated from. - final String? id; + /// The name of the routing profile. + final String? name; - ReplicateInstanceResponse({ + RoutingProfileSummary({ this.arn, this.id, + this.lastModifiedRegion, + this.lastModifiedTime, + this.name, }); - factory ReplicateInstanceResponse.fromJson(Map json) { - return ReplicateInstanceResponse( + factory RoutingProfileSummary.fromJson(Map json) { + return RoutingProfileSummary( arn: json['Arn'] as String?, id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, ); } Map toJson() { final arn = this.arn; final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; return { if (arn != null) 'Arn': arn, if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, }; } } -/// Information about a required field. -class RequiredFieldInfo { - /// The unique identifier for the field. - final TaskTemplateFieldIdentifier? id; - - RequiredFieldInfo({ - this.id, - }); - - factory RequiredFieldInfo.fromJson(Map json) { - return RequiredFieldInfo( - id: json['Id'] != null - ? TaskTemplateFieldIdentifier.fromJson( - json['Id'] as Map) - : null, - ); - } - - Map toJson() { - final id = this.id; - return { - if (id != null) 'Id': id, - }; - } -} - -class ResumeContactRecordingResponse { - ResumeContactRecordingResponse(); - - factory ResumeContactRecordingResponse.fromJson(Map _) { - return ResumeContactRecordingResponse(); - } - - Map toJson() { - return {}; - } -} +/// Information about a rule. +class Rule { + /// A list of actions to be run when the rule is triggered. + final List actions; -/// Contains information about a routing profile. -class RoutingProfile { - /// The identifier of the default outbound queue for this routing profile. - final String? defaultOutboundQueueId; + /// The timestamp for when the rule was created. + final DateTime createdTime; - /// The description of the routing profile. - final String? description; + /// The conditions of the rule. + final String function; - /// The identifier of the Amazon Connect instance. You can find - /// the instance ID in the Amazon Resource Name (ARN) of the instance. - final String? instanceId; + /// The Amazon Resource Name (ARN) of the user who last updated the rule. + final String lastUpdatedBy; - /// The channels agents can handle in the Contact Control Panel (CCP) for this - /// routing profile. - final List? mediaConcurrencies; + /// The timestamp for the when the rule was last updated. + final DateTime lastUpdatedTime; - /// The name of the routing profile. - final String? name; + /// The name of the rule. + final String name; - /// The number of associated queues in routing profile. - final int? numberOfAssociatedQueues; + /// The publish status of the rule. + final RulePublishStatus publishStatus; - /// The number of associated users in routing profile. - final int? numberOfAssociatedUsers; + /// The Amazon Resource Name (ARN) of the rule. + final String ruleArn; - /// The Amazon Resource Name (ARN) of the routing profile. - final String? routingProfileArn; + /// A unique identifier for the rule. + final String ruleId; - /// The identifier of the routing profile. - final String? routingProfileId; + /// The event source to trigger the rule. + final RuleTriggerEventSource triggerEventSource; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; - RoutingProfile({ - this.defaultOutboundQueueId, - this.description, - this.instanceId, - this.mediaConcurrencies, - this.name, - this.numberOfAssociatedQueues, - this.numberOfAssociatedUsers, - this.routingProfileArn, - this.routingProfileId, + Rule({ + required this.actions, + required this.createdTime, + required this.function, + required this.lastUpdatedBy, + required this.lastUpdatedTime, + required this.name, + required this.publishStatus, + required this.ruleArn, + required this.ruleId, + required this.triggerEventSource, this.tags, }); - factory RoutingProfile.fromJson(Map json) { - return RoutingProfile( - defaultOutboundQueueId: json['DefaultOutboundQueueId'] as String?, - description: json['Description'] as String?, - instanceId: json['InstanceId'] as String?, - mediaConcurrencies: (json['MediaConcurrencies'] as List?) - ?.whereNotNull() - .map((e) => MediaConcurrency.fromJson(e as Map)) + factory Rule.fromJson(Map json) { + return Rule( + actions: (json['Actions'] as List) + .whereNotNull() + .map((e) => RuleAction.fromJson(e as Map)) .toList(), - name: json['Name'] as String?, - numberOfAssociatedQueues: json['NumberOfAssociatedQueues'] as int?, - numberOfAssociatedUsers: json['NumberOfAssociatedUsers'] as int?, - routingProfileArn: json['RoutingProfileArn'] as String?, - routingProfileId: json['RoutingProfileId'] as String?, + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + function: json['Function'] as String, + lastUpdatedBy: json['LastUpdatedBy'] as String, + lastUpdatedTime: + nonNullableTimeStampFromJson(json['LastUpdatedTime'] as Object), + name: json['Name'] as String, + publishStatus: (json['PublishStatus'] as String).toRulePublishStatus(), + ruleArn: json['RuleArn'] as String, + ruleId: json['RuleId'] as String, + triggerEventSource: RuleTriggerEventSource.fromJson( + json['TriggerEventSource'] as Map), tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); } Map toJson() { - final defaultOutboundQueueId = this.defaultOutboundQueueId; - final description = this.description; - final instanceId = this.instanceId; - final mediaConcurrencies = this.mediaConcurrencies; + final actions = this.actions; + final createdTime = this.createdTime; + final function = this.function; + final lastUpdatedBy = this.lastUpdatedBy; + final lastUpdatedTime = this.lastUpdatedTime; final name = this.name; - final numberOfAssociatedQueues = this.numberOfAssociatedQueues; - final numberOfAssociatedUsers = this.numberOfAssociatedUsers; - final routingProfileArn = this.routingProfileArn; - final routingProfileId = this.routingProfileId; + final publishStatus = this.publishStatus; + final ruleArn = this.ruleArn; + final ruleId = this.ruleId; + final triggerEventSource = this.triggerEventSource; final tags = this.tags; return { - if (defaultOutboundQueueId != null) - 'DefaultOutboundQueueId': defaultOutboundQueueId, - if (description != null) 'Description': description, - if (instanceId != null) 'InstanceId': instanceId, - if (mediaConcurrencies != null) 'MediaConcurrencies': mediaConcurrencies, - if (name != null) 'Name': name, - if (numberOfAssociatedQueues != null) - 'NumberOfAssociatedQueues': numberOfAssociatedQueues, - if (numberOfAssociatedUsers != null) - 'NumberOfAssociatedUsers': numberOfAssociatedUsers, - if (routingProfileArn != null) 'RoutingProfileArn': routingProfileArn, - if (routingProfileId != null) 'RoutingProfileId': routingProfileId, + 'Actions': actions, + 'CreatedTime': unixTimestampToJson(createdTime), + 'Function': function, + 'LastUpdatedBy': lastUpdatedBy, + 'LastUpdatedTime': unixTimestampToJson(lastUpdatedTime), + 'Name': name, + 'PublishStatus': publishStatus.toValue(), + 'RuleArn': ruleArn, + 'RuleId': ruleId, + 'TriggerEventSource': triggerEventSource, if (tags != null) 'Tags': tags, }; } } -/// Contains information about the queue and channel for which priority and -/// delay can be set. -class RoutingProfileQueueConfig { - /// The delay, in seconds, a contact should be in the queue before they are - /// routed to an available agent. For more information, see Queues: - /// priority and delay in the Amazon Connect Administrator Guide. - final int delay; +/// Information about the action to be performed when a rule is triggered. +class RuleAction { + /// The type of action that creates a rule. + final ActionType actionType; - /// The order in which contacts are to be handled for the queue. For more - /// information, see Queues: - /// priority and delay. - final int priority; + /// Information about the contact category action. + /// + /// Supported only for TriggerEventSource values: + /// OnPostCallAnalysisAvailable | + /// OnRealTimeCallAnalysisAvailable | + /// OnRealTimeChatAnalysisAvailable | + /// OnPostChatAnalysisAvailable | + /// OnZendeskTicketCreate | + /// OnZendeskTicketStatusUpdate | + /// OnSalesforceCaseCreate + final AssignContactCategoryActionDefinition? assignContactCategoryAction; - /// Contains information about a queue resource. - final RoutingProfileQueueReference queueReference; + /// Information about the create case action. + /// + /// Supported only for TriggerEventSource values: + /// OnPostCallAnalysisAvailable | + /// OnPostChatAnalysisAvailable. + final CreateCaseActionDefinition? createCaseAction; - RoutingProfileQueueConfig({ - required this.delay, - required this.priority, - required this.queueReference, + /// Information about the end associated tasks action. + /// + /// Supported only for TriggerEventSource values: + /// OnCaseUpdate. + final EndAssociatedTasksActionDefinition? endAssociatedTasksAction; + + /// Information about the EventBridge action. + /// + /// Supported only for TriggerEventSource values: + /// OnPostCallAnalysisAvailable | + /// OnRealTimeCallAnalysisAvailable | + /// OnRealTimeChatAnalysisAvailable | + /// OnPostChatAnalysisAvailable | + /// OnContactEvaluationSubmit | OnMetricDataUpdate + final EventBridgeActionDefinition? eventBridgeAction; + + /// Information about the send notification action. + /// + /// Supported only for TriggerEventSource values: + /// OnPostCallAnalysisAvailable | + /// OnRealTimeCallAnalysisAvailable | + /// OnRealTimeChatAnalysisAvailable | + /// OnPostChatAnalysisAvailable | + /// OnContactEvaluationSubmit | OnMetricDataUpdate + final SendNotificationActionDefinition? sendNotificationAction; + + /// Information about the submit automated evaluation action. + final SubmitAutoEvaluationActionDefinition? submitAutoEvaluationAction; + + /// Information about the task action. This field is required if + /// TriggerEventSource is one of the following values: + /// OnZendeskTicketCreate | + /// OnZendeskTicketStatusUpdate | + /// OnSalesforceCaseCreate + final TaskActionDefinition? taskAction; + + /// Information about the update case action. + /// + /// Supported only for TriggerEventSource values: + /// OnCaseCreate | OnCaseUpdate. + final UpdateCaseActionDefinition? updateCaseAction; + + RuleAction({ + required this.actionType, + this.assignContactCategoryAction, + this.createCaseAction, + this.endAssociatedTasksAction, + this.eventBridgeAction, + this.sendNotificationAction, + this.submitAutoEvaluationAction, + this.taskAction, + this.updateCaseAction, }); + factory RuleAction.fromJson(Map json) { + return RuleAction( + actionType: (json['ActionType'] as String).toActionType(), + assignContactCategoryAction: json['AssignContactCategoryAction'] != null + ? AssignContactCategoryActionDefinition.fromJson( + json['AssignContactCategoryAction'] as Map) + : null, + createCaseAction: json['CreateCaseAction'] != null + ? CreateCaseActionDefinition.fromJson( + json['CreateCaseAction'] as Map) + : null, + endAssociatedTasksAction: json['EndAssociatedTasksAction'] != null + ? EndAssociatedTasksActionDefinition.fromJson( + json['EndAssociatedTasksAction'] as Map) + : null, + eventBridgeAction: json['EventBridgeAction'] != null + ? EventBridgeActionDefinition.fromJson( + json['EventBridgeAction'] as Map) + : null, + sendNotificationAction: json['SendNotificationAction'] != null + ? SendNotificationActionDefinition.fromJson( + json['SendNotificationAction'] as Map) + : null, + submitAutoEvaluationAction: json['SubmitAutoEvaluationAction'] != null + ? SubmitAutoEvaluationActionDefinition.fromJson( + json['SubmitAutoEvaluationAction'] as Map) + : null, + taskAction: json['TaskAction'] != null + ? TaskActionDefinition.fromJson( + json['TaskAction'] as Map) + : null, + updateCaseAction: json['UpdateCaseAction'] != null + ? UpdateCaseActionDefinition.fromJson( + json['UpdateCaseAction'] as Map) + : null, + ); + } + Map toJson() { - final delay = this.delay; - final priority = this.priority; - final queueReference = this.queueReference; + final actionType = this.actionType; + final assignContactCategoryAction = this.assignContactCategoryAction; + final createCaseAction = this.createCaseAction; + final endAssociatedTasksAction = this.endAssociatedTasksAction; + final eventBridgeAction = this.eventBridgeAction; + final sendNotificationAction = this.sendNotificationAction; + final submitAutoEvaluationAction = this.submitAutoEvaluationAction; + final taskAction = this.taskAction; + final updateCaseAction = this.updateCaseAction; return { - 'Delay': delay, - 'Priority': priority, - 'QueueReference': queueReference, + 'ActionType': actionType.toValue(), + if (assignContactCategoryAction != null) + 'AssignContactCategoryAction': assignContactCategoryAction, + if (createCaseAction != null) 'CreateCaseAction': createCaseAction, + if (endAssociatedTasksAction != null) + 'EndAssociatedTasksAction': endAssociatedTasksAction, + if (eventBridgeAction != null) 'EventBridgeAction': eventBridgeAction, + if (sendNotificationAction != null) + 'SendNotificationAction': sendNotificationAction, + if (submitAutoEvaluationAction != null) + 'SubmitAutoEvaluationAction': submitAutoEvaluationAction, + if (taskAction != null) 'TaskAction': taskAction, + if (updateCaseAction != null) 'UpdateCaseAction': updateCaseAction, }; } } -/// Contains summary information about a routing profile queue. -class RoutingProfileQueueConfigSummary { - /// The channels this queue supports. - final Channel channel; +enum RulePublishStatus { + draft, + published, +} - /// The delay, in seconds, that a contact should be in the queue before they are - /// routed to an available agent. For more information, see Queues: - /// priority and delay in the Amazon Connect Administrator Guide. - final int delay; +extension RulePublishStatusValueExtension on RulePublishStatus { + String toValue() { + switch (this) { + case RulePublishStatus.draft: + return 'DRAFT'; + case RulePublishStatus.published: + return 'PUBLISHED'; + } + } +} - /// The order in which contacts are to be handled for the queue. For more - /// information, see Queues: - /// priority and delay. - final int priority; +extension RulePublishStatusFromString on String { + RulePublishStatus toRulePublishStatus() { + switch (this) { + case 'DRAFT': + return RulePublishStatus.draft; + case 'PUBLISHED': + return RulePublishStatus.published; + } + throw Exception('$this is not known in enum RulePublishStatus'); + } +} - /// The Amazon Resource Name (ARN) of the queue. - final String queueArn; +/// A list of ActionTypes associated with a rule. +class RuleSummary { + /// A list of ActionTypes associated with a rule. + final List actionSummaries; - /// The identifier for the queue. - final String queueId; + /// The timestamp for when the rule was created. + final DateTime createdTime; - /// The name of the queue. - final String queueName; + /// The name of the event source. + final EventSourceName eventSourceName; - RoutingProfileQueueConfigSummary({ - required this.channel, - required this.delay, - required this.priority, - required this.queueArn, - required this.queueId, - required this.queueName, - }); + /// The timestamp for when the rule was last updated. + final DateTime lastUpdatedTime; - factory RoutingProfileQueueConfigSummary.fromJson(Map json) { - return RoutingProfileQueueConfigSummary( - channel: (json['Channel'] as String).toChannel(), - delay: json['Delay'] as int, - priority: json['Priority'] as int, - queueArn: json['QueueArn'] as String, - queueId: json['QueueId'] as String, - queueName: json['QueueName'] as String, - ); - } + /// The name of the rule. + final String name; - Map toJson() { - final channel = this.channel; - final delay = this.delay; - final priority = this.priority; - final queueArn = this.queueArn; - final queueId = this.queueId; - final queueName = this.queueName; - return { - 'Channel': channel.toValue(), - 'Delay': delay, - 'Priority': priority, - 'QueueArn': queueArn, - 'QueueId': queueId, - 'QueueName': queueName, - }; - } -} + /// The publish status of the rule. + final RulePublishStatus publishStatus; -/// Contains the channel and queue identifier for a routing profile. -class RoutingProfileQueueReference { - /// The channels agents can handle in the Contact Control Panel (CCP) for this - /// routing profile. - final Channel channel; + /// The Amazon Resource Name (ARN) of the rule. + final String ruleArn; - /// The identifier for the queue. - final String queueId; + /// A unique identifier for the rule. + final String ruleId; - RoutingProfileQueueReference({ - required this.channel, - required this.queueId, + RuleSummary({ + required this.actionSummaries, + required this.createdTime, + required this.eventSourceName, + required this.lastUpdatedTime, + required this.name, + required this.publishStatus, + required this.ruleArn, + required this.ruleId, }); + factory RuleSummary.fromJson(Map json) { + return RuleSummary( + actionSummaries: (json['ActionSummaries'] as List) + .whereNotNull() + .map((e) => ActionSummary.fromJson(e as Map)) + .toList(), + createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), + eventSourceName: (json['EventSourceName'] as String).toEventSourceName(), + lastUpdatedTime: + nonNullableTimeStampFromJson(json['LastUpdatedTime'] as Object), + name: json['Name'] as String, + publishStatus: (json['PublishStatus'] as String).toRulePublishStatus(), + ruleArn: json['RuleArn'] as String, + ruleId: json['RuleId'] as String, + ); + } + Map toJson() { - final channel = this.channel; - final queueId = this.queueId; + final actionSummaries = this.actionSummaries; + final createdTime = this.createdTime; + final eventSourceName = this.eventSourceName; + final lastUpdatedTime = this.lastUpdatedTime; + final name = this.name; + final publishStatus = this.publishStatus; + final ruleArn = this.ruleArn; + final ruleId = this.ruleId; return { - 'Channel': channel.toValue(), - 'QueueId': queueId, + 'ActionSummaries': actionSummaries, + 'CreatedTime': unixTimestampToJson(createdTime), + 'EventSourceName': eventSourceName.toValue(), + 'LastUpdatedTime': unixTimestampToJson(lastUpdatedTime), + 'Name': name, + 'PublishStatus': publishStatus.toValue(), + 'RuleArn': ruleArn, + 'RuleId': ruleId, }; } } -/// Information about the routing profile assigned to the user. -class RoutingProfileReference { - /// The Amazon Resource Name (ARN) of the routing profile. - final String? arn; +/// The name of the event source. This field is required if +/// TriggerEventSource is one of the following values: +/// OnZendeskTicketCreate | +/// OnZendeskTicketStatusUpdate | +/// OnSalesforceCaseCreate | OnContactEvaluationSubmit +/// | OnMetricDataUpdate. +class RuleTriggerEventSource { + /// The name of the event source. + final EventSourceName eventSourceName; - /// The identifier of the routing profile. - final String? id; + /// The identifier for the integration association. + final String? integrationAssociationId; - RoutingProfileReference({ - this.arn, - this.id, + RuleTriggerEventSource({ + required this.eventSourceName, + this.integrationAssociationId, }); - factory RoutingProfileReference.fromJson(Map json) { - return RoutingProfileReference( - arn: json['Arn'] as String?, - id: json['Id'] as String?, + factory RuleTriggerEventSource.fromJson(Map json) { + return RuleTriggerEventSource( + eventSourceName: (json['EventSourceName'] as String).toEventSourceName(), + integrationAssociationId: json['IntegrationAssociationId'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; + final eventSourceName = this.eventSourceName; + final integrationAssociationId = this.integrationAssociationId; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, + 'EventSourceName': eventSourceName.toValue(), + if (integrationAssociationId != null) + 'IntegrationAssociationId': integrationAssociationId, }; } } -/// The search criteria to be used to return routing profiles. -/// -/// The name and description fields support "contains" -/// queries with a minimum of 2 characters and a maximum of 25 characters. Any -/// queries with character lengths outside of this range will throw invalid -/// results. -/// -class RoutingProfileSearchCriteria { - /// A list of conditions which would be applied together with an AND condition. - final List? andConditions; +/// Information about the Amazon Simple Storage Service (Amazon S3) storage +/// type. +class S3Config { + /// The S3 bucket name. + final String bucketName; - /// A list of conditions which would be applied together with an OR condition. - final List? orConditions; - final StringCondition? stringCondition; + /// The S3 bucket prefix. + final String bucketPrefix; - RoutingProfileSearchCriteria({ - this.andConditions, - this.orConditions, - this.stringCondition, + /// The Amazon S3 encryption configuration. + final EncryptionConfig? encryptionConfig; + + S3Config({ + required this.bucketName, + required this.bucketPrefix, + this.encryptionConfig, }); + factory S3Config.fromJson(Map json) { + return S3Config( + bucketName: json['BucketName'] as String, + bucketPrefix: json['BucketPrefix'] as String, + encryptionConfig: json['EncryptionConfig'] != null + ? EncryptionConfig.fromJson( + json['EncryptionConfig'] as Map) + : null, + ); + } + Map toJson() { - final andConditions = this.andConditions; - final orConditions = this.orConditions; - final stringCondition = this.stringCondition; + final bucketName = this.bucketName; + final bucketPrefix = this.bucketPrefix; + final encryptionConfig = this.encryptionConfig; return { - if (andConditions != null) 'AndConditions': andConditions, - if (orConditions != null) 'OrConditions': orConditions, - if (stringCondition != null) 'StringCondition': stringCondition, + 'BucketName': bucketName, + 'BucketPrefix': bucketPrefix, + if (encryptionConfig != null) 'EncryptionConfig': encryptionConfig, }; } } -/// Filters to be applied to search results. -class RoutingProfileSearchFilter { - final ControlPlaneTagFilter? tagFilter; +class SearchAvailablePhoneNumbersResponse { + /// A list of available phone numbers that you can claim to your Amazon Connect + /// instance or traffic distribution group. + final List? availableNumbersList; - RoutingProfileSearchFilter({ - this.tagFilter, + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + SearchAvailablePhoneNumbersResponse({ + this.availableNumbersList, + this.nextToken, }); + factory SearchAvailablePhoneNumbersResponse.fromJson( + Map json) { + return SearchAvailablePhoneNumbersResponse( + availableNumbersList: (json['AvailableNumbersList'] as List?) + ?.whereNotNull() + .map( + (e) => AvailableNumberSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + Map toJson() { - final tagFilter = this.tagFilter; + final availableNumbersList = this.availableNumbersList; + final nextToken = this.nextToken; return { - if (tagFilter != null) 'TagFilter': tagFilter, + if (availableNumbersList != null) + 'AvailableNumbersList': availableNumbersList, + if (nextToken != null) 'NextToken': nextToken, }; } } -/// Contains summary information about a routing profile. -class RoutingProfileSummary { - /// The Amazon Resource Name (ARN) of the routing profile. - final String? arn; +class SearchContactFlowModulesResponse { + /// The total number of contact flows which matched your search query. + final int? approximateTotalCount; - /// The identifier of the routing profile. - final String? id; + /// The search criteria to be used to return contact flow modules. + final List? contactFlowModules; - /// The name of the routing profile. - final String? name; + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; - RoutingProfileSummary({ - this.arn, - this.id, - this.name, + SearchContactFlowModulesResponse({ + this.approximateTotalCount, + this.contactFlowModules, + this.nextToken, }); - factory RoutingProfileSummary.fromJson(Map json) { - return RoutingProfileSummary( - arn: json['Arn'] as String?, - id: json['Id'] as String?, - name: json['Name'] as String?, + factory SearchContactFlowModulesResponse.fromJson(Map json) { + return SearchContactFlowModulesResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + contactFlowModules: (json['ContactFlowModules'] as List?) + ?.whereNotNull() + .map((e) => ContactFlowModule.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, ); } Map toJson() { - final arn = this.arn; - final id = this.id; - final name = this.name; + final approximateTotalCount = this.approximateTotalCount; + final contactFlowModules = this.contactFlowModules; + final nextToken = this.nextToken; return { - if (arn != null) 'Arn': arn, - if (id != null) 'Id': id, - if (name != null) 'Name': name, + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (contactFlowModules != null) 'ContactFlowModules': contactFlowModules, + if (nextToken != null) 'NextToken': nextToken, }; } } -/// Information about a rule. -class Rule { - /// A list of actions to be run when the rule is triggered. - final List actions; +class SearchContactFlowsResponse { + /// The total number of contact flows which matched your search query. + final int? approximateTotalCount; - /// The timestamp for when the rule was created. - final DateTime createdTime; + /// Information about the contact flows. + final List? contactFlows; - /// The conditions of the rule. - final String function; + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; - /// The Amazon Resource Name (ARN) of the user who last updated the rule. - final String lastUpdatedBy; + SearchContactFlowsResponse({ + this.approximateTotalCount, + this.contactFlows, + this.nextToken, + }); - /// The timestamp for the when the rule was last updated. - final DateTime lastUpdatedTime; + factory SearchContactFlowsResponse.fromJson(Map json) { + return SearchContactFlowsResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + contactFlows: (json['ContactFlows'] as List?) + ?.whereNotNull() + .map((e) => ContactFlow.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } - /// The name of the rule. - final String name; + Map toJson() { + final approximateTotalCount = this.approximateTotalCount; + final contactFlows = this.contactFlows; + final nextToken = this.nextToken; + return { + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (contactFlows != null) 'ContactFlows': contactFlows, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} - /// The publish status of the rule. - final RulePublishStatus publishStatus; +enum SearchContactsMatchType { + matchAll, + matchAny, +} - /// The Amazon Resource Name (ARN) of the rule. - final String ruleArn; +extension SearchContactsMatchTypeValueExtension on SearchContactsMatchType { + String toValue() { + switch (this) { + case SearchContactsMatchType.matchAll: + return 'MATCH_ALL'; + case SearchContactsMatchType.matchAny: + return 'MATCH_ANY'; + } + } +} - /// A unique identifier for the rule. - final String ruleId; +extension SearchContactsMatchTypeFromString on String { + SearchContactsMatchType toSearchContactsMatchType() { + switch (this) { + case 'MATCH_ALL': + return SearchContactsMatchType.matchAll; + case 'MATCH_ANY': + return SearchContactsMatchType.matchAny; + } + throw Exception('$this is not known in enum SearchContactsMatchType'); + } +} - /// The event source to trigger the rule. - final RuleTriggerEventSource triggerEventSource; +class SearchContactsResponse { + /// Information about the contacts. + final List contacts; - /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. - final Map? tags; + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; - Rule({ - required this.actions, - required this.createdTime, - required this.function, - required this.lastUpdatedBy, - required this.lastUpdatedTime, - required this.name, - required this.publishStatus, - required this.ruleArn, - required this.ruleId, - required this.triggerEventSource, - this.tags, + /// The total number of contacts which matched your search query. + final int? totalCount; + + SearchContactsResponse({ + required this.contacts, + this.nextToken, + this.totalCount, }); - factory Rule.fromJson(Map json) { - return Rule( - actions: (json['Actions'] as List) + factory SearchContactsResponse.fromJson(Map json) { + return SearchContactsResponse( + contacts: (json['Contacts'] as List) .whereNotNull() - .map((e) => RuleAction.fromJson(e as Map)) + .map((e) => ContactSearchSummary.fromJson(e as Map)) .toList(), - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - function: json['Function'] as String, - lastUpdatedBy: json['LastUpdatedBy'] as String, - lastUpdatedTime: - nonNullableTimeStampFromJson(json['LastUpdatedTime'] as Object), - name: json['Name'] as String, - publishStatus: (json['PublishStatus'] as String).toRulePublishStatus(), - ruleArn: json['RuleArn'] as String, - ruleId: json['RuleId'] as String, - triggerEventSource: RuleTriggerEventSource.fromJson( - json['TriggerEventSource'] as Map), - tags: (json['Tags'] as Map?) - ?.map((k, e) => MapEntry(k, e as String)), + nextToken: json['NextToken'] as String?, + totalCount: json['TotalCount'] as int?, ); } Map toJson() { - final actions = this.actions; - final createdTime = this.createdTime; - final function = this.function; - final lastUpdatedBy = this.lastUpdatedBy; - final lastUpdatedTime = this.lastUpdatedTime; - final name = this.name; - final publishStatus = this.publishStatus; - final ruleArn = this.ruleArn; - final ruleId = this.ruleId; - final triggerEventSource = this.triggerEventSource; - final tags = this.tags; + final contacts = this.contacts; + final nextToken = this.nextToken; + final totalCount = this.totalCount; return { - 'Actions': actions, - 'CreatedTime': unixTimestampToJson(createdTime), - 'Function': function, - 'LastUpdatedBy': lastUpdatedBy, - 'LastUpdatedTime': unixTimestampToJson(lastUpdatedTime), - 'Name': name, - 'PublishStatus': publishStatus.toValue(), - 'RuleArn': ruleArn, - 'RuleId': ruleId, - 'TriggerEventSource': triggerEventSource, - if (tags != null) 'Tags': tags, + 'Contacts': contacts, + if (nextToken != null) 'NextToken': nextToken, + if (totalCount != null) 'TotalCount': totalCount, }; } } -/// Information about the action to be performed when a rule is triggered. -class RuleAction { - /// The type of action that creates a rule. - final ActionType actionType; - - /// Information about the contact category action. - final AssignContactCategoryActionDefinition? assignContactCategoryAction; - - /// Information about the EventBridge action. - final EventBridgeActionDefinition? eventBridgeAction; - - /// Information about the send notification action. - final SendNotificationActionDefinition? sendNotificationAction; +/// A structure of time range that you want to search results. +class SearchContactsTimeRange { + /// The end time of the time range. + final DateTime endTime; - /// Information about the task action. This field is required if - /// TriggerEventSource is one of the following values: - /// OnZendeskTicketCreate | - /// OnZendeskTicketStatusUpdate | - /// OnSalesforceCaseCreate - final TaskActionDefinition? taskAction; + /// The start time of the time range. + final DateTime startTime; - RuleAction({ - required this.actionType, - this.assignContactCategoryAction, - this.eventBridgeAction, - this.sendNotificationAction, - this.taskAction, - }); + /// The type of timestamp to search. + final SearchContactsTimeRangeType type; - factory RuleAction.fromJson(Map json) { - return RuleAction( - actionType: (json['ActionType'] as String).toActionType(), - assignContactCategoryAction: json['AssignContactCategoryAction'] != null - ? AssignContactCategoryActionDefinition.fromJson( - json['AssignContactCategoryAction'] as Map) - : null, - eventBridgeAction: json['EventBridgeAction'] != null - ? EventBridgeActionDefinition.fromJson( - json['EventBridgeAction'] as Map) - : null, - sendNotificationAction: json['SendNotificationAction'] != null - ? SendNotificationActionDefinition.fromJson( - json['SendNotificationAction'] as Map) - : null, - taskAction: json['TaskAction'] != null - ? TaskActionDefinition.fromJson( - json['TaskAction'] as Map) - : null, - ); - } + SearchContactsTimeRange({ + required this.endTime, + required this.startTime, + required this.type, + }); Map toJson() { - final actionType = this.actionType; - final assignContactCategoryAction = this.assignContactCategoryAction; - final eventBridgeAction = this.eventBridgeAction; - final sendNotificationAction = this.sendNotificationAction; - final taskAction = this.taskAction; + final endTime = this.endTime; + final startTime = this.startTime; + final type = this.type; return { - 'ActionType': actionType.toValue(), - if (assignContactCategoryAction != null) - 'AssignContactCategoryAction': assignContactCategoryAction, - if (eventBridgeAction != null) 'EventBridgeAction': eventBridgeAction, - if (sendNotificationAction != null) - 'SendNotificationAction': sendNotificationAction, - if (taskAction != null) 'TaskAction': taskAction, + 'EndTime': unixTimestampToJson(endTime), + 'StartTime': unixTimestampToJson(startTime), + 'Type': type.toValue(), }; } } -enum RulePublishStatus { - draft, - published, +enum SearchContactsTimeRangeType { + initiationTimestamp, + scheduledTimestamp, + connectedToAgentTimestamp, + disconnectTimestamp, } -extension RulePublishStatusValueExtension on RulePublishStatus { +extension SearchContactsTimeRangeTypeValueExtension + on SearchContactsTimeRangeType { String toValue() { switch (this) { - case RulePublishStatus.draft: - return 'DRAFT'; - case RulePublishStatus.published: - return 'PUBLISHED'; + case SearchContactsTimeRangeType.initiationTimestamp: + return 'INITIATION_TIMESTAMP'; + case SearchContactsTimeRangeType.scheduledTimestamp: + return 'SCHEDULED_TIMESTAMP'; + case SearchContactsTimeRangeType.connectedToAgentTimestamp: + return 'CONNECTED_TO_AGENT_TIMESTAMP'; + case SearchContactsTimeRangeType.disconnectTimestamp: + return 'DISCONNECT_TIMESTAMP'; } } } -extension RulePublishStatusFromString on String { - RulePublishStatus toRulePublishStatus() { +extension SearchContactsTimeRangeTypeFromString on String { + SearchContactsTimeRangeType toSearchContactsTimeRangeType() { switch (this) { - case 'DRAFT': - return RulePublishStatus.draft; - case 'PUBLISHED': - return RulePublishStatus.published; + case 'INITIATION_TIMESTAMP': + return SearchContactsTimeRangeType.initiationTimestamp; + case 'SCHEDULED_TIMESTAMP': + return SearchContactsTimeRangeType.scheduledTimestamp; + case 'CONNECTED_TO_AGENT_TIMESTAMP': + return SearchContactsTimeRangeType.connectedToAgentTimestamp; + case 'DISCONNECT_TIMESTAMP': + return SearchContactsTimeRangeType.disconnectTimestamp; } - throw Exception('$this is not known in enum RulePublishStatus'); + throw Exception('$this is not known in enum SearchContactsTimeRangeType'); } } -/// A list of ActionTypes associated with a rule. -class RuleSummary { - /// A list of ActionTypes associated with a rule. - final List actionSummaries; +/// A structure of search criteria to be used to return contacts. +class SearchCriteria { + /// The agent hierarchy groups of the agent at the time of handling the contact. + final AgentHierarchyGroups? agentHierarchyGroups; - /// The timestamp for when the rule was created. - final DateTime createdTime; + /// The identifiers of agents who handled the contacts. + final List? agentIds; - /// The name of the event source. - final EventSourceName eventSourceName; + /// The list of channels associated with contacts. + final List? channels; - /// The timestamp for when the rule was last updated. - final DateTime lastUpdatedTime; + /// Search criteria based on analysis outputs from Amazon Connect Contact Lens. + final ContactAnalysis? contactAnalysis; - /// The name of the rule. - final String name; + /// The list of initiation methods associated with contacts. + final List? initiationMethods; - /// The publish status of the rule. - final RulePublishStatus publishStatus; + /// The list of queue IDs associated with contacts. + final List? queueIds; - /// The Amazon Resource Name (ARN) of the rule. - final String ruleArn; + /// The search criteria based on user-defined contact attributes that have been + /// configured for contact search. For more information, see Search + /// by customer contact attributes in the Amazon Connect Administrator + /// Guide. + /// + /// To use SearchableContactAttributes in a search request, the + /// GetContactAttributes action is required to perform an API + /// request. For more information, see https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonconnect.html#amazonconnect-actions-as-permissionsActions + /// defined by Amazon Connect. + /// + final SearchableContactAttributes? searchableContactAttributes; - /// A unique identifier for the rule. - final String ruleId; + SearchCriteria({ + this.agentHierarchyGroups, + this.agentIds, + this.channels, + this.contactAnalysis, + this.initiationMethods, + this.queueIds, + this.searchableContactAttributes, + }); - RuleSummary({ - required this.actionSummaries, - required this.createdTime, - required this.eventSourceName, - required this.lastUpdatedTime, - required this.name, - required this.publishStatus, - required this.ruleArn, - required this.ruleId, + Map toJson() { + final agentHierarchyGroups = this.agentHierarchyGroups; + final agentIds = this.agentIds; + final channels = this.channels; + final contactAnalysis = this.contactAnalysis; + final initiationMethods = this.initiationMethods; + final queueIds = this.queueIds; + final searchableContactAttributes = this.searchableContactAttributes; + return { + if (agentHierarchyGroups != null) + 'AgentHierarchyGroups': agentHierarchyGroups, + if (agentIds != null) 'AgentIds': agentIds, + if (channels != null) + 'Channels': channels.map((e) => e.toValue()).toList(), + if (contactAnalysis != null) 'ContactAnalysis': contactAnalysis, + if (initiationMethods != null) + 'InitiationMethods': initiationMethods.map((e) => e.toValue()).toList(), + if (queueIds != null) 'QueueIds': queueIds, + if (searchableContactAttributes != null) + 'SearchableContactAttributes': searchableContactAttributes, + }; + } +} + +class SearchHoursOfOperationsResponse { + /// The total number of hours of operations which matched your search query. + final int? approximateTotalCount; + + /// Information about the hours of operations. + final List? hoursOfOperations; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + SearchHoursOfOperationsResponse({ + this.approximateTotalCount, + this.hoursOfOperations, + this.nextToken, }); - factory RuleSummary.fromJson(Map json) { - return RuleSummary( - actionSummaries: (json['ActionSummaries'] as List) - .whereNotNull() - .map((e) => ActionSummary.fromJson(e as Map)) + factory SearchHoursOfOperationsResponse.fromJson(Map json) { + return SearchHoursOfOperationsResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + hoursOfOperations: (json['HoursOfOperations'] as List?) + ?.whereNotNull() + .map((e) => HoursOfOperation.fromJson(e as Map)) .toList(), - createdTime: nonNullableTimeStampFromJson(json['CreatedTime'] as Object), - eventSourceName: (json['EventSourceName'] as String).toEventSourceName(), - lastUpdatedTime: - nonNullableTimeStampFromJson(json['LastUpdatedTime'] as Object), - name: json['Name'] as String, - publishStatus: (json['PublishStatus'] as String).toRulePublishStatus(), - ruleArn: json['RuleArn'] as String, - ruleId: json['RuleId'] as String, + nextToken: json['NextToken'] as String?, ); } Map toJson() { - final actionSummaries = this.actionSummaries; - final createdTime = this.createdTime; - final eventSourceName = this.eventSourceName; - final lastUpdatedTime = this.lastUpdatedTime; - final name = this.name; - final publishStatus = this.publishStatus; - final ruleArn = this.ruleArn; - final ruleId = this.ruleId; + final approximateTotalCount = this.approximateTotalCount; + final hoursOfOperations = this.hoursOfOperations; + final nextToken = this.nextToken; return { - 'ActionSummaries': actionSummaries, - 'CreatedTime': unixTimestampToJson(createdTime), - 'EventSourceName': eventSourceName.toValue(), - 'LastUpdatedTime': unixTimestampToJson(lastUpdatedTime), - 'Name': name, - 'PublishStatus': publishStatus.toValue(), - 'RuleArn': ruleArn, - 'RuleId': ruleId, + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (hoursOfOperations != null) 'HoursOfOperations': hoursOfOperations, + if (nextToken != null) 'NextToken': nextToken, }; } } -/// The name of the event source. This field is required if -/// TriggerEventSource is one of the following values: -/// OnZendeskTicketCreate | -/// OnZendeskTicketStatusUpdate | -/// OnSalesforceCaseCreate -class RuleTriggerEventSource { - /// The name of the event source. - final EventSourceName eventSourceName; +class SearchPredefinedAttributesResponse { + /// The approximate number of predefined attributes which matched your search + /// query. + final int? approximateTotalCount; - /// The identifier for the integration association. - final String? integrationAssociationId; + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + final String? nextToken; - RuleTriggerEventSource({ - required this.eventSourceName, - this.integrationAssociationId, + /// Predefined attributes matched by the search criteria. + final List? predefinedAttributes; + + SearchPredefinedAttributesResponse({ + this.approximateTotalCount, + this.nextToken, + this.predefinedAttributes, }); - factory RuleTriggerEventSource.fromJson(Map json) { - return RuleTriggerEventSource( - eventSourceName: (json['EventSourceName'] as String).toEventSourceName(), - integrationAssociationId: json['IntegrationAssociationId'] as String?, + factory SearchPredefinedAttributesResponse.fromJson( + Map json) { + return SearchPredefinedAttributesResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + nextToken: json['NextToken'] as String?, + predefinedAttributes: (json['PredefinedAttributes'] as List?) + ?.whereNotNull() + .map((e) => PredefinedAttribute.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final eventSourceName = this.eventSourceName; - final integrationAssociationId = this.integrationAssociationId; + final approximateTotalCount = this.approximateTotalCount; + final nextToken = this.nextToken; + final predefinedAttributes = this.predefinedAttributes; return { - 'EventSourceName': eventSourceName.toValue(), - if (integrationAssociationId != null) - 'IntegrationAssociationId': integrationAssociationId, + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (nextToken != null) 'NextToken': nextToken, + if (predefinedAttributes != null) + 'PredefinedAttributes': predefinedAttributes, }; } } -/// Information about the Amazon Simple Storage Service (Amazon S3) storage -/// type. -class S3Config { - /// The S3 bucket name. - final String bucketName; +class SearchPromptsResponse { + /// The total number of quick connects which matched your search query. + final int? approximateTotalCount; - /// The S3 bucket prefix. - final String bucketPrefix; + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; - /// The Amazon S3 encryption configuration. - final EncryptionConfig? encryptionConfig; + /// Information about the prompts. + final List? prompts; - S3Config({ - required this.bucketName, - required this.bucketPrefix, - this.encryptionConfig, + SearchPromptsResponse({ + this.approximateTotalCount, + this.nextToken, + this.prompts, }); - factory S3Config.fromJson(Map json) { - return S3Config( - bucketName: json['BucketName'] as String, - bucketPrefix: json['BucketPrefix'] as String, - encryptionConfig: json['EncryptionConfig'] != null - ? EncryptionConfig.fromJson( - json['EncryptionConfig'] as Map) - : null, + factory SearchPromptsResponse.fromJson(Map json) { + return SearchPromptsResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + nextToken: json['NextToken'] as String?, + prompts: (json['Prompts'] as List?) + ?.whereNotNull() + .map((e) => Prompt.fromJson(e as Map)) + .toList(), ); } Map toJson() { - final bucketName = this.bucketName; - final bucketPrefix = this.bucketPrefix; - final encryptionConfig = this.encryptionConfig; + final approximateTotalCount = this.approximateTotalCount; + final nextToken = this.nextToken; + final prompts = this.prompts; return { - 'BucketName': bucketName, - 'BucketPrefix': bucketPrefix, - if (encryptionConfig != null) 'EncryptionConfig': encryptionConfig, + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (nextToken != null) 'NextToken': nextToken, + if (prompts != null) 'Prompts': prompts, }; } } -class SearchAvailablePhoneNumbersResponse { - /// A list of available phone numbers that you can claim to your Amazon Connect - /// instance or traffic distribution group. - final List? availableNumbersList; +class SearchQueuesResponse { + /// The total number of queues which matched your search query. + final int? approximateTotalCount; /// If there are additional results, this is the token for the next set of /// results. final String? nextToken; - SearchAvailablePhoneNumbersResponse({ - this.availableNumbersList, + /// Information about the queues. + final List? queues; + + SearchQueuesResponse({ + this.approximateTotalCount, + this.nextToken, + this.queues, + }); + + factory SearchQueuesResponse.fromJson(Map json) { + return SearchQueuesResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + nextToken: json['NextToken'] as String?, + queues: (json['Queues'] as List?) + ?.whereNotNull() + .map((e) => Queue.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final approximateTotalCount = this.approximateTotalCount; + final nextToken = this.nextToken; + final queues = this.queues; + return { + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, + if (nextToken != null) 'NextToken': nextToken, + if (queues != null) 'Queues': queues, + }; + } +} + +class SearchQuickConnectsResponse { + /// The total number of quick connects which matched your search query. + final int? approximateTotalCount; + + /// If there are additional results, this is the token for the next set of + /// results. + final String? nextToken; + + /// Information about the quick connects. + final List? quickConnects; + + SearchQuickConnectsResponse({ + this.approximateTotalCount, this.nextToken, + this.quickConnects, }); - factory SearchAvailablePhoneNumbersResponse.fromJson( - Map json) { - return SearchAvailablePhoneNumbersResponse( - availableNumbersList: (json['AvailableNumbersList'] as List?) + factory SearchQuickConnectsResponse.fromJson(Map json) { + return SearchQuickConnectsResponse( + approximateTotalCount: json['ApproximateTotalCount'] as int?, + nextToken: json['NextToken'] as String?, + quickConnects: (json['QuickConnects'] as List?) ?.whereNotNull() - .map( - (e) => AvailableNumberSummary.fromJson(e as Map)) + .map((e) => QuickConnect.fromJson(e as Map)) .toList(), - nextToken: json['NextToken'] as String?, ); } Map toJson() { - final availableNumbersList = this.availableNumbersList; + final approximateTotalCount = this.approximateTotalCount; final nextToken = this.nextToken; + final quickConnects = this.quickConnects; return { - if (availableNumbersList != null) - 'AvailableNumbersList': availableNumbersList, + if (approximateTotalCount != null) + 'ApproximateTotalCount': approximateTotalCount, if (nextToken != null) 'NextToken': nextToken, + if (quickConnects != null) 'QuickConnects': quickConnects, }; } } -class SearchQueuesResponse { - /// The total number of queues which matched your search query. - final int? approximateTotalCount; - +class SearchResourceTagsResponse { /// If there are additional results, this is the token for the next set of /// results. final String? nextToken; - /// Information about the queues. - final List? queues; + /// A list of tags used in the Amazon Connect instance. + final List? tags; - SearchQueuesResponse({ - this.approximateTotalCount, + SearchResourceTagsResponse({ this.nextToken, - this.queues, + this.tags, }); - factory SearchQueuesResponse.fromJson(Map json) { - return SearchQueuesResponse( - approximateTotalCount: json['ApproximateTotalCount'] as int?, + factory SearchResourceTagsResponse.fromJson(Map json) { + return SearchResourceTagsResponse( nextToken: json['NextToken'] as String?, - queues: (json['Queues'] as List?) + tags: (json['Tags'] as List?) ?.whereNotNull() - .map((e) => Queue.fromJson(e as Map)) + .map((e) => TagSet.fromJson(e as Map)) .toList(), ); } Map toJson() { - final approximateTotalCount = this.approximateTotalCount; final nextToken = this.nextToken; - final queues = this.queues; + final tags = this.tags; return { - if (approximateTotalCount != null) - 'ApproximateTotalCount': approximateTotalCount, if (nextToken != null) 'NextToken': nextToken, - if (queues != null) 'Queues': queues, + if (tags != null) 'Tags': tags, }; } } @@ -22358,6 +32849,56 @@ class SearchVocabulariesResponse { } } +/// A structure that defines search criteria based on user-defined contact +/// attributes that are configured for contact search. +class SearchableContactAttributes { + /// The list of criteria based on user-defined contact attributes that are + /// configured for contact search. + final List criteria; + + /// The match type combining search criteria using multiple searchable contact + /// attributes. + final SearchContactsMatchType? matchType; + + SearchableContactAttributes({ + required this.criteria, + this.matchType, + }); + + Map toJson() { + final criteria = this.criteria; + final matchType = this.matchType; + return { + 'Criteria': criteria, + if (matchType != null) 'MatchType': matchType.toValue(), + }; + } +} + +/// The search criteria based on user-defned contact attribute key and values to +/// search on. +class SearchableContactAttributesCriteria { + /// The key containing a searchable user-defined contact attribute. + final String key; + + /// The list of values to search for within a user-defined contact attribute. + final List values; + + SearchableContactAttributesCriteria({ + required this.key, + required this.values, + }); + + Map toJson() { + final key = this.key; + final values = this.values; + return { + 'Key': key, + 'Values': values, + }; + } +} + enum SearchableQueueType { standard, } @@ -22422,6 +32963,10 @@ class SecurityKey { /// Contains information about a security profile. class SecurityProfile { + /// The identifier of the hierarchy group that a security profile uses to + /// restrict access to resources in Amazon Connect. + final String? allowedAccessControlHierarchyGroupId; + /// The list of tags that a security profile uses to restrict access to /// resources in Amazon Connect. final Map? allowedAccessControlTags; @@ -22432,9 +32977,20 @@ class SecurityProfile { /// The description of the security profile. final String? description; + /// The list of resources that a security profile applies hierarchy restrictions + /// to in Amazon Connect. Following are acceptable ResourceNames: + /// User. + final List? hierarchyRestrictedResources; + /// The identifier for the security profile. final String? id; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + /// The organization resource identifier for the security profile. final String? organizationResourceId; @@ -22446,14 +33002,18 @@ class SecurityProfile { final List? tagRestrictedResources; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; SecurityProfile({ + this.allowedAccessControlHierarchyGroupId, this.allowedAccessControlTags, this.arn, this.description, + this.hierarchyRestrictedResources, this.id, + this.lastModifiedRegion, + this.lastModifiedTime, this.organizationResourceId, this.securityProfileName, this.tagRestrictedResources, @@ -22462,12 +33022,21 @@ class SecurityProfile { factory SecurityProfile.fromJson(Map json) { return SecurityProfile( + allowedAccessControlHierarchyGroupId: + json['AllowedAccessControlHierarchyGroupId'] as String?, allowedAccessControlTags: (json['AllowedAccessControlTags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), arn: json['Arn'] as String?, description: json['Description'] as String?, + hierarchyRestrictedResources: + (json['HierarchyRestrictedResources'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), organizationResourceId: json['OrganizationResourceId'] as String?, securityProfileName: json['SecurityProfileName'] as String?, tagRestrictedResources: (json['TagRestrictedResources'] as List?) @@ -22480,20 +33049,33 @@ class SecurityProfile { } Map toJson() { + final allowedAccessControlHierarchyGroupId = + this.allowedAccessControlHierarchyGroupId; final allowedAccessControlTags = this.allowedAccessControlTags; final arn = this.arn; final description = this.description; + final hierarchyRestrictedResources = this.hierarchyRestrictedResources; final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; final organizationResourceId = this.organizationResourceId; final securityProfileName = this.securityProfileName; final tagRestrictedResources = this.tagRestrictedResources; final tags = this.tags; return { + if (allowedAccessControlHierarchyGroupId != null) + 'AllowedAccessControlHierarchyGroupId': + allowedAccessControlHierarchyGroupId, if (allowedAccessControlTags != null) 'AllowedAccessControlTags': allowedAccessControlTags, if (arn != null) 'Arn': arn, if (description != null) 'Description': description, + if (hierarchyRestrictedResources != null) + 'HierarchyRestrictedResources': hierarchyRestrictedResources, if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), if (organizationResourceId != null) 'OrganizationResourceId': organizationResourceId, if (securityProfileName != null) @@ -22555,7 +33137,7 @@ class SecurityProfileSearchSummary { final String? securityProfileName; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; SecurityProfileSearchSummary({ @@ -22607,12 +33189,20 @@ class SecurityProfileSummary { /// The identifier of the security profile. final String? id; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + /// The name of the security profile. final String? name; SecurityProfileSummary({ this.arn, this.id, + this.lastModifiedRegion, + this.lastModifiedTime, this.name, }); @@ -22620,6 +33210,8 @@ class SecurityProfileSummary { return SecurityProfileSummary( arn: json['Arn'] as String?, id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), name: json['Name'] as String?, ); } @@ -22627,10 +33219,15 @@ class SecurityProfileSummary { Map toJson() { final arn = this.arn; final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; final name = this.name; return { if (arn != null) 'Arn': arn, if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), if (name != null) 'Name': name, }; } @@ -22652,6 +33249,62 @@ class SecurityProfilesSearchFilter { } } +/// A value for a segment attribute. This is structured as a map where the key +/// is valueString and the value is a string. +class SegmentAttributeValue { + /// The value of a segment attribute. + final String? valueString; + + SegmentAttributeValue({ + this.valueString, + }); + + factory SegmentAttributeValue.fromJson(Map json) { + return SegmentAttributeValue( + valueString: json['ValueString'] as String?, + ); + } + + Map toJson() { + final valueString = this.valueString; + return { + if (valueString != null) 'ValueString': valueString, + }; + } +} + +class SendChatIntegrationEventResponse { + /// Identifier of chat contact used to handle integration event. This may be + /// null if the integration event is not valid without an already existing chat + /// contact. + final String? initialContactId; + + /// Whether handling the integration event resulted in creating a new chat or + /// acting on existing chat. + final bool? newChatCreated; + + SendChatIntegrationEventResponse({ + this.initialContactId, + this.newChatCreated, + }); + + factory SendChatIntegrationEventResponse.fromJson(Map json) { + return SendChatIntegrationEventResponse( + initialContactId: json['InitialContactId'] as String?, + newChatCreated: json['NewChatCreated'] as bool?, + ); + } + + Map toJson() { + final initialContactId = this.initialContactId; + final newChatCreated = this.newChatCreated; + return { + if (initialContactId != null) 'InitialContactId': initialContactId, + if (newChatCreated != null) 'NewChatCreated': newChatCreated, + }; + } +} + /// Information about the send notification action. class SendNotificationActionDefinition { /// Notification content. Supports variable injection. For more information, see @@ -22711,6 +33364,63 @@ class SendNotificationActionDefinition { } } +/// The distribution that determines which Amazon Web Services Regions should be +/// used to sign in agents in to both the instance and its replica(s). +class SignInConfig { + /// Information about traffic distributions. + final List distributions; + + SignInConfig({ + required this.distributions, + }); + + factory SignInConfig.fromJson(Map json) { + return SignInConfig( + distributions: (json['Distributions'] as List) + .whereNotNull() + .map((e) => SignInDistribution.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final distributions = this.distributions; + return { + 'Distributions': distributions, + }; + } +} + +/// The distribution of sign in traffic between the instance and its replica(s). +class SignInDistribution { + /// Whether sign in distribution is enabled. + final bool enabled; + + /// The Amazon Web Services Region of the sign in distribution. + final String region; + + SignInDistribution({ + required this.enabled, + required this.region, + }); + + factory SignInDistribution.fromJson(Map json) { + return SignInDistribution( + enabled: json['Enabled'] as bool, + region: json['Region'] as String, + ); + } + + Map toJson() { + final enabled = this.enabled; + final region = this.region; + return { + 'Enabled': enabled, + 'Region': region, + }; + } +} + /// Information about the automation option based on a rule category for a /// single select question. class SingleSelectQuestionRuleCategoryAutomation { @@ -22787,6 +33497,29 @@ extension SingleSelectQuestionRuleCategoryAutomationConditionFromString } } +/// A structure that defineds the field name to sort by and a sort order. +class Sort { + /// The name of the field on which to sort. + final SortableFieldName fieldName; + + /// An ascending or descending sort. + final SortOrder order; + + Sort({ + required this.fieldName, + required this.order, + }); + + Map toJson() { + final fieldName = this.fieldName; + final order = this.order; + return { + 'FieldName': fieldName.toValue(), + 'Order': order.toValue(), + }; + } +} + enum SortOrder { ascending, descending, @@ -22815,9 +33548,58 @@ extension SortOrderFromString on String { } } +enum SortableFieldName { + initiationTimestamp, + scheduledTimestamp, + connectedToAgentTimestamp, + disconnectTimestamp, + initiationMethod, + channel, +} + +extension SortableFieldNameValueExtension on SortableFieldName { + String toValue() { + switch (this) { + case SortableFieldName.initiationTimestamp: + return 'INITIATION_TIMESTAMP'; + case SortableFieldName.scheduledTimestamp: + return 'SCHEDULED_TIMESTAMP'; + case SortableFieldName.connectedToAgentTimestamp: + return 'CONNECTED_TO_AGENT_TIMESTAMP'; + case SortableFieldName.disconnectTimestamp: + return 'DISCONNECT_TIMESTAMP'; + case SortableFieldName.initiationMethod: + return 'INITIATION_METHOD'; + case SortableFieldName.channel: + return 'CHANNEL'; + } + } +} + +extension SortableFieldNameFromString on String { + SortableFieldName toSortableFieldName() { + switch (this) { + case 'INITIATION_TIMESTAMP': + return SortableFieldName.initiationTimestamp; + case 'SCHEDULED_TIMESTAMP': + return SortableFieldName.scheduledTimestamp; + case 'CONNECTED_TO_AGENT_TIMESTAMP': + return SortableFieldName.connectedToAgentTimestamp; + case 'DISCONNECT_TIMESTAMP': + return SortableFieldName.disconnectTimestamp; + case 'INITIATION_METHOD': + return SortableFieldName.initiationMethod; + case 'CHANNEL': + return SortableFieldName.channel; + } + throw Exception('$this is not known in enum SortableFieldName'); + } +} + enum SourceType { salesforce, zendesk, + cases, } extension SourceTypeValueExtension on SourceType { @@ -22827,6 +33609,8 @@ extension SourceTypeValueExtension on SourceType { return 'SALESFORCE'; case SourceType.zendesk: return 'ZENDESK'; + case SourceType.cases: + return 'CASES'; } } } @@ -22838,11 +33622,78 @@ extension SourceTypeFromString on String { return SourceType.salesforce; case 'ZENDESK': return SourceType.zendesk; + case 'CASES': + return SourceType.cases; } throw Exception('$this is not known in enum SourceType'); } } +/// Response from StartAttachedFileUpload API. +class StartAttachedFileUploadResponse { + /// Represents the identity that created the file. + final CreatedByInfo? createdBy; + + /// The time of Creation of the file resource as an ISO timestamp. It's + /// specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For + /// example, 2024-05-03T02:41:28.172Z. + final String? creationTime; + + /// The unique identifier of the attached file resource (ARN). + final String? fileArn; + + /// The unique identifier of the attached file resource. + final String? fileId; + + /// The current status of the attached file. + final FileStatusType? fileStatus; + + /// Information to be used while uploading the attached file. + final UploadUrlMetadata? uploadUrlMetadata; + + StartAttachedFileUploadResponse({ + this.createdBy, + this.creationTime, + this.fileArn, + this.fileId, + this.fileStatus, + this.uploadUrlMetadata, + }); + + factory StartAttachedFileUploadResponse.fromJson(Map json) { + return StartAttachedFileUploadResponse( + createdBy: json['CreatedBy'] != null + ? CreatedByInfo.fromJson(json['CreatedBy'] as Map) + : null, + creationTime: json['CreationTime'] as String?, + fileArn: json['FileArn'] as String?, + fileId: json['FileId'] as String?, + fileStatus: (json['FileStatus'] as String?)?.toFileStatusType(), + uploadUrlMetadata: json['UploadUrlMetadata'] != null + ? UploadUrlMetadata.fromJson( + json['UploadUrlMetadata'] as Map) + : null, + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final creationTime = this.creationTime; + final fileArn = this.fileArn; + final fileId = this.fileId; + final fileStatus = this.fileStatus; + final uploadUrlMetadata = this.uploadUrlMetadata; + return { + if (createdBy != null) 'CreatedBy': createdBy, + if (creationTime != null) 'CreationTime': creationTime, + if (fileArn != null) 'FileArn': fileArn, + if (fileId != null) 'FileId': fileId, + if (fileStatus != null) 'FileStatus': fileStatus.toValue(), + if (uploadUrlMetadata != null) 'UploadUrlMetadata': uploadUrlMetadata, + }; + } +} + class StartChatContactResponse { /// The identifier of this contact within the Amazon Connect instance. final String? contactId; @@ -22999,6 +33850,57 @@ class StartTaskContactResponse { } } +class StartWebRTCContactResponse { + /// Information required for the client application (mobile application or + /// website) to connect to the call. + final ConnectionData? connectionData; + + /// The identifier of the contact in this instance of Amazon Connect. + final String? contactId; + + /// The identifier for a contact participant. The ParticipantId for + /// a contact participant is the same throughout the contact lifecycle. + final String? participantId; + + /// The token used by the contact participant to call the CreateParticipantConnection + /// API. The participant token is valid for the lifetime of a contact + /// participant. + final String? participantToken; + + StartWebRTCContactResponse({ + this.connectionData, + this.contactId, + this.participantId, + this.participantToken, + }); + + factory StartWebRTCContactResponse.fromJson(Map json) { + return StartWebRTCContactResponse( + connectionData: json['ConnectionData'] != null + ? ConnectionData.fromJson( + json['ConnectionData'] as Map) + : null, + contactId: json['ContactId'] as String?, + participantId: json['ParticipantId'] as String?, + participantToken: json['ParticipantToken'] as String?, + ); + } + + Map toJson() { + final connectionData = this.connectionData; + final contactId = this.contactId; + final participantId = this.participantId; + final participantToken = this.participantToken; + return { + if (connectionData != null) 'ConnectionData': connectionData, + if (contactId != null) 'ContactId': contactId, + if (participantId != null) 'ParticipantId': participantId, + if (participantToken != null) 'ParticipantToken': participantToken, + }; + } +} + enum Statistic { sum, max, @@ -23018,17 +33920,58 @@ extension StatisticValueExtension on Statistic { } } -extension StatisticFromString on String { - Statistic toStatistic() { - switch (this) { - case 'SUM': - return Statistic.sum; - case 'MAX': - return Statistic.max; - case 'AVG': - return Statistic.avg; - } - throw Exception('$this is not known in enum Statistic'); +extension StatisticFromString on String { + Statistic toStatistic() { + switch (this) { + case 'SUM': + return Statistic.sum; + case 'MAX': + return Statistic.max; + case 'AVG': + return Statistic.avg; + } + throw Exception('$this is not known in enum Statistic'); + } +} + +/// Step signifies the criteria to be used for routing to an agent +class Step { + /// An object to specify the expiration of a routing step. + final Expiry? expiry; + + /// A tagged union to specify expression for a routing step. + final Expression? expression; + + /// Represents status of the Routing step. + final RoutingCriteriaStepStatus? status; + + Step({ + this.expiry, + this.expression, + this.status, + }); + + factory Step.fromJson(Map json) { + return Step( + expiry: json['Expiry'] != null + ? Expiry.fromJson(json['Expiry'] as Map) + : null, + expression: json['Expression'] != null + ? Expression.fromJson(json['Expression'] as Map) + : null, + status: (json['Status'] as String?)?.toRoutingCriteriaStepStatus(), + ); + } + + Map toJson() { + final expiry = this.expiry; + final expression = this.expression; + final status = this.status; + return { + if (expiry != null) 'Expiry': expiry, + if (expression != null) 'Expression': expression, + if (status != null) 'Status': status.toValue(), + }; } } @@ -23141,7 +34084,8 @@ extension StringComparisonTypeFromString on String { /// A leaf node condition which can be used to specify a string condition. /// -/// The currently supported value for FieldName: name +/// The currently supported values for FieldName are +/// name and description. /// class StringCondition { /// The type of comparison to be made when evaluating the string condition. @@ -23202,6 +34146,30 @@ class StringReference { } } +/// Information about the submit automated evaluation action. +class SubmitAutoEvaluationActionDefinition { + /// The identifier of the auto-evaluation enabled form. + final String evaluationFormId; + + SubmitAutoEvaluationActionDefinition({ + required this.evaluationFormId, + }); + + factory SubmitAutoEvaluationActionDefinition.fromJson( + Map json) { + return SubmitAutoEvaluationActionDefinition( + evaluationFormId: json['EvaluationFormId'] as String, + ); + } + + Map toJson() { + final evaluationFormId = this.evaluationFormId; + return { + 'EvaluationFormId': evaluationFormId, + }; + } +} + class SubmitContactEvaluationResponse { /// The Amazon Resource Name (ARN) for the contact evaluation resource. final String evaluationArn; @@ -23231,6 +34199,37 @@ class SubmitContactEvaluationResponse { } } +/// Request for which contact was successfully created. +class SuccessfulRequest { + /// The contactId of the contact that was created successfully. + final String? contactId; + + /// Request identifier provided in the API call in the ContactDataRequest to + /// create a contact. + final String? requestIdentifier; + + SuccessfulRequest({ + this.contactId, + this.requestIdentifier, + }); + + factory SuccessfulRequest.fromJson(Map json) { + return SuccessfulRequest( + contactId: json['ContactId'] as String?, + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final contactId = this.contactId; + final requestIdentifier = this.requestIdentifier; + return { + if (contactId != null) 'ContactId': contactId, + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + class SuspendContactRecordingResponse { SuspendContactRecordingResponse(); @@ -23267,6 +34266,87 @@ class TagCondition { } } +class TagContactResponse { + TagContactResponse(); + + factory TagContactResponse.fromJson(Map _) { + return TagContactResponse(); + } + + Map toJson() { + return {}; + } +} + +/// The search criteria to be used to return tags. +class TagSearchCondition { + /// The tag key used in the tag search condition. + final String? tagKey; + + /// The type of comparison to be made when evaluating the tag key in tag search + /// condition. + final StringComparisonType? tagKeyComparisonType; + + /// The tag value used in the tag search condition. + final String? tagValue; + + /// The type of comparison to be made when evaluating the tag value in tag + /// search condition. + final StringComparisonType? tagValueComparisonType; + + TagSearchCondition({ + this.tagKey, + this.tagKeyComparisonType, + this.tagValue, + this.tagValueComparisonType, + }); + + Map toJson() { + final tagKey = this.tagKey; + final tagKeyComparisonType = this.tagKeyComparisonType; + final tagValue = this.tagValue; + final tagValueComparisonType = this.tagValueComparisonType; + return { + if (tagKey != null) 'tagKey': tagKey, + if (tagKeyComparisonType != null) + 'tagKeyComparisonType': tagKeyComparisonType.toValue(), + if (tagValue != null) 'tagValue': tagValue, + if (tagValueComparisonType != null) + 'tagValueComparisonType': tagValueComparisonType.toValue(), + }; + } +} + +/// A tag set contains tag key and tag value. +class TagSet { + /// The tag key in the tagSet. + final String? key; + + /// The tag value in the tagSet. + final String? value; + + TagSet({ + this.key, + this.value, + }); + + factory TagSet.fromJson(Map json) { + return TagSet( + key: json['key'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + if (key != null) 'key': key, + if (value != null) 'value': value, + }; + } +} + /// Information about the task action. class TaskActionDefinition { /// The identifier of the flow. @@ -23803,6 +34883,23 @@ class TrafficDistributionGroup { /// The Amazon Resource Name (ARN). final String? instanceArn; + /// Whether this is the default traffic distribution group created during + /// instance replication. The default traffic distribution group cannot be + /// deleted by the DeleteTrafficDistributionGroup API. The default + /// traffic distribution group is deleted as part of the process for deleting a + /// replica. + /// + /// The SignInConfig distribution is available only on a default + /// TrafficDistributionGroup (see the IsDefault + /// parameter in the TrafficDistributionGroup + /// data type). If you call UpdateTrafficDistribution with a + /// modified SignInConfig and a non-default + /// TrafficDistributionGroup, an + /// InvalidRequestException is returned. + /// + final bool? isDefault; + /// The name of the traffic distribution group. final String? name; @@ -23836,14 +34933,14 @@ class TrafficDistributionGroup { ///
    • ///
    • /// UPDATE_IN_PROGRESS means the previous UpdateTrafficDistributionGroup + /// href="https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdateTrafficDistribution.html">UpdateTrafficDistribution /// operation is still in progress and has not yet completed. ///
    • ///
    final TrafficDistributionGroupStatus? status; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; TrafficDistributionGroup({ @@ -23851,6 +34948,7 @@ class TrafficDistributionGroup { this.description, this.id, this.instanceArn, + this.isDefault, this.name, this.status, this.tags, @@ -23862,6 +34960,7 @@ class TrafficDistributionGroup { description: json['Description'] as String?, id: json['Id'] as String?, instanceArn: json['InstanceArn'] as String?, + isDefault: json['IsDefault'] as bool?, name: json['Name'] as String?, status: (json['Status'] as String?)?.toTrafficDistributionGroupStatus(), tags: (json['Tags'] as Map?) @@ -23874,6 +34973,7 @@ class TrafficDistributionGroup { final description = this.description; final id = this.id; final instanceArn = this.instanceArn; + final isDefault = this.isDefault; final name = this.name; final status = this.status; final tags = this.tags; @@ -23882,6 +34982,7 @@ class TrafficDistributionGroup { if (description != null) 'Description': description, if (id != null) 'Id': id, if (instanceArn != null) 'InstanceArn': instanceArn, + if (isDefault != null) 'IsDefault': isDefault, if (name != null) 'Name': name, if (status != null) 'Status': status.toValue(), if (tags != null) 'Tags': tags, @@ -23953,6 +35054,13 @@ class TrafficDistributionGroupSummary { /// The Amazon Resource Name (ARN) of the traffic distribution group. final String? instanceArn; + /// Whether this is the default traffic distribution group created during + /// instance replication. The default traffic distribution group cannot be + /// deleted by the DeleteTrafficDistributionGroup API. The default + /// traffic distribution group is deleted as part of the process for deleting a + /// replica. + final bool? isDefault; + /// The name of the traffic distribution group. final String? name; @@ -23996,6 +35104,7 @@ class TrafficDistributionGroupSummary { this.arn, this.id, this.instanceArn, + this.isDefault, this.name, this.status, }); @@ -24005,6 +35114,7 @@ class TrafficDistributionGroupSummary { arn: json['Arn'] as String?, id: json['Id'] as String?, instanceArn: json['InstanceArn'] as String?, + isDefault: json['IsDefault'] as bool?, name: json['Name'] as String?, status: (json['Status'] as String?)?.toTrafficDistributionGroupStatus(), ); @@ -24014,18 +35124,44 @@ class TrafficDistributionGroupSummary { final arn = this.arn; final id = this.id; final instanceArn = this.instanceArn; + final isDefault = this.isDefault; final name = this.name; final status = this.status; return { if (arn != null) 'Arn': arn, if (id != null) 'Id': id, if (instanceArn != null) 'InstanceArn': instanceArn, + if (isDefault != null) 'IsDefault': isDefault, if (name != null) 'Name': name, if (status != null) 'Status': status.toValue(), }; } } +/// Summary information about a traffic distribution group user. +class TrafficDistributionGroupUserSummary { + /// The identifier for the user. This can be the ID or the ARN of the user. + final String? userId; + + TrafficDistributionGroupUserSummary({ + this.userId, + }); + + factory TrafficDistributionGroupUserSummary.fromJson( + Map json) { + return TrafficDistributionGroupUserSummary( + userId: json['UserId'] as String?, + ); + } + + Map toJson() { + final userId = this.userId; + return { + if (userId != null) 'UserId': userId, + }; + } +} + enum TrafficType { general, campaign, @@ -24054,6 +35190,63 @@ extension TrafficTypeFromString on String { } } +/// A structure that defines search criteria and matching logic to search for +/// contacts by matching text with transcripts analyzed by Amazon Connect +/// Contact Lens. +class Transcript { + /// The list of search criteria based on Contact Lens conversational analytics + /// transcript. + final List criteria; + + /// The match type combining search criteria using multiple transcript criteria. + final SearchContactsMatchType? matchType; + + Transcript({ + required this.criteria, + this.matchType, + }); + + Map toJson() { + final criteria = this.criteria; + final matchType = this.matchType; + return { + 'Criteria': criteria, + if (matchType != null) 'MatchType': matchType.toValue(), + }; + } +} + +/// A structure that defines search criteria base on words or phrases, +/// participants in the Contact Lens conversational analytics transcript. +class TranscriptCriteria { + /// The match type combining search criteria using multiple search texts in a + /// transcript criteria. + final SearchContactsMatchType matchType; + + /// The participant role in a transcript + final ParticipantRole participantRole; + + /// The words or phrases used to search within a transcript. + final List searchText; + + TranscriptCriteria({ + required this.matchType, + required this.participantRole, + required this.searchText, + }); + + Map toJson() { + final matchType = this.matchType; + final participantRole = this.participantRole; + final searchText = this.searchText; + return { + 'MatchType': matchType.toValue(), + 'ParticipantRole': participantRole.toValue(), + 'SearchText': searchText, + }; + } +} + class TransferContactResponse { /// The Amazon Resource Name (ARN) of the contact. final String? contactArn; @@ -24116,6 +35309,44 @@ extension UnitFromString on String { } } +class UntagContactResponse { + UntagContactResponse(); + + factory UntagContactResponse.fromJson(Map _) { + return UntagContactResponse(); + } + + Map toJson() { + return {}; + } +} + +/// The UpdateCase action definition. +class UpdateCaseActionDefinition { + /// An array of objects with Field ID and Value data. + final List fields; + + UpdateCaseActionDefinition({ + required this.fields, + }); + + factory UpdateCaseActionDefinition.fromJson(Map json) { + return UpdateCaseActionDefinition( + fields: (json['Fields'] as List) + .whereNotNull() + .map((e) => FieldValue.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final fields = this.fields; + return { + 'Fields': fields, + }; + } +} + class UpdateContactAttributesResponse { UpdateContactAttributesResponse(); @@ -24231,6 +35462,18 @@ class UpdateContactResponse { } } +class UpdateContactRoutingDataResponse { + UpdateContactRoutingDataResponse(); + + factory UpdateContactRoutingDataResponse.fromJson(Map _) { + return UpdateContactRoutingDataResponse(); + } + + Map toJson() { + return {}; + } +} + class UpdateContactScheduleResponse { UpdateContactScheduleResponse(); @@ -24494,6 +35737,83 @@ class UpdateTrafficDistributionResponse { } } +class UpdateViewContentResponse { + /// A view resource object. Contains metadata and content necessary to render + /// the view. + final View? view; + + UpdateViewContentResponse({ + this.view, + }); + + factory UpdateViewContentResponse.fromJson(Map json) { + return UpdateViewContentResponse( + view: json['View'] != null + ? View.fromJson(json['View'] as Map) + : null, + ); + } + + Map toJson() { + final view = this.view; + return { + if (view != null) 'View': view, + }; + } +} + +class UpdateViewMetadataResponse { + UpdateViewMetadataResponse(); + + factory UpdateViewMetadataResponse.fromJson(Map _) { + return UpdateViewMetadataResponse(); + } + + Map toJson() { + return {}; + } +} + +/// Fields required when uploading an attached file. +class UploadUrlMetadata { + /// A map of headers that should be provided when uploading the attached file. + final Map? headersToInclude; + + /// A pre-signed S3 URL that should be used for uploading the attached file. + final String? url; + + /// The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 + /// format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, + /// 2019-11-08T02:41:28.172Z. + final String? urlExpiry; + + UploadUrlMetadata({ + this.headersToInclude, + this.url, + this.urlExpiry, + }); + + factory UploadUrlMetadata.fromJson(Map json) { + return UploadUrlMetadata( + headersToInclude: (json['HeadersToInclude'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + url: json['Url'] as String?, + urlExpiry: json['UrlExpiry'] as String?, + ); + } + + Map toJson() { + final headersToInclude = this.headersToInclude; + final url = this.url; + final urlExpiry = this.urlExpiry; + return { + if (headersToInclude != null) 'HeadersToInclude': headersToInclude, + if (url != null) 'Url': url, + if (urlExpiry != null) 'UrlExpiry': urlExpiry, + }; + } +} + /// The URL reference. class UrlReference { /// Identifier of the URL reference. @@ -24608,6 +35928,12 @@ class User { /// Information about the user identity. final UserIdentityInfo? identityInfo; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + /// Information about the phone configuration for the user. final UserPhoneConfig? phoneConfig; @@ -24629,6 +35955,8 @@ class User { this.hierarchyGroupId, this.id, this.identityInfo, + this.lastModifiedRegion, + this.lastModifiedTime, this.phoneConfig, this.routingProfileId, this.securityProfileIds, @@ -24646,6 +35974,8 @@ class User { ? UserIdentityInfo.fromJson( json['IdentityInfo'] as Map) : null, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), phoneConfig: json['PhoneConfig'] != null ? UserPhoneConfig.fromJson( json['PhoneConfig'] as Map) @@ -24667,6 +35997,8 @@ class User { final hierarchyGroupId = this.hierarchyGroupId; final id = this.id; final identityInfo = this.identityInfo; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; final phoneConfig = this.phoneConfig; final routingProfileId = this.routingProfileId; final securityProfileIds = this.securityProfileIds; @@ -24678,6 +36010,9 @@ class User { if (hierarchyGroupId != null) 'HierarchyGroupId': hierarchyGroupId, if (id != null) 'Id': id, if (identityInfo != null) 'IdentityInfo': identityInfo, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), if (phoneConfig != null) 'PhoneConfig': phoneConfig, if (routingProfileId != null) 'RoutingProfileId': routingProfileId, if (securityProfileIds != null) 'SecurityProfileIds': securityProfileIds, @@ -24844,6 +36179,13 @@ class UserDataFilters { } /// Contains information about the identity of a user. +/// +/// For Amazon Connect instances that are created with the +/// EXISTING_DIRECTORY identity management type, +/// FirstName, LastName, and Email cannot +/// be updated from within Amazon Connect because they are managed by the +/// directory. +/// class UserIdentityInfo { /// The email address. If you are using SAML for identity management and include /// this parameter, an error is returned. @@ -24937,7 +36279,11 @@ class UserPhoneConfig { /// The phone type. final PhoneType phoneType; - /// The After Call Work (ACW) timeout setting, in seconds. + /// The After Call Work (ACW) timeout setting, in seconds. This parameter has a + /// minimum value of 0 and a maximum value of 2,000,000 seconds (24 days). Enter + /// 0 if you don't want to allocate a specific amount of ACW time. It + /// essentially means an indefinite amount of time. When the conversation ends, + /// ACW starts; the agent must choose Close contact to end ACW. /// /// When returned by a SearchUsers call, /// AfterContactWorkTimeLimit is returned in milliseconds. @@ -24981,6 +36327,68 @@ class UserPhoneConfig { } } +/// Information about proficiency of a user. +class UserProficiency { + /// The name of user's proficiency. You must use name of predefined attribute + /// present in the Amazon Connect instance. + final String attributeName; + + /// The value of user's proficiency. You must use value of predefined attribute + /// present in the Amazon Connect instance. + final String attributeValue; + + /// The level of the proficiency. The valid values are 1, 2, 3, 4 and 5. + final double level; + + UserProficiency({ + required this.attributeName, + required this.attributeValue, + required this.level, + }); + + factory UserProficiency.fromJson(Map json) { + return UserProficiency( + attributeName: json['AttributeName'] as String, + attributeValue: json['AttributeValue'] as String, + level: json['Level'] as double, + ); + } + + Map toJson() { + final attributeName = this.attributeName; + final attributeValue = this.attributeValue; + final level = this.level; + return { + 'AttributeName': attributeName, + 'AttributeValue': attributeValue, + 'Level': level, + }; + } +} + +/// Information about proficiency to be disassociated from the user. +class UserProficiencyDisassociate { + /// The name of user's proficiency. + final String attributeName; + + /// The value of user's proficiency. + final String attributeValue; + + UserProficiencyDisassociate({ + required this.attributeName, + required this.attributeValue, + }); + + Map toJson() { + final attributeName = this.attributeName; + final attributeValue = this.attributeValue; + return { + 'AttributeName': attributeName, + 'AttributeValue': attributeValue, + }; + } +} + /// Contains information about the quick connect configuration settings for a /// user. The contact flow must be of type Transfer to Agent. class UserQuickConnectConfig { @@ -25063,6 +36471,11 @@ class UserSearchCriteria { final List? orConditions; /// A leaf node condition which can be used to specify a string condition. + /// + /// The currently supported values for FieldName are + /// Username, FirstName, LastName, + /// RoutingProfileId, SecurityProfileId, + /// ResourceId. final StringCondition? stringCondition; UserSearchCriteria({ @@ -25091,14 +36504,41 @@ class UserSearchCriteria { class UserSearchFilter { final ControlPlaneTagFilter? tagFilter; + /// An object that can be used to specify Tag conditions or Hierarchy Group + /// conditions inside the SearchFilter. + /// + /// This accepts an OR of AND (List of List) input + /// where: + /// + ///
      + ///
    • + /// The top level list specifies conditions that need to be applied with + /// OR operator. + ///
    • + ///
    • + /// The inner list specifies conditions that need to be applied with + /// AND operator. + ///
    • + ///
    + /// Only one field can be populated. This object can’t be used along with + /// TagFilter. Request can either contain TagFilter or UserAttributeFilter if + /// SearchFilter is specified, combination of both is not supported and such + /// request will throw AccessDeniedException. + /// + final ControlPlaneUserAttributeFilter? userAttributeFilter; + UserSearchFilter({ this.tagFilter, + this.userAttributeFilter, }); Map toJson() { final tagFilter = this.tagFilter; + final userAttributeFilter = this.userAttributeFilter; return { if (tagFilter != null) 'TagFilter': tagFilter, + if (userAttributeFilter != null) + 'UserAttributeFilter': userAttributeFilter, }; } } @@ -25128,7 +36568,7 @@ class UserSearchSummary { final List? securityProfileIds; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; /// The name of the user. @@ -25206,12 +36646,20 @@ class UserSummary { /// The identifier of the user account. final String? id; + /// The Amazon Web Services Region where this resource was last modified. + final String? lastModifiedRegion; + + /// The timestamp when this resource was last modified. + final DateTime? lastModifiedTime; + /// The Amazon Connect user name of the user account. final String? username; UserSummary({ this.arn, this.id, + this.lastModifiedRegion, + this.lastModifiedTime, this.username, }); @@ -25219,6 +36667,8 @@ class UserSummary { return UserSummary( arn: json['Arn'] as String?, id: json['Id'] as String?, + lastModifiedRegion: json['LastModifiedRegion'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), username: json['Username'] as String?, ); } @@ -25226,15 +36676,407 @@ class UserSummary { Map toJson() { final arn = this.arn; final id = this.id; + final lastModifiedRegion = this.lastModifiedRegion; + final lastModifiedTime = this.lastModifiedTime; final username = this.username; return { if (arn != null) 'Arn': arn, if (id != null) 'Id': id, + if (lastModifiedRegion != null) 'LastModifiedRegion': lastModifiedRegion, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), if (username != null) 'Username': username, }; } } +enum VideoCapability { + send, +} + +extension VideoCapabilityValueExtension on VideoCapability { + String toValue() { + switch (this) { + case VideoCapability.send: + return 'SEND'; + } + } +} + +extension VideoCapabilityFromString on String { + VideoCapability toVideoCapability() { + switch (this) { + case 'SEND': + return VideoCapability.send; + } + throw Exception('$this is not known in enum VideoCapability'); + } +} + +/// A view resource object. Contains metadata and content necessary to render +/// the view. +class View { + /// The Amazon Resource Name (ARN) of the view. + final String? arn; + + /// View content containing all content necessary to render a view except for + /// runtime input data. + final ViewContent? content; + + /// The timestamp of when the view was created. + final DateTime? createdTime; + + /// The description of the view. + final String? description; + + /// The identifier of the view. + final String? id; + + /// Latest timestamp of the UpdateViewContent or + /// CreateViewVersion operations. + final DateTime? lastModifiedTime; + + /// The name of the view. + final String? name; + + /// Indicates the view status as either SAVED or + /// PUBLISHED. The PUBLISHED status will initiate + /// validation on the content. + final ViewStatus? status; + + /// The tags associated with the view resource (not specific to view version). + final Map? tags; + + /// The type of the view - CUSTOMER_MANAGED. + final ViewType? type; + + /// Current version of the view. + final int? version; + + /// The description of the version. + final String? versionDescription; + + /// Indicates the checksum value of the latest published view content. + final String? viewContentSha256; + + View({ + this.arn, + this.content, + this.createdTime, + this.description, + this.id, + this.lastModifiedTime, + this.name, + this.status, + this.tags, + this.type, + this.version, + this.versionDescription, + this.viewContentSha256, + }); + + factory View.fromJson(Map json) { + return View( + arn: json['Arn'] as String?, + content: json['Content'] != null + ? ViewContent.fromJson(json['Content'] as Map) + : null, + createdTime: timeStampFromJson(json['CreatedTime']), + description: json['Description'] as String?, + id: json['Id'] as String?, + lastModifiedTime: timeStampFromJson(json['LastModifiedTime']), + name: json['Name'] as String?, + status: (json['Status'] as String?)?.toViewStatus(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + type: (json['Type'] as String?)?.toViewType(), + version: json['Version'] as int?, + versionDescription: json['VersionDescription'] as String?, + viewContentSha256: json['ViewContentSha256'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final content = this.content; + final createdTime = this.createdTime; + final description = this.description; + final id = this.id; + final lastModifiedTime = this.lastModifiedTime; + final name = this.name; + final status = this.status; + final tags = this.tags; + final type = this.type; + final version = this.version; + final versionDescription = this.versionDescription; + final viewContentSha256 = this.viewContentSha256; + return { + if (arn != null) 'Arn': arn, + if (content != null) 'Content': content, + if (createdTime != null) 'CreatedTime': unixTimestampToJson(createdTime), + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (lastModifiedTime != null) + 'LastModifiedTime': unixTimestampToJson(lastModifiedTime), + if (name != null) 'Name': name, + if (status != null) 'Status': status.toValue(), + if (tags != null) 'Tags': tags, + if (type != null) 'Type': type.toValue(), + if (version != null) 'Version': version, + if (versionDescription != null) 'VersionDescription': versionDescription, + if (viewContentSha256 != null) 'ViewContentSha256': viewContentSha256, + }; + } +} + +/// View content containing all content necessary to render a view except for +/// runtime input data. +class ViewContent { + /// A list of possible actions from the view. + final List? actions; + + /// The data schema matching data that the view template must be provided to + /// render. + final String? inputSchema; + + /// The view template representing the structure of the view. + final String? template; + + ViewContent({ + this.actions, + this.inputSchema, + this.template, + }); + + factory ViewContent.fromJson(Map json) { + return ViewContent( + actions: (json['Actions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + inputSchema: json['InputSchema'] as String?, + template: json['Template'] as String?, + ); + } + + Map toJson() { + final actions = this.actions; + final inputSchema = this.inputSchema; + final template = this.template; + return { + if (actions != null) 'Actions': actions, + if (inputSchema != null) 'InputSchema': inputSchema, + if (template != null) 'Template': template, + }; + } +} + +/// View content containing all content necessary to render a view except for +/// runtime input data and the runtime input schema, which is auto-generated by +/// this operation. +class ViewInputContent { + /// A list of possible actions from the view. + final List? actions; + + /// The view template representing the structure of the view. + final String? template; + + ViewInputContent({ + this.actions, + this.template, + }); + + Map toJson() { + final actions = this.actions; + final template = this.template; + return { + if (actions != null) 'Actions': actions, + if (template != null) 'Template': template, + }; + } +} + +enum ViewStatus { + published, + saved, +} + +extension ViewStatusValueExtension on ViewStatus { + String toValue() { + switch (this) { + case ViewStatus.published: + return 'PUBLISHED'; + case ViewStatus.saved: + return 'SAVED'; + } + } +} + +extension ViewStatusFromString on String { + ViewStatus toViewStatus() { + switch (this) { + case 'PUBLISHED': + return ViewStatus.published; + case 'SAVED': + return ViewStatus.saved; + } + throw Exception('$this is not known in enum ViewStatus'); + } +} + +/// A summary of a view's metadata. +class ViewSummary { + /// The Amazon Resource Name (ARN) of the view. + final String? arn; + + /// The description of the view. + final String? description; + + /// The identifier of the view. + final String? id; + + /// The name of the view. + final String? name; + + /// Indicates the view status as either SAVED or + /// PUBLISHED. The PUBLISHED status will initiate + /// validation on the content. + final ViewStatus? status; + + /// The type of the view. + final ViewType? type; + + ViewSummary({ + this.arn, + this.description, + this.id, + this.name, + this.status, + this.type, + }); + + factory ViewSummary.fromJson(Map json) { + return ViewSummary( + arn: json['Arn'] as String?, + description: json['Description'] as String?, + id: json['Id'] as String?, + name: json['Name'] as String?, + status: (json['Status'] as String?)?.toViewStatus(), + type: (json['Type'] as String?)?.toViewType(), + ); + } + + Map toJson() { + final arn = this.arn; + final description = this.description; + final id = this.id; + final name = this.name; + final status = this.status; + final type = this.type; + return { + if (arn != null) 'Arn': arn, + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (status != null) 'Status': status.toValue(), + if (type != null) 'Type': type.toValue(), + }; + } +} + +enum ViewType { + customerManaged, + awsManaged, +} + +extension ViewTypeValueExtension on ViewType { + String toValue() { + switch (this) { + case ViewType.customerManaged: + return 'CUSTOMER_MANAGED'; + case ViewType.awsManaged: + return 'AWS_MANAGED'; + } + } +} + +extension ViewTypeFromString on String { + ViewType toViewType() { + switch (this) { + case 'CUSTOMER_MANAGED': + return ViewType.customerManaged; + case 'AWS_MANAGED': + return ViewType.awsManaged; + } + throw Exception('$this is not known in enum ViewType'); + } +} + +/// A summary of a view version's metadata. +class ViewVersionSummary { + /// The Amazon Resource Name (ARN) of the view version. + final String? arn; + + /// The description of the view version. + final String? description; + + /// The identifier of the view version. + final String? id; + + /// The name of the view version. + final String? name; + + /// The type of the view version. + final ViewType? type; + + /// The sequentially incremented version of the view version. + final int? version; + + /// The description of the view version. + final String? versionDescription; + + ViewVersionSummary({ + this.arn, + this.description, + this.id, + this.name, + this.type, + this.version, + this.versionDescription, + }); + + factory ViewVersionSummary.fromJson(Map json) { + return ViewVersionSummary( + arn: json['Arn'] as String?, + description: json['Description'] as String?, + id: json['Id'] as String?, + name: json['Name'] as String?, + type: (json['Type'] as String?)?.toViewType(), + version: json['Version'] as int?, + versionDescription: json['VersionDescription'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final description = this.description; + final id = this.id; + final name = this.name; + final type = this.type; + final version = this.version; + final versionDescription = this.versionDescription; + return { + if (arn != null) 'Arn': arn, + if (description != null) 'Description': description, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (type != null) 'Type': type.toValue(), + if (version != null) 'Version': version, + if (versionDescription != null) 'VersionDescription': versionDescription, + }; + } +} + /// Contains information about a custom vocabulary. class Vocabulary { /// The Amazon Resource Name (ARN) of the custom vocabulary. @@ -25271,7 +37113,7 @@ class Vocabulary { final String? failureReason; /// The tags used to organize, track, or control access for this resource. For - /// example, { "tags": {"key1":"value1", "key2":"value2"} }. + /// example, { "Tags": {"key1":"value1", "key2":"value2"} }. final Map? tags; Vocabulary({ @@ -25645,6 +37487,11 @@ class AccessDeniedException extends _s.GenericAwsException { : super(type: type, code: 'AccessDeniedException', message: message); } +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + class ContactFlowNotPublishedException extends _s.GenericAwsException { ContactFlowNotPublishedException({String? type, String? message}) : super( @@ -25710,6 +37557,14 @@ class LimitExceededException extends _s.GenericAwsException { : super(type: type, code: 'LimitExceededException', message: message); } +class MaximumResultReturnedException extends _s.GenericAwsException { + MaximumResultReturnedException({String? type, String? message}) + : super( + type: type, + code: 'MaximumResultReturnedException', + message: message); +} + class OutboundContactNotPermittedException extends _s.GenericAwsException { OutboundContactNotPermittedException({String? type, String? message}) : super( @@ -25718,6 +37573,12 @@ class OutboundContactNotPermittedException extends _s.GenericAwsException { message: message); } +class OutputTypeNotFoundException extends _s.GenericAwsException { + OutputTypeNotFoundException({String? type, String? message}) + : super( + type: type, code: 'OutputTypeNotFoundException', message: message); +} + class PropertyValidationException extends _s.GenericAwsException { PropertyValidationException({String? type, String? message}) : super( @@ -25757,6 +37618,11 @@ class ThrottlingException extends _s.GenericAwsException { : super(type: type, code: 'ThrottlingException', message: message); } +class TooManyRequestsException extends _s.GenericAwsException { + TooManyRequestsException({String? type, String? message}) + : super(type: type, code: 'TooManyRequestsException', message: message); +} + class UserNotFoundException extends _s.GenericAwsException { UserNotFoundException({String? type, String? message}) : super(type: type, code: 'UserNotFoundException', message: message); @@ -25765,6 +37631,8 @@ class UserNotFoundException extends _s.GenericAwsException { final _exceptionFns = { 'AccessDeniedException': (type, message) => AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), 'ContactFlowNotPublishedException': (type, message) => ContactFlowNotPublishedException(type: type, message: message), 'ContactNotFoundException': (type, message) => @@ -25787,8 +37655,12 @@ final _exceptionFns = { InvalidRequestException(type: type, message: message), 'LimitExceededException': (type, message) => LimitExceededException(type: type, message: message), + 'MaximumResultReturnedException': (type, message) => + MaximumResultReturnedException(type: type, message: message), 'OutboundContactNotPermittedException': (type, message) => OutboundContactNotPermittedException(type: type, message: message), + 'OutputTypeNotFoundException': (type, message) => + OutputTypeNotFoundException(type: type, message: message), 'PropertyValidationException': (type, message) => PropertyValidationException(type: type, message: message), 'ResourceConflictException': (type, message) => @@ -25803,6 +37675,8 @@ final _exceptionFns = { ServiceQuotaExceededException(type: type, message: message), 'ThrottlingException': (type, message) => ThrottlingException(type: type, message: message), + 'TooManyRequestsException': (type, message) => + TooManyRequestsException(type: type, message: message), 'UserNotFoundException': (type, message) => UserNotFoundException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/connect_campaigns/v2021_01_30.dart b/aws_client/lib/src/generated/connect_campaigns/v2021_01_30.dart index e80d04802..1ad4e8386 100644 --- a/aws_client/lib/src/generated/connect_campaigns/v2021_01_30.dart +++ b/aws_client/lib/src/generated/connect_campaigns/v2021_01_30.dart @@ -537,26 +537,56 @@ class ConnectCampaign { } } +/// Agentless Dialer config +class AgentlessDialerConfig { + final double? dialingCapacity; + + AgentlessDialerConfig({ + this.dialingCapacity, + }); + + factory AgentlessDialerConfig.fromJson(Map json) { + return AgentlessDialerConfig( + dialingCapacity: json['dialingCapacity'] as double?, + ); + } + + Map toJson() { + final dialingCapacity = this.dialingCapacity; + return { + if (dialingCapacity != null) 'dialingCapacity': dialingCapacity, + }; + } +} + /// Answering Machine Detection config class AnswerMachineDetectionConfig { /// Enable or disable answering machine detection final bool enableAnswerMachineDetection; + /// Enable or disable await answer machine prompt + final bool? awaitAnswerMachinePrompt; + AnswerMachineDetectionConfig({ required this.enableAnswerMachineDetection, + this.awaitAnswerMachinePrompt, }); factory AnswerMachineDetectionConfig.fromJson(Map json) { return AnswerMachineDetectionConfig( enableAnswerMachineDetection: json['enableAnswerMachineDetection'] as bool, + awaitAnswerMachinePrompt: json['awaitAnswerMachinePrompt'] as bool?, ); } Map toJson() { final enableAnswerMachineDetection = this.enableAnswerMachineDetection; + final awaitAnswerMachinePrompt = this.awaitAnswerMachinePrompt; return { 'enableAnswerMachineDetection': enableAnswerMachineDetection, + if (awaitAnswerMachinePrompt != null) + 'awaitAnswerMachinePrompt': awaitAnswerMachinePrompt, }; } } @@ -800,16 +830,22 @@ class DialRequest { /// The possible types of dialer config parameters class DialerConfig { + final AgentlessDialerConfig? agentlessDialerConfig; final PredictiveDialerConfig? predictiveDialerConfig; final ProgressiveDialerConfig? progressiveDialerConfig; DialerConfig({ + this.agentlessDialerConfig, this.predictiveDialerConfig, this.progressiveDialerConfig, }); factory DialerConfig.fromJson(Map json) { return DialerConfig( + agentlessDialerConfig: json['agentlessDialerConfig'] != null + ? AgentlessDialerConfig.fromJson( + json['agentlessDialerConfig'] as Map) + : null, predictiveDialerConfig: json['predictiveDialerConfig'] != null ? PredictiveDialerConfig.fromJson( json['predictiveDialerConfig'] as Map) @@ -822,9 +858,12 @@ class DialerConfig { } Map toJson() { + final agentlessDialerConfig = this.agentlessDialerConfig; final predictiveDialerConfig = this.predictiveDialerConfig; final progressiveDialerConfig = this.progressiveDialerConfig; return { + if (agentlessDialerConfig != null) + 'agentlessDialerConfig': agentlessDialerConfig, if (predictiveDialerConfig != null) 'predictiveDialerConfig': predictiveDialerConfig, if (progressiveDialerConfig != null) @@ -1387,39 +1426,39 @@ class ListTagsForResourceResponse { /// The configuration used for outbound calls. class OutboundCallConfig { final String connectContactFlowId; - final String connectQueueId; final AnswerMachineDetectionConfig? answerMachineDetectionConfig; + final String? connectQueueId; final String? connectSourcePhoneNumber; OutboundCallConfig({ required this.connectContactFlowId, - required this.connectQueueId, this.answerMachineDetectionConfig, + this.connectQueueId, this.connectSourcePhoneNumber, }); factory OutboundCallConfig.fromJson(Map json) { return OutboundCallConfig( connectContactFlowId: json['connectContactFlowId'] as String, - connectQueueId: json['connectQueueId'] as String, answerMachineDetectionConfig: json['answerMachineDetectionConfig'] != null ? AnswerMachineDetectionConfig.fromJson( json['answerMachineDetectionConfig'] as Map) : null, + connectQueueId: json['connectQueueId'] as String?, connectSourcePhoneNumber: json['connectSourcePhoneNumber'] as String?, ); } Map toJson() { final connectContactFlowId = this.connectContactFlowId; - final connectQueueId = this.connectQueueId; final answerMachineDetectionConfig = this.answerMachineDetectionConfig; + final connectQueueId = this.connectQueueId; final connectSourcePhoneNumber = this.connectSourcePhoneNumber; return { 'connectContactFlowId': connectContactFlowId, - 'connectQueueId': connectQueueId, if (answerMachineDetectionConfig != null) 'answerMachineDetectionConfig': answerMachineDetectionConfig, + if (connectQueueId != null) 'connectQueueId': connectQueueId, if (connectSourcePhoneNumber != null) 'connectSourcePhoneNumber': connectSourcePhoneNumber, }; @@ -1429,21 +1468,26 @@ class OutboundCallConfig { /// Predictive Dialer config class PredictiveDialerConfig { final double bandwidthAllocation; + final double? dialingCapacity; PredictiveDialerConfig({ required this.bandwidthAllocation, + this.dialingCapacity, }); factory PredictiveDialerConfig.fromJson(Map json) { return PredictiveDialerConfig( bandwidthAllocation: json['bandwidthAllocation'] as double, + dialingCapacity: json['dialingCapacity'] as double?, ); } Map toJson() { final bandwidthAllocation = this.bandwidthAllocation; + final dialingCapacity = this.dialingCapacity; return { 'bandwidthAllocation': bandwidthAllocation, + if (dialingCapacity != null) 'dialingCapacity': dialingCapacity, }; } } @@ -1451,21 +1495,26 @@ class PredictiveDialerConfig { /// Progressive Dialer config class ProgressiveDialerConfig { final double bandwidthAllocation; + final double? dialingCapacity; ProgressiveDialerConfig({ required this.bandwidthAllocation, + this.dialingCapacity, }); factory ProgressiveDialerConfig.fromJson(Map json) { return ProgressiveDialerConfig( bandwidthAllocation: json['bandwidthAllocation'] as double, + dialingCapacity: json['dialingCapacity'] as double?, ); } Map toJson() { final bandwidthAllocation = this.bandwidthAllocation; + final dialingCapacity = this.dialingCapacity; return { 'bandwidthAllocation': bandwidthAllocation, + if (dialingCapacity != null) 'dialingCapacity': dialingCapacity, }; } } diff --git a/aws_client/lib/src/generated/connect_cases/v2022_10_03.dart b/aws_client/lib/src/generated/connect_cases/v2022_10_03.dart index 88d2cc5d5..d7374db36 100644 --- a/aws_client/lib/src/generated/connect_cases/v2022_10_03.dart +++ b/aws_client/lib/src/generated/connect_cases/v2022_10_03.dart @@ -120,17 +120,21 @@ class ConnectCases { return BatchPutFieldOptionsResponse.fromJson(response); } - /// Creates a case in the specified Cases domain. Case system and custom - /// fields are taken as an array id/value pairs with a declared data types. /// - /// The following fields are required when creating a case: - ///
     <ul> <li> <p>
    +  /// If you provide a value for PerformedBy.UserArn you must also
    +  /// have connect:DescribeUser
    +  /// permission on the User ARN resource that you provide
    +  ///  
     <p>Creates a case in the specified Cases domain.
    +  /// Case system and custom fields are taken as an array id/value pairs with a
    +  /// declared data types.</p> <p>The following fields are required
    +  /// when creating a case:</p> <ul> <li> <p>
       /// <code>customer_id</code> - You must provide the full customer
    -  /// profile ARN in this format: <code>arn:aws:profile:your AWS
    -  /// Region:your AWS account ID:domains/profiles domain name/profiles/profile
    -  /// ID</code> </p> </li> <li> <p>
    -  /// <code>title</code> </p> </li> </ul>
    -  /// </note> 
    + /// profile ARN in this format: + /// <code>arn:aws:profile:your_AWS_Region:your_AWS_account + /// ID:domains/your_profiles_domain_name/profiles/profile_ID</code> + /// </p> </li> <li> <p> <code>title</code> + /// </p> </li> </ul>
    /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -160,11 +164,13 @@ class ConnectCases { required List fields, required String templateId, String? clientToken, + UserUnion? performedBy, }) async { final $payload = { 'fields': fields, 'templateId': templateId, 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (performedBy != null) 'performedBy': performedBy, }; final response = await _protocol.send( payload: $payload, @@ -186,7 +192,7 @@ class ConnectCases { /// domain. For more information, see Onboard /// to Cases. - /// + ///
     </important> 
    /// /// May throw [InternalServerException]. /// May throw [ValidationException]. @@ -311,12 +317,21 @@ class ConnectCases { /// Creates a related item (comments, tasks, and contacts) and associates it /// with a case. /// + ///
      + ///
    • /// A Related Item is a resource that is associated with a case. It may or may /// not have an external identifier linking it to an external resource (for /// example, a contactArn). All Related Items have their own /// internal identifier, the relatedItemArn. Examples of related /// items include comments and contacts. - /// + ///
    • + ///
    • + /// If you provide a value for performedBy.userArn you must also + /// have DescribeUser + /// permission on the ARN of the user that you provide. + ///
    • + ///
     </note> 
    /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -336,15 +351,20 @@ class ConnectCases { /// /// Parameter [type] : /// The type of a related item. + /// + /// Parameter [performedBy] : + /// Represents the creator of the related item. Future createRelatedItem({ required String caseId, required RelatedItemInputContent content, required String domainId, required RelatedItemType type, + UserUnion? performedBy, }) async { final $payload = { 'content': content, 'type': type.toValue(), + if (performedBy != null) 'performedBy': performedBy, }; final response = await _protocol.send( payload: $payload, @@ -415,7 +435,13 @@ class ConnectCases { return CreateTemplateResponse.fromJson(response); } - /// Deletes a domain. + /// Deletes a Cases domain. + ///
     <note> <p>After deleting your domain you must
    +  /// disassociate the deleted domain from your Amazon Connect instance with
    +  /// another API call before being able to use Cases again with this Amazon
    +  /// Connect instance. See <a
    +  /// href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteIntegrationAssociation.html">DeleteIntegrationAssociation</a>.</p>
    +  /// </note> 
    /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -437,6 +463,162 @@ class ConnectCases { ); } + /// Deletes a field from a cases template. You can delete up to 100 fields per + /// domain. + /// + /// After a field is deleted: + /// + ///
      + ///
    • + /// You can still retrieve the field by calling BatchGetField. + ///
    • + ///
    • + /// You cannot update a deleted field by calling UpdateField; it + /// throws a ValidationException. + ///
    • + ///
    • + /// Deleted fields are not included in the ListFields response. + ///
    • + ///
    • + /// Calling CreateCase with a deleted field throws a + /// ValidationException denoting which field IDs in the request + /// have been deleted. + ///
    • + ///
    • + /// Calling GetCase with a deleted field ID returns the deleted + /// field's value if one exists. + ///
    • + ///
    • + /// Calling UpdateCase with a deleted field ID throws a + /// ValidationException if the case does not already contain a + /// value for the deleted field. Otherwise it succeeds, allowing you to update + /// or remove (using emptyValue: {}) the field's value from the + /// case. + ///
    • + ///
    • + /// GetTemplate does not return field IDs for deleted fields. + ///
    • + ///
    • + /// GetLayout does not return field IDs for deleted fields. + ///
    • + ///
    • + /// Calling SearchCases with the deleted field ID as a filter + /// returns any cases that have a value for the deleted field that matches the + /// filter criteria. + ///
    • + ///
    • + /// Calling SearchCases with a searchTerm value that + /// matches a deleted field's value on a case returns the case in the + /// response. + ///
    • + ///
    • + /// Calling BatchPutFieldOptions with a deleted field ID throw a + /// ValidationException. + ///
    • + ///
    • + /// Calling GetCaseEventConfiguration does not return field IDs + /// for deleted fields. + ///
    • + ///
    + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [domainId] : + /// The unique identifier of the Cases domain. + /// + /// Parameter [fieldId] : + /// Unique identifier of the field. + Future deleteField({ + required String domainId, + required String fieldId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/domains/${Uri.encodeComponent(domainId)}/fields/${Uri.encodeComponent(fieldId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a layout from a cases template. You can delete up to 100 layouts + /// per domain. + ///
     <p>After a layout is deleted:</p> <ul>
    +  /// <li> <p>You can still retrieve the layout by calling
    +  /// <code>GetLayout</code>.</p> </li> <li>
    +  /// <p>You cannot update a deleted layout by calling
    +  /// <code>UpdateLayout</code>; it throws a
    +  /// <code>ValidationException</code>.</p> </li>
    +  /// <li> <p>Deleted layouts are not included in the
    +  /// <code>ListLayouts</code> response.</p> </li>
    +  /// </ul> 
    + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// + /// Parameter [domainId] : + /// The unique identifier of the Cases domain. + /// + /// Parameter [layoutId] : + /// The unique identifier of the layout. + Future deleteLayout({ + required String domainId, + required String layoutId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/domains/${Uri.encodeComponent(domainId)}/layouts/${Uri.encodeComponent(layoutId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a cases template. You can delete up to 100 templates per domain. + ///
     <p>After a cases template is deleted:</p>
    +  /// <ul> <li> <p>You can still retrieve the template by
    +  /// calling <code>GetTemplate</code>.</p> </li>
    +  /// <li> <p>You cannot update the template. </p> </li>
    +  /// <li> <p>You cannot create a case by using the deleted
    +  /// template.</p> </li> <li> <p>Deleted templates are
    +  /// not included in the <code>ListTemplates</code>
    +  /// response.</p> </li> </ul> 
    + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// + /// Parameter [domainId] : + /// The unique identifier of the Cases domain. + /// + /// Parameter [templateId] : + /// A unique identifier of a template. + Future deleteTemplate({ + required String domainId, + required String templateId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/domains/${Uri.encodeComponent(domainId)}/templates/${Uri.encodeComponent(templateId)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Returns information about a specific case if it exists. /// /// May throw [InternalServerException]. @@ -477,6 +659,54 @@ class ConnectCases { return GetCaseResponse.fromJson(response); } + /// Returns the audit history about a specific case if it exists. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// + /// Parameter [caseId] : + /// A unique identifier of the case. + /// + /// Parameter [domainId] : + /// The unique identifier of the Cases domain. + /// + /// Parameter [maxResults] : + /// The maximum number of audit events to return. The current maximum + /// supported value is 25. This is also the default when no other value is + /// provided. + /// + /// Parameter [nextToken] : + /// The token for the next set of results. Use the value returned in the + /// previous response in the next request to retrieve the next set of results. + Future getCaseAuditEvents({ + required String caseId, + required String domainId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 25, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/domains/${Uri.encodeComponent(domainId)}/cases/${Uri.encodeComponent(caseId)}/audit-history', + exceptionFnMap: _exceptionFns, + ); + return GetCaseAuditEventsResponse.fromJson(response); + } + /// Returns the case event publishing configuration. /// /// May throw [InternalServerException]. @@ -869,7 +1099,10 @@ class ConnectCases { return ListTemplatesResponse.fromJson(response); } - /// API for adding case event publishing configuration + /// Adds case event publishing configuration. For a complete list of fields + /// you can add to the event message, see Create + /// case fields in the Amazon Connect Administrator Guide /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -1082,12 +1315,16 @@ class ConnectCases { ); } - /// Updates the values of fields on a case. Fields to be updated are received - /// as an array of id/value pairs identical to the CreateCase - /// input . - /// - /// If the action is successful, the service sends back an HTTP 200 response - /// with an empty HTTP body. + /// + /// If you provide a value for PerformedBy.UserArn you must also + /// have connect:DescribeUser + /// permission on the User ARN resource that you provide + ///
     <p>Updates the values of fields on a case.
    +  /// Fields to be updated are received as an array of id/value pairs identical
    +  /// to the <code>CreateCase</code> input .</p> <p>If
    +  /// the action is successful, the service sends back an HTTP 200 response with
    +  /// an empty HTTP body.</p> 
    /// /// May throw [InternalServerException]. /// May throw [ResourceNotFoundException]. @@ -1109,9 +1346,11 @@ class ConnectCases { required String caseId, required String domainId, required List fields, + UserUnion? performedBy, }) async { final $payload = { 'fields': fields, + if (performedBy != null) 'performedBy': performedBy, }; final response = await _protocol.send( payload: $payload, @@ -1189,7 +1428,7 @@ class ConnectCases { /// /// Parameter [content] : /// Information about which fields will be present in the layout, the order of - /// the fields, and a read-only attribute of the field. + /// the fields. /// /// Parameter [name] : /// The name of the layout. It must be unique per domain. @@ -1274,6 +1513,231 @@ class ConnectCases { } } +/// Represents the content of a particular audit event. +class AuditEvent { + /// Unique identifier of a case audit history event. + final String eventId; + + /// A list of Case Audit History event fields. + final List fields; + + /// Time at which an Audit History event took place. + final DateTime performedTime; + + /// The Type of an audit history event. + final AuditEventType type; + + /// Information of the user which performed the audit. + final AuditEventPerformedBy? performedBy; + + /// The Type of the related item. + final RelatedItemType? relatedItemType; + + AuditEvent({ + required this.eventId, + required this.fields, + required this.performedTime, + required this.type, + this.performedBy, + this.relatedItemType, + }); + + factory AuditEvent.fromJson(Map json) { + return AuditEvent( + eventId: json['eventId'] as String, + fields: (json['fields'] as List) + .whereNotNull() + .map((e) => AuditEventField.fromJson(e as Map)) + .toList(), + performedTime: + nonNullableTimeStampFromJson(json['performedTime'] as Object), + type: (json['type'] as String).toAuditEventType(), + performedBy: json['performedBy'] != null + ? AuditEventPerformedBy.fromJson( + json['performedBy'] as Map) + : null, + relatedItemType: + (json['relatedItemType'] as String?)?.toRelatedItemType(), + ); + } + + Map toJson() { + final eventId = this.eventId; + final fields = this.fields; + final performedTime = this.performedTime; + final type = this.type; + final performedBy = this.performedBy; + final relatedItemType = this.relatedItemType; + return { + 'eventId': eventId, + 'fields': fields, + 'performedTime': iso8601ToJson(performedTime), + 'type': type.toValue(), + if (performedBy != null) 'performedBy': performedBy, + if (relatedItemType != null) 'relatedItemType': relatedItemType.toValue(), + }; + } +} + +/// Fields for audit event. +class AuditEventField { + /// Unique identifier of field in an Audit History entry. + final String eventFieldId; + + /// Union of potential field value types. + final AuditEventFieldValueUnion newValue; + + /// Union of potential field value types. + final AuditEventFieldValueUnion? oldValue; + + AuditEventField({ + required this.eventFieldId, + required this.newValue, + this.oldValue, + }); + + factory AuditEventField.fromJson(Map json) { + return AuditEventField( + eventFieldId: json['eventFieldId'] as String, + newValue: AuditEventFieldValueUnion.fromJson( + json['newValue'] as Map), + oldValue: json['oldValue'] != null + ? AuditEventFieldValueUnion.fromJson( + json['oldValue'] as Map) + : null, + ); + } + + Map toJson() { + final eventFieldId = this.eventFieldId; + final newValue = this.newValue; + final oldValue = this.oldValue; + return { + 'eventFieldId': eventFieldId, + 'newValue': newValue, + if (oldValue != null) 'oldValue': oldValue, + }; + } +} + +/// Object to store union of Field values. +class AuditEventFieldValueUnion { + /// Can be either null, or have a Boolean value type. Only one value can be + /// provided. + final bool? booleanValue; + + /// Can be either null, or have a Double value type. Only one value can be + /// provided. + final double? doubleValue; + final EmptyFieldValue? emptyValue; + + /// Can be either null, or have a String value type. Only one value can be + /// provided. + final String? stringValue; + + /// Can be either null, or have a String value type formatted as an ARN. Only + /// one value can be provided. + final String? userArnValue; + + AuditEventFieldValueUnion({ + this.booleanValue, + this.doubleValue, + this.emptyValue, + this.stringValue, + this.userArnValue, + }); + + factory AuditEventFieldValueUnion.fromJson(Map json) { + return AuditEventFieldValueUnion( + booleanValue: json['booleanValue'] as bool?, + doubleValue: json['doubleValue'] as double?, + emptyValue: json['emptyValue'] != null + ? EmptyFieldValue.fromJson(json['emptyValue'] as Map) + : null, + stringValue: json['stringValue'] as String?, + userArnValue: json['userArnValue'] as String?, + ); + } + + Map toJson() { + final booleanValue = this.booleanValue; + final doubleValue = this.doubleValue; + final emptyValue = this.emptyValue; + final stringValue = this.stringValue; + final userArnValue = this.userArnValue; + return { + if (booleanValue != null) 'booleanValue': booleanValue, + if (doubleValue != null) 'doubleValue': doubleValue, + if (emptyValue != null) 'emptyValue': emptyValue, + if (stringValue != null) 'stringValue': stringValue, + if (userArnValue != null) 'userArnValue': userArnValue, + }; + } +} + +/// Information of the user which performed the audit. +class AuditEventPerformedBy { + /// Unique identifier of an IAM role. + final String iamPrincipalArn; + final UserUnion? user; + + AuditEventPerformedBy({ + required this.iamPrincipalArn, + this.user, + }); + + factory AuditEventPerformedBy.fromJson(Map json) { + return AuditEventPerformedBy( + iamPrincipalArn: json['iamPrincipalArn'] as String, + user: json['user'] != null + ? UserUnion.fromJson(json['user'] as Map) + : null, + ); + } + + Map toJson() { + final iamPrincipalArn = this.iamPrincipalArn; + final user = this.user; + return { + 'iamPrincipalArn': iamPrincipalArn, + if (user != null) 'user': user, + }; + } +} + +enum AuditEventType { + caseCreated, + caseUpdated, + relatedItemCreated, +} + +extension AuditEventTypeValueExtension on AuditEventType { + String toValue() { + switch (this) { + case AuditEventType.caseCreated: + return 'Case.Created'; + case AuditEventType.caseUpdated: + return 'Case.Updated'; + case AuditEventType.relatedItemCreated: + return 'RelatedItem.Created'; + } + } +} + +extension AuditEventTypeFromString on String { + AuditEventType toAuditEventType() { + switch (this) { + case 'Case.Created': + return AuditEventType.caseCreated; + case 'Case.Updated': + return AuditEventType.caseUpdated; + case 'RelatedItem.Created': + return AuditEventType.relatedItemCreated; + } + throw Exception('$this is not known in enum AuditEventType'); + } +} + /// Content specific to BasicLayout type. It configures fields in /// the top panel and More Info tab of agent application. class BasicLayout { @@ -1404,20 +1868,26 @@ class CaseFilter { final FieldFilter? field; final CaseFilter? not; + /// Provides "or all" filtering. + final List? orAll; + CaseFilter({ this.andAll, this.field, this.not, + this.orAll, }); Map toJson() { final andAll = this.andAll; final field = this.field; final not = this.not; + final orAll = this.orAll; return { if (andAll != null) 'andAll': andAll, if (field != null) 'field': field, if (not != null) 'not': not, + if (orAll != null) 'orAll': orAll, }; } } @@ -1788,6 +2258,42 @@ class DeleteDomainResponse { } } +class DeleteFieldResponse { + DeleteFieldResponse(); + + factory DeleteFieldResponse.fromJson(Map _) { + return DeleteFieldResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteLayoutResponse { + DeleteLayoutResponse(); + + factory DeleteLayoutResponse.fromJson(Map _) { + return DeleteLayoutResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteTemplateResponse { + DeleteTemplateResponse(); + + factory DeleteTemplateResponse.fromJson(Map _) { + return DeleteTemplateResponse(); + } + + Map toJson() { + return {}; + } +} + enum DomainStatus { active, creationInProgress, @@ -1858,6 +2364,23 @@ class DomainSummary { } } +/// An empty value. You cannot set EmptyFieldValue on a field that +/// is required on a case template. +/// +/// This structure will never have any data members. It signifies an empty value +/// on a case field. +class EmptyFieldValue { + EmptyFieldValue(); + + factory EmptyFieldValue.fromJson(Map _) { + return EmptyFieldValue(); + } + + Map toJson() { + return {}; + } +} + /// Configuration to enable EventBridge case event delivery and determine what /// data is delivered. class EventBridgeConfiguration { @@ -2258,6 +2781,7 @@ enum FieldType { dateTime, singleSelect, url, + user, } extension FieldTypeValueExtension on FieldType { @@ -2275,6 +2799,8 @@ extension FieldTypeValueExtension on FieldType { return 'SingleSelect'; case FieldType.url: return 'Url'; + case FieldType.user: + return 'User'; } } } @@ -2294,6 +2820,8 @@ extension FieldTypeFromString on String { return FieldType.singleSelect; case 'Url': return FieldType.url; + case 'User': + return FieldType.user; } throw Exception('$this is not known in enum FieldType'); } @@ -2330,6 +2858,10 @@ class FieldValue { } /// Object to store union of Field values. +/// +/// The Summary system field accepts 1500 characters while all +/// other fields accept 500 characters. +/// class FieldValueUnion { /// Can be either null, or have a Boolean value type. Only one value can be /// provided. @@ -2339,31 +2871,120 @@ class FieldValueUnion { /// be provided. final double? doubleValue; + /// An empty value. + final EmptyFieldValue? emptyValue; + /// String value type. final String? stringValue; + /// Represents the user that performed the audit. + final String? userArnValue; + FieldValueUnion({ this.booleanValue, this.doubleValue, + this.emptyValue, this.stringValue, + this.userArnValue, }); factory FieldValueUnion.fromJson(Map json) { return FieldValueUnion( booleanValue: json['booleanValue'] as bool?, doubleValue: json['doubleValue'] as double?, + emptyValue: json['emptyValue'] != null + ? EmptyFieldValue.fromJson(json['emptyValue'] as Map) + : null, stringValue: json['stringValue'] as String?, + userArnValue: json['userArnValue'] as String?, ); } Map toJson() { final booleanValue = this.booleanValue; final doubleValue = this.doubleValue; + final emptyValue = this.emptyValue; final stringValue = this.stringValue; + final userArnValue = this.userArnValue; return { if (booleanValue != null) 'booleanValue': booleanValue, if (doubleValue != null) 'doubleValue': doubleValue, + if (emptyValue != null) 'emptyValue': emptyValue, if (stringValue != null) 'stringValue': stringValue, + if (userArnValue != null) 'userArnValue': userArnValue, + }; + } +} + +/// An object that represents a content of an Amazon Connect file object. +class FileContent { + /// The Amazon Resource Name (ARN) of a File in Amazon Connect. + final String fileArn; + + FileContent({ + required this.fileArn, + }); + + factory FileContent.fromJson(Map json) { + return FileContent( + fileArn: json['fileArn'] as String, + ); + } + + Map toJson() { + final fileArn = this.fileArn; + return { + 'fileArn': fileArn, + }; + } +} + +/// A filter for related items of type File. +class FileFilter { + /// The Amazon Resource Name (ARN) of the file. + final String? fileArn; + + FileFilter({ + this.fileArn, + }); + + Map toJson() { + final fileArn = this.fileArn; + return { + if (fileArn != null) 'fileArn': fileArn, + }; + } +} + +class GetCaseAuditEventsResponse { + /// A list of case audits where each represents a particular edit of the case. + final List auditEvents; + + /// The token for the next set of results. This is null if there are no more + /// results to return. + final String? nextToken; + + GetCaseAuditEventsResponse({ + required this.auditEvents, + this.nextToken, + }); + + factory GetCaseAuditEventsResponse.fromJson(Map json) { + return GetCaseAuditEventsResponse( + auditEvents: (json['auditEvents'] as List) + .whereNotNull() + .map((e) => AuditEvent.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final auditEvents = this.auditEvents; + final nextToken = this.nextToken; + return { + 'auditEvents': auditEvents, + if (nextToken != null) 'nextToken': nextToken, }; } } @@ -2518,9 +3139,18 @@ class GetFieldResponse { /// Type of the field. final FieldType type; + /// Timestamp at which the resource was created. + final DateTime? createdTime; + + /// Denotes whether or not the resource has been deleted. + final bool? deleted; + /// Description of the field. final String? description; + /// Timestamp at which the resource was created or last modified. + final DateTime? lastModifiedTime; + /// A map of of key-value pairs that represent tags on a resource. Tags are used /// to organize, track, or control access for this resource. final Map? tags; @@ -2531,7 +3161,10 @@ class GetFieldResponse { required this.name, required this.namespace, required this.type, + this.createdTime, + this.deleted, this.description, + this.lastModifiedTime, this.tags, }); @@ -2542,7 +3175,10 @@ class GetFieldResponse { name: json['name'] as String, namespace: (json['namespace'] as String).toFieldNamespace(), type: (json['type'] as String).toFieldType(), + createdTime: timeStampFromJson(json['createdTime']), + deleted: json['deleted'] as bool?, description: json['description'] as String?, + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -2554,7 +3190,10 @@ class GetFieldResponse { final name = this.name; final namespace = this.namespace; final type = this.type; + final createdTime = this.createdTime; + final deleted = this.deleted; final description = this.description; + final lastModifiedTime = this.lastModifiedTime; final tags = this.tags; return { 'fieldArn': fieldArn, @@ -2562,7 +3201,11 @@ class GetFieldResponse { 'name': name, 'namespace': namespace.toValue(), 'type': type.toValue(), + if (createdTime != null) 'createdTime': iso8601ToJson(createdTime), + if (deleted != null) 'deleted': deleted, if (description != null) 'description': description, + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), if (tags != null) 'tags': tags, }; } @@ -2582,6 +3225,15 @@ class GetLayoutResponse { /// The name of the layout. It must be unique. final String name; + /// Timestamp at which the resource was created. + final DateTime? createdTime; + + /// Denotes whether or not the resource has been deleted. + final bool? deleted; + + /// Timestamp at which the resource was created or last modified. + final DateTime? lastModifiedTime; + /// A map of of key-value pairs that represent tags on a resource. Tags are used /// to organize, track, or control access for this resource. final Map? tags; @@ -2591,6 +3243,9 @@ class GetLayoutResponse { required this.layoutArn, required this.layoutId, required this.name, + this.createdTime, + this.deleted, + this.lastModifiedTime, this.tags, }); @@ -2600,6 +3255,9 @@ class GetLayoutResponse { layoutArn: json['layoutArn'] as String, layoutId: json['layoutId'] as String, name: json['name'] as String, + createdTime: timeStampFromJson(json['createdTime']), + deleted: json['deleted'] as bool?, + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -2610,12 +3268,19 @@ class GetLayoutResponse { final layoutArn = this.layoutArn; final layoutId = this.layoutId; final name = this.name; + final createdTime = this.createdTime; + final deleted = this.deleted; + final lastModifiedTime = this.lastModifiedTime; final tags = this.tags; return { 'content': content, 'layoutArn': layoutArn, 'layoutId': layoutId, 'name': name, + if (createdTime != null) 'createdTime': iso8601ToJson(createdTime), + if (deleted != null) 'deleted': deleted, + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), if (tags != null) 'tags': tags, }; } @@ -2634,9 +3299,18 @@ class GetTemplateResponse { /// A unique identifier of a template. final String templateId; + /// Timestamp at which the resource was created. + final DateTime? createdTime; + + /// Denotes whether or not the resource has been deleted. + final bool? deleted; + /// A brief description of the template. final String? description; + /// Timestamp at which the resource was created or last modified. + final DateTime? lastModifiedTime; + /// Configuration of layouts associated to the template. final LayoutConfiguration? layoutConfiguration; @@ -2653,7 +3327,10 @@ class GetTemplateResponse { required this.status, required this.templateArn, required this.templateId, + this.createdTime, + this.deleted, this.description, + this.lastModifiedTime, this.layoutConfiguration, this.requiredFields, this.tags, @@ -2665,7 +3342,10 @@ class GetTemplateResponse { status: (json['status'] as String).toTemplateStatus(), templateArn: json['templateArn'] as String, templateId: json['templateId'] as String, + createdTime: timeStampFromJson(json['createdTime']), + deleted: json['deleted'] as bool?, description: json['description'] as String?, + lastModifiedTime: timeStampFromJson(json['lastModifiedTime']), layoutConfiguration: json['layoutConfiguration'] != null ? LayoutConfiguration.fromJson( json['layoutConfiguration'] as Map) @@ -2684,7 +3364,10 @@ class GetTemplateResponse { final status = this.status; final templateArn = this.templateArn; final templateId = this.templateId; + final createdTime = this.createdTime; + final deleted = this.deleted; final description = this.description; + final lastModifiedTime = this.lastModifiedTime; final layoutConfiguration = this.layoutConfiguration; final requiredFields = this.requiredFields; final tags = this.tags; @@ -2693,7 +3376,11 @@ class GetTemplateResponse { 'status': status.toValue(), 'templateArn': templateArn, 'templateId': templateId, + if (createdTime != null) 'createdTime': iso8601ToJson(createdTime), + if (deleted != null) 'deleted': deleted, if (description != null) 'description': description, + if (lastModifiedTime != null) + 'lastModifiedTime': iso8601ToJson(lastModifiedTime), if (layoutConfiguration != null) 'layoutConfiguration': layoutConfiguration, if (requiredFields != null) 'requiredFields': requiredFields, @@ -3084,9 +3771,13 @@ class RelatedItemContent { /// Represents the content of a contact to be returned to agents. final ContactContent? contact; + /// Represents the content of a File to be returned to agents. + final FileContent? file; + RelatedItemContent({ this.comment, this.contact, + this.file, }); factory RelatedItemContent.fromJson(Map json) { @@ -3097,15 +3788,20 @@ class RelatedItemContent { contact: json['contact'] != null ? ContactContent.fromJson(json['contact'] as Map) : null, + file: json['file'] != null + ? FileContent.fromJson(json['file'] as Map) + : null, ); } Map toJson() { final comment = this.comment; final contact = this.contact; + final file = this.file; return { if (comment != null) 'comment': comment, if (contact != null) 'contact': contact, + if (file != null) 'file': file, }; } } @@ -3143,17 +3839,23 @@ class RelatedItemInputContent { /// Object representing a contact in Amazon Connect as an API request field. final Contact? contact; + /// A file of related items. + final FileContent? file; + RelatedItemInputContent({ this.comment, this.contact, + this.file, }); Map toJson() { final comment = this.comment; final contact = this.contact; + final file = this.file; return { if (comment != null) 'comment': comment, if (contact != null) 'contact': contact, + if (file != null) 'file': file, }; } } @@ -3161,6 +3863,7 @@ class RelatedItemInputContent { enum RelatedItemType { contact, comment, + file, } extension RelatedItemTypeValueExtension on RelatedItemType { @@ -3170,6 +3873,8 @@ extension RelatedItemTypeValueExtension on RelatedItemType { return 'Contact'; case RelatedItemType.comment: return 'Comment'; + case RelatedItemType.file: + return 'File'; } } } @@ -3181,6 +3886,8 @@ extension RelatedItemTypeFromString on String { return RelatedItemType.contact; case 'Comment': return RelatedItemType.comment; + case 'File': + return RelatedItemType.file; } throw Exception('$this is not known in enum RelatedItemType'); } @@ -3195,17 +3902,23 @@ class RelatedItemTypeFilter { /// A filter for related items of type Contact. final ContactFilter? contact; + /// A filter for related items of this type of File. + final FileFilter? file; + RelatedItemTypeFilter({ this.comment, this.contact, + this.file, }); Map toJson() { final comment = this.comment; final contact = this.contact; + final file = this.file; return { if (comment != null) 'comment': comment, if (contact != null) 'contact': contact, + if (file != null) 'file': file, }; } } @@ -3366,6 +4079,9 @@ class SearchRelatedItemsResponseItem { /// Type of a related item. final RelatedItemType type; + /// Represents the creator of the related item. + final UserUnion? performedBy; + /// A map of of key-value pairs that represent tags on a resource. Tags are used /// to organize, track, or control access for this resource. final Map? tags; @@ -3375,6 +4091,7 @@ class SearchRelatedItemsResponseItem { required this.content, required this.relatedItemId, required this.type, + this.performedBy, this.tags, }); @@ -3386,6 +4103,9 @@ class SearchRelatedItemsResponseItem { RelatedItemContent.fromJson(json['content'] as Map), relatedItemId: json['relatedItemId'] as String, type: (json['type'] as String).toRelatedItemType(), + performedBy: json['performedBy'] != null + ? UserUnion.fromJson(json['performedBy'] as Map) + : null, tags: (json['tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -3396,12 +4116,14 @@ class SearchRelatedItemsResponseItem { final content = this.content; final relatedItemId = this.relatedItemId; final type = this.type; + final performedBy = this.performedBy; final tags = this.tags; return { 'associationTime': iso8601ToJson(associationTime), 'content': content, 'relatedItemId': relatedItemId, 'type': type.toValue(), + if (performedBy != null) 'performedBy': performedBy, if (tags != null) 'tags': tags, }; } @@ -3575,6 +4297,29 @@ class UpdateTemplateResponse { } } +/// Represents the identity of the person who performed the action. +class UserUnion { + /// Represents the Amazon Connect ARN of the user. + final String? userArn; + + UserUnion({ + this.userArn, + }); + + factory UserUnion.fromJson(Map json) { + return UserUnion( + userArn: json['userArn'] as String?, + ); + } + + Map toJson() { + final userArn = this.userArn; + return { + if (userArn != null) 'userArn': userArn, + }; + } +} + class AccessDeniedException extends _s.GenericAwsException { AccessDeniedException({String? type, String? message}) : super(type: type, code: 'AccessDeniedException', message: message); diff --git a/aws_client/lib/src/generated/connect_participant/v2018_09_07.dart b/aws_client/lib/src/generated/connect_participant/v2018_09_07.dart index c000d4cb8..1b89e2feb 100644 --- a/aws_client/lib/src/generated/connect_participant/v2018_09_07.dart +++ b/aws_client/lib/src/generated/connect_participant/v2018_09_07.dart @@ -61,7 +61,9 @@ class ConnectParticipant { } /// Allows you to confirm that the attachment has been uploaded using the - /// pre-signed URL provided in StartAttachmentUpload API. + /// pre-signed URL provided in StartAttachmentUpload API. A conflict exception + /// is thrown when an attachment with that identifier is already being + /// uploaded. /// /// ConnectionToken is used for invoking this API instead of /// ParticipantToken. @@ -169,8 +171,9 @@ class ConnectParticipant { /// manager participant in non-streaming chats. /// /// Parameter [type] : - /// Type of connection information required. This can be omitted if - /// ConnectParticipant is true. + /// Type of connection information required. If you need + /// CONNECTION_CREDENTIALS along with marking participant as + /// connected, pass CONNECTION_CREDENTIALS in Type. Future createParticipantConnection({ required String participantToken, bool? connectParticipant, @@ -193,6 +196,37 @@ class ConnectParticipant { return CreateParticipantConnectionResponse.fromJson(response); } + /// Retrieves the view for the specified view token. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ValidationException]. + /// + /// Parameter [connectionToken] : + /// The connection token. + /// + /// Parameter [viewToken] : + /// An encrypted token originating from the interactive message of a ShowView + /// block operation. Represents the desired view. + Future describeView({ + required String connectionToken, + required String viewToken, + }) async { + final headers = { + 'X-Amz-Bearer': connectionToken.toString(), + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/participant/views/${Uri.encodeComponent(viewToken)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return DescribeViewResponse.fromJson(response); + } + /// Disconnects a participant. /// /// ConnectionToken is used for invoking this API instead of @@ -280,7 +314,28 @@ class ConnectParticipant { /// for a persistent chat, see Enable /// persistent chat. - /// + /// + /// If you have a process that consumes events in the transcript of an chat + /// that has ended, note that chat transcripts contain the following event + /// content types if the event has occurred during the chat session: + /// + ///
      + ///
    • + /// application/vnd.amazonaws.connect.event.participant.left + ///
    • + ///
    • + /// application/vnd.amazonaws.connect.event.participant.joined + ///
    • + ///
    • + /// application/vnd.amazonaws.connect.event.chat.ended + ///
    • + ///
    • + /// application/vnd.amazonaws.connect.event.transfer.succeeded + ///
    • + ///
    • + /// application/vnd.amazonaws.connect.event.transfer.failed + ///
    • + ///
    /// ConnectionToken is used for invoking this API instead of /// ParticipantToken. /// @@ -352,7 +407,18 @@ class ConnectParticipant { return GetTranscriptResponse.fromJson(response); } - /// Sends an event. + /// + /// The + /// application/vnd.amazonaws.connect.event.connection.acknowledged + /// ContentType will no longer be supported starting December 31, 2024. This + /// event has been migrated to the CreateParticipantConnection + /// API using the ConnectParticipant field. + /// + /// Sends an event. Message receipts are not supported when there are more + /// than two active participants in the chat. Using the SendEvent API for + /// message receipts when a supervisor is barged-in will result in a conflict + /// exception. /// /// ConnectionToken is used for invoking this API instead of /// ParticipantToken. @@ -365,6 +431,7 @@ class ConnectParticipant { /// May throw [InternalServerException]. /// May throw [ThrottlingException]. /// May throw [ValidationException]. + /// May throw [ConflictException]. /// /// Parameter [connectionToken] : /// The authentication token associated with the participant's connection. @@ -377,7 +444,8 @@ class ConnectParticipant { /// application/vnd.amazonaws.connect.event.typing /// ///
  • - /// application/vnd.amazonaws.connect.event.connection.acknowledged + /// application/vnd.amazonaws.connect.event.connection.acknowledged (will be + /// deprecated on December 31, 2024) ///
  • ///
  • /// application/vnd.amazonaws.connect.event.message.delivered @@ -835,6 +903,31 @@ class CreateParticipantConnectionResponse { } } +class DescribeViewResponse { + /// A view resource object. Contains metadata and content necessary to render + /// the view. + final View? view; + + DescribeViewResponse({ + this.view, + }); + + factory DescribeViewResponse.fromJson(Map json) { + return DescribeViewResponse( + view: json['View'] != null + ? View.fromJson(json['View'] as Map) + : null, + ); + } + + Map toJson() { + final view = this.view; + return { + if (view != null) 'View': view, + }; + } +} + class DisconnectParticipantResponse { DisconnectParticipantResponse(); @@ -1072,6 +1165,8 @@ enum ParticipantRole { agent, customer, system, + customBot, + supervisor, } extension ParticipantRoleValueExtension on ParticipantRole { @@ -1083,6 +1178,10 @@ extension ParticipantRoleValueExtension on ParticipantRole { return 'CUSTOMER'; case ParticipantRole.system: return 'SYSTEM'; + case ParticipantRole.customBot: + return 'CUSTOM_BOT'; + case ParticipantRole.supervisor: + return 'SUPERVISOR'; } } } @@ -1096,6 +1195,10 @@ extension ParticipantRoleFromString on String { return ParticipantRole.customer; case 'SYSTEM': return ParticipantRole.system; + case 'CUSTOM_BOT': + return ParticipantRole.customBot; + case 'SUPERVISOR': + return ParticipantRole.supervisor; } throw Exception('$this is not known in enum ParticipantRole'); } @@ -1365,6 +1468,103 @@ class UploadMetadata { } } +/// A view resource object. Contains metadata and content necessary to render +/// the view. +class View { + /// The Amazon Resource Name (ARN) of the view. + final String? arn; + + /// View content containing all content necessary to render a view except for + /// runtime input data. + final ViewContent? content; + + /// The identifier of the view. + final String? id; + + /// The name of the view. + final String? name; + + /// The current version of the view. + final int? version; + + View({ + this.arn, + this.content, + this.id, + this.name, + this.version, + }); + + factory View.fromJson(Map json) { + return View( + arn: json['Arn'] as String?, + content: json['Content'] != null + ? ViewContent.fromJson(json['Content'] as Map) + : null, + id: json['Id'] as String?, + name: json['Name'] as String?, + version: json['Version'] as int?, + ); + } + + Map toJson() { + final arn = this.arn; + final content = this.content; + final id = this.id; + final name = this.name; + final version = this.version; + return { + if (arn != null) 'Arn': arn, + if (content != null) 'Content': content, + if (id != null) 'Id': id, + if (name != null) 'Name': name, + if (version != null) 'Version': version, + }; + } +} + +/// View content containing all content necessary to render a view except for +/// runtime input data. +class ViewContent { + /// A list of actions possible from the view + final List? actions; + + /// The schema representing the input data that the view template must be + /// supplied to render. + final String? inputSchema; + + /// The view template representing the structure of the view. + final String? template; + + ViewContent({ + this.actions, + this.inputSchema, + this.template, + }); + + factory ViewContent.fromJson(Map json) { + return ViewContent( + actions: (json['Actions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + inputSchema: json['InputSchema'] as String?, + template: json['Template'] as String?, + ); + } + + Map toJson() { + final actions = this.actions; + final inputSchema = this.inputSchema; + final template = this.template; + return { + if (actions != null) 'Actions': actions, + if (inputSchema != null) 'InputSchema': inputSchema, + if (template != null) 'Template': template, + }; + } +} + /// The websocket for the participant's connection. class Websocket { /// The URL expiration timestamp in ISO date format. @@ -1413,6 +1613,11 @@ class InternalServerException extends _s.GenericAwsException { : super(type: type, code: 'InternalServerException', message: message); } +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + class ServiceQuotaExceededException extends _s.GenericAwsException { ServiceQuotaExceededException({String? type, String? message}) : super( @@ -1438,6 +1643,8 @@ final _exceptionFns = { ConflictException(type: type, message: message), 'InternalServerException': (type, message) => InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), 'ServiceQuotaExceededException': (type, message) => ServiceQuotaExceededException(type: type, message: message), 'ThrottlingException': (type, message) => diff --git a/aws_client/lib/src/generated/control_catalog/v2018_05_10.dart b/aws_client/lib/src/generated/control_catalog/v2018_05_10.dart new file mode 100644 index 000000000..5000b5fda --- /dev/null +++ b/aws_client/lib/src/generated/control_catalog/v2018_05_10.dart @@ -0,0 +1,668 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Welcome to the Amazon Web Services Control Catalog API reference. This guide +/// is for developers who need detailed information about how to +/// programmatically identify and filter the common controls and related +/// metadata that are available to Amazon Web Services customers. This API +/// reference provides descriptions, syntax, and usage examples for each of the +/// actions and data types that are supported by Amazon Web Services Control +/// Catalog. +/// +/// Use the following links to get started with the Amazon Web Services Control +/// Catalog API: +/// +///
      +///
    • +/// Actions: +/// An alphabetical list of all Control Catalog API operations. +///
    • +///
    • +/// Data +/// types: An alphabetical list of all Control Catalog data types. +///
    • +///
    • +/// Common +/// parameters: Parameters that all operations can use. +///
    • +///
    • +/// Common +/// errors: Client and server errors that all operations can return. +///
    • +///
    +class ControlCatalog { + final _s.RestJsonProtocol _protocol; + ControlCatalog({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'controlcatalog', + signingName: 'controlcatalog', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Returns a paginated list of common controls from the Amazon Web Services + /// Control Catalog. + /// + /// You can apply an optional filter to see common controls that have a + /// specific objective. If you don’t provide a filter, the operation returns + /// all common controls. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [commonControlFilter] : + /// An optional filter that narrows the results to a specific objective. + /// + /// This filter allows you to specify one objective ARN at a time. Passing + /// multiple ARNs in the CommonControlFilter isn’t currently + /// supported. + /// + /// Parameter [maxResults] : + /// The maximum number of results on a page or for an API request call. + /// + /// Parameter [nextToken] : + /// The pagination token that's used to fetch the next set of results. + Future listCommonControls({ + CommonControlFilter? commonControlFilter, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final $payload = { + if (commonControlFilter != null) + 'CommonControlFilter': commonControlFilter, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/common-controls', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListCommonControlsResponse.fromJson(response); + } + + /// Returns a paginated list of domains from the Amazon Web Services Control + /// Catalog. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results on a page or for an API request call. + /// + /// Parameter [nextToken] : + /// The pagination token that's used to fetch the next set of results. + Future listDomains({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: '/domains', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDomainsResponse.fromJson(response); + } + + /// Returns a paginated list of objectives from the Amazon Web Services + /// Control Catalog. + /// + /// You can apply an optional filter to see the objectives that belong to a + /// specific domain. If you don’t provide a filter, the operation returns all + /// objectives. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results on a page or for an API request call. + /// + /// Parameter [nextToken] : + /// The pagination token that's used to fetch the next set of results. + /// + /// Parameter [objectiveFilter] : + /// An optional filter that narrows the results to a specific domain. + /// + /// This filter allows you to specify one domain ARN at a time. Passing + /// multiple ARNs in the ObjectiveFilter isn’t currently + /// supported. + Future listObjectives({ + int? maxResults, + String? nextToken, + ObjectiveFilter? objectiveFilter, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final $payload = { + if (objectiveFilter != null) 'ObjectiveFilter': objectiveFilter, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/objectives', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListObjectivesResponse.fromJson(response); + } +} + +/// A summary of the domain that a common control or an objective belongs to. +class AssociatedDomainSummary { + /// The Amazon Resource Name (ARN) of the related domain. + final String? arn; + + /// The name of the related domain. + final String? name; + + AssociatedDomainSummary({ + this.arn, + this.name, + }); + + factory AssociatedDomainSummary.fromJson(Map json) { + return AssociatedDomainSummary( + arn: json['Arn'] as String?, + name: json['Name'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + return { + if (arn != null) 'Arn': arn, + if (name != null) 'Name': name, + }; + } +} + +/// A summary of the objective that a common control supports. +class AssociatedObjectiveSummary { + /// The Amazon Resource Name (ARN) of the related objective. + final String? arn; + + /// The name of the related objective. + final String? name; + + AssociatedObjectiveSummary({ + this.arn, + this.name, + }); + + factory AssociatedObjectiveSummary.fromJson(Map json) { + return AssociatedObjectiveSummary( + arn: json['Arn'] as String?, + name: json['Name'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + return { + if (arn != null) 'Arn': arn, + if (name != null) 'Name': name, + }; + } +} + +/// An optional filter that narrows the results to a specific objective. +class CommonControlFilter { + /// The objective that's used as filter criteria. + /// + /// You can use this parameter to specify one objective ARN at a time. Passing + /// multiple ARNs in the CommonControlFilter isn’t currently + /// supported. + final List? objectives; + + CommonControlFilter({ + this.objectives, + }); + + Map toJson() { + final objectives = this.objectives; + return { + if (objectives != null) 'Objectives': objectives, + }; + } +} + +/// A summary of metadata for a common control. +class CommonControlSummary { + /// The Amazon Resource Name (ARN) that identifies the common control. + final String arn; + + /// The time when the common control was created. + final DateTime createTime; + + /// The description of the common control. + final String description; + + /// The domain that the common control belongs to. + final AssociatedDomainSummary domain; + + /// The time when the common control was most recently updated. + final DateTime lastUpdateTime; + + /// The name of the common control. + final String name; + + /// The objective that the common control belongs to. + final AssociatedObjectiveSummary objective; + + CommonControlSummary({ + required this.arn, + required this.createTime, + required this.description, + required this.domain, + required this.lastUpdateTime, + required this.name, + required this.objective, + }); + + factory CommonControlSummary.fromJson(Map json) { + return CommonControlSummary( + arn: json['Arn'] as String, + createTime: nonNullableTimeStampFromJson(json['CreateTime'] as Object), + description: json['Description'] as String, + domain: AssociatedDomainSummary.fromJson( + json['Domain'] as Map), + lastUpdateTime: + nonNullableTimeStampFromJson(json['LastUpdateTime'] as Object), + name: json['Name'] as String, + objective: AssociatedObjectiveSummary.fromJson( + json['Objective'] as Map), + ); + } + + Map toJson() { + final arn = this.arn; + final createTime = this.createTime; + final description = this.description; + final domain = this.domain; + final lastUpdateTime = this.lastUpdateTime; + final name = this.name; + final objective = this.objective; + return { + 'Arn': arn, + 'CreateTime': unixTimestampToJson(createTime), + 'Description': description, + 'Domain': domain, + 'LastUpdateTime': unixTimestampToJson(lastUpdateTime), + 'Name': name, + 'Objective': objective, + }; + } +} + +/// The domain resource that's being used as a filter. +class DomainResourceFilter { + /// The Amazon Resource Name (ARN) of the domain. + final String? arn; + + DomainResourceFilter({ + this.arn, + }); + + Map toJson() { + final arn = this.arn; + return { + if (arn != null) 'Arn': arn, + }; + } +} + +/// A summary of metadata for a domain. +class DomainSummary { + /// The Amazon Resource Name (ARN) that identifies the domain. + final String arn; + + /// The time when the domain was created. + final DateTime createTime; + + /// The description of the domain. + final String description; + + /// The time when the domain was most recently updated. + final DateTime lastUpdateTime; + + /// The name of the domain. + final String name; + + DomainSummary({ + required this.arn, + required this.createTime, + required this.description, + required this.lastUpdateTime, + required this.name, + }); + + factory DomainSummary.fromJson(Map json) { + return DomainSummary( + arn: json['Arn'] as String, + createTime: nonNullableTimeStampFromJson(json['CreateTime'] as Object), + description: json['Description'] as String, + lastUpdateTime: + nonNullableTimeStampFromJson(json['LastUpdateTime'] as Object), + name: json['Name'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + final createTime = this.createTime; + final description = this.description; + final lastUpdateTime = this.lastUpdateTime; + final name = this.name; + return { + 'Arn': arn, + 'CreateTime': unixTimestampToJson(createTime), + 'Description': description, + 'LastUpdateTime': unixTimestampToJson(lastUpdateTime), + 'Name': name, + }; + } +} + +class ListCommonControlsResponse { + /// The list of common controls that the ListCommonControls API + /// returns. + final List commonControls; + + /// The pagination token that's used to fetch the next set of results. + final String? nextToken; + + ListCommonControlsResponse({ + required this.commonControls, + this.nextToken, + }); + + factory ListCommonControlsResponse.fromJson(Map json) { + return ListCommonControlsResponse( + commonControls: (json['CommonControls'] as List) + .whereNotNull() + .map((e) => CommonControlSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final commonControls = this.commonControls; + final nextToken = this.nextToken; + return { + 'CommonControls': commonControls, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListDomainsResponse { + /// The list of domains that the ListDomains API returns. + final List domains; + + /// The pagination token that's used to fetch the next set of results. + final String? nextToken; + + ListDomainsResponse({ + required this.domains, + this.nextToken, + }); + + factory ListDomainsResponse.fromJson(Map json) { + return ListDomainsResponse( + domains: (json['Domains'] as List) + .whereNotNull() + .map((e) => DomainSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final domains = this.domains; + final nextToken = this.nextToken; + return { + 'Domains': domains, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListObjectivesResponse { + /// The list of objectives that the ListObjectives API returns. + final List objectives; + + /// The pagination token that's used to fetch the next set of results. + final String? nextToken; + + ListObjectivesResponse({ + required this.objectives, + this.nextToken, + }); + + factory ListObjectivesResponse.fromJson(Map json) { + return ListObjectivesResponse( + objectives: (json['Objectives'] as List) + .whereNotNull() + .map((e) => ObjectiveSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final objectives = this.objectives; + final nextToken = this.nextToken; + return { + 'Objectives': objectives, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +/// An optional filter that narrows the list of objectives to a specific domain. +class ObjectiveFilter { + /// The domain that's used as filter criteria. + /// + /// You can use this parameter to specify one domain ARN at a time. Passing + /// multiple ARNs in the ObjectiveFilter isn’t currently supported. + final List? domains; + + ObjectiveFilter({ + this.domains, + }); + + Map toJson() { + final domains = this.domains; + return { + if (domains != null) 'Domains': domains, + }; + } +} + +/// The objective resource that's being used as a filter. +class ObjectiveResourceFilter { + /// The Amazon Resource Name (ARN) of the objective. + final String? arn; + + ObjectiveResourceFilter({ + this.arn, + }); + + Map toJson() { + final arn = this.arn; + return { + if (arn != null) 'Arn': arn, + }; + } +} + +/// A summary of metadata for an objective. +class ObjectiveSummary { + /// The Amazon Resource Name (ARN) that identifies the objective. + final String arn; + + /// The time when the objective was created. + final DateTime createTime; + + /// The description of the objective. + final String description; + + /// The domain that the objective belongs to. + final AssociatedDomainSummary domain; + + /// The time when the objective was most recently updated. + final DateTime lastUpdateTime; + + /// The name of the objective. + final String name; + + ObjectiveSummary({ + required this.arn, + required this.createTime, + required this.description, + required this.domain, + required this.lastUpdateTime, + required this.name, + }); + + factory ObjectiveSummary.fromJson(Map json) { + return ObjectiveSummary( + arn: json['Arn'] as String, + createTime: nonNullableTimeStampFromJson(json['CreateTime'] as Object), + description: json['Description'] as String, + domain: AssociatedDomainSummary.fromJson( + json['Domain'] as Map), + lastUpdateTime: + nonNullableTimeStampFromJson(json['LastUpdateTime'] as Object), + name: json['Name'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + final createTime = this.createTime; + final description = this.description; + final domain = this.domain; + final lastUpdateTime = this.lastUpdateTime; + final name = this.name; + return { + 'Arn': arn, + 'CreateTime': unixTimestampToJson(createTime), + 'Description': description, + 'Domain': domain, + 'LastUpdateTime': unixTimestampToJson(lastUpdateTime), + 'Name': name, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/control_tower/v2018_05_10.dart b/aws_client/lib/src/generated/control_tower/v2018_05_10.dart index 7add02b55..cb43581e0 100644 --- a/aws_client/lib/src/generated/control_tower/v2018_05_10.dart +++ b/aws_client/lib/src/generated/control_tower/v2018_05_10.dart @@ -19,32 +19,78 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// These interfaces allow you to apply the AWS library of pre-defined -/// controls to your organizational units, programmatically. In this -/// context, controls are the same as AWS Control Tower guardrails. +/// Amazon Web Services Control Tower offers application programming interface +/// (API) operations that support programmatic interaction with these types of +/// resources: +/// +/// +/// For more information about these types of resources, see the +/// Amazon Web Services Control Tower User Guide . +/// +/// About control APIs +/// +/// These interfaces allow you to apply the Amazon Web Services library of +/// pre-defined controls to your organizational units, programmatically. +/// In Amazon Web Services Control Tower, the terms "control" and "guardrail" +/// are synonyms. /// /// To call these APIs, you'll need to know: /// ///
      ///
    • -/// the ControlARN for the control--that is, the guardrail--you are -/// targeting, +/// the controlIdentifier for the control--or guardrail--you are +/// targeting. +///
    • +///
    • +/// the ARN associated with the target organizational unit (OU), which we call +/// the targetIdentifier. ///
    • ///
    • -/// and the ARN associated with the target organizational unit (OU). +/// the ARN associated with a resource that you wish to tag or untag. ///
    • ///
    -/// To get the ControlARN for your AWS Control Tower -/// guardrail: +/// To get the controlIdentifier for your Amazon Web Services +/// Control Tower control: /// -/// The ControlARN contains the control name which is specified in -/// each guardrail. For a list of control names for Strongly recommended -/// and Elective guardrails, see controlIdentifier is an ARN that is specified for each +/// control. You can view the controlIdentifier in the console on +/// the Control details page, as well as in the documentation. +/// +/// The controlIdentifier is unique in each Amazon Web Services +/// Region for each control. You can find the controlIdentifier for +/// each Region and control in the Tables +/// of control metadata or the Control +/// availability by Region tables in the Amazon Web Services Control +/// Tower User Guide. +/// +/// A quick-reference list of control identifers for the Amazon Web Services +/// Control Tower legacy Strongly recommended and Elective +/// controls is given in Resource -/// identifiers for APIs and guardrails in the Automating -/// tasks section of the AWS Control Tower User Guide. Remember that -/// Mandatory guardrails cannot be added or removed. +/// identifiers for APIs and controls in the Controls +/// reference guide section of the Amazon Web Services Control Tower User +/// Guide. Remember that Mandatory controls cannot be added or +/// removed. /// /// ARN format: /// arn:aws:controltower:{REGION}::control/{CONTROL_NAME} @@ -53,36 +99,106 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// /// arn:aws:controltower:us-west-2::control/AWS-GR_AUTOSCALING_LAUNCH_CONFIG_PUBLIC_IP_DISABLED /// -/// To get the ARN for an OU: +/// To get the targetIdentifier: /// -/// In the AWS Organizations console, you can find the ARN for the OU on the -/// Organizational unit details page associated with that OU. +/// The targetIdentifier is the ARN for an OU. +/// +/// In the Amazon Web Services Organizations console, you can find the ARN for +/// the OU on the Organizational unit details page associated with that +/// OU. /// /// OU ARN format: /// /// arn:${Partition}:organizations::${MasterAccountId}:ou/o-${OrganizationId}/ou-${OrganizationalUnitId} -///

    Details and examples +/// +/// About landing zone APIs +/// +/// You can configure and launch an Amazon Web Services Control Tower landing +/// zone with APIs. For an introduction and steps, see Getting +/// started with Amazon Web Services Control Tower using APIs. +/// +/// For an overview of landing zone API operations, see +/// Amazon Web Services Control Tower supports landing zone APIs. The +/// individual API operations for landing zones are detailed in this document, +/// the API +/// reference manual, in the "Actions" section. +/// +/// About baseline APIs +/// +/// You can apply the AWSControlTowerBaseline baseline to an +/// organizational unit (OU) as a way to register the OU with Amazon Web +/// Services Control Tower, programmatically. For a general overview of this +/// capability, see Amazon +/// Web Services Control Tower supports APIs for OU registration and +/// configuration with baselines. +/// +/// You can call the baseline API operations to view the baselines that Amazon +/// Web Services Control Tower enables for your landing zone, on your behalf, +/// when setting up the landing zone. These baselines are read-only baselines. +/// +/// The individual API operations for baselines are detailed in this document, +/// the API +/// reference manual, in the "Actions" section. For usage examples, see Baseline +/// API input and output examples with CLI. +///

    Details and examples /// ///

    /// To view the open source resource repository on GitHub, see Recording API Requests /// -/// AWS Control Tower supports AWS CloudTrail, a service that records AWS API -/// calls for your AWS account and delivers log files to an Amazon S3 bucket. By -/// using information collected by CloudTrail, you can determine which requests -/// the AWS Control Tower service received, who made the request and when, and -/// so on. For more about AWS Control Tower and its support for CloudTrail, see -/// Logging -/// AWS Control Tower Actions with AWS CloudTrail in the AWS Control Tower -/// User Guide. To learn more about CloudTrail, including how to turn it on and -/// find your log files, see the AWS CloudTrail User Guide. +/// Amazon Web Services Control Tower Actions with Amazon Web Services +/// CloudTrail in the Amazon Web Services Control Tower User Guide. To learn +/// more about CloudTrail, including how to turn it on and find your log files, +/// see the Amazon Web Services CloudTrail User Guide. class ControlTower { final _s.RestJsonProtocol _protocol; ControlTower({ @@ -129,10 +247,113 @@ class ControlTower { _protocol.close(); } + /// Creates a new landing zone. This API call starts an asynchronous operation + /// that creates and configures a landing zone, based on the parameters + /// specified in the manifest JSON file. + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [manifest] : + /// The manifest JSON file is a text file that describes your Amazon Web + /// Services resources. For examples, review Launch + /// your landing zone. + /// + /// Parameter [version] : + /// The landing zone version, for example, 3.0. + /// + /// Parameter [tags] : + /// Tags to be applied to the landing zone. + Future createLandingZone({ + required Manifest manifest, + required String version, + Map? tags, + }) async { + final $payload = { + 'manifest': manifest, + 'version': version, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/create-landingzone', + exceptionFnMap: _exceptionFns, + ); + return CreateLandingZoneOutput.fromJson(response); + } + + /// Decommissions a landing zone. This API call starts an asynchronous + /// operation that deletes Amazon Web Services Control Tower resources + /// deployed in accounts managed by Amazon Web Services Control Tower. + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [landingZoneIdentifier] : + /// The unique identifier of the landing zone. + Future deleteLandingZone({ + required String landingZoneIdentifier, + }) async { + final $payload = { + 'landingZoneIdentifier': landingZoneIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/delete-landingzone', + exceptionFnMap: _exceptionFns, + ); + return DeleteLandingZoneOutput.fromJson(response); + } + + /// Disable an EnabledBaseline resource on the specified Target. + /// This API starts an asynchronous operation to remove all resources deployed + /// as part of the baseline enablement. The resource will vary depending on + /// the enabled baseline. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [enabledBaselineIdentifier] : + /// Identifier of the EnabledBaseline resource to be deactivated, + /// in ARN format. + Future disableBaseline({ + required String enabledBaselineIdentifier, + }) async { + final $payload = { + 'enabledBaselineIdentifier': enabledBaselineIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/disable-baseline', + exceptionFnMap: _exceptionFns, + ); + return DisableBaselineOutput.fromJson(response); + } + /// This API call turns off a control. It starts an asynchronous operation /// that deletes AWS resources on the specified organizational unit and the /// accounts it contains. The resources will vary according to the control - /// that you specify. + /// that you specify. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . /// /// May throw [ValidationException]. /// May throw [ConflictException]. @@ -145,10 +366,16 @@ class ControlTower { /// Parameter [controlIdentifier] : /// The ARN of the control. Only Strongly recommended and /// Elective controls are permitted, with the exception of the - /// Region deny guardrail. + /// Region deny control. For information on how to find the + /// controlIdentifier, see the + /// overview page. /// /// Parameter [targetIdentifier] : - /// The ARN of the organizational unit. + /// The ARN of the organizational unit. For information on how to find the + /// targetIdentifier, see the + /// overview page. Future disableControl({ required String controlIdentifier, required String targetIdentifier, @@ -166,10 +393,66 @@ class ControlTower { return DisableControlOutput.fromJson(response); } + /// Enable (apply) a Baseline to a Target. This API starts an + /// asynchronous operation to deploy resources specified by the + /// Baseline to the specified Target. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [baselineIdentifier] : + /// The ARN of the baseline to be enabled. + /// + /// Parameter [baselineVersion] : + /// The specific version to be enabled of the specified baseline. + /// + /// Parameter [targetIdentifier] : + /// The ARN of the target on which the baseline will be enabled. Only OUs are + /// supported as targets. + /// + /// Parameter [parameters] : + /// A list of key-value objects that specify enablement + /// parameters, where key is a string and value is a + /// document of any type. + /// + /// Parameter [tags] : + /// Tags associated with input to EnableBaseline. + Future enableBaseline({ + required String baselineIdentifier, + required String baselineVersion, + required String targetIdentifier, + List? parameters, + Map? tags, + }) async { + final $payload = { + 'baselineIdentifier': baselineIdentifier, + 'baselineVersion': baselineVersion, + 'targetIdentifier': targetIdentifier, + if (parameters != null) 'parameters': parameters, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/enable-baseline', + exceptionFnMap: _exceptionFns, + ); + return EnableBaselineOutput.fromJson(response); + } + /// This API call activates a control. It starts an asynchronous operation - /// that creates AWS resources on the specified organizational unit and the - /// accounts it contains. The resources created will vary according to the - /// control that you specify. + /// that creates Amazon Web Services resources on the specified organizational + /// unit and the accounts it contains. The resources created will vary + /// according to the control that you specify. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . /// /// May throw [ValidationException]. /// May throw [ConflictException]. @@ -182,17 +465,34 @@ class ControlTower { /// Parameter [controlIdentifier] : /// The ARN of the control. Only Strongly recommended and /// Elective controls are permitted, with the exception of the - /// Region deny guardrail. + /// Region deny control. For information on how to find the + /// controlIdentifier, see the + /// overview page. /// /// Parameter [targetIdentifier] : - /// The ARN of the organizational unit. + /// The ARN of the organizational unit. For information on how to find the + /// targetIdentifier, see the + /// overview page. + /// + /// Parameter [parameters] : + /// A list of input parameter values, which are specified to configure the + /// control when you enable it. + /// + /// Parameter [tags] : + /// Tags to be applied to the EnabledControl resource. Future enableControl({ required String controlIdentifier, required String targetIdentifier, + List? parameters, + Map? tags, }) async { final $payload = { 'controlIdentifier': controlIdentifier, 'targetIdentifier': targetIdentifier, + if (parameters != null) 'parameters': parameters, + if (tags != null) 'tags': tags, }; final response = await _protocol.send( payload: $payload, @@ -203,9 +503,72 @@ class ControlTower { return EnableControlOutput.fromJson(response); } + /// Retrieve details about an existing Baseline resource by + /// specifying its identifier. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [baselineIdentifier] : + /// The ARN of the Baseline resource to be retrieved. + Future getBaseline({ + required String baselineIdentifier, + }) async { + final $payload = { + 'baselineIdentifier': baselineIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-baseline', + exceptionFnMap: _exceptionFns, + ); + return GetBaselineOutput.fromJson(response); + } + + /// Returns the details of an asynchronous baseline operation, as initiated by + /// any of these APIs: EnableBaseline, + /// DisableBaseline, UpdateEnabledBaseline, + /// ResetEnabledBaseline. A status message is displayed in case + /// of operation failure. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [operationIdentifier] : + /// The operation ID returned from mutating asynchronous APIs (Enable, + /// Disable, Update, Reset). + Future getBaselineOperation({ + required String operationIdentifier, + }) async { + final $payload = { + 'operationIdentifier': operationIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-baseline-operation', + exceptionFnMap: _exceptionFns, + ); + return GetBaselineOperationOutput.fromJson(response); + } + /// Returns the status of a particular EnableControl or /// DisableControl operation. Displays a message in case of - /// error. Details for an operation are available for 90 days. + /// error. Details for an operation are available for 90 days. For usage + /// examples, see + /// the Amazon Web Services Control Tower User Guide . /// /// May throw [ValidationException]. /// May throw [InternalServerException]. @@ -231,8 +594,8 @@ class ControlTower { return GetControlOperationOutput.fromJson(response); } - /// Lists the controls enabled by AWS Control Tower on the specified - /// organizational unit and the accounts it contains. + /// Retrieve details of an EnabledBaseline resource by specifying + /// its identifier. /// /// May throw [ValidationException]. /// May throw [InternalServerException]. @@ -240,61 +603,2193 @@ class ControlTower { /// May throw [ThrottlingException]. /// May throw [ResourceNotFoundException]. /// - /// Parameter [targetIdentifier] : - /// The ARN of the organizational unit. + /// Parameter [enabledBaselineIdentifier] : + /// Identifier of the EnabledBaseline resource to be retrieved, + /// in ARN format. + Future getEnabledBaseline({ + required String enabledBaselineIdentifier, + }) async { + final $payload = { + 'enabledBaselineIdentifier': enabledBaselineIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-enabled-baseline', + exceptionFnMap: _exceptionFns, + ); + return GetEnabledBaselineOutput.fromJson(response); + } + + /// Retrieves details about an enabled control. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [enabledControlIdentifier] : + /// The controlIdentifier of the enabled control. + Future getEnabledControl({ + required String enabledControlIdentifier, + }) async { + final $payload = { + 'enabledControlIdentifier': enabledControlIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-enabled-control', + exceptionFnMap: _exceptionFns, + ); + return GetEnabledControlOutput.fromJson(response); + } + + /// Returns details about the landing zone. Displays a message in case of + /// error. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [landingZoneIdentifier] : + /// The unique identifier of the landing zone. + Future getLandingZone({ + required String landingZoneIdentifier, + }) async { + final $payload = { + 'landingZoneIdentifier': landingZoneIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-landingzone', + exceptionFnMap: _exceptionFns, + ); + return GetLandingZoneOutput.fromJson(response); + } + + /// Returns the status of the specified landing zone operation. Details for an + /// operation are available for 90 days. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [operationIdentifier] : + /// A unique identifier assigned to a landing zone operation. + Future getLandingZoneOperation({ + required String operationIdentifier, + }) async { + final $payload = { + 'operationIdentifier': operationIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/get-landingzone-operation', + exceptionFnMap: _exceptionFns, + ); + return GetLandingZoneOperationOutput.fromJson(response); + } + + /// Returns a summary list of all available baselines. For usage examples, see + /// + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. /// /// Parameter [maxResults] : - /// How many results to return per API call. + /// The maximum number of results to be shown. /// /// Parameter [nextToken] : - /// The token to continue the list from a previous API call with the same - /// parameters. - Future listEnabledControls({ - required String targetIdentifier, + /// A pagination token. + Future listBaselines({ int? maxResults, String? nextToken, }) async { _s.validateNumRange( 'maxResults', maxResults, - 1, + 4, 100, ); final $payload = { - 'targetIdentifier': targetIdentifier, if (maxResults != null) 'maxResults': maxResults, if (nextToken != null) 'nextToken': nextToken, }; final response = await _protocol.send( payload: $payload, method: 'POST', - requestUri: '/list-enabled-controls', + requestUri: '/list-baselines', exceptionFnMap: _exceptionFns, ); - return ListEnabledControlsOutput.fromJson(response); + return ListBaselinesOutput.fromJson(response); } -} - -/// An operation performed by the control. -class ControlOperation { - /// The time that the operation finished. - final DateTime? endTime; + + /// Provides a list of operations in progress or queued. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [filter] : + /// An input filter for the ListControlOperations API that lets + /// you select the types of control operations to view. + /// + /// Parameter [maxResults] : + /// The maximum number of results to be shown. + /// + /// Parameter [nextToken] : + /// A pagination token. + Future listControlOperations({ + ControlOperationFilter? filter, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + if (filter != null) 'filter': filter, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-control-operations', + exceptionFnMap: _exceptionFns, + ); + return ListControlOperationsOutput.fromJson(response); + } + + /// Returns a list of summaries describing EnabledBaseline + /// resources. You can filter the list by the corresponding + /// Baseline or Target of the + /// EnabledBaseline resources. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [filter] : + /// A filter applied on the ListEnabledBaseline operation. + /// Allowed filters are baselineIdentifiers and + /// targetIdentifiers. The filter can be applied for either, or + /// both. + /// + /// Parameter [maxResults] : + /// The maximum number of results to be shown. + /// + /// Parameter [nextToken] : + /// A pagination token. + Future listEnabledBaselines({ + EnabledBaselineFilter? filter, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 5, + 100, + ); + final $payload = { + if (filter != null) 'filter': filter, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-enabled-baselines', + exceptionFnMap: _exceptionFns, + ); + return ListEnabledBaselinesOutput.fromJson(response); + } + + /// Lists the controls enabled by Amazon Web Services Control Tower on the + /// specified organizational unit and the accounts it contains. For usage + /// examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [filter] : + /// An input filter for the ListCEnabledControls API that lets + /// you select the types of control operations to view. + /// + /// Parameter [maxResults] : + /// How many results to return per API call. + /// + /// Parameter [nextToken] : + /// The token to continue the list from a previous API call with the same + /// parameters. + /// + /// Parameter [targetIdentifier] : + /// The ARN of the organizational unit. For information on how to find the + /// targetIdentifier, see the + /// overview page. + Future listEnabledControls({ + EnabledControlFilter? filter, + int? maxResults, + String? nextToken, + String? targetIdentifier, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 200, + ); + final $payload = { + if (filter != null) 'filter': filter, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (targetIdentifier != null) 'targetIdentifier': targetIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-enabled-controls', + exceptionFnMap: _exceptionFns, + ); + return ListEnabledControlsOutput.fromJson(response); + } + + /// Returns the landing zone ARN for the landing zone deployed in your managed + /// account. This API also creates an ARN for existing accounts that do not + /// yet have a landing zone ARN. + /// + /// Returns one landing zone ARN. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [maxResults] : + /// The maximum number of returned landing zone ARNs, which is one. + /// + /// Parameter [nextToken] : + /// The token to continue the list from a previous API call with the same + /// parameters. + Future listLandingZones({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1, + ); + final $payload = { + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/list-landingzones', + exceptionFnMap: _exceptionFns, + ); + return ListLandingZonesOutput.fromJson(response); + } + + /// Returns a list of tags associated with the resource. For usage examples, + /// see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceOutput.fromJson(response); + } + + /// Re-enables an EnabledBaseline resource. For example, this API + /// can re-apply the existing Baseline after a new member account + /// is moved to the target OU. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [enabledBaselineIdentifier] : + /// Specifies the ID of the EnabledBaseline resource to be + /// re-enabled, in ARN format. + Future resetEnabledBaseline({ + required String enabledBaselineIdentifier, + }) async { + final $payload = { + 'enabledBaselineIdentifier': enabledBaselineIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/reset-enabled-baseline', + exceptionFnMap: _exceptionFns, + ); + return ResetEnabledBaselineOutput.fromJson(response); + } + + /// This API call resets a landing zone. It starts an asynchronous operation + /// that resets the landing zone to the parameters specified in its original + /// configuration. + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [landingZoneIdentifier] : + /// The unique identifier of the landing zone. + Future resetLandingZone({ + required String landingZoneIdentifier, + }) async { + final $payload = { + 'landingZoneIdentifier': landingZoneIdentifier, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/reset-landingzone', + exceptionFnMap: _exceptionFns, + ); + return ResetLandingZoneOutput.fromJson(response); + } + + /// Applies tags to a resource. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource to be tagged. + /// + /// Parameter [tags] : + /// Tags to be applied to the resource. + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes tags from a resource. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource. + /// + /// Parameter [tagKeys] : + /// Tag keys to be removed from the resource. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates an EnabledBaseline resource's applied parameters or + /// version. For usage examples, see + /// the Amazon Web Services Control Tower User Guide . + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [baselineVersion] : + /// Specifies the new Baseline version, to which the + /// EnabledBaseline should be updated. + /// + /// Parameter [enabledBaselineIdentifier] : + /// Specifies the EnabledBaseline resource to be updated. + /// + /// Parameter [parameters] : + /// Parameters to apply when making an update. + Future updateEnabledBaseline({ + required String baselineVersion, + required String enabledBaselineIdentifier, + List? parameters, + }) async { + final $payload = { + 'baselineVersion': baselineVersion, + 'enabledBaselineIdentifier': enabledBaselineIdentifier, + if (parameters != null) 'parameters': parameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-enabled-baseline', + exceptionFnMap: _exceptionFns, + ); + return UpdateEnabledBaselineOutput.fromJson(response); + } + + /// Updates the configuration of an already enabled control. + /// + /// If the enabled control shows an EnablementStatus of + /// SUCCEEDED, supply parameters that are different from the currently + /// configured parameters. Otherwise, Amazon Web Services Control Tower will + /// not accept the request. + /// + /// If the enabled control shows an EnablementStatus of FAILED, + /// Amazon Web Services Control Tower will update the control to match any + /// valid parameters that you supply. + /// + /// If the DriftSummary status for the control shows as DRIFTED, + /// you cannot call this API. Instead, you can update the control by calling + /// DisableControl and again calling EnableControl, + /// or you can run an extending governance operation. For usage examples, see + /// + /// the Amazon Web Services Control Tower User Guide + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [enabledControlIdentifier] : + /// The ARN of the enabled control that will be updated. + /// + /// Parameter [parameters] : + /// A key/value pair, where Key is of type String + /// and Value is of type Document. + Future updateEnabledControl({ + required String enabledControlIdentifier, + required List parameters, + }) async { + final $payload = { + 'enabledControlIdentifier': enabledControlIdentifier, + 'parameters': parameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-enabled-control', + exceptionFnMap: _exceptionFns, + ); + return UpdateEnabledControlOutput.fromJson(response); + } + + /// This API call updates the landing zone. It starts an asynchronous + /// operation that updates the landing zone based on the new landing zone + /// version, or on the changed parameters specified in the updated manifest + /// file. + /// + /// May throw [ValidationException]. + /// May throw [ConflictException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [landingZoneIdentifier] : + /// The unique identifier of the landing zone. + /// + /// Parameter [manifest] : + /// The manifest JSON file is a text file that describes your Amazon Web + /// Services resources. For examples, review Launch + /// your landing zone. + /// + /// Parameter [version] : + /// The landing zone version, for example, 3.2. + Future updateLandingZone({ + required String landingZoneIdentifier, + required Manifest manifest, + required String version, + }) async { + final $payload = { + 'landingZoneIdentifier': landingZoneIdentifier, + 'manifest': manifest, + 'version': version, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/update-landingzone', + exceptionFnMap: _exceptionFns, + ); + return UpdateLandingZoneOutput.fromJson(response); + } +} + +/// An object of shape BaselineOperation, returning details about +/// the specified Baseline operation ID. +class BaselineOperation { + /// The end time of the operation (if applicable), in ISO 8601 format. + final DateTime? endTime; + + /// The identifier of the specified operation. + final String? operationIdentifier; + + /// An enumerated type (enum) with possible values of + /// ENABLE_BASELINE, DISABLE_BASELINE, + /// UPDATE_ENABLED_BASELINE, or + /// RESET_ENABLED_BASELINE. + final BaselineOperationType? operationType; + + /// The start time of the operation, in ISO 8601 format. + final DateTime? startTime; + + /// An enumerated type (enum) with possible values of + /// SUCCEEDED, FAILED, or IN_PROGRESS. + final BaselineOperationStatus? status; + + /// A status message that gives more information about the operation's status, + /// if applicable. + final String? statusMessage; + + BaselineOperation({ + this.endTime, + this.operationIdentifier, + this.operationType, + this.startTime, + this.status, + this.statusMessage, + }); + + factory BaselineOperation.fromJson(Map json) { + return BaselineOperation( + endTime: timeStampFromJson(json['endTime']), + operationIdentifier: json['operationIdentifier'] as String?, + operationType: + (json['operationType'] as String?)?.toBaselineOperationType(), + startTime: timeStampFromJson(json['startTime']), + status: (json['status'] as String?)?.toBaselineOperationStatus(), + statusMessage: json['statusMessage'] as String?, + ); + } + + Map toJson() { + final endTime = this.endTime; + final operationIdentifier = this.operationIdentifier; + final operationType = this.operationType; + final startTime = this.startTime; + final status = this.status; + final statusMessage = this.statusMessage; + return { + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (operationIdentifier != null) + 'operationIdentifier': operationIdentifier, + if (operationType != null) 'operationType': operationType.toValue(), + if (startTime != null) 'startTime': iso8601ToJson(startTime), + if (status != null) 'status': status.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + }; + } +} + +enum BaselineOperationStatus { + succeeded, + failed, + inProgress, +} + +extension BaselineOperationStatusValueExtension on BaselineOperationStatus { + String toValue() { + switch (this) { + case BaselineOperationStatus.succeeded: + return 'SUCCEEDED'; + case BaselineOperationStatus.failed: + return 'FAILED'; + case BaselineOperationStatus.inProgress: + return 'IN_PROGRESS'; + } + } +} + +extension BaselineOperationStatusFromString on String { + BaselineOperationStatus toBaselineOperationStatus() { + switch (this) { + case 'SUCCEEDED': + return BaselineOperationStatus.succeeded; + case 'FAILED': + return BaselineOperationStatus.failed; + case 'IN_PROGRESS': + return BaselineOperationStatus.inProgress; + } + throw Exception('$this is not known in enum BaselineOperationStatus'); + } +} + +enum BaselineOperationType { + enableBaseline, + disableBaseline, + updateEnabledBaseline, + resetEnabledBaseline, +} + +extension BaselineOperationTypeValueExtension on BaselineOperationType { + String toValue() { + switch (this) { + case BaselineOperationType.enableBaseline: + return 'ENABLE_BASELINE'; + case BaselineOperationType.disableBaseline: + return 'DISABLE_BASELINE'; + case BaselineOperationType.updateEnabledBaseline: + return 'UPDATE_ENABLED_BASELINE'; + case BaselineOperationType.resetEnabledBaseline: + return 'RESET_ENABLED_BASELINE'; + } + } +} + +extension BaselineOperationTypeFromString on String { + BaselineOperationType toBaselineOperationType() { + switch (this) { + case 'ENABLE_BASELINE': + return BaselineOperationType.enableBaseline; + case 'DISABLE_BASELINE': + return BaselineOperationType.disableBaseline; + case 'UPDATE_ENABLED_BASELINE': + return BaselineOperationType.updateEnabledBaseline; + case 'RESET_ENABLED_BASELINE': + return BaselineOperationType.resetEnabledBaseline; + } + throw Exception('$this is not known in enum BaselineOperationType'); + } +} + +/// Returns a summary of information about a Baseline object. +class BaselineSummary { + /// The full ARN of a Baseline. + final String arn; + + /// The human-readable name of a Baseline. + final String name; + + /// A summary description of a Baseline. + final String? description; + + BaselineSummary({ + required this.arn, + required this.name, + this.description, + }); + + factory BaselineSummary.fromJson(Map json) { + return BaselineSummary( + arn: json['arn'] as String, + name: json['name'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final description = this.description; + return { + 'arn': arn, + 'name': name, + if (description != null) 'description': description, + }; + } +} + +/// An operation performed by the control. +class ControlOperation { + /// The controlIdentifier of the control for the operation. + final String? controlIdentifier; + + /// The controlIdentifier of the enabled control. + final String? enabledControlIdentifier; + + /// The time that the operation finished. + final DateTime? endTime; + + /// The identifier of the specified operation. + final String? operationIdentifier; /// One of ENABLE_CONTROL or DISABLE_CONTROL. final ControlOperationType? operationType; - /// The time that the operation began. + /// The time that the operation began. + final DateTime? startTime; + + /// One of IN_PROGRESS, SUCEEDED, or + /// FAILED. + final ControlOperationStatus? status; + + /// If the operation result is FAILED, this string contains a + /// message explaining why the operation failed. + final String? statusMessage; + + /// The target upon which the control operation is working. + final String? targetIdentifier; + + ControlOperation({ + this.controlIdentifier, + this.enabledControlIdentifier, + this.endTime, + this.operationIdentifier, + this.operationType, + this.startTime, + this.status, + this.statusMessage, + this.targetIdentifier, + }); + + factory ControlOperation.fromJson(Map json) { + return ControlOperation( + controlIdentifier: json['controlIdentifier'] as String?, + enabledControlIdentifier: json['enabledControlIdentifier'] as String?, + endTime: timeStampFromJson(json['endTime']), + operationIdentifier: json['operationIdentifier'] as String?, + operationType: + (json['operationType'] as String?)?.toControlOperationType(), + startTime: timeStampFromJson(json['startTime']), + status: (json['status'] as String?)?.toControlOperationStatus(), + statusMessage: json['statusMessage'] as String?, + targetIdentifier: json['targetIdentifier'] as String?, + ); + } + + Map toJson() { + final controlIdentifier = this.controlIdentifier; + final enabledControlIdentifier = this.enabledControlIdentifier; + final endTime = this.endTime; + final operationIdentifier = this.operationIdentifier; + final operationType = this.operationType; + final startTime = this.startTime; + final status = this.status; + final statusMessage = this.statusMessage; + final targetIdentifier = this.targetIdentifier; + return { + if (controlIdentifier != null) 'controlIdentifier': controlIdentifier, + if (enabledControlIdentifier != null) + 'enabledControlIdentifier': enabledControlIdentifier, + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (operationIdentifier != null) + 'operationIdentifier': operationIdentifier, + if (operationType != null) 'operationType': operationType.toValue(), + if (startTime != null) 'startTime': iso8601ToJson(startTime), + if (status != null) 'status': status.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (targetIdentifier != null) 'targetIdentifier': targetIdentifier, + }; + } +} + +/// A filter object that lets you call ListCOntrolOperations with a +/// specific filter. +class ControlOperationFilter { + /// The set of controlIdentifier returned by the filter. + final List? controlIdentifiers; + + /// The set of ControlOperation objects returned by the filter. + final List? controlOperationTypes; + + /// The set controlIdentifier of enabled controls selected by the + /// filter. + final List? enabledControlIdentifiers; + + /// Lists the status of control operations. + final List? statuses; + + /// The set of targetIdentifier objects returned by the filter. + final List? targetIdentifiers; + + ControlOperationFilter({ + this.controlIdentifiers, + this.controlOperationTypes, + this.enabledControlIdentifiers, + this.statuses, + this.targetIdentifiers, + }); + + Map toJson() { + final controlIdentifiers = this.controlIdentifiers; + final controlOperationTypes = this.controlOperationTypes; + final enabledControlIdentifiers = this.enabledControlIdentifiers; + final statuses = this.statuses; + final targetIdentifiers = this.targetIdentifiers; + return { + if (controlIdentifiers != null) 'controlIdentifiers': controlIdentifiers, + if (controlOperationTypes != null) + 'controlOperationTypes': + controlOperationTypes.map((e) => e.toValue()).toList(), + if (enabledControlIdentifiers != null) + 'enabledControlIdentifiers': enabledControlIdentifiers, + if (statuses != null) + 'statuses': statuses.map((e) => e.toValue()).toList(), + if (targetIdentifiers != null) 'targetIdentifiers': targetIdentifiers, + }; + } +} + +enum ControlOperationStatus { + succeeded, + failed, + inProgress, +} + +extension ControlOperationStatusValueExtension on ControlOperationStatus { + String toValue() { + switch (this) { + case ControlOperationStatus.succeeded: + return 'SUCCEEDED'; + case ControlOperationStatus.failed: + return 'FAILED'; + case ControlOperationStatus.inProgress: + return 'IN_PROGRESS'; + } + } +} + +extension ControlOperationStatusFromString on String { + ControlOperationStatus toControlOperationStatus() { + switch (this) { + case 'SUCCEEDED': + return ControlOperationStatus.succeeded; + case 'FAILED': + return ControlOperationStatus.failed; + case 'IN_PROGRESS': + return ControlOperationStatus.inProgress; + } + throw Exception('$this is not known in enum ControlOperationStatus'); + } +} + +/// A summary of information about the specified control operation. +class ControlOperationSummary { + /// The controlIdentifier of a control. + final String? controlIdentifier; + + /// The controlIdentifier of an enabled control. + final String? enabledControlIdentifier; + + /// The time at which the control operation was completed. + final DateTime? endTime; + + /// The unique identifier of a control operation. + final String? operationIdentifier; + + /// The type of operation. + final ControlOperationType? operationType; + + /// The time at which a control operation began. + final DateTime? startTime; + + /// The status of the specified control operation. + final ControlOperationStatus? status; + + /// A speficic message displayed as part of the control status. + final String? statusMessage; + + /// The unique identifier of the target of a control operation. + final String? targetIdentifier; + + ControlOperationSummary({ + this.controlIdentifier, + this.enabledControlIdentifier, + this.endTime, + this.operationIdentifier, + this.operationType, + this.startTime, + this.status, + this.statusMessage, + this.targetIdentifier, + }); + + factory ControlOperationSummary.fromJson(Map json) { + return ControlOperationSummary( + controlIdentifier: json['controlIdentifier'] as String?, + enabledControlIdentifier: json['enabledControlIdentifier'] as String?, + endTime: timeStampFromJson(json['endTime']), + operationIdentifier: json['operationIdentifier'] as String?, + operationType: + (json['operationType'] as String?)?.toControlOperationType(), + startTime: timeStampFromJson(json['startTime']), + status: (json['status'] as String?)?.toControlOperationStatus(), + statusMessage: json['statusMessage'] as String?, + targetIdentifier: json['targetIdentifier'] as String?, + ); + } + + Map toJson() { + final controlIdentifier = this.controlIdentifier; + final enabledControlIdentifier = this.enabledControlIdentifier; + final endTime = this.endTime; + final operationIdentifier = this.operationIdentifier; + final operationType = this.operationType; + final startTime = this.startTime; + final status = this.status; + final statusMessage = this.statusMessage; + final targetIdentifier = this.targetIdentifier; + return { + if (controlIdentifier != null) 'controlIdentifier': controlIdentifier, + if (enabledControlIdentifier != null) + 'enabledControlIdentifier': enabledControlIdentifier, + if (endTime != null) 'endTime': iso8601ToJson(endTime), + if (operationIdentifier != null) + 'operationIdentifier': operationIdentifier, + if (operationType != null) 'operationType': operationType.toValue(), + if (startTime != null) 'startTime': iso8601ToJson(startTime), + if (status != null) 'status': status.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (targetIdentifier != null) 'targetIdentifier': targetIdentifier, + }; + } +} + +enum ControlOperationType { + enableControl, + disableControl, + updateEnabledControl, +} + +extension ControlOperationTypeValueExtension on ControlOperationType { + String toValue() { + switch (this) { + case ControlOperationType.enableControl: + return 'ENABLE_CONTROL'; + case ControlOperationType.disableControl: + return 'DISABLE_CONTROL'; + case ControlOperationType.updateEnabledControl: + return 'UPDATE_ENABLED_CONTROL'; + } + } +} + +extension ControlOperationTypeFromString on String { + ControlOperationType toControlOperationType() { + switch (this) { + case 'ENABLE_CONTROL': + return ControlOperationType.enableControl; + case 'DISABLE_CONTROL': + return ControlOperationType.disableControl; + case 'UPDATE_ENABLED_CONTROL': + return ControlOperationType.updateEnabledControl; + } + throw Exception('$this is not known in enum ControlOperationType'); + } +} + +class CreateLandingZoneOutput { + /// The ARN of the landing zone resource. + final String arn; + + /// A unique identifier assigned to a CreateLandingZone operation. + /// You can use this identifier as an input of + /// GetLandingZoneOperation to check the operation's status. + final String operationIdentifier; + + CreateLandingZoneOutput({ + required this.arn, + required this.operationIdentifier, + }); + + factory CreateLandingZoneOutput.fromJson(Map json) { + return CreateLandingZoneOutput( + arn: json['arn'] as String, + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + final operationIdentifier = this.operationIdentifier; + return { + 'arn': arn, + 'operationIdentifier': operationIdentifier, + }; + } +} + +class DeleteLandingZoneOutput { + /// >A unique identifier assigned to a DeleteLandingZone + /// operation. You can use this identifier as an input parameter of + /// GetLandingZoneOperation to check the operation's status. + final String operationIdentifier; + + DeleteLandingZoneOutput({ + required this.operationIdentifier, + }); + + factory DeleteLandingZoneOutput.fromJson(Map json) { + return DeleteLandingZoneOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class DisableBaselineOutput { + /// The ID (in UUID format) of the asynchronous DisableBaseline + /// operation. This operationIdentifier is used to track status + /// through calls to the GetBaselineOperation API. + final String operationIdentifier; + + DisableBaselineOutput({ + required this.operationIdentifier, + }); + + factory DisableBaselineOutput.fromJson(Map json) { + return DisableBaselineOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class DisableControlOutput { + /// The ID of the asynchronous operation, which is used to track status. The + /// operation is available for 90 days. + final String operationIdentifier; + + DisableControlOutput({ + required this.operationIdentifier, + }); + + factory DisableControlOutput.fromJson(Map json) { + return DisableControlOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class Document { + Document(); + + factory Document.fromJson(Map _) { + return Document(); + } + + Map toJson() { + return {}; + } +} + +enum DriftStatus { + drifted, + inSync, + notChecking, + unknown, +} + +extension DriftStatusValueExtension on DriftStatus { + String toValue() { + switch (this) { + case DriftStatus.drifted: + return 'DRIFTED'; + case DriftStatus.inSync: + return 'IN_SYNC'; + case DriftStatus.notChecking: + return 'NOT_CHECKING'; + case DriftStatus.unknown: + return 'UNKNOWN'; + } + } +} + +extension DriftStatusFromString on String { + DriftStatus toDriftStatus() { + switch (this) { + case 'DRIFTED': + return DriftStatus.drifted; + case 'IN_SYNC': + return DriftStatus.inSync; + case 'NOT_CHECKING': + return DriftStatus.notChecking; + case 'UNKNOWN': + return DriftStatus.unknown; + } + throw Exception('$this is not known in enum DriftStatus'); + } +} + +/// The drift summary of the enabled control. +/// +/// Amazon Web Services Control Tower expects the enabled control configuration +/// to include all supported and governed Regions. If the enabled control +/// differs from the expected configuration, it is defined to be in a state of +/// drift. You can repair this drift by resetting the enabled control. +class DriftStatusSummary { + /// The drift status of the enabled control. + /// + /// Valid values: + /// + ///
      + ///
    • + /// DRIFTED: The enabledControl deployed in this + /// configuration doesn’t match the configuration that Amazon Web Services + /// Control Tower expected. + ///
    • + ///
    • + /// IN_SYNC: The enabledControl deployed in this + /// configuration matches the configuration that Amazon Web Services Control + /// Tower expected. + ///
    • + ///
    • + /// NOT_CHECKING: Amazon Web Services Control Tower does not check + /// drift for this enabled control. Drift is not supported for the control type. + ///
    • + ///
    • + /// UNKNOWN: Amazon Web Services Control Tower is not able to check + /// the drift status for the enabled control. + ///
    • + ///
    + final DriftStatus? driftStatus; + + DriftStatusSummary({ + this.driftStatus, + }); + + factory DriftStatusSummary.fromJson(Map json) { + return DriftStatusSummary( + driftStatus: (json['driftStatus'] as String?)?.toDriftStatus(), + ); + } + + Map toJson() { + final driftStatus = this.driftStatus; + return { + if (driftStatus != null) 'driftStatus': driftStatus.toValue(), + }; + } +} + +class EnableBaselineOutput { + /// The ARN of the EnabledBaseline resource. + final String arn; + + /// The ID (in UUID format) of the asynchronous EnableBaseline + /// operation. This operationIdentifier is used to track status + /// through calls to the GetBaselineOperation API. + final String operationIdentifier; + + EnableBaselineOutput({ + required this.arn, + required this.operationIdentifier, + }); + + factory EnableBaselineOutput.fromJson(Map json) { + return EnableBaselineOutput( + arn: json['arn'] as String, + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final arn = this.arn; + final operationIdentifier = this.operationIdentifier; + return { + 'arn': arn, + 'operationIdentifier': operationIdentifier, + }; + } +} + +class EnableControlOutput { + /// The ID of the asynchronous operation, which is used to track status. The + /// operation is available for 90 days. + final String operationIdentifier; + + /// The ARN of the EnabledControl resource. + final String? arn; + + EnableControlOutput({ + required this.operationIdentifier, + this.arn, + }); + + factory EnableControlOutput.fromJson(Map json) { + return EnableControlOutput( + operationIdentifier: json['operationIdentifier'] as String, + arn: json['arn'] as String?, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + final arn = this.arn; + return { + 'operationIdentifier': operationIdentifier, + if (arn != null) 'arn': arn, + }; + } +} + +/// Details of the EnabledBaseline resource. +class EnabledBaselineDetails { + /// The ARN of the EnabledBaseline resource. + final String arn; + + /// The specific Baseline enabled as part of the + /// EnabledBaseline resource. + final String baselineIdentifier; + final EnablementStatusSummary statusSummary; + + /// The target on which to enable the Baseline. + final String targetIdentifier; + + /// The enabled version of the Baseline. + final String? baselineVersion; + + /// Shows the parameters that are applied when enabling this + /// Baseline. + final List? parameters; + + EnabledBaselineDetails({ + required this.arn, + required this.baselineIdentifier, + required this.statusSummary, + required this.targetIdentifier, + this.baselineVersion, + this.parameters, + }); + + factory EnabledBaselineDetails.fromJson(Map json) { + return EnabledBaselineDetails( + arn: json['arn'] as String, + baselineIdentifier: json['baselineIdentifier'] as String, + statusSummary: EnablementStatusSummary.fromJson( + json['statusSummary'] as Map), + targetIdentifier: json['targetIdentifier'] as String, + baselineVersion: json['baselineVersion'] as String?, + parameters: (json['parameters'] as List?) + ?.whereNotNull() + .map((e) => EnabledBaselineParameterSummary.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final arn = this.arn; + final baselineIdentifier = this.baselineIdentifier; + final statusSummary = this.statusSummary; + final targetIdentifier = this.targetIdentifier; + final baselineVersion = this.baselineVersion; + final parameters = this.parameters; + return { + 'arn': arn, + 'baselineIdentifier': baselineIdentifier, + 'statusSummary': statusSummary, + 'targetIdentifier': targetIdentifier, + if (baselineVersion != null) 'baselineVersion': baselineVersion, + if (parameters != null) 'parameters': parameters, + }; + } +} + +/// A filter applied on the ListEnabledBaseline operation. Allowed +/// filters are baselineIdentifiers and +/// targetIdentifiers. The filter can be applied for either, or +/// both. +class EnabledBaselineFilter { + /// Identifiers for the Baseline objects returned as part of the + /// filter operation. + final List? baselineIdentifiers; + + /// Identifiers for the targets of the Baseline filter operation. + final List? targetIdentifiers; + + EnabledBaselineFilter({ + this.baselineIdentifiers, + this.targetIdentifiers, + }); + + Map toJson() { + final baselineIdentifiers = this.baselineIdentifiers; + final targetIdentifiers = this.targetIdentifiers; + return { + if (baselineIdentifiers != null) + 'baselineIdentifiers': baselineIdentifiers, + if (targetIdentifiers != null) 'targetIdentifiers': targetIdentifiers, + }; + } +} + +/// A key-value parameter to an EnabledBaseline resource. +class EnabledBaselineParameter { + /// A string denoting the parameter key. + final String key; + + /// A low-level Document object of any type (for example, a Java + /// Object). + final EnabledBaselineParameterDocument value; + + EnabledBaselineParameter({ + required this.key, + required this.value, + }); + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +class EnabledBaselineParameterDocument { + EnabledBaselineParameterDocument(); + + factory EnabledBaselineParameterDocument.fromJson(Map _) { + return EnabledBaselineParameterDocument(); + } + + Map toJson() { + return {}; + } +} + +/// Summary of an applied parameter to an EnabledBaseline resource. +class EnabledBaselineParameterSummary { + /// A string denoting the parameter key. + final String key; + + /// A low-level document object of any type (for example, a Java Object). + final EnabledBaselineParameterDocument value; + + EnabledBaselineParameterSummary({ + required this.key, + required this.value, + }); + + factory EnabledBaselineParameterSummary.fromJson(Map json) { + return EnabledBaselineParameterSummary( + key: json['key'] as String, + value: EnabledBaselineParameterDocument.fromJson( + json['value'] as Map), + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +/// Returns a summary of information about an EnabledBaseline +/// object. +class EnabledBaselineSummary { + /// The ARN of the EnabledBaseline resource + final String arn; + + /// The specific baseline that is enabled as part of the + /// EnabledBaseline resource. + final String baselineIdentifier; + final EnablementStatusSummary statusSummary; + + /// The target upon which the baseline is enabled. + final String targetIdentifier; + + /// The enabled version of the baseline. + final String? baselineVersion; + + EnabledBaselineSummary({ + required this.arn, + required this.baselineIdentifier, + required this.statusSummary, + required this.targetIdentifier, + this.baselineVersion, + }); + + factory EnabledBaselineSummary.fromJson(Map json) { + return EnabledBaselineSummary( + arn: json['arn'] as String, + baselineIdentifier: json['baselineIdentifier'] as String, + statusSummary: EnablementStatusSummary.fromJson( + json['statusSummary'] as Map), + targetIdentifier: json['targetIdentifier'] as String, + baselineVersion: json['baselineVersion'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final baselineIdentifier = this.baselineIdentifier; + final statusSummary = this.statusSummary; + final targetIdentifier = this.targetIdentifier; + final baselineVersion = this.baselineVersion; + return { + 'arn': arn, + 'baselineIdentifier': baselineIdentifier, + 'statusSummary': statusSummary, + 'targetIdentifier': targetIdentifier, + if (baselineVersion != null) 'baselineVersion': baselineVersion, + }; + } +} + +/// Information about the enabled control. +class EnabledControlDetails { + /// The ARN of the enabled control. + final String? arn; + + /// The control identifier of the enabled control. For information on how to + /// find the controlIdentifier, see the + /// overview page. + final String? controlIdentifier; + + /// The drift status of the enabled control. + final DriftStatusSummary? driftStatusSummary; + + /// Array of EnabledControlParameter objects. + final List? parameters; + + /// The deployment summary of the enabled control. + final EnablementStatusSummary? statusSummary; + + /// The ARN of the organizational unit. For information on how to find the + /// targetIdentifier, see the + /// overview page. + final String? targetIdentifier; + + /// Target Amazon Web Services Regions for the enabled control. + final List? targetRegions; + + EnabledControlDetails({ + this.arn, + this.controlIdentifier, + this.driftStatusSummary, + this.parameters, + this.statusSummary, + this.targetIdentifier, + this.targetRegions, + }); + + factory EnabledControlDetails.fromJson(Map json) { + return EnabledControlDetails( + arn: json['arn'] as String?, + controlIdentifier: json['controlIdentifier'] as String?, + driftStatusSummary: json['driftStatusSummary'] != null + ? DriftStatusSummary.fromJson( + json['driftStatusSummary'] as Map) + : null, + parameters: (json['parameters'] as List?) + ?.whereNotNull() + .map((e) => EnabledControlParameterSummary.fromJson( + e as Map)) + .toList(), + statusSummary: json['statusSummary'] != null + ? EnablementStatusSummary.fromJson( + json['statusSummary'] as Map) + : null, + targetIdentifier: json['targetIdentifier'] as String?, + targetRegions: (json['targetRegions'] as List?) + ?.whereNotNull() + .map((e) => Region.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final arn = this.arn; + final controlIdentifier = this.controlIdentifier; + final driftStatusSummary = this.driftStatusSummary; + final parameters = this.parameters; + final statusSummary = this.statusSummary; + final targetIdentifier = this.targetIdentifier; + final targetRegions = this.targetRegions; + return { + if (arn != null) 'arn': arn, + if (controlIdentifier != null) 'controlIdentifier': controlIdentifier, + if (driftStatusSummary != null) 'driftStatusSummary': driftStatusSummary, + if (parameters != null) 'parameters': parameters, + if (statusSummary != null) 'statusSummary': statusSummary, + if (targetIdentifier != null) 'targetIdentifier': targetIdentifier, + if (targetRegions != null) 'targetRegions': targetRegions, + }; + } +} + +/// A structure that returns a set of control identifiers, the control status +/// for each control in the set, and the drift status for each control in the +/// set. +class EnabledControlFilter { + /// The set of controlIdentifier returned by the filter. + final List? controlIdentifiers; + + /// A list of DriftStatus items. + final List? driftStatuses; + + /// A list of EnablementStatus items. + final List? statuses; + + EnabledControlFilter({ + this.controlIdentifiers, + this.driftStatuses, + this.statuses, + }); + + Map toJson() { + final controlIdentifiers = this.controlIdentifiers; + final driftStatuses = this.driftStatuses; + final statuses = this.statuses; + return { + if (controlIdentifiers != null) 'controlIdentifiers': controlIdentifiers, + if (driftStatuses != null) + 'driftStatuses': driftStatuses.map((e) => e.toValue()).toList(), + if (statuses != null) + 'statuses': statuses.map((e) => e.toValue()).toList(), + }; + } +} + +/// A key/value pair, where Key is of type String and +/// Value is of type Document. +class EnabledControlParameter { + /// The key of a key/value pair. + final String key; + + /// The value of a key/value pair. + final Document value; + + EnabledControlParameter({ + required this.key, + required this.value, + }); + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +/// Returns a summary of information about the parameters of an enabled control. +class EnabledControlParameterSummary { + /// The key of a key/value pair. + final String key; + + /// The value of a key/value pair. + final Document value; + + EnabledControlParameterSummary({ + required this.key, + required this.value, + }); + + factory EnabledControlParameterSummary.fromJson(Map json) { + return EnabledControlParameterSummary( + key: json['key'] as String, + value: Document.fromJson(json['value'] as Map), + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'key': key, + 'value': value, + }; + } +} + +/// Returns a summary of information about an enabled control. +class EnabledControlSummary { + /// The ARN of the enabled control. + final String? arn; + + /// The controlIdentifier of the enabled control. + final String? controlIdentifier; + + /// The drift status of the enabled control. + final DriftStatusSummary? driftStatusSummary; + + /// A short description of the status of the enabled control. + final EnablementStatusSummary? statusSummary; + + /// The ARN of the organizational unit. + final String? targetIdentifier; + + EnabledControlSummary({ + this.arn, + this.controlIdentifier, + this.driftStatusSummary, + this.statusSummary, + this.targetIdentifier, + }); + + factory EnabledControlSummary.fromJson(Map json) { + return EnabledControlSummary( + arn: json['arn'] as String?, + controlIdentifier: json['controlIdentifier'] as String?, + driftStatusSummary: json['driftStatusSummary'] != null + ? DriftStatusSummary.fromJson( + json['driftStatusSummary'] as Map) + : null, + statusSummary: json['statusSummary'] != null + ? EnablementStatusSummary.fromJson( + json['statusSummary'] as Map) + : null, + targetIdentifier: json['targetIdentifier'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final controlIdentifier = this.controlIdentifier; + final driftStatusSummary = this.driftStatusSummary; + final statusSummary = this.statusSummary; + final targetIdentifier = this.targetIdentifier; + return { + if (arn != null) 'arn': arn, + if (controlIdentifier != null) 'controlIdentifier': controlIdentifier, + if (driftStatusSummary != null) 'driftStatusSummary': driftStatusSummary, + if (statusSummary != null) 'statusSummary': statusSummary, + if (targetIdentifier != null) 'targetIdentifier': targetIdentifier, + }; + } +} + +enum EnablementStatus { + succeeded, + failed, + underChange, +} + +extension EnablementStatusValueExtension on EnablementStatus { + String toValue() { + switch (this) { + case EnablementStatus.succeeded: + return 'SUCCEEDED'; + case EnablementStatus.failed: + return 'FAILED'; + case EnablementStatus.underChange: + return 'UNDER_CHANGE'; + } + } +} + +extension EnablementStatusFromString on String { + EnablementStatus toEnablementStatus() { + switch (this) { + case 'SUCCEEDED': + return EnablementStatus.succeeded; + case 'FAILED': + return EnablementStatus.failed; + case 'UNDER_CHANGE': + return EnablementStatus.underChange; + } + throw Exception('$this is not known in enum EnablementStatus'); + } +} + +/// The deployment summary of the enabled control. +class EnablementStatusSummary { + /// The last operation identifier for the enabled control. + final String? lastOperationIdentifier; + + /// The deployment status of the enabled control. + /// + /// Valid values: + /// + ///
      + ///
    • + /// SUCCEEDED: The enabledControl configuration was + /// deployed successfully. + ///
    • + ///
    • + /// UNDER_CHANGE: The enabledControl configuration is + /// changing. + ///
    • + ///
    • + /// FAILED: The enabledControl configuration failed to + /// deploy. + ///
    • + ///
    + final EnablementStatus? status; + + EnablementStatusSummary({ + this.lastOperationIdentifier, + this.status, + }); + + factory EnablementStatusSummary.fromJson(Map json) { + return EnablementStatusSummary( + lastOperationIdentifier: json['lastOperationIdentifier'] as String?, + status: (json['status'] as String?)?.toEnablementStatus(), + ); + } + + Map toJson() { + final lastOperationIdentifier = this.lastOperationIdentifier; + final status = this.status; + return { + if (lastOperationIdentifier != null) + 'lastOperationIdentifier': lastOperationIdentifier, + if (status != null) 'status': status.toValue(), + }; + } +} + +class GetBaselineOperationOutput { + /// A baselineOperation object that shows information about the + /// specified operation ID. + final BaselineOperation baselineOperation; + + GetBaselineOperationOutput({ + required this.baselineOperation, + }); + + factory GetBaselineOperationOutput.fromJson(Map json) { + return GetBaselineOperationOutput( + baselineOperation: BaselineOperation.fromJson( + json['baselineOperation'] as Map), + ); + } + + Map toJson() { + final baselineOperation = this.baselineOperation; + return { + 'baselineOperation': baselineOperation, + }; + } +} + +class GetBaselineOutput { + /// The baseline ARN. + final String arn; + + /// A user-friendly name for the baseline. + final String name; + + /// A description of the baseline. + final String? description; + + GetBaselineOutput({ + required this.arn, + required this.name, + this.description, + }); + + factory GetBaselineOutput.fromJson(Map json) { + return GetBaselineOutput( + arn: json['arn'] as String, + name: json['name'] as String, + description: json['description'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final name = this.name; + final description = this.description; + return { + 'arn': arn, + 'name': name, + if (description != null) 'description': description, + }; + } +} + +class GetControlOperationOutput { + /// An operation performed by the control. + final ControlOperation controlOperation; + + GetControlOperationOutput({ + required this.controlOperation, + }); + + factory GetControlOperationOutput.fromJson(Map json) { + return GetControlOperationOutput( + controlOperation: ControlOperation.fromJson( + json['controlOperation'] as Map), + ); + } + + Map toJson() { + final controlOperation = this.controlOperation; + return { + 'controlOperation': controlOperation, + }; + } +} + +class GetEnabledBaselineOutput { + /// Details of the EnabledBaseline resource. + final EnabledBaselineDetails? enabledBaselineDetails; + + GetEnabledBaselineOutput({ + this.enabledBaselineDetails, + }); + + factory GetEnabledBaselineOutput.fromJson(Map json) { + return GetEnabledBaselineOutput( + enabledBaselineDetails: json['enabledBaselineDetails'] != null + ? EnabledBaselineDetails.fromJson( + json['enabledBaselineDetails'] as Map) + : null, + ); + } + + Map toJson() { + final enabledBaselineDetails = this.enabledBaselineDetails; + return { + if (enabledBaselineDetails != null) + 'enabledBaselineDetails': enabledBaselineDetails, + }; + } +} + +class GetEnabledControlOutput { + /// Information about the enabled control. + final EnabledControlDetails enabledControlDetails; + + GetEnabledControlOutput({ + required this.enabledControlDetails, + }); + + factory GetEnabledControlOutput.fromJson(Map json) { + return GetEnabledControlOutput( + enabledControlDetails: EnabledControlDetails.fromJson( + json['enabledControlDetails'] as Map), + ); + } + + Map toJson() { + final enabledControlDetails = this.enabledControlDetails; + return { + 'enabledControlDetails': enabledControlDetails, + }; + } +} + +class GetLandingZoneOperationOutput { + /// Details about a landing zone operation. + final LandingZoneOperationDetail operationDetails; + + GetLandingZoneOperationOutput({ + required this.operationDetails, + }); + + factory GetLandingZoneOperationOutput.fromJson(Map json) { + return GetLandingZoneOperationOutput( + operationDetails: LandingZoneOperationDetail.fromJson( + json['operationDetails'] as Map), + ); + } + + Map toJson() { + final operationDetails = this.operationDetails; + return { + 'operationDetails': operationDetails, + }; + } +} + +class GetLandingZoneOutput { + /// Information about the landing zone. + final LandingZoneDetail landingZone; + + GetLandingZoneOutput({ + required this.landingZone, + }); + + factory GetLandingZoneOutput.fromJson(Map json) { + return GetLandingZoneOutput( + landingZone: LandingZoneDetail.fromJson( + json['landingZone'] as Map), + ); + } + + Map toJson() { + final landingZone = this.landingZone; + return { + 'landingZone': landingZone, + }; + } +} + +/// Information about the landing zone. +class LandingZoneDetail { + /// The landing zone manifest JSON text file that specifies the landing zone + /// configurations. + final Manifest manifest; + + /// The landing zone's current deployed version. + final String version; + + /// The ARN of the landing zone. + final String? arn; + + /// The drift status of the landing zone. + final LandingZoneDriftStatusSummary? driftStatus; + + /// The latest available version of the landing zone. + final String? latestAvailableVersion; + + /// The landing zone deployment status. One of ACTIVE, + /// PROCESSING, FAILED. + final LandingZoneStatus? status; + + LandingZoneDetail({ + required this.manifest, + required this.version, + this.arn, + this.driftStatus, + this.latestAvailableVersion, + this.status, + }); + + factory LandingZoneDetail.fromJson(Map json) { + return LandingZoneDetail( + manifest: Manifest.fromJson(json['manifest'] as Map), + version: json['version'] as String, + arn: json['arn'] as String?, + driftStatus: json['driftStatus'] != null + ? LandingZoneDriftStatusSummary.fromJson( + json['driftStatus'] as Map) + : null, + latestAvailableVersion: json['latestAvailableVersion'] as String?, + status: (json['status'] as String?)?.toLandingZoneStatus(), + ); + } + + Map toJson() { + final manifest = this.manifest; + final version = this.version; + final arn = this.arn; + final driftStatus = this.driftStatus; + final latestAvailableVersion = this.latestAvailableVersion; + final status = this.status; + return { + 'manifest': manifest, + 'version': version, + if (arn != null) 'arn': arn, + if (driftStatus != null) 'driftStatus': driftStatus, + if (latestAvailableVersion != null) + 'latestAvailableVersion': latestAvailableVersion, + if (status != null) 'status': status.toValue(), + }; + } +} + +enum LandingZoneDriftStatus { + drifted, + inSync, +} + +extension LandingZoneDriftStatusValueExtension on LandingZoneDriftStatus { + String toValue() { + switch (this) { + case LandingZoneDriftStatus.drifted: + return 'DRIFTED'; + case LandingZoneDriftStatus.inSync: + return 'IN_SYNC'; + } + } +} + +extension LandingZoneDriftStatusFromString on String { + LandingZoneDriftStatus toLandingZoneDriftStatus() { + switch (this) { + case 'DRIFTED': + return LandingZoneDriftStatus.drifted; + case 'IN_SYNC': + return LandingZoneDriftStatus.inSync; + } + throw Exception('$this is not known in enum LandingZoneDriftStatus'); + } +} + +/// The drift status summary of the landing zone. +/// +/// If the landing zone differs from the expected configuration, it is defined +/// to be in a state of drift. You can repair this drift by resetting the +/// landing zone. +class LandingZoneDriftStatusSummary { + /// The drift status of the landing zone. + /// + /// Valid values: + /// + ///
      + ///
    • + /// DRIFTED: The landing zone deployed in this configuration does + /// not match the configuration that Amazon Web Services Control Tower expected. + ///
    • + ///
    • + /// IN_SYNC: The landing zone deployed in this configuration + /// matches the configuration that Amazon Web Services Control Tower expected. + ///
    • + ///
    + final LandingZoneDriftStatus? status; + + LandingZoneDriftStatusSummary({ + this.status, + }); + + factory LandingZoneDriftStatusSummary.fromJson(Map json) { + return LandingZoneDriftStatusSummary( + status: (json['status'] as String?)?.toLandingZoneDriftStatus(), + ); + } + + Map toJson() { + final status = this.status; + return { + if (status != null) 'status': status.toValue(), + }; + } +} + +/// Information about a landing zone operation. +class LandingZoneOperationDetail { + /// The landing zone operation end time. + final DateTime? endTime; + + /// The landing zone operation type. + /// + /// Valid values: + /// + ///
      + ///
    • + /// DELETE: The DeleteLandingZone operation. + ///
    • + ///
    • + /// CREATE: The CreateLandingZone operation. + ///
    • + ///
    • + /// UPDATE: The UpdateLandingZone operation. + ///
    • + ///
    • + /// RESET: The ResetLandingZone operation. + ///
    • + ///
    + final LandingZoneOperationType? operationType; + + /// The landing zone operation start time. final DateTime? startTime; - /// One of IN_PROGRESS, SUCEEDED, or - /// FAILED. - final ControlOperationStatus? status; + /// Valid values: + /// + ///
      + ///
    • + /// SUCCEEDED: The landing zone operation succeeded. + ///
    • + ///
    • + /// IN_PROGRESS: The landing zone operation is in progress. + ///
    • + ///
    • + /// FAILED: The landing zone operation failed. + ///
    • + ///
    + final LandingZoneOperationStatus? status; - /// If the operation result is FAILED, this string contains a - /// message explaining why the operation failed. + /// If the operation result is FAILED, this string contains a message explaining + /// why the operation failed. final String? statusMessage; - ControlOperation({ + LandingZoneOperationDetail({ this.endTime, this.operationType, this.startTime, @@ -302,13 +2797,13 @@ class ControlOperation { this.statusMessage, }); - factory ControlOperation.fromJson(Map json) { - return ControlOperation( + factory LandingZoneOperationDetail.fromJson(Map json) { + return LandingZoneOperationDetail( endTime: timeStampFromJson(json['endTime']), operationType: - (json['operationType'] as String?)?.toControlOperationType(), + (json['operationType'] as String?)?.toLandingZoneOperationType(), startTime: timeStampFromJson(json['startTime']), - status: (json['status'] as String?)?.toControlOperationStatus(), + status: (json['status'] as String?)?.toLandingZoneOperationStatus(), statusMessage: json['statusMessage'] as String?, ); } @@ -329,168 +2824,239 @@ class ControlOperation { } } -enum ControlOperationStatus { +enum LandingZoneOperationStatus { succeeded, failed, inProgress, } -extension ControlOperationStatusValueExtension on ControlOperationStatus { +extension LandingZoneOperationStatusValueExtension + on LandingZoneOperationStatus { String toValue() { switch (this) { - case ControlOperationStatus.succeeded: + case LandingZoneOperationStatus.succeeded: return 'SUCCEEDED'; - case ControlOperationStatus.failed: + case LandingZoneOperationStatus.failed: return 'FAILED'; - case ControlOperationStatus.inProgress: + case LandingZoneOperationStatus.inProgress: return 'IN_PROGRESS'; } } } -extension ControlOperationStatusFromString on String { - ControlOperationStatus toControlOperationStatus() { +extension LandingZoneOperationStatusFromString on String { + LandingZoneOperationStatus toLandingZoneOperationStatus() { switch (this) { case 'SUCCEEDED': - return ControlOperationStatus.succeeded; + return LandingZoneOperationStatus.succeeded; case 'FAILED': - return ControlOperationStatus.failed; + return LandingZoneOperationStatus.failed; case 'IN_PROGRESS': - return ControlOperationStatus.inProgress; + return LandingZoneOperationStatus.inProgress; } - throw Exception('$this is not known in enum ControlOperationStatus'); + throw Exception('$this is not known in enum LandingZoneOperationStatus'); } } -enum ControlOperationType { - enableControl, - disableControl, +enum LandingZoneOperationType { + delete, + create, + update, + reset, } -extension ControlOperationTypeValueExtension on ControlOperationType { +extension LandingZoneOperationTypeValueExtension on LandingZoneOperationType { String toValue() { switch (this) { - case ControlOperationType.enableControl: - return 'ENABLE_CONTROL'; - case ControlOperationType.disableControl: - return 'DISABLE_CONTROL'; + case LandingZoneOperationType.delete: + return 'DELETE'; + case LandingZoneOperationType.create: + return 'CREATE'; + case LandingZoneOperationType.update: + return 'UPDATE'; + case LandingZoneOperationType.reset: + return 'RESET'; } } } -extension ControlOperationTypeFromString on String { - ControlOperationType toControlOperationType() { +extension LandingZoneOperationTypeFromString on String { + LandingZoneOperationType toLandingZoneOperationType() { switch (this) { - case 'ENABLE_CONTROL': - return ControlOperationType.enableControl; - case 'DISABLE_CONTROL': - return ControlOperationType.disableControl; + case 'DELETE': + return LandingZoneOperationType.delete; + case 'CREATE': + return LandingZoneOperationType.create; + case 'UPDATE': + return LandingZoneOperationType.update; + case 'RESET': + return LandingZoneOperationType.reset; } - throw Exception('$this is not known in enum ControlOperationType'); + throw Exception('$this is not known in enum LandingZoneOperationType'); } } -class DisableControlOutput { - /// The ID of the asynchronous operation, which is used to track status. The - /// operation is available for 90 days. - final String operationIdentifier; +enum LandingZoneStatus { + active, + processing, + failed, +} - DisableControlOutput({ - required this.operationIdentifier, +extension LandingZoneStatusValueExtension on LandingZoneStatus { + String toValue() { + switch (this) { + case LandingZoneStatus.active: + return 'ACTIVE'; + case LandingZoneStatus.processing: + return 'PROCESSING'; + case LandingZoneStatus.failed: + return 'FAILED'; + } + } +} + +extension LandingZoneStatusFromString on String { + LandingZoneStatus toLandingZoneStatus() { + switch (this) { + case 'ACTIVE': + return LandingZoneStatus.active; + case 'PROCESSING': + return LandingZoneStatus.processing; + case 'FAILED': + return LandingZoneStatus.failed; + } + throw Exception('$this is not known in enum LandingZoneStatus'); + } +} + +/// Returns a summary of information about a landing zone. +class LandingZoneSummary { + /// The ARN of the landing zone. + final String? arn; + + LandingZoneSummary({ + this.arn, }); - factory DisableControlOutput.fromJson(Map json) { - return DisableControlOutput( - operationIdentifier: json['operationIdentifier'] as String, + factory LandingZoneSummary.fromJson(Map json) { + return LandingZoneSummary( + arn: json['arn'] as String?, ); } Map toJson() { - final operationIdentifier = this.operationIdentifier; + final arn = this.arn; return { - 'operationIdentifier': operationIdentifier, + if (arn != null) 'arn': arn, }; } } -class EnableControlOutput { - /// The ID of the asynchronous operation, which is used to track status. The - /// operation is available for 90 days. - final String operationIdentifier; +class ListBaselinesOutput { + /// A list of Baseline object details. + final List baselines; - EnableControlOutput({ - required this.operationIdentifier, + /// A pagination token. + final String? nextToken; + + ListBaselinesOutput({ + required this.baselines, + this.nextToken, }); - factory EnableControlOutput.fromJson(Map json) { - return EnableControlOutput( - operationIdentifier: json['operationIdentifier'] as String, + factory ListBaselinesOutput.fromJson(Map json) { + return ListBaselinesOutput( + baselines: (json['baselines'] as List) + .whereNotNull() + .map((e) => BaselineSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final operationIdentifier = this.operationIdentifier; + final baselines = this.baselines; + final nextToken = this.nextToken; return { - 'operationIdentifier': operationIdentifier, + 'baselines': baselines, + if (nextToken != null) 'nextToken': nextToken, }; } } -/// A summary of enabled controls. -class EnabledControlSummary { - /// The ARN of the control. Only Strongly recommended and Elective - /// controls are permitted, with the exception of the Region deny - /// guardrail. - final String? controlIdentifier; +class ListControlOperationsOutput { + /// Returns a list of output from control operations. PLACEHOLDER + final List controlOperations; - EnabledControlSummary({ - this.controlIdentifier, + /// A pagination token. + final String? nextToken; + + ListControlOperationsOutput({ + required this.controlOperations, + this.nextToken, }); - factory EnabledControlSummary.fromJson(Map json) { - return EnabledControlSummary( - controlIdentifier: json['controlIdentifier'] as String?, + factory ListControlOperationsOutput.fromJson(Map json) { + return ListControlOperationsOutput( + controlOperations: (json['controlOperations'] as List) + .whereNotNull() + .map((e) => + ControlOperationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final controlIdentifier = this.controlIdentifier; + final controlOperations = this.controlOperations; + final nextToken = this.nextToken; return { - if (controlIdentifier != null) 'controlIdentifier': controlIdentifier, + 'controlOperations': controlOperations, + if (nextToken != null) 'nextToken': nextToken, }; } } -class GetControlOperationOutput { - ///

    - final ControlOperation controlOperation; +class ListEnabledBaselinesOutput { + /// Retuens a list of summaries of EnabledBaseline resources. + final List enabledBaselines; - GetControlOperationOutput({ - required this.controlOperation, + /// A pagination token. + final String? nextToken; + + ListEnabledBaselinesOutput({ + required this.enabledBaselines, + this.nextToken, }); - factory GetControlOperationOutput.fromJson(Map json) { - return GetControlOperationOutput( - controlOperation: ControlOperation.fromJson( - json['controlOperation'] as Map), + factory ListEnabledBaselinesOutput.fromJson(Map json) { + return ListEnabledBaselinesOutput( + enabledBaselines: (json['enabledBaselines'] as List) + .whereNotNull() + .map( + (e) => EnabledBaselineSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, ); } Map toJson() { - final controlOperation = this.controlOperation; + final enabledBaselines = this.enabledBaselines; + final nextToken = this.nextToken; return { - 'controlOperation': controlOperation, + 'enabledBaselines': enabledBaselines, + if (nextToken != null) 'nextToken': nextToken, }; } } class ListEnabledControlsOutput { - /// Lists the controls enabled by AWS Control Tower on the specified - /// organizational unit and the accounts it contains. + /// Lists the controls enabled by Amazon Web Services Control Tower on the + /// specified organizational unit and the accounts it contains. final List enabledControls; - /// Retrieves the next page of results. If the string is empty, the current - /// response is the end of the results. + /// Retrieves the next page of results. If the string is empty, the response is + /// the end of the results. final String? nextToken; ListEnabledControlsOutput({ @@ -518,6 +3084,249 @@ class ListEnabledControlsOutput { } } +class ListLandingZonesOutput { + /// The ARN of the landing zone. + final List landingZones; + + /// Retrieves the next page of results. If the string is empty, the response is + /// the end of the results. + final String? nextToken; + + ListLandingZonesOutput({ + required this.landingZones, + this.nextToken, + }); + + factory ListLandingZonesOutput.fromJson(Map json) { + return ListLandingZonesOutput( + landingZones: (json['landingZones'] as List) + .whereNotNull() + .map((e) => LandingZoneSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final landingZones = this.landingZones; + final nextToken = this.nextToken; + return { + 'landingZones': landingZones, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceOutput { + /// A list of tags, as key:value strings. + final Map tags; + + ListTagsForResourceOutput({ + required this.tags, + }); + + factory ListTagsForResourceOutput.fromJson(Map json) { + return ListTagsForResourceOutput( + tags: (json['tags'] as Map) + .map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + 'tags': tags, + }; + } +} + +class Manifest { + Manifest(); + + factory Manifest.fromJson(Map _) { + return Manifest(); + } + + Map toJson() { + return {}; + } +} + +/// An Amazon Web Services Region in which Amazon Web Services Control Tower +/// expects to find the control deployed. +/// +/// The expected Regions are based on the Regions that are governed by the +/// landing zone. In certain cases, a control is not actually enabled in the +/// Region as expected, such as during drift, or mixed +/// governance. +class Region { + /// The Amazon Web Services Region name. + final String? name; + + Region({ + this.name, + }); + + factory Region.fromJson(Map json) { + return Region( + name: json['name'] as String?, + ); + } + + Map toJson() { + final name = this.name; + return { + if (name != null) 'name': name, + }; + } +} + +class ResetEnabledBaselineOutput { + /// The ID (in UUID format) of the asynchronous + /// ResetEnabledBaseline operation. This + /// operationIdentifier is used to track status through calls to + /// the GetBaselineOperation API. + final String operationIdentifier; + + ResetEnabledBaselineOutput({ + required this.operationIdentifier, + }); + + factory ResetEnabledBaselineOutput.fromJson(Map json) { + return ResetEnabledBaselineOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class ResetLandingZoneOutput { + /// A unique identifier assigned to a ResetLandingZone operation. + /// You can use this identifier as an input parameter of + /// GetLandingZoneOperation to check the operation's status. + final String operationIdentifier; + + ResetLandingZoneOutput({ + required this.operationIdentifier, + }); + + factory ResetLandingZoneOutput.fromJson(Map json) { + return ResetLandingZoneOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class TagResourceOutput { + TagResourceOutput(); + + factory TagResourceOutput.fromJson(Map _) { + return TagResourceOutput(); + } + + Map toJson() { + return {}; + } +} + +class UntagResourceOutput { + UntagResourceOutput(); + + factory UntagResourceOutput.fromJson(Map _) { + return UntagResourceOutput(); + } + + Map toJson() { + return {}; + } +} + +class UpdateEnabledBaselineOutput { + /// The ID (in UUID format) of the asynchronous + /// UpdateEnabledBaseline operation. This + /// operationIdentifier is used to track status through calls to + /// the GetBaselineOperation API. + final String operationIdentifier; + + UpdateEnabledBaselineOutput({ + required this.operationIdentifier, + }); + + factory UpdateEnabledBaselineOutput.fromJson(Map json) { + return UpdateEnabledBaselineOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class UpdateEnabledControlOutput { + /// The operation identifier for this UpdateEnabledControl + /// operation. + final String operationIdentifier; + + UpdateEnabledControlOutput({ + required this.operationIdentifier, + }); + + factory UpdateEnabledControlOutput.fromJson(Map json) { + return UpdateEnabledControlOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + +class UpdateLandingZoneOutput { + /// A unique identifier assigned to a UpdateLandingZone operation. + /// You can use this identifier as an input of + /// GetLandingZoneOperation to check the operation's status. + final String operationIdentifier; + + UpdateLandingZoneOutput({ + required this.operationIdentifier, + }); + + factory UpdateLandingZoneOutput.fromJson(Map json) { + return UpdateLandingZoneOutput( + operationIdentifier: json['operationIdentifier'] as String, + ); + } + + Map toJson() { + final operationIdentifier = this.operationIdentifier; + return { + 'operationIdentifier': operationIdentifier, + }; + } +} + class AccessDeniedException extends _s.GenericAwsException { AccessDeniedException({String? type, String? message}) : super(type: type, code: 'AccessDeniedException', message: message); diff --git a/aws_client/lib/src/generated/cost_and_usage_report_service/v2017_01_06.dart b/aws_client/lib/src/generated/cost_and_usage_report_service/v2017_01_06.dart index 3dad61dfe..20a598e81 100644 --- a/aws_client/lib/src/generated/cost_and_usage_report_service/v2017_01_06.dart +++ b/aws_client/lib/src/generated/cost_and_usage_report_service/v2017_01_06.dart @@ -19,18 +19,22 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// The AWS Cost and Usage Report API enables you to programmatically create, -/// query, and delete AWS Cost and Usage report definitions. +/// You can use the Amazon Web Services Cost and Usage Report API to +/// programmatically create, query, and delete Amazon Web Services Cost and +/// Usage Report definitions. /// -/// AWS Cost and Usage reports track the monthly AWS costs and usage associated -/// with your AWS account. The report contains line items for each unique -/// combination of AWS product, usage type, and operation that your AWS account -/// uses. You can configure the AWS Cost and Usage report to show only the data -/// that you want, using the AWS Cost and Usage API. +/// Amazon Web Services Cost and Usage Report track the monthly Amazon Web +/// Services costs and usage associated with your Amazon Web Services account. +/// The report contains line items for each unique combination of Amazon Web +/// Services product, usage type, and operation that your Amazon Web Services +/// account uses. You can configure the Amazon Web Services Cost and Usage +/// Report to show only the data that you want, using the Amazon Web Services +/// Cost and Usage Report API. /// /// Service Endpoint /// -/// The AWS Cost and Usage Report API provides the following endpoint: +/// The Amazon Web Services Cost and Usage Report API provides the following +/// endpoint: /// ///

      ///
    • @@ -66,7 +70,8 @@ class CostAndUsageReport { _protocol.close(); } - /// Deletes the specified report. + /// Deletes the specified report. Any tags associated with the report are also + /// deleted. /// /// May throw [InternalErrorException]. /// May throw [ValidationException]. @@ -75,7 +80,7 @@ class CostAndUsageReport { /// The name of the report that you want to delete. The name must be unique, /// is case sensitive, and can't include spaces. Future deleteReportDefinition({ - String? reportName, + required String reportName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -88,14 +93,15 @@ class CostAndUsageReport { // TODO queryParams headers: headers, payload: { - if (reportName != null) 'ReportName': reportName, + 'ReportName': reportName, }, ); return DeleteReportDefinitionResponse.fromJson(jsonResponse.body); } - /// Lists the AWS Cost and Usage reports available to this account. + /// Lists the Amazon Web Services Cost and Usage Report available to this + /// account. /// /// May throw [InternalErrorException]. Future describeReportDefinitions({ @@ -128,7 +134,36 @@ class CostAndUsageReport { return DescribeReportDefinitionsResponse.fromJson(jsonResponse.body); } - /// Allows you to programatically update your report preferences. + /// Lists the tags associated with the specified report definition. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalErrorException]. + /// May throw [ValidationException]. + /// + /// Parameter [reportName] : + /// The report name of the report definition that tags are to be returned for. + Future listTagsForResource({ + required String reportName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSOrigamiServiceGatewayService.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReportName': reportName, + }, + ); + + return ListTagsForResourceResponse.fromJson(jsonResponse.body); + } + + /// Allows you to programmatically update your report preferences. /// /// May throw [InternalErrorException]. /// May throw [ValidationException]. @@ -159,12 +194,17 @@ class CostAndUsageReport { /// May throw [ReportLimitReachedException]. /// May throw [InternalErrorException]. /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. /// /// Parameter [reportDefinition] : /// Represents the output of the PutReportDefinition operation. The content /// consists of the detailed metadata and data file information. + /// + /// Parameter [tags] : + /// The tags to be assigned to the report definition resource. Future putReportDefinition({ required ReportDefinition reportDefinition, + List? tags, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -178,12 +218,80 @@ class CostAndUsageReport { headers: headers, payload: { 'ReportDefinition': reportDefinition, + if (tags != null) 'Tags': tags, + }, + ); + } + + /// Associates a set of tags with a report definition. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalErrorException]. + /// May throw [ValidationException]. + /// + /// Parameter [reportName] : + /// The report name of the report definition that tags are to be associated + /// with. + /// + /// Parameter [tags] : + /// The tags to be assigned to the report definition resource. + Future tagResource({ + required String reportName, + required List tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSOrigamiServiceGatewayService.TagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReportName': reportName, + 'Tags': tags, + }, + ); + } + + /// Disassociates a set of tags from a report definition. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [InternalErrorException]. + /// May throw [ValidationException]. + /// + /// Parameter [reportName] : + /// The report name of the report definition that tags are to be disassociated + /// from. + /// + /// Parameter [tagKeys] : + /// The tags to be disassociated from the report definition resource. + Future untagResource({ + required String reportName, + required List tagKeys, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSOrigamiServiceGatewayService.UntagResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReportName': reportName, + 'TagKeys': tagKeys, }, ); } } -/// The region of the S3 bucket that AWS delivers the report into. +/// The region of the S3 bucket that Amazon Web Services delivers the report +/// into. enum AWSRegion { afSouth_1, apEast_1, @@ -342,7 +450,8 @@ extension AWSRegionFromString on String { } } -/// The types of manifest that you want AWS to create for this report. +/// The types of manifest that you want Amazon Web Services to create for this +/// report. enum AdditionalArtifact { redshift, quicksight, @@ -376,7 +485,7 @@ extension AdditionalArtifactFromString on String { } } -/// The compression format that AWS uses for the report. +/// The compression format that Amazon Web Services uses for the report. enum CompressionFormat { zip, gzip, @@ -436,7 +545,7 @@ class DeleteReportDefinitionResponse { class DescribeReportDefinitionsResponse { final String? nextToken; - /// A list of AWS Cost and Usage reports owned by the account. + /// An Amazon Web Services Cost and Usage Report list owned by the account. final List? reportDefinitions; DescribeReportDefinitionsResponse({ @@ -465,6 +574,64 @@ class DescribeReportDefinitionsResponse { } } +enum LastStatus { + success, + errorPermissions, + errorNoBucket, +} + +extension LastStatusValueExtension on LastStatus { + String toValue() { + switch (this) { + case LastStatus.success: + return 'SUCCESS'; + case LastStatus.errorPermissions: + return 'ERROR_PERMISSIONS'; + case LastStatus.errorNoBucket: + return 'ERROR_NO_BUCKET'; + } + } +} + +extension LastStatusFromString on String { + LastStatus toLastStatus() { + switch (this) { + case 'SUCCESS': + return LastStatus.success; + case 'ERROR_PERMISSIONS': + return LastStatus.errorPermissions; + case 'ERROR_NO_BUCKET': + return LastStatus.errorNoBucket; + } + throw Exception('$this is not known in enum LastStatus'); + } +} + +class ListTagsForResourceResponse { + /// The tags assigned to the report definition resource. + final List? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['Tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'Tags': tags, + }; + } +} + class ModifyReportDefinitionResponse { ModifyReportDefinitionResponse(); @@ -491,9 +658,9 @@ class PutReportDefinitionResponse { } } -/// The definition of AWS Cost and Usage Report. You can specify the report -/// name, time unit, report format, compression format, S3 bucket, additional -/// artifacts, and schema elements in the definition. +/// The definition of Amazon Web Services Cost and Usage Report. You can specify +/// the report name, time unit, report format, compression format, S3 bucket, +/// additional artifacts, and schema elements in the definition. class ReportDefinition { /// A list of strings that indicate additional content that Amazon Web Services /// includes in the report, such as individual resource IDs. @@ -510,8 +677,12 @@ class ReportDefinition { /// report. final List? additionalArtifacts; - /// The Amazon resource name of the billing view. You can get this value by - /// using the billing view service public APIs. + /// The Amazon resource name of the billing view. The + /// BillingViewArn is needed to create Amazon Web Services Cost and + /// Usage Report for each billing group maintained in the Amazon Web Services + /// Billing Conductor service. The BillingViewArn for a billing + /// group can be constructed as: + /// arn:aws:billing::payer-account-id:billingview/billing-group-primary-account-id final String? billingViewArn; /// Whether you want Amazon Web Services to update your reports after they have @@ -519,6 +690,9 @@ class ReportDefinition { /// months. These charges can include refunds, credits, or support fees. final bool? refreshClosedReports; + /// The status of the report. + final ReportStatus? reportStatus; + /// Whether you want Amazon Web Services to overwrite the previous version of /// each report or to deliver the report in addition to the previous versions. final ReportVersioning? reportVersioning; @@ -535,6 +709,7 @@ class ReportDefinition { this.additionalArtifacts, this.billingViewArn, this.refreshClosedReports, + this.reportStatus, this.reportVersioning, }); @@ -557,6 +732,9 @@ class ReportDefinition { .toList(), billingViewArn: json['BillingViewArn'] as String?, refreshClosedReports: json['RefreshClosedReports'] as bool?, + reportStatus: json['ReportStatus'] != null + ? ReportStatus.fromJson(json['ReportStatus'] as Map) + : null, reportVersioning: (json['ReportVersioning'] as String?)?.toReportVersioning(), ); @@ -574,6 +752,7 @@ class ReportDefinition { final additionalArtifacts = this.additionalArtifacts; final billingViewArn = this.billingViewArn; final refreshClosedReports = this.refreshClosedReports; + final reportStatus = this.reportStatus; final reportVersioning = this.reportVersioning; return { 'AdditionalSchemaElements': @@ -591,13 +770,14 @@ class ReportDefinition { if (billingViewArn != null) 'BillingViewArn': billingViewArn, if (refreshClosedReports != null) 'RefreshClosedReports': refreshClosedReports, + if (reportStatus != null) 'ReportStatus': reportStatus, if (reportVersioning != null) 'ReportVersioning': reportVersioning.toValue(), }; } } -/// The format that AWS saves the report in. +/// The format that Amazon Web Services saves the report in. enum ReportFormat { textORcsv, parquet, @@ -626,6 +806,38 @@ extension ReportFormatFromString on String { } } +/// A two element dictionary with a lastDelivery and +/// lastStatus key whose values describe the date and status of the +/// last delivered report for a particular report definition. +class ReportStatus { + /// A timestamp that gives the date of a report delivery. + final String? lastDelivery; + + /// An enum that gives the status of a report delivery. + final LastStatus? lastStatus; + + ReportStatus({ + this.lastDelivery, + this.lastStatus, + }); + + factory ReportStatus.fromJson(Map json) { + return ReportStatus( + lastDelivery: json['lastDelivery'] as String?, + lastStatus: (json['lastStatus'] as String?)?.toLastStatus(), + ); + } + + Map toJson() { + final lastDelivery = this.lastDelivery; + final lastStatus = this.lastStatus; + return { + if (lastDelivery != null) 'lastDelivery': lastDelivery, + if (lastStatus != null) 'lastStatus': lastStatus.toValue(), + }; + } +} + enum ReportVersioning { createNewReport, overwriteReport, @@ -654,10 +866,11 @@ extension ReportVersioningFromString on String { } } -/// Whether or not AWS includes resource IDs in the report. +/// Whether or not Amazon Web Services includes resource IDs in the report. enum SchemaElement { resources, splitCostAllocationData, + manualDiscountCompatibility, } extension SchemaElementValueExtension on SchemaElement { @@ -667,6 +880,8 @@ extension SchemaElementValueExtension on SchemaElement { return 'RESOURCES'; case SchemaElement.splitCostAllocationData: return 'SPLIT_COST_ALLOCATION_DATA'; + case SchemaElement.manualDiscountCompatibility: + return 'MANUAL_DISCOUNT_COMPATIBILITY'; } } } @@ -678,11 +893,59 @@ extension SchemaElementFromString on String { return SchemaElement.resources; case 'SPLIT_COST_ALLOCATION_DATA': return SchemaElement.splitCostAllocationData; + case 'MANUAL_DISCOUNT_COMPATIBILITY': + return SchemaElement.manualDiscountCompatibility; } throw Exception('$this is not known in enum SchemaElement'); } } +/// Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a +/// report definition. +class Tag { + /// The key of the tag. Tag keys are case sensitive. Each report definition can + /// only have up to one tag with the same key. If you try to add an existing tag + /// with the same key, the existing tag value will be updated to the new value. + final String key; + + /// The value of the tag. Tag values are case-sensitive. This can be an empty + /// string. + final String value; + + Tag({ + required this.key, + required this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['Key'] as String, + value: json['Value'] as String, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + 'Key': key, + 'Value': value, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + /// The length of time covered by the report. enum TimeUnit { hourly, @@ -717,6 +980,18 @@ extension TimeUnitFromString on String { } } +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + class DuplicateReportNameException extends _s.GenericAwsException { DuplicateReportNameException({String? type, String? message}) : super( @@ -734,6 +1009,11 @@ class ReportLimitReachedException extends _s.GenericAwsException { type: type, code: 'ReportLimitReachedException', message: message); } +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + class ValidationException extends _s.GenericAwsException { ValidationException({String? type, String? message}) : super(type: type, code: 'ValidationException', message: message); @@ -746,6 +1026,8 @@ final _exceptionFns = { InternalErrorException(type: type, message: message), 'ReportLimitReachedException': (type, message) => ReportLimitReachedException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), 'ValidationException': (type, message) => ValidationException(type: type, message: message), }; diff --git a/aws_client/lib/src/generated/cost_explorer/v2017_10_25.dart b/aws_client/lib/src/generated/cost_explorer/v2017_10_25.dart index b01f50b32..1be7a6f41 100644 --- a/aws_client/lib/src/generated/cost_explorer/v2017_10_25.dart +++ b/aws_client/lib/src/generated/cost_explorer/v2017_10_25.dart @@ -567,6 +567,49 @@ class CostExplorer { return GetAnomalySubscriptionsResponse.fromJson(jsonResponse.body); } + /// Retrieves estimated usage records for hourly granularity or resource-level + /// data at daily granularity. + /// + /// May throw [LimitExceededException]. + /// May throw [DataUnavailableException]. + /// + /// Parameter [approximationDimension] : + /// The service to evaluate for the usage records. You can choose + /// resource-level data at daily granularity, or hourly granularity with or + /// without resource-level data. + /// + /// Parameter [granularity] : + /// How granular you want the data to be. You can enable data at hourly or + /// daily granularity. + /// + /// Parameter [services] : + /// The service metadata for the service or services you want to query. If not + /// specified, all elements are returned. + Future getApproximateUsageRecords({ + required ApproximationDimension approximationDimension, + required Granularity granularity, + List? services, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSInsightsIndexService.GetApproximateUsageRecords' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ApproximationDimension': approximationDimension.toValue(), + 'Granularity': granularity.toValue(), + if (services != null) 'Services': services, + }, + ); + + return GetApproximateUsageRecordsResponse.fromJson(jsonResponse.body); + } + /// Retrieves cost and usage metrics for your account. You can specify which /// cost and usage-related metric that you want the request to return. For /// example, you can specify BlendedCosts or @@ -697,8 +740,11 @@ class CostExplorer { /// time range. For a complete list of valid dimensions, see the GetDimensionValues /// operation. Management account in an organization in Organizations have - /// access to all member accounts. This API is currently available for the - /// Amazon Elastic Compute Cloud – Compute service only. + /// access to all member accounts. + /// + /// Hourly granularity is only available for EC2-Instances (Elastic Compute + /// Cloud) resource-level data. All other resource-level data is available at + /// daily granularity. /// /// This is an opt-in only feature. You can enable this feature from the Cost /// Explorer Settings page. For information about how to access the Settings @@ -2028,6 +2074,39 @@ class CostExplorer { return GetRightsizingRecommendationResponse.fromJson(jsonResponse.body); } + /// Retrieves the details for a Savings Plan recommendation. These details + /// include the hourly data-points that construct the cost, coverage, and + /// utilization charts. + /// + /// May throw [LimitExceededException]. + /// May throw [DataUnavailableException]. + /// + /// Parameter [recommendationDetailId] : + /// The ID that is associated with the Savings Plan recommendation. + Future + getSavingsPlanPurchaseRecommendationDetails({ + required String recommendationDetailId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSInsightsIndexService.GetSavingsPlanPurchaseRecommendationDetails' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'RecommendationDetailId': recommendationDetailId, + }, + ); + + return GetSavingsPlanPurchaseRecommendationDetailsResponse.fromJson( + jsonResponse.body); + } + /// Retrieves the Savings Plans covered for your account. This enables you to /// see how much of your cost is covered by a Savings Plan. An organization’s /// management account can see the coverage of the associated member accounts. @@ -2786,6 +2865,50 @@ class CostExplorer { return GetUsageForecastResponse.fromJson(jsonResponse.body); } + /// Retrieves a list of your historical cost allocation tag backfill requests. + /// + /// May throw [LimitExceededException]. + /// May throw [InvalidNextTokenException]. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for this request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. Amazon Web Services + /// provides the token when the response from a previous call has more results + /// than the maximum page size. + Future + listCostAllocationTagBackfillHistory({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AWSInsightsIndexService.ListCostAllocationTagBackfillHistory' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return ListCostAllocationTagBackfillHistoryResponse.fromJson( + jsonResponse.body); + } + /// Get a list of cost allocation tags. All inputs in the API are optional and /// serve as filters. By default, all cost allocation tags are returned. /// @@ -2906,6 +3029,7 @@ class CostExplorer { /// /// May throw [LimitExceededException]. /// May throw [InvalidNextTokenException]. + /// May throw [DataUnavailableException]. /// /// Parameter [generationStatus] : /// The status of the recommendation generation. @@ -3020,6 +3144,42 @@ class CostExplorer { return ProvideAnomalyFeedbackResponse.fromJson(jsonResponse.body); } + /// Request a cost allocation tag backfill. This will backfill the activation + /// status (either active or inactive) for all tag + /// keys from para:BackfillFrom up to the when this request is + /// made. + /// + /// You can request a backfill once every 24 hours. + /// + /// May throw [LimitExceededException]. + /// May throw [BackfillLimitExceededException]. + /// + /// Parameter [backfillFrom] : + /// The date you want the backfill to start from. The date can only be a first + /// day of the month (a billing start date). Dates can't precede the previous + /// twelve months, or in the future. + Future + startCostAllocationTagBackfill({ + required String backfillFrom, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSInsightsIndexService.StartCostAllocationTagBackfill' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'BackfillFrom': backfillFrom, + }, + ); + + return StartCostAllocationTagBackfillResponse.fromJson(jsonResponse.body); + } + /// Requests a Savings Plans recommendation generation. This enables you to /// calculate a fresh set of Savings Plans recommendations that takes your /// latest usage data and current Savings Plans inventory into account. You @@ -3034,6 +3194,7 @@ class CostExplorer { /// May throw [LimitExceededException]. /// May throw [ServiceQuotaExceededException]. /// May throw [GenerationExistsException]. + /// May throw [DataUnavailableException]. Future startSavingsPlansPurchaseRecommendationGeneration() async { final headers = { @@ -3199,7 +3360,14 @@ class CostExplorer { return UpdateAnomalyMonitorResponse.fromJson(jsonResponse.body); } - /// Updates an existing cost anomaly monitor subscription. + /// Updates an existing cost anomaly subscription. Specify the fields that you + /// want to update. Omitted fields are unchanged. + /// + /// The JSON below describes the generic construct for each type. See Request + /// Parameters for possible values as they apply to + /// AnomalySubscription. + /// /// /// May throw [LimitExceededException]. /// May throw [UnknownMonitorException]. @@ -3229,16 +3397,23 @@ class CostExplorer { /// ThresholdExpression. Continued use of Threshold will be treated as /// shorthand syntax for a ThresholdExpression. /// + /// You can specify either Threshold or ThresholdExpression, but not both. + /// /// Parameter [thresholdExpression] : /// The update to the Expression /// object used to specify the anomalies that you want to generate alerts for. /// This supports dimensions and nested expressions. The supported dimensions /// are ANOMALY_TOTAL_IMPACT_ABSOLUTE and - /// ANOMALY_TOTAL_IMPACT_PERCENTAGE. The supported nested - /// expression types are AND and OR. The match - /// option GREATER_THAN_OR_EQUAL is required. Values must be - /// numbers between 0 and 10,000,000,000. + /// ANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an + /// anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact + /// for more details). The supported nested expression types are + /// AND and OR. The match option + /// GREATER_THAN_OR_EQUAL is required. Values must be numbers + /// between 0 and 10,000,000,000 in string format. + /// + /// You can specify either Threshold or ThresholdExpression, but not both. /// /// The following are examples of valid ThresholdExpressions: /// @@ -3686,12 +3861,30 @@ class AnomalyScore { } } -/// The association between a monitor, threshold, and list of subscribers used -/// to deliver notifications about anomalies detected by a monitor that exceeds -/// a threshold. The content consists of the detailed metadata and the current -/// status of the AnomalySubscription object. +/// An AnomalySubscription resource (also referred to as an alert +/// subscription) sends notifications about specific anomalies that meet an +/// alerting criteria defined by you. +/// +/// You can specify the frequency of the alerts and the subscribers to notify. +/// +/// Anomaly subscriptions can be associated with one or more +/// AnomalyMonitor resources, and they only send notifications +/// about anomalies detected by those associated monitors. You can also +/// configure a threshold to further control which anomalies are included in the +/// notifications. +/// +/// Anomalies that don’t exceed the chosen threshold and therefore don’t trigger +/// notifications from an anomaly subscription will still be available on the +/// console and from the +/// GetAnomalies API. class AnomalySubscription { - /// The frequency that anomaly reports are sent over email. + /// The frequency that anomaly notifications are sent. Notifications are sent + /// either over email (for DAILY and WEEKLY frequencies) or SNS (for IMMEDIATE + /// frequency). For more information, see Creating + /// an Amazon SNS topic for anomaly notifications. final AnomalySubscriptionFrequency frequency; /// A list of cost anomaly monitors. @@ -3711,13 +3904,17 @@ class AnomalySubscription { /// (deprecated) /// - /// The dollar value that triggers a notification if the threshold is exceeded. + /// An absolute dollar value that must be exceeded by the anomaly's total impact + /// (see Impact + /// for more details) for an anomaly notification to be generated. /// /// This field has been deprecated. To specify a threshold, use /// ThresholdExpression. Continued use of Threshold will be treated as shorthand /// syntax for a ThresholdExpression. /// - /// One of Threshold or ThresholdExpression is required for this resource. + /// One of Threshold or ThresholdExpression is required for this resource. You + /// cannot specify both. final double? threshold; /// An ANOMALY_TOTAL_IMPACT_ABSOLUTE and - /// ANOMALY_TOTAL_IMPACT_PERCENTAGE. The supported nested - /// expression types are AND and OR. The match option + /// ANOMALY_TOTAL_IMPACT_PERCENTAGE, corresponding to an anomaly’s + /// TotalImpact and TotalImpactPercentage, respectively (see Impact + /// for more details). The supported nested expression types are + /// AND and OR. The match option /// GREATER_THAN_OR_EQUAL is required. Values must be numbers - /// between 0 and 10,000,000,000. + /// between 0 and 10,000,000,000 in string format. /// - /// One of Threshold or ThresholdExpression is required for this resource. + /// One of Threshold or ThresholdExpression is required for this resource. You + /// cannot specify both. /// /// The following are examples of valid ThresholdExpressions: /// @@ -3852,6 +4053,34 @@ extension AnomalySubscriptionFrequencyFromString on String { } } +enum ApproximationDimension { + service, + resource, +} + +extension ApproximationDimensionValueExtension on ApproximationDimension { + String toValue() { + switch (this) { + case ApproximationDimension.service: + return 'SERVICE'; + case ApproximationDimension.resource: + return 'RESOURCE'; + } + } +} + +extension ApproximationDimensionFromString on String { + ApproximationDimension toApproximationDimension() { + switch (this) { + case 'SERVICE': + return ApproximationDimension.service; + case 'RESOURCE': + return ApproximationDimension.resource; + } + throw Exception('$this is not known in enum ApproximationDimension'); + } +} + enum Context { costAndUsage, reservations, @@ -3901,10 +4130,18 @@ class CostAllocationTag { /// type tags are tags that you define, create, and apply to resources. final CostAllocationTagType type; + /// The last date that the tag was either activated or deactivated. + final String? lastUpdatedDate; + + /// The last month that the tag was used on an Amazon Web Services resource. + final String? lastUsedDate; + CostAllocationTag({ required this.status, required this.tagKey, required this.type, + this.lastUpdatedDate, + this.lastUsedDate, }); factory CostAllocationTag.fromJson(Map json) { @@ -3912,6 +4149,8 @@ class CostAllocationTag { status: (json['Status'] as String).toCostAllocationTagStatus(), tagKey: json['TagKey'] as String, type: (json['Type'] as String).toCostAllocationTagType(), + lastUpdatedDate: json['LastUpdatedDate'] as String?, + lastUsedDate: json['LastUsedDate'] as String?, ); } @@ -3919,14 +4158,106 @@ class CostAllocationTag { final status = this.status; final tagKey = this.tagKey; final type = this.type; + final lastUpdatedDate = this.lastUpdatedDate; + final lastUsedDate = this.lastUsedDate; return { 'Status': status.toValue(), 'TagKey': tagKey, 'Type': type.toValue(), + if (lastUpdatedDate != null) 'LastUpdatedDate': lastUpdatedDate, + if (lastUsedDate != null) 'LastUsedDate': lastUsedDate, + }; + } +} + +/// The cost allocation tag backfill request structure that contains metadata +/// and details of a certain backfill. +class CostAllocationTagBackfillRequest { + /// The date the backfill starts from. + final String? backfillFrom; + + /// The status of the cost allocation tag backfill request. + final CostAllocationTagBackfillStatus? backfillStatus; + + /// The backfill completion time. + final String? completedAt; + + /// The time when the backfill status was last updated. + final String? lastUpdatedAt; + + /// The time when the backfill was requested. + final String? requestedAt; + + CostAllocationTagBackfillRequest({ + this.backfillFrom, + this.backfillStatus, + this.completedAt, + this.lastUpdatedAt, + this.requestedAt, + }); + + factory CostAllocationTagBackfillRequest.fromJson(Map json) { + return CostAllocationTagBackfillRequest( + backfillFrom: json['BackfillFrom'] as String?, + backfillStatus: (json['BackfillStatus'] as String?) + ?.toCostAllocationTagBackfillStatus(), + completedAt: json['CompletedAt'] as String?, + lastUpdatedAt: json['LastUpdatedAt'] as String?, + requestedAt: json['RequestedAt'] as String?, + ); + } + + Map toJson() { + final backfillFrom = this.backfillFrom; + final backfillStatus = this.backfillStatus; + final completedAt = this.completedAt; + final lastUpdatedAt = this.lastUpdatedAt; + final requestedAt = this.requestedAt; + return { + if (backfillFrom != null) 'BackfillFrom': backfillFrom, + if (backfillStatus != null) 'BackfillStatus': backfillStatus.toValue(), + if (completedAt != null) 'CompletedAt': completedAt, + if (lastUpdatedAt != null) 'LastUpdatedAt': lastUpdatedAt, + if (requestedAt != null) 'RequestedAt': requestedAt, }; } } +enum CostAllocationTagBackfillStatus { + succeeded, + processing, + failed, +} + +extension CostAllocationTagBackfillStatusValueExtension + on CostAllocationTagBackfillStatus { + String toValue() { + switch (this) { + case CostAllocationTagBackfillStatus.succeeded: + return 'SUCCEEDED'; + case CostAllocationTagBackfillStatus.processing: + return 'PROCESSING'; + case CostAllocationTagBackfillStatus.failed: + return 'FAILED'; + } + } +} + +extension CostAllocationTagBackfillStatusFromString on String { + CostAllocationTagBackfillStatus toCostAllocationTagBackfillStatus() { + switch (this) { + case 'SUCCEEDED': + return CostAllocationTagBackfillStatus.succeeded; + case 'PROCESSING': + return CostAllocationTagBackfillStatus.processing; + case 'FAILED': + return CostAllocationTagBackfillStatus.failed; + } + throw Exception( + '$this is not known in enum CostAllocationTagBackfillStatus'); + } +} + enum CostAllocationTagStatus { active, inactive, @@ -4295,10 +4626,8 @@ class CostCategoryRule { /// object used to categorize costs. This supports dimensions, tags, and nested /// expressions. Currently the only dimensions supported are /// LINKED_ACCOUNT, SERVICE_CODE, - /// RECORD_TYPE, and LINKED_ACCOUNT_NAME. - /// - /// Root level OR isn't supported. We recommend that you create a - /// separate rule instead. + /// RECORD_TYPE, LINKED_ACCOUNT_NAME, + /// REGION, and USAGE_TYPE. /// /// RECORD_TYPE is a dimension used for Cost Explorer APIs, and is /// also supported for Cost Category expressions. This dimension uses different @@ -5597,8 +5926,8 @@ class EBSResourceUtilization { } } -/// Details about the Amazon EC2 instances that Amazon Web Services recommends -/// that you purchase. +/// Details about the Amazon EC2 reservations that Amazon Web Services +/// recommends that you purchase. class EC2InstanceDetails { /// The Availability Zone of the recommended reservation. final String? availabilityZone; @@ -5859,7 +6188,7 @@ class EC2Specification { } } -/// Details about the Amazon OpenSearch Service instances that Amazon Web +/// Details about the Amazon OpenSearch Service reservations that Amazon Web /// Services recommends that you purchase. class ESInstanceDetails { /// Determines whether the recommendation is for a current-generation instance. @@ -5911,7 +6240,7 @@ class ESInstanceDetails { } } -/// Details about the Amazon ElastiCache instances that Amazon Web Services +/// Details about the Amazon ElastiCache reservations that Amazon Web Services /// recommends that you purchase. class ElastiCacheInstanceDetails { /// Determines whether the recommendation is for a current generation instance. @@ -6016,7 +6345,7 @@ class ElastiCacheInstanceDetails { ///
    • /// The corresponding Expression for this example is as follows: /// { "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", -/// “us-west-1” ] } } +/// "us-west-1" ] } } ///
    • ///
    • /// As shown in the previous example, lists of dimension values are combined @@ -6030,7 +6359,7 @@ class ElastiCacheInstanceDetails { /// ///
        ///
      • -/// For example, you can filter for linked account names that start with “a”. +/// For example, you can filter for linked account names that start with "a". ///
      • ///
      • /// The corresponding Expression for this example is as follows: @@ -6497,6 +6826,47 @@ class GetAnomalySubscriptionsResponse { } } +class GetApproximateUsageRecordsResponse { + /// The lookback period that's used for the estimation. + final DateInterval? lookbackPeriod; + + /// The service metadata for the service or services in the response. + final Map? services; + + /// The total number of usage records for all services in the services list. + final int? totalRecords; + + GetApproximateUsageRecordsResponse({ + this.lookbackPeriod, + this.services, + this.totalRecords, + }); + + factory GetApproximateUsageRecordsResponse.fromJson( + Map json) { + return GetApproximateUsageRecordsResponse( + lookbackPeriod: json['LookbackPeriod'] != null + ? DateInterval.fromJson( + json['LookbackPeriod'] as Map) + : null, + services: (json['Services'] as Map?) + ?.map((k, e) => MapEntry(k, e as int)), + totalRecords: json['TotalRecords'] as int?, + ); + } + + Map toJson() { + final lookbackPeriod = this.lookbackPeriod; + final services = this.services; + final totalRecords = this.totalRecords; + return { + if (lookbackPeriod != null) 'LookbackPeriod': lookbackPeriod, + if (services != null) 'Services': services, + if (totalRecords != null) 'TotalRecords': totalRecords, + }; + } +} + class GetCostAndUsageResponse { /// The attributes that apply to a specific dimension value. For example, if the /// value is a linked account, the attribute is that account name. @@ -7101,6 +7471,41 @@ class GetRightsizingRecommendationResponse { } } +class GetSavingsPlanPurchaseRecommendationDetailsResponse { + /// Contains detailed information about a specific Savings Plan recommendation. + final RecommendationDetailData? recommendationDetailData; + + /// The ID that is associated with the Savings Plan recommendation. + final String? recommendationDetailId; + + GetSavingsPlanPurchaseRecommendationDetailsResponse({ + this.recommendationDetailData, + this.recommendationDetailId, + }); + + factory GetSavingsPlanPurchaseRecommendationDetailsResponse.fromJson( + Map json) { + return GetSavingsPlanPurchaseRecommendationDetailsResponse( + recommendationDetailData: json['RecommendationDetailData'] != null + ? RecommendationDetailData.fromJson( + json['RecommendationDetailData'] as Map) + : null, + recommendationDetailId: json['RecommendationDetailId'] as String?, + ); + } + + Map toJson() { + final recommendationDetailData = this.recommendationDetailData; + final recommendationDetailId = this.recommendationDetailId; + return { + if (recommendationDetailData != null) + 'RecommendationDetailData': recommendationDetailData, + if (recommendationDetailId != null) + 'RecommendationDetailId': recommendationDetailId, + }; + } +} + class GetSavingsPlansCoverageResponse { /// The amount of spend that your Savings Plans covered. final List savingsPlansCoverages; @@ -7556,33 +7961,38 @@ class Impact { } } -/// Details about the instances that Amazon Web Services recommends that you +/// Details about the reservations that Amazon Web Services recommends that you /// purchase. class InstanceDetails { - /// The Amazon EC2 instances that Amazon Web Services recommends that you + /// The Amazon EC2 reservations that Amazon Web Services recommends that you /// purchase. final EC2InstanceDetails? eC2InstanceDetails; - /// The Amazon OpenSearch Service instances that Amazon Web Services recommends - /// that you purchase. + /// The Amazon OpenSearch Service reservations that Amazon Web Services + /// recommends that you purchase. final ESInstanceDetails? eSInstanceDetails; - /// The ElastiCache instances that Amazon Web Services recommends that you + /// The ElastiCache reservations that Amazon Web Services recommends that you /// purchase. final ElastiCacheInstanceDetails? elastiCacheInstanceDetails; - /// The Amazon RDS instances that Amazon Web Services recommends that you + /// The MemoryDB reservations that Amazon Web Services recommends that you /// purchase. - final RDSInstanceDetails? rDSInstanceDetails; + final MemoryDBInstanceDetails? memoryDBInstanceDetails; - /// The Amazon Redshift instances that Amazon Web Services recommends that you + /// The Amazon RDS reservations that Amazon Web Services recommends that you /// purchase. + final RDSInstanceDetails? rDSInstanceDetails; + + /// The Amazon Redshift reservations that Amazon Web Services recommends that + /// you purchase. final RedshiftInstanceDetails? redshiftInstanceDetails; InstanceDetails({ this.eC2InstanceDetails, this.eSInstanceDetails, this.elastiCacheInstanceDetails, + this.memoryDBInstanceDetails, this.rDSInstanceDetails, this.redshiftInstanceDetails, }); @@ -7601,6 +8011,10 @@ class InstanceDetails { ? ElastiCacheInstanceDetails.fromJson( json['ElastiCacheInstanceDetails'] as Map) : null, + memoryDBInstanceDetails: json['MemoryDBInstanceDetails'] != null + ? MemoryDBInstanceDetails.fromJson( + json['MemoryDBInstanceDetails'] as Map) + : null, rDSInstanceDetails: json['RDSInstanceDetails'] != null ? RDSInstanceDetails.fromJson( json['RDSInstanceDetails'] as Map) @@ -7616,6 +8030,7 @@ class InstanceDetails { final eC2InstanceDetails = this.eC2InstanceDetails; final eSInstanceDetails = this.eSInstanceDetails; final elastiCacheInstanceDetails = this.elastiCacheInstanceDetails; + final memoryDBInstanceDetails = this.memoryDBInstanceDetails; final rDSInstanceDetails = this.rDSInstanceDetails; final redshiftInstanceDetails = this.redshiftInstanceDetails; return { @@ -7623,6 +8038,8 @@ class InstanceDetails { if (eSInstanceDetails != null) 'ESInstanceDetails': eSInstanceDetails, if (elastiCacheInstanceDetails != null) 'ElastiCacheInstanceDetails': elastiCacheInstanceDetails, + if (memoryDBInstanceDetails != null) + 'MemoryDBInstanceDetails': memoryDBInstanceDetails, if (rDSInstanceDetails != null) 'RDSInstanceDetails': rDSInstanceDetails, if (redshiftInstanceDetails != null) 'RedshiftInstanceDetails': redshiftInstanceDetails, @@ -7630,6 +8047,42 @@ class InstanceDetails { } } +class ListCostAllocationTagBackfillHistoryResponse { + /// The list of historical cost allocation tag backfill requests. + final List? backfillRequests; + + /// The token to retrieve the next set of results. Amazon Web Services provides + /// the token when the response from a previous call has more results than the + /// maximum page size. + final String? nextToken; + + ListCostAllocationTagBackfillHistoryResponse({ + this.backfillRequests, + this.nextToken, + }); + + factory ListCostAllocationTagBackfillHistoryResponse.fromJson( + Map json) { + return ListCostAllocationTagBackfillHistoryResponse( + backfillRequests: (json['BackfillRequests'] as List?) + ?.whereNotNull() + .map((e) => CostAllocationTagBackfillRequest.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final backfillRequests = this.backfillRequests; + final nextToken = this.nextToken; + return { + if (backfillRequests != null) 'BackfillRequests': backfillRequests, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListCostAllocationTagsResponse { /// A list of cost allocation tags that includes the detailed metadata for each /// one. @@ -7852,19 +8305,71 @@ extension MatchOptionFromString on String { } } -enum Metric { - blendedCost, - unblendedCost, - amortizedCost, - netUnblendedCost, - netAmortizedCost, - usageQuantity, - normalizedUsageAmount, -} +/// Details about the MemoryDB reservations that Amazon Web Services recommends +/// that you purchase. +class MemoryDBInstanceDetails { + /// Determines whether the recommendation is for a current generation instance. + final bool? currentGeneration; -extension MetricValueExtension on Metric { - String toValue() { - switch (this) { + /// The instance family of the recommended reservation. + final String? family; + + /// The node type of the recommended reservation. + final String? nodeType; + + /// The Amazon Web Services Region of the recommended reservation. + final String? region; + + /// Determines whether the recommended reservation is size flexible. + final bool? sizeFlexEligible; + + MemoryDBInstanceDetails({ + this.currentGeneration, + this.family, + this.nodeType, + this.region, + this.sizeFlexEligible, + }); + + factory MemoryDBInstanceDetails.fromJson(Map json) { + return MemoryDBInstanceDetails( + currentGeneration: json['CurrentGeneration'] as bool?, + family: json['Family'] as String?, + nodeType: json['NodeType'] as String?, + region: json['Region'] as String?, + sizeFlexEligible: json['SizeFlexEligible'] as bool?, + ); + } + + Map toJson() { + final currentGeneration = this.currentGeneration; + final family = this.family; + final nodeType = this.nodeType; + final region = this.region; + final sizeFlexEligible = this.sizeFlexEligible; + return { + if (currentGeneration != null) 'CurrentGeneration': currentGeneration, + if (family != null) 'Family': family, + if (nodeType != null) 'NodeType': nodeType, + if (region != null) 'Region': region, + if (sizeFlexEligible != null) 'SizeFlexEligible': sizeFlexEligible, + }; + } +} + +enum Metric { + blendedCost, + unblendedCost, + amortizedCost, + netUnblendedCost, + netAmortizedCost, + usageQuantity, + normalizedUsageAmount, +} + +extension MetricValueExtension on Metric { + String toValue() { + switch (this) { case Metric.blendedCost: return 'BLENDED_COST'; case Metric.unblendedCost: @@ -8253,8 +8758,8 @@ class ProvideAnomalyFeedbackResponse { } } -/// Details about the Amazon RDS instances that Amazon Web Services recommends -/// that you purchase. +/// Details about the Amazon RDS reservations that Amazon Web Services +/// recommends that you purchase. class RDSInstanceDetails { /// Determines whether the recommendation is for a current-generation instance. final bool? currentGeneration; @@ -8335,6 +8840,333 @@ class RDSInstanceDetails { } } +/// The details and metrics for the given recommendation. +class RecommendationDetailData { + /// The AccountID that the recommendation is generated for. + final String? accountId; + + /// The account scope that you want your recommendations for. Amazon Web + /// Services calculates recommendations including the management account and + /// member accounts if the value is set to PAYER. If the value is LINKED, + /// recommendations are calculated for individual member accounts only. + final AccountScope? accountScope; + + /// The currency code that Amazon Web Services used to generate the + /// recommendation and present potential savings. + final String? currencyCode; + + /// The average value of hourly coverage over the lookback period. + final String? currentAverageCoverage; + + /// The average value of hourly On-Demand spend over the lookback period of the + /// applicable usage type. + final String? currentAverageHourlyOnDemandSpend; + + /// The highest value of hourly On-Demand spend over the lookback period of the + /// applicable usage type. + final String? currentMaximumHourlyOnDemandSpend; + + /// The lowest value of hourly On-Demand spend over the lookback period of the + /// applicable usage type. + final String? currentMinimumHourlyOnDemandSpend; + + /// The estimated coverage of the recommended Savings Plan. + final String? estimatedAverageCoverage; + + /// The estimated utilization of the recommended Savings Plan. + final String? estimatedAverageUtilization; + + /// The estimated monthly savings amount based on the recommended Savings Plan. + final String? estimatedMonthlySavingsAmount; + + /// The remaining On-Demand cost estimated to not be covered by the recommended + /// Savings Plan, over the length of the lookback period. + final String? estimatedOnDemandCost; + + /// The estimated On-Demand costs you expect with no additional commitment, + /// based on your usage of the selected time period and the Savings Plan you + /// own. + final String? estimatedOnDemandCostWithCurrentCommitment; + + /// The estimated return on investment that's based on the recommended Savings + /// Plan that you purchased. This is calculated as + /// estimatedSavingsAmount/estimatedSPCost*100. + final String? estimatedROI; + + /// The cost of the recommended Savings Plan over the length of the lookback + /// period. + final String? estimatedSPCost; + + /// The estimated savings amount that's based on the recommended Savings Plan + /// over the length of the lookback period. + final String? estimatedSavingsAmount; + + /// The estimated savings percentage relative to the total cost of applicable + /// On-Demand usage over the lookback period. + final String? estimatedSavingsPercentage; + + /// The existing hourly commitment for the Savings Plan type. + final String? existingHourlyCommitment; + final String? generationTimestamp; + + /// The recommended hourly commitment level for the Savings Plan type and the + /// configuration that's based on the usage during the lookback period. + final String? hourlyCommitmentToPurchase; + + /// The instance family of the recommended Savings Plan. + final String? instanceFamily; + final String? latestUsageTimestamp; + + /// How many days of previous usage that Amazon Web Services considers when + /// making this recommendation. + final LookbackPeriodInDays? lookbackPeriodInDays; + + /// The related hourly cost, coverage, and utilization metrics over the lookback + /// period. + final List? metricsOverLookbackPeriod; + + /// The unique ID that's used to distinguish Savings Plans from one another. + final String? offeringId; + + /// The payment option for the commitment (for example, All Upfront or No + /// Upfront). + final PaymentOption? paymentOption; + + /// The region the recommendation is generated for. + final String? region; + + /// The requested Savings Plan recommendation type. + final SupportedSavingsPlansType? savingsPlansType; + + /// The term of the commitment in years. + final TermInYears? termInYears; + + /// The upfront cost of the recommended Savings Plan, based on the selected + /// payment option. + final String? upfrontCost; + + RecommendationDetailData({ + this.accountId, + this.accountScope, + this.currencyCode, + this.currentAverageCoverage, + this.currentAverageHourlyOnDemandSpend, + this.currentMaximumHourlyOnDemandSpend, + this.currentMinimumHourlyOnDemandSpend, + this.estimatedAverageCoverage, + this.estimatedAverageUtilization, + this.estimatedMonthlySavingsAmount, + this.estimatedOnDemandCost, + this.estimatedOnDemandCostWithCurrentCommitment, + this.estimatedROI, + this.estimatedSPCost, + this.estimatedSavingsAmount, + this.estimatedSavingsPercentage, + this.existingHourlyCommitment, + this.generationTimestamp, + this.hourlyCommitmentToPurchase, + this.instanceFamily, + this.latestUsageTimestamp, + this.lookbackPeriodInDays, + this.metricsOverLookbackPeriod, + this.offeringId, + this.paymentOption, + this.region, + this.savingsPlansType, + this.termInYears, + this.upfrontCost, + }); + + factory RecommendationDetailData.fromJson(Map json) { + return RecommendationDetailData( + accountId: json['AccountId'] as String?, + accountScope: (json['AccountScope'] as String?)?.toAccountScope(), + currencyCode: json['CurrencyCode'] as String?, + currentAverageCoverage: json['CurrentAverageCoverage'] as String?, + currentAverageHourlyOnDemandSpend: + json['CurrentAverageHourlyOnDemandSpend'] as String?, + currentMaximumHourlyOnDemandSpend: + json['CurrentMaximumHourlyOnDemandSpend'] as String?, + currentMinimumHourlyOnDemandSpend: + json['CurrentMinimumHourlyOnDemandSpend'] as String?, + estimatedAverageCoverage: json['EstimatedAverageCoverage'] as String?, + estimatedAverageUtilization: + json['EstimatedAverageUtilization'] as String?, + estimatedMonthlySavingsAmount: + json['EstimatedMonthlySavingsAmount'] as String?, + estimatedOnDemandCost: json['EstimatedOnDemandCost'] as String?, + estimatedOnDemandCostWithCurrentCommitment: + json['EstimatedOnDemandCostWithCurrentCommitment'] as String?, + estimatedROI: json['EstimatedROI'] as String?, + estimatedSPCost: json['EstimatedSPCost'] as String?, + estimatedSavingsAmount: json['EstimatedSavingsAmount'] as String?, + estimatedSavingsPercentage: json['EstimatedSavingsPercentage'] as String?, + existingHourlyCommitment: json['ExistingHourlyCommitment'] as String?, + generationTimestamp: json['GenerationTimestamp'] as String?, + hourlyCommitmentToPurchase: json['HourlyCommitmentToPurchase'] as String?, + instanceFamily: json['InstanceFamily'] as String?, + latestUsageTimestamp: json['LatestUsageTimestamp'] as String?, + lookbackPeriodInDays: + (json['LookbackPeriodInDays'] as String?)?.toLookbackPeriodInDays(), + metricsOverLookbackPeriod: (json['MetricsOverLookbackPeriod'] as List?) + ?.whereNotNull() + .map((e) => RecommendationDetailHourlyMetrics.fromJson( + e as Map)) + .toList(), + offeringId: json['OfferingId'] as String?, + paymentOption: (json['PaymentOption'] as String?)?.toPaymentOption(), + region: json['Region'] as String?, + savingsPlansType: + (json['SavingsPlansType'] as String?)?.toSupportedSavingsPlansType(), + termInYears: (json['TermInYears'] as String?)?.toTermInYears(), + upfrontCost: json['UpfrontCost'] as String?, + ); + } + + Map toJson() { + final accountId = this.accountId; + final accountScope = this.accountScope; + final currencyCode = this.currencyCode; + final currentAverageCoverage = this.currentAverageCoverage; + final currentAverageHourlyOnDemandSpend = + this.currentAverageHourlyOnDemandSpend; + final currentMaximumHourlyOnDemandSpend = + this.currentMaximumHourlyOnDemandSpend; + final currentMinimumHourlyOnDemandSpend = + this.currentMinimumHourlyOnDemandSpend; + final estimatedAverageCoverage = this.estimatedAverageCoverage; + final estimatedAverageUtilization = this.estimatedAverageUtilization; + final estimatedMonthlySavingsAmount = this.estimatedMonthlySavingsAmount; + final estimatedOnDemandCost = this.estimatedOnDemandCost; + final estimatedOnDemandCostWithCurrentCommitment = + this.estimatedOnDemandCostWithCurrentCommitment; + final estimatedROI = this.estimatedROI; + final estimatedSPCost = this.estimatedSPCost; + final estimatedSavingsAmount = this.estimatedSavingsAmount; + final estimatedSavingsPercentage = this.estimatedSavingsPercentage; + final existingHourlyCommitment = this.existingHourlyCommitment; + final generationTimestamp = this.generationTimestamp; + final hourlyCommitmentToPurchase = this.hourlyCommitmentToPurchase; + final instanceFamily = this.instanceFamily; + final latestUsageTimestamp = this.latestUsageTimestamp; + final lookbackPeriodInDays = this.lookbackPeriodInDays; + final metricsOverLookbackPeriod = this.metricsOverLookbackPeriod; + final offeringId = this.offeringId; + final paymentOption = this.paymentOption; + final region = this.region; + final savingsPlansType = this.savingsPlansType; + final termInYears = this.termInYears; + final upfrontCost = this.upfrontCost; + return { + if (accountId != null) 'AccountId': accountId, + if (accountScope != null) 'AccountScope': accountScope.toValue(), + if (currencyCode != null) 'CurrencyCode': currencyCode, + if (currentAverageCoverage != null) + 'CurrentAverageCoverage': currentAverageCoverage, + if (currentAverageHourlyOnDemandSpend != null) + 'CurrentAverageHourlyOnDemandSpend': currentAverageHourlyOnDemandSpend, + if (currentMaximumHourlyOnDemandSpend != null) + 'CurrentMaximumHourlyOnDemandSpend': currentMaximumHourlyOnDemandSpend, + if (currentMinimumHourlyOnDemandSpend != null) + 'CurrentMinimumHourlyOnDemandSpend': currentMinimumHourlyOnDemandSpend, + if (estimatedAverageCoverage != null) + 'EstimatedAverageCoverage': estimatedAverageCoverage, + if (estimatedAverageUtilization != null) + 'EstimatedAverageUtilization': estimatedAverageUtilization, + if (estimatedMonthlySavingsAmount != null) + 'EstimatedMonthlySavingsAmount': estimatedMonthlySavingsAmount, + if (estimatedOnDemandCost != null) + 'EstimatedOnDemandCost': estimatedOnDemandCost, + if (estimatedOnDemandCostWithCurrentCommitment != null) + 'EstimatedOnDemandCostWithCurrentCommitment': + estimatedOnDemandCostWithCurrentCommitment, + if (estimatedROI != null) 'EstimatedROI': estimatedROI, + if (estimatedSPCost != null) 'EstimatedSPCost': estimatedSPCost, + if (estimatedSavingsAmount != null) + 'EstimatedSavingsAmount': estimatedSavingsAmount, + if (estimatedSavingsPercentage != null) + 'EstimatedSavingsPercentage': estimatedSavingsPercentage, + if (existingHourlyCommitment != null) + 'ExistingHourlyCommitment': existingHourlyCommitment, + if (generationTimestamp != null) + 'GenerationTimestamp': generationTimestamp, + if (hourlyCommitmentToPurchase != null) + 'HourlyCommitmentToPurchase': hourlyCommitmentToPurchase, + if (instanceFamily != null) 'InstanceFamily': instanceFamily, + if (latestUsageTimestamp != null) + 'LatestUsageTimestamp': latestUsageTimestamp, + if (lookbackPeriodInDays != null) + 'LookbackPeriodInDays': lookbackPeriodInDays.toValue(), + if (metricsOverLookbackPeriod != null) + 'MetricsOverLookbackPeriod': metricsOverLookbackPeriod, + if (offeringId != null) 'OfferingId': offeringId, + if (paymentOption != null) 'PaymentOption': paymentOption.toValue(), + if (region != null) 'Region': region, + if (savingsPlansType != null) + 'SavingsPlansType': savingsPlansType.toValue(), + if (termInYears != null) 'TermInYears': termInYears.toValue(), + if (upfrontCost != null) 'UpfrontCost': upfrontCost, + }; + } +} + +/// Contains the hourly metrics for the given recommendation over the lookback +/// period. +class RecommendationDetailHourlyMetrics { + /// The current amount of Savings Plans eligible usage that the Savings Plan + /// covered. + final String? currentCoverage; + + /// The estimated coverage amount based on the recommended Savings Plan. + final String? estimatedCoverage; + + /// The estimated utilization for the recommended Savings Plan. + final String? estimatedNewCommitmentUtilization; + + /// The remaining On-Demand cost estimated to not be covered by the recommended + /// Savings Plan, over the length of the lookback period. + final String? estimatedOnDemandCost; + final String? startTime; + + RecommendationDetailHourlyMetrics({ + this.currentCoverage, + this.estimatedCoverage, + this.estimatedNewCommitmentUtilization, + this.estimatedOnDemandCost, + this.startTime, + }); + + factory RecommendationDetailHourlyMetrics.fromJson( + Map json) { + return RecommendationDetailHourlyMetrics( + currentCoverage: json['CurrentCoverage'] as String?, + estimatedCoverage: json['EstimatedCoverage'] as String?, + estimatedNewCommitmentUtilization: + json['EstimatedNewCommitmentUtilization'] as String?, + estimatedOnDemandCost: json['EstimatedOnDemandCost'] as String?, + startTime: json['StartTime'] as String?, + ); + } + + Map toJson() { + final currentCoverage = this.currentCoverage; + final estimatedCoverage = this.estimatedCoverage; + final estimatedNewCommitmentUtilization = + this.estimatedNewCommitmentUtilization; + final estimatedOnDemandCost = this.estimatedOnDemandCost; + final startTime = this.startTime; + return { + if (currentCoverage != null) 'CurrentCoverage': currentCoverage, + if (estimatedCoverage != null) 'EstimatedCoverage': estimatedCoverage, + if (estimatedNewCommitmentUtilization != null) + 'EstimatedNewCommitmentUtilization': estimatedNewCommitmentUtilization, + if (estimatedOnDemandCost != null) + 'EstimatedOnDemandCost': estimatedOnDemandCost, + if (startTime != null) 'StartTime': startTime, + }; + } +} + enum RecommendationTarget { sameInstanceFamily, crossInstanceFamily, @@ -8363,7 +9195,7 @@ extension RecommendationTargetFromString on String { } } -/// Details about the Amazon Redshift instances that Amazon Web Services +/// Details about the Amazon Redshift reservations that Amazon Web Services /// recommends that you purchase. class RedshiftInstanceDetails { /// Determines whether the recommendation is for a current-generation instance. @@ -8732,7 +9564,7 @@ class ReservationPurchaseRecommendationDetail { /// during the specified historical period if you had a reservation. final String? estimatedReservationCostForLookbackPeriod; - /// Details about the instances that Amazon Web Services recommends that you + /// Details about the reservations that Amazon Web Services recommends that you /// purchase. final InstanceDetails? instanceDetails; @@ -8907,16 +9739,20 @@ class ReservationPurchaseRecommendationDetail { } } -/// Information about this specific recommendation, such as the timestamp for -/// when Amazon Web Services made a specific recommendation. +/// Information about a recommendation, such as the timestamp for when Amazon +/// Web Services made a specific recommendation. class ReservationPurchaseRecommendationMetadata { - /// The timestamp for when Amazon Web Services made this recommendation. + /// Additional metadata that might be applicable to the recommendation. + final String? additionalMetadata; + + /// The timestamp for when Amazon Web Services made the recommendation. final String? generationTimestamp; - /// The ID for this specific recommendation. + /// The ID for the recommendation. final String? recommendationId; ReservationPurchaseRecommendationMetadata({ + this.additionalMetadata, this.generationTimestamp, this.recommendationId, }); @@ -8924,15 +9760,18 @@ class ReservationPurchaseRecommendationMetadata { factory ReservationPurchaseRecommendationMetadata.fromJson( Map json) { return ReservationPurchaseRecommendationMetadata( + additionalMetadata: json['AdditionalMetadata'] as String?, generationTimestamp: json['GenerationTimestamp'] as String?, recommendationId: json['RecommendationId'] as String?, ); } Map toJson() { + final additionalMetadata = this.additionalMetadata; final generationTimestamp = this.generationTimestamp; final recommendationId = this.recommendationId; return { + if (additionalMetadata != null) 'AdditionalMetadata': additionalMetadata, if (generationTimestamp != null) 'GenerationTimestamp': generationTimestamp, if (recommendationId != null) 'RecommendationId': recommendationId, @@ -9298,19 +10137,19 @@ class RightsizingRecommendationConfiguration { } } -/// Metadata for this recommendation set. +/// Metadata for a recommendation set. class RightsizingRecommendationMetadata { /// Additional metadata that might be applicable to the recommendation. final String? additionalMetadata; - /// The timestamp for when Amazon Web Services made this recommendation. + /// The timestamp for when Amazon Web Services made the recommendation. final String? generationTimestamp; /// The number of days of previous usage that Amazon Web Services considers when - /// making this recommendation. + /// making the recommendation. final LookbackPeriodInDays? lookbackPeriodInDays; - /// The ID for this specific recommendation. + /// The ID for the recommendation. final String? recommendationId; RightsizingRecommendationMetadata({ @@ -9845,6 +10684,9 @@ class SavingsPlansPurchaseRecommendationDetail { /// configuration that's based on the usage during the lookback period. final String? hourlyCommitmentToPurchase; + /// Contains detailed information about a specific Savings Plan recommendation. + final String? recommendationDetailId; + /// Details for your recommended Savings Plans. final SavingsPlansDetails? savingsPlansDetails; @@ -9867,6 +10709,7 @@ class SavingsPlansPurchaseRecommendationDetail { this.estimatedSavingsAmount, this.estimatedSavingsPercentage, this.hourlyCommitmentToPurchase, + this.recommendationDetailId, this.savingsPlansDetails, this.upfrontCost, }); @@ -9894,6 +10737,7 @@ class SavingsPlansPurchaseRecommendationDetail { estimatedSavingsAmount: json['EstimatedSavingsAmount'] as String?, estimatedSavingsPercentage: json['EstimatedSavingsPercentage'] as String?, hourlyCommitmentToPurchase: json['HourlyCommitmentToPurchase'] as String?, + recommendationDetailId: json['RecommendationDetailId'] as String?, savingsPlansDetails: json['SavingsPlansDetails'] != null ? SavingsPlansDetails.fromJson( json['SavingsPlansDetails'] as Map) @@ -9921,6 +10765,7 @@ class SavingsPlansPurchaseRecommendationDetail { final estimatedSavingsAmount = this.estimatedSavingsAmount; final estimatedSavingsPercentage = this.estimatedSavingsPercentage; final hourlyCommitmentToPurchase = this.hourlyCommitmentToPurchase; + final recommendationDetailId = this.recommendationDetailId; final savingsPlansDetails = this.savingsPlansDetails; final upfrontCost = this.upfrontCost; return { @@ -9949,6 +10794,8 @@ class SavingsPlansPurchaseRecommendationDetail { 'EstimatedSavingsPercentage': estimatedSavingsPercentage, if (hourlyCommitmentToPurchase != null) 'HourlyCommitmentToPurchase': hourlyCommitmentToPurchase, + if (recommendationDetailId != null) + 'RecommendationDetailId': recommendationDetailId, if (savingsPlansDetails != null) 'SavingsPlansDetails': savingsPlansDetails, if (upfrontCost != null) 'UpfrontCost': upfrontCost, @@ -10453,6 +11300,32 @@ extension SortOrderFromString on String { } } +class StartCostAllocationTagBackfillResponse { + /// An object containing detailed metadata of your new backfill request. + final CostAllocationTagBackfillRequest? backfillRequest; + + StartCostAllocationTagBackfillResponse({ + this.backfillRequest, + }); + + factory StartCostAllocationTagBackfillResponse.fromJson( + Map json) { + return StartCostAllocationTagBackfillResponse( + backfillRequest: json['BackfillRequest'] != null + ? CostAllocationTagBackfillRequest.fromJson( + json['BackfillRequest'] as Map) + : null, + ); + } + + Map toJson() { + final backfillRequest = this.backfillRequest; + return { + if (backfillRequest != null) 'BackfillRequest': backfillRequest, + }; + } +} + class StartSavingsPlansPurchaseRecommendationGenerationResponse { /// The estimated time for when the recommendation generation will complete. final String? estimatedCompletionTime; @@ -11062,6 +11935,14 @@ class UtilizationByTime { } } +class BackfillLimitExceededException extends _s.GenericAwsException { + BackfillLimitExceededException({String? type, String? message}) + : super( + type: type, + code: 'BackfillLimitExceededException', + message: message); +} + class BillExpirationException extends _s.GenericAwsException { BillExpirationException({String? type, String? message}) : super(type: type, code: 'BillExpirationException', message: message); @@ -11130,6 +12011,8 @@ class UnresolvableUsageUnitException extends _s.GenericAwsException { } final _exceptionFns = { + 'BackfillLimitExceededException': (type, message) => + BackfillLimitExceededException(type: type, message: message), 'BillExpirationException': (type, message) => BillExpirationException(type: type, message: message), 'DataUnavailableException': (type, message) => diff --git a/aws_client/lib/src/generated/cost_optimization_hub/v2022_07_26.dart b/aws_client/lib/src/generated/cost_optimization_hub/v2022_07_26.dart new file mode 100644 index 000000000..ae0c274c8 --- /dev/null +++ b/aws_client/lib/src/generated/cost_optimization_hub/v2022_07_26.dart @@ -0,0 +1,3587 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// You can use the Cost Optimization Hub API to programmatically identify, +/// filter, aggregate, and quantify savings for your cost optimization +/// recommendations across multiple Amazon Web Services Regions and Amazon Web +/// Services accounts in your organization. +/// +/// The Cost Optimization Hub API provides the following endpoint: +/// +///
          +///
        • +/// https://cost-optimization-hub.us-east-1.amazonaws.com +///
        • +///
        +class CostOptimizationHub { + final _s.JsonProtocol _protocol; + CostOptimizationHub({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.JsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'cost-optimization-hub', + signingName: 'cost-optimization-hub', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Returns a set of preferences for an account in order to add + /// account-specific preferences into the service. These preferences impact + /// how the savings associated with recommendations are presented—estimated + /// savings after discounts or estimated savings before discounts, for + /// example. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + Future getPreferences() async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.GetPreferences' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + ); + + return GetPreferencesResponse.fromJson(jsonResponse.body); + } + + /// Returns both the current and recommended resource configuration and the + /// estimated cost impact for a recommendation. + /// + /// The recommendationId is only valid for up to a maximum of 24 + /// hours as recommendations are refreshed daily. To retrieve the + /// recommendationId, use the ListRecommendations + /// API. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [recommendationId] : + /// The ID for the recommendation. + Future getRecommendation({ + required String recommendationId, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.GetRecommendation' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'recommendationId': recommendationId, + }, + ); + + return GetRecommendationResponse.fromJson(jsonResponse.body); + } + + /// Retrieves the enrollment status for an account. It can also return the + /// list of accounts that are enrolled under the organization. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [accountId] : + /// The account ID of a member account in the organization. + /// + /// Parameter [includeOrganizationInfo] : + /// Indicates whether to return the enrollment status for the organization. + /// + /// Parameter [maxResults] : + /// The maximum number of objects that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listEnrollmentStatuses({ + String? accountId, + bool? includeOrganizationInfo, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 100, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.ListEnrollmentStatuses' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (accountId != null) 'accountId': accountId, + if (includeOrganizationInfo != null) + 'includeOrganizationInfo': includeOrganizationInfo, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListEnrollmentStatusesResponse.fromJson(jsonResponse.body); + } + + /// Returns a concise representation of savings estimates for resources. Also + /// returns de-duped savings across different types of recommendations. + /// + /// The following filters are not supported for this API: + /// recommendationIds, resourceArns, and + /// resourceIds. + /// + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [groupBy] : + /// The grouping of recommendations by a dimension. + /// + /// Parameter [maxResults] : + /// The maximum number of recommendations that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + Future listRecommendationSummaries({ + required String groupBy, + Filter? filter, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 1000, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.ListRecommendationSummaries' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'groupBy': groupBy, + if (filter != null) 'filter': filter, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + }, + ); + + return ListRecommendationSummariesResponse.fromJson(jsonResponse.body); + } + + /// Returns a list of recommendations. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [filter] : + /// The constraints that you want all returned recommendations to match. + /// + /// Parameter [includeAllRecommendations] : + /// List of all recommendations for a resource, or a single recommendation if + /// de-duped by resourceId. + /// + /// Parameter [maxResults] : + /// The maximum number of recommendations that are returned for the request. + /// + /// Parameter [nextToken] : + /// The token to retrieve the next set of results. + /// + /// Parameter [orderBy] : + /// The ordering of recommendations by a dimension. + Future listRecommendations({ + Filter? filter, + bool? includeAllRecommendations, + int? maxResults, + String? nextToken, + OrderBy? orderBy, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 0, + 1000, + ); + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.ListRecommendations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filter != null) 'filter': filter, + if (includeAllRecommendations != null) + 'includeAllRecommendations': includeAllRecommendations, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (orderBy != null) 'orderBy': orderBy, + }, + ); + + return ListRecommendationsResponse.fromJson(jsonResponse.body); + } + + /// Updates the enrollment (opt in and opt out) status of an account to the + /// Cost Optimization Hub service. + /// + /// If the account is a management account of an organization, this action can + /// also be used to enroll member accounts of the organization. + /// + /// You must have the appropriate permissions to opt in to Cost Optimization + /// Hub and to view its recommendations. When you opt in, Cost Optimization + /// Hub automatically creates a service-linked role in your account to access + /// its data. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [status] : + /// Sets the account status. + /// + /// Parameter [includeMemberAccounts] : + /// Indicates whether to enroll member accounts of the organization if the + /// account is the management account. + Future updateEnrollmentStatus({ + required EnrollmentStatus status, + bool? includeMemberAccounts, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.UpdateEnrollmentStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'status': status.toValue(), + if (includeMemberAccounts != null) + 'includeMemberAccounts': includeMemberAccounts, + }, + ); + + return UpdateEnrollmentStatusResponse.fromJson(jsonResponse.body); + } + + /// Updates a set of preferences for an account in order to add + /// account-specific preferences into the service. These preferences impact + /// how the savings associated with recommendations are presented. + /// + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [memberAccountDiscountVisibility] : + /// Sets the "member account discount visibility" preference. + /// + /// Parameter [savingsEstimationMode] : + /// Sets the "savings estimation mode" preference. + Future updatePreferences({ + MemberAccountDiscountVisibility? memberAccountDiscountVisibility, + SavingsEstimationMode? savingsEstimationMode, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'CostOptimizationHubService.UpdatePreferences' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (memberAccountDiscountVisibility != null) + 'memberAccountDiscountVisibility': + memberAccountDiscountVisibility.toValue(), + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode.toValue(), + }, + ); + + return UpdatePreferencesResponse.fromJson(jsonResponse.body); + } +} + +/// Describes the enrollment status of an organization's member accounts in Cost +/// Optimization Hub. +class AccountEnrollmentStatus { + /// The Amazon Web Services account ID. + final String? accountId; + + /// The time when the account enrollment status was created. + final DateTime? createdTimestamp; + + /// The time when the account enrollment status was last updated. + final DateTime? lastUpdatedTimestamp; + + /// The account enrollment status. + final EnrollmentStatus? status; + + AccountEnrollmentStatus({ + this.accountId, + this.createdTimestamp, + this.lastUpdatedTimestamp, + this.status, + }); + + factory AccountEnrollmentStatus.fromJson(Map json) { + return AccountEnrollmentStatus( + accountId: json['accountId'] as String?, + createdTimestamp: timeStampFromJson(json['createdTimestamp']), + lastUpdatedTimestamp: timeStampFromJson(json['lastUpdatedTimestamp']), + status: (json['status'] as String?)?.toEnrollmentStatus(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final createdTimestamp = this.createdTimestamp; + final lastUpdatedTimestamp = this.lastUpdatedTimestamp; + final status = this.status; + return { + if (accountId != null) 'accountId': accountId, + if (createdTimestamp != null) + 'createdTimestamp': unixTimestampToJson(createdTimestamp), + if (lastUpdatedTimestamp != null) + 'lastUpdatedTimestamp': unixTimestampToJson(lastUpdatedTimestamp), + if (status != null) 'status': status.toValue(), + }; + } +} + +enum ActionType { + rightsize, + stop, + upgrade, + purchaseSavingsPlans, + purchaseReservedInstances, + migrateToGraviton, +} + +extension ActionTypeValueExtension on ActionType { + String toValue() { + switch (this) { + case ActionType.rightsize: + return 'Rightsize'; + case ActionType.stop: + return 'Stop'; + case ActionType.upgrade: + return 'Upgrade'; + case ActionType.purchaseSavingsPlans: + return 'PurchaseSavingsPlans'; + case ActionType.purchaseReservedInstances: + return 'PurchaseReservedInstances'; + case ActionType.migrateToGraviton: + return 'MigrateToGraviton'; + } + } +} + +extension ActionTypeFromString on String { + ActionType toActionType() { + switch (this) { + case 'Rightsize': + return ActionType.rightsize; + case 'Stop': + return ActionType.stop; + case 'Upgrade': + return ActionType.upgrade; + case 'PurchaseSavingsPlans': + return ActionType.purchaseSavingsPlans; + case 'PurchaseReservedInstances': + return ActionType.purchaseReservedInstances; + case 'MigrateToGraviton': + return ActionType.migrateToGraviton; + } + throw Exception('$this is not known in enum ActionType'); + } +} + +/// Describes the Amazon Elastic Block Store performance configuration of the +/// current and recommended resource configuration for a recommendation. +class BlockStoragePerformanceConfiguration { + /// The number of I/O operations per second. + final double? iops; + + /// The throughput that the volume supports. + final double? throughput; + + BlockStoragePerformanceConfiguration({ + this.iops, + this.throughput, + }); + + factory BlockStoragePerformanceConfiguration.fromJson( + Map json) { + return BlockStoragePerformanceConfiguration( + iops: json['iops'] as double?, + throughput: json['throughput'] as double?, + ); + } + + Map toJson() { + final iops = this.iops; + final throughput = this.throughput; + return { + if (iops != null) 'iops': iops, + if (throughput != null) 'throughput': throughput, + }; + } +} + +/// Describes the performance configuration for compute services such as Amazon +/// EC2, Lambda, and ECS. +class ComputeConfiguration { + /// The architecture of the resource. + final String? architecture; + + /// The memory size of the resource. + final int? memorySizeInMB; + + /// The platform of the resource. The platform is the specific combination of + /// operating system, license model, and software on an instance. + final String? platform; + + /// The number of vCPU cores in the resource. + final double? vCpu; + + ComputeConfiguration({ + this.architecture, + this.memorySizeInMB, + this.platform, + this.vCpu, + }); + + factory ComputeConfiguration.fromJson(Map json) { + return ComputeConfiguration( + architecture: json['architecture'] as String?, + memorySizeInMB: json['memorySizeInMB'] as int?, + platform: json['platform'] as String?, + vCpu: json['vCpu'] as double?, + ); + } + + Map toJson() { + final architecture = this.architecture; + final memorySizeInMB = this.memorySizeInMB; + final platform = this.platform; + final vCpu = this.vCpu; + return { + if (architecture != null) 'architecture': architecture, + if (memorySizeInMB != null) 'memorySizeInMB': memorySizeInMB, + if (platform != null) 'platform': platform, + if (vCpu != null) 'vCpu': vCpu, + }; + } +} + +/// The Compute Savings Plans recommendation details. +class ComputeSavingsPlans { + /// Configuration details of the Compute Savings Plans to purchase. + final ComputeSavingsPlansConfiguration? configuration; + + /// Cost impact of the Savings Plans purchase recommendation. + final SavingsPlansCostCalculation? costCalculation; + + ComputeSavingsPlans({ + this.configuration, + this.costCalculation, + }); + + factory ComputeSavingsPlans.fromJson(Map json) { + return ComputeSavingsPlans( + configuration: json['configuration'] != null + ? ComputeSavingsPlansConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? SavingsPlansCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The Compute Savings Plans configuration used for recommendations. +class ComputeSavingsPlansConfiguration { + /// The account scope that you want your recommendations for. Amazon Web + /// Services calculates recommendations including the management account and + /// member accounts if the value is set to PAYER. If the value is + /// LINKED, recommendations are calculated for individual member + /// accounts only. + final String? accountScope; + + /// The hourly commitment for the Savings Plans type. + final String? hourlyCommitment; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Savings Plans recommendation term in years. + final String? term; + + ComputeSavingsPlansConfiguration({ + this.accountScope, + this.hourlyCommitment, + this.paymentOption, + this.term, + }); + + factory ComputeSavingsPlansConfiguration.fromJson(Map json) { + return ComputeSavingsPlansConfiguration( + accountScope: json['accountScope'] as String?, + hourlyCommitment: json['hourlyCommitment'] as String?, + paymentOption: json['paymentOption'] as String?, + term: json['term'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final hourlyCommitment = this.hourlyCommitment; + final paymentOption = this.paymentOption; + final term = this.term; + return { + if (accountScope != null) 'accountScope': accountScope, + if (hourlyCommitment != null) 'hourlyCommitment': hourlyCommitment, + if (paymentOption != null) 'paymentOption': paymentOption, + if (term != null) 'term': term, + }; + } +} + +/// Describes the Amazon Elastic Block Store volume configuration of the current +/// and recommended resource configuration for a recommendation. +class EbsVolume { + /// The Amazon Elastic Block Store volume configuration used for + /// recommendations. + final EbsVolumeConfiguration? configuration; + + /// Cost impact of the recommendation. + final ResourceCostCalculation? costCalculation; + + EbsVolume({ + this.configuration, + this.costCalculation, + }); + + factory EbsVolume.fromJson(Map json) { + return EbsVolume( + configuration: json['configuration'] != null + ? EbsVolumeConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ResourceCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The Amazon Elastic Block Store volume configuration used for +/// recommendations. +class EbsVolumeConfiguration { + /// The Amazon Elastic Block Store attachment state. + final String? attachmentState; + + /// The Amazon Elastic Block Store performance configuration. + final BlockStoragePerformanceConfiguration? performance; + + /// The disk storage of the Amazon Elastic Block Store volume. + final StorageConfiguration? storage; + + EbsVolumeConfiguration({ + this.attachmentState, + this.performance, + this.storage, + }); + + factory EbsVolumeConfiguration.fromJson(Map json) { + return EbsVolumeConfiguration( + attachmentState: json['attachmentState'] as String?, + performance: json['performance'] != null + ? BlockStoragePerformanceConfiguration.fromJson( + json['performance'] as Map) + : null, + storage: json['storage'] != null + ? StorageConfiguration.fromJson( + json['storage'] as Map) + : null, + ); + } + + Map toJson() { + final attachmentState = this.attachmentState; + final performance = this.performance; + final storage = this.storage; + return { + if (attachmentState != null) 'attachmentState': attachmentState, + if (performance != null) 'performance': performance, + if (storage != null) 'storage': storage, + }; + } +} + +/// The EC2 Auto Scaling group recommendation details. +class Ec2AutoScalingGroup { + /// The EC2 Auto Scaling group configuration used for recommendations. + final Ec2AutoScalingGroupConfiguration? configuration; + + /// Cost impact of the recommendation. + final ResourceCostCalculation? costCalculation; + + Ec2AutoScalingGroup({ + this.configuration, + this.costCalculation, + }); + + factory Ec2AutoScalingGroup.fromJson(Map json) { + return Ec2AutoScalingGroup( + configuration: json['configuration'] != null + ? Ec2AutoScalingGroupConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ResourceCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The EC2 auto scaling group configuration used for recommendations. +class Ec2AutoScalingGroupConfiguration { + /// Details about the instance. + final InstanceConfiguration? instance; + + Ec2AutoScalingGroupConfiguration({ + this.instance, + }); + + factory Ec2AutoScalingGroupConfiguration.fromJson(Map json) { + return Ec2AutoScalingGroupConfiguration( + instance: json['instance'] != null + ? InstanceConfiguration.fromJson( + json['instance'] as Map) + : null, + ); + } + + Map toJson() { + final instance = this.instance; + return { + if (instance != null) 'instance': instance, + }; + } +} + +/// Describes the EC2 instance configuration of the current and recommended +/// resource configuration for a recommendation. +class Ec2Instance { + /// The EC2 instance configuration used for recommendations. + final Ec2InstanceConfiguration? configuration; + + /// Cost impact of the recommendation. + final ResourceCostCalculation? costCalculation; + + Ec2Instance({ + this.configuration, + this.costCalculation, + }); + + factory Ec2Instance.fromJson(Map json) { + return Ec2Instance( + configuration: json['configuration'] != null + ? Ec2InstanceConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ResourceCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The EC2 instance configuration used for recommendations. +class Ec2InstanceConfiguration { + /// Details about the instance. + final InstanceConfiguration? instance; + + Ec2InstanceConfiguration({ + this.instance, + }); + + factory Ec2InstanceConfiguration.fromJson(Map json) { + return Ec2InstanceConfiguration( + instance: json['instance'] != null + ? InstanceConfiguration.fromJson( + json['instance'] as Map) + : null, + ); + } + + Map toJson() { + final instance = this.instance; + return { + if (instance != null) 'instance': instance, + }; + } +} + +/// The EC2 instance Savings Plans recommendation details. +class Ec2InstanceSavingsPlans { + /// The EC2 instance Savings Plans configuration used for recommendations. + final Ec2InstanceSavingsPlansConfiguration? configuration; + + /// Cost impact of the Savings Plans purchase recommendation. + final SavingsPlansCostCalculation? costCalculation; + + Ec2InstanceSavingsPlans({ + this.configuration, + this.costCalculation, + }); + + factory Ec2InstanceSavingsPlans.fromJson(Map json) { + return Ec2InstanceSavingsPlans( + configuration: json['configuration'] != null + ? Ec2InstanceSavingsPlansConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? SavingsPlansCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The EC2 instance Savings Plans configuration used for recommendations. +class Ec2InstanceSavingsPlansConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// The hourly commitment for the Savings Plans type. + final String? hourlyCommitment; + + /// The instance family of the recommended Savings Plan. + final String? instanceFamily; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Amazon Web Services Region of the commitment. + final String? savingsPlansRegion; + + /// The Savings Plans recommendation term in years. + final String? term; + + Ec2InstanceSavingsPlansConfiguration({ + this.accountScope, + this.hourlyCommitment, + this.instanceFamily, + this.paymentOption, + this.savingsPlansRegion, + this.term, + }); + + factory Ec2InstanceSavingsPlansConfiguration.fromJson( + Map json) { + return Ec2InstanceSavingsPlansConfiguration( + accountScope: json['accountScope'] as String?, + hourlyCommitment: json['hourlyCommitment'] as String?, + instanceFamily: json['instanceFamily'] as String?, + paymentOption: json['paymentOption'] as String?, + savingsPlansRegion: json['savingsPlansRegion'] as String?, + term: json['term'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final hourlyCommitment = this.hourlyCommitment; + final instanceFamily = this.instanceFamily; + final paymentOption = this.paymentOption; + final savingsPlansRegion = this.savingsPlansRegion; + final term = this.term; + return { + if (accountScope != null) 'accountScope': accountScope, + if (hourlyCommitment != null) 'hourlyCommitment': hourlyCommitment, + if (instanceFamily != null) 'instanceFamily': instanceFamily, + if (paymentOption != null) 'paymentOption': paymentOption, + if (savingsPlansRegion != null) 'savingsPlansRegion': savingsPlansRegion, + if (term != null) 'term': term, + }; + } +} + +/// The EC2 reserved instances recommendation details. +class Ec2ReservedInstances { + /// The EC2 reserved instances configuration used for recommendations. + final Ec2ReservedInstancesConfiguration? configuration; + + /// Cost impact of the purchase recommendation. + final ReservedInstancesCostCalculation? costCalculation; + + Ec2ReservedInstances({ + this.configuration, + this.costCalculation, + }); + + factory Ec2ReservedInstances.fromJson(Map json) { + return Ec2ReservedInstances( + configuration: json['configuration'] != null + ? Ec2ReservedInstancesConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ReservedInstancesCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The EC2 reserved instances configuration used for recommendations. +class Ec2ReservedInstancesConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// Determines whether the recommendation is for a current generation instance. + final String? currentGeneration; + + /// The instance family of the recommended reservation. + final String? instanceFamily; + + /// The type of instance that Amazon Web Services recommends. + final String? instanceType; + + /// How much purchasing reserved instances costs you on a monthly basis. + final String? monthlyRecurringCost; + + /// The number of normalized units that Amazon Web Services recommends that you + /// purchase. + final String? normalizedUnitsToPurchase; + + /// The number of instances that Amazon Web Services recommends that you + /// purchase. + final String? numberOfInstancesToPurchase; + + /// Indicates whether the recommendation is for standard or convertible + /// reservations. + final String? offeringClass; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The platform of the recommended reservation. The platform is the specific + /// combination of operating system, license model, and software on an instance. + final String? platform; + + /// The Amazon Web Services Region of the commitment. + final String? reservedInstancesRegion; + + /// The service that you want your recommendations for. + final String? service; + + /// Determines whether the recommendation is size flexible. + final bool? sizeFlexEligible; + + /// Determines whether the recommended reservation is dedicated or shared. + final String? tenancy; + + /// The reserved instances recommendation term in years. + final String? term; + + /// How much purchasing this instance costs you upfront. + final String? upfrontCost; + + Ec2ReservedInstancesConfiguration({ + this.accountScope, + this.currentGeneration, + this.instanceFamily, + this.instanceType, + this.monthlyRecurringCost, + this.normalizedUnitsToPurchase, + this.numberOfInstancesToPurchase, + this.offeringClass, + this.paymentOption, + this.platform, + this.reservedInstancesRegion, + this.service, + this.sizeFlexEligible, + this.tenancy, + this.term, + this.upfrontCost, + }); + + factory Ec2ReservedInstancesConfiguration.fromJson( + Map json) { + return Ec2ReservedInstancesConfiguration( + accountScope: json['accountScope'] as String?, + currentGeneration: json['currentGeneration'] as String?, + instanceFamily: json['instanceFamily'] as String?, + instanceType: json['instanceType'] as String?, + monthlyRecurringCost: json['monthlyRecurringCost'] as String?, + normalizedUnitsToPurchase: json['normalizedUnitsToPurchase'] as String?, + numberOfInstancesToPurchase: + json['numberOfInstancesToPurchase'] as String?, + offeringClass: json['offeringClass'] as String?, + paymentOption: json['paymentOption'] as String?, + platform: json['platform'] as String?, + reservedInstancesRegion: json['reservedInstancesRegion'] as String?, + service: json['service'] as String?, + sizeFlexEligible: json['sizeFlexEligible'] as bool?, + tenancy: json['tenancy'] as String?, + term: json['term'] as String?, + upfrontCost: json['upfrontCost'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final currentGeneration = this.currentGeneration; + final instanceFamily = this.instanceFamily; + final instanceType = this.instanceType; + final monthlyRecurringCost = this.monthlyRecurringCost; + final normalizedUnitsToPurchase = this.normalizedUnitsToPurchase; + final numberOfInstancesToPurchase = this.numberOfInstancesToPurchase; + final offeringClass = this.offeringClass; + final paymentOption = this.paymentOption; + final platform = this.platform; + final reservedInstancesRegion = this.reservedInstancesRegion; + final service = this.service; + final sizeFlexEligible = this.sizeFlexEligible; + final tenancy = this.tenancy; + final term = this.term; + final upfrontCost = this.upfrontCost; + return { + if (accountScope != null) 'accountScope': accountScope, + if (currentGeneration != null) 'currentGeneration': currentGeneration, + if (instanceFamily != null) 'instanceFamily': instanceFamily, + if (instanceType != null) 'instanceType': instanceType, + if (monthlyRecurringCost != null) + 'monthlyRecurringCost': monthlyRecurringCost, + if (normalizedUnitsToPurchase != null) + 'normalizedUnitsToPurchase': normalizedUnitsToPurchase, + if (numberOfInstancesToPurchase != null) + 'numberOfInstancesToPurchase': numberOfInstancesToPurchase, + if (offeringClass != null) 'offeringClass': offeringClass, + if (paymentOption != null) 'paymentOption': paymentOption, + if (platform != null) 'platform': platform, + if (reservedInstancesRegion != null) + 'reservedInstancesRegion': reservedInstancesRegion, + if (service != null) 'service': service, + if (sizeFlexEligible != null) 'sizeFlexEligible': sizeFlexEligible, + if (tenancy != null) 'tenancy': tenancy, + if (term != null) 'term': term, + if (upfrontCost != null) 'upfrontCost': upfrontCost, + }; + } +} + +/// The ECS service recommendation details. +class EcsService { + /// The ECS service configuration used for recommendations. + final EcsServiceConfiguration? configuration; + + /// Cost impact of the recommendation. + final ResourceCostCalculation? costCalculation; + + EcsService({ + this.configuration, + this.costCalculation, + }); + + factory EcsService.fromJson(Map json) { + return EcsService( + configuration: json['configuration'] != null + ? EcsServiceConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ResourceCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The ECS service configuration used for recommendations. +class EcsServiceConfiguration { + /// Details about the compute configuration. + final ComputeConfiguration? compute; + + EcsServiceConfiguration({ + this.compute, + }); + + factory EcsServiceConfiguration.fromJson(Map json) { + return EcsServiceConfiguration( + compute: json['compute'] != null + ? ComputeConfiguration.fromJson( + json['compute'] as Map) + : null, + ); + } + + Map toJson() { + final compute = this.compute; + return { + if (compute != null) 'compute': compute, + }; + } +} + +/// The ElastiCache reserved instances recommendation details. +class ElastiCacheReservedInstances { + /// The ElastiCache reserved instances configuration used for recommendations. + final ElastiCacheReservedInstancesConfiguration? configuration; + + /// Cost impact of the purchase recommendation. + final ReservedInstancesCostCalculation? costCalculation; + + ElastiCacheReservedInstances({ + this.configuration, + this.costCalculation, + }); + + factory ElastiCacheReservedInstances.fromJson(Map json) { + return ElastiCacheReservedInstances( + configuration: json['configuration'] != null + ? ElastiCacheReservedInstancesConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ReservedInstancesCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The ElastiCache reserved instances configuration used for recommendations. +class ElastiCacheReservedInstancesConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// Determines whether the recommendation is for a current generation instance. + final String? currentGeneration; + + /// The instance family of the recommended reservation. + final String? instanceFamily; + + /// The type of instance that Amazon Web Services recommends. + final String? instanceType; + + /// How much purchasing reserved instances costs you on a monthly basis. + final String? monthlyRecurringCost; + + /// The number of normalized units that Amazon Web Services recommends that you + /// purchase. + final String? normalizedUnitsToPurchase; + + /// The number of instances that Amazon Web Services recommends that you + /// purchase. + final String? numberOfInstancesToPurchase; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Amazon Web Services Region of the commitment. + final String? reservedInstancesRegion; + + /// The service that you want your recommendations for. + final String? service; + + /// Determines whether the recommendation is size flexible. + final bool? sizeFlexEligible; + + /// The reserved instances recommendation term in years. + final String? term; + + /// How much purchasing this instance costs you upfront. + final String? upfrontCost; + + ElastiCacheReservedInstancesConfiguration({ + this.accountScope, + this.currentGeneration, + this.instanceFamily, + this.instanceType, + this.monthlyRecurringCost, + this.normalizedUnitsToPurchase, + this.numberOfInstancesToPurchase, + this.paymentOption, + this.reservedInstancesRegion, + this.service, + this.sizeFlexEligible, + this.term, + this.upfrontCost, + }); + + factory ElastiCacheReservedInstancesConfiguration.fromJson( + Map json) { + return ElastiCacheReservedInstancesConfiguration( + accountScope: json['accountScope'] as String?, + currentGeneration: json['currentGeneration'] as String?, + instanceFamily: json['instanceFamily'] as String?, + instanceType: json['instanceType'] as String?, + monthlyRecurringCost: json['monthlyRecurringCost'] as String?, + normalizedUnitsToPurchase: json['normalizedUnitsToPurchase'] as String?, + numberOfInstancesToPurchase: + json['numberOfInstancesToPurchase'] as String?, + paymentOption: json['paymentOption'] as String?, + reservedInstancesRegion: json['reservedInstancesRegion'] as String?, + service: json['service'] as String?, + sizeFlexEligible: json['sizeFlexEligible'] as bool?, + term: json['term'] as String?, + upfrontCost: json['upfrontCost'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final currentGeneration = this.currentGeneration; + final instanceFamily = this.instanceFamily; + final instanceType = this.instanceType; + final monthlyRecurringCost = this.monthlyRecurringCost; + final normalizedUnitsToPurchase = this.normalizedUnitsToPurchase; + final numberOfInstancesToPurchase = this.numberOfInstancesToPurchase; + final paymentOption = this.paymentOption; + final reservedInstancesRegion = this.reservedInstancesRegion; + final service = this.service; + final sizeFlexEligible = this.sizeFlexEligible; + final term = this.term; + final upfrontCost = this.upfrontCost; + return { + if (accountScope != null) 'accountScope': accountScope, + if (currentGeneration != null) 'currentGeneration': currentGeneration, + if (instanceFamily != null) 'instanceFamily': instanceFamily, + if (instanceType != null) 'instanceType': instanceType, + if (monthlyRecurringCost != null) + 'monthlyRecurringCost': monthlyRecurringCost, + if (normalizedUnitsToPurchase != null) + 'normalizedUnitsToPurchase': normalizedUnitsToPurchase, + if (numberOfInstancesToPurchase != null) + 'numberOfInstancesToPurchase': numberOfInstancesToPurchase, + if (paymentOption != null) 'paymentOption': paymentOption, + if (reservedInstancesRegion != null) + 'reservedInstancesRegion': reservedInstancesRegion, + if (service != null) 'service': service, + if (sizeFlexEligible != null) 'sizeFlexEligible': sizeFlexEligible, + if (term != null) 'term': term, + if (upfrontCost != null) 'upfrontCost': upfrontCost, + }; + } +} + +enum EnrollmentStatus { + active, + inactive, +} + +extension EnrollmentStatusValueExtension on EnrollmentStatus { + String toValue() { + switch (this) { + case EnrollmentStatus.active: + return 'Active'; + case EnrollmentStatus.inactive: + return 'Inactive'; + } + } +} + +extension EnrollmentStatusFromString on String { + EnrollmentStatus toEnrollmentStatus() { + switch (this) { + case 'Active': + return EnrollmentStatus.active; + case 'Inactive': + return EnrollmentStatus.inactive; + } + throw Exception('$this is not known in enum EnrollmentStatus'); + } +} + +/// Estimated discount details of the current and recommended resource +/// configuration for a recommendation. +class EstimatedDiscounts { + /// Estimated other discounts include all discounts that are not itemized. + /// Itemized discounts include reservedInstanceDiscount and + /// savingsPlansDiscount. + final double? otherDiscount; + + /// Estimated reserved instance discounts. + final double? reservedInstancesDiscount; + + /// Estimated Savings Plans discounts. + final double? savingsPlansDiscount; + + EstimatedDiscounts({ + this.otherDiscount, + this.reservedInstancesDiscount, + this.savingsPlansDiscount, + }); + + factory EstimatedDiscounts.fromJson(Map json) { + return EstimatedDiscounts( + otherDiscount: json['otherDiscount'] as double?, + reservedInstancesDiscount: json['reservedInstancesDiscount'] as double?, + savingsPlansDiscount: json['savingsPlansDiscount'] as double?, + ); + } + + Map toJson() { + final otherDiscount = this.otherDiscount; + final reservedInstancesDiscount = this.reservedInstancesDiscount; + final savingsPlansDiscount = this.savingsPlansDiscount; + return { + if (otherDiscount != null) 'otherDiscount': otherDiscount, + if (reservedInstancesDiscount != null) + 'reservedInstancesDiscount': reservedInstancesDiscount, + if (savingsPlansDiscount != null) + 'savingsPlansDiscount': savingsPlansDiscount, + }; + } +} + +/// Describes a filter that returns a more specific list of recommendations. +/// Filters recommendations by different dimensions. +class Filter { + /// The account that the recommendation is for. + final List? accountIds; + + /// The type of action you can take by adopting the recommendation. + final List? actionTypes; + + /// The effort required to implement the recommendation. + final List? implementationEfforts; + + /// The IDs for the recommendations. + final List? recommendationIds; + + /// The Amazon Web Services Region of the resource. + final List? regions; + + /// The Amazon Resource Name (ARN) of the recommendation. + final List? resourceArns; + + /// The resource ID of the recommendation. + final List? resourceIds; + + /// The resource type of the recommendation. + final List? resourceTypes; + + /// Whether or not implementing the recommendation requires a restart. + final bool? restartNeeded; + + /// Whether or not implementing the recommendation can be rolled back. + final bool? rollbackPossible; + + /// A list of tags assigned to the recommendation. + final List? tags; + + Filter({ + this.accountIds, + this.actionTypes, + this.implementationEfforts, + this.recommendationIds, + this.regions, + this.resourceArns, + this.resourceIds, + this.resourceTypes, + this.restartNeeded, + this.rollbackPossible, + this.tags, + }); + + Map toJson() { + final accountIds = this.accountIds; + final actionTypes = this.actionTypes; + final implementationEfforts = this.implementationEfforts; + final recommendationIds = this.recommendationIds; + final regions = this.regions; + final resourceArns = this.resourceArns; + final resourceIds = this.resourceIds; + final resourceTypes = this.resourceTypes; + final restartNeeded = this.restartNeeded; + final rollbackPossible = this.rollbackPossible; + final tags = this.tags; + return { + if (accountIds != null) 'accountIds': accountIds, + if (actionTypes != null) + 'actionTypes': actionTypes.map((e) => e.toValue()).toList(), + if (implementationEfforts != null) + 'implementationEfforts': + implementationEfforts.map((e) => e.toValue()).toList(), + if (recommendationIds != null) 'recommendationIds': recommendationIds, + if (regions != null) 'regions': regions, + if (resourceArns != null) 'resourceArns': resourceArns, + if (resourceIds != null) 'resourceIds': resourceIds, + if (resourceTypes != null) + 'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(), + if (restartNeeded != null) 'restartNeeded': restartNeeded, + if (rollbackPossible != null) 'rollbackPossible': rollbackPossible, + if (tags != null) 'tags': tags, + }; + } +} + +class GetPreferencesResponse { + /// Retrieves the status of the "member account discount visibility" preference. + final MemberAccountDiscountVisibility? memberAccountDiscountVisibility; + + /// Retrieves the status of the "savings estimation mode" preference. + final SavingsEstimationMode? savingsEstimationMode; + + GetPreferencesResponse({ + this.memberAccountDiscountVisibility, + this.savingsEstimationMode, + }); + + factory GetPreferencesResponse.fromJson(Map json) { + return GetPreferencesResponse( + memberAccountDiscountVisibility: + (json['memberAccountDiscountVisibility'] as String?) + ?.toMemberAccountDiscountVisibility(), + savingsEstimationMode: + (json['savingsEstimationMode'] as String?)?.toSavingsEstimationMode(), + ); + } + + Map toJson() { + final memberAccountDiscountVisibility = + this.memberAccountDiscountVisibility; + final savingsEstimationMode = this.savingsEstimationMode; + return { + if (memberAccountDiscountVisibility != null) + 'memberAccountDiscountVisibility': + memberAccountDiscountVisibility.toValue(), + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode.toValue(), + }; + } +} + +class GetRecommendationResponse { + /// The account that the recommendation is for. + final String? accountId; + + /// The type of action you can take by adopting the recommendation. + final ActionType? actionType; + + /// The lookback period used to calculate cost impact for a recommendation. + final int? costCalculationLookbackPeriodInDays; + + /// The currency code used for the recommendation. + final String? currencyCode; + + /// The details for the resource. + final ResourceDetails? currentResourceDetails; + + /// The type of resource. + final ResourceType? currentResourceType; + + /// The estimated monthly cost of the recommendation. + final double? estimatedMonthlyCost; + + /// The estimated monthly savings amount for the recommendation. + final double? estimatedMonthlySavings; + + /// The estimated savings amount over the lookback period used to calculate cost + /// impact for a recommendation. + final double? estimatedSavingsOverCostCalculationLookbackPeriod; + + /// The estimated savings percentage relative to the total cost over the cost + /// calculation lookback period. + final double? estimatedSavingsPercentage; + + /// The effort required to implement the recommendation. + final ImplementationEffort? implementationEffort; + + /// The time when the recommendation was last generated. + final DateTime? lastRefreshTimestamp; + + /// The ID for the recommendation. + final String? recommendationId; + + /// The lookback period that's used to generate the recommendation. + final int? recommendationLookbackPeriodInDays; + + /// The details about the recommended resource. + final ResourceDetails? recommendedResourceDetails; + + /// The resource type of the recommendation. + final ResourceType? recommendedResourceType; + + /// The Amazon Web Services Region of the resource. + final String? region; + + /// The Amazon Resource Name (ARN) of the resource. + final String? resourceArn; + + /// The unique identifier for the resource. This is the same as the Amazon + /// Resource Name (ARN), if available. + final String? resourceId; + + /// Whether or not implementing the recommendation requires a restart. + final bool? restartNeeded; + + /// Whether or not implementing the recommendation can be rolled back. + final bool? rollbackPossible; + + /// The source of the recommendation. + final Source? source; + + /// A list of tags associated with the resource for which the recommendation + /// exists. + final List? tags; + + GetRecommendationResponse({ + this.accountId, + this.actionType, + this.costCalculationLookbackPeriodInDays, + this.currencyCode, + this.currentResourceDetails, + this.currentResourceType, + this.estimatedMonthlyCost, + this.estimatedMonthlySavings, + this.estimatedSavingsOverCostCalculationLookbackPeriod, + this.estimatedSavingsPercentage, + this.implementationEffort, + this.lastRefreshTimestamp, + this.recommendationId, + this.recommendationLookbackPeriodInDays, + this.recommendedResourceDetails, + this.recommendedResourceType, + this.region, + this.resourceArn, + this.resourceId, + this.restartNeeded, + this.rollbackPossible, + this.source, + this.tags, + }); + + factory GetRecommendationResponse.fromJson(Map json) { + return GetRecommendationResponse( + accountId: json['accountId'] as String?, + actionType: (json['actionType'] as String?)?.toActionType(), + costCalculationLookbackPeriodInDays: + json['costCalculationLookbackPeriodInDays'] as int?, + currencyCode: json['currencyCode'] as String?, + currentResourceDetails: json['currentResourceDetails'] != null + ? ResourceDetails.fromJson( + json['currentResourceDetails'] as Map) + : null, + currentResourceType: + (json['currentResourceType'] as String?)?.toResourceType(), + estimatedMonthlyCost: json['estimatedMonthlyCost'] as double?, + estimatedMonthlySavings: json['estimatedMonthlySavings'] as double?, + estimatedSavingsOverCostCalculationLookbackPeriod: + json['estimatedSavingsOverCostCalculationLookbackPeriod'] as double?, + estimatedSavingsPercentage: json['estimatedSavingsPercentage'] as double?, + implementationEffort: + (json['implementationEffort'] as String?)?.toImplementationEffort(), + lastRefreshTimestamp: timeStampFromJson(json['lastRefreshTimestamp']), + recommendationId: json['recommendationId'] as String?, + recommendationLookbackPeriodInDays: + json['recommendationLookbackPeriodInDays'] as int?, + recommendedResourceDetails: json['recommendedResourceDetails'] != null + ? ResourceDetails.fromJson( + json['recommendedResourceDetails'] as Map) + : null, + recommendedResourceType: + (json['recommendedResourceType'] as String?)?.toResourceType(), + region: json['region'] as String?, + resourceArn: json['resourceArn'] as String?, + resourceId: json['resourceId'] as String?, + restartNeeded: json['restartNeeded'] as bool?, + rollbackPossible: json['rollbackPossible'] as bool?, + source: (json['source'] as String?)?.toSource(), + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final actionType = this.actionType; + final costCalculationLookbackPeriodInDays = + this.costCalculationLookbackPeriodInDays; + final currencyCode = this.currencyCode; + final currentResourceDetails = this.currentResourceDetails; + final currentResourceType = this.currentResourceType; + final estimatedMonthlyCost = this.estimatedMonthlyCost; + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final estimatedSavingsOverCostCalculationLookbackPeriod = + this.estimatedSavingsOverCostCalculationLookbackPeriod; + final estimatedSavingsPercentage = this.estimatedSavingsPercentage; + final implementationEffort = this.implementationEffort; + final lastRefreshTimestamp = this.lastRefreshTimestamp; + final recommendationId = this.recommendationId; + final recommendationLookbackPeriodInDays = + this.recommendationLookbackPeriodInDays; + final recommendedResourceDetails = this.recommendedResourceDetails; + final recommendedResourceType = this.recommendedResourceType; + final region = this.region; + final resourceArn = this.resourceArn; + final resourceId = this.resourceId; + final restartNeeded = this.restartNeeded; + final rollbackPossible = this.rollbackPossible; + final source = this.source; + final tags = this.tags; + return { + if (accountId != null) 'accountId': accountId, + if (actionType != null) 'actionType': actionType.toValue(), + if (costCalculationLookbackPeriodInDays != null) + 'costCalculationLookbackPeriodInDays': + costCalculationLookbackPeriodInDays, + if (currencyCode != null) 'currencyCode': currencyCode, + if (currentResourceDetails != null) + 'currentResourceDetails': currentResourceDetails, + if (currentResourceType != null) + 'currentResourceType': currentResourceType.toValue(), + if (estimatedMonthlyCost != null) + 'estimatedMonthlyCost': estimatedMonthlyCost, + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (estimatedSavingsOverCostCalculationLookbackPeriod != null) + 'estimatedSavingsOverCostCalculationLookbackPeriod': + estimatedSavingsOverCostCalculationLookbackPeriod, + if (estimatedSavingsPercentage != null) + 'estimatedSavingsPercentage': estimatedSavingsPercentage, + if (implementationEffort != null) + 'implementationEffort': implementationEffort.toValue(), + if (lastRefreshTimestamp != null) + 'lastRefreshTimestamp': unixTimestampToJson(lastRefreshTimestamp), + if (recommendationId != null) 'recommendationId': recommendationId, + if (recommendationLookbackPeriodInDays != null) + 'recommendationLookbackPeriodInDays': + recommendationLookbackPeriodInDays, + if (recommendedResourceDetails != null) + 'recommendedResourceDetails': recommendedResourceDetails, + if (recommendedResourceType != null) + 'recommendedResourceType': recommendedResourceType.toValue(), + if (region != null) 'region': region, + if (resourceArn != null) 'resourceArn': resourceArn, + if (resourceId != null) 'resourceId': resourceId, + if (restartNeeded != null) 'restartNeeded': restartNeeded, + if (rollbackPossible != null) 'rollbackPossible': rollbackPossible, + if (source != null) 'source': source.toValue(), + if (tags != null) 'tags': tags, + }; + } +} + +enum ImplementationEffort { + veryLow, + low, + medium, + high, + veryHigh, +} + +extension ImplementationEffortValueExtension on ImplementationEffort { + String toValue() { + switch (this) { + case ImplementationEffort.veryLow: + return 'VeryLow'; + case ImplementationEffort.low: + return 'Low'; + case ImplementationEffort.medium: + return 'Medium'; + case ImplementationEffort.high: + return 'High'; + case ImplementationEffort.veryHigh: + return 'VeryHigh'; + } + } +} + +extension ImplementationEffortFromString on String { + ImplementationEffort toImplementationEffort() { + switch (this) { + case 'VeryLow': + return ImplementationEffort.veryLow; + case 'Low': + return ImplementationEffort.low; + case 'Medium': + return ImplementationEffort.medium; + case 'High': + return ImplementationEffort.high; + case 'VeryHigh': + return ImplementationEffort.veryHigh; + } + throw Exception('$this is not known in enum ImplementationEffort'); + } +} + +/// The Instance configuration used for recommendations. +class InstanceConfiguration { + /// Details about the type. + final String? type; + + InstanceConfiguration({ + this.type, + }); + + factory InstanceConfiguration.fromJson(Map json) { + return InstanceConfiguration( + type: json['type'] as String?, + ); + } + + Map toJson() { + final type = this.type; + return { + if (type != null) 'type': type, + }; + } +} + +/// The Lambda function recommendation details. +class LambdaFunction { + /// The Lambda function configuration used for recommendations. + final LambdaFunctionConfiguration? configuration; + + /// Cost impact of the recommendation. + final ResourceCostCalculation? costCalculation; + + LambdaFunction({ + this.configuration, + this.costCalculation, + }); + + factory LambdaFunction.fromJson(Map json) { + return LambdaFunction( + configuration: json['configuration'] != null + ? LambdaFunctionConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ResourceCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The Lambda function configuration used for recommendations. +class LambdaFunctionConfiguration { + /// Details about the compute configuration. + final ComputeConfiguration? compute; + + LambdaFunctionConfiguration({ + this.compute, + }); + + factory LambdaFunctionConfiguration.fromJson(Map json) { + return LambdaFunctionConfiguration( + compute: json['compute'] != null + ? ComputeConfiguration.fromJson( + json['compute'] as Map) + : null, + ); + } + + Map toJson() { + final compute = this.compute; + return { + if (compute != null) 'compute': compute, + }; + } +} + +class ListEnrollmentStatusesResponse { + /// The enrollment status of all member accounts in the organization if the + /// account is the management account. + final bool? includeMemberAccounts; + + /// The enrollment status of a specific account ID, including creation and last + /// updated timestamps. + final List? items; + + /// The token to retrieve the next set of results. + final String? nextToken; + + ListEnrollmentStatusesResponse({ + this.includeMemberAccounts, + this.items, + this.nextToken, + }); + + factory ListEnrollmentStatusesResponse.fromJson(Map json) { + return ListEnrollmentStatusesResponse( + includeMemberAccounts: json['includeMemberAccounts'] as bool?, + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => + AccountEnrollmentStatus.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final includeMemberAccounts = this.includeMemberAccounts; + final items = this.items; + final nextToken = this.nextToken; + return { + if (includeMemberAccounts != null) + 'includeMemberAccounts': includeMemberAccounts, + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListRecommendationSummariesResponse { + /// The currency code used for the recommendation. + final String? currencyCode; + + /// The total overall savings for the aggregated view. + final double? estimatedTotalDedupedSavings; + + /// The dimension used to group the recommendations by. + final String? groupBy; + + /// List of all savings recommendations. + final List? items; + + /// The token to retrieve the next set of results. + final String? nextToken; + + ListRecommendationSummariesResponse({ + this.currencyCode, + this.estimatedTotalDedupedSavings, + this.groupBy, + this.items, + this.nextToken, + }); + + factory ListRecommendationSummariesResponse.fromJson( + Map json) { + return ListRecommendationSummariesResponse( + currencyCode: json['currencyCode'] as String?, + estimatedTotalDedupedSavings: + json['estimatedTotalDedupedSavings'] as double?, + groupBy: json['groupBy'] as String?, + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => RecommendationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final currencyCode = this.currencyCode; + final estimatedTotalDedupedSavings = this.estimatedTotalDedupedSavings; + final groupBy = this.groupBy; + final items = this.items; + final nextToken = this.nextToken; + return { + if (currencyCode != null) 'currencyCode': currencyCode, + if (estimatedTotalDedupedSavings != null) + 'estimatedTotalDedupedSavings': estimatedTotalDedupedSavings, + if (groupBy != null) 'groupBy': groupBy, + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListRecommendationsResponse { + /// List of all savings recommendations. + final List? items; + + /// The token to retrieve the next set of results. + final String? nextToken; + + ListRecommendationsResponse({ + this.items, + this.nextToken, + }); + + factory ListRecommendationsResponse.fromJson(Map json) { + return ListRecommendationsResponse( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => Recommendation.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +enum MemberAccountDiscountVisibility { + all, + none, +} + +extension MemberAccountDiscountVisibilityValueExtension + on MemberAccountDiscountVisibility { + String toValue() { + switch (this) { + case MemberAccountDiscountVisibility.all: + return 'All'; + case MemberAccountDiscountVisibility.none: + return 'None'; + } + } +} + +extension MemberAccountDiscountVisibilityFromString on String { + MemberAccountDiscountVisibility toMemberAccountDiscountVisibility() { + switch (this) { + case 'All': + return MemberAccountDiscountVisibility.all; + case 'None': + return MemberAccountDiscountVisibility.none; + } + throw Exception( + '$this is not known in enum MemberAccountDiscountVisibility'); + } +} + +/// The OpenSearch reserved instances recommendation details. +class OpenSearchReservedInstances { + /// The OpenSearch reserved instances configuration used for recommendations. + final OpenSearchReservedInstancesConfiguration? configuration; + + /// Cost impact of the purchase recommendation. + final ReservedInstancesCostCalculation? costCalculation; + + OpenSearchReservedInstances({ + this.configuration, + this.costCalculation, + }); + + factory OpenSearchReservedInstances.fromJson(Map json) { + return OpenSearchReservedInstances( + configuration: json['configuration'] != null + ? OpenSearchReservedInstancesConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ReservedInstancesCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The OpenSearch reserved instances configuration used for recommendations. +class OpenSearchReservedInstancesConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// Determines whether the recommendation is for a current generation instance. + final String? currentGeneration; + + /// The type of instance that Amazon Web Services recommends. + final String? instanceType; + + /// How much purchasing reserved instances costs you on a monthly basis. + final String? monthlyRecurringCost; + + /// The number of normalized units that Amazon Web Services recommends that you + /// purchase. + final String? normalizedUnitsToPurchase; + + /// The number of instances that Amazon Web Services recommends that you + /// purchase. + final String? numberOfInstancesToPurchase; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Amazon Web Services Region of the commitment. + final String? reservedInstancesRegion; + + /// The service that you want your recommendations for. + final String? service; + + /// Determines whether the recommendation is size flexible. + final bool? sizeFlexEligible; + + /// The reserved instances recommendation term in years. + final String? term; + + /// How much purchasing this instance costs you upfront. + final String? upfrontCost; + + OpenSearchReservedInstancesConfiguration({ + this.accountScope, + this.currentGeneration, + this.instanceType, + this.monthlyRecurringCost, + this.normalizedUnitsToPurchase, + this.numberOfInstancesToPurchase, + this.paymentOption, + this.reservedInstancesRegion, + this.service, + this.sizeFlexEligible, + this.term, + this.upfrontCost, + }); + + factory OpenSearchReservedInstancesConfiguration.fromJson( + Map json) { + return OpenSearchReservedInstancesConfiguration( + accountScope: json['accountScope'] as String?, + currentGeneration: json['currentGeneration'] as String?, + instanceType: json['instanceType'] as String?, + monthlyRecurringCost: json['monthlyRecurringCost'] as String?, + normalizedUnitsToPurchase: json['normalizedUnitsToPurchase'] as String?, + numberOfInstancesToPurchase: + json['numberOfInstancesToPurchase'] as String?, + paymentOption: json['paymentOption'] as String?, + reservedInstancesRegion: json['reservedInstancesRegion'] as String?, + service: json['service'] as String?, + sizeFlexEligible: json['sizeFlexEligible'] as bool?, + term: json['term'] as String?, + upfrontCost: json['upfrontCost'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final currentGeneration = this.currentGeneration; + final instanceType = this.instanceType; + final monthlyRecurringCost = this.monthlyRecurringCost; + final normalizedUnitsToPurchase = this.normalizedUnitsToPurchase; + final numberOfInstancesToPurchase = this.numberOfInstancesToPurchase; + final paymentOption = this.paymentOption; + final reservedInstancesRegion = this.reservedInstancesRegion; + final service = this.service; + final sizeFlexEligible = this.sizeFlexEligible; + final term = this.term; + final upfrontCost = this.upfrontCost; + return { + if (accountScope != null) 'accountScope': accountScope, + if (currentGeneration != null) 'currentGeneration': currentGeneration, + if (instanceType != null) 'instanceType': instanceType, + if (monthlyRecurringCost != null) + 'monthlyRecurringCost': monthlyRecurringCost, + if (normalizedUnitsToPurchase != null) + 'normalizedUnitsToPurchase': normalizedUnitsToPurchase, + if (numberOfInstancesToPurchase != null) + 'numberOfInstancesToPurchase': numberOfInstancesToPurchase, + if (paymentOption != null) 'paymentOption': paymentOption, + if (reservedInstancesRegion != null) + 'reservedInstancesRegion': reservedInstancesRegion, + if (service != null) 'service': service, + if (sizeFlexEligible != null) 'sizeFlexEligible': sizeFlexEligible, + if (term != null) 'term': term, + if (upfrontCost != null) 'upfrontCost': upfrontCost, + }; + } +} + +enum Order { + asc, + desc, +} + +extension OrderValueExtension on Order { + String toValue() { + switch (this) { + case Order.asc: + return 'Asc'; + case Order.desc: + return 'Desc'; + } + } +} + +extension OrderFromString on String { + Order toOrder() { + switch (this) { + case 'Asc': + return Order.asc; + case 'Desc': + return Order.desc; + } + throw Exception('$this is not known in enum Order'); + } +} + +/// Defines how rows will be sorted in the response. +class OrderBy { + /// Sorts by dimension values. + final String? dimension; + + /// The order that's used to sort the data. + final Order? order; + + OrderBy({ + this.dimension, + this.order, + }); + + Map toJson() { + final dimension = this.dimension; + final order = this.order; + return { + if (dimension != null) 'dimension': dimension, + if (order != null) 'order': order.toValue(), + }; + } +} + +/// The RDS reserved instances recommendation details. +class RdsReservedInstances { + /// The RDS reserved instances configuration used for recommendations. + final RdsReservedInstancesConfiguration? configuration; + + /// Cost impact of the purchase recommendation. + final ReservedInstancesCostCalculation? costCalculation; + + RdsReservedInstances({ + this.configuration, + this.costCalculation, + }); + + factory RdsReservedInstances.fromJson(Map json) { + return RdsReservedInstances( + configuration: json['configuration'] != null + ? RdsReservedInstancesConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ReservedInstancesCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The RDS reserved instances configuration used for recommendations. +class RdsReservedInstancesConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// Determines whether the recommendation is for a current generation instance. + final String? currentGeneration; + + /// The database edition that the recommended reservation supports. + final String? databaseEdition; + + /// The database engine that the recommended reservation supports. + final String? databaseEngine; + + /// Determines whether the recommendation is for a reservation in a single + /// Availability Zone or a reservation with a backup in a second Availability + /// Zone. + final String? deploymentOption; + + /// The instance family of the recommended reservation. + final String? instanceFamily; + + /// The type of instance that Amazon Web Services recommends. + final String? instanceType; + + /// The license model that the recommended reservation supports. + final String? licenseModel; + + /// How much purchasing this instance costs you on a monthly basis. + final String? monthlyRecurringCost; + + /// The number of normalized units that Amazon Web Services recommends that you + /// purchase. + final String? normalizedUnitsToPurchase; + + /// The number of instances that Amazon Web Services recommends that you + /// purchase. + final String? numberOfInstancesToPurchase; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Amazon Web Services Region of the commitment. + final String? reservedInstancesRegion; + + /// The service that you want your recommendations for. + final String? service; + + /// Determines whether the recommendation is size flexible. + final bool? sizeFlexEligible; + + /// The reserved instances recommendation term in years. + final String? term; + + /// How much purchasing this instance costs you upfront. + final String? upfrontCost; + + RdsReservedInstancesConfiguration({ + this.accountScope, + this.currentGeneration, + this.databaseEdition, + this.databaseEngine, + this.deploymentOption, + this.instanceFamily, + this.instanceType, + this.licenseModel, + this.monthlyRecurringCost, + this.normalizedUnitsToPurchase, + this.numberOfInstancesToPurchase, + this.paymentOption, + this.reservedInstancesRegion, + this.service, + this.sizeFlexEligible, + this.term, + this.upfrontCost, + }); + + factory RdsReservedInstancesConfiguration.fromJson( + Map json) { + return RdsReservedInstancesConfiguration( + accountScope: json['accountScope'] as String?, + currentGeneration: json['currentGeneration'] as String?, + databaseEdition: json['databaseEdition'] as String?, + databaseEngine: json['databaseEngine'] as String?, + deploymentOption: json['deploymentOption'] as String?, + instanceFamily: json['instanceFamily'] as String?, + instanceType: json['instanceType'] as String?, + licenseModel: json['licenseModel'] as String?, + monthlyRecurringCost: json['monthlyRecurringCost'] as String?, + normalizedUnitsToPurchase: json['normalizedUnitsToPurchase'] as String?, + numberOfInstancesToPurchase: + json['numberOfInstancesToPurchase'] as String?, + paymentOption: json['paymentOption'] as String?, + reservedInstancesRegion: json['reservedInstancesRegion'] as String?, + service: json['service'] as String?, + sizeFlexEligible: json['sizeFlexEligible'] as bool?, + term: json['term'] as String?, + upfrontCost: json['upfrontCost'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final currentGeneration = this.currentGeneration; + final databaseEdition = this.databaseEdition; + final databaseEngine = this.databaseEngine; + final deploymentOption = this.deploymentOption; + final instanceFamily = this.instanceFamily; + final instanceType = this.instanceType; + final licenseModel = this.licenseModel; + final monthlyRecurringCost = this.monthlyRecurringCost; + final normalizedUnitsToPurchase = this.normalizedUnitsToPurchase; + final numberOfInstancesToPurchase = this.numberOfInstancesToPurchase; + final paymentOption = this.paymentOption; + final reservedInstancesRegion = this.reservedInstancesRegion; + final service = this.service; + final sizeFlexEligible = this.sizeFlexEligible; + final term = this.term; + final upfrontCost = this.upfrontCost; + return { + if (accountScope != null) 'accountScope': accountScope, + if (currentGeneration != null) 'currentGeneration': currentGeneration, + if (databaseEdition != null) 'databaseEdition': databaseEdition, + if (databaseEngine != null) 'databaseEngine': databaseEngine, + if (deploymentOption != null) 'deploymentOption': deploymentOption, + if (instanceFamily != null) 'instanceFamily': instanceFamily, + if (instanceType != null) 'instanceType': instanceType, + if (licenseModel != null) 'licenseModel': licenseModel, + if (monthlyRecurringCost != null) + 'monthlyRecurringCost': monthlyRecurringCost, + if (normalizedUnitsToPurchase != null) + 'normalizedUnitsToPurchase': normalizedUnitsToPurchase, + if (numberOfInstancesToPurchase != null) + 'numberOfInstancesToPurchase': numberOfInstancesToPurchase, + if (paymentOption != null) 'paymentOption': paymentOption, + if (reservedInstancesRegion != null) + 'reservedInstancesRegion': reservedInstancesRegion, + if (service != null) 'service': service, + if (sizeFlexEligible != null) 'sizeFlexEligible': sizeFlexEligible, + if (term != null) 'term': term, + if (upfrontCost != null) 'upfrontCost': upfrontCost, + }; + } +} + +/// Describes a recommendation. +class Recommendation { + /// The account that the recommendation is for. + final String? accountId; + + /// The type of tasks that can be carried out by this action. + final String? actionType; + + /// The currency code used for the recommendation. + final String? currencyCode; + + /// Describes the current resource. + final String? currentResourceSummary; + + /// The current resource type. + final String? currentResourceType; + + /// The estimated monthly cost for the recommendation. + final double? estimatedMonthlyCost; + + /// The estimated monthly savings amount for the recommendation. + final double? estimatedMonthlySavings; + + /// The estimated savings percentage relative to the total cost over the cost + /// calculation lookback period. + final double? estimatedSavingsPercentage; + + /// The effort required to implement the recommendation. + final String? implementationEffort; + + /// The time when the recommendation was last generated. + final DateTime? lastRefreshTimestamp; + + /// The ID for the recommendation. + final String? recommendationId; + + /// The lookback period that's used to generate the recommendation. + final int? recommendationLookbackPeriodInDays; + + /// Describes the recommended resource. + final String? recommendedResourceSummary; + + /// The recommended resource type. + final String? recommendedResourceType; + + /// The Amazon Web Services Region of the resource. + final String? region; + + /// The Amazon Resource Name (ARN) for the recommendation. + final String? resourceArn; + + /// The resource ID for the recommendation. + final String? resourceId; + + /// Whether or not implementing the recommendation requires a restart. + final bool? restartNeeded; + + /// Whether or not implementing the recommendation can be rolled back. + final bool? rollbackPossible; + + /// The source of the recommendation. + final Source? source; + + /// A list of tags assigned to the recommendation. + final List? tags; + + Recommendation({ + this.accountId, + this.actionType, + this.currencyCode, + this.currentResourceSummary, + this.currentResourceType, + this.estimatedMonthlyCost, + this.estimatedMonthlySavings, + this.estimatedSavingsPercentage, + this.implementationEffort, + this.lastRefreshTimestamp, + this.recommendationId, + this.recommendationLookbackPeriodInDays, + this.recommendedResourceSummary, + this.recommendedResourceType, + this.region, + this.resourceArn, + this.resourceId, + this.restartNeeded, + this.rollbackPossible, + this.source, + this.tags, + }); + + factory Recommendation.fromJson(Map json) { + return Recommendation( + accountId: json['accountId'] as String?, + actionType: json['actionType'] as String?, + currencyCode: json['currencyCode'] as String?, + currentResourceSummary: json['currentResourceSummary'] as String?, + currentResourceType: json['currentResourceType'] as String?, + estimatedMonthlyCost: json['estimatedMonthlyCost'] as double?, + estimatedMonthlySavings: json['estimatedMonthlySavings'] as double?, + estimatedSavingsPercentage: json['estimatedSavingsPercentage'] as double?, + implementationEffort: json['implementationEffort'] as String?, + lastRefreshTimestamp: timeStampFromJson(json['lastRefreshTimestamp']), + recommendationId: json['recommendationId'] as String?, + recommendationLookbackPeriodInDays: + json['recommendationLookbackPeriodInDays'] as int?, + recommendedResourceSummary: json['recommendedResourceSummary'] as String?, + recommendedResourceType: json['recommendedResourceType'] as String?, + region: json['region'] as String?, + resourceArn: json['resourceArn'] as String?, + resourceId: json['resourceId'] as String?, + restartNeeded: json['restartNeeded'] as bool?, + rollbackPossible: json['rollbackPossible'] as bool?, + source: (json['source'] as String?)?.toSource(), + tags: (json['tags'] as List?) + ?.whereNotNull() + .map((e) => Tag.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final accountId = this.accountId; + final actionType = this.actionType; + final currencyCode = this.currencyCode; + final currentResourceSummary = this.currentResourceSummary; + final currentResourceType = this.currentResourceType; + final estimatedMonthlyCost = this.estimatedMonthlyCost; + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final estimatedSavingsPercentage = this.estimatedSavingsPercentage; + final implementationEffort = this.implementationEffort; + final lastRefreshTimestamp = this.lastRefreshTimestamp; + final recommendationId = this.recommendationId; + final recommendationLookbackPeriodInDays = + this.recommendationLookbackPeriodInDays; + final recommendedResourceSummary = this.recommendedResourceSummary; + final recommendedResourceType = this.recommendedResourceType; + final region = this.region; + final resourceArn = this.resourceArn; + final resourceId = this.resourceId; + final restartNeeded = this.restartNeeded; + final rollbackPossible = this.rollbackPossible; + final source = this.source; + final tags = this.tags; + return { + if (accountId != null) 'accountId': accountId, + if (actionType != null) 'actionType': actionType, + if (currencyCode != null) 'currencyCode': currencyCode, + if (currentResourceSummary != null) + 'currentResourceSummary': currentResourceSummary, + if (currentResourceType != null) + 'currentResourceType': currentResourceType, + if (estimatedMonthlyCost != null) + 'estimatedMonthlyCost': estimatedMonthlyCost, + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (estimatedSavingsPercentage != null) + 'estimatedSavingsPercentage': estimatedSavingsPercentage, + if (implementationEffort != null) + 'implementationEffort': implementationEffort, + if (lastRefreshTimestamp != null) + 'lastRefreshTimestamp': unixTimestampToJson(lastRefreshTimestamp), + if (recommendationId != null) 'recommendationId': recommendationId, + if (recommendationLookbackPeriodInDays != null) + 'recommendationLookbackPeriodInDays': + recommendationLookbackPeriodInDays, + if (recommendedResourceSummary != null) + 'recommendedResourceSummary': recommendedResourceSummary, + if (recommendedResourceType != null) + 'recommendedResourceType': recommendedResourceType, + if (region != null) 'region': region, + if (resourceArn != null) 'resourceArn': resourceArn, + if (resourceId != null) 'resourceId': resourceId, + if (restartNeeded != null) 'restartNeeded': restartNeeded, + if (rollbackPossible != null) 'rollbackPossible': rollbackPossible, + if (source != null) 'source': source.toValue(), + if (tags != null) 'tags': tags, + }; + } +} + +/// The summary of rightsizing recommendations, including de-duped savings from +/// all types of recommendations. +class RecommendationSummary { + /// The estimated total savings resulting from modifications, on a monthly + /// basis. + final double? estimatedMonthlySavings; + + /// The grouping of recommendations. + final String? group; + + /// The total number of instance recommendations. + final int? recommendationCount; + + RecommendationSummary({ + this.estimatedMonthlySavings, + this.group, + this.recommendationCount, + }); + + factory RecommendationSummary.fromJson(Map json) { + return RecommendationSummary( + estimatedMonthlySavings: json['estimatedMonthlySavings'] as double?, + group: json['group'] as String?, + recommendationCount: json['recommendationCount'] as int?, + ); + } + + Map toJson() { + final estimatedMonthlySavings = this.estimatedMonthlySavings; + final group = this.group; + final recommendationCount = this.recommendationCount; + return { + if (estimatedMonthlySavings != null) + 'estimatedMonthlySavings': estimatedMonthlySavings, + if (group != null) 'group': group, + if (recommendationCount != null) + 'recommendationCount': recommendationCount, + }; + } +} + +/// The Redshift reserved instances recommendation details. +class RedshiftReservedInstances { + /// The Redshift reserved instances configuration used for recommendations. + final RedshiftReservedInstancesConfiguration? configuration; + + /// Cost impact of the purchase recommendation. + final ReservedInstancesCostCalculation? costCalculation; + + RedshiftReservedInstances({ + this.configuration, + this.costCalculation, + }); + + factory RedshiftReservedInstances.fromJson(Map json) { + return RedshiftReservedInstances( + configuration: json['configuration'] != null + ? RedshiftReservedInstancesConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? ReservedInstancesCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The Redshift reserved instances configuration used for recommendations. +class RedshiftReservedInstancesConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// Determines whether the recommendation is for a current generation instance. + final String? currentGeneration; + + /// The instance family of the recommended reservation. + final String? instanceFamily; + + /// The type of instance that Amazon Web Services recommends. + final String? instanceType; + + /// How much purchasing reserved instances costs you on a monthly basis. + final String? monthlyRecurringCost; + + /// The number of normalized units that Amazon Web Services recommends that you + /// purchase. + final String? normalizedUnitsToPurchase; + + /// The number of instances that Amazon Web Services recommends that you + /// purchase. + final String? numberOfInstancesToPurchase; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Amazon Web Services Region of the commitment. + final String? reservedInstancesRegion; + + /// The service that you want your recommendations for. + final String? service; + + /// Determines whether the recommendation is size flexible. + final bool? sizeFlexEligible; + + /// The reserved instances recommendation term in years. + final String? term; + + /// How much purchasing this instance costs you upfront. + final String? upfrontCost; + + RedshiftReservedInstancesConfiguration({ + this.accountScope, + this.currentGeneration, + this.instanceFamily, + this.instanceType, + this.monthlyRecurringCost, + this.normalizedUnitsToPurchase, + this.numberOfInstancesToPurchase, + this.paymentOption, + this.reservedInstancesRegion, + this.service, + this.sizeFlexEligible, + this.term, + this.upfrontCost, + }); + + factory RedshiftReservedInstancesConfiguration.fromJson( + Map json) { + return RedshiftReservedInstancesConfiguration( + accountScope: json['accountScope'] as String?, + currentGeneration: json['currentGeneration'] as String?, + instanceFamily: json['instanceFamily'] as String?, + instanceType: json['instanceType'] as String?, + monthlyRecurringCost: json['monthlyRecurringCost'] as String?, + normalizedUnitsToPurchase: json['normalizedUnitsToPurchase'] as String?, + numberOfInstancesToPurchase: + json['numberOfInstancesToPurchase'] as String?, + paymentOption: json['paymentOption'] as String?, + reservedInstancesRegion: json['reservedInstancesRegion'] as String?, + service: json['service'] as String?, + sizeFlexEligible: json['sizeFlexEligible'] as bool?, + term: json['term'] as String?, + upfrontCost: json['upfrontCost'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final currentGeneration = this.currentGeneration; + final instanceFamily = this.instanceFamily; + final instanceType = this.instanceType; + final monthlyRecurringCost = this.monthlyRecurringCost; + final normalizedUnitsToPurchase = this.normalizedUnitsToPurchase; + final numberOfInstancesToPurchase = this.numberOfInstancesToPurchase; + final paymentOption = this.paymentOption; + final reservedInstancesRegion = this.reservedInstancesRegion; + final service = this.service; + final sizeFlexEligible = this.sizeFlexEligible; + final term = this.term; + final upfrontCost = this.upfrontCost; + return { + if (accountScope != null) 'accountScope': accountScope, + if (currentGeneration != null) 'currentGeneration': currentGeneration, + if (instanceFamily != null) 'instanceFamily': instanceFamily, + if (instanceType != null) 'instanceType': instanceType, + if (monthlyRecurringCost != null) + 'monthlyRecurringCost': monthlyRecurringCost, + if (normalizedUnitsToPurchase != null) + 'normalizedUnitsToPurchase': normalizedUnitsToPurchase, + if (numberOfInstancesToPurchase != null) + 'numberOfInstancesToPurchase': numberOfInstancesToPurchase, + if (paymentOption != null) 'paymentOption': paymentOption, + if (reservedInstancesRegion != null) + 'reservedInstancesRegion': reservedInstancesRegion, + if (service != null) 'service': service, + if (sizeFlexEligible != null) 'sizeFlexEligible': sizeFlexEligible, + if (term != null) 'term': term, + if (upfrontCost != null) 'upfrontCost': upfrontCost, + }; + } +} + +/// Cost impact of the purchase recommendation. +class ReservedInstancesCostCalculation { + /// Pricing details of the purchase recommendation. + final ReservedInstancesPricing? pricing; + + ReservedInstancesCostCalculation({ + this.pricing, + }); + + factory ReservedInstancesCostCalculation.fromJson(Map json) { + return ReservedInstancesCostCalculation( + pricing: json['pricing'] != null + ? ReservedInstancesPricing.fromJson( + json['pricing'] as Map) + : null, + ); + } + + Map toJson() { + final pricing = this.pricing; + return { + if (pricing != null) 'pricing': pricing, + }; + } +} + +/// Pricing details for your recommended reserved instance. +class ReservedInstancesPricing { + /// The estimated cost of your recurring monthly fees for the recommended + /// reserved instance across the month. + final double? estimatedMonthlyAmortizedReservationCost; + + /// The remaining On-Demand cost estimated to not be covered by the recommended + /// reserved instance, over the length of the lookback period. + final double? estimatedOnDemandCost; + + /// The cost of paying for the recommended reserved instance monthly. + final double? monthlyReservationEligibleCost; + + /// The savings percentage relative to the total On-Demand costs that are + /// associated with this instance. + final double? savingsPercentage; + + ReservedInstancesPricing({ + this.estimatedMonthlyAmortizedReservationCost, + this.estimatedOnDemandCost, + this.monthlyReservationEligibleCost, + this.savingsPercentage, + }); + + factory ReservedInstancesPricing.fromJson(Map json) { + return ReservedInstancesPricing( + estimatedMonthlyAmortizedReservationCost: + json['estimatedMonthlyAmortizedReservationCost'] as double?, + estimatedOnDemandCost: json['estimatedOnDemandCost'] as double?, + monthlyReservationEligibleCost: + json['monthlyReservationEligibleCost'] as double?, + savingsPercentage: json['savingsPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlyAmortizedReservationCost = + this.estimatedMonthlyAmortizedReservationCost; + final estimatedOnDemandCost = this.estimatedOnDemandCost; + final monthlyReservationEligibleCost = this.monthlyReservationEligibleCost; + final savingsPercentage = this.savingsPercentage; + return { + if (estimatedMonthlyAmortizedReservationCost != null) + 'estimatedMonthlyAmortizedReservationCost': + estimatedMonthlyAmortizedReservationCost, + if (estimatedOnDemandCost != null) + 'estimatedOnDemandCost': estimatedOnDemandCost, + if (monthlyReservationEligibleCost != null) + 'monthlyReservationEligibleCost': monthlyReservationEligibleCost, + if (savingsPercentage != null) 'savingsPercentage': savingsPercentage, + }; + } +} + +/// Cost impact of the resource recommendation. +class ResourceCostCalculation { + /// Pricing details of the resource recommendation. + final ResourcePricing? pricing; + + /// Usage details of the resource recommendation. + final List? usages; + + ResourceCostCalculation({ + this.pricing, + this.usages, + }); + + factory ResourceCostCalculation.fromJson(Map json) { + return ResourceCostCalculation( + pricing: json['pricing'] != null + ? ResourcePricing.fromJson(json['pricing'] as Map) + : null, + usages: (json['usages'] as List?) + ?.whereNotNull() + .map((e) => Usage.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final pricing = this.pricing; + final usages = this.usages; + return { + if (pricing != null) 'pricing': pricing, + if (usages != null) 'usages': usages, + }; + } +} + +/// Contains detailed information about the specified resource. +class ResourceDetails { + /// The Compute Savings Plans recommendation details. + final ComputeSavingsPlans? computeSavingsPlans; + + /// The Amazon Elastic Block Store volume recommendation details. + final EbsVolume? ebsVolume; + + /// The EC2 Auto Scaling group recommendation details. + final Ec2AutoScalingGroup? ec2AutoScalingGroup; + + /// The EC2 instance recommendation details. + final Ec2Instance? ec2Instance; + + /// The EC2 instance Savings Plans recommendation details. + final Ec2InstanceSavingsPlans? ec2InstanceSavingsPlans; + + /// The EC2 reserved instances recommendation details. + final Ec2ReservedInstances? ec2ReservedInstances; + + /// The ECS service recommendation details. + final EcsService? ecsService; + + /// The ElastiCache reserved instances recommendation details. + final ElastiCacheReservedInstances? elastiCacheReservedInstances; + + /// The Lambda function recommendation details. + final LambdaFunction? lambdaFunction; + + /// The OpenSearch reserved instances recommendation details. + final OpenSearchReservedInstances? openSearchReservedInstances; + + /// The RDS reserved instances recommendation details. + final RdsReservedInstances? rdsReservedInstances; + + /// The Redshift reserved instances recommendation details. + final RedshiftReservedInstances? redshiftReservedInstances; + + /// The SageMaker Savings Plans recommendation details. + final SageMakerSavingsPlans? sageMakerSavingsPlans; + + ResourceDetails({ + this.computeSavingsPlans, + this.ebsVolume, + this.ec2AutoScalingGroup, + this.ec2Instance, + this.ec2InstanceSavingsPlans, + this.ec2ReservedInstances, + this.ecsService, + this.elastiCacheReservedInstances, + this.lambdaFunction, + this.openSearchReservedInstances, + this.rdsReservedInstances, + this.redshiftReservedInstances, + this.sageMakerSavingsPlans, + }); + + factory ResourceDetails.fromJson(Map json) { + return ResourceDetails( + computeSavingsPlans: json['computeSavingsPlans'] != null + ? ComputeSavingsPlans.fromJson( + json['computeSavingsPlans'] as Map) + : null, + ebsVolume: json['ebsVolume'] != null + ? EbsVolume.fromJson(json['ebsVolume'] as Map) + : null, + ec2AutoScalingGroup: json['ec2AutoScalingGroup'] != null + ? Ec2AutoScalingGroup.fromJson( + json['ec2AutoScalingGroup'] as Map) + : null, + ec2Instance: json['ec2Instance'] != null + ? Ec2Instance.fromJson(json['ec2Instance'] as Map) + : null, + ec2InstanceSavingsPlans: json['ec2InstanceSavingsPlans'] != null + ? Ec2InstanceSavingsPlans.fromJson( + json['ec2InstanceSavingsPlans'] as Map) + : null, + ec2ReservedInstances: json['ec2ReservedInstances'] != null + ? Ec2ReservedInstances.fromJson( + json['ec2ReservedInstances'] as Map) + : null, + ecsService: json['ecsService'] != null + ? EcsService.fromJson(json['ecsService'] as Map) + : null, + elastiCacheReservedInstances: json['elastiCacheReservedInstances'] != null + ? ElastiCacheReservedInstances.fromJson( + json['elastiCacheReservedInstances'] as Map) + : null, + lambdaFunction: json['lambdaFunction'] != null + ? LambdaFunction.fromJson( + json['lambdaFunction'] as Map) + : null, + openSearchReservedInstances: json['openSearchReservedInstances'] != null + ? OpenSearchReservedInstances.fromJson( + json['openSearchReservedInstances'] as Map) + : null, + rdsReservedInstances: json['rdsReservedInstances'] != null + ? RdsReservedInstances.fromJson( + json['rdsReservedInstances'] as Map) + : null, + redshiftReservedInstances: json['redshiftReservedInstances'] != null + ? RedshiftReservedInstances.fromJson( + json['redshiftReservedInstances'] as Map) + : null, + sageMakerSavingsPlans: json['sageMakerSavingsPlans'] != null + ? SageMakerSavingsPlans.fromJson( + json['sageMakerSavingsPlans'] as Map) + : null, + ); + } + + Map toJson() { + final computeSavingsPlans = this.computeSavingsPlans; + final ebsVolume = this.ebsVolume; + final ec2AutoScalingGroup = this.ec2AutoScalingGroup; + final ec2Instance = this.ec2Instance; + final ec2InstanceSavingsPlans = this.ec2InstanceSavingsPlans; + final ec2ReservedInstances = this.ec2ReservedInstances; + final ecsService = this.ecsService; + final elastiCacheReservedInstances = this.elastiCacheReservedInstances; + final lambdaFunction = this.lambdaFunction; + final openSearchReservedInstances = this.openSearchReservedInstances; + final rdsReservedInstances = this.rdsReservedInstances; + final redshiftReservedInstances = this.redshiftReservedInstances; + final sageMakerSavingsPlans = this.sageMakerSavingsPlans; + return { + if (computeSavingsPlans != null) + 'computeSavingsPlans': computeSavingsPlans, + if (ebsVolume != null) 'ebsVolume': ebsVolume, + if (ec2AutoScalingGroup != null) + 'ec2AutoScalingGroup': ec2AutoScalingGroup, + if (ec2Instance != null) 'ec2Instance': ec2Instance, + if (ec2InstanceSavingsPlans != null) + 'ec2InstanceSavingsPlans': ec2InstanceSavingsPlans, + if (ec2ReservedInstances != null) + 'ec2ReservedInstances': ec2ReservedInstances, + if (ecsService != null) 'ecsService': ecsService, + if (elastiCacheReservedInstances != null) + 'elastiCacheReservedInstances': elastiCacheReservedInstances, + if (lambdaFunction != null) 'lambdaFunction': lambdaFunction, + if (openSearchReservedInstances != null) + 'openSearchReservedInstances': openSearchReservedInstances, + if (rdsReservedInstances != null) + 'rdsReservedInstances': rdsReservedInstances, + if (redshiftReservedInstances != null) + 'redshiftReservedInstances': redshiftReservedInstances, + if (sageMakerSavingsPlans != null) + 'sageMakerSavingsPlans': sageMakerSavingsPlans, + }; + } +} + +/// Contains pricing information about the specified resource. +class ResourcePricing { + /// The savings estimate incorporating all discounts with Amazon Web Services, + /// such as Reserved Instances and Savings Plans. + final double? estimatedCostAfterDiscounts; + + /// The savings estimate using Amazon Web Services public pricing without + /// incorporating any discounts. + final double? estimatedCostBeforeDiscounts; + + /// The estimated discounts for a recommendation. + final EstimatedDiscounts? estimatedDiscounts; + + /// The estimated net unused amortized commitment for the recommendation. + final double? estimatedNetUnusedAmortizedCommitments; + + ResourcePricing({ + this.estimatedCostAfterDiscounts, + this.estimatedCostBeforeDiscounts, + this.estimatedDiscounts, + this.estimatedNetUnusedAmortizedCommitments, + }); + + factory ResourcePricing.fromJson(Map json) { + return ResourcePricing( + estimatedCostAfterDiscounts: + json['estimatedCostAfterDiscounts'] as double?, + estimatedCostBeforeDiscounts: + json['estimatedCostBeforeDiscounts'] as double?, + estimatedDiscounts: json['estimatedDiscounts'] != null + ? EstimatedDiscounts.fromJson( + json['estimatedDiscounts'] as Map) + : null, + estimatedNetUnusedAmortizedCommitments: + json['estimatedNetUnusedAmortizedCommitments'] as double?, + ); + } + + Map toJson() { + final estimatedCostAfterDiscounts = this.estimatedCostAfterDiscounts; + final estimatedCostBeforeDiscounts = this.estimatedCostBeforeDiscounts; + final estimatedDiscounts = this.estimatedDiscounts; + final estimatedNetUnusedAmortizedCommitments = + this.estimatedNetUnusedAmortizedCommitments; + return { + if (estimatedCostAfterDiscounts != null) + 'estimatedCostAfterDiscounts': estimatedCostAfterDiscounts, + if (estimatedCostBeforeDiscounts != null) + 'estimatedCostBeforeDiscounts': estimatedCostBeforeDiscounts, + if (estimatedDiscounts != null) 'estimatedDiscounts': estimatedDiscounts, + if (estimatedNetUnusedAmortizedCommitments != null) + 'estimatedNetUnusedAmortizedCommitments': + estimatedNetUnusedAmortizedCommitments, + }; + } +} + +enum ResourceType { + ec2Instance, + lambdaFunction, + ebsVolume, + ecsService, + ec2AutoScalingGroup, + ec2InstanceSavingsPlans, + computeSavingsPlans, + sageMakerSavingsPlans, + ec2ReservedInstances, + rdsReservedInstances, + openSearchReservedInstances, + redshiftReservedInstances, + elastiCacheReservedInstances, +} + +extension ResourceTypeValueExtension on ResourceType { + String toValue() { + switch (this) { + case ResourceType.ec2Instance: + return 'Ec2Instance'; + case ResourceType.lambdaFunction: + return 'LambdaFunction'; + case ResourceType.ebsVolume: + return 'EbsVolume'; + case ResourceType.ecsService: + return 'EcsService'; + case ResourceType.ec2AutoScalingGroup: + return 'Ec2AutoScalingGroup'; + case ResourceType.ec2InstanceSavingsPlans: + return 'Ec2InstanceSavingsPlans'; + case ResourceType.computeSavingsPlans: + return 'ComputeSavingsPlans'; + case ResourceType.sageMakerSavingsPlans: + return 'SageMakerSavingsPlans'; + case ResourceType.ec2ReservedInstances: + return 'Ec2ReservedInstances'; + case ResourceType.rdsReservedInstances: + return 'RdsReservedInstances'; + case ResourceType.openSearchReservedInstances: + return 'OpenSearchReservedInstances'; + case ResourceType.redshiftReservedInstances: + return 'RedshiftReservedInstances'; + case ResourceType.elastiCacheReservedInstances: + return 'ElastiCacheReservedInstances'; + } + } +} + +extension ResourceTypeFromString on String { + ResourceType toResourceType() { + switch (this) { + case 'Ec2Instance': + return ResourceType.ec2Instance; + case 'LambdaFunction': + return ResourceType.lambdaFunction; + case 'EbsVolume': + return ResourceType.ebsVolume; + case 'EcsService': + return ResourceType.ecsService; + case 'Ec2AutoScalingGroup': + return ResourceType.ec2AutoScalingGroup; + case 'Ec2InstanceSavingsPlans': + return ResourceType.ec2InstanceSavingsPlans; + case 'ComputeSavingsPlans': + return ResourceType.computeSavingsPlans; + case 'SageMakerSavingsPlans': + return ResourceType.sageMakerSavingsPlans; + case 'Ec2ReservedInstances': + return ResourceType.ec2ReservedInstances; + case 'RdsReservedInstances': + return ResourceType.rdsReservedInstances; + case 'OpenSearchReservedInstances': + return ResourceType.openSearchReservedInstances; + case 'RedshiftReservedInstances': + return ResourceType.redshiftReservedInstances; + case 'ElastiCacheReservedInstances': + return ResourceType.elastiCacheReservedInstances; + } + throw Exception('$this is not known in enum ResourceType'); + } +} + +/// The SageMaker Savings Plans recommendation details. +class SageMakerSavingsPlans { + /// The SageMaker Savings Plans configuration used for recommendations. + final SageMakerSavingsPlansConfiguration? configuration; + + /// Cost impact of the Savings Plans purchase recommendation. + final SavingsPlansCostCalculation? costCalculation; + + SageMakerSavingsPlans({ + this.configuration, + this.costCalculation, + }); + + factory SageMakerSavingsPlans.fromJson(Map json) { + return SageMakerSavingsPlans( + configuration: json['configuration'] != null + ? SageMakerSavingsPlansConfiguration.fromJson( + json['configuration'] as Map) + : null, + costCalculation: json['costCalculation'] != null + ? SavingsPlansCostCalculation.fromJson( + json['costCalculation'] as Map) + : null, + ); + } + + Map toJson() { + final configuration = this.configuration; + final costCalculation = this.costCalculation; + return { + if (configuration != null) 'configuration': configuration, + if (costCalculation != null) 'costCalculation': costCalculation, + }; + } +} + +/// The SageMaker Savings Plans configuration used for recommendations. +class SageMakerSavingsPlansConfiguration { + /// The account scope that you want your recommendations for. + final String? accountScope; + + /// The hourly commitment for the Savings Plans type. + final String? hourlyCommitment; + + /// The payment option for the commitment. + final String? paymentOption; + + /// The Savings Plans recommendation term in years. + final String? term; + + SageMakerSavingsPlansConfiguration({ + this.accountScope, + this.hourlyCommitment, + this.paymentOption, + this.term, + }); + + factory SageMakerSavingsPlansConfiguration.fromJson( + Map json) { + return SageMakerSavingsPlansConfiguration( + accountScope: json['accountScope'] as String?, + hourlyCommitment: json['hourlyCommitment'] as String?, + paymentOption: json['paymentOption'] as String?, + term: json['term'] as String?, + ); + } + + Map toJson() { + final accountScope = this.accountScope; + final hourlyCommitment = this.hourlyCommitment; + final paymentOption = this.paymentOption; + final term = this.term; + return { + if (accountScope != null) 'accountScope': accountScope, + if (hourlyCommitment != null) 'hourlyCommitment': hourlyCommitment, + if (paymentOption != null) 'paymentOption': paymentOption, + if (term != null) 'term': term, + }; + } +} + +enum SavingsEstimationMode { + beforeDiscounts, + afterDiscounts, +} + +extension SavingsEstimationModeValueExtension on SavingsEstimationMode { + String toValue() { + switch (this) { + case SavingsEstimationMode.beforeDiscounts: + return 'BeforeDiscounts'; + case SavingsEstimationMode.afterDiscounts: + return 'AfterDiscounts'; + } + } +} + +extension SavingsEstimationModeFromString on String { + SavingsEstimationMode toSavingsEstimationMode() { + switch (this) { + case 'BeforeDiscounts': + return SavingsEstimationMode.beforeDiscounts; + case 'AfterDiscounts': + return SavingsEstimationMode.afterDiscounts; + } + throw Exception('$this is not known in enum SavingsEstimationMode'); + } +} + +/// Cost impact of the purchase recommendation. +class SavingsPlansCostCalculation { + /// Pricing details of the purchase recommendation. + final SavingsPlansPricing? pricing; + + SavingsPlansCostCalculation({ + this.pricing, + }); + + factory SavingsPlansCostCalculation.fromJson(Map json) { + return SavingsPlansCostCalculation( + pricing: json['pricing'] != null + ? SavingsPlansPricing.fromJson( + json['pricing'] as Map) + : null, + ); + } + + Map toJson() { + final pricing = this.pricing; + return { + if (pricing != null) 'pricing': pricing, + }; + } +} + +/// Pricing information about a Savings Plan. +class SavingsPlansPricing { + /// Estimated monthly commitment for the Savings Plan. + final double? estimatedMonthlyCommitment; + + /// Estimated On-Demand cost you will pay after buying the Savings Plan. + final double? estimatedOnDemandCost; + + /// The cost of paying for the recommended Savings Plan monthly. + final double? monthlySavingsPlansEligibleCost; + + /// Estimated savings as a percentage of your overall costs after buying the + /// Savings Plan. + final double? savingsPercentage; + + SavingsPlansPricing({ + this.estimatedMonthlyCommitment, + this.estimatedOnDemandCost, + this.monthlySavingsPlansEligibleCost, + this.savingsPercentage, + }); + + factory SavingsPlansPricing.fromJson(Map json) { + return SavingsPlansPricing( + estimatedMonthlyCommitment: json['estimatedMonthlyCommitment'] as double?, + estimatedOnDemandCost: json['estimatedOnDemandCost'] as double?, + monthlySavingsPlansEligibleCost: + json['monthlySavingsPlansEligibleCost'] as double?, + savingsPercentage: json['savingsPercentage'] as double?, + ); + } + + Map toJson() { + final estimatedMonthlyCommitment = this.estimatedMonthlyCommitment; + final estimatedOnDemandCost = this.estimatedOnDemandCost; + final monthlySavingsPlansEligibleCost = + this.monthlySavingsPlansEligibleCost; + final savingsPercentage = this.savingsPercentage; + return { + if (estimatedMonthlyCommitment != null) + 'estimatedMonthlyCommitment': estimatedMonthlyCommitment, + if (estimatedOnDemandCost != null) + 'estimatedOnDemandCost': estimatedOnDemandCost, + if (monthlySavingsPlansEligibleCost != null) + 'monthlySavingsPlansEligibleCost': monthlySavingsPlansEligibleCost, + if (savingsPercentage != null) 'savingsPercentage': savingsPercentage, + }; + } +} + +enum Source { + computeOptimizer, + costExplorer, +} + +extension SourceValueExtension on Source { + String toValue() { + switch (this) { + case Source.computeOptimizer: + return 'ComputeOptimizer'; + case Source.costExplorer: + return 'CostExplorer'; + } + } +} + +extension SourceFromString on String { + Source toSource() { + switch (this) { + case 'ComputeOptimizer': + return Source.computeOptimizer; + case 'CostExplorer': + return Source.costExplorer; + } + throw Exception('$this is not known in enum Source'); + } +} + +/// The storage configuration used for recommendations. +class StorageConfiguration { + /// The storage volume. + final double? sizeInGb; + + /// The storage type. + final String? type; + + StorageConfiguration({ + this.sizeInGb, + this.type, + }); + + factory StorageConfiguration.fromJson(Map json) { + return StorageConfiguration( + sizeInGb: json['sizeInGb'] as double?, + type: json['type'] as String?, + ); + } + + Map toJson() { + final sizeInGb = this.sizeInGb; + final type = this.type; + return { + if (sizeInGb != null) 'sizeInGb': sizeInGb, + if (type != null) 'type': type, + }; + } +} + +/// The tag structure that contains a tag key and value. +class Tag { + /// The key that's associated with the tag. + final String? key; + + /// The value that's associated with the tag. + final String? value; + + Tag({ + this.key, + this.value, + }); + + factory Tag.fromJson(Map json) { + return Tag( + key: json['key'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + if (key != null) 'key': key, + if (value != null) 'value': value, + }; + } +} + +class UpdateEnrollmentStatusResponse { + /// The enrollment status of the account. + final String? status; + + UpdateEnrollmentStatusResponse({ + this.status, + }); + + factory UpdateEnrollmentStatusResponse.fromJson(Map json) { + return UpdateEnrollmentStatusResponse( + status: json['status'] as String?, + ); + } + + Map toJson() { + final status = this.status; + return { + if (status != null) 'status': status, + }; + } +} + +class UpdatePreferencesResponse { + /// Shows the status of the "member account discount visibility" preference. + final MemberAccountDiscountVisibility? memberAccountDiscountVisibility; + + /// Shows the status of the "savings estimation mode" preference. + final SavingsEstimationMode? savingsEstimationMode; + + UpdatePreferencesResponse({ + this.memberAccountDiscountVisibility, + this.savingsEstimationMode, + }); + + factory UpdatePreferencesResponse.fromJson(Map json) { + return UpdatePreferencesResponse( + memberAccountDiscountVisibility: + (json['memberAccountDiscountVisibility'] as String?) + ?.toMemberAccountDiscountVisibility(), + savingsEstimationMode: + (json['savingsEstimationMode'] as String?)?.toSavingsEstimationMode(), + ); + } + + Map toJson() { + final memberAccountDiscountVisibility = + this.memberAccountDiscountVisibility; + final savingsEstimationMode = this.savingsEstimationMode; + return { + if (memberAccountDiscountVisibility != null) + 'memberAccountDiscountVisibility': + memberAccountDiscountVisibility.toValue(), + if (savingsEstimationMode != null) + 'savingsEstimationMode': savingsEstimationMode.toValue(), + }; + } +} + +/// Details about the usage. +class Usage { + /// The operation value. + final String? operation; + + /// The product code. + final String? productCode; + + /// The usage unit. + final String? unit; + + /// The usage amount. + final double? usageAmount; + + /// The usage type. + final String? usageType; + + Usage({ + this.operation, + this.productCode, + this.unit, + this.usageAmount, + this.usageType, + }); + + factory Usage.fromJson(Map json) { + return Usage( + operation: json['operation'] as String?, + productCode: json['productCode'] as String?, + unit: json['unit'] as String?, + usageAmount: json['usageAmount'] as double?, + usageType: json['usageType'] as String?, + ); + } + + Map toJson() { + final operation = this.operation; + final productCode = this.productCode; + final unit = this.unit; + final usageAmount = this.usageAmount; + final usageType = this.usageType; + return { + if (operation != null) 'operation': operation, + if (productCode != null) 'productCode': productCode, + if (unit != null) 'unit': unit, + if (usageAmount != null) 'usageAmount': usageAmount, + if (usageType != null) 'usageType': usageType, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/customer_profiles/v2020_08_15.dart b/aws_client/lib/src/generated/customer_profiles/v2020_08_15.dart index 14a9fec74..6aeb81b0d 100644 --- a/aws_client/lib/src/generated/customer_profiles/v2020_08_15.dart +++ b/aws_client/lib/src/generated/customer_profiles/v2020_08_15.dart @@ -105,6 +105,75 @@ class CustomerProfiles { return AddProfileKeyResponse.fromJson(response); } + /// Creates a new calculated attribute definition. After creation, new object + /// data ingested into Customer Profiles will be included in the calculated + /// attribute, which can be retrieved for a profile using the GetCalculatedAttributeForProfile + /// API. Defining a calculated attribute makes it available for all profiles + /// within a domain. Each calculated attribute can only reference one + /// ObjectType and at most, two fields from that + /// ObjectType. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [attributeDetails] : + /// Mathematical expression and a list of attribute items specified in that + /// expression. + /// + /// Parameter [calculatedAttributeName] : + /// The unique name of the calculated attribute. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [statistic] : + /// The aggregation operation to perform for the calculated attribute. + /// + /// Parameter [conditions] : + /// The conditions including range, object count, and threshold for the + /// calculated attribute. + /// + /// Parameter [description] : + /// The description of the calculated attribute. + /// + /// Parameter [displayName] : + /// The display name of the calculated attribute. + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. + Future + createCalculatedAttributeDefinition({ + required AttributeDetails attributeDetails, + required String calculatedAttributeName, + required String domainName, + required Statistic statistic, + Conditions? conditions, + String? description, + String? displayName, + Map? tags, + }) async { + final $payload = { + 'AttributeDetails': attributeDetails, + 'Statistic': statistic.toValue(), + if (conditions != null) 'Conditions': conditions, + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}', + exceptionFnMap: _exceptionFns, + ); + return CreateCalculatedAttributeDefinitionResponse.fromJson(response); + } + /// Creates a domain, which is a container for all customer data, such as /// customer profile attributes, object types, profile keys, and encryption /// keys. You can create multiple domains, and each domain can have multiple @@ -159,6 +228,16 @@ class CustomerProfiles { /// ExportingConfig in the MatchingRequest, you can /// download the results from S3. /// + /// Parameter [ruleBasedMatching] : + /// The process of matching duplicate profiles using the Rule-Based matching. + /// If RuleBasedMatching = true, Amazon Connect Customer Profiles + /// will start to match and merge your profiles according to your + /// configuration in the RuleBasedMatchingRequest. You can use + /// the ListRuleBasedMatches and GetSimilarProfiles + /// API to return and review the results. Also, if you have configured + /// ExportingConfig in the RuleBasedMatchingRequest, + /// you can download the results from S3. + /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. Future createDomain({ @@ -167,6 +246,7 @@ class CustomerProfiles { String? deadLetterQueueUrl, String? defaultEncryptionKey, MatchingRequest? matching, + RuleBasedMatchingRequest? ruleBasedMatching, Map? tags, }) async { _s.validateNumRange( @@ -182,6 +262,7 @@ class CustomerProfiles { if (defaultEncryptionKey != null) 'DefaultEncryptionKey': defaultEncryptionKey, if (matching != null) 'Matching': matching, + if (ruleBasedMatching != null) 'RuleBasedMatching': ruleBasedMatching, if (tags != null) 'Tags': tags, }; final response = await _protocol.send( @@ -193,6 +274,52 @@ class CustomerProfiles { return CreateDomainResponse.fromJson(response); } + /// Creates an event stream, which is a subscription to real-time events, such + /// as when profiles are created and updated through Amazon Connect Customer + /// Profiles. + /// + /// Each event stream can be associated with only one Kinesis Data Stream + /// destination in the same region and Amazon Web Services account as the + /// customer profiles domain + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [eventStreamName] : + /// The name of the event stream. + /// + /// Parameter [uri] : + /// The StreamARN of the destination to deliver profile events to. For + /// example, arn:aws:kinesis:region:account-id:stream/stream-name + /// + /// Parameter [tags] : + /// The tags used to organize, track, or control access for this resource. + Future createEventStream({ + required String domainName, + required String eventStreamName, + required String uri, + Map? tags, + }) async { + final $payload = { + 'Uri': uri, + if (tags != null) 'Tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/event-streams/${Uri.encodeComponent(eventStreamName)}', + exceptionFnMap: _exceptionFns, + ); + return CreateEventStreamResponse.fromJson(response); + } + /// Creates an integration workflow. An integration workflow is an async /// process which ingests historic data and sets up an integration for ongoing /// updates. The supported Amazon AppFlow sources are Salesforce, ServiceNow, @@ -398,6 +525,35 @@ class CustomerProfiles { return CreateProfileResponse.fromJson(response); } + /// Deletes an existing calculated attribute definition. Note that deleting a + /// default calculated attribute is possible, however once deleted, you will + /// be unable to undo that action and will need to recreate it on your own + /// using the CreateCalculatedAttributeDefinition API if you want it back. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [calculatedAttributeName] : + /// The unique name of the calculated attribute. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + Future deleteCalculatedAttributeDefinition({ + required String calculatedAttributeName, + required String domainName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Deletes a specific domain and all of its customer data, such as customer /// profile attributes and their related objects. /// @@ -421,6 +577,32 @@ class CustomerProfiles { return DeleteDomainResponse.fromJson(response); } + /// Disables and deletes the specified event stream. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [eventStreamName] : + /// The name of the event stream + Future deleteEventStream({ + required String domainName, + required String eventStreamName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/event-streams/${Uri.encodeComponent(eventStreamName)}', + exceptionFnMap: _exceptionFns, + ); + } + /// Removes an integration from a specific domain. /// /// May throw [BadRequestException]. @@ -618,6 +800,37 @@ class CustomerProfiles { ); } + /// The process of detecting profile object type mapping by using given + /// objects. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [objects] : + /// A string that is serialized from a JSON object. + Future detectProfileObjectType({ + required String domainName, + required List objects, + }) async { + final $payload = { + 'Objects': objects, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/detect/object-types', + exceptionFnMap: _exceptionFns, + ); + return DetectProfileObjectTypeResponse.fromJson(response); + } + /// Tests the auto-merging settings of your Identity Resolution Job without /// merging your data. It randomly selects a sample of matching groups from /// the existing matching results, and applies the automerging settings that @@ -684,6 +897,67 @@ class CustomerProfiles { return GetAutoMergingPreviewResponse.fromJson(response); } + /// Provides more information on a calculated attribute definition for + /// Customer Profiles. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [calculatedAttributeName] : + /// The unique name of the calculated attribute. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + Future + getCalculatedAttributeDefinition({ + required String calculatedAttributeName, + required String domainName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}', + exceptionFnMap: _exceptionFns, + ); + return GetCalculatedAttributeDefinitionResponse.fromJson(response); + } + + /// Retrieve a calculated attribute for a customer profile. + /// + /// May throw [BadRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [calculatedAttributeName] : + /// The unique name of the calculated attribute. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [profileId] : + /// The unique identifier of a customer profile. + Future + getCalculatedAttributeForProfile({ + required String calculatedAttributeName, + required String domainName, + required String profileId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/profile/${Uri.encodeComponent(profileId)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}', + exceptionFnMap: _exceptionFns, + ); + return GetCalculatedAttributeForProfileResponse.fromJson(response); + } + /// Returns information about a specific domain. /// /// May throw [BadRequestException]. @@ -706,6 +980,33 @@ class CustomerProfiles { return GetDomainResponse.fromJson(response); } + /// Returns information about the specified event stream in a specific domain. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [eventStreamName] : + /// The name of the event stream provided during create operations. + Future getEventStream({ + required String domainName, + required String eventStreamName, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/event-streams/${Uri.encodeComponent(eventStreamName)}', + exceptionFnMap: _exceptionFns, + ); + return GetEventStreamResponse.fromJson(response); + } + /// Returns information about an Identity Resolution Job in a specific domain. /// /// Identity Resolution Jobs are set up using the Amazon Connect admin @@ -917,6 +1218,69 @@ class CustomerProfiles { return GetProfileObjectTypeTemplateResponse.fromJson(response); } + /// Returns a set of profiles that belong to the same matching group using the + /// matchId or profileId. You can also specify the + /// type of matching that you want for finding similar profiles using either + /// RULE_BASED_MATCHING or ML_BASED_MATCHING. + /// + /// May throw [BadRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [matchType] : + /// Specify the type of matching to get similar profiles for. + /// + /// Parameter [searchKey] : + /// The string indicating the search key to be used. + /// + /// Parameter [searchValue] : + /// The string based on SearchKey to be searched for similar + /// profiles. + /// + /// Parameter [maxResults] : + /// The maximum number of objects returned per page. + /// + /// Parameter [nextToken] : + /// The pagination token from the previous GetSimilarProfiles API + /// call. + Future getSimilarProfiles({ + required String domainName, + required MatchType matchType, + required String searchKey, + required String searchValue, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final $payload = { + 'MatchType': matchType.toValue(), + 'SearchKey': searchKey, + 'SearchValue': searchValue, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/domains/${Uri.encodeComponent(domainName)}/matches', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetSimilarProfilesResponse.fromJson(response); + } + /// Get details of specified workflow. /// /// May throw [BadRequestException]. @@ -1042,8 +1406,7 @@ class CustomerProfiles { return ListAccountIntegrationsResponse.fromJson(response); } - /// Returns a list of all the domains for an AWS account that have been - /// created. + /// Lists calculated attribute definitions for Customer Profiles /// /// May throw [BadRequestException]. /// May throw [ResourceNotFoundException]. @@ -1051,12 +1414,18 @@ class CustomerProfiles { /// May throw [ThrottlingException]. /// May throw [InternalServerException]. /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// /// Parameter [maxResults] : - /// The maximum number of objects returned per page. + /// The maximum number of calculated attribute definitions returned per page. /// /// Parameter [nextToken] : - /// The pagination token from the previous ListDomain API call. - Future listDomains({ + /// The pagination token from the previous call to + /// ListCalculatedAttributeDefinitions. + Future + listCalculatedAttributeDefinitions({ + required String domainName, int? maxResults, String? nextToken, }) async { @@ -1073,18 +1442,146 @@ class CustomerProfiles { final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/domains', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes', queryParams: $query, exceptionFnMap: _exceptionFns, ); - return ListDomainsResponse.fromJson(response); + return ListCalculatedAttributeDefinitionsResponse.fromJson(response); } - /// Lists all of the Identity Resolution Jobs in your domain. The response - /// sorts the list by JobStartTime. + /// Retrieve a list of calculated attributes for a customer profile. /// /// May throw [BadRequestException]. - /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [profileId] : + /// The unique identifier of a customer profile. + /// + /// Parameter [maxResults] : + /// The maximum number of calculated attributes returned per page. + /// + /// Parameter [nextToken] : + /// The pagination token from the previous call to + /// ListCalculatedAttributesForProfile. + Future + listCalculatedAttributesForProfile({ + required String domainName, + required String profileId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/profile/${Uri.encodeComponent(profileId)}/calculated-attributes', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListCalculatedAttributesForProfileResponse.fromJson(response); + } + + /// Returns a list of all the domains for an AWS account that have been + /// created. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [maxResults] : + /// The maximum number of objects returned per page. + /// + /// Parameter [nextToken] : + /// The pagination token from the previous ListDomain API call. + Future listDomains({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/domains', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDomainsResponse.fromJson(response); + } + + /// Returns a list of all the event streams in a specific domain. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [maxResults] : + /// The maximum number of objects returned per page. + /// + /// Parameter [nextToken] : + /// Identifies the next page of results to return. + Future listEventStreams({ + required String domainName, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/domains/${Uri.encodeComponent(domainName)}/event-streams', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEventStreamsResponse.fromJson(response); + } + + /// Lists all of the Identity Resolution Jobs in your domain. The response + /// sorts the list by JobStartTime. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. /// May throw [AccessDeniedException]. /// May throw [ThrottlingException]. /// May throw [InternalServerException]. @@ -1276,8 +1773,7 @@ class CustomerProfiles { /// /// Parameter [objectFilter] : /// Applies a filter to the response to include profile objects with the - /// specified index values. This filter is only supported for ObjectTypeName - /// _asset, _case and _order. + /// specified index values. Future listProfileObjects({ required String domainName, required String objectTypeName, @@ -1312,6 +1808,49 @@ class CustomerProfiles { return ListProfileObjectsResponse.fromJson(response); } + /// Returns a set of MatchIds that belong to the given domain. + /// + /// May throw [BadRequestException]. + /// May throw [AccessDeniedException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [maxResults] : + /// The maximum number of MatchIds returned per page. + /// + /// Parameter [nextToken] : + /// The pagination token from the previous ListRuleBasedMatches + /// API call. + Future listRuleBasedMatches({ + required String domainName, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'max-results': [maxResults.toString()], + if (nextToken != null) 'next-token': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/profiles/ruleBasedMatches', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListRuleBasedMatchesResponse.fromJson(response); + } + /// Displays the tags associated with an Amazon Connect Customer Profiles /// resource. In Connect Customer Profiles, domains, profile object types, and /// integrations can be tagged. @@ -1873,6 +2412,55 @@ class CustomerProfiles { ); } + /// Updates an existing calculated attribute definition. When updating the + /// Conditions, note that increasing the date range of a calculated attribute + /// will not trigger inclusion of historical data greater than the current + /// date range. + /// + /// May throw [BadRequestException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [InternalServerException]. + /// + /// Parameter [calculatedAttributeName] : + /// The unique name of the calculated attribute. + /// + /// Parameter [domainName] : + /// The unique name of the domain. + /// + /// Parameter [conditions] : + /// The conditions including range, object count, and threshold for the + /// calculated attribute. + /// + /// Parameter [description] : + /// The description of the calculated attribute. + /// + /// Parameter [displayName] : + /// The display name of the calculated attribute. + Future + updateCalculatedAttributeDefinition({ + required String calculatedAttributeName, + required String domainName, + Conditions? conditions, + String? description, + String? displayName, + }) async { + final $payload = { + if (conditions != null) 'Conditions': conditions, + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateCalculatedAttributeDefinitionResponse.fromJson(response); + } + /// Updates the properties of a domain, including creating or selecting a dead /// letter queue or an encryption key. /// @@ -1930,6 +2518,16 @@ class CustomerProfiles { /// ExportingConfig in the MatchingRequest, you can /// download the results from S3. /// + /// Parameter [ruleBasedMatching] : + /// The process of matching duplicate profiles using the rule-Based matching. + /// If RuleBasedMatching = true, Amazon Connect Customer Profiles + /// will start to match and merge your profiles according to your + /// configuration in the RuleBasedMatchingRequest. You can use + /// the ListRuleBasedMatches and GetSimilarProfiles + /// API to return and review the results. Also, if you have configured + /// ExportingConfig in the RuleBasedMatchingRequest, + /// you can download the results from S3. + /// /// Parameter [tags] : /// The tags used to organize, track, or control access for this resource. Future updateDomain({ @@ -1938,6 +2536,7 @@ class CustomerProfiles { String? defaultEncryptionKey, int? defaultExpirationDays, MatchingRequest? matching, + RuleBasedMatchingRequest? ruleBasedMatching, Map? tags, }) async { _s.validateNumRange( @@ -1953,6 +2552,7 @@ class CustomerProfiles { if (defaultExpirationDays != null) 'DefaultExpirationDays': defaultExpirationDays, if (matching != null) 'Matching': matching, + if (ruleBasedMatching != null) 'RuleBasedMatching': ruleBasedMatching, if (tags != null) 'Tags': tags, }; final response = await _protocol.send( @@ -2455,6 +3055,220 @@ class AppflowIntegrationWorkflowStep { } } +/// Mathematical expression and a list of attribute items specified in that +/// expression. +class AttributeDetails { + /// A list of attribute items specified in the mathematical expression. + final List attributes; + + /// Mathematical expression that is performed on attribute items provided in the + /// attribute list. Each element in the expression should follow the structure + /// of \"{ObjectTypeName.AttributeName}\". + final String expression; + + AttributeDetails({ + required this.attributes, + required this.expression, + }); + + factory AttributeDetails.fromJson(Map json) { + return AttributeDetails( + attributes: (json['Attributes'] as List) + .whereNotNull() + .map((e) => AttributeItem.fromJson(e as Map)) + .toList(), + expression: json['Expression'] as String, + ); + } + + Map toJson() { + final attributes = this.attributes; + final expression = this.expression; + return { + 'Attributes': attributes, + 'Expression': expression, + }; + } +} + +/// The details of a single attribute item specified in the mathematical +/// expression. +class AttributeItem { + /// The name of an attribute defined in a profile object type. + final String name; + + AttributeItem({ + required this.name, + }); + + factory AttributeItem.fromJson(Map json) { + return AttributeItem( + name: json['Name'] as String, + ); + } + + Map toJson() { + final name = this.name; + return { + 'Name': name, + }; + } +} + +enum AttributeMatchingModel { + oneToOne, + manyToMany, +} + +extension AttributeMatchingModelValueExtension on AttributeMatchingModel { + String toValue() { + switch (this) { + case AttributeMatchingModel.oneToOne: + return 'ONE_TO_ONE'; + case AttributeMatchingModel.manyToMany: + return 'MANY_TO_MANY'; + } + } +} + +extension AttributeMatchingModelFromString on String { + AttributeMatchingModel toAttributeMatchingModel() { + switch (this) { + case 'ONE_TO_ONE': + return AttributeMatchingModel.oneToOne; + case 'MANY_TO_MANY': + return AttributeMatchingModel.manyToMany; + } + throw Exception('$this is not known in enum AttributeMatchingModel'); + } +} + +/// Configuration information about the AttributeTypesSelector +/// where the rule-based identity resolution uses to match profiles. You +/// can choose how profiles are compared across attribute types and which +/// attribute to use for matching from each type. There are three attribute +/// types you can configure: +/// +///
          +///
        • +/// Email type +/// +///
            +///
          • +/// You can choose from Email, BusinessEmail, and +/// PersonalEmail +///
          • +///
        • +///
        • +/// Phone number type +/// +///
            +///
          • +/// You can choose from Phone, HomePhone, and +/// MobilePhone +///
          • +///
        • +///
        • +/// Address type +/// +///
            +///
          • +/// You can choose from Address, BusinessAddress, +/// MaillingAddress, and ShippingAddress +///
          • +///
        • +///
        +/// You can either choose ONE_TO_ONE or MANY_TO_MANY +/// as the AttributeMatchingModel. When choosing +/// MANY_TO_MANY, the system can match attribute across the +/// sub-types of an attribute type. For example, if the value of the +/// Email field of Profile A and the value of +/// BusinessEmail field of Profile B matches, the two profiles are +/// matched on the Email type. When choosing ONE_TO_ONE the system +/// can only match if the sub-types are exact matches. For example, only when +/// the value of the Email field of Profile A and the value of the +/// Email field of Profile B matches, the two profiles are matched +/// on the Email type. +class AttributeTypesSelector { + /// Configures the AttributeMatchingModel, you can either choose + /// ONE_TO_ONE or MANY_TO_MANY. + final AttributeMatchingModel attributeMatchingModel; + + /// The Address type. You can choose from Address, + /// BusinessAddress, MaillingAddress, and + /// ShippingAddress. + /// + /// You only can use the Address type in the MatchingRule. For + /// example, if you want to match profile based on + /// BusinessAddress.City or MaillingAddress.City, you + /// need to choose the BusinessAddress and the + /// MaillingAddress to represent the Address type and specify the + /// Address.City on the matching rule. + final List? address; + + /// The Email type. You can choose from EmailAddress, + /// BusinessEmailAddress and PersonalEmailAddress. + /// + /// You only can use the EmailAddress type in the + /// MatchingRule. For example, if you want to match profile based + /// on PersonalEmailAddress or BusinessEmailAddress, + /// you need to choose the PersonalEmailAddress and the + /// BusinessEmailAddress to represent the EmailAddress + /// type and only specify the EmailAddress on the matching rule. + final List? emailAddress; + + /// The PhoneNumber type. You can choose from + /// PhoneNumber, HomePhoneNumber, and + /// MobilePhoneNumber. + /// + /// You only can use the PhoneNumber type in the + /// MatchingRule. For example, if you want to match a profile based + /// on Phone or HomePhone, you need to choose the + /// Phone and the HomePhone to represent the + /// PhoneNumber type and only specify the PhoneNumber + /// on the matching rule. + final List? phoneNumber; + + AttributeTypesSelector({ + required this.attributeMatchingModel, + this.address, + this.emailAddress, + this.phoneNumber, + }); + + factory AttributeTypesSelector.fromJson(Map json) { + return AttributeTypesSelector( + attributeMatchingModel: + (json['AttributeMatchingModel'] as String).toAttributeMatchingModel(), + address: (json['Address'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + emailAddress: (json['EmailAddress'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + phoneNumber: (json['PhoneNumber'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final attributeMatchingModel = this.attributeMatchingModel; + final address = this.address; + final emailAddress = this.emailAddress; + final phoneNumber = this.phoneNumber; + return { + 'AttributeMatchingModel': attributeMatchingModel.toValue(), + if (address != null) 'Address': address, + if (emailAddress != null) 'EmailAddress': emailAddress, + if (phoneNumber != null) 'PhoneNumber': phoneNumber, + }; + } +} + /// Configuration settings for how to perform the auto-merging of profiles. class AutoMerging { /// The flag that enables the auto-merging of duplicate profiles. @@ -2542,17 +3356,59 @@ class Batch { } } -/// How the auto-merging process should resolve conflicts between different -/// profiles. -class ConflictResolution { - /// How the auto-merging process should resolve conflicts between different - /// profiles. - /// - ///
          - ///
        • - /// RECENCY: Uses the data that was most recently updated. - ///
        • - ///
        • +/// The conditions including range, object count, and threshold for the +/// calculated attribute. +class Conditions { + /// The number of profile objects used for the calculated attribute. + final int? objectCount; + + /// The relative time period over which data is included in the aggregation. + final Range? range; + + /// The threshold for the calculated attribute. + final Threshold? threshold; + + Conditions({ + this.objectCount, + this.range, + this.threshold, + }); + + factory Conditions.fromJson(Map json) { + return Conditions( + objectCount: json['ObjectCount'] as int?, + range: json['Range'] != null + ? Range.fromJson(json['Range'] as Map) + : null, + threshold: json['Threshold'] != null + ? Threshold.fromJson(json['Threshold'] as Map) + : null, + ); + } + + Map toJson() { + final objectCount = this.objectCount; + final range = this.range; + final threshold = this.threshold; + return { + if (objectCount != null) 'ObjectCount': objectCount, + if (range != null) 'Range': range, + if (threshold != null) 'Threshold': threshold, + }; + } +} + +/// How the auto-merging process should resolve conflicts between different +/// profiles. +class ConflictResolution { + /// How the auto-merging process should resolve conflicts between different + /// profiles. + /// + ///
            + ///
          • + /// RECENCY: Uses the data that was most recently updated. + ///
          • + ///
          • /// SOURCE: Uses the data from a specific source. For example, if a /// company has been aquired or two departments have merged, data from the /// specified source is used. If two duplicate profiles are from the same @@ -2685,6 +3541,96 @@ class Consolidation { } } +class CreateCalculatedAttributeDefinitionResponse { + /// Mathematical expression and a list of attribute items specified in that + /// expression. + final AttributeDetails? attributeDetails; + + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The conditions including range, object count, and threshold for the + /// calculated attribute. + final Conditions? conditions; + + /// The timestamp of when the calculated attribute definition was created. + final DateTime? createdAt; + + /// The description of the calculated attribute. + final String? description; + + /// The display name of the calculated attribute. + final String? displayName; + + /// The timestamp of when the calculated attribute definition was most recently + /// edited. + final DateTime? lastUpdatedAt; + + /// The aggregation operation to perform for the calculated attribute. + final Statistic? statistic; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + CreateCalculatedAttributeDefinitionResponse({ + this.attributeDetails, + this.calculatedAttributeName, + this.conditions, + this.createdAt, + this.description, + this.displayName, + this.lastUpdatedAt, + this.statistic, + this.tags, + }); + + factory CreateCalculatedAttributeDefinitionResponse.fromJson( + Map json) { + return CreateCalculatedAttributeDefinitionResponse( + attributeDetails: json['AttributeDetails'] != null + ? AttributeDetails.fromJson( + json['AttributeDetails'] as Map) + : null, + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + conditions: json['Conditions'] != null + ? Conditions.fromJson(json['Conditions'] as Map) + : null, + createdAt: timeStampFromJson(json['CreatedAt']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + statistic: (json['Statistic'] as String?)?.toStatistic(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final attributeDetails = this.attributeDetails; + final calculatedAttributeName = this.calculatedAttributeName; + final conditions = this.conditions; + final createdAt = this.createdAt; + final description = this.description; + final displayName = this.displayName; + final lastUpdatedAt = this.lastUpdatedAt; + final statistic = this.statistic; + final tags = this.tags; + return { + if (attributeDetails != null) 'AttributeDetails': attributeDetails, + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (conditions != null) 'Conditions': conditions, + if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (lastUpdatedAt != null) + 'LastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (statistic != null) 'Statistic': statistic.toValue(), + if (tags != null) 'Tags': tags, + }; + } +} + class CreateDomainResponse { /// The timestamp of when the domain was created. final DateTime createdAt; @@ -2720,6 +3666,16 @@ class CreateDomainResponse { /// download the results from S3. final MatchingResponse? matching; + /// The process of matching duplicate profiles using the Rule-Based matching. If + /// RuleBasedMatching = true, Amazon Connect Customer Profiles will + /// start to match and merge your profiles according to your configuration in + /// the RuleBasedMatchingRequest. You can use the + /// ListRuleBasedMatches and GetSimilarProfiles API to + /// return and review the results. Also, if you have configured + /// ExportingConfig in the RuleBasedMatchingRequest, + /// you can download the results from S3. + final RuleBasedMatchingResponse? ruleBasedMatching; + /// The tags used to organize, track, or control access for this resource. final Map? tags; @@ -2731,6 +3687,7 @@ class CreateDomainResponse { this.deadLetterQueueUrl, this.defaultEncryptionKey, this.matching, + this.ruleBasedMatching, this.tags, }); @@ -2746,6 +3703,10 @@ class CreateDomainResponse { matching: json['Matching'] != null ? MatchingResponse.fromJson(json['Matching'] as Map) : null, + ruleBasedMatching: json['RuleBasedMatching'] != null + ? RuleBasedMatchingResponse.fromJson( + json['RuleBasedMatching'] as Map) + : null, tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -2759,6 +3720,7 @@ class CreateDomainResponse { final deadLetterQueueUrl = this.deadLetterQueueUrl; final defaultEncryptionKey = this.defaultEncryptionKey; final matching = this.matching; + final ruleBasedMatching = this.ruleBasedMatching; final tags = this.tags; return { 'CreatedAt': unixTimestampToJson(createdAt), @@ -2769,6 +3731,37 @@ class CreateDomainResponse { if (defaultEncryptionKey != null) 'DefaultEncryptionKey': defaultEncryptionKey, if (matching != null) 'Matching': matching, + if (ruleBasedMatching != null) 'RuleBasedMatching': ruleBasedMatching, + if (tags != null) 'Tags': tags, + }; + } +} + +class CreateEventStreamResponse { + /// A unique identifier for the event stream. + final String eventStreamArn; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + CreateEventStreamResponse({ + required this.eventStreamArn, + this.tags, + }); + + factory CreateEventStreamResponse.fromJson(Map json) { + return CreateEventStreamResponse( + eventStreamArn: json['EventStreamArn'] as String, + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final eventStreamArn = this.eventStreamArn; + final tags = this.tags; + return { + 'EventStreamArn': eventStreamArn, if (tags != null) 'Tags': tags, }; } @@ -2854,6 +3847,19 @@ extension DataPullModeFromString on String { } } +class DeleteCalculatedAttributeDefinitionResponse { + DeleteCalculatedAttributeDefinitionResponse(); + + factory DeleteCalculatedAttributeDefinitionResponse.fromJson( + Map _) { + return DeleteCalculatedAttributeDefinitionResponse(); + } + + Map toJson() { + return {}; + } +} + class DeleteDomainResponse { /// A message that indicates the delete request is done. final String message; @@ -2876,6 +3882,18 @@ class DeleteDomainResponse { } } +class DeleteEventStreamResponse { + DeleteEventStreamResponse(); + + factory DeleteEventStreamResponse.fromJson(Map _) { + return DeleteEventStreamResponse(); + } + + Map toJson() { + return {}; + } +} + class DeleteIntegrationResponse { /// A message that indicates the delete request is done. final String message; @@ -2998,6 +4016,120 @@ class DeleteWorkflowResponse { } } +/// Summary information about the Kinesis data stream +class DestinationSummary { + /// The status of enabling the Kinesis stream as a destination for export. + final EventStreamDestinationStatus status; + + /// The StreamARN of the destination to deliver profile events to. For example, + /// arn:aws:kinesis:region:account-id:stream/stream-name. + final String uri; + + /// The timestamp when the status last changed to UNHEALHY. + final DateTime? unhealthySince; + + DestinationSummary({ + required this.status, + required this.uri, + this.unhealthySince, + }); + + factory DestinationSummary.fromJson(Map json) { + return DestinationSummary( + status: (json['Status'] as String).toEventStreamDestinationStatus(), + uri: json['Uri'] as String, + unhealthySince: timeStampFromJson(json['UnhealthySince']), + ); + } + + Map toJson() { + final status = this.status; + final uri = this.uri; + final unhealthySince = this.unhealthySince; + return { + 'Status': status.toValue(), + 'Uri': uri, + if (unhealthySince != null) + 'UnhealthySince': unixTimestampToJson(unhealthySince), + }; + } +} + +class DetectProfileObjectTypeResponse { + /// Detected ProfileObjectType mappings from given objects. A + /// maximum of one mapping is supported. + final List? detectedProfileObjectTypes; + + DetectProfileObjectTypeResponse({ + this.detectedProfileObjectTypes, + }); + + factory DetectProfileObjectTypeResponse.fromJson(Map json) { + return DetectProfileObjectTypeResponse( + detectedProfileObjectTypes: (json['DetectedProfileObjectTypes'] as List?) + ?.whereNotNull() + .map((e) => + DetectedProfileObjectType.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final detectedProfileObjectTypes = this.detectedProfileObjectTypes; + return { + if (detectedProfileObjectTypes != null) + 'DetectedProfileObjectTypes': detectedProfileObjectTypes, + }; + } +} + +/// Contains ProfileObjectType mapping information from the model. +class DetectedProfileObjectType { + /// A map of the name and the ObjectType field. + final Map? fields; + + /// A list of unique keys that can be used to map data to a profile. + final Map>? keys; + + /// The format of sourceLastUpdatedTimestamp that was detected in + /// fields. + final String? sourceLastUpdatedTimestampFormat; + + DetectedProfileObjectType({ + this.fields, + this.keys, + this.sourceLastUpdatedTimestampFormat, + }); + + factory DetectedProfileObjectType.fromJson(Map json) { + return DetectedProfileObjectType( + fields: (json['Fields'] as Map?)?.map((k, e) => + MapEntry(k, ObjectTypeField.fromJson(e as Map))), + keys: (json['Keys'] as Map?)?.map((k, e) => MapEntry( + k, + (e as List) + .whereNotNull() + .map((e) => ObjectTypeKey.fromJson(e as Map)) + .toList())), + sourceLastUpdatedTimestampFormat: + json['SourceLastUpdatedTimestampFormat'] as String?, + ); + } + + Map toJson() { + final fields = this.fields; + final keys = this.keys; + final sourceLastUpdatedTimestampFormat = + this.sourceLastUpdatedTimestampFormat; + return { + if (fields != null) 'Fields': fields, + if (keys != null) 'Keys': keys, + if (sourceLastUpdatedTimestampFormat != null) + 'SourceLastUpdatedTimestampFormat': sourceLastUpdatedTimestampFormat, + }; + } +} + /// Usage-specific statistics about the domain. class DomainStats { /// The number of profiles that you are currently paying for in the domain. If @@ -3046,6 +4178,180 @@ class DomainStats { } } +/// Details of the destination being used for the EventStream. +class EventStreamDestinationDetails { + /// The status of enabling the Kinesis stream as a destination for export. + final EventStreamDestinationStatus status; + + /// The StreamARN of the destination to deliver profile events to. For example, + /// arn:aws:kinesis:region:account-id:stream/stream-name. + final String uri; + + /// The human-readable string that corresponds to the error or success while + /// enabling the streaming destination. + final String? message; + + /// The timestamp when the status last changed to UNHEALHY. + final DateTime? unhealthySince; + + EventStreamDestinationDetails({ + required this.status, + required this.uri, + this.message, + this.unhealthySince, + }); + + factory EventStreamDestinationDetails.fromJson(Map json) { + return EventStreamDestinationDetails( + status: (json['Status'] as String).toEventStreamDestinationStatus(), + uri: json['Uri'] as String, + message: json['Message'] as String?, + unhealthySince: timeStampFromJson(json['UnhealthySince']), + ); + } + + Map toJson() { + final status = this.status; + final uri = this.uri; + final message = this.message; + final unhealthySince = this.unhealthySince; + return { + 'Status': status.toValue(), + 'Uri': uri, + if (message != null) 'Message': message, + if (unhealthySince != null) + 'UnhealthySince': unixTimestampToJson(unhealthySince), + }; + } +} + +enum EventStreamDestinationStatus { + healthy, + unhealthy, +} + +extension EventStreamDestinationStatusValueExtension + on EventStreamDestinationStatus { + String toValue() { + switch (this) { + case EventStreamDestinationStatus.healthy: + return 'HEALTHY'; + case EventStreamDestinationStatus.unhealthy: + return 'UNHEALTHY'; + } + } +} + +extension EventStreamDestinationStatusFromString on String { + EventStreamDestinationStatus toEventStreamDestinationStatus() { + switch (this) { + case 'HEALTHY': + return EventStreamDestinationStatus.healthy; + case 'UNHEALTHY': + return EventStreamDestinationStatus.unhealthy; + } + throw Exception('$this is not known in enum EventStreamDestinationStatus'); + } +} + +enum EventStreamState { + running, + stopped, +} + +extension EventStreamStateValueExtension on EventStreamState { + String toValue() { + switch (this) { + case EventStreamState.running: + return 'RUNNING'; + case EventStreamState.stopped: + return 'STOPPED'; + } + } +} + +extension EventStreamStateFromString on String { + EventStreamState toEventStreamState() { + switch (this) { + case 'RUNNING': + return EventStreamState.running; + case 'STOPPED': + return EventStreamState.stopped; + } + throw Exception('$this is not known in enum EventStreamState'); + } +} + +/// An instance of EventStream in a list of EventStreams. +class EventStreamSummary { + /// The unique name of the domain. + final String domainName; + + /// A unique identifier for the event stream. + final String eventStreamArn; + + /// The name of the event stream. + final String eventStreamName; + + /// The operational state of destination stream for export. + final EventStreamState state; + + /// Summary information about the Kinesis data stream. + final DestinationSummary? destinationSummary; + + /// The timestamp when the State changed to STOPPED. + final DateTime? stoppedSince; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + EventStreamSummary({ + required this.domainName, + required this.eventStreamArn, + required this.eventStreamName, + required this.state, + this.destinationSummary, + this.stoppedSince, + this.tags, + }); + + factory EventStreamSummary.fromJson(Map json) { + return EventStreamSummary( + domainName: json['DomainName'] as String, + eventStreamArn: json['EventStreamArn'] as String, + eventStreamName: json['EventStreamName'] as String, + state: (json['State'] as String).toEventStreamState(), + destinationSummary: json['DestinationSummary'] != null + ? DestinationSummary.fromJson( + json['DestinationSummary'] as Map) + : null, + stoppedSince: timeStampFromJson(json['StoppedSince']), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final domainName = this.domainName; + final eventStreamArn = this.eventStreamArn; + final eventStreamName = this.eventStreamName; + final state = this.state; + final destinationSummary = this.destinationSummary; + final stoppedSince = this.stoppedSince; + final tags = this.tags; + return { + 'DomainName': domainName, + 'EventStreamArn': eventStreamArn, + 'EventStreamName': eventStreamName, + 'State': state.toValue(), + if (destinationSummary != null) 'DestinationSummary': destinationSummary, + if (stoppedSince != null) + 'StoppedSince': unixTimestampToJson(stoppedSince), + if (tags != null) 'Tags': tags, + }; + } +} + /// Configuration information about the S3 bucket where Identity Resolution Jobs /// writes result files. /// @@ -3437,29 +4743,165 @@ class GetAutoMergingPreviewResponse { this.numberOfProfilesWillBeMerged, }); - factory GetAutoMergingPreviewResponse.fromJson(Map json) { - return GetAutoMergingPreviewResponse( - domainName: json['DomainName'] as String, - numberOfMatchesInSample: json['NumberOfMatchesInSample'] as int?, - numberOfProfilesInSample: json['NumberOfProfilesInSample'] as int?, - numberOfProfilesWillBeMerged: - json['NumberOfProfilesWillBeMerged'] as int?, + factory GetAutoMergingPreviewResponse.fromJson(Map json) { + return GetAutoMergingPreviewResponse( + domainName: json['DomainName'] as String, + numberOfMatchesInSample: json['NumberOfMatchesInSample'] as int?, + numberOfProfilesInSample: json['NumberOfProfilesInSample'] as int?, + numberOfProfilesWillBeMerged: + json['NumberOfProfilesWillBeMerged'] as int?, + ); + } + + Map toJson() { + final domainName = this.domainName; + final numberOfMatchesInSample = this.numberOfMatchesInSample; + final numberOfProfilesInSample = this.numberOfProfilesInSample; + final numberOfProfilesWillBeMerged = this.numberOfProfilesWillBeMerged; + return { + 'DomainName': domainName, + if (numberOfMatchesInSample != null) + 'NumberOfMatchesInSample': numberOfMatchesInSample, + if (numberOfProfilesInSample != null) + 'NumberOfProfilesInSample': numberOfProfilesInSample, + if (numberOfProfilesWillBeMerged != null) + 'NumberOfProfilesWillBeMerged': numberOfProfilesWillBeMerged, + }; + } +} + +class GetCalculatedAttributeDefinitionResponse { + /// Mathematical expression and a list of attribute items specified in that + /// expression. + final AttributeDetails? attributeDetails; + + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The conditions including range, object count, and threshold for the + /// calculated attribute. + final Conditions? conditions; + + /// The timestamp of when the calculated attribute definition was created. + final DateTime? createdAt; + + /// The description of the calculated attribute. + final String? description; + + /// The display name of the calculated attribute. + final String? displayName; + + /// The timestamp of when the calculated attribute definition was most recently + /// edited. + final DateTime? lastUpdatedAt; + + /// The aggregation operation to perform for the calculated attribute. + final Statistic? statistic; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + GetCalculatedAttributeDefinitionResponse({ + this.attributeDetails, + this.calculatedAttributeName, + this.conditions, + this.createdAt, + this.description, + this.displayName, + this.lastUpdatedAt, + this.statistic, + this.tags, + }); + + factory GetCalculatedAttributeDefinitionResponse.fromJson( + Map json) { + return GetCalculatedAttributeDefinitionResponse( + attributeDetails: json['AttributeDetails'] != null + ? AttributeDetails.fromJson( + json['AttributeDetails'] as Map) + : null, + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + conditions: json['Conditions'] != null + ? Conditions.fromJson(json['Conditions'] as Map) + : null, + createdAt: timeStampFromJson(json['CreatedAt']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + statistic: (json['Statistic'] as String?)?.toStatistic(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final attributeDetails = this.attributeDetails; + final calculatedAttributeName = this.calculatedAttributeName; + final conditions = this.conditions; + final createdAt = this.createdAt; + final description = this.description; + final displayName = this.displayName; + final lastUpdatedAt = this.lastUpdatedAt; + final statistic = this.statistic; + final tags = this.tags; + return { + if (attributeDetails != null) 'AttributeDetails': attributeDetails, + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (conditions != null) 'Conditions': conditions, + if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (lastUpdatedAt != null) + 'LastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (statistic != null) 'Statistic': statistic.toValue(), + if (tags != null) 'Tags': tags, + }; + } +} + +class GetCalculatedAttributeForProfileResponse { + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The display name of the calculated attribute. + final String? displayName; + + /// Indicates whether the calculated attribute’s value is based on partial data. + /// If data is partial, it is set to true. + final String? isDataPartial; + + /// The value of the calculated attribute. + final String? value; + + GetCalculatedAttributeForProfileResponse({ + this.calculatedAttributeName, + this.displayName, + this.isDataPartial, + this.value, + }); + + factory GetCalculatedAttributeForProfileResponse.fromJson( + Map json) { + return GetCalculatedAttributeForProfileResponse( + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + displayName: json['DisplayName'] as String?, + isDataPartial: json['IsDataPartial'] as String?, + value: json['Value'] as String?, ); } Map toJson() { - final domainName = this.domainName; - final numberOfMatchesInSample = this.numberOfMatchesInSample; - final numberOfProfilesInSample = this.numberOfProfilesInSample; - final numberOfProfilesWillBeMerged = this.numberOfProfilesWillBeMerged; + final calculatedAttributeName = this.calculatedAttributeName; + final displayName = this.displayName; + final isDataPartial = this.isDataPartial; + final value = this.value; return { - 'DomainName': domainName, - if (numberOfMatchesInSample != null) - 'NumberOfMatchesInSample': numberOfMatchesInSample, - if (numberOfProfilesInSample != null) - 'NumberOfProfilesInSample': numberOfProfilesInSample, - if (numberOfProfilesWillBeMerged != null) - 'NumberOfProfilesWillBeMerged': numberOfProfilesWillBeMerged, + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (displayName != null) 'DisplayName': displayName, + if (isDataPartial != null) 'IsDataPartial': isDataPartial, + if (value != null) 'Value': value, }; } } @@ -3499,6 +4941,16 @@ class GetDomainResponse { /// download the results from S3. final MatchingResponse? matching; + /// The process of matching duplicate profiles using the Rule-Based matching. If + /// RuleBasedMatching = true, Amazon Connect Customer Profiles will + /// start to match and merge your profiles according to your configuration in + /// the RuleBasedMatchingRequest. You can use the + /// ListRuleBasedMatches and GetSimilarProfiles API to + /// return and review the results. Also, if you have configured + /// ExportingConfig in the RuleBasedMatchingRequest, + /// you can download the results from S3. + final RuleBasedMatchingResponse? ruleBasedMatching; + /// Usage-specific statistics about the domain. final DomainStats? stats; @@ -3513,6 +4965,7 @@ class GetDomainResponse { this.defaultEncryptionKey, this.defaultExpirationDays, this.matching, + this.ruleBasedMatching, this.stats, this.tags, }); @@ -3529,6 +4982,10 @@ class GetDomainResponse { matching: json['Matching'] != null ? MatchingResponse.fromJson(json['Matching'] as Map) : null, + ruleBasedMatching: json['RuleBasedMatching'] != null + ? RuleBasedMatchingResponse.fromJson( + json['RuleBasedMatching'] as Map) + : null, stats: json['Stats'] != null ? DomainStats.fromJson(json['Stats'] as Map) : null, @@ -3545,6 +5002,7 @@ class GetDomainResponse { final defaultEncryptionKey = this.defaultEncryptionKey; final defaultExpirationDays = this.defaultExpirationDays; final matching = this.matching; + final ruleBasedMatching = this.ruleBasedMatching; final stats = this.stats; final tags = this.tags; return { @@ -3557,12 +5015,80 @@ class GetDomainResponse { if (defaultExpirationDays != null) 'DefaultExpirationDays': defaultExpirationDays, if (matching != null) 'Matching': matching, + if (ruleBasedMatching != null) 'RuleBasedMatching': ruleBasedMatching, if (stats != null) 'Stats': stats, if (tags != null) 'Tags': tags, }; } } +class GetEventStreamResponse { + /// The timestamp of when the export was created. + final DateTime createdAt; + + /// Details regarding the Kinesis stream. + final EventStreamDestinationDetails destinationDetails; + + /// The unique name of the domain. + final String domainName; + + /// A unique identifier for the event stream. + final String eventStreamArn; + + /// The operational state of destination stream for export. + final EventStreamState state; + + /// The timestamp when the State changed to STOPPED. + final DateTime? stoppedSince; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + GetEventStreamResponse({ + required this.createdAt, + required this.destinationDetails, + required this.domainName, + required this.eventStreamArn, + required this.state, + this.stoppedSince, + this.tags, + }); + + factory GetEventStreamResponse.fromJson(Map json) { + return GetEventStreamResponse( + createdAt: nonNullableTimeStampFromJson(json['CreatedAt'] as Object), + destinationDetails: EventStreamDestinationDetails.fromJson( + json['DestinationDetails'] as Map), + domainName: json['DomainName'] as String, + eventStreamArn: json['EventStreamArn'] as String, + state: (json['State'] as String).toEventStreamState(), + stoppedSince: timeStampFromJson(json['StoppedSince']), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final destinationDetails = this.destinationDetails; + final domainName = this.domainName; + final eventStreamArn = this.eventStreamArn; + final state = this.state; + final stoppedSince = this.stoppedSince; + final tags = this.tags; + return { + 'CreatedAt': unixTimestampToJson(createdAt), + 'DestinationDetails': destinationDetails, + 'DomainName': domainName, + 'EventStreamArn': eventStreamArn, + 'State': state.toValue(), + if (stoppedSince != null) + 'StoppedSince': unixTimestampToJson(stoppedSince), + if (tags != null) 'Tags': tags, + }; + } +} + class GetIdentityResolutionJobResponse { /// Configuration settings for how to perform the auto-merging of profiles. final AutoMerging? autoMerging; @@ -4034,6 +5560,76 @@ class GetProfileObjectTypeTemplateResponse { } } +class GetSimilarProfilesResponse { + /// It only has value when the MatchType is + /// ML_BASED_MATCHING.A number between 0 and 1, where a higher + /// score means higher similarity. Examining match confidence scores lets you + /// distinguish between groups of similar records in which the system is highly + /// confident (which you may decide to merge), groups of similar records about + /// which the system is uncertain (which you may decide to have reviewed by a + /// human), and groups of similar records that the system deems to be unlikely + /// (which you may decide to reject). Given confidence scores vary as per the + /// data input, it should not be used as an absolute measure of matching + /// quality. + final double? confidenceScore; + + /// The string matchId that the similar profiles belong to. + final String? matchId; + + /// Specify the type of matching to get similar profiles for. + final MatchType? matchType; + + /// The pagination token from the previous GetSimilarProfiles API + /// call. + final String? nextToken; + + /// Set of profileIds that belong to the same matching group. + final List? profileIds; + + /// The integer rule level that the profiles matched on. + final int? ruleLevel; + + GetSimilarProfilesResponse({ + this.confidenceScore, + this.matchId, + this.matchType, + this.nextToken, + this.profileIds, + this.ruleLevel, + }); + + factory GetSimilarProfilesResponse.fromJson(Map json) { + return GetSimilarProfilesResponse( + confidenceScore: json['ConfidenceScore'] as double?, + matchId: json['MatchId'] as String?, + matchType: (json['MatchType'] as String?)?.toMatchType(), + nextToken: json['NextToken'] as String?, + profileIds: (json['ProfileIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ruleLevel: json['RuleLevel'] as int?, + ); + } + + Map toJson() { + final confidenceScore = this.confidenceScore; + final matchId = this.matchId; + final matchType = this.matchType; + final nextToken = this.nextToken; + final profileIds = this.profileIds; + final ruleLevel = this.ruleLevel; + return { + if (confidenceScore != null) 'ConfidenceScore': confidenceScore, + if (matchId != null) 'MatchId': matchId, + if (matchType != null) 'MatchType': matchType.toValue(), + if (nextToken != null) 'NextToken': nextToken, + if (profileIds != null) 'ProfileIds': profileIds, + if (ruleLevel != null) 'RuleLevel': ruleLevel, + }; + } +} + class GetWorkflowResponse { /// Attributes provided for workflow execution. final WorkflowAttributes? attributes; @@ -4515,6 +6111,186 @@ class ListAccountIntegrationsResponse { } } +/// The details of a single calculated attribute definition. +class ListCalculatedAttributeDefinitionItem { + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The threshold for the calculated attribute. + final DateTime? createdAt; + + /// The threshold for the calculated attribute. + final String? description; + + /// The display name of the calculated attribute. + final String? displayName; + + /// The timestamp of when the calculated attribute definition was most recently + /// edited. + final DateTime? lastUpdatedAt; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + ListCalculatedAttributeDefinitionItem({ + this.calculatedAttributeName, + this.createdAt, + this.description, + this.displayName, + this.lastUpdatedAt, + this.tags, + }); + + factory ListCalculatedAttributeDefinitionItem.fromJson( + Map json) { + return ListCalculatedAttributeDefinitionItem( + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + createdAt: timeStampFromJson(json['CreatedAt']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final calculatedAttributeName = this.calculatedAttributeName; + final createdAt = this.createdAt; + final description = this.description; + final displayName = this.displayName; + final lastUpdatedAt = this.lastUpdatedAt; + final tags = this.tags; + return { + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (lastUpdatedAt != null) + 'LastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (tags != null) 'Tags': tags, + }; + } +} + +class ListCalculatedAttributeDefinitionsResponse { + /// The list of calculated attribute definitions. + final List? items; + + /// The pagination token from the previous call to + /// ListCalculatedAttributeDefinitions. + final String? nextToken; + + ListCalculatedAttributeDefinitionsResponse({ + this.items, + this.nextToken, + }); + + factory ListCalculatedAttributeDefinitionsResponse.fromJson( + Map json) { + return ListCalculatedAttributeDefinitionsResponse( + items: (json['Items'] as List?) + ?.whereNotNull() + .map((e) => ListCalculatedAttributeDefinitionItem.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'Items': items, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +/// The details of a single calculated attribute for a profile. +class ListCalculatedAttributeForProfileItem { + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The display name of the calculated attribute. + final String? displayName; + + /// Indicates whether the calculated attribute’s value is based on partial data. + /// If data is partial, it is set to true. + final String? isDataPartial; + + /// The value of the calculated attribute. + final String? value; + + ListCalculatedAttributeForProfileItem({ + this.calculatedAttributeName, + this.displayName, + this.isDataPartial, + this.value, + }); + + factory ListCalculatedAttributeForProfileItem.fromJson( + Map json) { + return ListCalculatedAttributeForProfileItem( + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + displayName: json['DisplayName'] as String?, + isDataPartial: json['IsDataPartial'] as String?, + value: json['Value'] as String?, + ); + } + + Map toJson() { + final calculatedAttributeName = this.calculatedAttributeName; + final displayName = this.displayName; + final isDataPartial = this.isDataPartial; + final value = this.value; + return { + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (displayName != null) 'DisplayName': displayName, + if (isDataPartial != null) 'IsDataPartial': isDataPartial, + if (value != null) 'Value': value, + }; + } +} + +class ListCalculatedAttributesForProfileResponse { + /// The list of calculated attributes. + final List? items; + + /// The pagination token from the previous call to + /// ListCalculatedAttributesForProfile. + final String? nextToken; + + ListCalculatedAttributesForProfileResponse({ + this.items, + this.nextToken, + }); + + factory ListCalculatedAttributesForProfileResponse.fromJson( + Map json) { + return ListCalculatedAttributesForProfileResponse( + items: (json['Items'] as List?) + ?.whereNotNull() + .map((e) => ListCalculatedAttributeForProfileItem.fromJson( + e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'Items': items, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + /// An object in a list that represents a domain. class ListDomainItem { /// The timestamp of when the domain was created. @@ -4593,6 +6369,38 @@ class ListDomainsResponse { } } +class ListEventStreamsResponse { + /// Contains summary information about an EventStream. + final List? items; + + /// Identifies the next page of results to return. + final String? nextToken; + + ListEventStreamsResponse({ + this.items, + this.nextToken, + }); + + factory ListEventStreamsResponse.fromJson(Map json) { + return ListEventStreamsResponse( + items: (json['Items'] as List?) + ?.whereNotNull() + .map((e) => EventStreamSummary.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'Items': items, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListIdentityResolutionJobsResponse { /// A list of Identity Resolution Jobs. final List? identityResolutionJobsList; @@ -4971,10 +6779,43 @@ class ListProfileObjectsResponse { } Map toJson() { - final items = this.items; + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'Items': items, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListRuleBasedMatchesResponse { + /// The list of MatchIds for the given domain. + final List? matchIds; + + /// The pagination token from the previous ListRuleBasedMatches API + /// call. + final String? nextToken; + + ListRuleBasedMatchesResponse({ + this.matchIds, + this.nextToken, + }); + + factory ListRuleBasedMatchesResponse.fromJson(Map json) { + return ListRuleBasedMatchesResponse( + matchIds: (json['MatchIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final matchIds = this.matchIds; final nextToken = this.nextToken; return { - if (items != null) 'Items': items, + if (matchIds != null) 'MatchIds': matchIds, if (nextToken != null) 'NextToken': nextToken, }; } @@ -5257,6 +7098,34 @@ class MatchItem { } } +enum MatchType { + ruleBasedMatching, + mlBasedMatching, +} + +extension MatchTypeValueExtension on MatchType { + String toValue() { + switch (this) { + case MatchType.ruleBasedMatching: + return 'RULE_BASED_MATCHING'; + case MatchType.mlBasedMatching: + return 'ML_BASED_MATCHING'; + } + } +} + +extension MatchTypeFromString on String { + MatchType toMatchType() { + switch (this) { + case 'RULE_BASED_MATCHING': + return MatchType.ruleBasedMatching; + case 'ML_BASED_MATCHING': + return MatchType.mlBasedMatching; + } + throw Exception('$this is not known in enum MatchType'); + } +} + /// The flag that enables the matching process of duplicate profiles. class MatchingRequest { /// The flag that enables the matching process of duplicate profiles. @@ -5347,6 +7216,89 @@ class MatchingResponse { } } +/// Specifies how does the rule-based matching process should match profiles. +/// You can choose from the following attributes to build the matching Rule: +/// +///
              +///
            • +/// AccountNumber +///
            • +///
            • +/// Address.Address +///
            • +///
            • +/// Address.City +///
            • +///
            • +/// Address.Country +///
            • +///
            • +/// Address.County +///
            • +///
            • +/// Address.PostalCode +///
            • +///
            • +/// Address.State +///
            • +///
            • +/// Address.Province +///
            • +///
            • +/// BirthDate +///
            • +///
            • +/// BusinessName +///
            • +///
            • +/// EmailAddress +///
            • +///
            • +/// FirstName +///
            • +///
            • +/// Gender +///
            • +///
            • +/// LastName +///
            • +///
            • +/// MiddleName +///
            • +///
            • +/// PhoneNumber +///
            • +///
            • +/// Any customized profile attributes that start with the +/// Attributes +///
            • +///
            +class MatchingRule { + /// A single rule level of the MatchRules. Configures how the + /// rule-based matching process should match profiles. + final List rule; + + MatchingRule({ + required this.rule, + }); + + factory MatchingRule.fromJson(Map json) { + return MatchingRule( + rule: (json['Rule'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final rule = this.rule; + return { + 'Rule': rule, + }; + } +} + class MergeProfilesResponse { /// A message that indicates the merge request is complete. final String? message; @@ -5369,15 +7321,15 @@ class MergeProfilesResponse { } } -/// The filter applied to ListProfileObjects response to include profile objects -/// with the specified index values. This filter is only supported for -/// ObjectTypeName _asset, _case and _order. +/// The filter applied to ListProfileObjects response to include +/// profile objects with the specified index values. class ObjectFilter { - /// A searchable identifier of a standard profile object. The predefined keys - /// you can use to search for _asset include: _assetId, _assetName, - /// _serialNumber. The predefined keys you can use to search for _case include: - /// _caseId. The predefined keys you can use to search for _order include: - /// _orderId. + /// A searchable identifier of a profile object. The predefined keys you can use + /// to search for _asset include: _assetId, + /// _assetName, and _serialNumber. The predefined keys + /// you can use to search for _case include: _caseId. + /// The predefined keys you can use to search for _order include: + /// _orderId. final String keyName; /// A list of key values. @@ -5486,6 +7438,44 @@ class ObjectTypeKey { } } +enum Operator { + equalTo, + greaterThan, + lessThan, + notEqualTo, +} + +extension OperatorValueExtension on Operator { + String toValue() { + switch (this) { + case Operator.equalTo: + return 'EQUAL_TO'; + case Operator.greaterThan: + return 'GREATER_THAN'; + case Operator.lessThan: + return 'LESS_THAN'; + case Operator.notEqualTo: + return 'NOT_EQUAL_TO'; + } + } +} + +extension OperatorFromString on String { + Operator toOperator() { + switch (this) { + case 'EQUAL_TO': + return Operator.equalTo; + case 'GREATER_THAN': + return Operator.greaterThan; + case 'LESS_THAN': + return Operator.lessThan; + case 'NOT_EQUAL_TO': + return Operator.notEqualTo; + } + throw Exception('$this is not known in enum Operator'); + } +} + enum OperatorPropertiesKeys { value, $values, @@ -6078,6 +8068,240 @@ class PutProfileObjectTypeResponse { } } +/// The relative time period over which data is included in the aggregation. +class Range { + /// The unit of time. + final Unit unit; + + /// The amount of time of the specified unit. + final int value; + + Range({ + required this.unit, + required this.value, + }); + + factory Range.fromJson(Map json) { + return Range( + unit: (json['Unit'] as String).toUnit(), + value: json['Value'] as int, + ); + } + + Map toJson() { + final unit = this.unit; + final value = this.value; + return { + 'Unit': unit.toValue(), + 'Value': value, + }; + } +} + +/// The request to enable the rule-based matching. +class RuleBasedMatchingRequest { + /// The flag that enables the rule-based matching process of duplicate profiles. + final bool enabled; + + /// Configures information about the AttributeTypesSelector where + /// the rule-based identity resolution uses to match profiles. + final AttributeTypesSelector? attributeTypesSelector; + final ConflictResolution? conflictResolution; + final ExportingConfig? exportingConfig; + + /// Configures how the rule-based matching process should match profiles. You + /// can have up to 15 MatchingRule in the + /// MatchingRules. + final List? matchingRules; + + /// Indicates the maximum allowed rule level. + final int? maxAllowedRuleLevelForMatching; + + /// MatchingRule + final int? maxAllowedRuleLevelForMerging; + + RuleBasedMatchingRequest({ + required this.enabled, + this.attributeTypesSelector, + this.conflictResolution, + this.exportingConfig, + this.matchingRules, + this.maxAllowedRuleLevelForMatching, + this.maxAllowedRuleLevelForMerging, + }); + + Map toJson() { + final enabled = this.enabled; + final attributeTypesSelector = this.attributeTypesSelector; + final conflictResolution = this.conflictResolution; + final exportingConfig = this.exportingConfig; + final matchingRules = this.matchingRules; + final maxAllowedRuleLevelForMatching = this.maxAllowedRuleLevelForMatching; + final maxAllowedRuleLevelForMerging = this.maxAllowedRuleLevelForMerging; + return { + 'Enabled': enabled, + if (attributeTypesSelector != null) + 'AttributeTypesSelector': attributeTypesSelector, + if (conflictResolution != null) 'ConflictResolution': conflictResolution, + if (exportingConfig != null) 'ExportingConfig': exportingConfig, + if (matchingRules != null) 'MatchingRules': matchingRules, + if (maxAllowedRuleLevelForMatching != null) + 'MaxAllowedRuleLevelForMatching': maxAllowedRuleLevelForMatching, + if (maxAllowedRuleLevelForMerging != null) + 'MaxAllowedRuleLevelForMerging': maxAllowedRuleLevelForMerging, + }; + } +} + +/// The response of the Rule-based matching request. +class RuleBasedMatchingResponse { + /// Configures information about the AttributeTypesSelector where + /// the rule-based identity resolution uses to match profiles. + final AttributeTypesSelector? attributeTypesSelector; + final ConflictResolution? conflictResolution; + + /// The flag that enables the rule-based matching process of duplicate profiles. + final bool? enabled; + final ExportingConfig? exportingConfig; + + /// Configures how the rule-based matching process should match profiles. You + /// can have up to 15 MatchingRule in the + /// MatchingRules. + final List? matchingRules; + + /// Indicates the maximum allowed rule level. + final int? maxAllowedRuleLevelForMatching; + + /// MatchingRule + final int? maxAllowedRuleLevelForMerging; + + /// PENDING + /// + ///
              + ///
            • + /// The first status after configuration a rule-based matching rule. If it is an + /// existing domain, the rule-based Identity Resolution waits one hour before + /// creating the matching rule. If it is a new domain, the system will skip the + /// PENDING stage. + ///
            • + ///
            + /// IN_PROGRESS + /// + ///
              + ///
            • + /// The system is creating the rule-based matching rule. Under this status, the + /// system is evaluating the existing data and you can no longer change the + /// Rule-based matching configuration. + ///
            • + ///
            + /// ACTIVE + /// + ///
              + ///
            • + /// The rule is ready to use. You can change the rule a day after the status is + /// in ACTIVE. + ///
            • + ///
            + final RuleBasedMatchingStatus? status; + + RuleBasedMatchingResponse({ + this.attributeTypesSelector, + this.conflictResolution, + this.enabled, + this.exportingConfig, + this.matchingRules, + this.maxAllowedRuleLevelForMatching, + this.maxAllowedRuleLevelForMerging, + this.status, + }); + + factory RuleBasedMatchingResponse.fromJson(Map json) { + return RuleBasedMatchingResponse( + attributeTypesSelector: json['AttributeTypesSelector'] != null + ? AttributeTypesSelector.fromJson( + json['AttributeTypesSelector'] as Map) + : null, + conflictResolution: json['ConflictResolution'] != null + ? ConflictResolution.fromJson( + json['ConflictResolution'] as Map) + : null, + enabled: json['Enabled'] as bool?, + exportingConfig: json['ExportingConfig'] != null + ? ExportingConfig.fromJson( + json['ExportingConfig'] as Map) + : null, + matchingRules: (json['MatchingRules'] as List?) + ?.whereNotNull() + .map((e) => MatchingRule.fromJson(e as Map)) + .toList(), + maxAllowedRuleLevelForMatching: + json['MaxAllowedRuleLevelForMatching'] as int?, + maxAllowedRuleLevelForMerging: + json['MaxAllowedRuleLevelForMerging'] as int?, + status: (json['Status'] as String?)?.toRuleBasedMatchingStatus(), + ); + } + + Map toJson() { + final attributeTypesSelector = this.attributeTypesSelector; + final conflictResolution = this.conflictResolution; + final enabled = this.enabled; + final exportingConfig = this.exportingConfig; + final matchingRules = this.matchingRules; + final maxAllowedRuleLevelForMatching = this.maxAllowedRuleLevelForMatching; + final maxAllowedRuleLevelForMerging = this.maxAllowedRuleLevelForMerging; + final status = this.status; + return { + if (attributeTypesSelector != null) + 'AttributeTypesSelector': attributeTypesSelector, + if (conflictResolution != null) 'ConflictResolution': conflictResolution, + if (enabled != null) 'Enabled': enabled, + if (exportingConfig != null) 'ExportingConfig': exportingConfig, + if (matchingRules != null) 'MatchingRules': matchingRules, + if (maxAllowedRuleLevelForMatching != null) + 'MaxAllowedRuleLevelForMatching': maxAllowedRuleLevelForMatching, + if (maxAllowedRuleLevelForMerging != null) + 'MaxAllowedRuleLevelForMerging': maxAllowedRuleLevelForMerging, + if (status != null) 'Status': status.toValue(), + }; + } +} + +enum RuleBasedMatchingStatus { + pending, + inProgress, + active, +} + +extension RuleBasedMatchingStatusValueExtension on RuleBasedMatchingStatus { + String toValue() { + switch (this) { + case RuleBasedMatchingStatus.pending: + return 'PENDING'; + case RuleBasedMatchingStatus.inProgress: + return 'IN_PROGRESS'; + case RuleBasedMatchingStatus.active: + return 'ACTIVE'; + } + } +} + +extension RuleBasedMatchingStatusFromString on String { + RuleBasedMatchingStatus toRuleBasedMatchingStatus() { + switch (this) { + case 'PENDING': + return RuleBasedMatchingStatus.pending; + case 'IN_PROGRESS': + return RuleBasedMatchingStatus.inProgress; + case 'ACTIVE': + return RuleBasedMatchingStatus.active; + } + throw Exception('$this is not known in enum RuleBasedMatchingStatus'); + } +} + enum S3ConnectorOperator { projection, lessThan, @@ -6863,6 +9087,64 @@ extension StandardIdentifierFromString on String { } } +enum Statistic { + firstOccurrence, + lastOccurrence, + count, + sum, + minimum, + maximum, + average, + maxOccurrence, +} + +extension StatisticValueExtension on Statistic { + String toValue() { + switch (this) { + case Statistic.firstOccurrence: + return 'FIRST_OCCURRENCE'; + case Statistic.lastOccurrence: + return 'LAST_OCCURRENCE'; + case Statistic.count: + return 'COUNT'; + case Statistic.sum: + return 'SUM'; + case Statistic.minimum: + return 'MINIMUM'; + case Statistic.maximum: + return 'MAXIMUM'; + case Statistic.average: + return 'AVERAGE'; + case Statistic.maxOccurrence: + return 'MAX_OCCURRENCE'; + } + } +} + +extension StatisticFromString on String { + Statistic toStatistic() { + switch (this) { + case 'FIRST_OCCURRENCE': + return Statistic.firstOccurrence; + case 'LAST_OCCURRENCE': + return Statistic.lastOccurrence; + case 'COUNT': + return Statistic.count; + case 'SUM': + return Statistic.sum; + case 'MINIMUM': + return Statistic.minimum; + case 'MAXIMUM': + return Statistic.maximum; + case 'AVERAGE': + return Statistic.average; + case 'MAX_OCCURRENCE': + return Statistic.maxOccurrence; + } + throw Exception('$this is not known in enum Statistic'); + } +} + enum Status { notStarted, inProgress, @@ -7027,6 +9309,36 @@ extension TaskTypeFromString on String { } } +/// The threshold for the calculated attribute. +class Threshold { + /// The operator of the threshold. + final Operator operator; + + /// The value of the threshold. + final String value; + + Threshold({ + required this.operator, + required this.value, + }); + + factory Threshold.fromJson(Map json) { + return Threshold( + operator: (json['Operator'] as String).toOperator(), + value: json['Value'] as String, + ); + } + + Map toJson() { + final operator = this.operator; + final value = this.value; + return { + 'Operator': operator.toValue(), + 'Value': value, + }; + } +} + /// The trigger settings that determine how and when Amazon AppFlow runs the /// specified flow. class TriggerConfig { @@ -7104,6 +9416,29 @@ extension TriggerTypeFromString on String { } } +enum Unit { + days, +} + +extension UnitValueExtension on Unit { + String toValue() { + switch (this) { + case Unit.days: + return 'DAYS'; + } + } +} + +extension UnitFromString on String { + Unit toUnit() { + switch (this) { + case 'DAYS': + return Unit.days; + } + throw Exception('$this is not known in enum Unit'); + } +} + class UntagResourceResponse { UntagResourceResponse(); @@ -7187,6 +9522,96 @@ class UpdateAddress { } } +class UpdateCalculatedAttributeDefinitionResponse { + /// The mathematical expression and a list of attribute items specified in that + /// expression. + final AttributeDetails? attributeDetails; + + /// The unique name of the calculated attribute. + final String? calculatedAttributeName; + + /// The conditions including range, object count, and threshold for the + /// calculated attribute. + final Conditions? conditions; + + /// The timestamp of when the calculated attribute definition was created. + final DateTime? createdAt; + + /// The description of the calculated attribute. + final String? description; + + /// The display name of the calculated attribute. + final String? displayName; + + /// The timestamp of when the calculated attribute definition was most recently + /// edited. + final DateTime? lastUpdatedAt; + + /// The aggregation operation to perform for the calculated attribute. + final Statistic? statistic; + + /// The tags used to organize, track, or control access for this resource. + final Map? tags; + + UpdateCalculatedAttributeDefinitionResponse({ + this.attributeDetails, + this.calculatedAttributeName, + this.conditions, + this.createdAt, + this.description, + this.displayName, + this.lastUpdatedAt, + this.statistic, + this.tags, + }); + + factory UpdateCalculatedAttributeDefinitionResponse.fromJson( + Map json) { + return UpdateCalculatedAttributeDefinitionResponse( + attributeDetails: json['AttributeDetails'] != null + ? AttributeDetails.fromJson( + json['AttributeDetails'] as Map) + : null, + calculatedAttributeName: json['CalculatedAttributeName'] as String?, + conditions: json['Conditions'] != null + ? Conditions.fromJson(json['Conditions'] as Map) + : null, + createdAt: timeStampFromJson(json['CreatedAt']), + description: json['Description'] as String?, + displayName: json['DisplayName'] as String?, + lastUpdatedAt: timeStampFromJson(json['LastUpdatedAt']), + statistic: (json['Statistic'] as String?)?.toStatistic(), + tags: (json['Tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final attributeDetails = this.attributeDetails; + final calculatedAttributeName = this.calculatedAttributeName; + final conditions = this.conditions; + final createdAt = this.createdAt; + final description = this.description; + final displayName = this.displayName; + final lastUpdatedAt = this.lastUpdatedAt; + final statistic = this.statistic; + final tags = this.tags; + return { + if (attributeDetails != null) 'AttributeDetails': attributeDetails, + if (calculatedAttributeName != null) + 'CalculatedAttributeName': calculatedAttributeName, + if (conditions != null) 'Conditions': conditions, + if (createdAt != null) 'CreatedAt': unixTimestampToJson(createdAt), + if (description != null) 'Description': description, + if (displayName != null) 'DisplayName': displayName, + if (lastUpdatedAt != null) + 'LastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (statistic != null) 'Statistic': statistic.toValue(), + if (tags != null) 'Tags': tags, + }; + } +} + class UpdateDomainResponse { /// The timestamp of when the domain was created. final DateTime createdAt; @@ -7222,6 +9647,16 @@ class UpdateDomainResponse { /// download the results from S3. final MatchingResponse? matching; + /// The process of matching duplicate profiles using the rule-Based matching. If + /// RuleBasedMatching = true, Amazon Connect Customer Profiles will + /// start to match and merge your profiles according to your configuration in + /// the RuleBasedMatchingRequest. You can use the + /// ListRuleBasedMatches and GetSimilarProfiles API to + /// return and review the results. Also, if you have configured + /// ExportingConfig in the RuleBasedMatchingRequest, + /// you can download the results from S3. + final RuleBasedMatchingResponse? ruleBasedMatching; + /// The tags used to organize, track, or control access for this resource. final Map? tags; @@ -7233,6 +9668,7 @@ class UpdateDomainResponse { this.defaultEncryptionKey, this.defaultExpirationDays, this.matching, + this.ruleBasedMatching, this.tags, }); @@ -7248,6 +9684,10 @@ class UpdateDomainResponse { matching: json['Matching'] != null ? MatchingResponse.fromJson(json['Matching'] as Map) : null, + ruleBasedMatching: json['RuleBasedMatching'] != null + ? RuleBasedMatchingResponse.fromJson( + json['RuleBasedMatching'] as Map) + : null, tags: (json['Tags'] as Map?) ?.map((k, e) => MapEntry(k, e as String)), ); @@ -7261,6 +9701,7 @@ class UpdateDomainResponse { final defaultEncryptionKey = this.defaultEncryptionKey; final defaultExpirationDays = this.defaultExpirationDays; final matching = this.matching; + final ruleBasedMatching = this.ruleBasedMatching; final tags = this.tags; return { 'CreatedAt': unixTimestampToJson(createdAt), @@ -7272,6 +9713,7 @@ class UpdateDomainResponse { if (defaultExpirationDays != null) 'DefaultExpirationDays': defaultExpirationDays, if (matching != null) 'Matching': matching, + if (ruleBasedMatching != null) 'RuleBasedMatching': ruleBasedMatching, if (tags != null) 'Tags': tags, }; } diff --git a/aws_client/lib/src/generated/data_exchange/v2017_07_25.dart b/aws_client/lib/src/generated/data_exchange/v2017_07_25.dart index c0166684e..4fad461d6 100644 --- a/aws_client/lib/src/generated/data_exchange/v2017_07_25.dart +++ b/aws_client/lib/src/generated/data_exchange/v2017_07_25.dart @@ -807,6 +807,60 @@ class DataExchange { ); } + /// The type of event associated with the data set. + /// + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [AccessDeniedException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [InternalServerException]. + /// + /// Parameter [dataSetId] : + /// Affected data set of the notification. + /// + /// Parameter [type] : + /// The type of the notification. Describing the kind of event the + /// notification is alerting you to. + /// + /// Parameter [clientToken] : + /// Idempotency key for the notification, this key allows us to deduplicate + /// notifications that are sent in quick succession erroneously. + /// + /// Parameter [comment] : + /// Free-form text field for providers to add information about their + /// notifications. + /// + /// Parameter [details] : + /// Extra details specific to this notification type. + /// + /// Parameter [scope] : + /// Affected scope of this notification such as the underlying resources + /// affected by the notification event. + Future sendDataSetNotification({ + required String dataSetId, + required NotificationType type, + String? clientToken, + String? comment, + NotificationDetails? details, + ScopeDetails? scope, + }) async { + final $payload = { + 'Type': type.toValue(), + 'ClientToken': clientToken ?? _s.generateIdempotencyToken(), + if (comment != null) 'Comment': comment, + if (details != null) 'Details': details, + if (scope != null) 'Scope': scope, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v1/data-sets/${Uri.encodeComponent(dataSetId)}/notification', + exceptionFnMap: _exceptionFns, + ); + } + /// This operation starts a job. /// /// May throw [ResourceNotFoundException]. @@ -2060,6 +2114,24 @@ class DataSetEntry { } } +/// Extra details specific to a data update type notification. +class DataUpdateRequestDetails { + /// A datetime in the past when the data was updated. This typically means that + /// the underlying resource supporting the data set was updated. + final DateTime? dataUpdatedAt; + + DataUpdateRequestDetails({ + this.dataUpdatedAt, + }); + + Map toJson() { + final dataUpdatedAt = this.dataUpdatedAt; + return { + if (dataUpdatedAt != null) 'DataUpdatedAt': iso8601ToJson(dataUpdatedAt), + }; + } +} + /// The LF-tag policy for database resources. class DatabaseLFTagPolicy { /// A list of LF-tag conditions that apply to database resources. @@ -2147,6 +2219,23 @@ extension DatabaseLFTagPolicyPermissionFromString on String { } } +/// Extra details specific to a deprecation type notification. +class DeprecationRequestDetails { + /// A datetime in the future when the data set will be deprecated. + final DateTime deprecationAt; + + DeprecationRequestDetails({ + required this.deprecationAt, + }); + + Map toJson() { + final deprecationAt = this.deprecationAt; + return { + 'DeprecationAt': iso8601ToJson(deprecationAt), + }; + } +} + /// Information about the job error. class Details { /// Information about the job error. @@ -4077,6 +4166,29 @@ extension LakeFormationDataPermissionTypeFromString on String { } } +/// Extra details specific to the affected scope in this LF data set. +class LakeFormationTagPolicyDetails { + /// The underlying Glue database that the notification is referring to. + final String? database; + + /// The underlying Glue table that the notification is referring to. + final String? table; + + LakeFormationTagPolicyDetails({ + this.database, + this.table, + }); + + Map toJson() { + final database = this.database; + final table = this.table; + return { + if (database != null) 'Database': database, + if (table != null) 'Table': table, + }; + } +} + class ListDataSetRevisionsResponse { /// The token value retrieved from a previous call to access the next page of /// results. @@ -4265,6 +4377,73 @@ class ListTagsForResourceResponse { } } +/// Extra details specific to this notification. +class NotificationDetails { + /// Extra details specific to a data update type notification. + final DataUpdateRequestDetails? dataUpdate; + + /// Extra details specific to a deprecation type notification. + final DeprecationRequestDetails? deprecation; + + /// Extra details specific to a schema change type notification. + final SchemaChangeRequestDetails? schemaChange; + + NotificationDetails({ + this.dataUpdate, + this.deprecation, + this.schemaChange, + }); + + Map toJson() { + final dataUpdate = this.dataUpdate; + final deprecation = this.deprecation; + final schemaChange = this.schemaChange; + return { + if (dataUpdate != null) 'DataUpdate': dataUpdate, + if (deprecation != null) 'Deprecation': deprecation, + if (schemaChange != null) 'SchemaChange': schemaChange, + }; + } +} + +enum NotificationType { + dataDelay, + dataUpdate, + deprecation, + schemaChange, +} + +extension NotificationTypeValueExtension on NotificationType { + String toValue() { + switch (this) { + case NotificationType.dataDelay: + return 'DATA_DELAY'; + case NotificationType.dataUpdate: + return 'DATA_UPDATE'; + case NotificationType.deprecation: + return 'DEPRECATION'; + case NotificationType.schemaChange: + return 'SCHEMA_CHANGE'; + } + } +} + +extension NotificationTypeFromString on String { + NotificationType toNotificationType() { + switch (this) { + case 'DATA_DELAY': + return NotificationType.dataDelay; + case 'DATA_UPDATE': + return NotificationType.dataUpdate; + case 'DEPRECATION': + return NotificationType.deprecation; + case 'SCHEMA_CHANGE': + return NotificationType.schemaChange; + } + throw Exception('$this is not known in enum NotificationType'); + } +} + enum Origin { owned, entitled, @@ -4296,22 +4475,22 @@ extension OriginFromString on String { /// Details about the origin of the data set. class OriginDetails { /// The product ID of the origin of the data set. - final String productId; + final String? productId; OriginDetails({ - required this.productId, + this.productId, }); factory OriginDetails.fromJson(Map json) { return OriginDetails( - productId: json['ProductId'] as String, + productId: json['ProductId'] as String?, ); } Map toJson() { final productId = this.productId; return { - 'ProductId': productId, + if (productId != null) 'ProductId': productId, }; } } @@ -4386,6 +4565,59 @@ class RedshiftDataShareAssetSourceEntry { } } +/// Extra details specific to the affected scope in this Redshift data set. +class RedshiftDataShareDetails { + /// The ARN of the underlying Redshift data share that is being affected by this + /// notification. + final String arn; + + /// The database name in the Redshift data share that is being affected by this + /// notification. + final String database; + + /// A function name in the Redshift database that is being affected by this + /// notification. + final String? function; + + /// A schema name in the Redshift database that is being affected by this + /// notification. + final String? schema; + + /// A table name in the Redshift database that is being affected by this + /// notification. + final String? table; + + /// A view name in the Redshift database that is being affected by this + /// notification. + final String? view; + + RedshiftDataShareDetails({ + required this.arn, + required this.database, + this.function, + this.schema, + this.table, + this.view, + }); + + Map toJson() { + final arn = this.arn; + final database = this.database; + final function = this.function; + final schema = this.schema; + final table = this.table; + final view = this.view; + return { + 'Arn': arn, + 'Database': database, + if (function != null) 'Function': function, + if (schema != null) 'Schema': schema, + if (table != null) 'Table': table, + if (view != null) 'View': view, + }; + } +} + /// The details for the request. class RequestDetails { /// Details of the request to create S3 data access from the Amazon S3 bucket. @@ -4990,6 +5222,32 @@ class S3DataAccessAssetSourceEntry { } } +/// Extra details specific to the affected scope in this S3 Data Access data +/// set. +class S3DataAccessDetails { + /// A list of the key prefixes affected by this notification. This can have up + /// to 50 entries. + final List? keyPrefixes; + + /// A list of the keys affected by this notification. This can have up to 50 + /// entries. + final List? keys; + + S3DataAccessDetails({ + this.keyPrefixes, + this.keys, + }); + + Map toJson() { + final keyPrefixes = this.keyPrefixes; + final keys = this.keys; + return { + if (keyPrefixes != null) 'KeyPrefixes': keyPrefixes, + if (keys != null) 'Keys': keys, + }; + } +} + /// The Amazon S3 object that is the asset. class S3SnapshotAsset { /// The size of the Amazon S3 object that is the object. @@ -5013,6 +5271,124 @@ class S3SnapshotAsset { } } +/// Object encompassing information about a schema change to a single, +/// particular field, a notification can have up to 100 of these. +class SchemaChangeDetails { + /// Name of the changing field. This value can be up to 255 characters long. + final String name; + + /// Is the field being added, removed, or modified? + final SchemaChangeType type; + + /// Description of what's changing about this field. This value can be up to 512 + /// characters long. + final String? description; + + SchemaChangeDetails({ + required this.name, + required this.type, + this.description, + }); + + Map toJson() { + final name = this.name; + final type = this.type; + final description = this.description; + return { + 'Name': name, + 'Type': type.toValue(), + if (description != null) 'Description': description, + }; + } +} + +/// Extra details specific to this schema change type notification. +class SchemaChangeRequestDetails { + /// A date in the future when the schema change is taking effect. + final DateTime schemaChangeAt; + + /// List of schema changes happening in the scope of this notification. This can + /// have up to 100 entries. + final List? changes; + + SchemaChangeRequestDetails({ + required this.schemaChangeAt, + this.changes, + }); + + Map toJson() { + final schemaChangeAt = this.schemaChangeAt; + final changes = this.changes; + return { + 'SchemaChangeAt': iso8601ToJson(schemaChangeAt), + if (changes != null) 'Changes': changes, + }; + } +} + +enum SchemaChangeType { + add, + remove, + modify, +} + +extension SchemaChangeTypeValueExtension on SchemaChangeType { + String toValue() { + switch (this) { + case SchemaChangeType.add: + return 'ADD'; + case SchemaChangeType.remove: + return 'REMOVE'; + case SchemaChangeType.modify: + return 'MODIFY'; + } + } +} + +extension SchemaChangeTypeFromString on String { + SchemaChangeType toSchemaChangeType() { + switch (this) { + case 'ADD': + return SchemaChangeType.add; + case 'REMOVE': + return SchemaChangeType.remove; + case 'MODIFY': + return SchemaChangeType.modify; + } + throw Exception('$this is not known in enum SchemaChangeType'); + } +} + +/// Details about the scope of the notifications such as the affected resources. +class ScopeDetails { + /// Underlying LF resources that will be affected by this notification. + final List? lakeFormationTagPolicies; + + /// Underlying Redshift resources that will be affected by this notification. + final List? redshiftDataShares; + + /// Underlying S3 resources that will be affected by this notification. + final List? s3DataAccesses; + + ScopeDetails({ + this.lakeFormationTagPolicies, + this.redshiftDataShares, + this.s3DataAccesses, + }); + + Map toJson() { + final lakeFormationTagPolicies = this.lakeFormationTagPolicies; + final redshiftDataShares = this.redshiftDataShares; + final s3DataAccesses = this.s3DataAccesses; + return { + if (lakeFormationTagPolicies != null) + 'LakeFormationTagPolicies': lakeFormationTagPolicies, + if (redshiftDataShares != null) 'RedshiftDataShares': redshiftDataShares, + if (s3DataAccesses != null) 'S3DataAccesses': s3DataAccesses, + }; + } +} + class SendApiAssetResponse { /// The response body from the underlying API tracked by the API asset. final String? body; @@ -5034,6 +5410,18 @@ class SendApiAssetResponse { } } +class SendDataSetNotificationResponse { + SendDataSetNotificationResponse(); + + factory SendDataSetNotificationResponse.fromJson(Map _) { + return SendDataSetNotificationResponse(); + } + + Map toJson() { + return {}; + } +} + enum ServerSideEncryptionTypes { awsKms, aes256, diff --git a/aws_client/lib/src/generated/data_sync/v2018_11_09.dart b/aws_client/lib/src/generated/data_sync/v2018_11_09.dart index 585286134..5632761d6 100644 --- a/aws_client/lib/src/generated/data_sync/v2018_11_09.dart +++ b/aws_client/lib/src/generated/data_sync/v2018_11_09.dart @@ -19,10 +19,10 @@ import '../../shared/shared.dart' export '../../shared/shared.dart' show AwsClientCredentials; -/// DataSync is a managed data transfer service that makes it simpler for you to -/// automate moving data between on-premises storage and Amazon Web Services -/// storage services. You also can use DataSync to transfer data between other -/// cloud providers and Amazon Web Services storage services. +/// DataSync is an online data movement and discovery service that simplifies +/// data migration and helps you quickly, easily, and securely transfer your +/// file or object data to, from, and between Amazon Web Services storage +/// services. class DataSync { final _s.JsonProtocol _protocol; DataSync({ @@ -61,7 +61,7 @@ class DataSync { /// Parameter [agentArns] : /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that /// connects to and reads from your on-premises storage system's management - /// interface. + /// interface. You can only specify one ARN. /// /// Parameter [credentials] : /// Specifies the user name and password for accessing your on-premises @@ -165,81 +165,70 @@ class DataSync { ); } - /// Activates an DataSync agent that you have deployed in your storage - /// environment. The activation process associates your agent with your - /// account. In the activation process, you specify information such as the - /// Amazon Web Services Region that you want to activate the agent in. You - /// activate the agent in the Amazon Web Services Region where your target - /// locations (in Amazon S3 or Amazon EFS) reside. Your tasks are created in - /// this Amazon Web Services Region. + /// Activates an DataSync agent that you've deployed in your storage + /// environment. The activation process associates the agent with your Amazon + /// Web Services account. /// - /// You can activate the agent in a VPC (virtual private cloud) or provide the - /// agent access to a VPC endpoint so you can run tasks without going over the - /// public internet. + /// If you haven't deployed an agent yet, see the following topics to learn + /// more: /// - /// You can use an agent for more than one location. If a task uses multiple - /// agents, all of them need to have status AVAILABLE for the task to run. If - /// you use multiple agents for a source location, the status of all the - /// agents must be AVAILABLE for the task to run. - /// - /// Agents are automatically updated by Amazon Web Services on a regular - /// basis, using a mechanism that ensures minimal interruption to your tasks. + /// + /// If you're transferring between Amazon Web Services storage services, you + /// don't need a DataSync agent. + /// /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [activationKey] : - /// Your agent activation key. You can get the activation key either by - /// sending an HTTP GET request with redirects that enable you to get the - /// agent IP address (port 80). Alternatively, you can get it from the - /// DataSync console. - /// - /// The redirect URL returned in the response provides you the activation key - /// for your agent in the query string parameter activationKey. - /// It might also include other activation-related parameters; however, these - /// are merely defaults. The arguments you pass to this API call determine the - /// actual configuration of your agent. - /// - /// For more information, see Activating an Agent in the DataSync User - /// Guide. + /// Specifies your DataSync agent's activation key. If you don't have an + /// activation key, see Activate + /// your agent. /// /// Parameter [agentName] : - /// The name you configured for your agent. This value is a text reference - /// that is used to identify the agent in the console. + /// Specifies a name for your agent. You can see this name in the DataSync + /// console. /// /// Parameter [securityGroupArns] : - /// The ARNs of the security groups used to protect your data transfer task - /// subnets. See SecurityGroupArns. + /// Specifies the Amazon Resource Name (ARN) of the security group that + /// protects your task's network + /// interfaces when using + /// a virtual private cloud (VPC) endpoint. You can only specify one ARN. /// /// Parameter [subnetArns] : - /// The Amazon Resource Names (ARNs) of the subnets in which DataSync will - /// create elastic network interfaces for each data transfer task. The agent - /// that runs a task must be private. When you start a task that is associated - /// with an agent created in a VPC, or one that has access to an IP address in - /// a VPC, then the task is also private. In this case, DataSync creates four - /// network interfaces for each task in your subnet. For a data transfer to - /// work, the agent must be able to route to all these four network - /// interfaces. + /// Specifies the ARN of the subnet where you want to run your DataSync task + /// when using a VPC endpoint. This is the subnet where DataSync creates and + /// manages the network + /// interfaces for your transfer. You can only specify one ARN. /// /// Parameter [tags] : - /// The key-value pair that represents the tag that you want to associate with - /// the agent. The value can be an empty string. This value helps you manage, - /// filter, and search for your agents. - /// - /// Valid characters for key and value are letters, spaces, and numbers - /// representable in UTF-8 format, and the following special characters: + - = - /// . _ : / @. - /// + /// Specifies labels that help you categorize, filter, and search for your + /// Amazon Web Services resources. We recommend creating at least one tag for + /// your agent. /// /// Parameter [vpcEndpointId] : - /// The ID of the VPC (virtual private cloud) endpoint that the agent has - /// access to. This is the client-side VPC endpoint, also called a - /// PrivateLink. If you don't have a PrivateLink VPC endpoint, see Creating - /// a VPC Endpoint Service Configuration in the Amazon VPC User Guide. - /// - /// VPC endpoint ID looks like this: vpce-01234d5aff67890e1. + /// Specifies the ID of the VPC endpoint that you want your agent to connect + /// to. For example, a VPC endpoint ID looks like + /// vpce-01234d5aff67890e1. + /// + /// The VPC endpoint you use must include the DataSync service name (for + /// example, com.amazonaws.us-east-2.datasync). + /// Future createAgent({ required String activationKey, String? agentName, @@ -271,10 +260,108 @@ class DataSync { return CreateAgentResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an Amazon EFS file system that DataSync can access - /// for a transfer. For more information, see Creating - /// a location for Amazon EFS. + /// Creates a transfer location for a Microsoft Azure Blob Storage + /// container. DataSync can use this location as a transfer source or + /// destination. + /// + /// Before you begin, make sure you know how + /// DataSync accesses Azure Blob Storage and works with access + /// tiers and blob + /// types. You also need a DataSync + /// agent that can connect to your container. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalException]. + /// + /// Parameter [agentArns] : + /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that can + /// connect with your Azure Blob Storage container. + /// + /// You can specify more than one agent. For more information, see Using + /// multiple agents for your transfer. + /// + /// Parameter [authenticationType] : + /// Specifies the authentication method DataSync uses to access your Azure + /// Blob Storage. DataSync can access blob storage using a shared access + /// signature (SAS). + /// + /// Parameter [containerUrl] : + /// Specifies the URL of the Azure Blob Storage container involved in your + /// transfer. + /// + /// Parameter [accessTier] : + /// Specifies the access tier that you want your objects or files transferred + /// into. This only applies when using the location as a transfer destination. + /// For more information, see Access + /// tiers. + /// + /// Parameter [blobType] : + /// Specifies the type of blob that you want your objects or files to be when + /// transferring them into Azure Blob Storage. Currently, DataSync only + /// supports moving data into Azure Blob Storage as block blobs. For more + /// information on blob types, see the Azure + /// Blob Storage documentation. + /// + /// Parameter [sasConfiguration] : + /// Specifies the SAS configuration that allows DataSync to access your Azure + /// Blob Storage. + /// + /// Parameter [subdirectory] : + /// Specifies path segments if you want to limit your transfer to a virtual + /// directory in your container (for example, /my/images). + /// + /// Parameter [tags] : + /// Specifies labels that help you categorize, filter, and search for your + /// Amazon Web Services resources. We recommend creating at least a name tag + /// for your transfer location. + Future createLocationAzureBlob({ + required List agentArns, + required AzureBlobAuthenticationType authenticationType, + required String containerUrl, + AzureAccessTier? accessTier, + AzureBlobType? blobType, + AzureBlobSasConfiguration? sasConfiguration, + String? subdirectory, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'FmrsService.CreateLocationAzureBlob' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'AgentArns': agentArns, + 'AuthenticationType': authenticationType.toValue(), + 'ContainerUrl': containerUrl, + if (accessTier != null) 'AccessTier': accessTier.toValue(), + if (blobType != null) 'BlobType': blobType.toValue(), + if (sasConfiguration != null) 'SasConfiguration': sasConfiguration, + if (subdirectory != null) 'Subdirectory': subdirectory, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateLocationAzureBlobResponse.fromJson(jsonResponse.body); + } + + /// Creates a transfer location for an Amazon EFS file system. DataSync + /// can use this location as a source or destination for transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// Amazon EFS file systems. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -352,7 +439,13 @@ class DataSync { return CreateLocationEfsResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an Amazon FSx for Lustre file system. + /// Creates a transfer location for an Amazon FSx for Lustre file + /// system. DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// FSx for Lustre file systems. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -401,10 +494,13 @@ class DataSync { return CreateLocationFsxLustreResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an Amazon FSx for NetApp ONTAP file system that - /// DataSync can access for a transfer. For more information, see Creating - /// a location for FSx for ONTAP. + /// Creates a transfer location for an Amazon FSx for NetApp ONTAP file + /// system. DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// FSx for ONTAP file systems. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -479,10 +575,13 @@ class DataSync { return CreateLocationFsxOntapResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an Amazon FSx for OpenZFS file system that - /// DataSync can access for a transfer. For more information, see Creating - /// a location for FSx for OpenZFS. + /// Creates a transfer location for an Amazon FSx for OpenZFS file + /// system. DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// FSx for OpenZFS file systems. /// /// Request parameters related to SMB aren't supported with the /// CreateLocationFsxOpenZfs operation. @@ -541,7 +640,13 @@ class DataSync { return CreateLocationFsxOpenZfsResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an Amazon FSx for Windows File Server file system. + /// Creates a transfer location for an Amazon FSx for Windows File + /// Server file system. DataSync can use this location as a source or + /// destination for transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// FSx for Windows File Server file systems. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -551,8 +656,9 @@ class DataSync { /// Server file system. /// /// Parameter [password] : - /// Specifies the password of the user who has the permissions to access files - /// and folders in the file system. + /// Specifies the password of the user with the permissions to mount and + /// access the files, folders, and file metadata in your FSx for Windows File + /// Server file system. /// /// Parameter [securityGroupArns] : /// Specifies the ARNs of the security groups that provide access to your file @@ -572,16 +678,22 @@ class DataSync { ///
          /// /// Parameter [user] : - /// Specifies the user who has the permissions to access files and folders in - /// the file system. + /// Specifies the user with the permissions to mount and access the files, + /// folders, and file metadata in your FSx for Windows File Server file + /// system. /// - /// For information about choosing a user name that ensures sufficient - /// permissions to files, folders, and metadata, see user. + /// For information about choosing a user with the right level of access for + /// your transfer, see required + /// permissions for FSx for Windows File Server locations. /// /// Parameter [domain] : - /// Specifies the name of the Windows domain that the FSx for Windows File - /// Server belongs to. + /// Specifies the name of the Microsoft Active Directory domain that the FSx + /// for Windows File Server file system belongs to. + /// + /// If you have multiple Active Directory domains in your environment, + /// configuring this parameter makes sure that DataSync connects to the right + /// file system. /// /// Parameter [subdirectory] : /// Specifies a mount path for your file system using forward slashes. This is @@ -625,7 +737,13 @@ class DataSync { return CreateLocationFsxWindowsResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for a Hadoop Distributed File System (HDFS). + /// Creates a transfer location for a Hadoop Distributed File System + /// (HDFS). DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// HDFS clusters. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -768,68 +886,52 @@ class DataSync { return CreateLocationHdfsResponse.fromJson(jsonResponse.body); } - /// Defines a file system on a Network File System (NFS) server that can be - /// read from or written to. + /// Creates a transfer location for a Network File System (NFS) file + /// server. DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// NFS file servers. + /// + /// If you're copying data to or from an Snowcone device, you can also use + /// CreateLocationNfs to create your transfer location. For more + /// information, see Configuring + /// transfers with Snowcone. + /// /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [onPremConfig] : - /// Contains a list of Amazon Resource Names (ARNs) of agents that are used to - /// connect to an NFS server. + /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that want + /// to connect to your NFS file server. /// - /// If you are copying data to or from your Snowcone device, see NFS - /// Server on Snowcone for more information. + /// You can specify more than one agent. For more information, see Using + /// multiple agents for transfers. /// /// Parameter [serverHostname] : - /// The name of the NFS server. This value is the IP address or Domain Name - /// Service (DNS) name of the NFS server. An agent that is installed - /// on-premises uses this hostname to mount the NFS server in a network. - /// - /// If you are copying data to or from your Snowcone device, see NFS - /// Server on Snowcone for more information. - /// - /// This name must either be DNS-compliant or must be an IP version 4 (IPv4) - /// address. - /// + /// Specifies the Domain Name System (DNS) name or IP version 4 address of the + /// NFS file server that your DataSync agent connects to. /// /// Parameter [subdirectory] : - /// The subdirectory in the NFS file system that is used to read data from the - /// NFS source location or write data to the NFS destination. The NFS path - /// should be a path that's exported by the NFS server, or a subdirectory of - /// that path. The path should be such that it can be mounted by other NFS - /// clients in your network. - /// - /// To see all the paths exported by your NFS server, run "showmount -e - /// nfs-server-name" from an NFS client that has access to your server. - /// You can specify any directory that appears in the results, and any - /// subdirectory of that directory. Ensure that the NFS export is accessible - /// without Kerberos authentication. - /// - /// To transfer all the data in the folder you specified, DataSync needs to - /// have permissions to read all the data. To ensure this, either configure - /// the NFS export with no_root_squash, or ensure that the - /// permissions for all of the files that you want DataSync allow read access - /// for all users. Doing either enables the agent to read the files. For the - /// agent to access directories, you must additionally enable all execute - /// access. - /// - /// If you are copying data to or from your Snowcone device, see NFS - /// Server on Snowcone for more information. - /// - /// For information about NFS export configuration, see 18.7. The /etc/exports - /// Configuration File in the Red Hat Enterprise Linux documentation. + /// Specifies the export path in your NFS file server that you want DataSync + /// to mount. + /// + /// This path (or a subdirectory of the path) is where DataSync transfers data + /// to or from. For information on configuring an export for DataSync, see Accessing + /// NFS file servers. /// /// Parameter [mountOptions] : - /// The NFS mount options that DataSync can use to mount your NFS share. + /// Specifies the options that DataSync can use to mount your NFS file server. /// /// Parameter [tags] : - /// The key-value pair that represents the tag that you want to add to the - /// location. The value can be an empty string. We recommend using tags to - /// name your resources. + /// Specifies labels that help you categorize, filter, and search for your + /// Amazon Web Services resources. We recommend creating at least a name tag + /// for your location. Future createLocationNfs({ required OnPremConfig onPremConfig, required String serverHostname, @@ -859,10 +961,12 @@ class DataSync { return CreateLocationNfsResponse.fromJson(jsonResponse.body); } - /// Creates an endpoint for an object storage system that DataSync can access - /// for a transfer. For more information, see Creating - /// a location for object storage. + /// Creates a transfer location for an object storage system. DataSync + /// can use this location as a source or destination for transferring data. + /// + /// Before you begin, make sure that you understand the prerequisites + /// for DataSync to work with object storage systems. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -888,11 +992,33 @@ class DataSync { /// required to authenticate with the object storage server. /// /// Parameter [serverCertificate] : - /// Specifies a certificate to authenticate with an object storage system that - /// uses a private or self-signed certificate authority (CA). You must specify - /// a Base64-encoded .pem file (for example, - /// file:///home/user/.ssh/storage_sys_certificate.pem). The - /// certificate can be up to 32768 bytes (before Base64 encoding). + /// Specifies a certificate chain for DataSync to authenticate with your + /// object storage system if the system uses a private or self-signed + /// certificate authority (CA). You must specify a single .pem + /// file with a full certificate chain (for example, + /// file:///home/user/.ssh/object_storage_certificates.pem). + /// + /// The certificate chain might include: + /// + ///
            + ///
          • + /// The object storage system's certificate + ///
          • + ///
          • + /// All intermediate certificates (if there are any) + ///
          • + ///
          • + /// The root certificate of the signing CA + ///
          • + ///
          + /// You can concatenate your certificates into a .pem file (which + /// can be up to 32768 bytes before base64 encoding). The following example + /// cat command creates an + /// object_storage_certificates.pem file that includes three + /// certificates: + /// + /// cat object_server_certificate.pem intermediate_certificate.pem + /// ca_root_certificate.pem > object_storage_certificates.pem /// /// To use this parameter, configure ServerProtocol to /// HTTPS. @@ -960,11 +1086,10 @@ class DataSync { return CreateLocationObjectStorageResponse.fromJson(jsonResponse.body); } - /// A location is an endpoint for an Amazon S3 bucket. DataSync can use - /// the location as a source or destination for copying data. + /// Creates a transfer location for an Amazon S3 bucket. DataSync can + /// use this location as a source or destination for transferring data. /// - /// Before you create your location, make sure that you read the following - /// sections: + /// Before you begin, make sure that you read the following topics: /// ///
            ///
          • @@ -979,46 +1104,70 @@ class DataSync { ///
          • ///
          /// For more information, see Creating - /// an Amazon S3 location. + /// href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html">Configuring + /// transfers with Amazon S3. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [s3BucketArn] : - /// The ARN of the Amazon S3 bucket. If the bucket is on an Amazon Web - /// Services Outpost, this must be an access point ARN. + /// Specifies the ARN of the S3 bucket that you want to use as a location. + /// (When creating your DataSync task later, you specify whether this location + /// is a transfer source or destination.) + /// + /// If your S3 bucket is located on an Outposts resource, you must specify an + /// Amazon S3 access point. For more information, see Managing + /// data access with Amazon S3 access points in the Amazon S3 User + /// Guide. /// /// Parameter [agentArns] : - /// If you're using DataSync on an Amazon Web Services Outpost, specify the - /// Amazon Resource Names (ARNs) of the DataSync agents deployed on your - /// Outpost. For more information about launching a DataSync agent on an - /// Amazon Web Services Outpost, see Deploy /// your DataSync agent on Outposts. /// /// Parameter [s3StorageClass] : - /// The Amazon S3 storage class that you want to store your files in when this - /// location is used as a task destination. For buckets in Amazon Web Services - /// Regions, the storage class defaults to Standard. For buckets on Outposts, - /// the storage class defaults to Amazon Web Services S3 Outposts. - /// - /// For more information about S3 storage classes, see Amazon S3 Storage - /// Classes. Some storage classes have behaviors that can affect your S3 - /// storage cost. For detailed information, see Considerations - /// when working with S3 storage classes in DataSync. + /// Specifies the storage class that you want your objects to use when Amazon + /// S3 is a transfer destination. + /// + /// For buckets in Amazon Web Services Regions, the storage class defaults to + /// STANDARD. For buckets on Outposts, the storage class defaults + /// to OUTPOSTS. + /// + /// For more information, see Storage + /// class considerations with Amazon S3 transfers. /// /// Parameter [subdirectory] : - /// A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is - /// used to read data from the S3 source location or write data to the S3 - /// destination. + /// Specifies a prefix in the S3 bucket that DataSync reads from or writes to + /// (depending on whether the bucket is a source or destination location). + /// + /// DataSync can't transfer objects with a prefix that begins with a slash + /// (/) or includes //, /./, or + /// /../ patterns. For example: + /// + ///
            + ///
          • + /// /photos + ///
          • + ///
          • + /// photos//2006/January + ///
          • + ///
          • + /// photos/./2006/February + ///
          • + ///
          • + /// photos/../2006/March + ///
          • + ///
          /// /// Parameter [tags] : - /// The key-value pair that represents the tag that you want to add to the - /// location. The value can be an empty string. We recommend using tags to - /// name your resources. + /// Specifies labels that help you categorize, filter, and search for your + /// Amazon Web Services resources. We recommend creating at least a name tag + /// for your transfer location. Future createLocationS3({ required String s3BucketArn, required S3Config s3Config, @@ -1050,10 +1199,13 @@ class DataSync { return CreateLocationS3Response.fromJson(jsonResponse.body); } - /// Creates an endpoint for a Server Message Block (SMB) file server that - /// DataSync can access for a transfer. For more information, see Creating - /// an SMB location. + /// Creates a transfer location for a Server Message Block (SMB) file + /// server. DataSync can use this location as a source or destination for + /// transferring data. + /// + /// Before you begin, make sure that you understand how DataSync accesses + /// SMB file servers. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1084,15 +1236,14 @@ class DataSync { /// share path (for example, /path/to/subdirectory). Make sure /// that other SMB clients in your network can also mount this path. /// - /// To copy all data in the specified subdirectory, DataSync must be able to - /// mount the SMB share and access all of its data. For more information, see - /// required /// permissions for SMB locations. /// /// Parameter [user] : - /// Specifies the user name that can mount your SMB file server and has - /// permission to access the files and folders involved in your transfer. + /// Specifies the user that can mount and access the files, folders, and file + /// metadata in your SMB file server. /// /// For information about choosing a user with the right level of access for /// your transfer, see for SMB locations. /// /// Parameter [domain] : - /// Specifies the Windows domain name that your SMB file server belongs to. + /// Specifies the name of the Active Directory domain that your SMB file + /// server belongs to. /// - /// For more information, see required - /// permissions for SMB locations. + /// If you have multiple Active Directory domains in your environment, + /// configuring this parameter makes sure that DataSync connects to the right + /// file server. /// /// Parameter [mountOptions] : /// Specifies the version of the SMB protocol that DataSync uses to access @@ -1149,12 +1301,11 @@ class DataSync { return CreateLocationSmbResponse.fromJson(jsonResponse.body); } - /// Configures a task, which defines where and how DataSync transfers your - /// data. + /// Configures a task, which defines where and how DataSync transfers + /// your data. /// - /// A task includes a source location, a destination location, and the - /// preferences for how and when you want to transfer your data (such as - /// bandwidth limits, scheduling, among other options). + /// A task includes a source location, destination location, and transfer + /// options (such as bandwidth limits, scheduling, and more). /// /// If you're planning to transfer data to or from an Amazon S3 location, /// review Filtering - /// data transferred by DataSync. + /// Specifies exclude filters that define the files, objects, and folders in + /// your source location that you don't want DataSync to transfer. For more + /// information and examples, see Specifying + /// what DataSync transfers by using filters. /// /// Parameter [includes] : - /// Specifies a list of filter rules that include specific data during your - /// transfer. For more information and examples, see Filtering - /// data transferred by DataSync. + /// Specifies include filters define the files, objects, and folders in your + /// source location that you want DataSync to transfer. For more information + /// and examples, see Specifying + /// what DataSync transfers by using filters. + /// + /// Parameter [manifestConfig] : + /// Configures a manifest, which is a list of files or objects that you want + /// DataSync to transfer. For more information and configuration examples, see + /// Specifying + /// what DataSync transfers by using a manifest. + /// + /// When using this parameter, your caller identity (the role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. /// /// Parameter [name] : - /// The name of a task. This value is a text reference that is used to - /// identify the task in the console. + /// Specifies the name of your task. /// /// Parameter [options] : - /// Specifies the configuration options for a task. Some options include - /// preserving file or object metadata and verifying data integrity. - /// - /// You can also override these options before starting an individual run of a - /// task (also known as a task execution). For more information, see StartTaskExecution. + /// Specifies your task's settings, such as preserving file metadata, + /// verifying data integrity, among other options. /// /// Parameter [schedule] : - /// Specifies a schedule used to periodically transfer files from a source to - /// a destination location. The schedule should be specified in UTC time. For - /// more information, see Scheduling /// your task. /// /// Parameter [tags] : - /// Specifies the tags that you want to apply to the Amazon Resource Name - /// (ARN) representing the task. + /// Specifies the tags that you want to apply to your task. /// /// Tags are key-value pairs that help you manage, filter, and search /// for your DataSync resources. + /// + /// Parameter [taskReportConfig] : + /// Specifies how you want to configure a task report, which provides detailed + /// information about your DataSync transfer. For more information, see Monitoring + /// your DataSync transfers with task reports. + /// + /// When using this parameter, your caller identity (the role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. Future createTask({ required String destinationLocationArn, required String sourceLocationArn, String? cloudWatchLogGroupArn, List? excludes, List? includes, + ManifestConfig? manifestConfig, String? name, Options? options, TaskSchedule? schedule, List? tags, + TaskReportConfig? taskReportConfig, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -1243,21 +1415,26 @@ class DataSync { 'CloudWatchLogGroupArn': cloudWatchLogGroupArn, if (excludes != null) 'Excludes': excludes, if (includes != null) 'Includes': includes, + if (manifestConfig != null) 'ManifestConfig': manifestConfig, if (name != null) 'Name': name, if (options != null) 'Options': options, if (schedule != null) 'Schedule': schedule, if (tags != null) 'Tags': tags, + if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig, }, ); return CreateTaskResponse.fromJson(jsonResponse.body); } - /// Deletes an agent. To specify which agent to delete, use the Amazon - /// Resource Name (ARN) of the agent in your request. The operation - /// disassociates the agent from your Amazon Web Services account. However, it - /// doesn't delete the agent virtual machine (VM) from your on-premises - /// environment. + /// Removes an DataSync agent resource from your Amazon Web Services account. + /// + /// Keep in mind that this operation (which can't be undone) doesn't remove + /// the agent's virtual machine (VM) or Amazon EC2 instance from your storage + /// environment. For next steps, you can delete the VM or instance from your + /// storage environment or reuse it to activate + /// a new agent. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1285,7 +1462,7 @@ class DataSync { ); } - /// Deletes the configuration of a location used by DataSync. + /// Deletes a transfer location resource from DataSync. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1311,7 +1488,7 @@ class DataSync { ); } - /// Deletes an DataSync task. + /// Deletes a transfer task resource from DataSync. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1338,15 +1515,15 @@ class DataSync { ); } - /// Returns metadata about an DataSync agent, such as its name, endpoint type, - /// and status. + /// Returns information about an DataSync agent, such as its name, service + /// endpoint type, and status. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [agentArn] : - /// Specifies the Amazon Resource Name (ARN) of the DataSync agent to - /// describe. + /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that you + /// want information about. Future describeAgent({ required String agentArn, }) async { @@ -1397,8 +1574,38 @@ class DataSync { return DescribeDiscoveryJobResponse.fromJson(jsonResponse.body); } - /// Returns metadata about your DataSync location for an Amazon EFS file - /// system. + /// Provides details about how an DataSync transfer location for Microsoft + /// Azure Blob Storage is configured. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalException]. + /// + /// Parameter [locationArn] : + /// Specifies the Amazon Resource Name (ARN) of your Azure Blob Storage + /// transfer location. + Future describeLocationAzureBlob({ + required String locationArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'FmrsService.DescribeLocationAzureBlob' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'LocationArn': locationArn, + }, + ); + + return DescribeLocationAzureBlobResponse.fromJson(jsonResponse.body); + } + + /// Provides details about how an DataSync transfer location for an Amazon EFS + /// file system is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1427,8 +1634,8 @@ class DataSync { return DescribeLocationEfsResponse.fromJson(jsonResponse.body); } - /// Provides details about how an DataSync location for an Amazon FSx for - /// Lustre file system is configured. + /// Provides details about how an DataSync transfer location for an Amazon FSx + /// for Lustre file system is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -1456,8 +1663,8 @@ class DataSync { return DescribeLocationFsxLustreResponse.fromJson(jsonResponse.body); } - /// Provides details about how an DataSync location for an Amazon FSx for - /// NetApp ONTAP file system is configured. + /// Provides details about how an DataSync transfer location for an Amazon FSx + /// for NetApp ONTAP file system is configured. /// /// If your location uses SMB, the DescribeLocationFsxOntap /// operation doesn't actually return a Password. @@ -1490,8 +1697,8 @@ class DataSync { return DescribeLocationFsxOntapResponse.fromJson(jsonResponse.body); } - /// Provides details about how an DataSync location for an Amazon FSx for - /// OpenZFS file system is configured. + /// Provides details about how an DataSync transfer location for an Amazon FSx + /// for OpenZFS file system is configured. /// /// Response elements related to SMB aren't supported with the /// DescribeLocationFsxOpenZfs operation. @@ -1524,15 +1731,15 @@ class DataSync { return DescribeLocationFsxOpenZfsResponse.fromJson(jsonResponse.body); } - /// Returns metadata about an Amazon FSx for Windows File Server location, - /// such as information about its path. + /// Provides details about how an DataSync transfer location for an Amazon FSx + /// for Windows File Server file system is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the FSx for Windows File Server location - /// to describe. + /// Specifies the Amazon Resource Name (ARN) of the FSx for Windows File + /// Server location. Future describeLocationFsxWindows({ required String locationArn, }) async { @@ -1554,14 +1761,14 @@ class DataSync { return DescribeLocationFsxWindowsResponse.fromJson(jsonResponse.body); } - /// Returns metadata, such as the authentication information about the Hadoop - /// Distributed File System (HDFS) location. + /// Provides details about how an DataSync transfer location for a Hadoop + /// Distributed File System (HDFS) is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the HDFS cluster location to describe. + /// Specifies the Amazon Resource Name (ARN) of the HDFS location. Future describeLocationHdfs({ required String locationArn, }) async { @@ -1583,13 +1790,15 @@ class DataSync { return DescribeLocationHdfsResponse.fromJson(jsonResponse.body); } - /// Returns metadata, such as the path information, about an NFS location. + /// Provides details about how an DataSync transfer location for a Network + /// File System (NFS) file server is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the NFS location to describe. + /// Specifies the Amazon Resource Name (ARN) of the NFS location that you want + /// information about. Future describeLocationNfs({ required String locationArn, }) async { @@ -1611,15 +1820,15 @@ class DataSync { return DescribeLocationNfsResponse.fromJson(jsonResponse.body); } - /// Returns metadata about your DataSync location for an object storage - /// system. + /// Provides details about how an DataSync transfer location for an object + /// storage system is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the object storage system location that - /// you want information about. + /// Specifies the Amazon Resource Name (ARN) of the object storage system + /// location. Future describeLocationObjectStorage({ required String locationArn, }) async { @@ -1641,14 +1850,14 @@ class DataSync { return DescribeLocationObjectStorageResponse.fromJson(jsonResponse.body); } - /// Returns metadata, such as bucket name, about an Amazon S3 bucket location. + /// Provides details about how an DataSync transfer location for an S3 bucket + /// is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the Amazon S3 bucket location to - /// describe. + /// Specifies the Amazon Resource Name (ARN) of the Amazon S3 location. Future describeLocationS3({ required String locationArn, }) async { @@ -1670,14 +1879,15 @@ class DataSync { return DescribeLocationS3Response.fromJson(jsonResponse.body); } - /// Returns metadata, such as the path and user information about an SMB - /// location. + /// Provides details about how an DataSync transfer location for a Server + /// Message Block (SMB) file server is configured. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the SMB location to describe. + /// Specifies the Amazon Resource Name (ARN) of the SMB location that you want + /// information about. Future describeLocationSmb({ required String locationArn, }) async { @@ -1875,13 +2085,15 @@ class DataSync { return DescribeStorageSystemResourcesResponse.fromJson(jsonResponse.body); } - /// Returns metadata about a task. + /// Provides information about a task, which defines where and how + /// DataSync transfers your data. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [taskArn] : - /// The Amazon Resource Name (ARN) of the task to describe. + /// Specifies the Amazon Resource Name (ARN) of the transfer task that you + /// want information about. Future describeTask({ required String taskArn, }) async { @@ -1903,13 +2115,16 @@ class DataSync { return DescribeTaskResponse.fromJson(jsonResponse.body); } - /// Returns detailed metadata about a task that is being executed. + /// Provides information about an execution of your DataSync task. You can use + /// this operation to help monitor the progress of an ongoing transfer or + /// check the results of the transfer. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [taskExecutionArn] : - /// The Amazon Resource Name (ARN) of the task that is being executed. + /// Specifies the Amazon Resource Name (ARN) of the task execution that you + /// want information about. Future describeTaskExecution({ required String taskExecutionArn, }) async { @@ -1941,12 +2156,6 @@ class DataSync { /// Once generated, you can view your recommendations by using the DescribeStorageSystemResources /// operation. - /// - /// If your discovery - /// job completes successfully, you don't need to use this operation. - /// DataSync Discovery generates the recommendations for you automatically. - /// /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -2230,20 +2439,21 @@ class DataSync { return ListTagsForResourceResponse.fromJson(jsonResponse.body); } - /// Returns a list of executed tasks. + /// Returns a list of executions for an DataSync transfer task. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [maxResults] : - /// The maximum number of executed tasks to list. + /// Specifies how many results you want in the response. /// /// Parameter [nextToken] : - /// An opaque string that indicates the position at which to begin the next - /// list of the executed tasks. + /// Specifies an opaque string that indicates the position at which to begin + /// the next list of results in the response. /// /// Parameter [taskArn] : - /// The Amazon Resource Name (ARN) of the task whose tasks you want to list. + /// Specifies the Amazon Resource Name (ARN) of the task that you want + /// execution information about. Future listTaskExecutions({ int? maxResults, String? nextToken, @@ -2417,7 +2627,7 @@ class DataSync { return StartDiscoveryJobResponse.fromJson(jsonResponse.body); } - /// Starts an DataSync task. For each task, you can only run one task + /// Starts an DataSync transfer task. For each task, you can only run one task /// execution at a time. /// /// There are several phases to a task execution. For more information, see "/folder1|/folder2". /// + /// Parameter [manifestConfig] : + /// Configures a manifest, which is a list of files or objects that you want + /// DataSync to transfer. For more information and configuration examples, see + /// Specifying + /// what DataSync transfers by using a manifest. + /// + /// When using this parameter, your caller identity (the role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. + /// + /// To remove a manifest configuration, specify this parameter with an empty + /// value. + /// /// Parameter [tags] : /// Specifies the tags that you want to apply to the Amazon Resource Name /// (ARN) representing the task execution. /// /// Tags are key-value pairs that help you manage, filter, and search /// for your DataSync resources. + /// + /// Parameter [taskReportConfig] : + /// Specifies how you want to configure a task report, which provides detailed + /// information about your DataSync transfer. For more information, see Monitoring + /// your DataSync transfers with task reports. + /// + /// When using this parameter, your caller identity (the role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. + /// + /// To remove a task report configuration, specify this parameter as empty. Future startTaskExecution({ required String taskArn, List? excludes, List? includes, + ManifestConfig? manifestConfig, Options? overrideOptions, List? tags, + TaskReportConfig? taskReportConfig, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -2478,8 +2720,10 @@ class DataSync { 'TaskArn': taskArn, if (excludes != null) 'Excludes': excludes, if (includes != null) 'Includes': includes, + if (manifestConfig != null) 'ManifestConfig': manifestConfig, if (overrideOptions != null) 'OverrideOptions': overrideOptions, if (tags != null) 'Tags': tags, + if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig, }, ); @@ -2589,7 +2833,7 @@ class DataSync { ); } - /// Updates the name of an agent. + /// Updates the name of an DataSync agent. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -2661,6 +2905,83 @@ class DataSync { ); } + /// Modifies some configurations of the Microsoft Azure Blob Storage transfer + /// location that you're using with DataSync. + /// + /// May throw [InvalidRequestException]. + /// May throw [InternalException]. + /// + /// Parameter [locationArn] : + /// Specifies the ARN of the Azure Blob Storage transfer location that you're + /// updating. + /// + /// Parameter [accessTier] : + /// Specifies the access tier that you want your objects or files transferred + /// into. This only applies when using the location as a transfer destination. + /// For more information, see Access + /// tiers. + /// + /// Parameter [agentArns] : + /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that can + /// connect with your Azure Blob Storage container. + /// + /// You can specify more than one agent. For more information, see Using + /// multiple agents for your transfer. + /// + /// Parameter [authenticationType] : + /// Specifies the authentication method DataSync uses to access your Azure + /// Blob Storage. DataSync can access blob storage using a shared access + /// signature (SAS). + /// + /// Parameter [blobType] : + /// Specifies the type of blob that you want your objects or files to be when + /// transferring them into Azure Blob Storage. Currently, DataSync only + /// supports moving data into Azure Blob Storage as block blobs. For more + /// information on blob types, see the Azure + /// Blob Storage documentation. + /// + /// Parameter [sasConfiguration] : + /// Specifies the SAS configuration that allows DataSync to access your Azure + /// Blob Storage. + /// + /// Parameter [subdirectory] : + /// Specifies path segments if you want to limit your transfer to a virtual + /// directory in your container (for example, /my/images). + Future updateLocationAzureBlob({ + required String locationArn, + AzureAccessTier? accessTier, + List? agentArns, + AzureBlobAuthenticationType? authenticationType, + AzureBlobType? blobType, + AzureBlobSasConfiguration? sasConfiguration, + String? subdirectory, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'FmrsService.UpdateLocationAzureBlob' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'LocationArn': locationArn, + if (accessTier != null) 'AccessTier': accessTier.toValue(), + if (agentArns != null) 'AgentArns': agentArns, + if (authenticationType != null) + 'AuthenticationType': authenticationType.toValue(), + if (blobType != null) 'BlobType': blobType.toValue(), + if (sasConfiguration != null) 'SasConfiguration': sasConfiguration, + if (subdirectory != null) 'Subdirectory': subdirectory, + }, + ); + } + /// Updates some parameters of a previously created location for a Hadoop /// Distributed File System cluster. /// @@ -2777,45 +3098,28 @@ class DataSync { ); } - /// Updates some of the parameters of a previously created location for - /// Network File System (NFS) access. For information about creating an NFS - /// location, see Creating - /// a location for NFS. + /// Modifies some configurations of the Network File System (NFS) transfer + /// location that you're using with DataSync. + /// + /// For more information, see Configuring + /// transfers to or from an NFS file server. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the NFS location to update. + /// Specifies the Amazon Resource Name (ARN) of the NFS transfer location that + /// you want to update. /// /// Parameter [subdirectory] : - /// The subdirectory in the NFS file system that is used to read data from the - /// NFS source location or write data to the NFS destination. The NFS path - /// should be a path that's exported by the NFS server, or a subdirectory of - /// that path. The path should be such that it can be mounted by other NFS - /// clients in your network. - /// - /// To see all the paths exported by your NFS server, run "showmount -e - /// nfs-server-name" from an NFS client that has access to your server. - /// You can specify any directory that appears in the results, and any - /// subdirectory of that directory. Ensure that the NFS export is accessible - /// without Kerberos authentication. - /// - /// To transfer all the data in the folder that you specified, DataSync must - /// have permissions to read all the data. To ensure this, either configure - /// the NFS export with no_root_squash, or ensure that the files - /// you want DataSync to access have permissions that allow read access for - /// all users. Doing either option enables the agent to read the files. For - /// the agent to access directories, you must additionally enable all execute - /// access. - /// - /// If you are copying data to or from your Snowcone device, see NFS - /// Server on Snowcone for more information. - /// - /// For information about NFS export configuration, see 18.7. The /etc/exports - /// Configuration File in the Red Hat Enterprise Linux documentation. + /// Specifies the export path in your NFS file server that you want DataSync + /// to mount. + /// + /// This path (or a subdirectory of the path) is where DataSync transfers data + /// to or from. For information on configuring an export for DataSync, see Accessing + /// NFS file servers. Future updateLocationNfs({ required String locationArn, NfsMountOptions? mountOptions, @@ -2841,11 +3145,8 @@ class DataSync { ); } - /// Updates some parameters of an existing object storage location that - /// DataSync accesses for a transfer. For information about creating a - /// self-managed object storage location, see Creating - /// a location for object storage. + /// Updates some parameters of an existing DataSync location for an object + /// storage system. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. @@ -2867,16 +3168,38 @@ class DataSync { /// required to authenticate with the object storage server. /// /// Parameter [serverCertificate] : - /// Specifies a certificate to authenticate with an object storage system that - /// uses a private or self-signed certificate authority (CA). You must specify - /// a Base64-encoded .pem file (for example, - /// file:///home/user/.ssh/storage_sys_certificate.pem). The - /// certificate can be up to 32768 bytes (before Base64 encoding). + /// Specifies a certificate chain for DataSync to authenticate with your + /// object storage system if the system uses a private or self-signed + /// certificate authority (CA). You must specify a single .pem + /// file with a full certificate chain (for example, + /// file:///home/user/.ssh/object_storage_certificates.pem). + /// + /// The certificate chain might include: + /// + ///
            + ///
          • + /// The object storage system's certificate + ///
          • + ///
          • + /// All intermediate certificates (if there are any) + ///
          • + ///
          • + /// The root certificate of the signing CA + ///
          • + ///
          + /// You can concatenate your certificates into a .pem file (which + /// can be up to 32768 bytes before base64 encoding). The following example + /// cat command creates an + /// object_storage_certificates.pem file that includes three + /// certificates: + /// + /// cat object_server_certificate.pem intermediate_certificate.pem + /// ca_root_certificate.pem > object_storage_certificates.pem /// /// To use this parameter, configure ServerProtocol to /// HTTPS. /// - /// Updating the certificate doesn't interfere with tasks that you have in + /// Updating this parameter doesn't interfere with tasks that you have in /// progress. /// /// Parameter [serverPort] : @@ -2931,60 +3254,58 @@ class DataSync { ); } - /// Updates some of the parameters of a previously created location for Server - /// Message Block (SMB) file system access. For information about creating an - /// SMB location, see Creating - /// a location for SMB. + /// Updates some of the parameters of a Server Message Block (SMB) file server + /// location that you can use for DataSync transfers. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [locationArn] : - /// The Amazon Resource Name (ARN) of the SMB location to update. + /// Specifies the ARN of the SMB location that you want to update. /// /// Parameter [agentArns] : - /// The Amazon Resource Names (ARNs) of agents to use for a Simple Message - /// Block (SMB) location. + /// Specifies the DataSync agent (or agents) which you want to connect to your + /// SMB file server. You specify an agent by using its Amazon Resource Name + /// (ARN). /// /// Parameter [domain] : - /// The name of the Windows domain that the SMB server belongs to. + /// Specifies the Windows domain name that your SMB file server belongs to. /// - /// Parameter [password] : - /// The password of the user who can mount the share has the permissions to - /// access files and folders in the SMB share. + /// If you have multiple domains in your environment, configuring this + /// parameter makes sure that DataSync connects to the right file server. /// - /// Parameter [subdirectory] : - /// The subdirectory in the SMB file system that is used to read data from the - /// SMB source location or write data to the SMB destination. The SMB path - /// should be a path that's exported by the SMB server, or a subdirectory of - /// that path. The path should be such that it can be mounted by other SMB - /// clients in your network. - /// - /// Subdirectory must be specified with forward slashes. For - /// example, /path/to/folder. - /// - /// To transfer all the data in the folder that you specified, DataSync must - /// have permissions to mount the SMB share and to access all the data in that - /// share. To ensure this, do either of the following: + /// For more information, see required + /// permissions for SMB locations. /// - ///
            - ///
          • - /// Ensure that the user/password specified belongs to the user who can mount - /// the share and who has the appropriate permissions for all of the files and - /// directories that you want DataSync to access. - ///
          • - ///
          • - /// Use credentials of a member of the Backup Operators group to mount the - /// share. - ///
          • - ///
          - /// Doing either of these options enables the agent to access the data. For - /// the agent to access directories, you must also enable all execute access. + /// Parameter [password] : + /// Specifies the password of the user who can mount your SMB file server and + /// has permission to access the files and folders involved in your transfer. + /// + /// For more information, see required + /// permissions for SMB locations. + /// + /// Parameter [subdirectory] : + /// Specifies the name of the share exported by your SMB file server where + /// DataSync will read or write data. You can include a subdirectory in the + /// share path (for example, /path/to/subdirectory). Make sure + /// that other SMB clients in your network can also mount this path. + /// + /// To copy all data in the specified subdirectory, DataSync must be able to + /// mount the SMB share and access all of its data. For more information, see + /// required + /// permissions for SMB locations. /// /// Parameter [user] : - /// The user who can mount the share has the permissions to access files and - /// folders in the SMB share. + /// Specifies the user name that can mount your SMB file server and has + /// permission to access the files and folders involved in your transfer. + /// + /// For information about choosing a user with the right level of access for + /// your transfer, see required + /// permissions for SMB locations. Future updateLocationSmb({ required String locationArn, List? agentArns, @@ -3028,7 +3349,8 @@ class DataSync { /// /// Parameter [agentArns] : /// Specifies the Amazon Resource Name (ARN) of the DataSync agent that - /// connects to and reads your on-premises storage system. + /// connects to and reads your on-premises storage system. You can only + /// specify one ARN. /// /// Parameter [cloudWatchLogGroupArn] : /// Specifies the ARN of the Amazon CloudWatch log group for monitoring and @@ -3075,49 +3397,80 @@ class DataSync { ); } - /// Updates the metadata associated with a task. + /// Updates the configuration of a task, which defines where and how + /// DataSync transfers your data. /// /// May throw [InvalidRequestException]. /// May throw [InternalException]. /// /// Parameter [taskArn] : - /// The Amazon Resource Name (ARN) of the resource name of the task to update. + /// Specifies the ARN of the task that you want to update. /// /// Parameter [cloudWatchLogGroupArn] : - /// The Amazon Resource Name (ARN) of the resource name of the Amazon - /// CloudWatch log group. + /// Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group + /// for monitoring your task. /// /// Parameter [excludes] : - /// Specifies a list of filter rules that exclude specific data during your - /// transfer. For more information and examples, see Filtering - /// data transferred by DataSync. + /// Specifies exclude filters that define the files, objects, and folders in + /// your source location that you don't want DataSync to transfer. For more + /// information and examples, see Specifying + /// what DataSync transfers by using filters. /// /// Parameter [includes] : - /// Specifies a list of filter rules that include specific data during your - /// transfer. For more information and examples, see Filtering - /// data transferred by DataSync. + /// Specifies include filters define the files, objects, and folders in your + /// source location that you want DataSync to transfer. For more information + /// and examples, see Specifying + /// what DataSync transfers by using filters. + /// + /// Parameter [manifestConfig] : + /// Configures a manifest, which is a list of files or objects that you want + /// DataSync to transfer. For more information and configuration examples, see + /// Specifying + /// what DataSync transfers by using a manifest. + /// + /// When using this parameter, your caller identity (the IAM role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. + /// + /// To remove a manifest configuration, specify this parameter as empty. /// /// Parameter [name] : - /// The name of the task to update. + /// Specifies the name of your task. /// /// Parameter [schedule] : - /// Specifies a schedule used to periodically transfer files from a source to - /// a destination location. You can configure your task to execute hourly, - /// daily, weekly or on specific days of the week. You control when in the day - /// or hour you want the task to execute. The time you specify is UTC time. - /// For more information, see Scheduling /// your task. + /// + /// Parameter [taskReportConfig] : + /// Specifies how you want to configure a task report, which provides detailed + /// information about your DataSync transfer. For more information, see Monitoring + /// your DataSync transfers with task reports. + /// + /// When using this parameter, your caller identity (the IAM role that you're + /// using DataSync with) must have the iam:PassRole permission. + /// The AWSDataSyncFullAccess + /// policy includes this permission. + /// + /// To remove a task report configuration, specify this parameter as empty. Future updateTask({ required String taskArn, String? cloudWatchLogGroupArn, List? excludes, List? includes, + ManifestConfig? manifestConfig, String? name, Options? options, TaskSchedule? schedule, + TaskReportConfig? taskReportConfig, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', @@ -3135,19 +3488,21 @@ class DataSync { 'CloudWatchLogGroupArn': cloudWatchLogGroupArn, if (excludes != null) 'Excludes': excludes, if (includes != null) 'Includes': includes, + if (manifestConfig != null) 'ManifestConfig': manifestConfig, if (name != null) 'Name': name, if (options != null) 'Options': options, if (schedule != null) 'Schedule': schedule, + if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig, }, ); } - /// Modifies a running DataSync task. + /// Updates the configuration of a running DataSync task execution. /// /// Currently, the only Option that you can modify with /// UpdateTaskExecution is BytesPerSecond - /// , which throttles bandwidth for a running or queued task. + /// , which throttles bandwidth for a running or queued task execution. /// /// /// May throw [InvalidRequestException]. @@ -3212,14 +3567,30 @@ class AgentListEntry { /// The name of an agent. final String? name; - /// The status of an agent. For more information, see DataSync - /// agent statuses. + /// The platform-related details about the agent, such as the version number. + final Platform? platform; + + /// The status of an agent. + /// + ///
            + ///
          • + /// If the status is ONLINE, the agent is configured properly and + /// ready to use. + ///
          • + ///
          • + /// If the status is OFFLINE, the agent has been out of contact + /// with DataSync for five minutes or longer. This can happen for a few reasons. + /// For more information, see What + /// do I do if my agent is offline? + ///
          • + ///
          final AgentStatus? status; AgentListEntry({ this.agentArn, this.name, + this.platform, this.status, }); @@ -3227,6 +3598,9 @@ class AgentListEntry { return AgentListEntry( agentArn: json['AgentArn'] as String?, name: json['Name'] as String?, + platform: json['Platform'] != null + ? Platform.fromJson(json['Platform'] as Map) + : null, status: (json['Status'] as String?)?.toAgentStatus(), ); } @@ -3234,10 +3608,12 @@ class AgentListEntry { Map toJson() { final agentArn = this.agentArn; final name = this.name; + final platform = this.platform; final status = this.status; return { if (agentArn != null) 'AgentArn': agentArn, if (name != null) 'Name': name, + if (platform != null) 'Platform': platform, if (status != null) 'Status': status.toValue(), }; } @@ -3299,6 +3675,114 @@ extension AtimeFromString on String { } } +enum AzureAccessTier { + hot, + cool, + archive, +} + +extension AzureAccessTierValueExtension on AzureAccessTier { + String toValue() { + switch (this) { + case AzureAccessTier.hot: + return 'HOT'; + case AzureAccessTier.cool: + return 'COOL'; + case AzureAccessTier.archive: + return 'ARCHIVE'; + } + } +} + +extension AzureAccessTierFromString on String { + AzureAccessTier toAzureAccessTier() { + switch (this) { + case 'HOT': + return AzureAccessTier.hot; + case 'COOL': + return AzureAccessTier.cool; + case 'ARCHIVE': + return AzureAccessTier.archive; + } + throw Exception('$this is not known in enum AzureAccessTier'); + } +} + +enum AzureBlobAuthenticationType { + sas, +} + +extension AzureBlobAuthenticationTypeValueExtension + on AzureBlobAuthenticationType { + String toValue() { + switch (this) { + case AzureBlobAuthenticationType.sas: + return 'SAS'; + } + } +} + +extension AzureBlobAuthenticationTypeFromString on String { + AzureBlobAuthenticationType toAzureBlobAuthenticationType() { + switch (this) { + case 'SAS': + return AzureBlobAuthenticationType.sas; + } + throw Exception('$this is not known in enum AzureBlobAuthenticationType'); + } +} + +/// The shared access signature (SAS) configuration that allows DataSync to +/// access your Microsoft Azure Blob Storage. +/// +/// For more information, see SAS +/// tokens for accessing your Azure Blob Storage. +class AzureBlobSasConfiguration { + /// Specifies a SAS token that provides permissions to access your Azure Blob + /// Storage. + /// + /// The token is part of the SAS URI string that comes after the storage + /// resource URI and a question mark. A token looks something like this: + /// + /// sp=r&st=2023-12-20T14:54:52Z&se=2023-12-20T22:54:52Z&spr=https&sv=2021-06-08&sr=c&sig=aBBKDWQvyuVcTPH9EBp%2FXTI9E%2F%2Fmq171%2BZU178wcwqU%3D + final String token; + + AzureBlobSasConfiguration({ + required this.token, + }); + + Map toJson() { + final token = this.token; + return { + 'Token': token, + }; + } +} + +enum AzureBlobType { + block, +} + +extension AzureBlobTypeValueExtension on AzureBlobType { + String toValue() { + switch (this) { + case AzureBlobType.block: + return 'BLOCK'; + } + } +} + +extension AzureBlobTypeFromString on String { + AzureBlobType toAzureBlobType() { + switch (this) { + case 'BLOCK': + return AzureBlobType.block; + } + throw Exception('$this is not known in enum AzureBlobType'); + } +} + class CancelTaskExecutionResponse { CancelTaskExecutionResponse(); @@ -3314,6 +3798,10 @@ class CancelTaskExecutionResponse { /// The storage capacity of an on-premises storage system resource (for example, /// a volume). class Capacity { + /// The amount of space in the cluster that's in cloud storage (for example, if + /// you're using data tiering). + final int? clusterCloudStorageUsed; + /// The amount of space that's being used in a storage system resource without /// accounting for compression or deduplication. final int? logicalUsed; @@ -3325,6 +3813,7 @@ class Capacity { final int? used; Capacity({ + this.clusterCloudStorageUsed, this.logicalUsed, this.provisioned, this.used, @@ -3332,6 +3821,7 @@ class Capacity { factory Capacity.fromJson(Map json) { return Capacity( + clusterCloudStorageUsed: json['ClusterCloudStorageUsed'] as int?, logicalUsed: json['LogicalUsed'] as int?, provisioned: json['Provisioned'] as int?, used: json['Used'] as int?, @@ -3339,10 +3829,13 @@ class Capacity { } Map toJson() { + final clusterCloudStorageUsed = this.clusterCloudStorageUsed; final logicalUsed = this.logicalUsed; final provisioned = this.provisioned; final used = this.used; return { + if (clusterCloudStorageUsed != null) + 'ClusterCloudStorageUsed': clusterCloudStorageUsed, if (logicalUsed != null) 'LogicalUsed': logicalUsed, if (provisioned != null) 'Provisioned': provisioned, if (used != null) 'Used': used, @@ -3352,9 +3845,10 @@ class Capacity { /// CreateAgentResponse class CreateAgentResponse { - /// The Amazon Resource Name (ARN) of the agent. Use the ListAgents - /// operation to return a list of agents for your account and Amazon Web - /// Services Region. + /// The ARN of the agent that you just activated. Use the ListAgents + /// operation to return a list of agents in your Amazon Web Services account and + /// Amazon Web Services Region. final String? agentArn; CreateAgentResponse({ @@ -3375,6 +3869,28 @@ class CreateAgentResponse { } } +class CreateLocationAzureBlobResponse { + /// The ARN of the Azure Blob Storage transfer location that you created. + final String? locationArn; + + CreateLocationAzureBlobResponse({ + this.locationArn, + }); + + factory CreateLocationAzureBlobResponse.fromJson(Map json) { + return CreateLocationAzureBlobResponse( + locationArn: json['LocationArn'] as String?, + ); + } + + Map toJson() { + final locationArn = this.locationArn; + return { + if (locationArn != null) 'LocationArn': locationArn, + }; + } +} + /// CreateLocationEfs class CreateLocationEfsResponse { /// The Amazon Resource Name (ARN) of the Amazon EFS file system location that @@ -3512,8 +4028,7 @@ class CreateLocationHdfsResponse { /// CreateLocationNfsResponse class CreateLocationNfsResponse { - /// The Amazon Resource Name (ARN) of the source NFS file system location that - /// is created. + /// The ARN of the transfer location that you created for your NFS file server. final String? locationArn; CreateLocationNfsResponse({ @@ -3560,8 +4075,7 @@ class CreateLocationObjectStorageResponse { /// CreateLocationS3Response class CreateLocationS3Response { - /// The Amazon Resource Name (ARN) of the source Amazon S3 bucket location that - /// is created. + /// The ARN of the S3 location that you created. final String? locationArn; CreateLocationS3Response({ @@ -3699,28 +4213,44 @@ class DescribeAgentResponse { /// The ARN of the agent. final String? agentArn; - /// The time that the agent was activated (that is, created in your account). + /// The time that the agent was activated. final DateTime? creationTime; - /// The type of endpoint that your agent is connected to. If the endpoint is a - /// VPC endpoint, the agent is not accessible over the public internet. + /// The type of service + /// endpoint that your agent is connected to. final EndpointType? endpointType; - /// The time that the agent last connected to DataSync. + /// The last time that the agent was communicating with the DataSync service. final DateTime? lastConnectionTime; /// The name of the agent. final String? name; - /// The subnet and the security group that DataSync used to access a VPC - /// endpoint. + /// The platform-related details about the agent, such as the version number. + final Platform? platform; + + /// The network configuration that the agent uses when connecting to a VPC + /// service endpoint. final PrivateLinkConfig? privateLinkConfig; - /// The status of the agent. If the status is ONLINE, then the agent is - /// configured properly and is available to use. The Running status is the - /// normal running status for an agent. If the status is OFFLINE, the agent's VM - /// is turned off or the agent is in an unhealthy state. When the issue that - /// caused the unhealthy state is resolved, the agent returns to ONLINE status. + /// The status of the agent. + /// + ///
            + ///
          • + /// If the status is ONLINE, the agent is configured properly and + /// ready to use. + ///
          • + ///
          • + /// If the status is OFFLINE, the agent has been out of contact + /// with DataSync for five minutes or longer. This can happen for a few reasons. + /// For more information, see What + /// do I do if my agent is offline? + ///
          • + ///
          final AgentStatus? status; DescribeAgentResponse({ @@ -3729,6 +4259,7 @@ class DescribeAgentResponse { this.endpointType, this.lastConnectionTime, this.name, + this.platform, this.privateLinkConfig, this.status, }); @@ -3740,6 +4271,9 @@ class DescribeAgentResponse { endpointType: (json['EndpointType'] as String?)?.toEndpointType(), lastConnectionTime: timeStampFromJson(json['LastConnectionTime']), name: json['Name'] as String?, + platform: json['Platform'] != null + ? Platform.fromJson(json['Platform'] as Map) + : null, privateLinkConfig: json['PrivateLinkConfig'] != null ? PrivateLinkConfig.fromJson( json['PrivateLinkConfig'] as Map) @@ -3754,6 +4288,7 @@ class DescribeAgentResponse { final endpointType = this.endpointType; final lastConnectionTime = this.lastConnectionTime; final name = this.name; + final platform = this.platform; final privateLinkConfig = this.privateLinkConfig; final status = this.status; return { @@ -3764,6 +4299,7 @@ class DescribeAgentResponse { if (lastConnectionTime != null) 'LastConnectionTime': unixTimestampToJson(lastConnectionTime), if (name != null) 'Name': name, + if (platform != null) 'Platform': platform, if (privateLinkConfig != null) 'PrivateLinkConfig': privateLinkConfig, if (status != null) 'Status': status.toValue(), }; @@ -3832,6 +4368,88 @@ class DescribeDiscoveryJobResponse { } } +class DescribeLocationAzureBlobResponse { + /// The access tier that you want your objects or files transferred into. This + /// only applies when using the location as a transfer destination. For more + /// information, see Access + /// tiers. + final AzureAccessTier? accessTier; + + /// The ARNs of the DataSync agents that can connect with your Azure Blob + /// Storage container. + final List? agentArns; + + /// The authentication method DataSync uses to access your Azure Blob Storage. + /// DataSync can access blob storage using a shared access signature (SAS). + final AzureBlobAuthenticationType? authenticationType; + + /// The type of blob that you want your objects or files to be when transferring + /// them into Azure Blob Storage. Currently, DataSync only supports moving data + /// into Azure Blob Storage as block blobs. For more information on blob types, + /// see the Azure + /// Blob Storage documentation. + final AzureBlobType? blobType; + + /// The time that your Azure Blob Storage transfer location was created. + final DateTime? creationTime; + + /// The ARN of your Azure Blob Storage transfer location. + final String? locationArn; + + /// The URL of the Azure Blob Storage container involved in your transfer. + final String? locationUri; + + DescribeLocationAzureBlobResponse({ + this.accessTier, + this.agentArns, + this.authenticationType, + this.blobType, + this.creationTime, + this.locationArn, + this.locationUri, + }); + + factory DescribeLocationAzureBlobResponse.fromJson( + Map json) { + return DescribeLocationAzureBlobResponse( + accessTier: (json['AccessTier'] as String?)?.toAzureAccessTier(), + agentArns: (json['AgentArns'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + authenticationType: (json['AuthenticationType'] as String?) + ?.toAzureBlobAuthenticationType(), + blobType: (json['BlobType'] as String?)?.toAzureBlobType(), + creationTime: timeStampFromJson(json['CreationTime']), + locationArn: json['LocationArn'] as String?, + locationUri: json['LocationUri'] as String?, + ); + } + + Map toJson() { + final accessTier = this.accessTier; + final agentArns = this.agentArns; + final authenticationType = this.authenticationType; + final blobType = this.blobType; + final creationTime = this.creationTime; + final locationArn = this.locationArn; + final locationUri = this.locationUri; + return { + if (accessTier != null) 'AccessTier': accessTier.toValue(), + if (agentArns != null) 'AgentArns': agentArns, + if (authenticationType != null) + 'AuthenticationType': authenticationType.toValue(), + if (blobType != null) 'BlobType': blobType.toValue(), + if (creationTime != null) + 'CreationTime': unixTimestampToJson(creationTime), + if (locationArn != null) 'LocationArn': locationArn, + if (locationUri != null) 'LocationUri': locationUri, + }; + } +} + /// DescribeLocationEfsResponse class DescribeLocationEfsResponse { /// The ARN of the access point that DataSync uses to access the Amazon EFS file @@ -4092,23 +4710,23 @@ class DescribeLocationFsxWindowsResponse { /// The time that the FSx for Windows File Server location was created. final DateTime? creationTime; - /// The name of the Windows domain that the FSx for Windows File Server belongs - /// to. + /// The name of the Microsoft Active Directory domain that the FSx for Windows + /// File Server file system belongs to. final String? domain; - /// The Amazon Resource Name (ARN) of the FSx for Windows File Server location - /// that was described. + /// The ARN of the FSx for Windows File Server location. final String? locationArn; - /// The URL of the FSx for Windows File Server location that was described. + /// The uniform resource identifier (URI) of the FSx for Windows File Server + /// location. final String? locationUri; - /// The Amazon Resource Names (ARNs) of the security groups that are configured - /// for the FSx for Windows File Server file system. + /// The ARNs of the security groups that are configured for the FSx for Windows + /// File Server file system. final List? securityGroupArns; - /// The user who has the permissions to access files and folders in the FSx for - /// Windows File Server file system. + /// The user with the permissions to mount and access the FSx for Windows File + /// Server file system. final String? user; DescribeLocationFsxWindowsResponse({ @@ -4155,7 +4773,7 @@ class DescribeLocationFsxWindowsResponse { } class DescribeLocationHdfsResponse { - /// The ARNs of the agents that are used to connect to the HDFS cluster. + /// The ARNs of the DataSync agents that can connect with your HDFS cluster. final List? agentArns; /// The type of authentication used to determine the identity of the user. @@ -4175,25 +4793,25 @@ class DescribeLocationHdfsResponse { /// The URI of the HDFS cluster's Key Management Server (KMS). final String? kmsKeyProviderUri; - /// The ARN of the HDFS cluster location. + /// The ARN of the HDFS location. final String? locationArn; - /// The URI of the HDFS cluster location. + /// The URI of the HDFS location. final String? locationUri; - /// The NameNode that manage the HDFS namespace. + /// The NameNode that manages the HDFS namespace. final List? nameNodes; - /// The Quality of Protection (QOP) configuration specifies the Remote Procedure - /// Call (RPC) and data transfer protection settings configured on the Hadoop - /// Distributed File System (HDFS) cluster. + /// The Quality of Protection (QOP) configuration, which specifies the Remote + /// Procedure Call (RPC) and data transfer protection settings configured on the + /// HDFS cluster. final QopConfiguration? qopConfiguration; /// The number of DataNodes to replicate the data to when writing to the HDFS /// cluster. final int? replicationFactor; - /// The user name used to identify the client on the host operating system. This + /// The user name to identify the client on the host operating system. This /// parameter is used if the AuthenticationType is defined as /// SIMPLE. final String? simpleUser; @@ -4274,16 +4892,16 @@ class DescribeLocationHdfsResponse { /// DescribeLocationNfsResponse class DescribeLocationNfsResponse { - /// The time that the NFS location was created. + /// The time when the NFS location was created. final DateTime? creationTime; - /// The Amazon Resource Name (ARN) of the NFS location that was described. + /// The ARN of the NFS location. final String? locationArn; - /// The URL of the source NFS location that was described. + /// The URI of the NFS location. final String? locationUri; - /// The NFS mount options that DataSync used to mount your NFS share. + /// The mount options that DataSync uses to mount your NFS file server. final NfsMountOptions? mountOptions; final OnPremConfig? onPremConfig; @@ -4333,8 +4951,8 @@ class DescribeLocationObjectStorageResponse { /// object storage system. final String? accessKey; - /// The ARNs of the DataSync agents that can securely connect with your - /// location. + /// The ARNs of the DataSync agents that can connect with your object storage + /// system. final List? agentArns; /// The time that the location was created. @@ -4343,11 +4961,12 @@ class DescribeLocationObjectStorageResponse { /// The ARN of the object storage system location. final String? locationArn; - /// The URL of the object storage system location. + /// The URI of the object storage system location. final String? locationUri; - /// The self-signed certificate that DataSync uses to securely authenticate with - /// your object storage system. + /// The certificate chain for DataSync to authenticate with your object storage + /// system if the system uses a private or self-signed certificate authority + /// (CA). final Uint8List? serverCertificate; /// The port that your object storage server accepts inbound network traffic on @@ -4413,32 +5032,31 @@ class DescribeLocationObjectStorageResponse { /// DescribeLocationS3Response class DescribeLocationS3Response { - /// If you are using DataSync on an Amazon Web Services Outpost, the Amazon - /// Resource Name (ARNs) of the EC2 agents deployed on your Outpost. For more - /// information about launching a DataSync agent on an Amazon Web Services - /// Outpost, see Deploy /// your DataSync agent on Outposts. final List? agentArns; - /// The time that the Amazon S3 bucket location was created. + /// The time that the Amazon S3 location was created. final DateTime? creationTime; - /// The Amazon Resource Name (ARN) of the Amazon S3 bucket or access point. + /// The ARN of the Amazon S3 location. final String? locationArn; /// The URL of the Amazon S3 location that was described. final String? locationUri; final S3Config? s3Config; - /// The Amazon S3 storage class that you chose to store your files in when this - /// location is used as a task destination. For more information about S3 - /// storage classes, see Amazon S3 Storage - /// Classes. Some storage classes have behaviors that can affect your S3 - /// storage cost. For detailed information, see Considerations - /// when working with S3 storage classes in DataSync. + /// When Amazon S3 is a destination location, this is the storage class that you + /// chose for your objects. + /// + /// Some storage classes have behaviors that can affect your Amazon S3 storage + /// costs. For more information, see Storage + /// class considerations with Amazon S3 transfers. final S3StorageClass? s3StorageClass; DescribeLocationS3Response({ @@ -4487,28 +5105,27 @@ class DescribeLocationS3Response { /// DescribeLocationSmbResponse class DescribeLocationSmbResponse { - /// The Amazon Resource Name (ARN) of the source SMB file system location that - /// is created. + /// The ARNs of the DataSync agents that can connect with your SMB file server. final List? agentArns; /// The time that the SMB location was created. final DateTime? creationTime; - /// The name of the Windows domain that the SMB server belongs to. + /// The name of the Microsoft Active Directory domain that the SMB file server + /// belongs to. final String? domain; - /// The Amazon Resource Name (ARN) of the SMB location that was described. + /// The ARN of the SMB location. final String? locationArn; - /// The URL of the source SMB location that was described. + /// The URI of the SMB location. final String? locationUri; - /// The mount options that are available for DataSync to use to access an SMB - /// location. + /// The protocol that DataSync use to access your SMB file. final SmbMountOptions? mountOptions; - /// The user who can mount the share, has the permissions to access files and - /// folders in the SMB share. + /// The user that can mount and access the files, folders, and file metadata in + /// your SMB file server. final String? user; DescribeLocationSmbResponse({ @@ -4757,20 +5374,25 @@ class DescribeTaskExecutionResponse { /// of bytes sent over the network, see BytesCompressed. final int? bytesTransferred; - /// The number of logical bytes written to the destination Amazon Web Services - /// storage resource. + /// The number of logical bytes written to the destination location. final int? bytesWritten; - /// The estimated physical number of bytes that is to be transferred over the - /// network. + /// The estimated physical number of bytes that will transfer over the network. final int? estimatedBytesToTransfer; - /// The expected number of files that is to be transferred over the network. - /// This value is calculated during the PREPARING phase before the - /// TRANSFERRING phase of the task execution. This value is the - /// expected number of files to be transferred. It's calculated based on - /// comparing the content of the source and destination locations and finding - /// the delta that needs to be transferred. + /// The expected number of files, objects, and directories that DataSync will + /// delete in your destination location. If you don't configure + /// your task to delete data in the destination that isn't in the source, + /// the value is always 0. + final int? estimatedFilesToDelete; + + /// The expected number of files, objects, and directories that DataSync will + /// transfer over the network. This value is calculated during the task + /// execution's PREPARING phase before the + /// TRANSFERRING phase. The calculation is based on comparing the + /// content of the source and destination locations and finding the difference + /// that needs to be transferred. final int? estimatedFilesToTransfer; /// A list of filter rules that exclude specific data during your transfer. For @@ -4779,39 +5401,67 @@ class DescribeTaskExecutionResponse { /// data transferred by DataSync. final List? excludes; - /// The actual number of files that was transferred over the network. This value - /// is calculated and updated on an ongoing basis during the - /// TRANSFERRING phase of the task execution. It's updated - /// periodically when each file is read from the source and sent over the - /// network. + /// The number of files, objects, and directories that DataSync deleted in your + /// destination location. If you don't configure + /// your task to delete data in the destination that isn't in the source, + /// the value is always 0. + final int? filesDeleted; + + /// The number of files, objects, and directories that DataSync skipped during + /// your transfer. + final int? filesSkipped; + + /// The actual number of files, objects, and directories that DataSync + /// transferred over the network. This value is updated periodically during the + /// task execution's TRANSFERRING phase when something is read from + /// the source and sent over the network. /// - /// If failures occur during a transfer, this value can be less than + /// If DataSync fails to transfer something, this value can be less than /// EstimatedFilesToTransfer. In some cases, this value can also be /// greater than EstimatedFilesToTransfer. This element is - /// implementation-specific for some location types, so don't use it as an - /// indicator for a correct file number or to monitor your task execution. + /// implementation-specific for some location types, so don't use it as an exact + /// indication of what transferred or to monitor your task execution. final int? filesTransferred; + /// The number of files, objects, and directories that DataSync verified during + /// your transfer. + /// + /// When you configure your task to verify + /// only the data that's transferred, DataSync doesn't verify directories in + /// some situations or files that fail to transfer. + /// + final int? filesVerified; + /// A list of filter rules that include specific data during your transfer. For /// more information and examples, see Filtering /// data transferred by DataSync. final List? includes; + + /// The configuration of the manifest that lists the files or objects to + /// transfer. For more information, see Specifying + /// what DataSync transfers by using a manifest. + final ManifestConfig? manifestConfig; final Options? options; + /// Indicates whether DataSync generated a complete task + /// report for your transfer. + final ReportResult? reportResult; + /// The result of the task execution. final TaskExecutionResultDetail? result; - /// The time that the task execution was started. + /// The time when the task execution started. final DateTime? startTime; /// The status of the task execution. - /// - /// For detailed information about task execution statuses, see Understanding - /// Task Statuses in the DataSync User Guide. final TaskExecutionStatus? status; - /// The Amazon Resource Name (ARN) of the task execution that was described. + /// The ARN of the task execution that you wanted information about. /// TaskExecutionArn is hierarchical and includes /// TaskArn for the task that was executed. /// @@ -4821,20 +5471,33 @@ class DescribeTaskExecutionResponse { /// arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2. final String? taskExecutionArn; + /// The configuration of your task report, which provides detailed information + /// about for your DataSync transfer. For more information, see Creating + /// a task report. + final TaskReportConfig? taskReportConfig; + DescribeTaskExecutionResponse({ this.bytesCompressed, this.bytesTransferred, this.bytesWritten, this.estimatedBytesToTransfer, + this.estimatedFilesToDelete, this.estimatedFilesToTransfer, this.excludes, + this.filesDeleted, + this.filesSkipped, this.filesTransferred, + this.filesVerified, this.includes, + this.manifestConfig, this.options, + this.reportResult, this.result, this.startTime, this.status, this.taskExecutionArn, + this.taskReportConfig, }); factory DescribeTaskExecutionResponse.fromJson(Map json) { @@ -4843,19 +5506,30 @@ class DescribeTaskExecutionResponse { bytesTransferred: json['BytesTransferred'] as int?, bytesWritten: json['BytesWritten'] as int?, estimatedBytesToTransfer: json['EstimatedBytesToTransfer'] as int?, + estimatedFilesToDelete: json['EstimatedFilesToDelete'] as int?, estimatedFilesToTransfer: json['EstimatedFilesToTransfer'] as int?, excludes: (json['Excludes'] as List?) ?.whereNotNull() .map((e) => FilterRule.fromJson(e as Map)) .toList(), + filesDeleted: json['FilesDeleted'] as int?, + filesSkipped: json['FilesSkipped'] as int?, filesTransferred: json['FilesTransferred'] as int?, + filesVerified: json['FilesVerified'] as int?, includes: (json['Includes'] as List?) ?.whereNotNull() .map((e) => FilterRule.fromJson(e as Map)) .toList(), + manifestConfig: json['ManifestConfig'] != null + ? ManifestConfig.fromJson( + json['ManifestConfig'] as Map) + : null, options: json['Options'] != null ? Options.fromJson(json['Options'] as Map) : null, + reportResult: json['ReportResult'] != null + ? ReportResult.fromJson(json['ReportResult'] as Map) + : null, result: json['Result'] != null ? TaskExecutionResultDetail.fromJson( json['Result'] as Map) @@ -4863,6 +5537,10 @@ class DescribeTaskExecutionResponse { startTime: timeStampFromJson(json['StartTime']), status: (json['Status'] as String?)?.toTaskExecutionStatus(), taskExecutionArn: json['TaskExecutionArn'] as String?, + taskReportConfig: json['TaskReportConfig'] != null + ? TaskReportConfig.fromJson( + json['TaskReportConfig'] as Map) + : null, ); } @@ -4871,115 +5549,148 @@ class DescribeTaskExecutionResponse { final bytesTransferred = this.bytesTransferred; final bytesWritten = this.bytesWritten; final estimatedBytesToTransfer = this.estimatedBytesToTransfer; + final estimatedFilesToDelete = this.estimatedFilesToDelete; final estimatedFilesToTransfer = this.estimatedFilesToTransfer; final excludes = this.excludes; + final filesDeleted = this.filesDeleted; + final filesSkipped = this.filesSkipped; final filesTransferred = this.filesTransferred; + final filesVerified = this.filesVerified; final includes = this.includes; + final manifestConfig = this.manifestConfig; final options = this.options; + final reportResult = this.reportResult; final result = this.result; final startTime = this.startTime; final status = this.status; final taskExecutionArn = this.taskExecutionArn; + final taskReportConfig = this.taskReportConfig; return { if (bytesCompressed != null) 'BytesCompressed': bytesCompressed, if (bytesTransferred != null) 'BytesTransferred': bytesTransferred, if (bytesWritten != null) 'BytesWritten': bytesWritten, if (estimatedBytesToTransfer != null) 'EstimatedBytesToTransfer': estimatedBytesToTransfer, + if (estimatedFilesToDelete != null) + 'EstimatedFilesToDelete': estimatedFilesToDelete, if (estimatedFilesToTransfer != null) 'EstimatedFilesToTransfer': estimatedFilesToTransfer, if (excludes != null) 'Excludes': excludes, + if (filesDeleted != null) 'FilesDeleted': filesDeleted, + if (filesSkipped != null) 'FilesSkipped': filesSkipped, if (filesTransferred != null) 'FilesTransferred': filesTransferred, + if (filesVerified != null) 'FilesVerified': filesVerified, if (includes != null) 'Includes': includes, + if (manifestConfig != null) 'ManifestConfig': manifestConfig, if (options != null) 'Options': options, + if (reportResult != null) 'ReportResult': reportResult, if (result != null) 'Result': result, if (startTime != null) 'StartTime': unixTimestampToJson(startTime), if (status != null) 'Status': status.toValue(), if (taskExecutionArn != null) 'TaskExecutionArn': taskExecutionArn, + if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig, }; } } /// DescribeTaskResponse class DescribeTaskResponse { - /// The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that was - /// used to monitor and log events in the task. + /// The Amazon Resource Name (ARN) of an Amazon CloudWatch log group for + /// monitoring your task. /// - /// For more information on these groups, see Working with Log Groups and Log - /// Streams in the Amazon CloudWatch User Guide. + /// For more information, see Monitoring + /// DataSync with Amazon CloudWatch. final String? cloudWatchLogGroupArn; /// The time that the task was created. final DateTime? creationTime; - /// The Amazon Resource Name (ARN) of the task execution that is transferring - /// files. + /// The ARN of the most recent task execution. final String? currentTaskExecutionArn; - /// The Amazon Resource Name (ARN) of the Amazon Web Services storage resource's - /// location. + /// The ARN of your transfer's destination location. final String? destinationLocationArn; - /// The Amazon Resource Names (ARNs) of the network interfaces created for your - /// destination location. For more information, see Network - /// interface requirements. + /// The ARNs of the network + /// interfaces that DataSync created for your destination location. final List? destinationNetworkInterfaceArns; - /// Errors that DataSync encountered during execution of the task. You can use - /// this error code to help troubleshoot issues. + /// If there's an issue with your task, you can use the error code to help you + /// troubleshoot the problem. For more information, see Troubleshooting + /// issues with DataSync transfers. final String? errorCode; - /// Detailed description of an error that was encountered during the task - /// execution. You can use this information to help troubleshoot issues. + /// If there's an issue with your task, you can use the error details to help + /// you troubleshoot the problem. For more information, see Troubleshooting + /// issues with DataSync transfers. final String? errorDetail; - /// A list of filter rules that exclude specific data during your transfer. For - /// more information and examples, see Filtering - /// data transferred by DataSync. + /// The exclude filters that define the files, objects, and folders in your + /// source location that you don't want DataSync to transfer. For more + /// information and examples, see Specifying + /// what DataSync transfers by using filters. final List? excludes; - /// A list of filter rules that include specific data during your transfer. For - /// more information and examples, see Filtering - /// data transferred by DataSync. + /// The include filters that define the files, objects, and folders in your + /// source location that you want DataSync to transfer. For more information and + /// examples, see Specifying + /// what DataSync transfers by using filters. final List? includes; - /// The name of the task that was described. + /// The configuration of the manifest that lists the files or objects that you + /// want DataSync to transfer. For more information, see Specifying + /// what DataSync transfers by using a manifest. + final ManifestConfig? manifestConfig; + + /// The name of your task. final String? name; - /// The configuration options that control the behavior of the - /// StartTaskExecution operation. Some options include preserving - /// file or object metadata and verifying data integrity. - /// - /// You can override these options for each task execution. For more - /// information, see StartTaskExecution. + /// The task's settings. For example, what file metadata gets preserved, how + /// data integrity gets verified at the end of your transfer, bandwidth limits, + /// among other options. final Options? options; - /// The schedule used to periodically transfer files from a source to a - /// destination location. + /// The schedule for when you want your task to run. For more information, see + /// Scheduling + /// your task. final TaskSchedule? schedule; - /// The Amazon Resource Name (ARN) of the source file system's location. + /// The details about your task + /// schedule. + final TaskScheduleDetails? scheduleDetails; + + /// The ARN of your transfer's source location. final String? sourceLocationArn; - /// The Amazon Resource Names (ARNs) of the network interfaces created for your - /// source location. For more information, see Network - /// interface requirements. + /// The ARNs of the network + /// interfaces that DataSync created for your source location. final List? sourceNetworkInterfaceArns; - /// The status of the task that was described. - /// - /// For detailed information about task execution statuses, see Understanding - /// Task Statuses in the DataSync User Guide. + /// The status of your task. For information about what each status means, see + /// Task + /// statuses. final TaskStatus? status; - /// The Amazon Resource Name (ARN) of the task that was described. + /// The ARN of your task. final String? taskArn; + /// The configuration of your task report, which provides detailed information + /// about your DataSync transfer. For more information, see Monitoring + /// your DataSync transfers with task reports. + final TaskReportConfig? taskReportConfig; + DescribeTaskResponse({ this.cloudWatchLogGroupArn, this.creationTime, @@ -4990,13 +5701,16 @@ class DescribeTaskResponse { this.errorDetail, this.excludes, this.includes, + this.manifestConfig, this.name, this.options, this.schedule, + this.scheduleDetails, this.sourceLocationArn, this.sourceNetworkInterfaceArns, this.status, this.taskArn, + this.taskReportConfig, }); factory DescribeTaskResponse.fromJson(Map json) { @@ -5020,6 +5734,10 @@ class DescribeTaskResponse { ?.whereNotNull() .map((e) => FilterRule.fromJson(e as Map)) .toList(), + manifestConfig: json['ManifestConfig'] != null + ? ManifestConfig.fromJson( + json['ManifestConfig'] as Map) + : null, name: json['Name'] as String?, options: json['Options'] != null ? Options.fromJson(json['Options'] as Map) @@ -5027,6 +5745,10 @@ class DescribeTaskResponse { schedule: json['Schedule'] != null ? TaskSchedule.fromJson(json['Schedule'] as Map) : null, + scheduleDetails: json['ScheduleDetails'] != null + ? TaskScheduleDetails.fromJson( + json['ScheduleDetails'] as Map) + : null, sourceLocationArn: json['SourceLocationArn'] as String?, sourceNetworkInterfaceArns: (json['SourceNetworkInterfaceArns'] as List?) ?.whereNotNull() @@ -5034,6 +5756,10 @@ class DescribeTaskResponse { .toList(), status: (json['Status'] as String?)?.toTaskStatus(), taskArn: json['TaskArn'] as String?, + taskReportConfig: json['TaskReportConfig'] != null + ? TaskReportConfig.fromJson( + json['TaskReportConfig'] as Map) + : null, ); } @@ -5048,13 +5774,16 @@ class DescribeTaskResponse { final errorDetail = this.errorDetail; final excludes = this.excludes; final includes = this.includes; + final manifestConfig = this.manifestConfig; final name = this.name; final options = this.options; final schedule = this.schedule; + final scheduleDetails = this.scheduleDetails; final sourceLocationArn = this.sourceLocationArn; final sourceNetworkInterfaceArns = this.sourceNetworkInterfaceArns; final status = this.status; final taskArn = this.taskArn; + final taskReportConfig = this.taskReportConfig; return { if (cloudWatchLogGroupArn != null) 'CloudWatchLogGroupArn': cloudWatchLogGroupArn, @@ -5070,14 +5799,17 @@ class DescribeTaskResponse { if (errorDetail != null) 'ErrorDetail': errorDetail, if (excludes != null) 'Excludes': excludes, if (includes != null) 'Includes': includes, + if (manifestConfig != null) 'ManifestConfig': manifestConfig, if (name != null) 'Name': name, if (options != null) 'Options': options, if (schedule != null) 'Schedule': schedule, + if (scheduleDetails != null) 'ScheduleDetails': scheduleDetails, if (sourceLocationArn != null) 'SourceLocationArn': sourceLocationArn, if (sourceNetworkInterfaceArns != null) 'SourceNetworkInterfaceArns': sourceNetworkInterfaceArns, if (status != null) 'Status': status.toValue(), if (taskArn != null) 'TaskArn': taskArn, + if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig, }; } } @@ -5522,46 +6254,20 @@ class FsxProtocolSmb { /// Specifies the password of a user who has permission to access your SVM. final String password; - /// Specifies a user name that can mount the location and access the files, - /// folders, and metadata that you need in the SVM. + /// Specifies a user that can mount and access the files, folders, and metadata + /// in your SVM. /// - /// If you provide a user in your Active Directory, note the following: + /// For information about choosing a user with the right level of access for + /// your transfer, see Using + /// the SMB protocol. + final String user; + + /// Specifies the fully qualified domain name (FQDN) of the Microsoft Active + /// Directory that your storage virtual machine (SVM) belongs to. /// - ///
            - ///
          • - /// If you're using Directory Service for Microsoft Active Directory, the user - /// must be a member of the Amazon Web Services Delegated FSx Administrators - /// group. - ///
          • - ///
          • - /// If you're using a self-managed Active Directory, the user must be a member - /// of either the Domain Admins group or a custom group that you specified for - /// file system administration when you created your file system. - ///
          • - ///
          - /// Make sure that the user has the permissions it needs to copy the data you - /// want: - /// - ///
            - ///
          • - /// SE_TCB_NAME: Required to set object ownership and file - /// metadata. With this privilege, you also can copy NTFS discretionary access - /// lists (DACLs). - ///
          • - ///
          • - /// SE_SECURITY_NAME: May be needed to copy NTFS system access - /// control lists (SACLs). This operation specifically requires the Windows - /// privilege, which is granted to members of the Domain Admins group. If you - /// configure your task to copy SACLs, make sure that the user has the required - /// privileges. For information about copying SACLs, see Ownership - /// and permissions-related options. - ///
          • - ///
          - final String user; - - /// Specifies the fully qualified domain name (FQDN) of the Microsoft Active - /// Directory that your storage virtual machine (SVM) belongs to. + /// If you have multiple domains in your environment, configuring this setting + /// makes sure that DataSync connects to the right SVM. final String? domain; final SmbMountOptions? mountOptions; @@ -6046,11 +6752,11 @@ class ListTagsForResourceResponse { /// ListTaskExecutionsResponse class ListTaskExecutionsResponse { - /// An opaque string that indicates the position at which to begin returning the - /// next list of executed tasks. + /// The opaque string that indicates the position to begin the next list of + /// results in the response. final String? nextToken; - /// A list of executed tasks. + /// A list of the task's executions. final List? taskExecutions; ListTaskExecutionsResponse({ @@ -6276,6 +6982,109 @@ extension LogLevelFromString on String { } } +enum ManifestAction { + transfer, +} + +extension ManifestActionValueExtension on ManifestAction { + String toValue() { + switch (this) { + case ManifestAction.transfer: + return 'TRANSFER'; + } + } +} + +extension ManifestActionFromString on String { + ManifestAction toManifestAction() { + switch (this) { + case 'TRANSFER': + return ManifestAction.transfer; + } + throw Exception('$this is not known in enum ManifestAction'); + } +} + +/// Configures a manifest, which is a list of files or objects that you want +/// DataSync to transfer. For more information and configuration examples, see +/// Specifying +/// what DataSync transfers by using a manifest. +class ManifestConfig { + /// Specifies what DataSync uses the manifest for. + final ManifestAction? action; + + /// Specifies the file format of your manifest. For more information, see Creating + /// a manifest. + final ManifestFormat? format; + + /// Specifies the manifest that you want DataSync to use and where it's hosted. + /// + /// You must specify this parameter if you're configuring a new manifest on or + /// after February 7, 2024. + /// + /// If you don't, you'll get a 400 status code and + /// ValidationException error stating that you're missing the IAM + /// role for DataSync to access the S3 bucket where you're hosting your + /// manifest. For more information, see Providing + /// DataSync access to your manifest. + /// + final SourceManifestConfig? source; + + ManifestConfig({ + this.action, + this.format, + this.source, + }); + + factory ManifestConfig.fromJson(Map json) { + return ManifestConfig( + action: (json['Action'] as String?)?.toManifestAction(), + format: (json['Format'] as String?)?.toManifestFormat(), + source: json['Source'] != null + ? SourceManifestConfig.fromJson( + json['Source'] as Map) + : null, + ); + } + + Map toJson() { + final action = this.action; + final format = this.format; + final source = this.source; + return { + if (action != null) 'Action': action.toValue(), + if (format != null) 'Format': format.toValue(), + if (source != null) 'Source': source, + }; + } +} + +enum ManifestFormat { + csv, +} + +extension ManifestFormatValueExtension on ManifestFormat { + String toValue() { + switch (this) { + case ManifestFormat.csv: + return 'CSV'; + } + } +} + +extension ManifestFormatFromString on String { + ManifestFormat toManifestFormat() { + switch (this) { + case 'CSV': + return ManifestFormat.csv; + } + throw Exception('$this is not known in enum ManifestFormat'); + } +} + /// The performance data that DataSync Discovery collects about an on-premises /// storage system resource. class MaxP95Performance { @@ -6414,9 +7223,16 @@ class NetAppONTAPCluster { /// The storage space that's being used in a cluster. final int? clusterBlockStorageUsed; + /// The amount of space in the cluster that's in cloud storage (for example, if + /// you're using data tiering). + final int? clusterCloudStorageUsed; + /// The name of the cluster. final String? clusterName; + /// The number of LUNs (logical unit numbers) in the cluster. + final int? lunCount; + /// The performance data that DataSync Discovery collects about the cluster. final MaxP95Performance? maxP95Performance; @@ -6445,7 +7261,9 @@ class NetAppONTAPCluster { this.clusterBlockStorageLogicalUsed, this.clusterBlockStorageSize, this.clusterBlockStorageUsed, + this.clusterCloudStorageUsed, this.clusterName, + this.lunCount, this.maxP95Performance, this.nfsExportedVolumes, this.recommendationStatus, @@ -6460,7 +7278,9 @@ class NetAppONTAPCluster { json['ClusterBlockStorageLogicalUsed'] as int?, clusterBlockStorageSize: json['ClusterBlockStorageSize'] as int?, clusterBlockStorageUsed: json['ClusterBlockStorageUsed'] as int?, + clusterCloudStorageUsed: json['ClusterCloudStorageUsed'] as int?, clusterName: json['ClusterName'] as String?, + lunCount: json['LunCount'] as int?, maxP95Performance: json['MaxP95Performance'] != null ? MaxP95Performance.fromJson( json['MaxP95Performance'] as Map) @@ -6481,7 +7301,9 @@ class NetAppONTAPCluster { final clusterBlockStorageLogicalUsed = this.clusterBlockStorageLogicalUsed; final clusterBlockStorageSize = this.clusterBlockStorageSize; final clusterBlockStorageUsed = this.clusterBlockStorageUsed; + final clusterCloudStorageUsed = this.clusterCloudStorageUsed; final clusterName = this.clusterName; + final lunCount = this.lunCount; final maxP95Performance = this.maxP95Performance; final nfsExportedVolumes = this.nfsExportedVolumes; final recommendationStatus = this.recommendationStatus; @@ -6495,7 +7317,10 @@ class NetAppONTAPCluster { 'ClusterBlockStorageSize': clusterBlockStorageSize, if (clusterBlockStorageUsed != null) 'ClusterBlockStorageUsed': clusterBlockStorageUsed, + if (clusterCloudStorageUsed != null) + 'ClusterCloudStorageUsed': clusterCloudStorageUsed, if (clusterName != null) 'ClusterName': clusterName, + if (lunCount != null) 'LunCount': lunCount, if (maxP95Performance != null) 'MaxP95Performance': maxP95Performance, if (nfsExportedVolumes != null) 'NfsExportedVolumes': nfsExportedVolumes, if (recommendationStatus != null) @@ -6519,6 +7344,9 @@ class NetAppONTAPSVM { /// The data transfer protocols (such as NFS) configured for the SVM. final List? enabledProtocols; + /// The number of LUNs (logical unit numbers) in the SVM. + final int? lunCount; + /// The performance data that DataSync Discovery collects about the SVM. final MaxP95Performance? maxP95Performance; @@ -6562,6 +7390,7 @@ class NetAppONTAPSVM { this.cifsShareCount, this.clusterUuid, this.enabledProtocols, + this.lunCount, this.maxP95Performance, this.nfsExportedVolumes, this.recommendationStatus, @@ -6582,6 +7411,7 @@ class NetAppONTAPSVM { ?.whereNotNull() .map((e) => e as String) .toList(), + lunCount: json['LunCount'] as int?, maxP95Performance: json['MaxP95Performance'] != null ? MaxP95Performance.fromJson( json['MaxP95Performance'] as Map) @@ -6606,6 +7436,7 @@ class NetAppONTAPSVM { final cifsShareCount = this.cifsShareCount; final clusterUuid = this.clusterUuid; final enabledProtocols = this.enabledProtocols; + final lunCount = this.lunCount; final maxP95Performance = this.maxP95Performance; final nfsExportedVolumes = this.nfsExportedVolumes; final recommendationStatus = this.recommendationStatus; @@ -6620,6 +7451,7 @@ class NetAppONTAPSVM { if (cifsShareCount != null) 'CifsShareCount': cifsShareCount, if (clusterUuid != null) 'ClusterUuid': clusterUuid, if (enabledProtocols != null) 'EnabledProtocols': enabledProtocols, + if (lunCount != null) 'LunCount': lunCount, if (maxP95Performance != null) 'MaxP95Performance': maxP95Performance, if (nfsExportedVolumes != null) 'NfsExportedVolumes': nfsExportedVolumes, if (recommendationStatus != null) @@ -6654,6 +7486,9 @@ class NetAppONTAPVolume { /// compression or deduplication. final int? logicalCapacityUsed; + /// The number of LUNs (logical unit numbers) in the volume. + final int? lunCount; + /// The performance data that DataSync Discovery collects about the volume. final MaxP95Performance? maxP95Performance; @@ -6697,6 +7532,7 @@ class NetAppONTAPVolume { this.capacityUsed, this.cifsShareCount, this.logicalCapacityUsed, + this.lunCount, this.maxP95Performance, this.nfsExported, this.recommendationStatus, @@ -6715,6 +7551,7 @@ class NetAppONTAPVolume { capacityUsed: json['CapacityUsed'] as int?, cifsShareCount: json['CifsShareCount'] as int?, logicalCapacityUsed: json['LogicalCapacityUsed'] as int?, + lunCount: json['LunCount'] as int?, maxP95Performance: json['MaxP95Performance'] != null ? MaxP95Performance.fromJson( json['MaxP95Performance'] as Map) @@ -6740,6 +7577,7 @@ class NetAppONTAPVolume { final capacityUsed = this.capacityUsed; final cifsShareCount = this.cifsShareCount; final logicalCapacityUsed = this.logicalCapacityUsed; + final lunCount = this.lunCount; final maxP95Performance = this.maxP95Performance; final nfsExported = this.nfsExported; final recommendationStatus = this.recommendationStatus; @@ -6757,6 +7595,7 @@ class NetAppONTAPVolume { if (cifsShareCount != null) 'CifsShareCount': cifsShareCount, if (logicalCapacityUsed != null) 'LogicalCapacityUsed': logicalCapacityUsed, + if (lunCount != null) 'LunCount': lunCount, if (maxP95Performance != null) 'MaxP95Performance': maxP95Performance, if (nfsExported != null) 'NfsExported': nfsExported, if (recommendationStatus != null) @@ -6917,10 +7756,39 @@ extension ObjectTagsFromString on String { } } -/// A list of Amazon Resource Names (ARNs) of agents to use for a Network File -/// System (NFS) location. +enum ObjectVersionIds { + include, + none, +} + +extension ObjectVersionIdsValueExtension on ObjectVersionIds { + String toValue() { + switch (this) { + case ObjectVersionIds.include: + return 'INCLUDE'; + case ObjectVersionIds.none: + return 'NONE'; + } + } +} + +extension ObjectVersionIdsFromString on String { + ObjectVersionIds toObjectVersionIds() { + switch (this) { + case 'INCLUDE': + return ObjectVersionIds.include; + case 'NONE': + return ObjectVersionIds.none; + } + throw Exception('$this is not known in enum ObjectVersionIds'); + } +} + +/// The DataSync agents that are connecting to a Network File System (NFS) +/// location. class OnPremConfig { - /// ARNs of the agents to use for an NFS location. + /// The Amazon Resource Names (ARNs) of the agents connecting to a transfer + /// location. final List agentArns; OnPremConfig({ @@ -7012,30 +7880,36 @@ extension OperatorFromString on String { } } -/// Configures your DataSync task settings. These options include how DataSync -/// handles files, objects, and their associated metadata. You also can specify -/// how DataSync verifies data integrity, set bandwidth limits for your task, -/// among other options. +/// Indicates how your transfer task is configured. These options include how +/// DataSync handles files, objects, and their associated metadata during your +/// transfer. You also can specify how to verify data integrity, set bandwidth +/// limits for your task, among other options. /// -/// Each task setting has a default value. Unless you need to, you don't have to -/// configure any of these Options before starting your task. +/// Each option has a default value. Unless you need to, you don't have to +/// configure any option before calling StartTaskExecution. +/// +/// You also can override your task options for each task execution. For +/// example, you might want to adjust the LogLevel for an +/// individual execution. class Options { /// Specifies whether to preserve metadata indicating the last time a file was - /// read or written to. If you set Atime to - /// BEST_EFFORT, DataSync attempts to preserve the original - /// Atime attribute on all source files (that is, the version - /// before the PREPARING phase of the task execution). + /// read or written to. /// /// The behavior of Atime isn't fully standard across platforms, so /// DataSync can only do this on a best-effort basis. /// - /// Default value: BEST_EFFORT - /// - /// BEST_EFFORT: Attempt to preserve the per-file - /// Atime value (recommended). - /// - /// NONE: Ignore Atime. - /// + ///
            + ///
          • + /// BEST_EFFORT (default) - DataSync attempts to preserve the + /// original Atime attribute on all source files (that is, the + /// version before the PREPARING phase of the task execution). This + /// option is recommended. + ///
          • + ///
          • + /// NONE - Ignores Atime. + ///
          • + ///
          /// If Atime is set to BEST_EFFORT, Mtime /// must be set to PRESERVE. /// @@ -7051,27 +7925,37 @@ class Options { /// Specifies the POSIX group ID (GID) of the file's owners. /// + ///
            + ///
          • + /// INT_VALUE (default) - Preserves the integer value of user ID + /// (UID) and GID, which is recommended. + ///
          • + ///
          • + /// NONE - Ignores UID and GID. + ///
          • + ///
          /// For more information, see Metadata /// copied by DataSync. - /// - /// Default value: INT_VALUE. This preserves the integer value of - /// the ID. - /// - /// INT_VALUE: Preserve the integer value of user ID (UID) and GID - /// (recommended). - /// - /// NONE: Ignore UID and GID. final Gid? gid; /// Specifies the type of logs that DataSync publishes to a Amazon CloudWatch /// Logs log group. To specify the log group, see CloudWatchLogGroupArn. /// - /// If you set LogLevel to OFF, no logs are published. - /// BASIC publishes logs on errors for individual files - /// transferred. TRANSFER publishes logs for every file or object - /// that is transferred and integrity checked. + ///
            + ///
          • + /// BASIC - Publishes logs with only basic information (such as + /// transfer errors). + ///
          • + ///
          • + /// TRANSFER - Publishes logs for all files or objects that your + /// DataSync task transfers and performs data-integrity checks on. + ///
          • + ///
          • + /// OFF - No logs are published. + ///
          • + ///
          final LogLevel? logLevel; /// Specifies whether to preserve metadata indicating the last time that a file @@ -7079,12 +7963,15 @@ class Options { /// execution. This option is required when you need to run the a task more than /// once. /// - /// Default Value: PRESERVE - /// - /// PRESERVE: Preserve original Mtime (recommended) - /// - /// NONE: Ignore Mtime. - /// + ///
            + ///
          • + /// PRESERVE (default) - Preserves original Mtime, + /// which is recommended. + ///
          • + ///
          • + /// NONE - Ignores Mtime. + ///
          • + ///
          /// If Mtime is set to PRESERVE, Atime /// must be set to BEST_EFFORT. /// @@ -7093,23 +7980,33 @@ class Options { /// final Mtime? mtime; - /// Specifies whether object tags are preserved when transferring between object - /// storage systems. If you want your DataSync task to ignore object tags, - /// specify the NONE value. - /// - /// Default Value: PRESERVE + /// Specifies whether you want DataSync to PRESERVE object tags + /// (default behavior) when transferring between object storage systems. If you + /// want your DataSync task to ignore object tags, specify the NONE + /// value. final ObjectTags? objectTags; - /// Specifies whether data at the destination location should be overwritten or - /// preserved. If set to NEVER, a destination file for example will - /// not be replaced by a source file (even if the destination file differs from - /// the source file). If you modify files in the destination and you sync the - /// files, you can use this value to protect against overwriting those changes. + /// Specifies whether DataSync should modify or preserve data at the destination + /// location. /// - /// Some storage classes have specific behaviors that can affect your Amazon S3 - /// storage cost. For detailed information, see Considerations - /// when working with Amazon S3 storage classes in DataSync. + ///
            + ///
          • + /// ALWAYS (default) - DataSync modifies data in the destination + /// location when source data (including metadata) has changed. + /// + /// If DataSync overwrites objects, you might incur additional charges for + /// certain Amazon S3 storage classes (for example, for retrieval or early + /// deletion). For more information, see Storage + /// class considerations with Amazon S3 transfers. + ///
          • + ///
          • + /// NEVER - DataSync doesn't overwrite data in the destination + /// location even if the source data has changed. You can use this option to + /// protect against overwriting changes made to files or objects in the + /// destination. + ///
          • + ///
          final OverwriteMode? overwriteMode; /// Specifies which users or groups can access a file for a specific purpose @@ -7119,12 +8016,15 @@ class Options { /// href="https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied">Metadata /// copied by DataSync. /// - /// Default value: PRESERVE - /// - /// PRESERVE: Preserve POSIX-style permissions (recommended). - /// - /// NONE: Ignore permissions. - /// + ///
            + ///
          • + /// PRESERVE (default) - Preserves POSIX-style permissions, which + /// is recommended. + ///
          • + ///
          • + /// NONE - Ignores POSIX-style permissions. + ///
          • + ///
          /// DataSync can preserve extant permissions of a source location. /// final PosixPermissions? posixPermissions; @@ -7136,13 +8036,16 @@ class Options { /// href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Considerations /// when working with Amazon S3 storage classes in DataSync. /// - /// Default value: PRESERVE - /// - /// PRESERVE: Ignore such destination files (recommended). - /// - /// REMOVE: Delete destination files that aren’t present in the + ///
            + ///
          • + /// PRESERVE (default) - Ignores such destination files, which is + /// recommended. + ///
          • + ///
          • + /// REMOVE - Deletes destination files that aren’t present in the /// source. - /// + ///
          • + ///
          /// If you set this parameter to REMOVE, you can't set /// TransferMode to ALL. When you transfer all data, /// DataSync doesn't scan your destination location and doesn't know what to @@ -7158,12 +8061,15 @@ class Options { /// DataSync can't copy the actual contents of these devices because they're /// nonterminal and don't return an end-of-file (EOF) marker. /// - /// Default value: NONE - /// - /// NONE: Ignore special devices (recommended). - /// - /// PRESERVE: Preserve character and block device metadata. This + ///
            + ///
          • + /// NONE (default) - Ignores special devices (recommended). + ///
          • + ///
          • + /// PRESERVE - Preserves character and block device metadata. This /// option currently isn't supported for Amazon EFS. + ///
          • + ///
          final PreserveDevices? preserveDevices; /// Specifies which components of the SMB security descriptor are copied from @@ -7175,10 +8081,10 @@ class Options { /// href="https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html">how /// DataSync handles metadata. /// - /// Default value: OWNER_DACL - /// - /// OWNER_DACL: For each copied object, DataSync copies the - /// following metadata: + ///
            + ///
          • + /// OWNER_DACL (default) - For each copied object, DataSync copies + /// the following metadata: /// ///
              ///
            • @@ -7191,8 +8097,9 @@ class Options { /// DataSync won't copy NTFS system access control lists (SACLs) with this /// option. ///
            • - ///
            - /// OWNER_DACL_SACL: For each copied object, DataSync copies the + ///
        • + ///
        • + /// OWNER_DACL_SACL - For each copied object, DataSync copies the /// following metadata: /// ///
            @@ -7209,57 +8116,69 @@ class Options { /// /// Copying SACLs requires granting additional permissions to the Windows user /// that DataSync uses to access your SMB location. For information about - /// choosing a user that ensures sufficient permissions to files, folders, and - /// metadata, see user. + /// choosing a user with the right permissions, see required permissions for SMB, + /// FSx + /// for Windows File Server, or FSx + /// for ONTAP (depending on the type of location in your transfer). /// - ///
          - /// NONE: None of the SMB security descriptor components are + ///
      • + ///
      • + /// NONE - None of the SMB security descriptor components are /// copied. Destination objects are owned by the user that was provided for /// accessing the destination location. DACLs and SACLs are set based on the /// destination server’s configuration. + ///
      • + ///
      final SmbSecurityDescriptorCopyFlags? securityDescriptorCopyFlags; - /// Specifies whether tasks should be queued before executing the tasks. The - /// default is ENABLED, which means the tasks will be queued. - /// - /// If you use the same agent to run multiple tasks, you can enable the tasks to - /// run in series. For more information, see Queueing - /// task executions. + /// Specifies whether your transfer tasks should be put into a queue during + /// certain scenarios when running + /// multiple tasks. This is ENABLED by default. final TaskQueueing? taskQueueing; /// Determines whether DataSync transfers only the data and metadata that differ /// between the source and the destination location or transfers all the content /// from the source (without comparing what's in the destination). /// - /// CHANGED: DataSync copies only data or metadata that is new or - /// different content from the source location to the destination location. - /// - /// ALL: DataSync copies all source location content to the - /// destination (without comparing what's in the destination). + ///
        + ///
      • + /// CHANGED (default) - DataSync copies only data or metadata that + /// is new or different content from the source location to the destination + /// location. + ///
      • + ///
      • + /// ALL - DataSync copies everything in the source to the + /// destination without comparing differences between the locations. + ///
      • + ///
      final TransferMode? transferMode; /// Specifies the POSIX user ID (UID) of the file's owner. /// + ///
        + ///
      • + /// INT_VALUE (default) - Preserves the integer value of UID and + /// group ID (GID), which is recommended. + ///
      • + ///
      • + /// NONE - Ignores UID and GID. + ///
      • + ///
      /// For more information, see Metadata /// copied by DataSync. - /// - /// Default value: INT_VALUE. This preserves the integer value of - /// the ID. - /// - /// INT_VALUE: Preserve the integer value of UID and group ID (GID) - /// (recommended). - /// - /// NONE: Ignore UID and GID. final Uid? uid; /// Specifies how and when DataSync checks the integrity of your data during a /// transfer. /// - /// Default value: POINT_IN_TIME_CONSISTENT - /// - /// ONLY_FILES_TRANSFERRED (recommended): DataSync calculates the + ///
        + ///
      • + /// ONLY_FILES_TRANSFERRED (recommended) - DataSync calculates the /// checksum of transferred files and metadata at the source location. At the /// end of the transfer, DataSync then compares this checksum to the checksum /// calculated on those files at the destination. @@ -7268,19 +8187,27 @@ class Options { /// or S3 Glacier Deep Archive storage classes. For more information, see Storage /// class considerations with Amazon S3 locations. + ///
      • + ///
      • + /// POINT_IN_TIME_CONSISTENT (default) - At the end of the + /// transfer, DataSync scans the entire source and destination to verify that + /// both locations are fully synchronized. /// - /// POINT_IN_TIME_CONSISTENT: At the end of the transfer, DataSync - /// scans the entire source and destination to verify that both locations are - /// fully synchronized. + /// If you use a manifest, + /// DataSync only scans and verifies what's listed in the manifest. /// /// You can't use this option when transferring to S3 Glacier Flexible Retrieval /// or S3 Glacier Deep Archive storage classes. For more information, see Storage /// class considerations with Amazon S3 locations. - /// - /// NONE: DataSync doesn't run additional verification at the end + ///
      • + ///
      • + /// NONE - DataSync doesn't run additional verification at the end /// of the transfer. All data transmissions are still integrity-checked with /// checksum verification during the transfer. + ///
      • + ///
      final VerifyMode? verifyMode; Options({ @@ -7473,6 +8400,30 @@ extension PhaseStatusFromString on String { } } +/// The platform-related details about the DataSync agent, such as the version +/// number. +class Platform { + /// The version of the DataSync agent. + final String? version; + + Platform({ + this.version, + }); + + factory Platform.fromJson(Map json) { + return Platform( + version: json['Version'] as String?, + ); + } + + Map toJson() { + final version = this.version; + return { + if (version != null) 'Version': version, + }; + } +} + enum PosixPermissions { none, preserve, @@ -7557,28 +8508,25 @@ extension PreserveDevicesFromString on String { } } -/// The VPC endpoint, subnet, and security group that an agent uses to access IP -/// addresses in a VPC (Virtual Private Cloud). +/// Specifies how your DataSync agent connects to Amazon Web Services using a virtual +/// private cloud (VPC) service endpoint. An agent that uses a VPC endpoint +/// isn't accessible over the public internet. class PrivateLinkConfig { - /// The private endpoint that is configured for an agent that has access to IP - /// addresses in a PrivateLink. - /// An agent that is configured with this endpoint will not be accessible over - /// the public internet. + /// Specifies the VPC endpoint provided by Amazon + /// Web Services PrivateLink that your agent connects to. final String? privateLinkEndpoint; - /// The Amazon Resource Names (ARNs) of the security groups that are configured - /// for the EC2 resource that hosts an agent activated in a VPC or an agent that - /// has access to a VPC endpoint. + /// Specifies the Amazon Resource Names (ARN) of the security group that + /// provides DataSync access to your VPC endpoint. You can only specify one ARN. final List? securityGroupArns; - /// The Amazon Resource Names (ARNs) of the subnets that are configured for an - /// agent activated in a VPC or an agent that has access to a VPC endpoint. + /// Specifies the ARN of the subnet where your VPC endpoint is located. You can + /// only specify one ARN. final List? subnetArns; - /// The ID of the VPC endpoint that is configured for an agent. An agent that is - /// configured with a VPC endpoint will not be accessible over the public - /// internet. + /// Specifies the ID of the VPC endpoint that your agent connects to. final String? vpcEndpointId; PrivateLinkConfig({ @@ -7757,6 +8705,268 @@ class RemoveStorageSystemResponse { } } +/// Specifies where DataSync uploads your task +/// report. +class ReportDestination { + /// Specifies the Amazon S3 bucket where DataSync uploads your task report. + final ReportDestinationS3? s3; + + ReportDestination({ + this.s3, + }); + + factory ReportDestination.fromJson(Map json) { + return ReportDestination( + s3: json['S3'] != null + ? ReportDestinationS3.fromJson(json['S3'] as Map) + : null, + ); + } + + Map toJson() { + final s3 = this.s3; + return { + if (s3 != null) 'S3': s3, + }; + } +} + +/// Specifies the Amazon S3 bucket where DataSync uploads your task +/// report. +class ReportDestinationS3 { + /// Specifies the Amazon Resource Name (ARN) of the IAM policy that allows + /// DataSync to upload a task report to your S3 bucket. For more information, + /// see Allowing + /// DataSync to upload a task report to an Amazon S3 bucket. + final String bucketAccessRoleArn; + + /// Specifies the ARN of the S3 bucket where DataSync uploads your report. + final String s3BucketArn; + + /// Specifies a bucket prefix for your report. + final String? subdirectory; + + ReportDestinationS3({ + required this.bucketAccessRoleArn, + required this.s3BucketArn, + this.subdirectory, + }); + + factory ReportDestinationS3.fromJson(Map json) { + return ReportDestinationS3( + bucketAccessRoleArn: json['BucketAccessRoleArn'] as String, + s3BucketArn: json['S3BucketArn'] as String, + subdirectory: json['Subdirectory'] as String?, + ); + } + + Map toJson() { + final bucketAccessRoleArn = this.bucketAccessRoleArn; + final s3BucketArn = this.s3BucketArn; + final subdirectory = this.subdirectory; + return { + 'BucketAccessRoleArn': bucketAccessRoleArn, + 'S3BucketArn': s3BucketArn, + if (subdirectory != null) 'Subdirectory': subdirectory, + }; + } +} + +enum ReportLevel { + errorsOnly, + successesAndErrors, +} + +extension ReportLevelValueExtension on ReportLevel { + String toValue() { + switch (this) { + case ReportLevel.errorsOnly: + return 'ERRORS_ONLY'; + case ReportLevel.successesAndErrors: + return 'SUCCESSES_AND_ERRORS'; + } + } +} + +extension ReportLevelFromString on String { + ReportLevel toReportLevel() { + switch (this) { + case 'ERRORS_ONLY': + return ReportLevel.errorsOnly; + case 'SUCCESSES_AND_ERRORS': + return ReportLevel.successesAndErrors; + } + throw Exception('$this is not known in enum ReportLevel'); + } +} + +enum ReportOutputType { + summaryOnly, + standard, +} + +extension ReportOutputTypeValueExtension on ReportOutputType { + String toValue() { + switch (this) { + case ReportOutputType.summaryOnly: + return 'SUMMARY_ONLY'; + case ReportOutputType.standard: + return 'STANDARD'; + } + } +} + +extension ReportOutputTypeFromString on String { + ReportOutputType toReportOutputType() { + switch (this) { + case 'SUMMARY_ONLY': + return ReportOutputType.summaryOnly; + case 'STANDARD': + return ReportOutputType.standard; + } + throw Exception('$this is not known in enum ReportOutputType'); + } +} + +/// Specifies the level of detail for a particular aspect of your DataSync task +/// report. +class ReportOverride { + /// Specifies whether your task report includes errors only or successes and + /// errors. + /// + /// For example, your report might mostly include only what didn't go well in + /// your transfer (ERRORS_ONLY). At the same time, you want to + /// verify that your task + /// filter is working correctly. In this situation, you can get a list of + /// what files DataSync successfully skipped and if something transferred that + /// you didn't to transfer (SUCCESSES_AND_ERRORS). + final ReportLevel? reportLevel; + + ReportOverride({ + this.reportLevel, + }); + + factory ReportOverride.fromJson(Map json) { + return ReportOverride( + reportLevel: (json['ReportLevel'] as String?)?.toReportLevel(), + ); + } + + Map toJson() { + final reportLevel = this.reportLevel; + return { + if (reportLevel != null) 'ReportLevel': reportLevel.toValue(), + }; + } +} + +/// The level of detail included in each aspect of your DataSync task +/// report. +class ReportOverrides { + /// Specifies the level of reporting for the files, objects, and directories + /// that DataSync attempted to delete in your destination location. This only + /// applies if you configure + /// your task to delete data in the destination that isn't in the source. + final ReportOverride? deleted; + + /// Specifies the level of reporting for the files, objects, and directories + /// that DataSync attempted to skip during your transfer. + final ReportOverride? skipped; + + /// Specifies the level of reporting for the files, objects, and directories + /// that DataSync attempted to transfer. + final ReportOverride? transferred; + + /// Specifies the level of reporting for the files, objects, and directories + /// that DataSync attempted to verify at the end of your transfer. + final ReportOverride? verified; + + ReportOverrides({ + this.deleted, + this.skipped, + this.transferred, + this.verified, + }); + + factory ReportOverrides.fromJson(Map json) { + return ReportOverrides( + deleted: json['Deleted'] != null + ? ReportOverride.fromJson(json['Deleted'] as Map) + : null, + skipped: json['Skipped'] != null + ? ReportOverride.fromJson(json['Skipped'] as Map) + : null, + transferred: json['Transferred'] != null + ? ReportOverride.fromJson(json['Transferred'] as Map) + : null, + verified: json['Verified'] != null + ? ReportOverride.fromJson(json['Verified'] as Map) + : null, + ); + } + + Map toJson() { + final deleted = this.deleted; + final skipped = this.skipped; + final transferred = this.transferred; + final verified = this.verified; + return { + if (deleted != null) 'Deleted': deleted, + if (skipped != null) 'Skipped': skipped, + if (transferred != null) 'Transferred': transferred, + if (verified != null) 'Verified': verified, + }; + } +} + +/// Indicates whether DataSync created a complete task +/// report for your transfer. +class ReportResult { + /// Indicates the code associated with the error if DataSync can't create a + /// complete report. + final String? errorCode; + + /// Provides details about issues creating a report. + final String? errorDetail; + + /// Indicates whether DataSync is still working on your report, created a + /// report, or can't create a complete report. + final PhaseStatus? status; + + ReportResult({ + this.errorCode, + this.errorDetail, + this.status, + }); + + factory ReportResult.fromJson(Map json) { + return ReportResult( + errorCode: json['ErrorCode'] as String?, + errorDetail: json['ErrorDetail'] as String?, + status: (json['Status'] as String?)?.toPhaseStatus(), + ); + } + + Map toJson() { + final errorCode = this.errorCode; + final errorDetail = this.errorDetail; + final status = this.status; + return { + if (errorCode != null) 'ErrorCode': errorCode, + if (errorDetail != null) 'ErrorDetail': errorDetail, + if (status != null) 'Status': status.toValue(), + }; + } +} + /// Information provided by DataSync Discovery about the resources in your /// on-premises storage system. class ResourceDetails { @@ -7868,13 +9078,15 @@ class ResourceMetrics { } } -/// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) -/// role used to access an Amazon S3 bucket. +/// Specifies the Amazon Resource Name (ARN) of the Identity and Access +/// Management (IAM) role that DataSync uses to access your S3 bucket. /// -/// For detailed information about using such a role, see Creating a Location -/// for Amazon S3 in the DataSync User Guide. +/// For more information, see Accessing +/// S3 buckets. class S3Config { - /// The ARN of the IAM role for accessing the S3 bucket. + /// Specifies the ARN of the IAM role that DataSync uses to access your S3 + /// bucket. final String bucketAccessRoleArn; S3Config({ @@ -7895,6 +9107,60 @@ class S3Config { } } +/// Specifies the S3 bucket where you're hosting the manifest that you want +/// DataSync to use. For more information and configuration examples, see Specifying +/// what DataSync transfers by using a manifest. +class S3ManifestConfig { + /// Specifies the Identity and Access Management (IAM) role that allows DataSync + /// to access your manifest. For more information, see Providing + /// DataSync access to your manifest. + final String bucketAccessRoleArn; + + /// Specifies the Amazon S3 object key of your manifest. This can include a + /// prefix (for example, prefix/my-manifest.csv). + final String manifestObjectPath; + + /// Specifies the Amazon Resource Name (ARN) of the S3 bucket where you're + /// hosting your manifest. + final String s3BucketArn; + + /// Specifies the object version ID of the manifest that you want DataSync to + /// use. If you don't set this, DataSync uses the latest version of the object. + final String? manifestObjectVersionId; + + S3ManifestConfig({ + required this.bucketAccessRoleArn, + required this.manifestObjectPath, + required this.s3BucketArn, + this.manifestObjectVersionId, + }); + + factory S3ManifestConfig.fromJson(Map json) { + return S3ManifestConfig( + bucketAccessRoleArn: json['BucketAccessRoleArn'] as String, + manifestObjectPath: json['ManifestObjectPath'] as String, + s3BucketArn: json['S3BucketArn'] as String, + manifestObjectVersionId: json['ManifestObjectVersionId'] as String?, + ); + } + + Map toJson() { + final bucketAccessRoleArn = this.bucketAccessRoleArn; + final manifestObjectPath = this.manifestObjectPath; + final s3BucketArn = this.s3BucketArn; + final manifestObjectVersionId = this.manifestObjectVersionId; + return { + 'BucketAccessRoleArn': bucketAccessRoleArn, + 'ManifestObjectPath': manifestObjectPath, + 'S3BucketArn': s3BucketArn, + if (manifestObjectVersionId != null) + 'ManifestObjectVersionId': manifestObjectVersionId, + }; + } +} + enum S3StorageClass { standard, standardIa, @@ -7953,6 +9219,62 @@ extension S3StorageClassFromString on String { } } +enum ScheduleDisabledBy { + user, + service, +} + +extension ScheduleDisabledByValueExtension on ScheduleDisabledBy { + String toValue() { + switch (this) { + case ScheduleDisabledBy.user: + return 'USER'; + case ScheduleDisabledBy.service: + return 'SERVICE'; + } + } +} + +extension ScheduleDisabledByFromString on String { + ScheduleDisabledBy toScheduleDisabledBy() { + switch (this) { + case 'USER': + return ScheduleDisabledBy.user; + case 'SERVICE': + return ScheduleDisabledBy.service; + } + throw Exception('$this is not known in enum ScheduleDisabledBy'); + } +} + +enum ScheduleStatus { + enabled, + disabled, +} + +extension ScheduleStatusValueExtension on ScheduleStatus { + String toValue() { + switch (this) { + case ScheduleStatus.enabled: + return 'ENABLED'; + case ScheduleStatus.disabled: + return 'DISABLED'; + } + } +} + +extension ScheduleStatusFromString on String { + ScheduleStatus toScheduleStatus() { + switch (this) { + case 'ENABLED': + return ScheduleStatus.enabled; + case 'DISABLED': + return ScheduleStatus.disabled; + } + throw Exception('$this is not known in enum ScheduleStatus'); + } +} + /// Specifies the version of the Server Message Block (SMB) protocol that /// DataSync uses to access an SMB file server. class SmbMountOptions { @@ -8091,6 +9413,32 @@ extension SmbVersionFromString on String { } } +/// Specifies the manifest that you want DataSync to use and where it's hosted. +/// For more information and configuration examples, see Specifying +/// what DataSync transfers by using a manifest. +class SourceManifestConfig { + /// Specifies the S3 bucket where you're hosting your manifest. + final S3ManifestConfig s3; + + SourceManifestConfig({ + required this.s3, + }); + + factory SourceManifestConfig.fromJson(Map json) { + return SourceManifestConfig( + s3: S3ManifestConfig.fromJson(json['S3'] as Map), + ); + } + + Map toJson() { + final s3 = this.s3; + return { + 'S3': s3, + }; + } +} + class StartDiscoveryJobResponse { /// The ARN of the discovery job that you started. final String? discoveryJobArn; @@ -8259,16 +9607,17 @@ class TagResourceResponse { } } -/// Represents a single entry in a list of task executions. -/// TaskExecutionListEntry returns an array that contains a list of -/// specific invocations of a task when the ListTaskExecutions -/// operation is called. +/// operation. class TaskExecutionListEntry { - /// The status of a task execution. + /// The status of a task execution. For more information, see Task + /// execution statuses. final TaskExecutionStatus? status; - /// The Amazon Resource Name (ARN) of the task that was executed. + /// The Amazon Resource Name (ARN) of a task execution. final String? taskExecutionArn; TaskExecutionListEntry({ @@ -8380,6 +9729,7 @@ class TaskExecutionResultDetail { enum TaskExecutionStatus { queued, + cancelling, launching, preparing, transferring, @@ -8393,6 +9743,8 @@ extension TaskExecutionStatusValueExtension on TaskExecutionStatus { switch (this) { case TaskExecutionStatus.queued: return 'QUEUED'; + case TaskExecutionStatus.cancelling: + return 'CANCELLING'; case TaskExecutionStatus.launching: return 'LAUNCHING'; case TaskExecutionStatus.preparing: @@ -8414,6 +9766,8 @@ extension TaskExecutionStatusFromString on String { switch (this) { case 'QUEUED': return TaskExecutionStatus.queued; + case 'CANCELLING': + return TaskExecutionStatus.cancelling; case 'LAUNCHING': return TaskExecutionStatus.launching; case 'PREPARING': @@ -8569,29 +9923,205 @@ extension TaskQueueingFromString on String { } } -/// Specifies the schedule you want your task to use for repeated executions. +/// Specifies how you want to configure a task report, which provides detailed +/// information about for your DataSync transfer. +/// /// For more information, see Schedule -/// Expressions for Rules. +/// href="https://docs.aws.amazon.com/datasync/latest/userguide/task-reports.html">Task +/// reports. +class TaskReportConfig { + /// Specifies the Amazon S3 bucket where DataSync uploads your task report. For + /// more information, see Task + /// reports. + final ReportDestination? destination; + + /// Specifies whether your task report includes the new version of each object + /// transferred into an S3 bucket. This only applies if you enable + /// versioning on your bucket. Keep in mind that setting this to + /// INCLUDE can increase the duration of your task execution. + final ObjectVersionIds? objectVersionIds; + + /// Specifies the type of task report that you want: + /// + ///
        + ///
      • + /// SUMMARY_ONLY: Provides necessary details about your task, + /// including the number of files, objects, and directories transferred and + /// transfer duration. + ///
      • + ///
      • + /// STANDARD: Provides complete details about your task, including + /// a full list of files, objects, and directories that were transferred, + /// skipped, verified, and more. + ///
      • + ///
      + final ReportOutputType? outputType; + + /// Customizes the reporting level for aspects of your task report. For example, + /// your report might generally only include errors, but you could specify that + /// you want a list of successes and errors just for the files that DataSync + /// attempted to delete in your destination location. + final ReportOverrides? overrides; + + /// Specifies whether you want your task report to include only what went wrong + /// with your transfer or a list of what succeeded and didn't. + /// + ///
        + ///
      • + /// ERRORS_ONLY: A report shows what DataSync was unable to + /// transfer, skip, verify, and delete. + ///
      • + ///
      • + /// SUCCESSES_AND_ERRORS: A report shows what DataSync was able and + /// unable to transfer, skip, verify, and delete. + ///
      • + ///
      + final ReportLevel? reportLevel; + + TaskReportConfig({ + this.destination, + this.objectVersionIds, + this.outputType, + this.overrides, + this.reportLevel, + }); + + factory TaskReportConfig.fromJson(Map json) { + return TaskReportConfig( + destination: json['Destination'] != null + ? ReportDestination.fromJson( + json['Destination'] as Map) + : null, + objectVersionIds: + (json['ObjectVersionIds'] as String?)?.toObjectVersionIds(), + outputType: (json['OutputType'] as String?)?.toReportOutputType(), + overrides: json['Overrides'] != null + ? ReportOverrides.fromJson(json['Overrides'] as Map) + : null, + reportLevel: (json['ReportLevel'] as String?)?.toReportLevel(), + ); + } + + Map toJson() { + final destination = this.destination; + final objectVersionIds = this.objectVersionIds; + final outputType = this.outputType; + final overrides = this.overrides; + final reportLevel = this.reportLevel; + return { + if (destination != null) 'Destination': destination, + if (objectVersionIds != null) + 'ObjectVersionIds': objectVersionIds.toValue(), + if (outputType != null) 'OutputType': outputType.toValue(), + if (overrides != null) 'Overrides': overrides, + if (reportLevel != null) 'ReportLevel': reportLevel.toValue(), + }; + } +} + +/// Configures your DataSync task to run on a schedule +/// (at a minimum interval of 1 hour). class TaskSchedule { - /// A cron expression that specifies when DataSync initiates a scheduled - /// transfer from a source to a destination location. + /// Specifies your task schedule by using a cron expression in UTC time. For + /// information about cron expression syntax, see the + /// Amazon EventBridge User Guide . final String scheduleExpression; + /// Specifies whether to enable or disable your task schedule. Your schedule is + /// enabled by default, but there can be situations where you need to disable + /// it. For example, you might need to pause a recurring transfer to fix an + /// issue with your task or perform maintenance on your storage system. + /// + /// DataSync might disable your schedule automatically if your task fails + /// repeatedly with the same error. For more information, see TaskScheduleDetails. + final ScheduleStatus? status; + TaskSchedule({ required this.scheduleExpression, + this.status, }); factory TaskSchedule.fromJson(Map json) { return TaskSchedule( scheduleExpression: json['ScheduleExpression'] as String, + status: (json['Status'] as String?)?.toScheduleStatus(), ); } Map toJson() { final scheduleExpression = this.scheduleExpression; + final status = this.status; return { 'ScheduleExpression': scheduleExpression, + if (status != null) 'Status': status.toValue(), + }; + } +} + +/// Provides information about your DataSync task +/// schedule. +class TaskScheduleDetails { + /// Indicates how your task schedule was disabled. + /// + ///
        + ///
      • + /// USER - Your schedule was manually disabled by using the UpdateTask + /// operation or DataSync console. + ///
      • + ///
      • + /// SERVICE - Your schedule was automatically disabled by DataSync + /// because the task failed repeatedly with the same error. + ///
      • + ///
      + final ScheduleDisabledBy? disabledBy; + + /// Provides a reason if the task schedule is disabled. + /// + /// If your schedule is disabled by USER, you see a Manually + /// disabled by user. message. + /// + /// If your schedule is disabled by SERVICE, you see an error + /// message to help you understand why the task keeps failing. For information + /// on resolving DataSync errors, see Troubleshooting + /// issues with DataSync transfers. + final String? disabledReason; + + /// Indicates the last time the status of your task schedule changed. For + /// example, if DataSync automatically disables your schedule because of a + /// repeated error, you can see when the schedule was disabled. + final DateTime? statusUpdateTime; + + TaskScheduleDetails({ + this.disabledBy, + this.disabledReason, + this.statusUpdateTime, + }); + + factory TaskScheduleDetails.fromJson(Map json) { + return TaskScheduleDetails( + disabledBy: (json['DisabledBy'] as String?)?.toScheduleDisabledBy(), + disabledReason: json['DisabledReason'] as String?, + statusUpdateTime: timeStampFromJson(json['StatusUpdateTime']), + ); + } + + Map toJson() { + final disabledBy = this.disabledBy; + final disabledReason = this.disabledReason; + final statusUpdateTime = this.statusUpdateTime; + return { + if (disabledBy != null) 'DisabledBy': disabledBy.toValue(), + if (disabledReason != null) 'DisabledReason': disabledReason, + if (statusUpdateTime != null) + 'StatusUpdateTime': unixTimestampToJson(statusUpdateTime), }; } } @@ -8786,6 +10316,18 @@ class UpdateDiscoveryJobResponse { } } +class UpdateLocationAzureBlobResponse { + UpdateLocationAzureBlobResponse(); + + factory UpdateLocationAzureBlobResponse.fromJson(Map _) { + return UpdateLocationAzureBlobResponse(); + } + + Map toJson() { + return {}; + } +} + class UpdateLocationHdfsResponse { UpdateLocationHdfsResponse(); diff --git a/aws_client/lib/src/generated/data_zone/v2018_05_10.dart b/aws_client/lib/src/generated/data_zone/v2018_05_10.dart new file mode 100644 index 000000000..486bcbfe0 --- /dev/null +++ b/aws_client/lib/src/generated/data_zone/v2018_05_10.dart @@ -0,0 +1,20079 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// Amazon DataZone is a data management service that enables you to catalog, +/// discover, govern, share, and analyze your data. With Amazon DataZone, you +/// can share and access your data across accounts and supported regions. Amazon +/// DataZone simplifies your experience across Amazon Web Services services, +/// including, but not limited to, Amazon Redshift, Amazon Athena, Amazon Web +/// Services Glue, and Amazon Web Services Lake Formation. +class DataZone { + final _s.RestJsonProtocol _protocol; + DataZone({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'datazone', + signingName: 'datazone', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Accepts automatically generated business-friendly metadata for your Amazon + /// DataZone assets. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [identifier] : + /// The identifier of the asset. + /// + /// Parameter [acceptChoices] : + /// Specifies the prediction (aka, the automatically generated piece of + /// metadata) and the target (for example, a column name) that can be + /// accepted. + /// + /// Parameter [acceptRule] : + /// Specifies the rule (or the conditions) under which a prediction can be + /// accepted. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure idempotency of the request. + /// This field is automatically populated if not provided. + /// + /// Parameter [revision] : + /// The revision that is to be made to the asset. + Future acceptPredictions({ + required String domainIdentifier, + required String identifier, + List? acceptChoices, + AcceptRule? acceptRule, + String? clientToken, + String? revision, + }) async { + final $query = >{ + if (revision != null) 'revision': [revision], + }; + final $payload = { + if (acceptChoices != null) 'acceptChoices': acceptChoices, + if (acceptRule != null) 'acceptRule': acceptRule, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}/accept-predictions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return AcceptPredictionsOutput.fromJson(response); + } + + /// Accepts a subscription request to a specific asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The Amazon DataZone domain where the specified subscription request is + /// being accepted. + /// + /// Parameter [identifier] : + /// The unique identifier of the subscription request that is to be accepted. + /// + /// Parameter [decisionComment] : + /// A description that specifies the reason for accepting the specified + /// subscription request. + Future acceptSubscriptionRequest({ + required String domainIdentifier, + required String identifier, + String? decisionComment, + }) async { + final $payload = { + if (decisionComment != null) 'decisionComment': decisionComment, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests/${Uri.encodeComponent(identifier)}/accept', + exceptionFnMap: _exceptionFns, + ); + return AcceptSubscriptionRequestOutput.fromJson(response); + } + + /// Cancels the metadata generation run. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the metadata generation run + /// is to be cancelled. + /// + /// Parameter [identifier] : + /// The ID of the metadata generation run. + Future cancelMetadataGenerationRun({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/metadata-generation-runs/${Uri.encodeComponent(identifier)}/cancel', + exceptionFnMap: _exceptionFns, + ); + } + + /// Cancels the subscription to the specified asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The unique identifier of the Amazon DataZone domain where the subscription + /// request is being cancelled. + /// + /// Parameter [identifier] : + /// The unique identifier of the subscription that is being cancelled. + Future cancelSubscription({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscriptions/${Uri.encodeComponent(identifier)}/cancel', + exceptionFnMap: _exceptionFns, + ); + return CancelSubscriptionOutput.fromJson(response); + } + + /// Creates an asset in Amazon DataZone catalog. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// Amazon DataZone domain where the asset is created. + /// + /// Parameter [name] : + /// Asset name. + /// + /// Parameter [owningProjectIdentifier] : + /// The unique identifier of the project that owns this asset. + /// + /// Parameter [typeIdentifier] : + /// The unique identifier of this asset's type. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// Asset description. + /// + /// Parameter [externalIdentifier] : + /// The external identifier of the asset. + /// + /// Parameter [formsInput] : + /// Metadata forms attached to the asset. + /// + /// Parameter [glossaryTerms] : + /// Glossary terms attached to the asset. + /// + /// Parameter [predictionConfiguration] : + /// The configuration of the automatically generated business-friendly + /// metadata for the asset. + /// + /// Parameter [typeRevision] : + /// The revision of this asset's type. + Future createAsset({ + required String domainIdentifier, + required String name, + required String owningProjectIdentifier, + required String typeIdentifier, + String? clientToken, + String? description, + String? externalIdentifier, + List? formsInput, + List? glossaryTerms, + PredictionConfiguration? predictionConfiguration, + String? typeRevision, + }) async { + final $payload = { + 'name': name, + 'owningProjectIdentifier': owningProjectIdentifier, + 'typeIdentifier': typeIdentifier, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (externalIdentifier != null) 'externalIdentifier': externalIdentifier, + if (formsInput != null) 'formsInput': formsInput, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (predictionConfiguration != null) + 'predictionConfiguration': predictionConfiguration, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets', + exceptionFnMap: _exceptionFns, + ); + return CreateAssetOutput.fromJson(response); + } + + /// Creates a revision of the asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The unique identifier of the domain where the asset is being revised. + /// + /// Parameter [identifier] : + /// The identifier of the asset. + /// + /// Parameter [name] : + /// Te revised name of the asset. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// The revised description of the asset. + /// + /// Parameter [formsInput] : + /// The metadata forms to be attached to the asset as part of asset revision. + /// + /// Parameter [glossaryTerms] : + /// The glossary terms to be attached to the asset as part of asset revision. + /// + /// Parameter [predictionConfiguration] : + /// The configuration of the automatically generated business-friendly + /// metadata for the asset. + /// + /// Parameter [typeRevision] : + /// The revision type of the asset. + Future createAssetRevision({ + required String domainIdentifier, + required String identifier, + required String name, + String? clientToken, + String? description, + List? formsInput, + List? glossaryTerms, + PredictionConfiguration? predictionConfiguration, + String? typeRevision, + }) async { + final $payload = { + 'name': name, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (formsInput != null) 'formsInput': formsInput, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (predictionConfiguration != null) + 'predictionConfiguration': predictionConfiguration, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}/revisions', + exceptionFnMap: _exceptionFns, + ); + return CreateAssetRevisionOutput.fromJson(response); + } + + /// Creates a custom asset type. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The unique identifier of the Amazon DataZone domain where the custom asset + /// type is being created. + /// + /// Parameter [formsInput] : + /// The metadata forms that are to be attached to the custom asset type. + /// + /// Parameter [name] : + /// The name of the custom asset type. + /// + /// Parameter [owningProjectIdentifier] : + /// The identifier of the Amazon DataZone project that is to own the custom + /// asset type. + /// + /// Parameter [description] : + /// The descripton of the custom asset type. + Future createAssetType({ + required String domainIdentifier, + required Map formsInput, + required String name, + required String owningProjectIdentifier, + String? description, + }) async { + final $payload = { + 'formsInput': formsInput, + 'name': name, + 'owningProjectIdentifier': owningProjectIdentifier, + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/asset-types', + exceptionFnMap: _exceptionFns, + ); + return CreateAssetTypeOutput.fromJson(response); + } + + /// Creates an Amazon DataZone data source. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where the data source is created. + /// + /// Parameter [environmentIdentifier] : + /// The unique identifier of the Amazon DataZone environment to which the data + /// source publishes assets. + /// + /// Parameter [name] : + /// The name of the data source. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the Amazon DataZone project in which you want to add + /// this data source. + /// + /// Parameter [type] : + /// The type of the data source. + /// + /// Parameter [assetFormsInput] : + /// The metadata forms that are to be attached to the assets that this data + /// source works with. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [configuration] : + /// Specifies the configuration of the data source. It can be set to either + /// glueRunConfiguration or + /// redshiftRunConfiguration. + /// + /// Parameter [description] : + /// The description of the data source. + /// + /// Parameter [enableSetting] : + /// Specifies whether the data source is enabled. + /// + /// Parameter [publishOnImport] : + /// Specifies whether the assets that this data source creates in the + /// inventory are to be also automatically published to the catalog. + /// + /// Parameter [recommendation] : + /// Specifies whether the business name generation is to be enabled for this + /// data source. + /// + /// Parameter [schedule] : + /// The schedule of the data source runs. + Future createDataSource({ + required String domainIdentifier, + required String environmentIdentifier, + required String name, + required String projectIdentifier, + required String type, + List? assetFormsInput, + String? clientToken, + DataSourceConfigurationInput? configuration, + String? description, + EnableSetting? enableSetting, + bool? publishOnImport, + RecommendationConfiguration? recommendation, + ScheduleConfiguration? schedule, + }) async { + final $payload = { + 'environmentIdentifier': environmentIdentifier, + 'name': name, + 'projectIdentifier': projectIdentifier, + 'type': type, + if (assetFormsInput != null) 'assetFormsInput': assetFormsInput, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (configuration != null) 'configuration': configuration, + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (recommendation != null) 'recommendation': recommendation, + if (schedule != null) 'schedule': schedule, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources', + exceptionFnMap: _exceptionFns, + ); + return CreateDataSourceOutput.fromJson(response); + } + + /// Creates an Amazon DataZone domain. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainExecutionRole] : + /// The domain execution role that is created when an Amazon DataZone domain + /// is created. The domain execution role is created in the Amazon Web + /// Services account that houses the Amazon DataZone domain. + /// + /// Parameter [name] : + /// The name of the Amazon DataZone domain. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// The description of the Amazon DataZone domain. + /// + /// Parameter [kmsKeyIdentifier] : + /// The identifier of the Amazon Web Services Key Management Service (KMS) key + /// that is used to encrypt the Amazon DataZone domain, metadata, and + /// reporting data. + /// + /// Parameter [singleSignOn] : + /// The single-sign on configuration of the Amazon DataZone domain. + /// + /// Parameter [tags] : + /// The tags specified for the Amazon DataZone domain. + Future createDomain({ + required String domainExecutionRole, + required String name, + String? clientToken, + String? description, + String? kmsKeyIdentifier, + SingleSignOn? singleSignOn, + Map? tags, + }) async { + final $payload = { + 'domainExecutionRole': domainExecutionRole, + 'name': name, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (kmsKeyIdentifier != null) 'kmsKeyIdentifier': kmsKeyIdentifier, + if (singleSignOn != null) 'singleSignOn': singleSignOn, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v2/domains', + exceptionFnMap: _exceptionFns, + ); + return CreateDomainOutput.fromJson(response); + } + + /// Create an Amazon DataZone environment. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which the environment is + /// created. + /// + /// Parameter [environmentProfileIdentifier] : + /// The identifier of the environment profile that is used to create this + /// Amazon DataZone environment. + /// + /// Parameter [name] : + /// The name of the Amazon DataZone environment. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the Amazon DataZone project in which this environment is + /// created. + /// + /// Parameter [description] : + /// The description of the Amazon DataZone environment. + /// + /// Parameter [glossaryTerms] : + /// The glossary terms that can be used in this Amazon DataZone environment. + /// + /// Parameter [userParameters] : + /// The user parameters of this Amazon DataZone environment. + Future createEnvironment({ + required String domainIdentifier, + required String environmentProfileIdentifier, + required String name, + required String projectIdentifier, + String? description, + List? glossaryTerms, + List? userParameters, + }) async { + final $payload = { + 'environmentProfileIdentifier': environmentProfileIdentifier, + 'name': name, + 'projectIdentifier': projectIdentifier, + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (userParameters != null) 'userParameters': userParameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments', + exceptionFnMap: _exceptionFns, + ); + return CreateEnvironmentOutput.fromJson(response); + } + + /// Creates an Amazon DataZone environment profile. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this environment profile is + /// created. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// The ID of the blueprint with which this environment profile is created. + /// + /// Parameter [name] : + /// The name of this Amazon DataZone environment profile. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the project in which to create the environment profile. + /// + /// Parameter [awsAccountId] : + /// The Amazon Web Services account in which the Amazon DataZone environment + /// is created. + /// + /// Parameter [awsAccountRegion] : + /// The Amazon Web Services region in which this environment profile is + /// created. + /// + /// Parameter [description] : + /// The description of this Amazon DataZone environment profile. + /// + /// Parameter [userParameters] : + /// The user parameters of this Amazon DataZone environment profile. + Future createEnvironmentProfile({ + required String domainIdentifier, + required String environmentBlueprintIdentifier, + required String name, + required String projectIdentifier, + String? awsAccountId, + String? awsAccountRegion, + String? description, + List? userParameters, + }) async { + final $payload = { + 'environmentBlueprintIdentifier': environmentBlueprintIdentifier, + 'name': name, + 'projectIdentifier': projectIdentifier, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (description != null) 'description': description, + if (userParameters != null) 'userParameters': userParameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-profiles', + exceptionFnMap: _exceptionFns, + ); + return CreateEnvironmentProfileOutput.fromJson(response); + } + + /// Creates a metadata form type. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this metadata form type is + /// created. + /// + /// Parameter [model] : + /// The model of this Amazon DataZone metadata form type. + /// + /// Parameter [name] : + /// The name of this Amazon DataZone metadata form type. + /// + /// Parameter [owningProjectIdentifier] : + /// The ID of the Amazon DataZone project that owns this metadata form type. + /// + /// Parameter [description] : + /// The description of this Amazon DataZone metadata form type. + /// + /// Parameter [status] : + /// The status of this Amazon DataZone metadata form type. + Future createFormType({ + required String domainIdentifier, + required Model model, + required String name, + required String owningProjectIdentifier, + String? description, + FormTypeStatus? status, + }) async { + final $payload = { + 'model': model, + 'name': name, + 'owningProjectIdentifier': owningProjectIdentifier, + if (description != null) 'description': description, + if (status != null) 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/form-types', + exceptionFnMap: _exceptionFns, + ); + return CreateFormTypeOutput.fromJson(response); + } + + /// Creates an Amazon DataZone business glossary. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this business glossary is + /// created. + /// + /// Parameter [name] : + /// The name of this business glossary. + /// + /// Parameter [owningProjectIdentifier] : + /// The ID of the project that currently owns business glossary. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// The description of this business glossary. + /// + /// Parameter [status] : + /// The status of this business glossary. + Future createGlossary({ + required String domainIdentifier, + required String name, + required String owningProjectIdentifier, + String? clientToken, + String? description, + GlossaryStatus? status, + }) async { + final $payload = { + 'name': name, + 'owningProjectIdentifier': owningProjectIdentifier, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (status != null) 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossaries', + exceptionFnMap: _exceptionFns, + ); + return CreateGlossaryOutput.fromJson(response); + } + + /// Creates a business glossary term. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this business glossary term + /// is created. + /// + /// Parameter [glossaryIdentifier] : + /// The ID of the business glossary in which this term is created. + /// + /// Parameter [name] : + /// The name of this business glossary term. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [longDescription] : + /// The long description of this business glossary term. + /// + /// Parameter [shortDescription] : + /// The short description of this business glossary term. + /// + /// Parameter [status] : + /// The status of this business glossary term. + /// + /// Parameter [termRelations] : + /// The term relations of this business glossary term. + Future createGlossaryTerm({ + required String domainIdentifier, + required String glossaryIdentifier, + required String name, + String? clientToken, + String? longDescription, + String? shortDescription, + GlossaryTermStatus? status, + TermRelations? termRelations, + }) async { + final $payload = { + 'glossaryIdentifier': glossaryIdentifier, + 'name': name, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (longDescription != null) 'longDescription': longDescription, + if (shortDescription != null) 'shortDescription': shortDescription, + if (status != null) 'status': status.toValue(), + if (termRelations != null) 'termRelations': termRelations, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossary-terms', + exceptionFnMap: _exceptionFns, + ); + return CreateGlossaryTermOutput.fromJson(response); + } + + /// Creates a group profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which the group profile is + /// created. + /// + /// Parameter [groupIdentifier] : + /// The identifier of the group for which the group profile is created. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future createGroupProfile({ + required String domainIdentifier, + required String groupIdentifier, + String? clientToken, + }) async { + final $payload = { + 'groupIdentifier': groupIdentifier, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/group-profiles', + exceptionFnMap: _exceptionFns, + ); + return CreateGroupProfileOutput.fromJson(response); + } + + /// Publishes a listing (a record of an asset at a given time) or removes a + /// listing from the catalog. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [action] : + /// Specifies whether to publish or unpublish a listing. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain. + /// + /// Parameter [entityIdentifier] : + /// The ID of the asset. + /// + /// Parameter [entityType] : + /// The type of an entity. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [entityRevision] : + /// The revision of an asset. + Future createListingChangeSet({ + required ChangeAction action, + required String domainIdentifier, + required String entityIdentifier, + required EntityType entityType, + String? clientToken, + String? entityRevision, + }) async { + final $payload = { + 'action': action.toValue(), + 'entityIdentifier': entityIdentifier, + 'entityType': entityType.toValue(), + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (entityRevision != null) 'entityRevision': entityRevision, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/listings/change-set', + exceptionFnMap: _exceptionFns, + ); + return CreateListingChangeSetOutput.fromJson(response); + } + + /// Creates an Amazon DataZone project. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this project is created. + /// + /// Parameter [name] : + /// The name of the Amazon DataZone project. + /// + /// Parameter [description] : + /// The description of the Amazon DataZone project. + /// + /// Parameter [glossaryTerms] : + /// The glossary terms that can be used in this Amazon DataZone project. + Future createProject({ + required String domainIdentifier, + required String name, + String? description, + List? glossaryTerms, + }) async { + final $payload = { + 'name': name, + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects', + exceptionFnMap: _exceptionFns, + ); + return CreateProjectOutput.fromJson(response); + } + + /// Creates a project membership in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [designation] : + /// The designation of the project membership. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which project membership is + /// created. + /// + /// Parameter [member] : + /// The project member whose project membership was created. + /// + /// Parameter [projectIdentifier] : + /// The ID of the project for which this project membership was created. + Future createProjectMembership({ + required UserDesignation designation, + required String domainIdentifier, + required Member member, + required String projectIdentifier, + }) async { + final $payload = { + 'designation': designation.toValue(), + 'member': member, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(projectIdentifier)}/createMembership', + exceptionFnMap: _exceptionFns, + ); + } + + /// Creates a subsscription grant in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription grant is + /// created. + /// + /// Parameter [environmentIdentifier] : + /// The ID of the environment in which the subscription grant is created. + /// + /// Parameter [grantedEntity] : + /// The entity to which the subscription is to be granted. + /// + /// Parameter [subscriptionTargetIdentifier] : + /// The ID of the subscription target for which the subscription grant is + /// created. + /// + /// Parameter [assetTargetNames] : + /// The names of the assets for which the subscription grant is created. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future createSubscriptionGrant({ + required String domainIdentifier, + required String environmentIdentifier, + required GrantedEntityInput grantedEntity, + required String subscriptionTargetIdentifier, + List? assetTargetNames, + String? clientToken, + }) async { + final $payload = { + 'environmentIdentifier': environmentIdentifier, + 'grantedEntity': grantedEntity, + 'subscriptionTargetIdentifier': subscriptionTargetIdentifier, + if (assetTargetNames != null) 'assetTargetNames': assetTargetNames, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants', + exceptionFnMap: _exceptionFns, + ); + return CreateSubscriptionGrantOutput.fromJson(response); + } + + /// Creates a subscription request in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription request is + /// created. + /// + /// Parameter [requestReason] : + /// The reason for the subscription request. + /// + /// Parameter [subscribedListings] : + /// The published asset for which the subscription grant is to be created. + /// + /// Parameter [subscribedPrincipals] : + /// The Amazon DataZone principals for whom the subscription request is + /// created. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future createSubscriptionRequest({ + required String domainIdentifier, + required String requestReason, + required List subscribedListings, + required List subscribedPrincipals, + String? clientToken, + }) async { + final $payload = { + 'requestReason': requestReason, + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests', + exceptionFnMap: _exceptionFns, + ); + return CreateSubscriptionRequestOutput.fromJson(response); + } + + /// Creates a subscription target in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [applicableAssetTypes] : + /// The asset types that can be included in the subscription target. + /// + /// Parameter [authorizedPrincipals] : + /// The authorized principals of the subscription target. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which subscription target is + /// created. + /// + /// Parameter [environmentIdentifier] : + /// The ID of the environment in which subscription target is created. + /// + /// Parameter [manageAccessRole] : + /// The manage access role that is used to create the subscription target. + /// + /// Parameter [name] : + /// The name of the subscription target. + /// + /// Parameter [subscriptionTargetConfig] : + /// The configuration of the subscription target. + /// + /// Parameter [type] : + /// The type of the subscription target. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [provider] : + /// The provider of the subscription target. + Future createSubscriptionTarget({ + required List applicableAssetTypes, + required List authorizedPrincipals, + required String domainIdentifier, + required String environmentIdentifier, + required String manageAccessRole, + required String name, + required List subscriptionTargetConfig, + required String type, + String? clientToken, + String? provider, + }) async { + final $payload = { + 'applicableAssetTypes': applicableAssetTypes, + 'authorizedPrincipals': authorizedPrincipals, + 'manageAccessRole': manageAccessRole, + 'name': name, + 'subscriptionTargetConfig': subscriptionTargetConfig, + 'type': type, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (provider != null) 'provider': provider, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(environmentIdentifier)}/subscription-targets', + exceptionFnMap: _exceptionFns, + ); + return CreateSubscriptionTargetOutput.fromJson(response); + } + + /// Creates a user profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a user profile is + /// created. + /// + /// Parameter [userIdentifier] : + /// The identifier of the user for which the user profile is created. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [userType] : + /// The user type of the user for which the user profile is created. + Future createUserProfile({ + required String domainIdentifier, + required String userIdentifier, + String? clientToken, + UserType? userType, + }) async { + final $payload = { + 'userIdentifier': userIdentifier, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (userType != null) 'userType': userType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/user-profiles', + exceptionFnMap: _exceptionFns, + ); + return CreateUserProfileOutput.fromJson(response); + } + + /// Delets an asset in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the asset is deleted. + /// + /// Parameter [identifier] : + /// The identifier of the asset that is deleted. + Future deleteAsset({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an asset type in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the asset type is deleted. + /// + /// Parameter [identifier] : + /// The identifier of the asset type that is deleted. + Future deleteAssetType({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/asset-types/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a data source in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the data source is deleted. + /// + /// Parameter [identifier] : + /// The identifier of the data source that is deleted. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future deleteDataSource({ + required String domainIdentifier, + required String identifier, + String? clientToken, + }) async { + final $query = >{ + if (clientToken != null) 'clientToken': [clientToken], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeleteDataSourceOutput.fromJson(response); + } + + /// Deletes a Amazon DataZone domain. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [identifier] : + /// The identifier of the Amazon Web Services domain that is to be deleted. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [skipDeletionCheck] : + /// Specifies the optional flag to delete all child entities within the + /// domain. + Future deleteDomain({ + required String identifier, + String? clientToken, + bool? skipDeletionCheck, + }) async { + final $query = >{ + if (clientToken != null) 'clientToken': [clientToken], + if (skipDeletionCheck != null) + 'skipDeletionCheck': [skipDeletionCheck.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/v2/domains/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return DeleteDomainOutput.fromJson(response); + } + + /// Deletes an environment in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the environment is deleted. + /// + /// Parameter [identifier] : + /// The identifier of the environment that is to be deleted. + Future deleteEnvironment({ + required String domainIdentifier, + required String identifier, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the blueprint configuration in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the blueprint configuration + /// is deleted. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// The ID of the blueprint the configuration of which is deleted. + Future deleteEnvironmentBlueprintConfiguration({ + required String domainIdentifier, + required String environmentBlueprintIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprint-configurations/${Uri.encodeComponent(environmentBlueprintIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes an environment profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the environment profile is + /// deleted. + /// + /// Parameter [identifier] : + /// The ID of the environment profile that is deleted. + Future deleteEnvironmentProfile({ + required String domainIdentifier, + required String identifier, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-profiles/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Delets and metadata form type in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the metadata form type is + /// deleted. + /// + /// Parameter [formTypeIdentifier] : + /// The ID of the metadata form type that is deleted. + Future deleteFormType({ + required String domainIdentifier, + required String formTypeIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/form-types/${Uri.encodeComponent(formTypeIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a business glossary in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the business glossary is + /// deleted. + /// + /// Parameter [identifier] : + /// The ID of the business glossary that is deleted. + Future deleteGlossary({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossaries/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a business glossary term in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the business glossary term + /// is deleted. + /// + /// Parameter [identifier] : + /// The ID of the business glossary term that is deleted. + Future deleteGlossaryTerm({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossary-terms/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a listing (a record of an asset at a given time). + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain. + /// + /// Parameter [identifier] : + /// The ID of the listing to be deleted. + Future deleteListing({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/listings/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a project in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the project is deleted. + /// + /// Parameter [identifier] : + /// The identifier of the project that is to be deleted. + /// + /// Parameter [skipDeletionCheck] : + /// Specifies the optional flag to delete all child entities within the + /// project. + Future deleteProject({ + required String domainIdentifier, + required String identifier, + bool? skipDeletionCheck, + }) async { + final $query = >{ + if (skipDeletionCheck != null) + 'skipDeletionCheck': [skipDeletionCheck.toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes project membership in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where project membership is deleted. + /// + /// Parameter [member] : + /// The project member whose project membership is deleted. + /// + /// Parameter [projectIdentifier] : + /// The ID of the Amazon DataZone project the membership to which is deleted. + Future deleteProjectMembership({ + required String domainIdentifier, + required Member member, + required String projectIdentifier, + }) async { + final $payload = { + 'member': member, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(projectIdentifier)}/deleteMembership', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes and subscription grant in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where the subscription grant is + /// deleted. + /// + /// Parameter [identifier] : + /// The ID of the subscription grant that is deleted. + Future deleteSubscriptionGrant({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return DeleteSubscriptionGrantOutput.fromJson(response); + } + + /// Deletes a subscription request in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription request is + /// deleted. + /// + /// Parameter [identifier] : + /// The ID of the subscription request that is deleted. + Future deleteSubscriptionRequest({ + required String domainIdentifier, + required String identifier, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a subscription target in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription target is + /// deleted. + /// + /// Parameter [environmentIdentifier] : + /// The ID of the Amazon DataZone environment in which the subscription target + /// is deleted. + /// + /// Parameter [identifier] : + /// The ID of the subscription target that is deleted. + Future deleteSubscriptionTarget({ + required String domainIdentifier, + required String environmentIdentifier, + required String identifier, + }) async { + await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(environmentIdentifier)}/subscription-targets/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes the specified time series form for the specified asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain that houses the asset for which you + /// want to delete a time series form. + /// + /// Parameter [entityIdentifier] : + /// The ID of the asset for which you want to delete a time series form. + /// + /// Parameter [entityType] : + /// The type of the asset for which you want to delete a time series form. + /// + /// Parameter [formName] : + /// The name of the time series form that you want to delete. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure idempotency of the request. + /// This field is automatically populated if not provided. + Future deleteTimeSeriesDataPoints({ + required String domainIdentifier, + required String entityIdentifier, + required TimeSeriesEntityType entityType, + required String formName, + String? clientToken, + }) async { + final $query = >{ + 'formName': [formName], + if (clientToken != null) 'clientToken': [clientToken], + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/entities/${Uri.encodeComponent(entityType.toValue())}/${Uri.encodeComponent(entityIdentifier)}/time-series-data-points', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Gets an Amazon DataZone asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain to which the asset belongs. + /// + /// Parameter [identifier] : + /// The ID of the Amazon DataZone asset. + /// + /// Parameter [revision] : + /// The revision of the Amazon DataZone asset. + Future getAsset({ + required String domainIdentifier, + required String identifier, + String? revision, + }) async { + final $query = >{ + if (revision != null) 'revision': [revision], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetAssetOutput.fromJson(response); + } + + /// Gets an Amazon DataZone asset type. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the asset type exists. + /// + /// Parameter [identifier] : + /// The ID of the asset type. + /// + /// Parameter [revision] : + /// The revision of the asset type. + Future getAssetType({ + required String domainIdentifier, + required String identifier, + String? revision, + }) async { + final $query = >{ + if (revision != null) 'revision': [revision], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/asset-types/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetAssetTypeOutput.fromJson(response); + } + + /// Gets an Amazon DataZone data source. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the data source exists. + /// + /// Parameter [identifier] : + /// The ID of the Amazon DataZone data source. + Future getDataSource({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetDataSourceOutput.fromJson(response); + } + + /// Gets an Amazon DataZone data source run. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the domain in which this data source run was performed. + /// + /// Parameter [identifier] : + /// The ID of the data source run. + Future getDataSourceRun({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-source-runs/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetDataSourceRunOutput.fromJson(response); + } + + /// Gets an Amazon DataZone domain. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [identifier] : + /// The identifier of the specified Amazon DataZone domain. + Future getDomain({ + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v2/domains/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetDomainOutput.fromJson(response); + } + + /// Gets an Amazon DataZone environment. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where the environment exists. + /// + /// Parameter [identifier] : + /// The ID of the Amazon DataZone environment. + Future getEnvironment({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetEnvironmentOutput.fromJson(response); + } + + /// Gets an Amazon DataZone blueprint. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the domain in which this blueprint exists. + /// + /// Parameter [identifier] : + /// The ID of this Amazon DataZone blueprint. + Future getEnvironmentBlueprint({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprints/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetEnvironmentBlueprintOutput.fromJson(response); + } + + /// Gets the blueprint configuration in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where this blueprint exists. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// He ID of the blueprint. + Future + getEnvironmentBlueprintConfiguration({ + required String domainIdentifier, + required String environmentBlueprintIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprint-configurations/${Uri.encodeComponent(environmentBlueprintIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetEnvironmentBlueprintConfigurationOutput.fromJson(response); + } + + /// Gets an evinronment profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this environment profile + /// exists. + /// + /// Parameter [identifier] : + /// The ID of the environment profile. + Future getEnvironmentProfile({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-profiles/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetEnvironmentProfileOutput.fromJson(response); + } + + /// Gets a metadata form type in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this metadata form type + /// exists. + /// + /// Parameter [formTypeIdentifier] : + /// The ID of the metadata form type. + /// + /// Parameter [revision] : + /// The revision of this metadata form type. + Future getFormType({ + required String domainIdentifier, + required String formTypeIdentifier, + String? revision, + }) async { + final $query = >{ + if (revision != null) 'revision': [revision], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/form-types/${Uri.encodeComponent(formTypeIdentifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetFormTypeOutput.fromJson(response); + } + + /// Gets a business glossary in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this business glossary + /// exists. + /// + /// Parameter [identifier] : + /// The ID of the business glossary. + Future getGlossary({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossaries/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetGlossaryOutput.fromJson(response); + } + + /// Gets a business glossary term in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which this business glossary term + /// exists. + /// + /// Parameter [identifier] : + /// The ID of the business glossary term. + Future getGlossaryTerm({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossary-terms/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetGlossaryTermOutput.fromJson(response); + } + + /// Gets a group profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which the group profile + /// exists. + /// + /// Parameter [groupIdentifier] : + /// The identifier of the group profile. + Future getGroupProfile({ + required String domainIdentifier, + required String groupIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/group-profiles/${Uri.encodeComponent(groupIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetGroupProfileOutput.fromJson(response); + } + + /// Gets the data portal URL for the specified Amazon DataZone domain. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// the ID of the Amazon DataZone domain the data portal of which you want to + /// get. + Future getIamPortalLoginUrl({ + required String domainIdentifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/get-portal-login-url', + exceptionFnMap: _exceptionFns, + ); + return GetIamPortalLoginUrlOutput.fromJson(response); + } + + /// Gets a listing (a record of an asset at a given time). + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain. + /// + /// Parameter [identifier] : + /// The ID of the listing. + /// + /// Parameter [listingRevision] : + /// The revision of the listing. + Future getListing({ + required String domainIdentifier, + required String identifier, + String? listingRevision, + }) async { + final $query = >{ + if (listingRevision != null) 'listingRevision': [listingRevision], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/listings/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetListingOutput.fromJson(response); + } + + /// Gets a metadata generation run in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain the metadata generation run of which + /// you want to get. + /// + /// Parameter [identifier] : + /// The identifier of the metadata generation run. + Future getMetadataGenerationRun({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/metadata-generation-runs/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetMetadataGenerationRunOutput.fromJson(response); + } + + /// Gets a project in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the project exists. + /// + /// Parameter [identifier] : + /// The ID of the project. + Future getProject({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetProjectOutput.fromJson(response); + } + + /// Gets a subscription in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription exists. + /// + /// Parameter [identifier] : + /// The ID of the subscription. + Future getSubscription({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscriptions/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetSubscriptionOutput.fromJson(response); + } + + /// Gets the subscription grant in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription grant + /// exists. + /// + /// Parameter [identifier] : + /// The ID of the subscription grant. + Future getSubscriptionGrant({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetSubscriptionGrantOutput.fromJson(response); + } + + /// Gets the details of the specified subscription request. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to get the + /// subscription request details. + /// + /// Parameter [identifier] : + /// The identifier of the subscription request the details of which to get. + Future getSubscriptionRequestDetails({ + required String domainIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetSubscriptionRequestDetailsOutput.fromJson(response); + } + + /// Gets the subscription target in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which the subscription target + /// exists. + /// + /// Parameter [environmentIdentifier] : + /// The ID of the environment associated with the subscription target. + /// + /// Parameter [identifier] : + /// The ID of the subscription target. + Future getSubscriptionTarget({ + required String domainIdentifier, + required String environmentIdentifier, + required String identifier, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(environmentIdentifier)}/subscription-targets/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return GetSubscriptionTargetOutput.fromJson(response); + } + + /// Gets the existing data point for the asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain that houses the asset for which you + /// want to get the data point. + /// + /// Parameter [entityIdentifier] : + /// The ID of the asset for which you want to get the data point. + /// + /// Parameter [entityType] : + /// The type of the asset for which you want to get the data point. + /// + /// Parameter [formName] : + /// The name of the time series form that houses the data point that you want + /// to get. + /// + /// Parameter [identifier] : + /// The ID of the data point that you want to get. + Future getTimeSeriesDataPoint({ + required String domainIdentifier, + required String entityIdentifier, + required TimeSeriesEntityType entityType, + required String formName, + required String identifier, + }) async { + final $query = >{ + 'formName': [formName], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/entities/${Uri.encodeComponent(entityType.toValue())}/${Uri.encodeComponent(entityIdentifier)}/time-series-data-points/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetTimeSeriesDataPointOutput.fromJson(response); + } + + /// Gets a user profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// the ID of the Amazon DataZone domain the data portal of which you want to + /// get. + /// + /// Parameter [userIdentifier] : + /// The identifier of the user for which you want to get the user profile. + /// + /// Parameter [type] : + /// The type of the user profile. + Future getUserProfile({ + required String domainIdentifier, + required String userIdentifier, + UserProfileType? type, + }) async { + final $query = >{ + if (type != null) 'type': [type.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/user-profiles/${Uri.encodeComponent(userIdentifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetUserProfileOutput.fromJson(response); + } + + /// Lists the revisions for the asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the domain. + /// + /// Parameter [identifier] : + /// The identifier of the asset. + /// + /// Parameter [maxResults] : + /// The maximum number of revisions to return in a single call to + /// ListAssetRevisions. When the number of revisions to be listed + /// is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListAssetRevisions to list the next set of revisions. + /// + /// Parameter [nextToken] : + /// When the number of revisions is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of revisions, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListAssetRevisions to list the next set of revisions. + Future listAssetRevisions({ + required String domainIdentifier, + required String identifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}/revisions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAssetRevisionsOutput.fromJson(response); + } + + /// Lists data source run activities. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to list data source + /// run activities. + /// + /// Parameter [identifier] : + /// The identifier of the data source run. + /// + /// Parameter [maxResults] : + /// The maximum number of activities to return in a single call to + /// ListDataSourceRunActivities. When the number of activities to + /// be listed is greater than the value of MaxResults, the + /// response contains a NextToken value that you can use in a + /// subsequent call to ListDataSourceRunActivities to list the + /// next set of activities. + /// + /// Parameter [nextToken] : + /// When the number of activities is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of activities, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListDataSourceRunActivities to list the next set of + /// activities. + /// + /// Parameter [status] : + /// The status of the data source run. + Future listDataSourceRunActivities({ + required String domainIdentifier, + required String identifier, + int? maxResults, + String? nextToken, + DataAssetActivityStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-source-runs/${Uri.encodeComponent(identifier)}/activities', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDataSourceRunActivitiesOutput.fromJson(response); + } + + /// Lists data source runs in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [dataSourceIdentifier] : + /// The identifier of the data source. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to invoke the + /// ListDataSourceRuns action. + /// + /// Parameter [maxResults] : + /// The maximum number of runs to return in a single call to + /// ListDataSourceRuns. When the number of runs to be listed is + /// greater than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// ListDataSourceRuns to list the next set of runs. + /// + /// Parameter [nextToken] : + /// When the number of runs is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of runs, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListDataSourceRuns to list the next set of runs. + /// + /// Parameter [status] : + /// The status of the data source. + Future listDataSourceRuns({ + required String dataSourceIdentifier, + required String domainIdentifier, + int? maxResults, + String? nextToken, + DataSourceRunStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources/${Uri.encodeComponent(dataSourceIdentifier)}/runs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDataSourceRunsOutput.fromJson(response); + } + + /// Lists data sources in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to list the data + /// sources. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the project in which to list data sources. + /// + /// Parameter [environmentIdentifier] : + /// The identifier of the environment in which to list the data sources. + /// + /// Parameter [maxResults] : + /// The maximum number of data sources to return in a single call to + /// ListDataSources. When the number of data sources to be listed + /// is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListDataSources to list the next set of data sources. + /// + /// Parameter [name] : + /// The name of the data source. + /// + /// Parameter [nextToken] : + /// When the number of data sources is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of data sources, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListDataSources to list the next set of data sources. + /// + /// Parameter [status] : + /// The status of the data source. + /// + /// Parameter [type] : + /// The type of the data source. + Future listDataSources({ + required String domainIdentifier, + required String projectIdentifier, + String? environmentIdentifier, + int? maxResults, + String? name, + String? nextToken, + DataSourceStatus? status, + String? type, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + 'projectIdentifier': [projectIdentifier], + if (environmentIdentifier != null) + 'environmentIdentifier': [environmentIdentifier], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (name != null) 'name': [name], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + if (type != null) 'type': [type], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDataSourcesOutput.fromJson(response); + } + + /// Lists Amazon DataZone domains. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [maxResults] : + /// The maximum number of domains to return in a single call to + /// ListDomains. When the number of domains to be listed is + /// greater than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// ListDomains to list the next set of domains. + /// + /// Parameter [nextToken] : + /// When the number of domains is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of domains, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListDomains to list the next set of domains. + /// + /// Parameter [status] : + /// The status of the data source. + Future listDomains({ + int? maxResults, + String? nextToken, + DomainStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 25, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/v2/domains', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListDomainsOutput.fromJson(response); + } + + /// Lists blueprint configurations for a Amazon DataZone environment. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [maxResults] : + /// The maximum number of blueprint configurations to return in a single call + /// to ListEnvironmentBlueprintConfigurations. When the number of + /// configurations to be listed is greater than the value of + /// MaxResults, the response contains a NextToken + /// value that you can use in a subsequent call to + /// ListEnvironmentBlueprintConfigurations to list the next set + /// of configurations. + /// + /// Parameter [nextToken] : + /// When the number of blueprint configurations is greater than the default + /// value for the MaxResults parameter, or if you explicitly + /// specify a value for MaxResults that is less than the number + /// of configurations, the response includes a pagination token named + /// NextToken. You can specify this NextToken value + /// in a subsequent call to + /// ListEnvironmentBlueprintConfigurations to list the next set + /// of configurations. + Future + listEnvironmentBlueprintConfigurations({ + required String domainIdentifier, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprint-configurations', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEnvironmentBlueprintConfigurationsOutput.fromJson(response); + } + + /// Lists blueprints in an Amazon DataZone environment. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [managed] : + /// Specifies whether the environment blueprint is managed by Amazon DataZone. + /// + /// Parameter [maxResults] : + /// The maximum number of blueprints to return in a single call to + /// ListEnvironmentBlueprints. When the number of blueprints to + /// be listed is greater than the value of MaxResults, the + /// response contains a NextToken value that you can use in a + /// subsequent call to ListEnvironmentBlueprints to list the next + /// set of blueprints. + /// + /// Parameter [name] : + /// The name of the Amazon DataZone environment. + /// + /// Parameter [nextToken] : + /// When the number of blueprints in the environment is greater than the + /// default value for the MaxResults parameter, or if you + /// explicitly specify a value for MaxResults that is less than + /// the number of blueprints in the environment, the response includes a + /// pagination token named NextToken. You can specify this + /// NextToken value in a subsequent call to + /// ListEnvironmentBlueprintsto list the next set of blueprints. + Future listEnvironmentBlueprints({ + required String domainIdentifier, + bool? managed, + int? maxResults, + String? name, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (managed != null) 'managed': [managed.toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (name != null) 'name': [name], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprints', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEnvironmentBlueprintsOutput.fromJson(response); + } + + /// Lists Amazon DataZone environment profiles. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [awsAccountId] : + /// The identifier of the Amazon Web Services account where you want to list + /// environment profiles. + /// + /// Parameter [awsAccountRegion] : + /// The Amazon Web Services region where you want to list environment + /// profiles. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// The identifier of the blueprint that was used to create the environment + /// profiles that you want to list. + /// + /// Parameter [maxResults] : + /// The maximum number of environment profiles to return in a single call to + /// ListEnvironmentProfiles. When the number of environment + /// profiles to be listed is greater than the value of + /// MaxResults, the response contains a NextToken + /// value that you can use in a subsequent call to + /// ListEnvironmentProfiles to list the next set of environment + /// profiles. + /// + /// Parameter [name] : + ///

      + /// + /// Parameter [nextToken] : + /// When the number of environment profiles is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// environment profiles, the response includes a pagination token named + /// NextToken. You can specify this NextToken value + /// in a subsequent call to ListEnvironmentProfiles to list the + /// next set of environment profiles. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the Amazon DataZone project. + Future listEnvironmentProfiles({ + required String domainIdentifier, + String? awsAccountId, + String? awsAccountRegion, + String? environmentBlueprintIdentifier, + int? maxResults, + String? name, + String? nextToken, + String? projectIdentifier, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (awsAccountId != null) 'awsAccountId': [awsAccountId], + if (awsAccountRegion != null) 'awsAccountRegion': [awsAccountRegion], + if (environmentBlueprintIdentifier != null) + 'environmentBlueprintIdentifier': [environmentBlueprintIdentifier], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (name != null) 'name': [name], + if (nextToken != null) 'nextToken': [nextToken], + if (projectIdentifier != null) 'projectIdentifier': [projectIdentifier], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-profiles', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEnvironmentProfilesOutput.fromJson(response); + } + + /// Lists Amazon DataZone environments. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the Amazon DataZone project. + /// + /// Parameter [awsAccountId] : + /// The identifier of the Amazon Web Services account where you want to list + /// environments. + /// + /// Parameter [awsAccountRegion] : + /// The Amazon Web Services region where you want to list environments. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// The identifier of the Amazon DataZone blueprint. + /// + /// Parameter [environmentProfileIdentifier] : + /// The identifier of the environment profile. + /// + /// Parameter [maxResults] : + /// The maximum number of environments to return in a single call to + /// ListEnvironments. When the number of environments to be + /// listed is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListEnvironments to list the next set of + /// environments. + /// + /// Parameter [name] : + /// The name of the environment. + /// + /// Parameter [nextToken] : + /// When the number of environments is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of environments, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListEnvironments to list the next set of environments. + /// + /// Parameter [provider] : + /// The provider of the environment. + /// + /// Parameter [status] : + /// The status of the environments that you want to list. + Future listEnvironments({ + required String domainIdentifier, + required String projectIdentifier, + String? awsAccountId, + String? awsAccountRegion, + String? environmentBlueprintIdentifier, + String? environmentProfileIdentifier, + int? maxResults, + String? name, + String? nextToken, + String? provider, + EnvironmentStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + 'projectIdentifier': [projectIdentifier], + if (awsAccountId != null) 'awsAccountId': [awsAccountId], + if (awsAccountRegion != null) 'awsAccountRegion': [awsAccountRegion], + if (environmentBlueprintIdentifier != null) + 'environmentBlueprintIdentifier': [environmentBlueprintIdentifier], + if (environmentProfileIdentifier != null) + 'environmentProfileIdentifier': [environmentProfileIdentifier], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (name != null) 'name': [name], + if (nextToken != null) 'nextToken': [nextToken], + if (provider != null) 'provider': [provider], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListEnvironmentsOutput.fromJson(response); + } + + /// Lists all metadata generation runs. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where you want to list metadata + /// generation runs. + /// + /// Parameter [maxResults] : + /// The maximum number of metadata generation runs to return in a single call + /// to ListMetadataGenerationRuns. When the number of metadata generation runs + /// to be listed is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent call to + /// ListMetadataGenerationRuns to list the next set of revisions. + /// + /// Parameter [nextToken] : + /// When the number of metadata generation runs is greater than the default + /// value for the MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of metadata generation runs, + /// the response includes a pagination token named NextToken. You can specify + /// this NextToken value in a subsequent call to ListMetadataGenerationRuns to + /// list the next set of revisions. + /// + /// Parameter [status] : + /// The status of the metadata generation runs. + /// + /// Parameter [type] : + /// The type of the metadata generation runs. + Future listMetadataGenerationRuns({ + required String domainIdentifier, + int? maxResults, + String? nextToken, + MetadataGenerationRunStatus? status, + MetadataGenerationRunType? type, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + if (type != null) 'type': [type.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/metadata-generation-runs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListMetadataGenerationRunsOutput.fromJson(response); + } + + /// Lists all Amazon DataZone notifications. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [type] : + /// The type of notifications. + /// + /// Parameter [afterTimestamp] : + /// The time after which you want to list notifications. + /// + /// Parameter [beforeTimestamp] : + /// The time before which you want to list notifications. + /// + /// Parameter [maxResults] : + /// The maximum number of notifications to return in a single call to + /// ListNotifications. When the number of notifications to be + /// listed is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListNotifications to list the next set of + /// notifications. + /// + /// Parameter [nextToken] : + /// When the number of notifications is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of notifications, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListNotifications to list the next set of notifications. + /// + /// Parameter [subjects] : + /// The subjects of notifications. + /// + /// Parameter [taskStatus] : + /// The task status of notifications. + Future listNotifications({ + required String domainIdentifier, + required NotificationType type, + DateTime? afterTimestamp, + DateTime? beforeTimestamp, + int? maxResults, + String? nextToken, + List? subjects, + TaskStatus? taskStatus, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + 'type': [type.toValue()], + if (afterTimestamp != null) + 'afterTimestamp': [_s.iso8601ToJson(afterTimestamp).toString()], + if (beforeTimestamp != null) + 'beforeTimestamp': [_s.iso8601ToJson(beforeTimestamp).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (subjects != null) 'subjects': subjects, + if (taskStatus != null) 'taskStatus': [taskStatus.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/notifications', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListNotificationsOutput.fromJson(response); + } + + /// Lists all members of the specified project. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which you want to list + /// project memberships. + /// + /// Parameter [projectIdentifier] : + /// The identifier of the project whose memberships you want to list. + /// + /// Parameter [maxResults] : + /// The maximum number of memberships to return in a single call to + /// ListProjectMemberships. When the number of memberships to be + /// listed is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListProjectMemberships to list the next set of + /// memberships. + /// + /// Parameter [nextToken] : + /// When the number of memberships is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of memberships, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListProjectMemberships to list the next set of memberships. + /// + /// Parameter [sortBy] : + /// The method by which you want to sort the project memberships. + /// + /// Parameter [sortOrder] : + /// The sort order of the project memberships. + Future listProjectMemberships({ + required String domainIdentifier, + required String projectIdentifier, + int? maxResults, + String? nextToken, + SortFieldProject? sortBy, + SortOrder? sortOrder, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(projectIdentifier)}/memberships', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListProjectMembershipsOutput.fromJson(response); + } + + /// Lists Amazon DataZone projects. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [groupIdentifier] : + /// The identifier of a group. + /// + /// Parameter [maxResults] : + /// The maximum number of projects to return in a single call to + /// ListProjects. When the number of projects to be listed is + /// greater than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// ListProjects to list the next set of projects. + /// + /// Parameter [name] : + /// The name of the project. + /// + /// Parameter [nextToken] : + /// When the number of projects is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of projects, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListProjects to list the next set of projects. + /// + /// Parameter [userIdentifier] : + /// The identifier of the Amazon DataZone user. + Future listProjects({ + required String domainIdentifier, + String? groupIdentifier, + int? maxResults, + String? name, + String? nextToken, + String? userIdentifier, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (groupIdentifier != null) 'groupIdentifier': [groupIdentifier], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (name != null) 'name': [name], + if (nextToken != null) 'nextToken': [nextToken], + if (userIdentifier != null) 'userIdentifier': [userIdentifier], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListProjectsOutput.fromJson(response); + } + + /// Lists subscription grants. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [environmentId] : + /// The identifier of the Amazon DataZone environment. + /// + /// Parameter [maxResults] : + /// The maximum number of subscription grants to return in a single call to + /// ListSubscriptionGrants. When the number of subscription + /// grants to be listed is greater than the value of MaxResults, + /// the response contains a NextToken value that you can use in a + /// subsequent call to ListSubscriptionGrants to list the next + /// set of subscription grants. + /// + /// Parameter [nextToken] : + /// When the number of subscription grants is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// subscription grants, the response includes a pagination token named + /// NextToken. You can specify this NextToken value + /// in a subsequent call to ListSubscriptionGrants to list the + /// next set of subscription grants. + /// + /// Parameter [sortBy] : + /// Specifies the way of sorting the results of this action. + /// + /// Parameter [sortOrder] : + /// Specifies the sort order of this action. + /// + /// Parameter [subscribedListingId] : + /// The identifier of the subscribed listing. + /// + /// Parameter [subscriptionId] : + /// The identifier of the subscription. + /// + /// Parameter [subscriptionTargetId] : + /// The identifier of the subscription target. + Future listSubscriptionGrants({ + required String domainIdentifier, + String? environmentId, + int? maxResults, + String? nextToken, + SortKey? sortBy, + SortOrder? sortOrder, + String? subscribedListingId, + String? subscriptionId, + String? subscriptionTargetId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (environmentId != null) 'environmentId': [environmentId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (subscribedListingId != null) + 'subscribedListingId': [subscribedListingId], + if (subscriptionId != null) 'subscriptionId': [subscriptionId], + if (subscriptionTargetId != null) + 'subscriptionTargetId': [subscriptionTargetId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSubscriptionGrantsOutput.fromJson(response); + } + + /// Lists Amazon DataZone subscription requests. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [approverProjectId] : + /// The identifier of the subscription request approver's project. + /// + /// Parameter [maxResults] : + /// The maximum number of subscription requests to return in a single call to + /// ListSubscriptionRequests. When the number of subscription + /// requests to be listed is greater than the value of + /// MaxResults, the response contains a NextToken + /// value that you can use in a subsequent call to + /// ListSubscriptionRequests to list the next set of subscription + /// requests. + /// + /// Parameter [nextToken] : + /// When the number of subscription requests is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// subscription requests, the response includes a pagination token named + /// NextToken. You can specify this NextToken value + /// in a subsequent call to ListSubscriptionRequests to list the + /// next set of subscription requests. + /// + /// Parameter [owningProjectId] : + /// The identifier of the project for the subscription requests. + /// + /// Parameter [sortBy] : + /// Specifies the way to sort the results of this action. + /// + /// Parameter [sortOrder] : + /// Specifies the sort order for the results of this action. + /// + /// Parameter [status] : + /// Specifies the status of the subscription requests. + /// + /// Parameter [subscribedListingId] : + /// The identifier of the subscribed listing. + Future listSubscriptionRequests({ + required String domainIdentifier, + String? approverProjectId, + int? maxResults, + String? nextToken, + String? owningProjectId, + SortKey? sortBy, + SortOrder? sortOrder, + SubscriptionRequestStatus? status, + String? subscribedListingId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (approverProjectId != null) 'approverProjectId': [approverProjectId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (owningProjectId != null) 'owningProjectId': [owningProjectId], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (status != null) 'status': [status.toValue()], + if (subscribedListingId != null) + 'subscribedListingId': [subscribedListingId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSubscriptionRequestsOutput.fromJson(response); + } + + /// Lists subscription targets in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain where you want to list + /// subscription targets. + /// + /// Parameter [environmentIdentifier] : + /// The identifier of the environment where you want to list subscription + /// targets. + /// + /// Parameter [maxResults] : + /// The maximum number of subscription targets to return in a single call to + /// ListSubscriptionTargets. When the number of subscription + /// targets to be listed is greater than the value of MaxResults, + /// the response contains a NextToken value that you can use in a + /// subsequent call to ListSubscriptionTargets to list the next + /// set of subscription targets. + /// + /// Parameter [nextToken] : + /// When the number of subscription targets is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// subscription targets, the response includes a pagination token named + /// NextToken. You can specify this NextToken value + /// in a subsequent call to ListSubscriptionTargets to list the + /// next set of subscription targets. + /// + /// Parameter [sortBy] : + /// Specifies the way in which the results of this action are to be sorted. + /// + /// Parameter [sortOrder] : + /// Specifies the sort order for the results of this action. + Future listSubscriptionTargets({ + required String domainIdentifier, + required String environmentIdentifier, + int? maxResults, + String? nextToken, + SortKey? sortBy, + SortOrder? sortOrder, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(environmentIdentifier)}/subscription-targets', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSubscriptionTargetsOutput.fromJson(response); + } + + /// Lists subscriptions in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [approverProjectId] : + /// The identifier of the project for the subscription's approver. + /// + /// Parameter [maxResults] : + /// The maximum number of subscriptions to return in a single call to + /// ListSubscriptions. When the number of subscriptions to be + /// listed is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to ListSubscriptions to list the next set of + /// Subscriptions. + /// + /// Parameter [nextToken] : + /// When the number of subscriptions is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of subscriptions, + /// the response includes a pagination token named NextToken. You + /// can specify this NextToken value in a subsequent call to + /// ListSubscriptions to list the next set of subscriptions. + /// + /// Parameter [owningProjectId] : + /// The identifier of the owning project. + /// + /// Parameter [sortBy] : + /// Specifies the way in which the results of this action are to be sorted. + /// + /// Parameter [sortOrder] : + /// Specifies the sort order for the results of this action. + /// + /// Parameter [status] : + /// The status of the subscriptions that you want to list. + /// + /// Parameter [subscribedListingId] : + /// The identifier of the subscribed listing for the subscriptions that you + /// want to list. + /// + /// Parameter [subscriptionRequestIdentifier] : + /// The identifier of the subscription request for the subscriptions that you + /// want to list. + Future listSubscriptions({ + required String domainIdentifier, + String? approverProjectId, + int? maxResults, + String? nextToken, + String? owningProjectId, + SortKey? sortBy, + SortOrder? sortOrder, + SubscriptionStatus? status, + String? subscribedListingId, + String? subscriptionRequestIdentifier, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + if (approverProjectId != null) 'approverProjectId': [approverProjectId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (owningProjectId != null) 'owningProjectId': [owningProjectId], + if (sortBy != null) 'sortBy': [sortBy.toValue()], + if (sortOrder != null) 'sortOrder': [sortOrder.toValue()], + if (status != null) 'status': [status.toValue()], + if (subscribedListingId != null) + 'subscribedListingId': [subscribedListingId], + if (subscriptionRequestIdentifier != null) + 'subscriptionRequestIdentifier': [subscriptionRequestIdentifier], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscriptions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSubscriptionsOutput.fromJson(response); + } + + /// Lists tags for the specified resource in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource whose tags you want to list. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Lists time series data points. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain that houses the assets for which you + /// want to list time series data points. + /// + /// Parameter [entityIdentifier] : + /// The ID of the asset for which you want to list data points. + /// + /// Parameter [entityType] : + /// The type of the asset for which you want to list data points. + /// + /// Parameter [formName] : + /// The name of the time series data points form. + /// + /// Parameter [endedAt] : + /// The timestamp at which the data points that you wanted to list ended. + /// + /// Parameter [maxResults] : + /// The maximum number of data points to return in a single call to + /// ListTimeSeriesDataPoints. When the number of data points to be listed is + /// greater than the value of MaxResults, the response contains a NextToken + /// value that you can use in a subsequent call to ListTimeSeriesDataPoints to + /// list the next set of data points. + /// + /// Parameter [nextToken] : + /// When the number of data points is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for MaxResults + /// that is less than the number of data points, the response includes a + /// pagination token named NextToken. You can specify this NextToken value in + /// a subsequent call to ListTimeSeriesDataPoints to list the next set of data + /// points. + /// + /// Parameter [startedAt] : + /// The timestamp at which the data points that you want to list started. + Future listTimeSeriesDataPoints({ + required String domainIdentifier, + required String entityIdentifier, + required TimeSeriesEntityType entityType, + required String formName, + DateTime? endedAt, + int? maxResults, + String? nextToken, + DateTime? startedAt, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $query = >{ + 'formName': [formName], + if (endedAt != null) 'endedAt': [_s.iso8601ToJson(endedAt).toString()], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (startedAt != null) + 'startedAt': [_s.iso8601ToJson(startedAt).toString()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/entities/${Uri.encodeComponent(entityType.toValue())}/${Uri.encodeComponent(entityIdentifier)}/time-series-data-points', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTimeSeriesDataPointsOutput.fromJson(response); + } + + /// Posts time series data points to Amazon DataZone for the specified asset. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain in which you want to post time series + /// data points. + /// + /// Parameter [entityIdentifier] : + /// The ID of the asset for which you want to post time series data points. + /// + /// Parameter [entityType] : + /// The type of the asset for which you want to post data points. + /// + /// Parameter [forms] : + /// The forms that contain the data points that you want to post. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future postTimeSeriesDataPoints({ + required String domainIdentifier, + required String entityIdentifier, + required TimeSeriesEntityType entityType, + required List forms, + String? clientToken, + }) async { + final $payload = { + 'forms': forms, + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/entities/${Uri.encodeComponent(entityType.toValue())}/${Uri.encodeComponent(entityIdentifier)}/time-series-data-points', + exceptionFnMap: _exceptionFns, + ); + return PostTimeSeriesDataPointsOutput.fromJson(response); + } + + /// Writes the configuration for the specified environment blueprint in Amazon + /// DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [enabledRegions] : + /// Specifies the enabled Amazon Web Services Regions. + /// + /// Parameter [environmentBlueprintIdentifier] : + /// The identifier of the environment blueprint. + /// + /// Parameter [manageAccessRoleArn] : + /// The ARN of the manage access role. + /// + /// Parameter [provisioningRoleArn] : + /// The ARN of the provisioning role. + /// + /// Parameter [regionalParameters] : + /// The regional parameters in the environment blueprint. + Future + putEnvironmentBlueprintConfiguration({ + required String domainIdentifier, + required List enabledRegions, + required String environmentBlueprintIdentifier, + String? manageAccessRoleArn, + String? provisioningRoleArn, + Map>? regionalParameters, + }) async { + final $payload = { + 'enabledRegions': enabledRegions, + if (manageAccessRoleArn != null) + 'manageAccessRoleArn': manageAccessRoleArn, + if (provisioningRoleArn != null) + 'provisioningRoleArn': provisioningRoleArn, + if (regionalParameters != null) 'regionalParameters': regionalParameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-blueprint-configurations/${Uri.encodeComponent(environmentBlueprintIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return PutEnvironmentBlueprintConfigurationOutput.fromJson(response); + } + + /// Rejects automatically generated business-friendly metadata for your Amazon + /// DataZone assets. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [identifier] : + /// The identifier of the prediction. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [rejectChoices] : + /// Specifies the prediction (aka, the automatically generated piece of + /// metadata) and the target (for example, a column name) that can be + /// rejected. + /// + /// Parameter [rejectRule] : + /// Specifies the rule (or the conditions) under which a prediction can be + /// rejected. + /// + /// Parameter [revision] : + /// The revision that is to be made to the asset. + Future rejectPredictions({ + required String domainIdentifier, + required String identifier, + String? clientToken, + List? rejectChoices, + RejectRule? rejectRule, + String? revision, + }) async { + final $query = >{ + if (revision != null) 'revision': [revision], + }; + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (rejectChoices != null) 'rejectChoices': rejectChoices, + if (rejectRule != null) 'rejectRule': rejectRule, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/assets/${Uri.encodeComponent(identifier)}/reject-predictions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return RejectPredictionsOutput.fromJson(response); + } + + /// Rejects the specified subscription request. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which the subscription + /// request was rejected. + /// + /// Parameter [identifier] : + /// The identifier of the subscription request that was rejected. + /// + /// Parameter [decisionComment] : + /// The decision comment of the rejected subscription request. + Future rejectSubscriptionRequest({ + required String domainIdentifier, + required String identifier, + String? decisionComment, + }) async { + final $payload = { + if (decisionComment != null) 'decisionComment': decisionComment, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests/${Uri.encodeComponent(identifier)}/reject', + exceptionFnMap: _exceptionFns, + ); + return RejectSubscriptionRequestOutput.fromJson(response); + } + + /// Revokes a specified subscription in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain where you want to revoke a + /// subscription. + /// + /// Parameter [identifier] : + /// The identifier of the revoked subscription. + /// + /// Parameter [retainPermissions] : + /// Specifies whether permissions are retained when the subscription is + /// revoked. + Future revokeSubscription({ + required String domainIdentifier, + required String identifier, + bool? retainPermissions, + }) async { + final $payload = { + if (retainPermissions != null) 'retainPermissions': retainPermissions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscriptions/${Uri.encodeComponent(identifier)}/revoke', + exceptionFnMap: _exceptionFns, + ); + return RevokeSubscriptionOutput.fromJson(response); + } + + /// Searches for assets in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain. + /// + /// Parameter [searchScope] : + /// The scope of the search. + /// + /// Parameter [additionalAttributes] : + /// Specifies additional attributes for the Search action. + /// + /// Parameter [filters] : + /// Specifies the search filters. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call to + /// Search. When the number of results to be listed is greater + /// than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// Search to list the next set of results. + /// + /// Parameter [nextToken] : + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// Search to list the next set of results. + /// + /// Parameter [owningProjectIdentifier] : + /// The identifier of the owning project specified for the search. + /// + /// Parameter [searchIn] : + /// The details of the search. + /// + /// Parameter [searchText] : + /// Specifies the text for which to search. + /// + /// Parameter [sort] : + /// Specifies the way in which the search results are to be sorted. + Future search({ + required String domainIdentifier, + required InventorySearchScope searchScope, + List? additionalAttributes, + FilterClause? filters, + int? maxResults, + String? nextToken, + String? owningProjectIdentifier, + List? searchIn, + String? searchText, + SearchSort? sort, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $payload = { + 'searchScope': searchScope.toValue(), + if (additionalAttributes != null) + 'additionalAttributes': + additionalAttributes.map((e) => e.toValue()).toList(), + if (filters != null) 'filters': filters, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (owningProjectIdentifier != null) + 'owningProjectIdentifier': owningProjectIdentifier, + if (searchIn != null) 'searchIn': searchIn, + if (searchText != null) 'searchText': searchText, + if (sort != null) 'sort': sort, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/search', + exceptionFnMap: _exceptionFns, + ); + return SearchOutput.fromJson(response); + } + + /// Searches group profiles in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which you want to search + /// group profiles. + /// + /// Parameter [groupType] : + /// The group type for which to search. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call to + /// SearchGroupProfiles. When the number of results to be listed + /// is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to SearchGroupProfiles to list the next set of results. + /// + /// Parameter [nextToken] : + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchGroupProfiles to list the next set of results. + /// + /// Parameter [searchText] : + /// Specifies the text for which to search. + Future searchGroupProfiles({ + required String domainIdentifier, + required GroupSearchType groupType, + int? maxResults, + String? nextToken, + String? searchText, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $payload = { + 'groupType': groupType.toValue(), + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (searchText != null) 'searchText': searchText, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/search-group-profiles', + exceptionFnMap: _exceptionFns, + ); + return SearchGroupProfilesOutput.fromJson(response); + } + + /// Searches listings (records of an asset at a given time) in Amazon + /// DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the domain in which to search listings. + /// + /// Parameter [additionalAttributes] : + /// Specifies additional attributes for the search. + /// + /// Parameter [filters] : + /// Specifies the filters for the search of listings. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call to + /// SearchListings. When the number of results to be listed is + /// greater than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// SearchListings to list the next set of results. + /// + /// Parameter [nextToken] : + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchListings to list the next set of results. + /// + /// Parameter [searchIn] : + /// The details of the search. + /// + /// Parameter [searchText] : + /// Specifies the text for which to search. + /// + /// Parameter [sort] : + /// Specifies the way for sorting the search results. + Future searchListings({ + required String domainIdentifier, + List? additionalAttributes, + FilterClause? filters, + int? maxResults, + String? nextToken, + List? searchIn, + String? searchText, + SearchSort? sort, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $payload = { + if (additionalAttributes != null) + 'additionalAttributes': + additionalAttributes.map((e) => e.toValue()).toList(), + if (filters != null) 'filters': filters, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (searchIn != null) 'searchIn': searchIn, + if (searchText != null) 'searchText': searchText, + if (sort != null) 'sort': sort, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/listings/search', + exceptionFnMap: _exceptionFns, + ); + return SearchListingsOutput.fromJson(response); + } + + /// Searches for types in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to invoke the + /// SearchTypes action. + /// + /// Parameter [managed] : + /// Specifies whether the search is managed. + /// + /// Parameter [searchScope] : + /// Specifies the scope of the search for types. + /// + /// Parameter [filters] : + /// The filters for the SearchTypes action. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call to + /// SearchTypes. When the number of results to be listed is + /// greater than the value of MaxResults, the response contains a + /// NextToken value that you can use in a subsequent call to + /// SearchTypes to list the next set of results. + /// + /// Parameter [nextToken] : + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchTypes to list the next set of results. + /// + /// Parameter [searchIn] : + /// The details of the search. + /// + /// Parameter [searchText] : + /// Specifies the text for which to search. + /// + /// Parameter [sort] : + /// The specifies the way to sort the SearchTypes results. + Future searchTypes({ + required String domainIdentifier, + required bool managed, + required TypesSearchScope searchScope, + FilterClause? filters, + int? maxResults, + String? nextToken, + List? searchIn, + String? searchText, + SearchSort? sort, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $payload = { + 'managed': managed, + 'searchScope': searchScope.toValue(), + if (filters != null) 'filters': filters, + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (searchIn != null) 'searchIn': searchIn, + if (searchText != null) 'searchText': searchText, + if (sort != null) 'sort': sort, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/types-search', + exceptionFnMap: _exceptionFns, + ); + return SearchTypesOutput.fromJson(response); + } + + /// Searches user profiles in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which you want to search + /// user profiles. + /// + /// Parameter [userType] : + /// Specifies the user type for the SearchUserProfiles action. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return in a single call to + /// SearchUserProfiles. When the number of results to be listed + /// is greater than the value of MaxResults, the response + /// contains a NextToken value that you can use in a subsequent + /// call to SearchUserProfiles to list the next set of results. + /// + /// Parameter [nextToken] : + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchUserProfiles to list the next set of results. + /// + /// Parameter [searchText] : + /// Specifies the text for which to search. + Future searchUserProfiles({ + required String domainIdentifier, + required UserSearchType userType, + int? maxResults, + String? nextToken, + String? searchText, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 50, + ); + final $payload = { + 'userType': userType.toValue(), + if (maxResults != null) 'maxResults': maxResults, + if (nextToken != null) 'nextToken': nextToken, + if (searchText != null) 'searchText': searchText, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/search-user-profiles', + exceptionFnMap: _exceptionFns, + ); + return SearchUserProfilesOutput.fromJson(response); + } + + /// Start the run of the specified data source in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [dataSourceIdentifier] : + /// The identifier of the data source. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which to start a data + /// source run. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + Future startDataSourceRun({ + required String dataSourceIdentifier, + required String domainIdentifier, + String? clientToken, + }) async { + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources/${Uri.encodeComponent(dataSourceIdentifier)}/runs', + exceptionFnMap: _exceptionFns, + ); + return StartDataSourceRunOutput.fromJson(response); + } + + /// Starts the metadata generation run. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The ID of the Amazon DataZone domain where you want to start a metadata + /// generation run. + /// + /// Parameter [owningProjectIdentifier] : + /// The ID of the project that owns the asset for which you want to start a + /// metadata generation run. + /// + /// Parameter [target] : + /// The asset for which you want to start a metadata generation run. + /// + /// Parameter [type] : + /// The type of the metadata generation run. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier to ensure idempotency of the request. + /// This field is automatically populated if not provided. + Future startMetadataGenerationRun({ + required String domainIdentifier, + required String owningProjectIdentifier, + required MetadataGenerationRunTarget target, + required MetadataGenerationRunType type, + String? clientToken, + }) async { + final $payload = { + 'owningProjectIdentifier': owningProjectIdentifier, + 'target': target, + 'type': type.toValue(), + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/metadata-generation-runs', + exceptionFnMap: _exceptionFns, + ); + return StartMetadataGenerationRunOutput.fromJson(response); + } + + /// Tags a resource in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource to be tagged in Amazon DataZone. + /// + /// Parameter [tags] : + /// Specifies the tags for the TagResource action. + Future tagResource({ + required String resourceArn, + required Map tags, + }) async { + final $payload = { + 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Untags a resource in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource to be untagged in Amazon DataZone. + /// + /// Parameter [tagKeys] : + /// Specifies the tag keys for the UntagResource action. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates the specified data source in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the domain in which to update a data source. + /// + /// Parameter [identifier] : + /// The identifier of the data source to be updated. + /// + /// Parameter [assetFormsInput] : + /// The asset forms to be updated as part of the UpdateDataSource + /// action. + /// + /// Parameter [configuration] : + /// The configuration to be updated as part of the + /// UpdateDataSource action. + /// + /// Parameter [description] : + /// The description to be updated as part of the UpdateDataSource + /// action. + /// + /// Parameter [enableSetting] : + /// The enable setting to be updated as part of the + /// UpdateDataSource action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateDataSource + /// action. + /// + /// Parameter [publishOnImport] : + /// The publish on import setting to be updated as part of the + /// UpdateDataSource action. + /// + /// Parameter [recommendation] : + /// The recommendation to be updated as part of the + /// UpdateDataSource action. + /// + /// Parameter [schedule] : + /// The schedule to be updated as part of the UpdateDataSource + /// action. + Future updateDataSource({ + required String domainIdentifier, + required String identifier, + List? assetFormsInput, + DataSourceConfigurationInput? configuration, + String? description, + EnableSetting? enableSetting, + String? name, + bool? publishOnImport, + RecommendationConfiguration? recommendation, + ScheduleConfiguration? schedule, + }) async { + final $payload = { + if (assetFormsInput != null) 'assetFormsInput': assetFormsInput, + if (configuration != null) 'configuration': configuration, + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (name != null) 'name': name, + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (recommendation != null) 'recommendation': recommendation, + if (schedule != null) 'schedule': schedule, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateDataSourceOutput.fromJson(response); + } + + /// Updates a Amazon DataZone domain. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [identifier] : + /// The ID of the Amazon Web Services domain that is to be updated. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// The description to be updated as part of the UpdateDomain + /// action. + /// + /// Parameter [domainExecutionRole] : + /// The domain execution role to be updated as part of the + /// UpdateDomain action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateDomain action. + /// + /// Parameter [singleSignOn] : + /// The single sign-on option to be updated as part of the + /// UpdateDomain action. + Future updateDomain({ + required String identifier, + String? clientToken, + String? description, + String? domainExecutionRole, + String? name, + SingleSignOn? singleSignOn, + }) async { + final $query = >{ + if (clientToken != null) 'clientToken': [clientToken], + }; + final $payload = { + if (description != null) 'description': description, + if (domainExecutionRole != null) + 'domainExecutionRole': domainExecutionRole, + if (name != null) 'name': name, + if (singleSignOn != null) 'singleSignOn': singleSignOn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: '/v2/domains/${Uri.encodeComponent(identifier)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return UpdateDomainOutput.fromJson(response); + } + + /// Updates the specified environment in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the domain in which the environment is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the environment that is to be updated. + /// + /// Parameter [description] : + /// The description to be updated as part of the + /// UpdateEnvironment action. + /// + /// Parameter [glossaryTerms] : + /// The glossary terms to be updated as part of the + /// UpdateEnvironment action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateEnvironment + /// action. + Future updateEnvironment({ + required String domainIdentifier, + required String identifier, + String? description, + List? glossaryTerms, + String? name, + }) async { + final $payload = { + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (name != null) 'name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateEnvironmentOutput.fromJson(response); + } + + /// Updates the specified environment profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which an environment + /// profile is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the environment profile that is to be updated. + /// + /// Parameter [awsAccountId] : + /// The Amazon Web Services account in which a specified environment profile + /// is to be udpated. + /// + /// Parameter [awsAccountRegion] : + /// The Amazon Web Services Region in which a specified environment profile is + /// to be updated. + /// + /// Parameter [description] : + /// The description to be updated as part of the + /// UpdateEnvironmentProfile action. + /// + /// Parameter [name] : + /// The name to be updated as part of the + /// UpdateEnvironmentProfile action. + /// + /// Parameter [userParameters] : + /// The user parameters to be updated as part of the + /// UpdateEnvironmentProfile action. + Future updateEnvironmentProfile({ + required String domainIdentifier, + required String identifier, + String? awsAccountId, + String? awsAccountRegion, + String? description, + String? name, + List? userParameters, + }) async { + final $payload = { + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (description != null) 'description': description, + if (name != null) 'name': name, + if (userParameters != null) 'userParameters': userParameters, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environment-profiles/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateEnvironmentProfileOutput.fromJson(response); + } + + /// Updates the business glossary in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a business glossary + /// is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the business glossary to be updated. + /// + /// Parameter [clientToken] : + /// A unique, case-sensitive identifier that is provided to ensure the + /// idempotency of the request. + /// + /// Parameter [description] : + /// The description to be updated as part of the UpdateGlossary + /// action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateGlossary action. + /// + /// Parameter [status] : + /// The status to be updated as part of the UpdateGlossary + /// action. + Future updateGlossary({ + required String domainIdentifier, + required String identifier, + String? clientToken, + String? description, + String? name, + GlossaryStatus? status, + }) async { + final $payload = { + 'clientToken': clientToken ?? _s.generateIdempotencyToken(), + if (description != null) 'description': description, + if (name != null) 'name': name, + if (status != null) 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossaries/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateGlossaryOutput.fromJson(response); + } + + /// Updates a business glossary term in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a business glossary + /// term is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the business glossary term that is to be updated. + /// + /// Parameter [glossaryIdentifier] : + /// The identifier of the business glossary in which a term is to be updated. + /// + /// Parameter [longDescription] : + /// The long description to be updated as part of the + /// UpdateGlossaryTerm action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateGlossaryTerm + /// action. + /// + /// Parameter [shortDescription] : + /// The short description to be updated as part of the + /// UpdateGlossaryTerm action. + /// + /// Parameter [status] : + /// The status to be updated as part of the UpdateGlossaryTerm + /// action. + /// + /// Parameter [termRelations] : + /// The term relations to be updated as part of the + /// UpdateGlossaryTerm action. + Future updateGlossaryTerm({ + required String domainIdentifier, + required String identifier, + String? glossaryIdentifier, + String? longDescription, + String? name, + String? shortDescription, + GlossaryTermStatus? status, + TermRelations? termRelations, + }) async { + final $payload = { + if (glossaryIdentifier != null) 'glossaryIdentifier': glossaryIdentifier, + if (longDescription != null) 'longDescription': longDescription, + if (name != null) 'name': name, + if (shortDescription != null) 'shortDescription': shortDescription, + if (status != null) 'status': status.toValue(), + if (termRelations != null) 'termRelations': termRelations, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/glossary-terms/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateGlossaryTermOutput.fromJson(response); + } + + /// Updates the specified group profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a group profile is + /// updated. + /// + /// Parameter [groupIdentifier] : + /// The identifier of the group profile that is updated. + /// + /// Parameter [status] : + /// The status of the group profile that is updated. + Future updateGroupProfile({ + required String domainIdentifier, + required String groupIdentifier, + required GroupProfileStatus status, + }) async { + final $payload = { + 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/group-profiles/${Uri.encodeComponent(groupIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateGroupProfileOutput.fromJson(response); + } + + /// Updates the specified project in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ServiceQuotaExceededException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a project is to be + /// updated. + /// + /// Parameter [identifier] : + /// The identifier of the project that is to be updated. + /// + /// Parameter [description] : + /// The description to be updated as part of the UpdateProject + /// action. + /// + /// Parameter [glossaryTerms] : + /// The glossary terms to be updated as part of the UpdateProject + /// action. + /// + /// Parameter [name] : + /// The name to be updated as part of the UpdateProject action. + Future updateProject({ + required String domainIdentifier, + required String identifier, + String? description, + List? glossaryTerms, + String? name, + }) async { + final $payload = { + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (name != null) 'name': name, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/projects/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateProjectOutput.fromJson(response); + } + + /// Updates the status of the specified subscription grant status in Amazon + /// DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [assetIdentifier] : + /// The identifier of the asset the subscription grant status of which is to + /// be updated. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a subscription grant + /// status is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the subscription grant the status of which is to be + /// updated. + /// + /// Parameter [status] : + /// The status to be updated as part of the + /// UpdateSubscriptionGrantStatus action. + /// + /// Parameter [failureCause] : + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + /// + /// Parameter [targetName] : + /// The target name to be updated as part of the + /// UpdateSubscriptionGrantStatus action. + Future updateSubscriptionGrantStatus({ + required String assetIdentifier, + required String domainIdentifier, + required String identifier, + required SubscriptionGrantStatus status, + FailureCause? failureCause, + String? targetName, + }) async { + final $payload = { + 'status': status.toValue(), + if (failureCause != null) 'failureCause': failureCause, + if (targetName != null) 'targetName': targetName, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants/${Uri.encodeComponent(identifier)}/status/${Uri.encodeComponent(assetIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateSubscriptionGrantStatusOutput.fromJson(response); + } + + /// Updates a specified subscription request in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a subscription + /// request is to be updated. + /// + /// Parameter [identifier] : + /// The identifier of the subscription request that is to be updated. + /// + /// Parameter [requestReason] : + /// The reason for the UpdateSubscriptionRequest action. + Future updateSubscriptionRequest({ + required String domainIdentifier, + required String identifier, + required String requestReason, + }) async { + final $payload = { + 'requestReason': requestReason, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-requests/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateSubscriptionRequestOutput.fromJson(response); + } + + /// Updates the specified subscription target in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a subscription + /// target is to be updated. + /// + /// Parameter [environmentIdentifier] : + /// The identifier of the environment in which a subscription target is to be + /// updated. + /// + /// Parameter [identifier] : + /// Identifier of the subscription target that is to be updated. + /// + /// Parameter [applicableAssetTypes] : + /// The applicable asset types to be updated as part of the + /// UpdateSubscriptionTarget action. + /// + /// Parameter [authorizedPrincipals] : + /// The authorized principals to be updated as part of the + /// UpdateSubscriptionTarget action. + /// + /// Parameter [manageAccessRole] : + /// The manage access role to be updated as part of the + /// UpdateSubscriptionTarget action. + /// + /// Parameter [name] : + /// The name to be updated as part of the + /// UpdateSubscriptionTarget action. + /// + /// Parameter [provider] : + /// The provider to be updated as part of the + /// UpdateSubscriptionTarget action. + /// + /// Parameter [subscriptionTargetConfig] : + /// The configuration to be updated as part of the + /// UpdateSubscriptionTarget action. + Future updateSubscriptionTarget({ + required String domainIdentifier, + required String environmentIdentifier, + required String identifier, + List? applicableAssetTypes, + List? authorizedPrincipals, + String? manageAccessRole, + String? name, + String? provider, + List? subscriptionTargetConfig, + }) async { + final $payload = { + if (applicableAssetTypes != null) + 'applicableAssetTypes': applicableAssetTypes, + if (authorizedPrincipals != null) + 'authorizedPrincipals': authorizedPrincipals, + if (manageAccessRole != null) 'manageAccessRole': manageAccessRole, + if (name != null) 'name': name, + if (provider != null) 'provider': provider, + if (subscriptionTargetConfig != null) + 'subscriptionTargetConfig': subscriptionTargetConfig, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/environments/${Uri.encodeComponent(environmentIdentifier)}/subscription-targets/${Uri.encodeComponent(identifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateSubscriptionTargetOutput.fromJson(response); + } + + /// Updates the specified user profile in Amazon DataZone. + /// + /// May throw [InternalServerException]. + /// May throw [ResourceNotFoundException]. + /// May throw [AccessDeniedException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [UnauthorizedException]. + /// + /// Parameter [domainIdentifier] : + /// The identifier of the Amazon DataZone domain in which a user profile is + /// updated. + /// + /// Parameter [status] : + /// The status of the user profile that are to be updated. + /// + /// Parameter [userIdentifier] : + /// The identifier of the user whose user profile is to be updated. + /// + /// Parameter [type] : + /// The type of the user profile that are to be updated. + Future updateUserProfile({ + required String domainIdentifier, + required UserProfileStatus status, + required String userIdentifier, + UserProfileType? type, + }) async { + final $payload = { + 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/user-profiles/${Uri.encodeComponent(userIdentifier)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateUserProfileOutput.fromJson(response); + } +} + +/// Specifies the prediction (aka, the automatically generated piece of +/// metadata) and the target (for example, a column name) that can be accepted. +class AcceptChoice { + /// Specifies the target (for example, a column name) where a prediction can be + /// accepted. + final String predictionTarget; + + /// The edit of the prediction. + final String? editedValue; + + /// Specifies the prediction (aka, the automatically generated piece of + /// metadata) that can be accepted. + final int? predictionChoice; + + AcceptChoice({ + required this.predictionTarget, + this.editedValue, + this.predictionChoice, + }); + + Map toJson() { + final predictionTarget = this.predictionTarget; + final editedValue = this.editedValue; + final predictionChoice = this.predictionChoice; + return { + 'predictionTarget': predictionTarget, + if (editedValue != null) 'editedValue': editedValue, + if (predictionChoice != null) 'predictionChoice': predictionChoice, + }; + } +} + +class AcceptPredictionsOutput { + /// The ID of the asset. + final String assetId; + + /// The identifier of the Amazon DataZone domain. + final String domainId; + + /// The revision that is to be made to the asset. + final String revision; + + AcceptPredictionsOutput({ + required this.assetId, + required this.domainId, + required this.revision, + }); + + factory AcceptPredictionsOutput.fromJson(Map json) { + return AcceptPredictionsOutput( + assetId: json['assetId'] as String, + domainId: json['domainId'] as String, + revision: json['revision'] as String, + ); + } + + Map toJson() { + final assetId = this.assetId; + final domainId = this.domainId; + final revision = this.revision; + return { + 'assetId': assetId, + 'domainId': domainId, + 'revision': revision, + }; + } +} + +/// Specifies the rule and the threshold under which a prediction can be +/// accepted. +class AcceptRule { + /// Specifies whether you want to accept the top prediction for all targets or + /// none. + final AcceptRuleBehavior? rule; + + /// The confidence score that specifies the condition at which a prediction can + /// be accepted. + final double? threshold; + + AcceptRule({ + this.rule, + this.threshold, + }); + + Map toJson() { + final rule = this.rule; + final threshold = this.threshold; + return { + if (rule != null) 'rule': rule.toValue(), + if (threshold != null) 'threshold': threshold, + }; + } +} + +enum AcceptRuleBehavior { + all, + none, +} + +extension AcceptRuleBehaviorValueExtension on AcceptRuleBehavior { + String toValue() { + switch (this) { + case AcceptRuleBehavior.all: + return 'ALL'; + case AcceptRuleBehavior.none: + return 'NONE'; + } + } +} + +extension AcceptRuleBehaviorFromString on String { + AcceptRuleBehavior toAcceptRuleBehavior() { + switch (this) { + case 'ALL': + return AcceptRuleBehavior.all; + case 'NONE': + return AcceptRuleBehavior.none; + } + throw Exception('$this is not known in enum AcceptRuleBehavior'); + } +} + +class AcceptSubscriptionRequestOutput { + /// The timestamp that specifies when the subscription request was accepted. + final DateTime createdAt; + + /// Specifies the Amazon DataZone user that accepted the specified subscription + /// request. + final String createdBy; + + /// The unique identifier of the Amazon DataZone domain where the specified + /// subscription request was accepted. + final String domainId; + + /// The identifier of the subscription request. + final String id; + + /// Specifies the reason for requesting a subscription to the asset. + final String requestReason; + + /// Specifies the status of the subscription request. + final SubscriptionRequestStatus status; + + /// Specifies the asset for which the subscription request was created. + final List subscribedListings; + + /// Specifies the Amazon DataZone users who are subscribed to the asset + /// specified in the subscription request. + final List subscribedPrincipals; + + /// Specifies the timestamp when subscription request was updated. + final DateTime updatedAt; + + /// Specifies the reason for accepting the subscription request. + final String? decisionComment; + + /// Specifes the ID of the Amazon DataZone user who reviewed the subscription + /// request. + final String? reviewerId; + + /// Specifies the Amazon DataZone user who updated the subscription request. + final String? updatedBy; + + AcceptSubscriptionRequestOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory AcceptSubscriptionRequestOutput.fromJson(Map json) { + return AcceptSubscriptionRequestOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// A Amazon DataZone inventory asset. +class AssetItem { + /// The identifier of the Amazon DataZone domain in which the inventory asset + /// exists. + final String domainId; + + /// the identifier of the Amazon DataZone inventory asset. + final String identifier; + + /// The name of the Amazon DataZone inventory asset. + final String name; + + /// The identifier of the Amazon DataZone project that owns the inventory asset. + final String owningProjectId; + + /// The identifier of the asset type of the specified Amazon DataZone inventory + /// asset. + final String typeIdentifier; + + /// The revision of the inventory asset type. + final String typeRevision; + + /// The additional attributes of a Amazon DataZone inventory asset. + final AssetItemAdditionalAttributes? additionalAttributes; + + /// The timestamp of when the Amazon DataZone inventory asset was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the inventory asset. + final String? createdBy; + + /// The description of an Amazon DataZone inventory asset. + final String? description; + + /// The external identifier of the Amazon DataZone inventory asset. + final String? externalIdentifier; + + /// The timestamp of when the first revision of the inventory asset was created. + final DateTime? firstRevisionCreatedAt; + + /// The Amazon DataZone user who created the first revision of the inventory + /// asset. + final String? firstRevisionCreatedBy; + + /// The glossary terms attached to the Amazon DataZone inventory asset. + final List? glossaryTerms; + + AssetItem({ + required this.domainId, + required this.identifier, + required this.name, + required this.owningProjectId, + required this.typeIdentifier, + required this.typeRevision, + this.additionalAttributes, + this.createdAt, + this.createdBy, + this.description, + this.externalIdentifier, + this.firstRevisionCreatedAt, + this.firstRevisionCreatedBy, + this.glossaryTerms, + }); + + factory AssetItem.fromJson(Map json) { + return AssetItem( + domainId: json['domainId'] as String, + identifier: json['identifier'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + typeIdentifier: json['typeIdentifier'] as String, + typeRevision: json['typeRevision'] as String, + additionalAttributes: json['additionalAttributes'] != null + ? AssetItemAdditionalAttributes.fromJson( + json['additionalAttributes'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + externalIdentifier: json['externalIdentifier'] as String?, + firstRevisionCreatedAt: timeStampFromJson(json['firstRevisionCreatedAt']), + firstRevisionCreatedBy: json['firstRevisionCreatedBy'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final identifier = this.identifier; + final name = this.name; + final owningProjectId = this.owningProjectId; + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + final additionalAttributes = this.additionalAttributes; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final externalIdentifier = this.externalIdentifier; + final firstRevisionCreatedAt = this.firstRevisionCreatedAt; + final firstRevisionCreatedBy = this.firstRevisionCreatedBy; + final glossaryTerms = this.glossaryTerms; + return { + 'domainId': domainId, + 'identifier': identifier, + 'name': name, + 'owningProjectId': owningProjectId, + 'typeIdentifier': typeIdentifier, + 'typeRevision': typeRevision, + if (additionalAttributes != null) + 'additionalAttributes': additionalAttributes, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (externalIdentifier != null) 'externalIdentifier': externalIdentifier, + if (firstRevisionCreatedAt != null) + 'firstRevisionCreatedAt': unixTimestampToJson(firstRevisionCreatedAt), + if (firstRevisionCreatedBy != null) + 'firstRevisionCreatedBy': firstRevisionCreatedBy, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + }; + } +} + +/// The additional attributes of an inventory asset. +class AssetItemAdditionalAttributes { + /// The forms included in the additional attributes of an inventory asset. + final List? formsOutput; + + /// The latest time series data points forms included in the additional + /// attributes of an asset. + final List? + latestTimeSeriesDataPointFormsOutput; + + /// The read-only forms included in the additional attributes of an inventory + /// asset. + final List? readOnlyFormsOutput; + + AssetItemAdditionalAttributes({ + this.formsOutput, + this.latestTimeSeriesDataPointFormsOutput, + this.readOnlyFormsOutput, + }); + + factory AssetItemAdditionalAttributes.fromJson(Map json) { + return AssetItemAdditionalAttributes( + formsOutput: (json['formsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + latestTimeSeriesDataPointFormsOutput: + (json['latestTimeSeriesDataPointFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + readOnlyFormsOutput: (json['readOnlyFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final formsOutput = this.formsOutput; + final latestTimeSeriesDataPointFormsOutput = + this.latestTimeSeriesDataPointFormsOutput; + final readOnlyFormsOutput = this.readOnlyFormsOutput; + return { + if (formsOutput != null) 'formsOutput': formsOutput, + if (latestTimeSeriesDataPointFormsOutput != null) + 'latestTimeSeriesDataPointFormsOutput': + latestTimeSeriesDataPointFormsOutput, + if (readOnlyFormsOutput != null) + 'readOnlyFormsOutput': readOnlyFormsOutput, + }; + } +} + +/// An asset published in an Amazon DataZone catalog. +class AssetListing { + /// The identifier of an asset published in an Amazon DataZone catalog. + final String? assetId; + + /// The revision of an asset published in an Amazon DataZone catalog. + final String? assetRevision; + + /// The type of an asset published in an Amazon DataZone catalog. + final String? assetType; + + /// The timestamp of when an asset published in an Amazon DataZone catalog was + /// created. + final DateTime? createdAt; + + /// The metadata forms attached to an asset published in an Amazon DataZone + /// catalog. + final String? forms; + + /// The glossary terms attached to an asset published in an Amazon DataZone + /// catalog. + final List? glossaryTerms; + + /// The latest time series data points forms included in the additional + /// attributes of an asset. + final List? + latestTimeSeriesDataPointForms; + + /// The identifier of the project where an asset published in an Amazon DataZone + /// catalog exists. + final String? owningProjectId; + + AssetListing({ + this.assetId, + this.assetRevision, + this.assetType, + this.createdAt, + this.forms, + this.glossaryTerms, + this.latestTimeSeriesDataPointForms, + this.owningProjectId, + }); + + factory AssetListing.fromJson(Map json) { + return AssetListing( + assetId: json['assetId'] as String?, + assetRevision: json['assetRevision'] as String?, + assetType: json['assetType'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + forms: json['forms'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => DetailedGlossaryTerm.fromJson(e as Map)) + .toList(), + latestTimeSeriesDataPointForms: + (json['latestTimeSeriesDataPointForms'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + owningProjectId: json['owningProjectId'] as String?, + ); + } + + Map toJson() { + final assetId = this.assetId; + final assetRevision = this.assetRevision; + final assetType = this.assetType; + final createdAt = this.createdAt; + final forms = this.forms; + final glossaryTerms = this.glossaryTerms; + final latestTimeSeriesDataPointForms = this.latestTimeSeriesDataPointForms; + final owningProjectId = this.owningProjectId; + return { + if (assetId != null) 'assetId': assetId, + if (assetRevision != null) 'assetRevision': assetRevision, + if (assetType != null) 'assetType': assetType, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (forms != null) 'forms': forms, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (latestTimeSeriesDataPointForms != null) + 'latestTimeSeriesDataPointForms': latestTimeSeriesDataPointForms, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + }; + } +} + +/// The details of an asset published in an Amazon DataZone catalog. +class AssetListingDetails { + /// The identifier of an asset published in an Amazon DataZone catalog. + final String listingId; + + /// The status of an asset published in an Amazon DataZone catalog. + final ListingStatus listingStatus; + + AssetListingDetails({ + required this.listingId, + required this.listingStatus, + }); + + factory AssetListingDetails.fromJson(Map json) { + return AssetListingDetails( + listingId: json['listingId'] as String, + listingStatus: (json['listingStatus'] as String).toListingStatus(), + ); + } + + Map toJson() { + final listingId = this.listingId; + final listingStatus = this.listingStatus; + return { + 'listingId': listingId, + 'listingStatus': listingStatus.toValue(), + }; + } +} + +/// The details of an asset published in an Amazon DataZone catalog. +class AssetListingItem { + /// The additional attributes of an asset published in an Amazon DataZone + /// catalog. + final AssetListingItemAdditionalAttributes? additionalAttributes; + + /// The timestamp of when an asset published in an Amazon DataZone catalog was + /// created. + final DateTime? createdAt; + + /// The description of an asset published in an Amazon DataZone catalog. + final String? description; + + /// The identifier of the inventory asset. + final String? entityId; + + /// The revision of the inventory asset. + final String? entityRevision; + + /// The type of the inventory asset. + final String? entityType; + + /// Glossary terms attached to the inventory asset. + final List? glossaryTerms; + + /// The Amazon DataZone user who created the listing. + final String? listingCreatedBy; + + /// The identifier of the listing (asset published in Amazon DataZone catalog). + final String? listingId; + + /// The revision of the listing (asset published in Amazon DataZone catalog). + final String? listingRevision; + + /// The Amazon DataZone user who updated the listing. + final String? listingUpdatedBy; + + /// The name of the inventory asset. + final String? name; + + /// The identifier of the project that owns the inventory asset. + final String? owningProjectId; + + AssetListingItem({ + this.additionalAttributes, + this.createdAt, + this.description, + this.entityId, + this.entityRevision, + this.entityType, + this.glossaryTerms, + this.listingCreatedBy, + this.listingId, + this.listingRevision, + this.listingUpdatedBy, + this.name, + this.owningProjectId, + }); + + factory AssetListingItem.fromJson(Map json) { + return AssetListingItem( + additionalAttributes: json['additionalAttributes'] != null + ? AssetListingItemAdditionalAttributes.fromJson( + json['additionalAttributes'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + entityId: json['entityId'] as String?, + entityRevision: json['entityRevision'] as String?, + entityType: json['entityType'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => DetailedGlossaryTerm.fromJson(e as Map)) + .toList(), + listingCreatedBy: json['listingCreatedBy'] as String?, + listingId: json['listingId'] as String?, + listingRevision: json['listingRevision'] as String?, + listingUpdatedBy: json['listingUpdatedBy'] as String?, + name: json['name'] as String?, + owningProjectId: json['owningProjectId'] as String?, + ); + } + + Map toJson() { + final additionalAttributes = this.additionalAttributes; + final createdAt = this.createdAt; + final description = this.description; + final entityId = this.entityId; + final entityRevision = this.entityRevision; + final entityType = this.entityType; + final glossaryTerms = this.glossaryTerms; + final listingCreatedBy = this.listingCreatedBy; + final listingId = this.listingId; + final listingRevision = this.listingRevision; + final listingUpdatedBy = this.listingUpdatedBy; + final name = this.name; + final owningProjectId = this.owningProjectId; + return { + if (additionalAttributes != null) + 'additionalAttributes': additionalAttributes, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (description != null) 'description': description, + if (entityId != null) 'entityId': entityId, + if (entityRevision != null) 'entityRevision': entityRevision, + if (entityType != null) 'entityType': entityType, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (listingCreatedBy != null) 'listingCreatedBy': listingCreatedBy, + if (listingId != null) 'listingId': listingId, + if (listingRevision != null) 'listingRevision': listingRevision, + if (listingUpdatedBy != null) 'listingUpdatedBy': listingUpdatedBy, + if (name != null) 'name': name, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + }; + } +} + +/// Additional attributes of an inventory asset. +class AssetListingItemAdditionalAttributes { + /// The metadata forms that form additional attributes of the metadata asset. + final String? forms; + + /// The latest time series data points forms included in the additional + /// attributes of an asset. + final List? + latestTimeSeriesDataPointForms; + + AssetListingItemAdditionalAttributes({ + this.forms, + this.latestTimeSeriesDataPointForms, + }); + + factory AssetListingItemAdditionalAttributes.fromJson( + Map json) { + return AssetListingItemAdditionalAttributes( + forms: json['forms'] as String?, + latestTimeSeriesDataPointForms: + (json['latestTimeSeriesDataPointForms'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + ); + } + + Map toJson() { + final forms = this.forms; + final latestTimeSeriesDataPointForms = this.latestTimeSeriesDataPointForms; + return { + if (forms != null) 'forms': forms, + if (latestTimeSeriesDataPointForms != null) + 'latestTimeSeriesDataPointForms': latestTimeSeriesDataPointForms, + }; + } +} + +/// The revision of an inventory asset. +class AssetRevision { + /// The timestamp of when an inventory asset revison was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the asset revision. + final String? createdBy; + + /// The Amazon DataZone user who created the inventory asset. + final String? domainId; + + /// The identifier of the inventory asset revision. + final String? id; + + /// The revision details of the inventory asset. + final String? revision; + + AssetRevision({ + this.createdAt, + this.createdBy, + this.domainId, + this.id, + this.revision, + }); + + factory AssetRevision.fromJson(Map json) { + return AssetRevision( + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + domainId: json['domainId'] as String?, + id: json['id'] as String?, + revision: json['revision'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final revision = this.revision; + return { + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (domainId != null) 'domainId': domainId, + if (id != null) 'id': id, + if (revision != null) 'revision': revision, + }; + } +} + +/// The name map for assets. +class AssetTargetNameMap { + /// The identifier of the inventory asset. + final String assetId; + + /// The target name in the asset target name map. + final String targetName; + + AssetTargetNameMap({ + required this.assetId, + required this.targetName, + }); + + Map toJson() { + final assetId = this.assetId; + final targetName = this.targetName; + return { + 'assetId': assetId, + 'targetName': targetName, + }; + } +} + +/// The details of the asset type. +class AssetTypeItem { + /// The identifier of the Amazon DataZone domain where the asset type exists. + final String domainId; + + /// The forms included in the details of the asset type. + final Map formsOutput; + + /// The name of the asset type. + final String name; + + /// The identifier of the Amazon DataZone project that owns the asset type. + final String owningProjectId; + + /// The revision of the asset type. + final String revision; + + /// The timestamp of when the asset type was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the asset type. + final String? createdBy; + + /// The description of the asset type. + final String? description; + + /// The identifier of the Amazon DataZone domain where the asset type was + /// originally created. + final String? originDomainId; + + /// The identifier of the Amazon DataZone project where the asset type exists. + final String? originProjectId; + + /// The timestamp of when the asset type was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the asset type. + final String? updatedBy; + + AssetTypeItem({ + required this.domainId, + required this.formsOutput, + required this.name, + required this.owningProjectId, + required this.revision, + this.createdAt, + this.createdBy, + this.description, + this.originDomainId, + this.originProjectId, + this.updatedAt, + this.updatedBy, + }); + + factory AssetTypeItem.fromJson(Map json) { + return AssetTypeItem( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as Map).map((k, e) => + MapEntry(k, FormEntryOutput.fromJson(e as Map))), + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + revision: json['revision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final name = this.name; + final owningProjectId = this.owningProjectId; + final revision = this.revision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'name': name, + 'owningProjectId': owningProjectId, + 'revision': revision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum AuthType { + iamIdc, + disabled, +} + +extension AuthTypeValueExtension on AuthType { + String toValue() { + switch (this) { + case AuthType.iamIdc: + return 'IAM_IDC'; + case AuthType.disabled: + return 'DISABLED'; + } + } +} + +extension AuthTypeFromString on String { + AuthType toAuthType() { + switch (this) { + case 'IAM_IDC': + return AuthType.iamIdc; + case 'DISABLED': + return AuthType.disabled; + } + throw Exception('$this is not known in enum AuthType'); + } +} + +/// The configuration of the business name generation. +class BusinessNameGenerationConfiguration { + /// Specifies whether the business name generation is enabled. + final bool? enabled; + + BusinessNameGenerationConfiguration({ + this.enabled, + }); + + factory BusinessNameGenerationConfiguration.fromJson( + Map json) { + return BusinessNameGenerationConfiguration( + enabled: json['enabled'] as bool?, + ); + } + + Map toJson() { + final enabled = this.enabled; + return { + if (enabled != null) 'enabled': enabled, + }; + } +} + +class CancelMetadataGenerationRunOutput { + CancelMetadataGenerationRunOutput(); + + factory CancelMetadataGenerationRunOutput.fromJson(Map _) { + return CancelMetadataGenerationRunOutput(); + } + + Map toJson() { + return {}; + } +} + +class CancelSubscriptionOutput { + /// The timestamp that specifies when the request to cancel the subscription was + /// created. + final DateTime createdAt; + + /// Specifies the Amazon DataZone user who is cancelling the subscription. + final String createdBy; + + /// The unique identifier of the Amazon DataZone domain where the subscription + /// is being cancelled. + final String domainId; + + /// The identifier of the subscription. + final String id; + + /// The status of the request to cancel the subscription. + final SubscriptionStatus status; + + /// The asset to which a subscription is being cancelled. + final SubscribedListing subscribedListing; + + /// The Amazon DataZone user who is made a subscriber to the specified asset by + /// the subscription that is being cancelled. + final SubscribedPrincipal subscribedPrincipal; + + /// The timestamp that specifies when the subscription was cancelled. + final DateTime updatedAt; + + /// Specifies whether the permissions to the asset are retained after the + /// subscription is cancelled. + final bool? retainPermissions; + + /// The unique ID of the subscripton request for the subscription that is being + /// cancelled. + final String? subscriptionRequestId; + + /// The Amazon DataZone user that cancelled the subscription. + final String? updatedBy; + + CancelSubscriptionOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.status, + required this.subscribedListing, + required this.subscribedPrincipal, + required this.updatedAt, + this.retainPermissions, + this.subscriptionRequestId, + this.updatedBy, + }); + + factory CancelSubscriptionOutput.fromJson(Map json) { + return CancelSubscriptionOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionStatus(), + subscribedListing: SubscribedListing.fromJson( + json['subscribedListing'] as Map), + subscribedPrincipal: SubscribedPrincipal.fromJson( + json['subscribedPrincipal'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + retainPermissions: json['retainPermissions'] as bool?, + subscriptionRequestId: json['subscriptionRequestId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final subscribedListing = this.subscribedListing; + final subscribedPrincipal = this.subscribedPrincipal; + final updatedAt = this.updatedAt; + final retainPermissions = this.retainPermissions; + final subscriptionRequestId = this.subscriptionRequestId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'status': status.toValue(), + 'subscribedListing': subscribedListing, + 'subscribedPrincipal': subscribedPrincipal, + 'updatedAt': unixTimestampToJson(updatedAt), + if (retainPermissions != null) 'retainPermissions': retainPermissions, + if (subscriptionRequestId != null) + 'subscriptionRequestId': subscriptionRequestId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum ChangeAction { + publish, + unpublish, +} + +extension ChangeActionValueExtension on ChangeAction { + String toValue() { + switch (this) { + case ChangeAction.publish: + return 'PUBLISH'; + case ChangeAction.unpublish: + return 'UNPUBLISH'; + } + } +} + +extension ChangeActionFromString on String { + ChangeAction toChangeAction() { + switch (this) { + case 'PUBLISH': + return ChangeAction.publish; + case 'UNPUBLISH': + return ChangeAction.unpublish; + } + throw Exception('$this is not known in enum ChangeAction'); + } +} + +/// Part of the provisioning properties of the environment blueprint. +class CloudFormationProperties { + /// The template URL of the cloud formation provisioning properties of the + /// environment blueprint. + final String templateUrl; + + CloudFormationProperties({ + required this.templateUrl, + }); + + factory CloudFormationProperties.fromJson(Map json) { + return CloudFormationProperties( + templateUrl: json['templateUrl'] as String, + ); + } + + Map toJson() { + final templateUrl = this.templateUrl; + return { + 'templateUrl': templateUrl, + }; + } +} + +/// The details of the parameters for the configurable environment action. +class ConfigurableActionParameter { + /// The key of the configurable action parameter. + final String? key; + + /// The value of the configurable action parameter. + final String? value; + + ConfigurableActionParameter({ + this.key, + this.value, + }); + + factory ConfigurableActionParameter.fromJson(Map json) { + return ConfigurableActionParameter( + key: json['key'] as String?, + value: json['value'] as String?, + ); + } + + Map toJson() { + final key = this.key; + final value = this.value; + return { + if (key != null) 'key': key, + if (value != null) 'value': value, + }; + } +} + +enum ConfigurableActionTypeAuthorization { + iam, + https, +} + +extension ConfigurableActionTypeAuthorizationValueExtension + on ConfigurableActionTypeAuthorization { + String toValue() { + switch (this) { + case ConfigurableActionTypeAuthorization.iam: + return 'IAM'; + case ConfigurableActionTypeAuthorization.https: + return 'HTTPS'; + } + } +} + +extension ConfigurableActionTypeAuthorizationFromString on String { + ConfigurableActionTypeAuthorization toConfigurableActionTypeAuthorization() { + switch (this) { + case 'IAM': + return ConfigurableActionTypeAuthorization.iam; + case 'HTTPS': + return ConfigurableActionTypeAuthorization.https; + } + throw Exception( + '$this is not known in enum ConfigurableActionTypeAuthorization'); + } +} + +/// The configurable action of a Amazon DataZone environment. +class ConfigurableEnvironmentAction { + /// The parameters of a configurable action in a Amazon DataZone environment. + final List parameters; + + /// The type of a configurable action in a Amazon DataZone environment. + final String type; + + /// The authentication type of a configurable action of a Amazon DataZone + /// environment. + final ConfigurableActionTypeAuthorization? auth; + + ConfigurableEnvironmentAction({ + required this.parameters, + required this.type, + this.auth, + }); + + factory ConfigurableEnvironmentAction.fromJson(Map json) { + return ConfigurableEnvironmentAction( + parameters: (json['parameters'] as List) + .whereNotNull() + .map((e) => + ConfigurableActionParameter.fromJson(e as Map)) + .toList(), + type: json['type'] as String, + auth: (json['auth'] as String?)?.toConfigurableActionTypeAuthorization(), + ); + } + + Map toJson() { + final parameters = this.parameters; + final type = this.type; + final auth = this.auth; + return { + 'parameters': parameters, + 'type': type, + if (auth != null) 'auth': auth.toValue(), + }; + } +} + +class CreateAssetOutput { + /// The ID of the Amazon DataZone domain in which the asset was created. + final String domainId; + + /// The metadata forms that are attached to the created asset. + final List formsOutput; + + /// The unique identifier of the created asset. + final String id; + + /// The name of the created asset. + final String name; + + /// The ID of the Amazon DataZone project that owns the created asset. + final String owningProjectId; + + /// The revision of the asset. + final String revision; + + /// The identifier of the created asset type. + final String typeIdentifier; + + /// The revision type of the asset. + final String typeRevision; + + /// The timestamp of when the asset was created. + final DateTime? createdAt; + + /// The Amazon DataZone user that created this asset in the catalog. + final String? createdBy; + + /// The description of the created asset. + final String? description; + + /// The external identifier of the asset. + final String? externalIdentifier; + + /// The timestamp of when the first revision of the asset took place. + final DateTime? firstRevisionCreatedAt; + + /// The Amazon DataZone user that made the first revision of the asset. + final String? firstRevisionCreatedBy; + + /// The glossary terms that are attached to the created asset. + final List? glossaryTerms; + + /// The latest data point that was imported into the time series form for the + /// asset. + final List? + latestTimeSeriesDataPointFormsOutput; + + /// The details of an asset published in an Amazon DataZone catalog. + final AssetListingDetails? listing; + + /// The configuration of the automatically generated business-friendly metadata + /// for the asset. + final PredictionConfiguration? predictionConfiguration; + + /// The read-only metadata forms that are attached to the created asset. + final List? readOnlyFormsOutput; + + CreateAssetOutput({ + required this.domainId, + required this.formsOutput, + required this.id, + required this.name, + required this.owningProjectId, + required this.revision, + required this.typeIdentifier, + required this.typeRevision, + this.createdAt, + this.createdBy, + this.description, + this.externalIdentifier, + this.firstRevisionCreatedAt, + this.firstRevisionCreatedBy, + this.glossaryTerms, + this.latestTimeSeriesDataPointFormsOutput, + this.listing, + this.predictionConfiguration, + this.readOnlyFormsOutput, + }); + + factory CreateAssetOutput.fromJson(Map json) { + return CreateAssetOutput( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as List) + .whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + revision: json['revision'] as String, + typeIdentifier: json['typeIdentifier'] as String, + typeRevision: json['typeRevision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + externalIdentifier: json['externalIdentifier'] as String?, + firstRevisionCreatedAt: timeStampFromJson(json['firstRevisionCreatedAt']), + firstRevisionCreatedBy: json['firstRevisionCreatedBy'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + latestTimeSeriesDataPointFormsOutput: + (json['latestTimeSeriesDataPointFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + listing: json['listing'] != null + ? AssetListingDetails.fromJson( + json['listing'] as Map) + : null, + predictionConfiguration: json['predictionConfiguration'] != null + ? PredictionConfiguration.fromJson( + json['predictionConfiguration'] as Map) + : null, + readOnlyFormsOutput: (json['readOnlyFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final revision = this.revision; + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final externalIdentifier = this.externalIdentifier; + final firstRevisionCreatedAt = this.firstRevisionCreatedAt; + final firstRevisionCreatedBy = this.firstRevisionCreatedBy; + final glossaryTerms = this.glossaryTerms; + final latestTimeSeriesDataPointFormsOutput = + this.latestTimeSeriesDataPointFormsOutput; + final listing = this.listing; + final predictionConfiguration = this.predictionConfiguration; + final readOnlyFormsOutput = this.readOnlyFormsOutput; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + 'revision': revision, + 'typeIdentifier': typeIdentifier, + 'typeRevision': typeRevision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (externalIdentifier != null) 'externalIdentifier': externalIdentifier, + if (firstRevisionCreatedAt != null) + 'firstRevisionCreatedAt': unixTimestampToJson(firstRevisionCreatedAt), + if (firstRevisionCreatedBy != null) + 'firstRevisionCreatedBy': firstRevisionCreatedBy, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (latestTimeSeriesDataPointFormsOutput != null) + 'latestTimeSeriesDataPointFormsOutput': + latestTimeSeriesDataPointFormsOutput, + if (listing != null) 'listing': listing, + if (predictionConfiguration != null) + 'predictionConfiguration': predictionConfiguration, + if (readOnlyFormsOutput != null) + 'readOnlyFormsOutput': readOnlyFormsOutput, + }; + } +} + +class CreateAssetRevisionOutput { + /// The unique identifier of the Amazon DataZone domain where the asset was + /// revised. + final String domainId; + + /// The metadata forms that were attached to the asset as part of the asset + /// revision. + final List formsOutput; + + /// The unique identifier of the asset revision. + final String id; + + /// The revised name of the asset. + final String name; + + /// The unique identifier of the revised project that owns the asset. + final String owningProjectId; + + /// The revision of the asset. + final String revision; + + /// The identifier of the revision type. + final String typeIdentifier; + + /// The revision type of the asset. + final String typeRevision; + + /// The timestamp of when the asset revision occured. + final DateTime? createdAt; + + /// The Amazon DataZone user who performed the asset revision. + final String? createdBy; + + /// The revised asset description. + final String? description; + + /// The external identifier of the asset. + final String? externalIdentifier; + + /// The timestamp of when the first asset revision occured. + final DateTime? firstRevisionCreatedAt; + + /// The Amazon DataZone user who performed the first asset revision. + final String? firstRevisionCreatedBy; + + /// The glossary terms that were attached to the asset as part of asset + /// revision. + final List? glossaryTerms; + + /// The latest data point that was imported into the time series form for the + /// asset. + final List? + latestTimeSeriesDataPointFormsOutput; + + /// The details of an asset published in an Amazon DataZone catalog. + final AssetListingDetails? listing; + + /// The configuration of the automatically generated business-friendly metadata + /// for the asset. + final PredictionConfiguration? predictionConfiguration; + + /// The read-only metadata forms that were attached to the asset as part of the + /// asset revision. + final List? readOnlyFormsOutput; + + CreateAssetRevisionOutput({ + required this.domainId, + required this.formsOutput, + required this.id, + required this.name, + required this.owningProjectId, + required this.revision, + required this.typeIdentifier, + required this.typeRevision, + this.createdAt, + this.createdBy, + this.description, + this.externalIdentifier, + this.firstRevisionCreatedAt, + this.firstRevisionCreatedBy, + this.glossaryTerms, + this.latestTimeSeriesDataPointFormsOutput, + this.listing, + this.predictionConfiguration, + this.readOnlyFormsOutput, + }); + + factory CreateAssetRevisionOutput.fromJson(Map json) { + return CreateAssetRevisionOutput( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as List) + .whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + revision: json['revision'] as String, + typeIdentifier: json['typeIdentifier'] as String, + typeRevision: json['typeRevision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + externalIdentifier: json['externalIdentifier'] as String?, + firstRevisionCreatedAt: timeStampFromJson(json['firstRevisionCreatedAt']), + firstRevisionCreatedBy: json['firstRevisionCreatedBy'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + latestTimeSeriesDataPointFormsOutput: + (json['latestTimeSeriesDataPointFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + listing: json['listing'] != null + ? AssetListingDetails.fromJson( + json['listing'] as Map) + : null, + predictionConfiguration: json['predictionConfiguration'] != null + ? PredictionConfiguration.fromJson( + json['predictionConfiguration'] as Map) + : null, + readOnlyFormsOutput: (json['readOnlyFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final revision = this.revision; + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final externalIdentifier = this.externalIdentifier; + final firstRevisionCreatedAt = this.firstRevisionCreatedAt; + final firstRevisionCreatedBy = this.firstRevisionCreatedBy; + final glossaryTerms = this.glossaryTerms; + final latestTimeSeriesDataPointFormsOutput = + this.latestTimeSeriesDataPointFormsOutput; + final listing = this.listing; + final predictionConfiguration = this.predictionConfiguration; + final readOnlyFormsOutput = this.readOnlyFormsOutput; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + 'revision': revision, + 'typeIdentifier': typeIdentifier, + 'typeRevision': typeRevision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (externalIdentifier != null) 'externalIdentifier': externalIdentifier, + if (firstRevisionCreatedAt != null) + 'firstRevisionCreatedAt': unixTimestampToJson(firstRevisionCreatedAt), + if (firstRevisionCreatedBy != null) + 'firstRevisionCreatedBy': firstRevisionCreatedBy, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (latestTimeSeriesDataPointFormsOutput != null) + 'latestTimeSeriesDataPointFormsOutput': + latestTimeSeriesDataPointFormsOutput, + if (listing != null) 'listing': listing, + if (predictionConfiguration != null) + 'predictionConfiguration': predictionConfiguration, + if (readOnlyFormsOutput != null) + 'readOnlyFormsOutput': readOnlyFormsOutput, + }; + } +} + +class CreateAssetTypeOutput { + /// The ID of the Amazon DataZone domain in which the asset type was created. + final String domainId; + + /// The metadata forms that are attached to the asset type. + final Map formsOutput; + + /// The name of the asset type. + final String name; + + /// The revision of the custom asset type. + final String revision; + + /// The timestamp of when the asset type is to be created. + final DateTime? createdAt; + + /// The Amazon DataZone user who creates this custom asset type. + final String? createdBy; + + /// The description of the custom asset type. + final String? description; + + /// The ID of the Amazon DataZone domain where the asset type was originally + /// created. + final String? originDomainId; + + /// The ID of the Amazon DataZone project where the asset type was originally + /// created. + final String? originProjectId; + + /// The ID of the Amazon DataZone project that currently owns this asset type. + final String? owningProjectId; + + /// The timestamp of when the custom type was created. + final DateTime? updatedAt; + + /// The Amazon DataZone user that created the custom asset type. + final String? updatedBy; + + CreateAssetTypeOutput({ + required this.domainId, + required this.formsOutput, + required this.name, + required this.revision, + this.createdAt, + this.createdBy, + this.description, + this.originDomainId, + this.originProjectId, + this.owningProjectId, + this.updatedAt, + this.updatedBy, + }); + + factory CreateAssetTypeOutput.fromJson(Map json) { + return CreateAssetTypeOutput( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as Map).map((k, e) => + MapEntry(k, FormEntryOutput.fromJson(e as Map))), + name: json['name'] as String, + revision: json['revision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + owningProjectId: json['owningProjectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final name = this.name; + final revision = this.revision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final owningProjectId = this.owningProjectId; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'name': name, + 'revision': revision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class CreateDataSourceOutput { + /// The ID of the Amazon DataZone domain in which the data source is created. + final String domainId; + + /// The unique identifier of the Amazon DataZone environment to which the data + /// source publishes assets. + final String environmentId; + + /// The unique identifier of the data source. + final String id; + + /// The name of the data source. + final String name; + + /// The ID of the Amazon DataZone project to which the data source is added. + final String projectId; + + /// The metadata forms attached to the assets that this data source creates. + final List? assetFormsOutput; + + /// Specifies the configuration of the data source. It can be set to either + /// glueRunConfiguration or redshiftRunConfiguration. + final DataSourceConfigurationOutput? configuration; + + /// The timestamp of when the data source was created. + final DateTime? createdAt; + + /// The description of the data source. + final String? description; + + /// Specifies whether the data source is enabled. + final EnableSetting? enableSetting; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// The timestamp that specifies when the data source was last run. + final DateTime? lastRunAt; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? lastRunErrorMessage; + + /// The status of the last run of this data source. + final DataSourceRunStatus? lastRunStatus; + + /// Specifies whether the assets that this data source creates in the inventory + /// are to be also automatically published to the catalog. + final bool? publishOnImport; + + /// Specifies whether the business name generation is to be enabled for this + /// data source. + final RecommendationConfiguration? recommendation; + + /// The schedule of the data source runs. + final ScheduleConfiguration? schedule; + + /// The status of the data source. + final DataSourceStatus? status; + + /// The type of the data source. + final String? type; + + /// The timestamp of when the data source was updated. + final DateTime? updatedAt; + + CreateDataSourceOutput({ + required this.domainId, + required this.environmentId, + required this.id, + required this.name, + required this.projectId, + this.assetFormsOutput, + this.configuration, + this.createdAt, + this.description, + this.enableSetting, + this.errorMessage, + this.lastRunAt, + this.lastRunErrorMessage, + this.lastRunStatus, + this.publishOnImport, + this.recommendation, + this.schedule, + this.status, + this.type, + this.updatedAt, + }); + + factory CreateDataSourceOutput.fromJson(Map json) { + return CreateDataSourceOutput( + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + assetFormsOutput: (json['assetFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + configuration: json['configuration'] != null + ? DataSourceConfigurationOutput.fromJson( + json['configuration'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + enableSetting: (json['enableSetting'] as String?)?.toEnableSetting(), + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + lastRunAt: timeStampFromJson(json['lastRunAt']), + lastRunErrorMessage: json['lastRunErrorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['lastRunErrorMessage'] as Map) + : null, + lastRunStatus: + (json['lastRunStatus'] as String?)?.toDataSourceRunStatus(), + publishOnImport: json['publishOnImport'] as bool?, + recommendation: json['recommendation'] != null + ? RecommendationConfiguration.fromJson( + json['recommendation'] as Map) + : null, + schedule: json['schedule'] != null + ? ScheduleConfiguration.fromJson( + json['schedule'] as Map) + : null, + status: (json['status'] as String?)?.toDataSourceStatus(), + type: json['type'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final name = this.name; + final projectId = this.projectId; + final assetFormsOutput = this.assetFormsOutput; + final configuration = this.configuration; + final createdAt = this.createdAt; + final description = this.description; + final enableSetting = this.enableSetting; + final errorMessage = this.errorMessage; + final lastRunAt = this.lastRunAt; + final lastRunErrorMessage = this.lastRunErrorMessage; + final lastRunStatus = this.lastRunStatus; + final publishOnImport = this.publishOnImport; + final recommendation = this.recommendation; + final schedule = this.schedule; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'name': name, + 'projectId': projectId, + if (assetFormsOutput != null) 'assetFormsOutput': assetFormsOutput, + if (configuration != null) 'configuration': configuration, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (lastRunAt != null) 'lastRunAt': iso8601ToJson(lastRunAt), + if (lastRunErrorMessage != null) + 'lastRunErrorMessage': lastRunErrorMessage, + if (lastRunStatus != null) 'lastRunStatus': lastRunStatus.toValue(), + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (recommendation != null) 'recommendation': recommendation, + if (schedule != null) 'schedule': schedule, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class CreateDomainOutput { + /// The identifier of the Amazon DataZone domain. + final String id; + + /// The ARN of the Amazon DataZone domain. + final String? arn; + + /// The description of the Amazon DataZone domain. + final String? description; + + /// The domain execution role that is created when an Amazon DataZone domain is + /// created. The domain execution role is created in the Amazon Web Services + /// account that houses the Amazon DataZone domain. + final String? domainExecutionRole; + + /// The identifier of the Amazon Web Services Key Management Service (KMS) key + /// that is used to encrypt the Amazon DataZone domain, metadata, and reporting + /// data. + final String? kmsKeyIdentifier; + + /// The name of the Amazon DataZone domain. + final String? name; + + /// The URL of the data portal for this Amazon DataZone domain. + final String? portalUrl; + + /// The single-sign on configuration of the Amazon DataZone domain. + final SingleSignOn? singleSignOn; + + /// The status of the Amazon DataZone domain. + final DomainStatus? status; + + /// The tags specified for the Amazon DataZone domain. + final Map? tags; + + CreateDomainOutput({ + required this.id, + this.arn, + this.description, + this.domainExecutionRole, + this.kmsKeyIdentifier, + this.name, + this.portalUrl, + this.singleSignOn, + this.status, + this.tags, + }); + + factory CreateDomainOutput.fromJson(Map json) { + return CreateDomainOutput( + id: json['id'] as String, + arn: json['arn'] as String?, + description: json['description'] as String?, + domainExecutionRole: json['domainExecutionRole'] as String?, + kmsKeyIdentifier: json['kmsKeyIdentifier'] as String?, + name: json['name'] as String?, + portalUrl: json['portalUrl'] as String?, + singleSignOn: json['singleSignOn'] != null + ? SingleSignOn.fromJson(json['singleSignOn'] as Map) + : null, + status: (json['status'] as String?)?.toDomainStatus(), + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final id = this.id; + final arn = this.arn; + final description = this.description; + final domainExecutionRole = this.domainExecutionRole; + final kmsKeyIdentifier = this.kmsKeyIdentifier; + final name = this.name; + final portalUrl = this.portalUrl; + final singleSignOn = this.singleSignOn; + final status = this.status; + final tags = this.tags; + return { + 'id': id, + if (arn != null) 'arn': arn, + if (description != null) 'description': description, + if (domainExecutionRole != null) + 'domainExecutionRole': domainExecutionRole, + if (kmsKeyIdentifier != null) 'kmsKeyIdentifier': kmsKeyIdentifier, + if (name != null) 'name': name, + if (portalUrl != null) 'portalUrl': portalUrl, + if (singleSignOn != null) 'singleSignOn': singleSignOn, + if (status != null) 'status': status.toValue(), + if (tags != null) 'tags': tags, + }; + } +} + +class CreateEnvironmentOutput { + /// The Amazon DataZone user who created this environment. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the environment is + /// created. + final String domainId; + + /// The ID of the environment profile with which this Amazon DataZone + /// environment was created. + final String environmentProfileId; + + /// The name of this environment. + final String name; + + /// The ID of the Amazon DataZone project in which this environment is created. + final String projectId; + + /// The provider of this Amazon DataZone environment. + final String provider; + + /// The Amazon Web Services account in which the Amazon DataZone environment is + /// created. + final String? awsAccountId; + + /// The Amazon Web Services region in which the Amazon DataZone environment is + /// created. + final String? awsAccountRegion; + + /// The timestamp of when the environment was created. + final DateTime? createdAt; + + /// The deployment properties of this Amazon DataZone environment. + final DeploymentProperties? deploymentProperties; + + /// The description of this Amazon DataZone environment. + final String? description; + + /// The configurable actions of this Amazon DataZone environment. + final List? environmentActions; + + /// The ID of the blueprint with which this Amazon DataZone environment was + /// created. + final String? environmentBlueprintId; + + /// The glossary terms that can be used in this Amazon DataZone environment. + final List? glossaryTerms; + + /// The ID of this Amazon DataZone environment. + final String? id; + + /// The details of the last deployment of this Amazon DataZone environment. + final Deployment? lastDeployment; + + /// The provisioned resources of this Amazon DataZone environment. + final List? provisionedResources; + + /// The provisioning properties of this Amazon DataZone environment. + final ProvisioningProperties? provisioningProperties; + + /// The status of this Amazon DataZone environment. + final EnvironmentStatus? status; + + /// The timestamp of when this environment was updated. + final DateTime? updatedAt; + + /// The user parameters of this Amazon DataZone environment. + final List? userParameters; + + CreateEnvironmentOutput({ + required this.createdBy, + required this.domainId, + required this.environmentProfileId, + required this.name, + required this.projectId, + required this.provider, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.deploymentProperties, + this.description, + this.environmentActions, + this.environmentBlueprintId, + this.glossaryTerms, + this.id, + this.lastDeployment, + this.provisionedResources, + this.provisioningProperties, + this.status, + this.updatedAt, + this.userParameters, + }); + + factory CreateEnvironmentOutput.fromJson(Map json) { + return CreateEnvironmentOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentProfileId: json['environmentProfileId'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + deploymentProperties: json['deploymentProperties'] != null + ? DeploymentProperties.fromJson( + json['deploymentProperties'] as Map) + : null, + description: json['description'] as String?, + environmentActions: (json['environmentActions'] as List?) + ?.whereNotNull() + .map((e) => + ConfigurableEnvironmentAction.fromJson(e as Map)) + .toList(), + environmentBlueprintId: json['environmentBlueprintId'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + id: json['id'] as String?, + lastDeployment: json['lastDeployment'] != null + ? Deployment.fromJson(json['lastDeployment'] as Map) + : null, + provisionedResources: (json['provisionedResources'] as List?) + ?.whereNotNull() + .map((e) => Resource.fromJson(e as Map)) + .toList(), + provisioningProperties: json['provisioningProperties'] != null + ? ProvisioningProperties.fromJson( + json['provisioningProperties'] as Map) + : null, + status: (json['status'] as String?)?.toEnvironmentStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentProfileId = this.environmentProfileId; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final deploymentProperties = this.deploymentProperties; + final description = this.description; + final environmentActions = this.environmentActions; + final environmentBlueprintId = this.environmentBlueprintId; + final glossaryTerms = this.glossaryTerms; + final id = this.id; + final lastDeployment = this.lastDeployment; + final provisionedResources = this.provisionedResources; + final provisioningProperties = this.provisioningProperties; + final status = this.status; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentProfileId': environmentProfileId, + 'name': name, + 'projectId': projectId, + 'provider': provider, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (deploymentProperties != null) + 'deploymentProperties': deploymentProperties, + if (description != null) 'description': description, + if (environmentActions != null) 'environmentActions': environmentActions, + if (environmentBlueprintId != null) + 'environmentBlueprintId': environmentBlueprintId, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (id != null) 'id': id, + if (lastDeployment != null) 'lastDeployment': lastDeployment, + if (provisionedResources != null) + 'provisionedResources': provisionedResources, + if (provisioningProperties != null) + 'provisioningProperties': provisioningProperties, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class CreateEnvironmentProfileOutput { + /// The Amazon DataZone user who created this environment profile. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which this environment profile is + /// created. + final String domainId; + + /// The ID of the blueprint with which this environment profile is created. + final String environmentBlueprintId; + + /// The ID of this Amazon DataZone environment profile. + final String id; + + /// The name of this Amazon DataZone environment profile. + final String name; + + /// The Amazon Web Services account ID in which this Amazon DataZone environment + /// profile is created. + final String? awsAccountId; + + /// The Amazon Web Services region in which this Amazon DataZone environment + /// profile is created. + final String? awsAccountRegion; + + /// The timestamp of when this environment profile was created. + final DateTime? createdAt; + + /// The description of this Amazon DataZone environment profile. + final String? description; + + /// The ID of the Amazon DataZone project in which this environment profile is + /// created. + final String? projectId; + + /// The timestamp of when this environment profile was updated. + final DateTime? updatedAt; + + /// The user parameters of this Amazon DataZone environment profile. + final List? userParameters; + + CreateEnvironmentProfileOutput({ + required this.createdBy, + required this.domainId, + required this.environmentBlueprintId, + required this.id, + required this.name, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.description, + this.projectId, + this.updatedAt, + this.userParameters, + }); + + factory CreateEnvironmentProfileOutput.fromJson(Map json) { + return CreateEnvironmentProfileOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + id: json['id'] as String, + name: json['name'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + projectId: json['projectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final id = this.id; + final name = this.name; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final description = this.description; + final projectId = this.projectId; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + 'id': id, + 'name': name, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (projectId != null) 'projectId': projectId, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class CreateFormTypeOutput { + /// The ID of the Amazon DataZone domain in which this metadata form type is + /// created. + final String domainId; + + /// The name of this Amazon DataZone metadata form type. + final String name; + + /// The revision of this Amazon DataZone metadata form type. + final String revision; + + /// The description of this Amazon DataZone metadata form type. + final String? description; + + /// The ID of the Amazon DataZone domain in which this metadata form type was + /// originally created. + final String? originDomainId; + + /// The ID of the project in which this Amazon DataZone metadata form type was + /// originally created. + final String? originProjectId; + + /// The ID of the project that owns this Amazon DataZone metadata form type. + final String? owningProjectId; + + CreateFormTypeOutput({ + required this.domainId, + required this.name, + required this.revision, + this.description, + this.originDomainId, + this.originProjectId, + this.owningProjectId, + }); + + factory CreateFormTypeOutput.fromJson(Map json) { + return CreateFormTypeOutput( + domainId: json['domainId'] as String, + name: json['name'] as String, + revision: json['revision'] as String, + description: json['description'] as String?, + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + owningProjectId: json['owningProjectId'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final name = this.name; + final revision = this.revision; + final description = this.description; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final owningProjectId = this.owningProjectId; + return { + 'domainId': domainId, + 'name': name, + 'revision': revision, + if (description != null) 'description': description, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + }; + } +} + +class CreateGlossaryOutput { + /// The ID of the Amazon DataZone domain in which this business glossary is + /// created. + final String domainId; + + /// The ID of this business glossary. + final String id; + + /// The name of this business glossary. + final String name; + + /// The ID of the project that currently owns this business glossary. + final String owningProjectId; + + /// The description of this business glossary. + final String? description; + + /// The status of this business glossary. + final GlossaryStatus? status; + + CreateGlossaryOutput({ + required this.domainId, + required this.id, + required this.name, + required this.owningProjectId, + this.description, + this.status, + }); + + factory CreateGlossaryOutput.fromJson(Map json) { + return CreateGlossaryOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + description: json['description'] as String?, + status: (json['status'] as String?)?.toGlossaryStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final description = this.description; + final status = this.status; + return { + 'domainId': domainId, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + if (description != null) 'description': description, + if (status != null) 'status': status.toValue(), + }; + } +} + +class CreateGlossaryTermOutput { + /// The ID of the Amazon DataZone domain in which this business glossary term is + /// created. + final String domainId; + + /// The ID of the business glossary in which this term is created. + final String glossaryId; + + /// The ID of this business glossary term. + final String id; + + /// The name of this business glossary term. + final String name; + + /// The status of this business glossary term. + final GlossaryTermStatus status; + + /// The long description of this business glossary term. + final String? longDescription; + + /// The short description of this business glossary term. + final String? shortDescription; + + /// The term relations of this business glossary term. + final TermRelations? termRelations; + + CreateGlossaryTermOutput({ + required this.domainId, + required this.glossaryId, + required this.id, + required this.name, + required this.status, + this.longDescription, + this.shortDescription, + this.termRelations, + }); + + factory CreateGlossaryTermOutput.fromJson(Map json) { + return CreateGlossaryTermOutput( + domainId: json['domainId'] as String, + glossaryId: json['glossaryId'] as String, + id: json['id'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGlossaryTermStatus(), + longDescription: json['longDescription'] as String?, + shortDescription: json['shortDescription'] as String?, + termRelations: json['termRelations'] != null + ? TermRelations.fromJson( + json['termRelations'] as Map) + : null, + ); + } + + Map toJson() { + final domainId = this.domainId; + final glossaryId = this.glossaryId; + final id = this.id; + final name = this.name; + final status = this.status; + final longDescription = this.longDescription; + final shortDescription = this.shortDescription; + final termRelations = this.termRelations; + return { + 'domainId': domainId, + 'glossaryId': glossaryId, + 'id': id, + 'name': name, + 'status': status.toValue(), + if (longDescription != null) 'longDescription': longDescription, + if (shortDescription != null) 'shortDescription': shortDescription, + if (termRelations != null) 'termRelations': termRelations, + }; + } +} + +class CreateGroupProfileOutput { + /// The identifier of the Amazon DataZone domain in which the group profile is + /// created. + final String? domainId; + + /// The name of the group for which group profile is created. + final String? groupName; + + /// The identifier of the group profile. + final String? id; + + /// The status of the group profile. + final GroupProfileStatus? status; + + CreateGroupProfileOutput({ + this.domainId, + this.groupName, + this.id, + this.status, + }); + + factory CreateGroupProfileOutput.fromJson(Map json) { + return CreateGroupProfileOutput( + domainId: json['domainId'] as String?, + groupName: json['groupName'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toGroupProfileStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final groupName = this.groupName; + final id = this.id; + final status = this.status; + return { + if (domainId != null) 'domainId': domainId, + if (groupName != null) 'groupName': groupName, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + }; + } +} + +class CreateListingChangeSetOutput { + /// The ID of the listing (a record of an asset at a given time). + final String listingId; + + /// The revision of a listing. + final String listingRevision; + + /// Specifies the status of the listing. + final ListingStatus status; + + CreateListingChangeSetOutput({ + required this.listingId, + required this.listingRevision, + required this.status, + }); + + factory CreateListingChangeSetOutput.fromJson(Map json) { + return CreateListingChangeSetOutput( + listingId: json['listingId'] as String, + listingRevision: json['listingRevision'] as String, + status: (json['status'] as String).toListingStatus(), + ); + } + + Map toJson() { + final listingId = this.listingId; + final listingRevision = this.listingRevision; + final status = this.status; + return { + 'listingId': listingId, + 'listingRevision': listingRevision, + 'status': status.toValue(), + }; + } +} + +class CreateProjectMembershipOutput { + CreateProjectMembershipOutput(); + + factory CreateProjectMembershipOutput.fromJson(Map _) { + return CreateProjectMembershipOutput(); + } + + Map toJson() { + return {}; + } +} + +class CreateProjectOutput { + /// The Amazon DataZone user who created the project. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the project was + /// created. + final String domainId; + + /// The ID of the Amazon DataZone project. + final String id; + + /// The name of the project. + final String name; + + /// The timestamp of when the project was created. + final DateTime? createdAt; + + /// The description of the project. + final String? description; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final List? failureReasons; + + /// The glossary terms that can be used in the project. + final List? glossaryTerms; + + /// The timestamp of when the project was last updated. + final DateTime? lastUpdatedAt; + + /// The status of the Amazon DataZone project that was created. + final ProjectStatus? projectStatus; + + CreateProjectOutput({ + required this.createdBy, + required this.domainId, + required this.id, + required this.name, + this.createdAt, + this.description, + this.failureReasons, + this.glossaryTerms, + this.lastUpdatedAt, + this.projectStatus, + }); + + factory CreateProjectOutput.fromJson(Map json) { + return CreateProjectOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => ProjectDeletionError.fromJson(e as Map)) + .toList(), + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + projectStatus: (json['projectStatus'] as String?)?.toProjectStatus(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final createdAt = this.createdAt; + final description = this.description; + final failureReasons = this.failureReasons; + final glossaryTerms = this.glossaryTerms; + final lastUpdatedAt = this.lastUpdatedAt; + final projectStatus = this.projectStatus; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'name': name, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (lastUpdatedAt != null) 'lastUpdatedAt': iso8601ToJson(lastUpdatedAt), + if (projectStatus != null) 'projectStatus': projectStatus.toValue(), + }; + } +} + +class CreateSubscriptionGrantOutput { + /// A timestamp of when the subscription grant is created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription grant. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription grant is + /// created. + final String domainId; + + /// The entity to which the subscription is granted. + final GrantedEntity grantedEntity; + + /// The ID of the subscription grant. + final String id; + + /// The status of the subscription grant. + final SubscriptionGrantOverallStatus status; + + /// The ID of the subscription target for which the subscription grant is + /// created. + final String subscriptionTargetId; + + /// A timestamp of when the subscription grant was updated. + final DateTime updatedAt; + + /// The assets for which the subscription grant is created. + final List? assets; + + /// The identifier of the subscription grant. + final String? subscriptionId; + + /// The Amazon DataZone user who updated the subscription grant. + final String? updatedBy; + + CreateSubscriptionGrantOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.grantedEntity, + required this.id, + required this.status, + required this.subscriptionTargetId, + required this.updatedAt, + this.assets, + this.subscriptionId, + this.updatedBy, + }); + + factory CreateSubscriptionGrantOutput.fromJson(Map json) { + return CreateSubscriptionGrantOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + grantedEntity: + GrantedEntity.fromJson(json['grantedEntity'] as Map), + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionGrantOverallStatus(), + subscriptionTargetId: json['subscriptionTargetId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + assets: (json['assets'] as List?) + ?.whereNotNull() + .map((e) => SubscribedAsset.fromJson(e as Map)) + .toList(), + subscriptionId: json['subscriptionId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final grantedEntity = this.grantedEntity; + final id = this.id; + final status = this.status; + final subscriptionTargetId = this.subscriptionTargetId; + final updatedAt = this.updatedAt; + final assets = this.assets; + final subscriptionId = this.subscriptionId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'grantedEntity': grantedEntity, + 'id': id, + 'status': status.toValue(), + 'subscriptionTargetId': subscriptionTargetId, + 'updatedAt': unixTimestampToJson(updatedAt), + if (assets != null) 'assets': assets, + if (subscriptionId != null) 'subscriptionId': subscriptionId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class CreateSubscriptionRequestOutput { + /// A timestamp of when the subscription request is created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription request. + final String createdBy; + + /// The ID of the Amazon DataZone domain in whcih the subscription request is + /// created. + final String domainId; + + /// The ID of the subscription request. + final String id; + + /// The reason for the subscription request. + final String requestReason; + + /// The status of the subscription request. + final SubscriptionRequestStatus status; + + /// The published asset for which the subscription grant is to be created. + final List subscribedListings; + + /// The subscribed principals of the subscription request. + final List subscribedPrincipals; + + /// The timestamp of when the subscription request was updated. + final DateTime updatedAt; + + /// The decision comment of the subscription request. + final String? decisionComment; + + /// The ID of the reviewer of the subscription request. + final String? reviewerId; + + /// The Amazon DataZone user who updated the subscription request. + final String? updatedBy; + + CreateSubscriptionRequestOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory CreateSubscriptionRequestOutput.fromJson(Map json) { + return CreateSubscriptionRequestOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class CreateSubscriptionTargetOutput { + /// The asset types that can be included in the subscription target. + final List applicableAssetTypes; + + /// The authorised principals of the subscription target. + final List authorizedPrincipals; + + /// The timestamp of when the subscription target was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription target. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription target was + /// created. + final String domainId; + + /// The ID of the environment in which the subscription target was created. + final String environmentId; + + /// The ID of the subscription target. + final String id; + + /// The manage access role with which the subscription target was created. + final String manageAccessRole; + + /// The name of the subscription target. + final String name; + + /// ??? + final String projectId; + + /// The provider of the subscription target. + final String provider; + + /// The configuration of the subscription target. + final List subscriptionTargetConfig; + + /// The type of the subscription target. + final String type; + + /// The timestamp of when the subscription target was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the subscription target. + final String? updatedBy; + + CreateSubscriptionTargetOutput({ + required this.applicableAssetTypes, + required this.authorizedPrincipals, + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.environmentId, + required this.id, + required this.manageAccessRole, + required this.name, + required this.projectId, + required this.provider, + required this.subscriptionTargetConfig, + required this.type, + this.updatedAt, + this.updatedBy, + }); + + factory CreateSubscriptionTargetOutput.fromJson(Map json) { + return CreateSubscriptionTargetOutput( + applicableAssetTypes: (json['applicableAssetTypes'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + authorizedPrincipals: (json['authorizedPrincipals'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + manageAccessRole: json['manageAccessRole'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + subscriptionTargetConfig: (json['subscriptionTargetConfig'] as List) + .whereNotNull() + .map( + (e) => SubscriptionTargetForm.fromJson(e as Map)) + .toList(), + type: json['type'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final applicableAssetTypes = this.applicableAssetTypes; + final authorizedPrincipals = this.authorizedPrincipals; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final manageAccessRole = this.manageAccessRole; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final subscriptionTargetConfig = this.subscriptionTargetConfig; + final type = this.type; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'applicableAssetTypes': applicableAssetTypes, + 'authorizedPrincipals': authorizedPrincipals, + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'manageAccessRole': manageAccessRole, + 'name': name, + 'projectId': projectId, + 'provider': provider, + 'subscriptionTargetConfig': subscriptionTargetConfig, + 'type': type, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class CreateUserProfileOutput { + final UserProfileDetails? details; + + /// The identifier of the Amazon DataZone domain in which a user profile is + /// created. + final String? domainId; + + /// The identifier of the user profile. + final String? id; + + /// The status of the user profile. + final UserProfileStatus? status; + + /// The type of the user profile. + final UserProfileType? type; + + CreateUserProfileOutput({ + this.details, + this.domainId, + this.id, + this.status, + this.type, + }); + + factory CreateUserProfileOutput.fromJson(Map json) { + return CreateUserProfileOutput( + details: json['details'] != null + ? UserProfileDetails.fromJson(json['details'] as Map) + : null, + domainId: json['domainId'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toUserProfileStatus(), + type: (json['type'] as String?)?.toUserProfileType(), + ); + } + + Map toJson() { + final details = this.details; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final type = this.type; + return { + if (details != null) 'details': details, + if (domainId != null) 'domainId': domainId, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +/// The details of user parameters of an environment blueprint. +class CustomParameter { + /// The filed type of the parameter. + final String fieldType; + + /// The key name of the parameter. + final String keyName; + + /// The default value of the parameter. + final String? defaultValue; + + /// The description of the parameter. + final String? description; + + /// Specifies whether the parameter is editable. + final bool? isEditable; + + /// Specifies whether the custom parameter is optional. + final bool? isOptional; + + CustomParameter({ + required this.fieldType, + required this.keyName, + this.defaultValue, + this.description, + this.isEditable, + this.isOptional, + }); + + factory CustomParameter.fromJson(Map json) { + return CustomParameter( + fieldType: json['fieldType'] as String, + keyName: json['keyName'] as String, + defaultValue: json['defaultValue'] as String?, + description: json['description'] as String?, + isEditable: json['isEditable'] as bool?, + isOptional: json['isOptional'] as bool?, + ); + } + + Map toJson() { + final fieldType = this.fieldType; + final keyName = this.keyName; + final defaultValue = this.defaultValue; + final description = this.description; + final isEditable = this.isEditable; + final isOptional = this.isOptional; + return { + 'fieldType': fieldType, + 'keyName': keyName, + if (defaultValue != null) 'defaultValue': defaultValue, + if (description != null) 'description': description, + if (isEditable != null) 'isEditable': isEditable, + if (isOptional != null) 'isOptional': isOptional, + }; + } +} + +enum DataAssetActivityStatus { + failed, + publishingFailed, + succeededCreated, + succeededUpdated, + skippedAlreadyImported, + skippedArchived, + skippedNoAccess, + unchanged, +} + +extension DataAssetActivityStatusValueExtension on DataAssetActivityStatus { + String toValue() { + switch (this) { + case DataAssetActivityStatus.failed: + return 'FAILED'; + case DataAssetActivityStatus.publishingFailed: + return 'PUBLISHING_FAILED'; + case DataAssetActivityStatus.succeededCreated: + return 'SUCCEEDED_CREATED'; + case DataAssetActivityStatus.succeededUpdated: + return 'SUCCEEDED_UPDATED'; + case DataAssetActivityStatus.skippedAlreadyImported: + return 'SKIPPED_ALREADY_IMPORTED'; + case DataAssetActivityStatus.skippedArchived: + return 'SKIPPED_ARCHIVED'; + case DataAssetActivityStatus.skippedNoAccess: + return 'SKIPPED_NO_ACCESS'; + case DataAssetActivityStatus.unchanged: + return 'UNCHANGED'; + } + } +} + +extension DataAssetActivityStatusFromString on String { + DataAssetActivityStatus toDataAssetActivityStatus() { + switch (this) { + case 'FAILED': + return DataAssetActivityStatus.failed; + case 'PUBLISHING_FAILED': + return DataAssetActivityStatus.publishingFailed; + case 'SUCCEEDED_CREATED': + return DataAssetActivityStatus.succeededCreated; + case 'SUCCEEDED_UPDATED': + return DataAssetActivityStatus.succeededUpdated; + case 'SKIPPED_ALREADY_IMPORTED': + return DataAssetActivityStatus.skippedAlreadyImported; + case 'SKIPPED_ARCHIVED': + return DataAssetActivityStatus.skippedArchived; + case 'SKIPPED_NO_ACCESS': + return DataAssetActivityStatus.skippedNoAccess; + case 'UNCHANGED': + return DataAssetActivityStatus.unchanged; + } + throw Exception('$this is not known in enum DataAssetActivityStatus'); + } +} + +///

      +class DataProductItem { + ///

      + final String? domainId; + + ///

      + final String? itemId; + + DataProductItem({ + this.domainId, + this.itemId, + }); + + factory DataProductItem.fromJson(Map json) { + return DataProductItem( + domainId: json['domainId'] as String?, + itemId: json['itemId'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final itemId = this.itemId; + return { + if (domainId != null) 'domainId': domainId, + if (itemId != null) 'itemId': itemId, + }; + } +} + +///

      +class DataProductSummary { + ///

      + final String domainId; + + ///

      + final String id; + + ///

      + final String name; + + ///

      + final String owningProjectId; + + ///

      + final DateTime? createdAt; + + ///

      + final String? createdBy; + + ///

      + final List? dataProductItems; + + ///

      + final String? description; + + ///

      + final List? glossaryTerms; + + ///

      + final DateTime? updatedAt; + + ///

      + final String? updatedBy; + + DataProductSummary({ + required this.domainId, + required this.id, + required this.name, + required this.owningProjectId, + this.createdAt, + this.createdBy, + this.dataProductItems, + this.description, + this.glossaryTerms, + this.updatedAt, + this.updatedBy, + }); + + factory DataProductSummary.fromJson(Map json) { + return DataProductSummary( + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + dataProductItems: (json['dataProductItems'] as List?) + ?.whereNotNull() + .map((e) => DataProductItem.fromJson(e as Map)) + .toList(), + description: json['description'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final dataProductItems = this.dataProductItems; + final description = this.description; + final glossaryTerms = this.glossaryTerms; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (dataProductItems != null) 'dataProductItems': dataProductItems, + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The configuration of the data source. +class DataSourceConfigurationInput { + /// The configuration of the Amazon Web Services Glue data source. + final GlueRunConfigurationInput? glueRunConfiguration; + + /// The configuration of the Amazon Redshift data source. + final RedshiftRunConfigurationInput? redshiftRunConfiguration; + + DataSourceConfigurationInput({ + this.glueRunConfiguration, + this.redshiftRunConfiguration, + }); + + Map toJson() { + final glueRunConfiguration = this.glueRunConfiguration; + final redshiftRunConfiguration = this.redshiftRunConfiguration; + return { + if (glueRunConfiguration != null) + 'glueRunConfiguration': glueRunConfiguration, + if (redshiftRunConfiguration != null) + 'redshiftRunConfiguration': redshiftRunConfiguration, + }; + } +} + +/// The configuration of the data source. +class DataSourceConfigurationOutput { + /// The configuration of the Amazon Web Services Glue data source. + final GlueRunConfigurationOutput? glueRunConfiguration; + + /// The configuration of the Amazon Redshift data source. + final RedshiftRunConfigurationOutput? redshiftRunConfiguration; + + DataSourceConfigurationOutput({ + this.glueRunConfiguration, + this.redshiftRunConfiguration, + }); + + factory DataSourceConfigurationOutput.fromJson(Map json) { + return DataSourceConfigurationOutput( + glueRunConfiguration: json['glueRunConfiguration'] != null + ? GlueRunConfigurationOutput.fromJson( + json['glueRunConfiguration'] as Map) + : null, + redshiftRunConfiguration: json['redshiftRunConfiguration'] != null + ? RedshiftRunConfigurationOutput.fromJson( + json['redshiftRunConfiguration'] as Map) + : null, + ); + } + + Map toJson() { + final glueRunConfiguration = this.glueRunConfiguration; + final redshiftRunConfiguration = this.redshiftRunConfiguration; + return { + if (glueRunConfiguration != null) + 'glueRunConfiguration': glueRunConfiguration, + if (redshiftRunConfiguration != null) + 'redshiftRunConfiguration': redshiftRunConfiguration, + }; + } +} + +/// The details of the error message that is returned if the operation cannot be +/// successfully completed. +class DataSourceErrorMessage { + /// The type of the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorType errorType; + + /// The details of the error message that is returned if the operation cannot be + /// successfully completed. + final String? errorDetail; + + DataSourceErrorMessage({ + required this.errorType, + this.errorDetail, + }); + + factory DataSourceErrorMessage.fromJson(Map json) { + return DataSourceErrorMessage( + errorType: (json['errorType'] as String).toDataSourceErrorType(), + errorDetail: json['errorDetail'] as String?, + ); + } + + Map toJson() { + final errorType = this.errorType; + final errorDetail = this.errorDetail; + return { + 'errorType': errorType.toValue(), + if (errorDetail != null) 'errorDetail': errorDetail, + }; + } +} + +enum DataSourceErrorType { + accessDeniedException, + conflictException, + internalServerException, + resourceNotFoundException, + serviceQuotaExceededException, + throttlingException, + validationException, +} + +extension DataSourceErrorTypeValueExtension on DataSourceErrorType { + String toValue() { + switch (this) { + case DataSourceErrorType.accessDeniedException: + return 'ACCESS_DENIED_EXCEPTION'; + case DataSourceErrorType.conflictException: + return 'CONFLICT_EXCEPTION'; + case DataSourceErrorType.internalServerException: + return 'INTERNAL_SERVER_EXCEPTION'; + case DataSourceErrorType.resourceNotFoundException: + return 'RESOURCE_NOT_FOUND_EXCEPTION'; + case DataSourceErrorType.serviceQuotaExceededException: + return 'SERVICE_QUOTA_EXCEEDED_EXCEPTION'; + case DataSourceErrorType.throttlingException: + return 'THROTTLING_EXCEPTION'; + case DataSourceErrorType.validationException: + return 'VALIDATION_EXCEPTION'; + } + } +} + +extension DataSourceErrorTypeFromString on String { + DataSourceErrorType toDataSourceErrorType() { + switch (this) { + case 'ACCESS_DENIED_EXCEPTION': + return DataSourceErrorType.accessDeniedException; + case 'CONFLICT_EXCEPTION': + return DataSourceErrorType.conflictException; + case 'INTERNAL_SERVER_EXCEPTION': + return DataSourceErrorType.internalServerException; + case 'RESOURCE_NOT_FOUND_EXCEPTION': + return DataSourceErrorType.resourceNotFoundException; + case 'SERVICE_QUOTA_EXCEEDED_EXCEPTION': + return DataSourceErrorType.serviceQuotaExceededException; + case 'THROTTLING_EXCEPTION': + return DataSourceErrorType.throttlingException; + case 'VALIDATION_EXCEPTION': + return DataSourceErrorType.validationException; + } + throw Exception('$this is not known in enum DataSourceErrorType'); + } +} + +/// The activity details of the data source run. +class DataSourceRunActivity { + /// The timestamp of when data source run activity was created. + final DateTime createdAt; + + /// The status of the asset included in the data source run activity. + final DataAssetActivityStatus dataAssetStatus; + + /// The identifier of the data source for the data source run activity. + final String dataSourceRunId; + + /// The database included in the data source run activity. + final String database; + + /// The project ID included in the data source run activity. + final String projectId; + + /// The technical name included in the data source run activity. + final String technicalName; + + /// The timestamp of when data source run activity was updated. + final DateTime updatedAt; + + /// The identifier of the asset included in the data source run activity. + final String? dataAssetId; + final DataSourceErrorMessage? errorMessage; + + /// The technical description included in the data source run activity. + final String? technicalDescription; + + DataSourceRunActivity({ + required this.createdAt, + required this.dataAssetStatus, + required this.dataSourceRunId, + required this.database, + required this.projectId, + required this.technicalName, + required this.updatedAt, + this.dataAssetId, + this.errorMessage, + this.technicalDescription, + }); + + factory DataSourceRunActivity.fromJson(Map json) { + return DataSourceRunActivity( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + dataAssetStatus: + (json['dataAssetStatus'] as String).toDataAssetActivityStatus(), + dataSourceRunId: json['dataSourceRunId'] as String, + database: json['database'] as String, + projectId: json['projectId'] as String, + technicalName: json['technicalName'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + dataAssetId: json['dataAssetId'] as String?, + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + technicalDescription: json['technicalDescription'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final dataAssetStatus = this.dataAssetStatus; + final dataSourceRunId = this.dataSourceRunId; + final database = this.database; + final projectId = this.projectId; + final technicalName = this.technicalName; + final updatedAt = this.updatedAt; + final dataAssetId = this.dataAssetId; + final errorMessage = this.errorMessage; + final technicalDescription = this.technicalDescription; + return { + 'createdAt': iso8601ToJson(createdAt), + 'dataAssetStatus': dataAssetStatus.toValue(), + 'dataSourceRunId': dataSourceRunId, + 'database': database, + 'projectId': projectId, + 'technicalName': technicalName, + 'updatedAt': iso8601ToJson(updatedAt), + if (dataAssetId != null) 'dataAssetId': dataAssetId, + if (errorMessage != null) 'errorMessage': errorMessage, + if (technicalDescription != null) + 'technicalDescription': technicalDescription, + }; + } +} + +enum DataSourceRunStatus { + requested, + running, + failed, + partiallySucceeded, + success, +} + +extension DataSourceRunStatusValueExtension on DataSourceRunStatus { + String toValue() { + switch (this) { + case DataSourceRunStatus.requested: + return 'REQUESTED'; + case DataSourceRunStatus.running: + return 'RUNNING'; + case DataSourceRunStatus.failed: + return 'FAILED'; + case DataSourceRunStatus.partiallySucceeded: + return 'PARTIALLY_SUCCEEDED'; + case DataSourceRunStatus.success: + return 'SUCCESS'; + } + } +} + +extension DataSourceRunStatusFromString on String { + DataSourceRunStatus toDataSourceRunStatus() { + switch (this) { + case 'REQUESTED': + return DataSourceRunStatus.requested; + case 'RUNNING': + return DataSourceRunStatus.running; + case 'FAILED': + return DataSourceRunStatus.failed; + case 'PARTIALLY_SUCCEEDED': + return DataSourceRunStatus.partiallySucceeded; + case 'SUCCESS': + return DataSourceRunStatus.success; + } + throw Exception('$this is not known in enum DataSourceRunStatus'); + } +} + +/// The details of a data source run. +class DataSourceRunSummary { + /// The timestamp of when a data source run was created. + final DateTime createdAt; + + /// The identifier of the data source of the data source run. + final String dataSourceId; + + /// The identifier of the data source run. + final String id; + + /// The project ID of the data source run. + final String projectId; + + /// The status of the data source run. + final DataSourceRunStatus status; + + /// The type of the data source run. + final DataSourceRunType type; + + /// The timestamp of when a data source run was updated. + final DateTime updatedAt; + final DataSourceErrorMessage? errorMessage; + final RunStatisticsForAssets? runStatisticsForAssets; + + /// The timestamp of when a data source run was started. + final DateTime? startedAt; + + /// The timestamp of when a data source run was stopped. + final DateTime? stoppedAt; + + DataSourceRunSummary({ + required this.createdAt, + required this.dataSourceId, + required this.id, + required this.projectId, + required this.status, + required this.type, + required this.updatedAt, + this.errorMessage, + this.runStatisticsForAssets, + this.startedAt, + this.stoppedAt, + }); + + factory DataSourceRunSummary.fromJson(Map json) { + return DataSourceRunSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + dataSourceId: json['dataSourceId'] as String, + id: json['id'] as String, + projectId: json['projectId'] as String, + status: (json['status'] as String).toDataSourceRunStatus(), + type: (json['type'] as String).toDataSourceRunType(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + runStatisticsForAssets: json['runStatisticsForAssets'] != null + ? RunStatisticsForAssets.fromJson( + json['runStatisticsForAssets'] as Map) + : null, + startedAt: timeStampFromJson(json['startedAt']), + stoppedAt: timeStampFromJson(json['stoppedAt']), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final dataSourceId = this.dataSourceId; + final id = this.id; + final projectId = this.projectId; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + final errorMessage = this.errorMessage; + final runStatisticsForAssets = this.runStatisticsForAssets; + final startedAt = this.startedAt; + final stoppedAt = this.stoppedAt; + return { + 'createdAt': iso8601ToJson(createdAt), + 'dataSourceId': dataSourceId, + 'id': id, + 'projectId': projectId, + 'status': status.toValue(), + 'type': type.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (errorMessage != null) 'errorMessage': errorMessage, + if (runStatisticsForAssets != null) + 'runStatisticsForAssets': runStatisticsForAssets, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (stoppedAt != null) 'stoppedAt': iso8601ToJson(stoppedAt), + }; + } +} + +enum DataSourceRunType { + prioritized, + scheduled, +} + +extension DataSourceRunTypeValueExtension on DataSourceRunType { + String toValue() { + switch (this) { + case DataSourceRunType.prioritized: + return 'PRIORITIZED'; + case DataSourceRunType.scheduled: + return 'SCHEDULED'; + } + } +} + +extension DataSourceRunTypeFromString on String { + DataSourceRunType toDataSourceRunType() { + switch (this) { + case 'PRIORITIZED': + return DataSourceRunType.prioritized; + case 'SCHEDULED': + return DataSourceRunType.scheduled; + } + throw Exception('$this is not known in enum DataSourceRunType'); + } +} + +enum DataSourceStatus { + creating, + failedCreation, + ready, + updating, + failedUpdate, + running, + deleting, + failedDeletion, +} + +extension DataSourceStatusValueExtension on DataSourceStatus { + String toValue() { + switch (this) { + case DataSourceStatus.creating: + return 'CREATING'; + case DataSourceStatus.failedCreation: + return 'FAILED_CREATION'; + case DataSourceStatus.ready: + return 'READY'; + case DataSourceStatus.updating: + return 'UPDATING'; + case DataSourceStatus.failedUpdate: + return 'FAILED_UPDATE'; + case DataSourceStatus.running: + return 'RUNNING'; + case DataSourceStatus.deleting: + return 'DELETING'; + case DataSourceStatus.failedDeletion: + return 'FAILED_DELETION'; + } + } +} + +extension DataSourceStatusFromString on String { + DataSourceStatus toDataSourceStatus() { + switch (this) { + case 'CREATING': + return DataSourceStatus.creating; + case 'FAILED_CREATION': + return DataSourceStatus.failedCreation; + case 'READY': + return DataSourceStatus.ready; + case 'UPDATING': + return DataSourceStatus.updating; + case 'FAILED_UPDATE': + return DataSourceStatus.failedUpdate; + case 'RUNNING': + return DataSourceStatus.running; + case 'DELETING': + return DataSourceStatus.deleting; + case 'FAILED_DELETION': + return DataSourceStatus.failedDeletion; + } + throw Exception('$this is not known in enum DataSourceStatus'); + } +} + +/// The details of the data source. +class DataSourceSummary { + /// The ID of the data source. + final String dataSourceId; + + /// The ID of the Amazon DataZone domain in which the data source exists. + final String domainId; + + /// The ID of the environment in which the data source exists. + final String environmentId; + + /// The name of the data source. + final String name; + + /// The status of the data source. + final DataSourceStatus status; + + /// The type of the data source. + final String type; + + /// The timestamp of when the data source was created. + final DateTime? createdAt; + + /// Specifies whether the data source is enabled. + final EnableSetting? enableSetting; + + /// The count of the assets created during the last data source run. + final int? lastRunAssetCount; + + /// The timestamp of when the data source run was last performed. + final DateTime? lastRunAt; + final DataSourceErrorMessage? lastRunErrorMessage; + + /// The status of the last data source run. + final DataSourceRunStatus? lastRunStatus; + final ScheduleConfiguration? schedule; + + /// The timestamp of when the data source was updated. + final DateTime? updatedAt; + + DataSourceSummary({ + required this.dataSourceId, + required this.domainId, + required this.environmentId, + required this.name, + required this.status, + required this.type, + this.createdAt, + this.enableSetting, + this.lastRunAssetCount, + this.lastRunAt, + this.lastRunErrorMessage, + this.lastRunStatus, + this.schedule, + this.updatedAt, + }); + + factory DataSourceSummary.fromJson(Map json) { + return DataSourceSummary( + dataSourceId: json['dataSourceId'] as String, + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toDataSourceStatus(), + type: json['type'] as String, + createdAt: timeStampFromJson(json['createdAt']), + enableSetting: (json['enableSetting'] as String?)?.toEnableSetting(), + lastRunAssetCount: json['lastRunAssetCount'] as int?, + lastRunAt: timeStampFromJson(json['lastRunAt']), + lastRunErrorMessage: json['lastRunErrorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['lastRunErrorMessage'] as Map) + : null, + lastRunStatus: + (json['lastRunStatus'] as String?)?.toDataSourceRunStatus(), + schedule: json['schedule'] != null + ? ScheduleConfiguration.fromJson( + json['schedule'] as Map) + : null, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final dataSourceId = this.dataSourceId; + final domainId = this.domainId; + final environmentId = this.environmentId; + final name = this.name; + final status = this.status; + final type = this.type; + final createdAt = this.createdAt; + final enableSetting = this.enableSetting; + final lastRunAssetCount = this.lastRunAssetCount; + final lastRunAt = this.lastRunAt; + final lastRunErrorMessage = this.lastRunErrorMessage; + final lastRunStatus = this.lastRunStatus; + final schedule = this.schedule; + final updatedAt = this.updatedAt; + return { + 'dataSourceId': dataSourceId, + 'domainId': domainId, + 'environmentId': environmentId, + 'name': name, + 'status': status.toValue(), + 'type': type, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (lastRunAssetCount != null) 'lastRunAssetCount': lastRunAssetCount, + if (lastRunAt != null) 'lastRunAt': iso8601ToJson(lastRunAt), + if (lastRunErrorMessage != null) + 'lastRunErrorMessage': lastRunErrorMessage, + if (lastRunStatus != null) 'lastRunStatus': lastRunStatus.toValue(), + if (schedule != null) 'schedule': schedule, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class DeleteAssetOutput { + DeleteAssetOutput(); + + factory DeleteAssetOutput.fromJson(Map _) { + return DeleteAssetOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteAssetTypeOutput { + DeleteAssetTypeOutput(); + + factory DeleteAssetTypeOutput.fromJson(Map _) { + return DeleteAssetTypeOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteDataSourceOutput { + /// The ID of the Amazon DataZone domain in which the data source is deleted. + final String domainId; + + /// The ID of the environemnt associated with this data source. + final String environmentId; + + /// The ID of the data source that is deleted. + final String id; + + /// The name of the data source that is deleted. + final String name; + + /// The ID of the project in which this data source exists and from which it's + /// deleted. + final String projectId; + + /// The asset data forms associated with this data source. + final List? assetFormsOutput; + + /// The configuration of the data source that is deleted. + final DataSourceConfigurationOutput? configuration; + + /// The timestamp of when this data source was created. + final DateTime? createdAt; + + /// The description of the data source that is deleted. + final String? description; + + /// The enable setting of the data source that specifies whether the data source + /// is enabled or disabled. + final EnableSetting? enableSetting; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// The timestamp of when the data source was last run. + final DateTime? lastRunAt; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? lastRunErrorMessage; + + /// The status of the last run of this data source. + final DataSourceRunStatus? lastRunStatus; + + /// Specifies whether the assets that this data source creates in the inventory + /// are to be also automatically published to the catalog. + final bool? publishOnImport; + + /// The schedule of runs for this data source. + final ScheduleConfiguration? schedule; + + /// The status of this data source. + final DataSourceStatus? status; + + /// The type of this data source. + final String? type; + + /// The timestamp of when this data source was updated. + final DateTime? updatedAt; + + DeleteDataSourceOutput({ + required this.domainId, + required this.environmentId, + required this.id, + required this.name, + required this.projectId, + this.assetFormsOutput, + this.configuration, + this.createdAt, + this.description, + this.enableSetting, + this.errorMessage, + this.lastRunAt, + this.lastRunErrorMessage, + this.lastRunStatus, + this.publishOnImport, + this.schedule, + this.status, + this.type, + this.updatedAt, + }); + + factory DeleteDataSourceOutput.fromJson(Map json) { + return DeleteDataSourceOutput( + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + assetFormsOutput: (json['assetFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + configuration: json['configuration'] != null + ? DataSourceConfigurationOutput.fromJson( + json['configuration'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + enableSetting: (json['enableSetting'] as String?)?.toEnableSetting(), + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + lastRunAt: timeStampFromJson(json['lastRunAt']), + lastRunErrorMessage: json['lastRunErrorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['lastRunErrorMessage'] as Map) + : null, + lastRunStatus: + (json['lastRunStatus'] as String?)?.toDataSourceRunStatus(), + publishOnImport: json['publishOnImport'] as bool?, + schedule: json['schedule'] != null + ? ScheduleConfiguration.fromJson( + json['schedule'] as Map) + : null, + status: (json['status'] as String?)?.toDataSourceStatus(), + type: json['type'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final name = this.name; + final projectId = this.projectId; + final assetFormsOutput = this.assetFormsOutput; + final configuration = this.configuration; + final createdAt = this.createdAt; + final description = this.description; + final enableSetting = this.enableSetting; + final errorMessage = this.errorMessage; + final lastRunAt = this.lastRunAt; + final lastRunErrorMessage = this.lastRunErrorMessage; + final lastRunStatus = this.lastRunStatus; + final publishOnImport = this.publishOnImport; + final schedule = this.schedule; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'name': name, + 'projectId': projectId, + if (assetFormsOutput != null) 'assetFormsOutput': assetFormsOutput, + if (configuration != null) 'configuration': configuration, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (lastRunAt != null) 'lastRunAt': iso8601ToJson(lastRunAt), + if (lastRunErrorMessage != null) + 'lastRunErrorMessage': lastRunErrorMessage, + if (lastRunStatus != null) 'lastRunStatus': lastRunStatus.toValue(), + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (schedule != null) 'schedule': schedule, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class DeleteDomainOutput { + /// The status of the domain. + final DomainStatus status; + + DeleteDomainOutput({ + required this.status, + }); + + factory DeleteDomainOutput.fromJson(Map json) { + return DeleteDomainOutput( + status: (json['status'] as String).toDomainStatus(), + ); + } + + Map toJson() { + final status = this.status; + return { + 'status': status.toValue(), + }; + } +} + +class DeleteEnvironmentBlueprintConfigurationOutput { + DeleteEnvironmentBlueprintConfigurationOutput(); + + factory DeleteEnvironmentBlueprintConfigurationOutput.fromJson( + Map _) { + return DeleteEnvironmentBlueprintConfigurationOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteFormTypeOutput { + DeleteFormTypeOutput(); + + factory DeleteFormTypeOutput.fromJson(Map _) { + return DeleteFormTypeOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteGlossaryOutput { + DeleteGlossaryOutput(); + + factory DeleteGlossaryOutput.fromJson(Map _) { + return DeleteGlossaryOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteGlossaryTermOutput { + DeleteGlossaryTermOutput(); + + factory DeleteGlossaryTermOutput.fromJson(Map _) { + return DeleteGlossaryTermOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteListingOutput { + DeleteListingOutput(); + + factory DeleteListingOutput.fromJson(Map _) { + return DeleteListingOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteProjectMembershipOutput { + DeleteProjectMembershipOutput(); + + factory DeleteProjectMembershipOutput.fromJson(Map _) { + return DeleteProjectMembershipOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteProjectOutput { + DeleteProjectOutput(); + + factory DeleteProjectOutput.fromJson(Map _) { + return DeleteProjectOutput(); + } + + Map toJson() { + return {}; + } +} + +class DeleteSubscriptionGrantOutput { + /// The timestamp of when the subscription grant that is deleted was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription grant that is deleted. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription grant is + /// deleted. + final String domainId; + + /// The entity to which the subscription is deleted. + final GrantedEntity grantedEntity; + + /// The ID of the subscription grant that is deleted. + final String id; + + /// The status of the subscription grant that is deleted. + final SubscriptionGrantOverallStatus status; + + /// The ID of the subscription target associated with the subscription grant + /// that is deleted. + final String subscriptionTargetId; + + /// The timestamp of when the subscription grant that is deleted was updated. + final DateTime updatedAt; + + /// The assets for which the subsctiption grant that is deleted gave access. + final List? assets; + + /// The identifier of the subsctiption whose subscription grant is to be + /// deleted. + final String? subscriptionId; + + /// The Amazon DataZone user who updated the subscription grant that is deleted. + final String? updatedBy; + + DeleteSubscriptionGrantOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.grantedEntity, + required this.id, + required this.status, + required this.subscriptionTargetId, + required this.updatedAt, + this.assets, + this.subscriptionId, + this.updatedBy, + }); + + factory DeleteSubscriptionGrantOutput.fromJson(Map json) { + return DeleteSubscriptionGrantOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + grantedEntity: + GrantedEntity.fromJson(json['grantedEntity'] as Map), + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionGrantOverallStatus(), + subscriptionTargetId: json['subscriptionTargetId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + assets: (json['assets'] as List?) + ?.whereNotNull() + .map((e) => SubscribedAsset.fromJson(e as Map)) + .toList(), + subscriptionId: json['subscriptionId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final grantedEntity = this.grantedEntity; + final id = this.id; + final status = this.status; + final subscriptionTargetId = this.subscriptionTargetId; + final updatedAt = this.updatedAt; + final assets = this.assets; + final subscriptionId = this.subscriptionId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'grantedEntity': grantedEntity, + 'id': id, + 'status': status.toValue(), + 'subscriptionTargetId': subscriptionTargetId, + 'updatedAt': unixTimestampToJson(updatedAt), + if (assets != null) 'assets': assets, + if (subscriptionId != null) 'subscriptionId': subscriptionId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class DeleteTimeSeriesDataPointsOutput { + DeleteTimeSeriesDataPointsOutput(); + + factory DeleteTimeSeriesDataPointsOutput.fromJson(Map _) { + return DeleteTimeSeriesDataPointsOutput(); + } + + Map toJson() { + return {}; + } +} + +/// The details of the last deployment of the environment. +class Deployment { + /// The identifier of the last deployment of the environment. + final String? deploymentId; + + /// The status of the last deployment of the environment. + final DeploymentStatus? deploymentStatus; + + /// The type of the last deployment of the environment. + final DeploymentType? deploymentType; + + /// The failure reason of the last deployment of the environment. + final EnvironmentError? failureReason; + + /// Specifies whether the last deployment of the environment is complete. + final bool? isDeploymentComplete; + + /// The messages of the last deployment of the environment. + final List? messages; + + Deployment({ + this.deploymentId, + this.deploymentStatus, + this.deploymentType, + this.failureReason, + this.isDeploymentComplete, + this.messages, + }); + + factory Deployment.fromJson(Map json) { + return Deployment( + deploymentId: json['deploymentId'] as String?, + deploymentStatus: + (json['deploymentStatus'] as String?)?.toDeploymentStatus(), + deploymentType: (json['deploymentType'] as String?)?.toDeploymentType(), + failureReason: json['failureReason'] != null + ? EnvironmentError.fromJson( + json['failureReason'] as Map) + : null, + isDeploymentComplete: json['isDeploymentComplete'] as bool?, + messages: (json['messages'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final deploymentId = this.deploymentId; + final deploymentStatus = this.deploymentStatus; + final deploymentType = this.deploymentType; + final failureReason = this.failureReason; + final isDeploymentComplete = this.isDeploymentComplete; + final messages = this.messages; + return { + if (deploymentId != null) 'deploymentId': deploymentId, + if (deploymentStatus != null) + 'deploymentStatus': deploymentStatus.toValue(), + if (deploymentType != null) 'deploymentType': deploymentType.toValue(), + if (failureReason != null) 'failureReason': failureReason, + if (isDeploymentComplete != null) + 'isDeploymentComplete': isDeploymentComplete, + if (messages != null) 'messages': messages, + }; + } +} + +/// The deployment properties of the Amazon DataZone blueprint. +class DeploymentProperties { + /// The end timeout of the environment blueprint deployment. + final int? endTimeoutMinutes; + + /// The start timeout of the environment blueprint deployment. + final int? startTimeoutMinutes; + + DeploymentProperties({ + this.endTimeoutMinutes, + this.startTimeoutMinutes, + }); + + factory DeploymentProperties.fromJson(Map json) { + return DeploymentProperties( + endTimeoutMinutes: json['endTimeoutMinutes'] as int?, + startTimeoutMinutes: json['startTimeoutMinutes'] as int?, + ); + } + + Map toJson() { + final endTimeoutMinutes = this.endTimeoutMinutes; + final startTimeoutMinutes = this.startTimeoutMinutes; + return { + if (endTimeoutMinutes != null) 'endTimeoutMinutes': endTimeoutMinutes, + if (startTimeoutMinutes != null) + 'startTimeoutMinutes': startTimeoutMinutes, + }; + } +} + +enum DeploymentStatus { + inProgress, + successful, + failed, + pendingDeployment, +} + +extension DeploymentStatusValueExtension on DeploymentStatus { + String toValue() { + switch (this) { + case DeploymentStatus.inProgress: + return 'IN_PROGRESS'; + case DeploymentStatus.successful: + return 'SUCCESSFUL'; + case DeploymentStatus.failed: + return 'FAILED'; + case DeploymentStatus.pendingDeployment: + return 'PENDING_DEPLOYMENT'; + } + } +} + +extension DeploymentStatusFromString on String { + DeploymentStatus toDeploymentStatus() { + switch (this) { + case 'IN_PROGRESS': + return DeploymentStatus.inProgress; + case 'SUCCESSFUL': + return DeploymentStatus.successful; + case 'FAILED': + return DeploymentStatus.failed; + case 'PENDING_DEPLOYMENT': + return DeploymentStatus.pendingDeployment; + } + throw Exception('$this is not known in enum DeploymentStatus'); + } +} + +enum DeploymentType { + create, + update, + delete, +} + +extension DeploymentTypeValueExtension on DeploymentType { + String toValue() { + switch (this) { + case DeploymentType.create: + return 'CREATE'; + case DeploymentType.update: + return 'UPDATE'; + case DeploymentType.delete: + return 'DELETE'; + } + } +} + +extension DeploymentTypeFromString on String { + DeploymentType toDeploymentType() { + switch (this) { + case 'CREATE': + return DeploymentType.create; + case 'UPDATE': + return DeploymentType.update; + case 'DELETE': + return DeploymentType.delete; + } + throw Exception('$this is not known in enum DeploymentType'); + } +} + +/// Details of a glossary term attached to the inventory asset. +class DetailedGlossaryTerm { + /// The name of a glossary term attached to the inventory asset. + final String? name; + + /// The shoft description of a glossary term attached to the inventory asset. + final String? shortDescription; + + DetailedGlossaryTerm({ + this.name, + this.shortDescription, + }); + + factory DetailedGlossaryTerm.fromJson(Map json) { + return DetailedGlossaryTerm( + name: json['name'] as String?, + shortDescription: json['shortDescription'] as String?, + ); + } + + Map toJson() { + final name = this.name; + final shortDescription = this.shortDescription; + return { + if (name != null) 'name': name, + if (shortDescription != null) 'shortDescription': shortDescription, + }; + } +} + +enum DomainStatus { + creating, + available, + creationFailed, + deleting, + deleted, + deletionFailed, +} + +extension DomainStatusValueExtension on DomainStatus { + String toValue() { + switch (this) { + case DomainStatus.creating: + return 'CREATING'; + case DomainStatus.available: + return 'AVAILABLE'; + case DomainStatus.creationFailed: + return 'CREATION_FAILED'; + case DomainStatus.deleting: + return 'DELETING'; + case DomainStatus.deleted: + return 'DELETED'; + case DomainStatus.deletionFailed: + return 'DELETION_FAILED'; + } + } +} + +extension DomainStatusFromString on String { + DomainStatus toDomainStatus() { + switch (this) { + case 'CREATING': + return DomainStatus.creating; + case 'AVAILABLE': + return DomainStatus.available; + case 'CREATION_FAILED': + return DomainStatus.creationFailed; + case 'DELETING': + return DomainStatus.deleting; + case 'DELETED': + return DomainStatus.deleted; + case 'DELETION_FAILED': + return DomainStatus.deletionFailed; + } + throw Exception('$this is not known in enum DomainStatus'); + } +} + +/// A summary of a Amazon DataZone domain. +class DomainSummary { + /// The ARN of the Amazon DataZone domain. + final String arn; + + /// A timestamp of when a Amazon DataZone domain was created. + final DateTime createdAt; + + /// The ID of the Amazon DataZone domain. + final String id; + + /// The identifier of the Amazon Web Services account that manages the domain. + final String managedAccountId; + + /// A name of an Amazon DataZone domain. + final String name; + + /// The status of the Amazon DataZone domain. + final DomainStatus status; + + /// A description of an Amazon DataZone domain. + final String? description; + + /// A timestamp of when a Amazon DataZone domain was last updated. + final DateTime? lastUpdatedAt; + + /// The data portal URL for the Amazon DataZone domain. + final String? portalUrl; + + DomainSummary({ + required this.arn, + required this.createdAt, + required this.id, + required this.managedAccountId, + required this.name, + required this.status, + this.description, + this.lastUpdatedAt, + this.portalUrl, + }); + + factory DomainSummary.fromJson(Map json) { + return DomainSummary( + arn: json['arn'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + id: json['id'] as String, + managedAccountId: json['managedAccountId'] as String, + name: json['name'] as String, + status: (json['status'] as String).toDomainStatus(), + description: json['description'] as String?, + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + portalUrl: json['portalUrl'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final createdAt = this.createdAt; + final id = this.id; + final managedAccountId = this.managedAccountId; + final name = this.name; + final status = this.status; + final description = this.description; + final lastUpdatedAt = this.lastUpdatedAt; + final portalUrl = this.portalUrl; + return { + 'arn': arn, + 'createdAt': unixTimestampToJson(createdAt), + 'id': id, + 'managedAccountId': managedAccountId, + 'name': name, + 'status': status.toValue(), + if (description != null) 'description': description, + if (lastUpdatedAt != null) + 'lastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (portalUrl != null) 'portalUrl': portalUrl, + }; + } +} + +enum EnableSetting { + enabled, + disabled, +} + +extension EnableSettingValueExtension on EnableSetting { + String toValue() { + switch (this) { + case EnableSetting.enabled: + return 'ENABLED'; + case EnableSetting.disabled: + return 'DISABLED'; + } + } +} + +extension EnableSettingFromString on String { + EnableSetting toEnableSetting() { + switch (this) { + case 'ENABLED': + return EnableSetting.enabled; + case 'DISABLED': + return EnableSetting.disabled; + } + throw Exception('$this is not known in enum EnableSetting'); + } +} + +enum EntityType { + asset, +} + +extension EntityTypeValueExtension on EntityType { + String toValue() { + switch (this) { + case EntityType.asset: + return 'ASSET'; + } + } +} + +extension EntityTypeFromString on String { + EntityType toEntityType() { + switch (this) { + case 'ASSET': + return EntityType.asset; + } + throw Exception('$this is not known in enum EntityType'); + } +} + +/// The configuration details of an environment blueprint. +class EnvironmentBlueprintConfigurationItem { + /// The identifier of the Amazon DataZone domain in which an environment + /// blueprint exists. + final String domainId; + + /// The identifier of the environment blueprint. + final String environmentBlueprintId; + + /// The timestamp of when an environment blueprint was created. + final DateTime? createdAt; + + /// The enabled Amazon Web Services Regions specified in a blueprint + /// configuration. + final List? enabledRegions; + + /// The ARN of the manage access role specified in the environment blueprint + /// configuration. + final String? manageAccessRoleArn; + + /// The ARN of the provisioning role specified in the environment blueprint + /// configuration. + final String? provisioningRoleArn; + + /// The regional parameters of the environment blueprint. + final Map>? regionalParameters; + + /// The timestamp of when the environment blueprint was updated. + final DateTime? updatedAt; + + EnvironmentBlueprintConfigurationItem({ + required this.domainId, + required this.environmentBlueprintId, + this.createdAt, + this.enabledRegions, + this.manageAccessRoleArn, + this.provisioningRoleArn, + this.regionalParameters, + this.updatedAt, + }); + + factory EnvironmentBlueprintConfigurationItem.fromJson( + Map json) { + return EnvironmentBlueprintConfigurationItem( + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + enabledRegions: (json['enabledRegions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + manageAccessRoleArn: json['manageAccessRoleArn'] as String?, + provisioningRoleArn: json['provisioningRoleArn'] as String?, + regionalParameters: (json['regionalParameters'] as Map?) + ?.map((k, e) => MapEntry( + k, + (e as Map) + .map((k, e) => MapEntry(k, e as String)))), + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final createdAt = this.createdAt; + final enabledRegions = this.enabledRegions; + final manageAccessRoleArn = this.manageAccessRoleArn; + final provisioningRoleArn = this.provisioningRoleArn; + final regionalParameters = this.regionalParameters; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (enabledRegions != null) 'enabledRegions': enabledRegions, + if (manageAccessRoleArn != null) + 'manageAccessRoleArn': manageAccessRoleArn, + if (provisioningRoleArn != null) + 'provisioningRoleArn': provisioningRoleArn, + if (regionalParameters != null) 'regionalParameters': regionalParameters, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// The details of an environment blueprint summary. +class EnvironmentBlueprintSummary { + /// The identifier of the blueprint. + final String id; + + /// The name of the blueprint. + final String name; + + /// The provider of the blueprint. + final String provider; + + /// The provisioning properties of the blueprint. + final ProvisioningProperties provisioningProperties; + + /// The timestamp of when an environment blueprint was created. + final DateTime? createdAt; + + /// The description of a blueprint. + final String? description; + + /// The timestamp of when the blueprint was enabled. + final DateTime? updatedAt; + + EnvironmentBlueprintSummary({ + required this.id, + required this.name, + required this.provider, + required this.provisioningProperties, + this.createdAt, + this.description, + this.updatedAt, + }); + + factory EnvironmentBlueprintSummary.fromJson(Map json) { + return EnvironmentBlueprintSummary( + id: json['id'] as String, + name: json['name'] as String, + provider: json['provider'] as String, + provisioningProperties: ProvisioningProperties.fromJson( + json['provisioningProperties'] as Map), + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final id = this.id; + final name = this.name; + final provider = this.provider; + final provisioningProperties = this.provisioningProperties; + final createdAt = this.createdAt; + final description = this.description; + final updatedAt = this.updatedAt; + return { + 'id': id, + 'name': name, + 'provider': provider, + 'provisioningProperties': provisioningProperties, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// The failure reasons for the environment deployment. +class EnvironmentError { + /// The error message for the failure reason for the environment deployment. + final String message; + + /// The error code for the failure reason for the environment deployment. + final String? code; + + EnvironmentError({ + required this.message, + this.code, + }); + + factory EnvironmentError.fromJson(Map json) { + return EnvironmentError( + message: json['message'] as String, + code: json['code'] as String?, + ); + } + + Map toJson() { + final message = this.message; + final code = this.code; + return { + 'message': message, + if (code != null) 'code': code, + }; + } +} + +/// The parameter details of an evironment profile. +class EnvironmentParameter { + /// The name of an environment profile parameter. + final String? name; + + /// The value of an environment profile parameter. + final String? value; + + EnvironmentParameter({ + this.name, + this.value, + }); + + Map toJson() { + final name = this.name; + final value = this.value; + return { + if (name != null) 'name': name, + if (value != null) 'value': value, + }; + } +} + +/// The details of an environment profile. +class EnvironmentProfileSummary { + /// The Amazon DataZone user who created the environment profile. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the environment + /// profile exists. + final String domainId; + + /// The identifier of a blueprint with which an environment profile is created. + final String environmentBlueprintId; + + /// The identifier of the environment profile. + final String id; + + /// The name of the environment profile. + final String name; + + /// The identifier of an Amazon Web Services account in which an environment + /// profile exists. + final String? awsAccountId; + + /// The Amazon Web Services Region in which an environment profile exists. + final String? awsAccountRegion; + + /// The timestamp of when an environment profile was created. + final DateTime? createdAt; + + /// The description of the environment profile. + final String? description; + + /// The identifier of a project in which an environment profile exists. + final String? projectId; + + /// The timestamp of when the environment profile was updated. + final DateTime? updatedAt; + + EnvironmentProfileSummary({ + required this.createdBy, + required this.domainId, + required this.environmentBlueprintId, + required this.id, + required this.name, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.description, + this.projectId, + this.updatedAt, + }); + + factory EnvironmentProfileSummary.fromJson(Map json) { + return EnvironmentProfileSummary( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + id: json['id'] as String, + name: json['name'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + projectId: json['projectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final id = this.id; + final name = this.name; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final description = this.description; + final projectId = this.projectId; + final updatedAt = this.updatedAt; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + 'id': id, + 'name': name, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (projectId != null) 'projectId': projectId, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +enum EnvironmentStatus { + active, + creating, + updating, + deleting, + createFailed, + updateFailed, + deleteFailed, + validationFailed, + suspended, + disabled, + expired, + deleted, + inaccessible, +} + +extension EnvironmentStatusValueExtension on EnvironmentStatus { + String toValue() { + switch (this) { + case EnvironmentStatus.active: + return 'ACTIVE'; + case EnvironmentStatus.creating: + return 'CREATING'; + case EnvironmentStatus.updating: + return 'UPDATING'; + case EnvironmentStatus.deleting: + return 'DELETING'; + case EnvironmentStatus.createFailed: + return 'CREATE_FAILED'; + case EnvironmentStatus.updateFailed: + return 'UPDATE_FAILED'; + case EnvironmentStatus.deleteFailed: + return 'DELETE_FAILED'; + case EnvironmentStatus.validationFailed: + return 'VALIDATION_FAILED'; + case EnvironmentStatus.suspended: + return 'SUSPENDED'; + case EnvironmentStatus.disabled: + return 'DISABLED'; + case EnvironmentStatus.expired: + return 'EXPIRED'; + case EnvironmentStatus.deleted: + return 'DELETED'; + case EnvironmentStatus.inaccessible: + return 'INACCESSIBLE'; + } + } +} + +extension EnvironmentStatusFromString on String { + EnvironmentStatus toEnvironmentStatus() { + switch (this) { + case 'ACTIVE': + return EnvironmentStatus.active; + case 'CREATING': + return EnvironmentStatus.creating; + case 'UPDATING': + return EnvironmentStatus.updating; + case 'DELETING': + return EnvironmentStatus.deleting; + case 'CREATE_FAILED': + return EnvironmentStatus.createFailed; + case 'UPDATE_FAILED': + return EnvironmentStatus.updateFailed; + case 'DELETE_FAILED': + return EnvironmentStatus.deleteFailed; + case 'VALIDATION_FAILED': + return EnvironmentStatus.validationFailed; + case 'SUSPENDED': + return EnvironmentStatus.suspended; + case 'DISABLED': + return EnvironmentStatus.disabled; + case 'EXPIRED': + return EnvironmentStatus.expired; + case 'DELETED': + return EnvironmentStatus.deleted; + case 'INACCESSIBLE': + return EnvironmentStatus.inaccessible; + } + throw Exception('$this is not known in enum EnvironmentStatus'); + } +} + +/// The details of an environment. +class EnvironmentSummary { + /// The Amazon DataZone user who created the environment. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the environment + /// exists. + final String domainId; + + /// The identifier of the environment profile with which the environment was + /// created. + final String environmentProfileId; + + /// The name of the environment. + final String name; + + /// The identifier of the project in which the environment exists. + final String projectId; + + /// The provider of the environment. + final String provider; + + /// The identifier of the Amazon Web Services account in which an environment + /// exists. + final String? awsAccountId; + + /// The Amazon Web Services Region in which an environment exists. + final String? awsAccountRegion; + + /// The timestamp of when the environment was created. + final DateTime? createdAt; + + /// The description of the environment. + final String? description; + + /// The identifier of the environment. + final String? id; + + /// The status of the environment. + final EnvironmentStatus? status; + + /// The timestamp of when the environment was updated. + final DateTime? updatedAt; + + EnvironmentSummary({ + required this.createdBy, + required this.domainId, + required this.environmentProfileId, + required this.name, + required this.projectId, + required this.provider, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.description, + this.id, + this.status, + this.updatedAt, + }); + + factory EnvironmentSummary.fromJson(Map json) { + return EnvironmentSummary( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentProfileId: json['environmentProfileId'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toEnvironmentStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentProfileId = this.environmentProfileId; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final description = this.description; + final id = this.id; + final status = this.status; + final updatedAt = this.updatedAt; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentProfileId': environmentProfileId, + 'name': name, + 'projectId': projectId, + 'provider': provider, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// Specifies the error message that is returned if the operation cannot be +/// successfully completed. +class FailureCause { + /// The description of the error message. + final String? message; + + FailureCause({ + this.message, + }); + + factory FailureCause.fromJson(Map json) { + return FailureCause( + message: json['message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'message': message, + }; + } +} + +/// A search filter in Amazon DataZone. +class Filter { + /// A search filter attribute in Amazon DataZone. + final String attribute; + + /// A search filter value in Amazon DataZone. + final String value; + + Filter({ + required this.attribute, + required this.value, + }); + + Map toJson() { + final attribute = this.attribute; + final value = this.value; + return { + 'attribute': attribute, + 'value': value, + }; + } +} + +/// A search filter clause in Amazon DataZone. +class FilterClause { + /// The 'and' search filter clause in Amazon DataZone. + final List? and; + + /// A search filter in Amazon DataZone. + final Filter? filter; + + /// The 'or' search filter clause in Amazon DataZone. + final List? or; + + FilterClause({ + this.and, + this.filter, + this.or, + }); + + Map toJson() { + final and = this.and; + final filter = this.filter; + final or = this.or; + return { + if (and != null) 'and': and, + if (filter != null) 'filter': filter, + if (or != null) 'or': or, + }; + } +} + +/// A filter expression in Amazon DataZone. +class FilterExpression { + /// The search filter expression. + final String expression; + + /// The search filter explresison type. + final FilterExpressionType type; + + FilterExpression({ + required this.expression, + required this.type, + }); + + factory FilterExpression.fromJson(Map json) { + return FilterExpression( + expression: json['expression'] as String, + type: (json['type'] as String).toFilterExpressionType(), + ); + } + + Map toJson() { + final expression = this.expression; + final type = this.type; + return { + 'expression': expression, + 'type': type.toValue(), + }; + } +} + +enum FilterExpressionType { + include, + exclude, +} + +extension FilterExpressionTypeValueExtension on FilterExpressionType { + String toValue() { + switch (this) { + case FilterExpressionType.include: + return 'INCLUDE'; + case FilterExpressionType.exclude: + return 'EXCLUDE'; + } + } +} + +extension FilterExpressionTypeFromString on String { + FilterExpressionType toFilterExpressionType() { + switch (this) { + case 'INCLUDE': + return FilterExpressionType.include; + case 'EXCLUDE': + return FilterExpressionType.exclude; + } + throw Exception('$this is not known in enum FilterExpressionType'); + } +} + +/// The details of the form entry. +class FormEntryInput { + /// The type ID of the form entry. + final String typeIdentifier; + + /// The type revision of the form entry. + final String typeRevision; + + /// Specifies whether a form entry is required. + final bool? required; + + FormEntryInput({ + required this.typeIdentifier, + required this.typeRevision, + this.required, + }); + + Map toJson() { + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + final required = this.required; + return { + 'typeIdentifier': typeIdentifier, + 'typeRevision': typeRevision, + if (required != null) 'required': required, + }; + } +} + +/// The details of the form entry. +class FormEntryOutput { + /// The name of the type of the form entry. + final String typeName; + + /// The type revision of the form entry. + final String typeRevision; + + /// Specifies whether a form entry is required. + final bool? required; + + FormEntryOutput({ + required this.typeName, + required this.typeRevision, + this.required, + }); + + factory FormEntryOutput.fromJson(Map json) { + return FormEntryOutput( + typeName: json['typeName'] as String, + typeRevision: json['typeRevision'] as String, + required: json['required'] as bool?, + ); + } + + Map toJson() { + final typeName = this.typeName; + final typeRevision = this.typeRevision; + final required = this.required; + return { + 'typeName': typeName, + 'typeRevision': typeRevision, + if (required != null) 'required': required, + }; + } +} + +/// The details of a metadata form. +class FormInput { + /// The name of the metadata form. + final String formName; + + /// The content of the metadata form. + final String? content; + + /// The ID of the metadata form type. + final String? typeIdentifier; + + /// The revision of the metadata form type. + final String? typeRevision; + + FormInput({ + required this.formName, + this.content, + this.typeIdentifier, + this.typeRevision, + }); + + Map toJson() { + final formName = this.formName; + final content = this.content; + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + return { + 'formName': formName, + if (content != null) 'content': content, + if (typeIdentifier != null) 'typeIdentifier': typeIdentifier, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + } +} + +/// The details of a metadata form. +class FormOutput { + /// The name of the metadata form. + final String formName; + + /// The content of the metadata form. + final String? content; + + /// The name of the metadata form type. + final String? typeName; + + /// The revision of the metadata form type. + final String? typeRevision; + + FormOutput({ + required this.formName, + this.content, + this.typeName, + this.typeRevision, + }); + + factory FormOutput.fromJson(Map json) { + return FormOutput( + formName: json['formName'] as String, + content: json['content'] as String?, + typeName: json['typeName'] as String?, + typeRevision: json['typeRevision'] as String?, + ); + } + + Map toJson() { + final formName = this.formName; + final content = this.content; + final typeName = this.typeName; + final typeRevision = this.typeRevision; + return { + 'formName': formName, + if (content != null) 'content': content, + if (typeName != null) 'typeName': typeName, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + } +} + +/// The details of the metadata form type. +class FormTypeData { + /// The identifier of the Amazon DataZone domain in which the form type exists. + final String domainId; + + /// The name of the form type. + final String name; + + /// The revision of the form type. + final String revision; + + /// The timestamp of when the metadata form type was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created teh metadata form type. + final String? createdBy; + + /// The description of the metadata form type. + final String? description; + + /// The imports specified in the form type. + final List? imports; + + /// The model of the form type. + final Model? model; + + /// The identifier of the Amazon DataZone domain in which the form type was + /// originally created. + final String? originDomainId; + + /// The identifier of the project in which the form type was originally created. + final String? originProjectId; + + /// The identifier of the project that owns the form type. + final String? owningProjectId; + + /// The status of the form type. + final FormTypeStatus? status; + + FormTypeData({ + required this.domainId, + required this.name, + required this.revision, + this.createdAt, + this.createdBy, + this.description, + this.imports, + this.model, + this.originDomainId, + this.originProjectId, + this.owningProjectId, + this.status, + }); + + factory FormTypeData.fromJson(Map json) { + return FormTypeData( + domainId: json['domainId'] as String, + name: json['name'] as String, + revision: json['revision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + imports: (json['imports'] as List?) + ?.whereNotNull() + .map((e) => Import.fromJson(e as Map)) + .toList(), + model: json['model'] != null + ? Model.fromJson(json['model'] as Map) + : null, + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + owningProjectId: json['owningProjectId'] as String?, + status: (json['status'] as String?)?.toFormTypeStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final name = this.name; + final revision = this.revision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final imports = this.imports; + final model = this.model; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final owningProjectId = this.owningProjectId; + final status = this.status; + return { + 'domainId': domainId, + 'name': name, + 'revision': revision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (imports != null) 'imports': imports, + if (model != null) 'model': model, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + if (status != null) 'status': status.toValue(), + }; + } +} + +enum FormTypeStatus { + enabled, + disabled, +} + +extension FormTypeStatusValueExtension on FormTypeStatus { + String toValue() { + switch (this) { + case FormTypeStatus.enabled: + return 'ENABLED'; + case FormTypeStatus.disabled: + return 'DISABLED'; + } + } +} + +extension FormTypeStatusFromString on String { + FormTypeStatus toFormTypeStatus() { + switch (this) { + case 'ENABLED': + return FormTypeStatus.enabled; + case 'DISABLED': + return FormTypeStatus.disabled; + } + throw Exception('$this is not known in enum FormTypeStatus'); + } +} + +class GetAssetOutput { + /// The ID of the Amazon DataZone domain to which the asset belongs. + final String domainId; + + /// The metadata forms attached to the asset. + final List formsOutput; + + /// The ID of the asset. + final String id; + + /// The name of the asset. + final String name; + + /// The ID of the project that owns the asset. + final String owningProjectId; + + /// The revision of the asset. + final String revision; + + /// The ID of the asset type. + final String typeIdentifier; + + /// The revision of the asset type. + final String typeRevision; + + /// The timestamp of when the asset was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the asset. + final String? createdBy; + + /// The description of the Amazon DataZone asset. + final String? description; + + /// The external ID of the asset. + final String? externalIdentifier; + + /// The timestamp of when the first revision of the asset was created. + final DateTime? firstRevisionCreatedAt; + + /// The Amazon DataZone user who created the first revision of the asset. + final String? firstRevisionCreatedBy; + + /// The business glossary terms attached to the asset. + final List? glossaryTerms; + + /// The latest data point that was imported into the time series form for the + /// asset. + final List? + latestTimeSeriesDataPointFormsOutput; + + /// The listing of the asset. + final AssetListingDetails? listing; + + /// The read-only metadata forms attached to the asset. + final List? readOnlyFormsOutput; + + GetAssetOutput({ + required this.domainId, + required this.formsOutput, + required this.id, + required this.name, + required this.owningProjectId, + required this.revision, + required this.typeIdentifier, + required this.typeRevision, + this.createdAt, + this.createdBy, + this.description, + this.externalIdentifier, + this.firstRevisionCreatedAt, + this.firstRevisionCreatedBy, + this.glossaryTerms, + this.latestTimeSeriesDataPointFormsOutput, + this.listing, + this.readOnlyFormsOutput, + }); + + factory GetAssetOutput.fromJson(Map json) { + return GetAssetOutput( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as List) + .whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + revision: json['revision'] as String, + typeIdentifier: json['typeIdentifier'] as String, + typeRevision: json['typeRevision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + externalIdentifier: json['externalIdentifier'] as String?, + firstRevisionCreatedAt: timeStampFromJson(json['firstRevisionCreatedAt']), + firstRevisionCreatedBy: json['firstRevisionCreatedBy'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + latestTimeSeriesDataPointFormsOutput: + (json['latestTimeSeriesDataPointFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + listing: json['listing'] != null + ? AssetListingDetails.fromJson( + json['listing'] as Map) + : null, + readOnlyFormsOutput: (json['readOnlyFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final revision = this.revision; + final typeIdentifier = this.typeIdentifier; + final typeRevision = this.typeRevision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final externalIdentifier = this.externalIdentifier; + final firstRevisionCreatedAt = this.firstRevisionCreatedAt; + final firstRevisionCreatedBy = this.firstRevisionCreatedBy; + final glossaryTerms = this.glossaryTerms; + final latestTimeSeriesDataPointFormsOutput = + this.latestTimeSeriesDataPointFormsOutput; + final listing = this.listing; + final readOnlyFormsOutput = this.readOnlyFormsOutput; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + 'revision': revision, + 'typeIdentifier': typeIdentifier, + 'typeRevision': typeRevision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (externalIdentifier != null) 'externalIdentifier': externalIdentifier, + if (firstRevisionCreatedAt != null) + 'firstRevisionCreatedAt': unixTimestampToJson(firstRevisionCreatedAt), + if (firstRevisionCreatedBy != null) + 'firstRevisionCreatedBy': firstRevisionCreatedBy, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (latestTimeSeriesDataPointFormsOutput != null) + 'latestTimeSeriesDataPointFormsOutput': + latestTimeSeriesDataPointFormsOutput, + if (listing != null) 'listing': listing, + if (readOnlyFormsOutput != null) + 'readOnlyFormsOutput': readOnlyFormsOutput, + }; + } +} + +class GetAssetTypeOutput { + /// The ID of the Amazon DataZone domain in which the asset type exists. + final String domainId; + + /// The metadata forms attached to the asset type. + final Map formsOutput; + + /// The name of the asset type. + final String name; + + /// The ID of the Amazon DataZone project that owns the asset type. + final String owningProjectId; + + /// The revision of the asset type. + final String revision; + + /// The timestamp of when the asset type was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the asset type. + final String? createdBy; + + /// The description of the asset type. + final String? description; + + /// The ID of the Amazon DataZone domain in which the asset type was originally + /// created. + final String? originDomainId; + + /// The ID of the Amazon DataZone project in which the asset type was originally + /// created. + final String? originProjectId; + + /// The timestamp of when the asset type was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user that updated the asset type. + final String? updatedBy; + + GetAssetTypeOutput({ + required this.domainId, + required this.formsOutput, + required this.name, + required this.owningProjectId, + required this.revision, + this.createdAt, + this.createdBy, + this.description, + this.originDomainId, + this.originProjectId, + this.updatedAt, + this.updatedBy, + }); + + factory GetAssetTypeOutput.fromJson(Map json) { + return GetAssetTypeOutput( + domainId: json['domainId'] as String, + formsOutput: (json['formsOutput'] as Map).map((k, e) => + MapEntry(k, FormEntryOutput.fromJson(e as Map))), + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + revision: json['revision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final formsOutput = this.formsOutput; + final name = this.name; + final owningProjectId = this.owningProjectId; + final revision = this.revision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'formsOutput': formsOutput, + 'name': name, + 'owningProjectId': owningProjectId, + 'revision': revision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetDataSourceOutput { + /// The ID of the Amazon DataZone domain in which the data source exists. + final String domainId; + + /// The ID of the environment where this data source creates and publishes + /// assets, + final String environmentId; + + /// The ID of the data source. + final String id; + + /// The name of the data source. + final String name; + + /// The ID of the project where the data source creates and publishes assets. + final String projectId; + + /// The metadata forms attached to the assets created by this data source. + final List? assetFormsOutput; + + /// The configuration of the data source. + final DataSourceConfigurationOutput? configuration; + + /// The timestamp of when the data source was created. + final DateTime? createdAt; + + /// The description of the data source. + final String? description; + + /// Specifies whether this data source is enabled or not. + final EnableSetting? enableSetting; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// The number of assets created by the data source during its last run. + final int? lastRunAssetCount; + + /// The timestamp of the last run of the data source. + final DateTime? lastRunAt; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? lastRunErrorMessage; + + /// The status of the last run of the data source. + final DataSourceRunStatus? lastRunStatus; + + /// Specifies whether the assets that this data source creates in the inventory + /// are to be also automatically published to the catalog. + final bool? publishOnImport; + + /// The recommendation configuration of the data source. + final RecommendationConfiguration? recommendation; + + /// The schedule of the data source runs. + final ScheduleConfiguration? schedule; + + /// The status of the data source. + final DataSourceStatus? status; + + /// The type of the data source. + final String? type; + + /// The timestamp of when the data source was updated. + final DateTime? updatedAt; + + GetDataSourceOutput({ + required this.domainId, + required this.environmentId, + required this.id, + required this.name, + required this.projectId, + this.assetFormsOutput, + this.configuration, + this.createdAt, + this.description, + this.enableSetting, + this.errorMessage, + this.lastRunAssetCount, + this.lastRunAt, + this.lastRunErrorMessage, + this.lastRunStatus, + this.publishOnImport, + this.recommendation, + this.schedule, + this.status, + this.type, + this.updatedAt, + }); + + factory GetDataSourceOutput.fromJson(Map json) { + return GetDataSourceOutput( + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + assetFormsOutput: (json['assetFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + configuration: json['configuration'] != null + ? DataSourceConfigurationOutput.fromJson( + json['configuration'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + enableSetting: (json['enableSetting'] as String?)?.toEnableSetting(), + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + lastRunAssetCount: json['lastRunAssetCount'] as int?, + lastRunAt: timeStampFromJson(json['lastRunAt']), + lastRunErrorMessage: json['lastRunErrorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['lastRunErrorMessage'] as Map) + : null, + lastRunStatus: + (json['lastRunStatus'] as String?)?.toDataSourceRunStatus(), + publishOnImport: json['publishOnImport'] as bool?, + recommendation: json['recommendation'] != null + ? RecommendationConfiguration.fromJson( + json['recommendation'] as Map) + : null, + schedule: json['schedule'] != null + ? ScheduleConfiguration.fromJson( + json['schedule'] as Map) + : null, + status: (json['status'] as String?)?.toDataSourceStatus(), + type: json['type'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final name = this.name; + final projectId = this.projectId; + final assetFormsOutput = this.assetFormsOutput; + final configuration = this.configuration; + final createdAt = this.createdAt; + final description = this.description; + final enableSetting = this.enableSetting; + final errorMessage = this.errorMessage; + final lastRunAssetCount = this.lastRunAssetCount; + final lastRunAt = this.lastRunAt; + final lastRunErrorMessage = this.lastRunErrorMessage; + final lastRunStatus = this.lastRunStatus; + final publishOnImport = this.publishOnImport; + final recommendation = this.recommendation; + final schedule = this.schedule; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'name': name, + 'projectId': projectId, + if (assetFormsOutput != null) 'assetFormsOutput': assetFormsOutput, + if (configuration != null) 'configuration': configuration, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (lastRunAssetCount != null) 'lastRunAssetCount': lastRunAssetCount, + if (lastRunAt != null) 'lastRunAt': iso8601ToJson(lastRunAt), + if (lastRunErrorMessage != null) + 'lastRunErrorMessage': lastRunErrorMessage, + if (lastRunStatus != null) 'lastRunStatus': lastRunStatus.toValue(), + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (recommendation != null) 'recommendation': recommendation, + if (schedule != null) 'schedule': schedule, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class GetDataSourceRunOutput { + /// The timestamp of when the data source run was created. + final DateTime createdAt; + + /// The ID of the data source for this data source run. + final String dataSourceId; + + /// The ID of the domain in which this data source run was performed. + final String domainId; + + /// The ID of the data source run. + final String id; + + /// The ID of the project in which this data source run occured. + final String projectId; + + /// The status of this data source run. + final DataSourceRunStatus status; + + /// The type of this data source run. + final DataSourceRunType type; + + /// The timestamp of when this data source run was updated. + final DateTime updatedAt; + + /// The configuration snapshot of the data source run. + final String? dataSourceConfigurationSnapshot; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// The asset statistics from this data source run. + final RunStatisticsForAssets? runStatisticsForAssets; + + /// The timestamp of when this data source run started. + final DateTime? startedAt; + + /// The timestamp of when this data source run stopped. + final DateTime? stoppedAt; + + GetDataSourceRunOutput({ + required this.createdAt, + required this.dataSourceId, + required this.domainId, + required this.id, + required this.projectId, + required this.status, + required this.type, + required this.updatedAt, + this.dataSourceConfigurationSnapshot, + this.errorMessage, + this.runStatisticsForAssets, + this.startedAt, + this.stoppedAt, + }); + + factory GetDataSourceRunOutput.fromJson(Map json) { + return GetDataSourceRunOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + dataSourceId: json['dataSourceId'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + projectId: json['projectId'] as String, + status: (json['status'] as String).toDataSourceRunStatus(), + type: (json['type'] as String).toDataSourceRunType(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + dataSourceConfigurationSnapshot: + json['dataSourceConfigurationSnapshot'] as String?, + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + runStatisticsForAssets: json['runStatisticsForAssets'] != null + ? RunStatisticsForAssets.fromJson( + json['runStatisticsForAssets'] as Map) + : null, + startedAt: timeStampFromJson(json['startedAt']), + stoppedAt: timeStampFromJson(json['stoppedAt']), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final dataSourceId = this.dataSourceId; + final domainId = this.domainId; + final id = this.id; + final projectId = this.projectId; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + final dataSourceConfigurationSnapshot = + this.dataSourceConfigurationSnapshot; + final errorMessage = this.errorMessage; + final runStatisticsForAssets = this.runStatisticsForAssets; + final startedAt = this.startedAt; + final stoppedAt = this.stoppedAt; + return { + 'createdAt': iso8601ToJson(createdAt), + 'dataSourceId': dataSourceId, + 'domainId': domainId, + 'id': id, + 'projectId': projectId, + 'status': status.toValue(), + 'type': type.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (dataSourceConfigurationSnapshot != null) + 'dataSourceConfigurationSnapshot': dataSourceConfigurationSnapshot, + if (errorMessage != null) 'errorMessage': errorMessage, + if (runStatisticsForAssets != null) + 'runStatisticsForAssets': runStatisticsForAssets, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (stoppedAt != null) 'stoppedAt': iso8601ToJson(stoppedAt), + }; + } +} + +class GetDomainOutput { + /// The domain execution role with which the Amazon DataZone domain is created. + final String domainExecutionRole; + + /// The identifier of the specified Amazon DataZone domain. + final String id; + + /// The status of the specified Amazon DataZone domain. + final DomainStatus status; + + /// The ARN of the specified Amazon DataZone domain. + final String? arn; + + /// The timestamp of when the Amazon DataZone domain was created. + final DateTime? createdAt; + + /// The description of the Amazon DataZone domain. + final String? description; + + /// The identifier of the Amazon Web Services Key Management Service (KMS) key + /// that is used to encrypt the Amazon DataZone domain, metadata, and reporting + /// data. + final String? kmsKeyIdentifier; + + /// The timestamp of when the Amazon DataZone domain was last updated. + final DateTime? lastUpdatedAt; + + /// The name of the Amazon DataZone domain. + final String? name; + + /// The URL of the data portal for this Amazon DataZone domain. + final String? portalUrl; + + /// The single sing-on option of the specified Amazon DataZone domain. + final SingleSignOn? singleSignOn; + + /// The tags specified for the Amazon DataZone domain. + final Map? tags; + + GetDomainOutput({ + required this.domainExecutionRole, + required this.id, + required this.status, + this.arn, + this.createdAt, + this.description, + this.kmsKeyIdentifier, + this.lastUpdatedAt, + this.name, + this.portalUrl, + this.singleSignOn, + this.tags, + }); + + factory GetDomainOutput.fromJson(Map json) { + return GetDomainOutput( + domainExecutionRole: json['domainExecutionRole'] as String, + id: json['id'] as String, + status: (json['status'] as String).toDomainStatus(), + arn: json['arn'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + kmsKeyIdentifier: json['kmsKeyIdentifier'] as String?, + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + name: json['name'] as String?, + portalUrl: json['portalUrl'] as String?, + singleSignOn: json['singleSignOn'] != null + ? SingleSignOn.fromJson(json['singleSignOn'] as Map) + : null, + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final domainExecutionRole = this.domainExecutionRole; + final id = this.id; + final status = this.status; + final arn = this.arn; + final createdAt = this.createdAt; + final description = this.description; + final kmsKeyIdentifier = this.kmsKeyIdentifier; + final lastUpdatedAt = this.lastUpdatedAt; + final name = this.name; + final portalUrl = this.portalUrl; + final singleSignOn = this.singleSignOn; + final tags = this.tags; + return { + 'domainExecutionRole': domainExecutionRole, + 'id': id, + 'status': status.toValue(), + if (arn != null) 'arn': arn, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (description != null) 'description': description, + if (kmsKeyIdentifier != null) 'kmsKeyIdentifier': kmsKeyIdentifier, + if (lastUpdatedAt != null) + 'lastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (name != null) 'name': name, + if (portalUrl != null) 'portalUrl': portalUrl, + if (singleSignOn != null) 'singleSignOn': singleSignOn, + if (tags != null) 'tags': tags, + }; + } +} + +class GetEnvironmentBlueprintConfigurationOutput { + /// The ID of the Amazon DataZone domain where this blueprint exists. + final String domainId; + + /// The ID of the blueprint. + final String environmentBlueprintId; + + /// The timestamp of when this blueprint was created. + final DateTime? createdAt; + + /// The Amazon Web Services regions in which this blueprint is enabled. + final List? enabledRegions; + + /// The ARN of the manage access role with which this blueprint is created. + final String? manageAccessRoleArn; + + /// The ARN of the provisioning role with which this blueprint is created. + final String? provisioningRoleArn; + + /// The regional parameters of the blueprint. + final Map>? regionalParameters; + + /// The timestamp of when this blueprint was upated. + final DateTime? updatedAt; + + GetEnvironmentBlueprintConfigurationOutput({ + required this.domainId, + required this.environmentBlueprintId, + this.createdAt, + this.enabledRegions, + this.manageAccessRoleArn, + this.provisioningRoleArn, + this.regionalParameters, + this.updatedAt, + }); + + factory GetEnvironmentBlueprintConfigurationOutput.fromJson( + Map json) { + return GetEnvironmentBlueprintConfigurationOutput( + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + enabledRegions: (json['enabledRegions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + manageAccessRoleArn: json['manageAccessRoleArn'] as String?, + provisioningRoleArn: json['provisioningRoleArn'] as String?, + regionalParameters: (json['regionalParameters'] as Map?) + ?.map((k, e) => MapEntry( + k, + (e as Map) + .map((k, e) => MapEntry(k, e as String)))), + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final createdAt = this.createdAt; + final enabledRegions = this.enabledRegions; + final manageAccessRoleArn = this.manageAccessRoleArn; + final provisioningRoleArn = this.provisioningRoleArn; + final regionalParameters = this.regionalParameters; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (enabledRegions != null) 'enabledRegions': enabledRegions, + if (manageAccessRoleArn != null) + 'manageAccessRoleArn': manageAccessRoleArn, + if (provisioningRoleArn != null) + 'provisioningRoleArn': provisioningRoleArn, + if (regionalParameters != null) 'regionalParameters': regionalParameters, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class GetEnvironmentBlueprintOutput { + /// The ID of this Amazon DataZone blueprint. + final String id; + + /// The name of this Amazon DataZone blueprint. + final String name; + + /// The provider of this Amazon DataZone blueprint. + final String provider; + + /// The provisioning properties of this Amazon DataZone blueprint. + final ProvisioningProperties provisioningProperties; + + /// A timestamp of when this blueprint was created. + final DateTime? createdAt; + + /// The deployment properties of this Amazon DataZone blueprint. + final DeploymentProperties? deploymentProperties; + + /// The description of this Amazon DataZone blueprint. + final String? description; + + /// The glossary terms attached to this Amazon DataZone blueprint. + final List? glossaryTerms; + + /// The timestamp of when this blueprint was updated. + final DateTime? updatedAt; + + /// The user parameters of this blueprint. + final List? userParameters; + + GetEnvironmentBlueprintOutput({ + required this.id, + required this.name, + required this.provider, + required this.provisioningProperties, + this.createdAt, + this.deploymentProperties, + this.description, + this.glossaryTerms, + this.updatedAt, + this.userParameters, + }); + + factory GetEnvironmentBlueprintOutput.fromJson(Map json) { + return GetEnvironmentBlueprintOutput( + id: json['id'] as String, + name: json['name'] as String, + provider: json['provider'] as String, + provisioningProperties: ProvisioningProperties.fromJson( + json['provisioningProperties'] as Map), + createdAt: timeStampFromJson(json['createdAt']), + deploymentProperties: json['deploymentProperties'] != null + ? DeploymentProperties.fromJson( + json['deploymentProperties'] as Map) + : null, + description: json['description'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final id = this.id; + final name = this.name; + final provider = this.provider; + final provisioningProperties = this.provisioningProperties; + final createdAt = this.createdAt; + final deploymentProperties = this.deploymentProperties; + final description = this.description; + final glossaryTerms = this.glossaryTerms; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'id': id, + 'name': name, + 'provider': provider, + 'provisioningProperties': provisioningProperties, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (deploymentProperties != null) + 'deploymentProperties': deploymentProperties, + if (description != null) 'description': description, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class GetEnvironmentOutput { + /// The Amazon DataZone user who created the environment. + final String createdBy; + + /// The ID of the Amazon DataZone domain where the environment exists. + final String domainId; + + /// The ID of the environment profile with which the environment is created. + final String environmentProfileId; + + /// The name of the environment. + final String name; + + /// The ID of the Amazon DataZone project in which this environment is created. + final String projectId; + + /// The provider of this Amazon DataZone environment. + final String provider; + + /// The ID of the Amazon Web Services account where the environment exists. + final String? awsAccountId; + + /// The Amazon Web Services region where the environment exists. + final String? awsAccountRegion; + + /// The timestamp of when the environment was created. + final DateTime? createdAt; + + /// The deployment properties of the environment. + final DeploymentProperties? deploymentProperties; + + /// The description of the environment. + final String? description; + + /// The actions of the environment. + final List? environmentActions; + + /// The blueprint with which the environment is created. + final String? environmentBlueprintId; + + /// The business glossary terms that can be used in this environment. + final List? glossaryTerms; + + /// The ID of the environment. + final String? id; + + /// The details of the last deployment of the environment. + final Deployment? lastDeployment; + + /// The provisioned resources of this Amazon DataZone environment. + final List? provisionedResources; + + /// The provisioning properties of this Amazon DataZone environment. + final ProvisioningProperties? provisioningProperties; + + /// The status of this Amazon DataZone environment. + final EnvironmentStatus? status; + + /// The timestamp of when this environment was updated. + final DateTime? updatedAt; + + /// The user parameters of this Amazon DataZone environment. + final List? userParameters; + + GetEnvironmentOutput({ + required this.createdBy, + required this.domainId, + required this.environmentProfileId, + required this.name, + required this.projectId, + required this.provider, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.deploymentProperties, + this.description, + this.environmentActions, + this.environmentBlueprintId, + this.glossaryTerms, + this.id, + this.lastDeployment, + this.provisionedResources, + this.provisioningProperties, + this.status, + this.updatedAt, + this.userParameters, + }); + + factory GetEnvironmentOutput.fromJson(Map json) { + return GetEnvironmentOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentProfileId: json['environmentProfileId'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + deploymentProperties: json['deploymentProperties'] != null + ? DeploymentProperties.fromJson( + json['deploymentProperties'] as Map) + : null, + description: json['description'] as String?, + environmentActions: (json['environmentActions'] as List?) + ?.whereNotNull() + .map((e) => + ConfigurableEnvironmentAction.fromJson(e as Map)) + .toList(), + environmentBlueprintId: json['environmentBlueprintId'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + id: json['id'] as String?, + lastDeployment: json['lastDeployment'] != null + ? Deployment.fromJson(json['lastDeployment'] as Map) + : null, + provisionedResources: (json['provisionedResources'] as List?) + ?.whereNotNull() + .map((e) => Resource.fromJson(e as Map)) + .toList(), + provisioningProperties: json['provisioningProperties'] != null + ? ProvisioningProperties.fromJson( + json['provisioningProperties'] as Map) + : null, + status: (json['status'] as String?)?.toEnvironmentStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentProfileId = this.environmentProfileId; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final deploymentProperties = this.deploymentProperties; + final description = this.description; + final environmentActions = this.environmentActions; + final environmentBlueprintId = this.environmentBlueprintId; + final glossaryTerms = this.glossaryTerms; + final id = this.id; + final lastDeployment = this.lastDeployment; + final provisionedResources = this.provisionedResources; + final provisioningProperties = this.provisioningProperties; + final status = this.status; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentProfileId': environmentProfileId, + 'name': name, + 'projectId': projectId, + 'provider': provider, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (deploymentProperties != null) + 'deploymentProperties': deploymentProperties, + if (description != null) 'description': description, + if (environmentActions != null) 'environmentActions': environmentActions, + if (environmentBlueprintId != null) + 'environmentBlueprintId': environmentBlueprintId, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (id != null) 'id': id, + if (lastDeployment != null) 'lastDeployment': lastDeployment, + if (provisionedResources != null) + 'provisionedResources': provisionedResources, + if (provisioningProperties != null) + 'provisioningProperties': provisioningProperties, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class GetEnvironmentProfileOutput { + /// The Amazon DataZone user who created this environment profile. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which this environment profile + /// exists. + final String domainId; + + /// The ID of the blueprint with which this environment profile is created. + final String environmentBlueprintId; + + /// The ID of the environment profile. + final String id; + + /// The name of the environment profile. + final String name; + + /// The ID of the Amazon Web Services account where this environment profile + /// exists. + final String? awsAccountId; + + /// The Amazon Web Services region where this environment profile exists. + final String? awsAccountRegion; + + /// The timestamp of when this environment profile was created. + final DateTime? createdAt; + + /// The description of the environment profile. + final String? description; + + /// The ID of the Amazon DataZone project in which this environment profile is + /// created. + final String? projectId; + + /// The timestamp of when this environment profile was upated. + final DateTime? updatedAt; + + /// The user parameters of the environment profile. + final List? userParameters; + + GetEnvironmentProfileOutput({ + required this.createdBy, + required this.domainId, + required this.environmentBlueprintId, + required this.id, + required this.name, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.description, + this.projectId, + this.updatedAt, + this.userParameters, + }); + + factory GetEnvironmentProfileOutput.fromJson(Map json) { + return GetEnvironmentProfileOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + id: json['id'] as String, + name: json['name'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + projectId: json['projectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final id = this.id; + final name = this.name; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final description = this.description; + final projectId = this.projectId; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + 'id': id, + 'name': name, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (projectId != null) 'projectId': projectId, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class GetFormTypeOutput { + /// The ID of the Amazon DataZone domain in which this metadata form type + /// exists. + final String domainId; + + /// The model of the metadata form type. + final Model model; + + /// The name of the metadata form type. + final String name; + + /// The revision of the metadata form type. + final String revision; + + /// The timestamp of when this metadata form type was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created this metadata form type. + final String? createdBy; + + /// The description of the metadata form type. + final String? description; + + /// The imports of the metadata form type. + final List? imports; + + /// The ID of the Amazon DataZone domain in which the metadata form type was + /// originally created. + final String? originDomainId; + + /// The ID of the project in which this metadata form type was originally + /// created. + final String? originProjectId; + + /// The ID of the project that owns this metadata form type. + final String? owningProjectId; + + /// The status of the metadata form type. + final FormTypeStatus? status; + + GetFormTypeOutput({ + required this.domainId, + required this.model, + required this.name, + required this.revision, + this.createdAt, + this.createdBy, + this.description, + this.imports, + this.originDomainId, + this.originProjectId, + this.owningProjectId, + this.status, + }); + + factory GetFormTypeOutput.fromJson(Map json) { + return GetFormTypeOutput( + domainId: json['domainId'] as String, + model: Model.fromJson(json['model'] as Map), + name: json['name'] as String, + revision: json['revision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + imports: (json['imports'] as List?) + ?.whereNotNull() + .map((e) => Import.fromJson(e as Map)) + .toList(), + originDomainId: json['originDomainId'] as String?, + originProjectId: json['originProjectId'] as String?, + owningProjectId: json['owningProjectId'] as String?, + status: (json['status'] as String?)?.toFormTypeStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final model = this.model; + final name = this.name; + final revision = this.revision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final imports = this.imports; + final originDomainId = this.originDomainId; + final originProjectId = this.originProjectId; + final owningProjectId = this.owningProjectId; + final status = this.status; + return { + 'domainId': domainId, + 'model': model, + 'name': name, + 'revision': revision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (imports != null) 'imports': imports, + if (originDomainId != null) 'originDomainId': originDomainId, + if (originProjectId != null) 'originProjectId': originProjectId, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + if (status != null) 'status': status.toValue(), + }; + } +} + +class GetGlossaryOutput { + /// The ID of the Amazon DataZone domain in which this business glossary exists. + final String domainId; + + /// The ID of the business glossary. + final String id; + + /// The name of the business glossary. + final String name; + + /// The ID of the project that owns this business glossary. + final String owningProjectId; + + /// The status of the business glossary. + final GlossaryStatus status; + + /// The timestamp of when this business glossary was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created this business glossary. + final String? createdBy; + + /// The description of the business glossary. + final String? description; + + /// The timestamp of when the business glossary was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the business glossary. + final String? updatedBy; + + GetGlossaryOutput({ + required this.domainId, + required this.id, + required this.name, + required this.owningProjectId, + required this.status, + this.createdAt, + this.createdBy, + this.description, + this.updatedAt, + this.updatedBy, + }); + + factory GetGlossaryOutput.fromJson(Map json) { + return GetGlossaryOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + status: (json['status'] as String).toGlossaryStatus(), + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final status = this.status; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + 'status': status.toValue(), + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetGlossaryTermOutput { + /// The ID of the Amazon DataZone domain in which this business glossary term + /// exists. + final String domainId; + + /// The ID of the business glossary to which this term belongs. + final String glossaryId; + + /// The ID of the business glossary term. + final String id; + + /// The name of the business glossary term. + final String name; + + /// The status of the business glossary term. + final GlossaryTermStatus status; + + /// The timestamp of when the business glossary term was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the business glossary. + final String? createdBy; + + /// The long description of the business glossary term. + final String? longDescription; + + /// The short decription of the business glossary term. + final String? shortDescription; + + /// The relations of the business glossary term. + final TermRelations? termRelations; + + /// The timestamp of when the business glossary term was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the business glossary term. + final String? updatedBy; + + GetGlossaryTermOutput({ + required this.domainId, + required this.glossaryId, + required this.id, + required this.name, + required this.status, + this.createdAt, + this.createdBy, + this.longDescription, + this.shortDescription, + this.termRelations, + this.updatedAt, + this.updatedBy, + }); + + factory GetGlossaryTermOutput.fromJson(Map json) { + return GetGlossaryTermOutput( + domainId: json['domainId'] as String, + glossaryId: json['glossaryId'] as String, + id: json['id'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGlossaryTermStatus(), + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + longDescription: json['longDescription'] as String?, + shortDescription: json['shortDescription'] as String?, + termRelations: json['termRelations'] != null + ? TermRelations.fromJson( + json['termRelations'] as Map) + : null, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final glossaryId = this.glossaryId; + final id = this.id; + final name = this.name; + final status = this.status; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final longDescription = this.longDescription; + final shortDescription = this.shortDescription; + final termRelations = this.termRelations; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'glossaryId': glossaryId, + 'id': id, + 'name': name, + 'status': status.toValue(), + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (longDescription != null) 'longDescription': longDescription, + if (shortDescription != null) 'shortDescription': shortDescription, + if (termRelations != null) 'termRelations': termRelations, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetGroupProfileOutput { + /// The identifier of the Amazon DataZone domain in which the group profile + /// exists. + final String? domainId; + + /// The name of the group for which the specified group profile exists. + final String? groupName; + + /// The identifier of the group profile. + final String? id; + + /// The identifier of the group profile. + final GroupProfileStatus? status; + + GetGroupProfileOutput({ + this.domainId, + this.groupName, + this.id, + this.status, + }); + + factory GetGroupProfileOutput.fromJson(Map json) { + return GetGroupProfileOutput( + domainId: json['domainId'] as String?, + groupName: json['groupName'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toGroupProfileStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final groupName = this.groupName; + final id = this.id; + final status = this.status; + return { + if (domainId != null) 'domainId': domainId, + if (groupName != null) 'groupName': groupName, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + }; + } +} + +class GetIamPortalLoginUrlOutput { + /// The ID of the user profile. + final String userProfileId; + + /// The data portal URL of the specified Amazon DataZone domain. + final String? authCodeUrl; + + GetIamPortalLoginUrlOutput({ + required this.userProfileId, + this.authCodeUrl, + }); + + factory GetIamPortalLoginUrlOutput.fromJson(Map json) { + return GetIamPortalLoginUrlOutput( + userProfileId: json['userProfileId'] as String, + authCodeUrl: json['authCodeUrl'] as String?, + ); + } + + Map toJson() { + final userProfileId = this.userProfileId; + final authCodeUrl = this.authCodeUrl; + return { + 'userProfileId': userProfileId, + if (authCodeUrl != null) 'authCodeUrl': authCodeUrl, + }; + } +} + +class GetListingOutput { + /// The ID of the Amazon DataZone domain. + final String domainId; + + /// The ID of the listing. + final String id; + + /// The revision of a listing. + final String listingRevision; + + /// The timestamp of when the listing was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the listing. + final String? createdBy; + + /// The description of the listing. + final String? description; + + /// The details of a listing. + final ListingItem? item; + + /// The name of the listing. + final String? name; + + /// The status of the listing. + final ListingStatus? status; + + /// The timestamp of when the listing was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the listing. + final String? updatedBy; + + GetListingOutput({ + required this.domainId, + required this.id, + required this.listingRevision, + this.createdAt, + this.createdBy, + this.description, + this.item, + this.name, + this.status, + this.updatedAt, + this.updatedBy, + }); + + factory GetListingOutput.fromJson(Map json) { + return GetListingOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + listingRevision: json['listingRevision'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + item: json['item'] != null + ? ListingItem.fromJson(json['item'] as Map) + : null, + name: json['name'] as String?, + status: (json['status'] as String?)?.toListingStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final listingRevision = this.listingRevision; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final item = this.item; + final name = this.name; + final status = this.status; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'id': id, + 'listingRevision': listingRevision, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (item != null) 'item': item, + if (name != null) 'name': name, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetMetadataGenerationRunOutput { + /// The ID of the Amazon DataZone domain the metadata generation run of which + /// you want to get. + final String domainId; + + /// The ID of the metadata generation run. + final String id; + + /// The ID of the project that owns the assets for which you're running metadata + /// generation. + final String owningProjectId; + + /// The timestamp of when the metadata generation run was start. + final DateTime? createdAt; + + /// The Amazon DataZone user who started the metadata generation run. + final String? createdBy; + + /// The status of the metadata generation run. + final MetadataGenerationRunStatus? status; + + /// The asset for which you're generating metadata. + final MetadataGenerationRunTarget? target; + + /// The type of metadata generation run. + final MetadataGenerationRunType? type; + + GetMetadataGenerationRunOutput({ + required this.domainId, + required this.id, + required this.owningProjectId, + this.createdAt, + this.createdBy, + this.status, + this.target, + this.type, + }); + + factory GetMetadataGenerationRunOutput.fromJson(Map json) { + return GetMetadataGenerationRunOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + owningProjectId: json['owningProjectId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + status: (json['status'] as String?)?.toMetadataGenerationRunStatus(), + target: json['target'] != null + ? MetadataGenerationRunTarget.fromJson( + json['target'] as Map) + : null, + type: (json['type'] as String?)?.toMetadataGenerationRunType(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final owningProjectId = this.owningProjectId; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final status = this.status; + final target = this.target; + final type = this.type; + return { + 'domainId': domainId, + 'id': id, + 'owningProjectId': owningProjectId, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (status != null) 'status': status.toValue(), + if (target != null) 'target': target, + if (type != null) 'type': type.toValue(), + }; + } +} + +class GetProjectOutput { + /// The Amazon DataZone user who created the project. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the project exists. + final String domainId; + + /// >The ID of the project. + final String id; + + /// The name of the project. + final String name; + + /// The timestamp of when the project was created. + final DateTime? createdAt; + + /// The description of the project. + final String? description; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final List? failureReasons; + + /// The business glossary terms that can be used in the project. + final List? glossaryTerms; + + /// The timestamp of when the project was last updated. + final DateTime? lastUpdatedAt; + + /// The status of the project. + final ProjectStatus? projectStatus; + + GetProjectOutput({ + required this.createdBy, + required this.domainId, + required this.id, + required this.name, + this.createdAt, + this.description, + this.failureReasons, + this.glossaryTerms, + this.lastUpdatedAt, + this.projectStatus, + }); + + factory GetProjectOutput.fromJson(Map json) { + return GetProjectOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => ProjectDeletionError.fromJson(e as Map)) + .toList(), + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + projectStatus: (json['projectStatus'] as String?)?.toProjectStatus(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final createdAt = this.createdAt; + final description = this.description; + final failureReasons = this.failureReasons; + final glossaryTerms = this.glossaryTerms; + final lastUpdatedAt = this.lastUpdatedAt; + final projectStatus = this.projectStatus; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'name': name, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (lastUpdatedAt != null) 'lastUpdatedAt': iso8601ToJson(lastUpdatedAt), + if (projectStatus != null) 'projectStatus': projectStatus.toValue(), + }; + } +} + +class GetSubscriptionGrantOutput { + /// The timestamp of when the subscription grant is created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription grant. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription grant exists. + final String domainId; + + /// The entity to which the subscription is granted. + final GrantedEntity grantedEntity; + + /// The ID of the subscription grant. + final String id; + + /// The status of the subscription grant. + final SubscriptionGrantOverallStatus status; + + /// The subscription target ID associated with the subscription grant. + final String subscriptionTargetId; + + /// The timestamp of when the subscription grant was upated. + final DateTime updatedAt; + + /// The assets for which the subscription grant is created. + final List? assets; + + /// The identifier of the subscription. + final String? subscriptionId; + + /// The Amazon DataZone user who updated the subscription grant. + final String? updatedBy; + + GetSubscriptionGrantOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.grantedEntity, + required this.id, + required this.status, + required this.subscriptionTargetId, + required this.updatedAt, + this.assets, + this.subscriptionId, + this.updatedBy, + }); + + factory GetSubscriptionGrantOutput.fromJson(Map json) { + return GetSubscriptionGrantOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + grantedEntity: + GrantedEntity.fromJson(json['grantedEntity'] as Map), + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionGrantOverallStatus(), + subscriptionTargetId: json['subscriptionTargetId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + assets: (json['assets'] as List?) + ?.whereNotNull() + .map((e) => SubscribedAsset.fromJson(e as Map)) + .toList(), + subscriptionId: json['subscriptionId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final grantedEntity = this.grantedEntity; + final id = this.id; + final status = this.status; + final subscriptionTargetId = this.subscriptionTargetId; + final updatedAt = this.updatedAt; + final assets = this.assets; + final subscriptionId = this.subscriptionId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'grantedEntity': grantedEntity, + 'id': id, + 'status': status.toValue(), + 'subscriptionTargetId': subscriptionTargetId, + 'updatedAt': unixTimestampToJson(updatedAt), + if (assets != null) 'assets': assets, + if (subscriptionId != null) 'subscriptionId': subscriptionId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetSubscriptionOutput { + /// The timestamp of when the subscription was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription exists. + final String domainId; + + /// The ID of the subscription. + final String id; + + /// The status of the subscription. + final SubscriptionStatus status; + + /// The details of the published asset for which the subscription grant is + /// created. + final SubscribedListing subscribedListing; + + /// The principal that owns the subscription. + final SubscribedPrincipal subscribedPrincipal; + + /// The timestamp of when the subscription was updated. + final DateTime updatedAt; + + /// The retain permissions of the subscription. + final bool? retainPermissions; + + /// The ID of the subscription request. + final String? subscriptionRequestId; + + /// The Amazon DataZone user who updated the subscription. + final String? updatedBy; + + GetSubscriptionOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.status, + required this.subscribedListing, + required this.subscribedPrincipal, + required this.updatedAt, + this.retainPermissions, + this.subscriptionRequestId, + this.updatedBy, + }); + + factory GetSubscriptionOutput.fromJson(Map json) { + return GetSubscriptionOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionStatus(), + subscribedListing: SubscribedListing.fromJson( + json['subscribedListing'] as Map), + subscribedPrincipal: SubscribedPrincipal.fromJson( + json['subscribedPrincipal'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + retainPermissions: json['retainPermissions'] as bool?, + subscriptionRequestId: json['subscriptionRequestId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final subscribedListing = this.subscribedListing; + final subscribedPrincipal = this.subscribedPrincipal; + final updatedAt = this.updatedAt; + final retainPermissions = this.retainPermissions; + final subscriptionRequestId = this.subscriptionRequestId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'status': status.toValue(), + 'subscribedListing': subscribedListing, + 'subscribedPrincipal': subscribedPrincipal, + 'updatedAt': unixTimestampToJson(updatedAt), + if (retainPermissions != null) 'retainPermissions': retainPermissions, + if (subscriptionRequestId != null) + 'subscriptionRequestId': subscriptionRequestId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetSubscriptionRequestDetailsOutput { + /// The timestamp of when the specified subscription request was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription request. + final String createdBy; + + /// The Amazon DataZone domain of the subscription request. + final String domainId; + + /// The identifier of the subscription request. + final String id; + + /// The reason for the subscription request. + final String requestReason; + + /// The status of the subscription request. + final SubscriptionRequestStatus status; + + /// The subscribed listings in the subscription request. + final List subscribedListings; + + /// The subscribed principals in the subscription request. + final List subscribedPrincipals; + + /// The timestamp of when the subscription request was updated. + final DateTime updatedAt; + + /// The decision comment of the subscription request. + final String? decisionComment; + + /// The identifier of the Amazon DataZone user who reviewed the subscription + /// request. + final String? reviewerId; + + /// The Amazon DataZone user who updated the subscription request. + final String? updatedBy; + + GetSubscriptionRequestDetailsOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory GetSubscriptionRequestDetailsOutput.fromJson( + Map json) { + return GetSubscriptionRequestDetailsOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetSubscriptionTargetOutput { + /// The asset types associated with the subscription target. + final List applicableAssetTypes; + + /// The authorized principals of the subscription target. + final List authorizedPrincipals; + + /// The timestamp of when the subscription target was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription target. + final String createdBy; + + /// The ID of the Amazon DataZone domain in which the subscription target + /// exists. + final String domainId; + + /// The ID of the environment associated with the subscription target. + final String environmentId; + + /// The ID of the subscription target. + final String id; + + /// The manage access role with which the subscription target was created. + final String manageAccessRole; + + /// The name of the subscription target. + final String name; + + /// The ID of the project associated with the subscription target. + final String projectId; + + /// The provider of the subscription target. + final String provider; + + /// The configuration of teh subscription target. + final List subscriptionTargetConfig; + + /// The type of the subscription target. + final String type; + + /// The timestamp of when the subscription target was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the subscription target. + final String? updatedBy; + + GetSubscriptionTargetOutput({ + required this.applicableAssetTypes, + required this.authorizedPrincipals, + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.environmentId, + required this.id, + required this.manageAccessRole, + required this.name, + required this.projectId, + required this.provider, + required this.subscriptionTargetConfig, + required this.type, + this.updatedAt, + this.updatedBy, + }); + + factory GetSubscriptionTargetOutput.fromJson(Map json) { + return GetSubscriptionTargetOutput( + applicableAssetTypes: (json['applicableAssetTypes'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + authorizedPrincipals: (json['authorizedPrincipals'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + manageAccessRole: json['manageAccessRole'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + subscriptionTargetConfig: (json['subscriptionTargetConfig'] as List) + .whereNotNull() + .map( + (e) => SubscriptionTargetForm.fromJson(e as Map)) + .toList(), + type: json['type'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final applicableAssetTypes = this.applicableAssetTypes; + final authorizedPrincipals = this.authorizedPrincipals; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final manageAccessRole = this.manageAccessRole; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final subscriptionTargetConfig = this.subscriptionTargetConfig; + final type = this.type; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'applicableAssetTypes': applicableAssetTypes, + 'authorizedPrincipals': authorizedPrincipals, + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'manageAccessRole': manageAccessRole, + 'name': name, + 'projectId': projectId, + 'provider': provider, + 'subscriptionTargetConfig': subscriptionTargetConfig, + 'type': type, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetTimeSeriesDataPointOutput { + /// The ID of the Amazon DataZone domain that houses the asset data point that + /// you want to get. + final String? domainId; + + /// The ID of the asset for which you want to get the data point. + final String? entityId; + + /// The type of the asset for which you want to get the data point. + final TimeSeriesEntityType? entityType; + + /// The time series form that houses the data point that you want to get. + final TimeSeriesDataPointFormOutput? form; + + /// The name of the time series form that houses the data point that you want to + /// get. + final String? formName; + + GetTimeSeriesDataPointOutput({ + this.domainId, + this.entityId, + this.entityType, + this.form, + this.formName, + }); + + factory GetTimeSeriesDataPointOutput.fromJson(Map json) { + return GetTimeSeriesDataPointOutput( + domainId: json['domainId'] as String?, + entityId: json['entityId'] as String?, + entityType: (json['entityType'] as String?)?.toTimeSeriesEntityType(), + form: json['form'] != null + ? TimeSeriesDataPointFormOutput.fromJson( + json['form'] as Map) + : null, + formName: json['formName'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final entityId = this.entityId; + final entityType = this.entityType; + final form = this.form; + final formName = this.formName; + return { + if (domainId != null) 'domainId': domainId, + if (entityId != null) 'entityId': entityId, + if (entityType != null) 'entityType': entityType.toValue(), + if (form != null) 'form': form, + if (formName != null) 'formName': formName, + }; + } +} + +class GetUserProfileOutput { + final UserProfileDetails? details; + + /// the identifier of the Amazon DataZone domain of which you want to get the + /// user profile. + final String? domainId; + + /// The identifier of the user profile. + final String? id; + + /// The status of the user profile. + final UserProfileStatus? status; + + /// The type of the user profile. + final UserProfileType? type; + + GetUserProfileOutput({ + this.details, + this.domainId, + this.id, + this.status, + this.type, + }); + + factory GetUserProfileOutput.fromJson(Map json) { + return GetUserProfileOutput( + details: json['details'] != null + ? UserProfileDetails.fromJson(json['details'] as Map) + : null, + domainId: json['domainId'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toUserProfileStatus(), + type: (json['type'] as String?)?.toUserProfileType(), + ); + } + + Map toJson() { + final details = this.details; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final type = this.type; + return { + if (details != null) 'details': details, + if (domainId != null) 'domainId': domainId, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +/// The details of a business glossary. +class GlossaryItem { + /// The identifier of the Amazon DataZone domain in which the business glossary + /// exists. + final String domainId; + + /// The identifier of the glossary. + final String id; + + /// The name of the glossary. + final String name; + + /// The identifier of the project that owns the business glosary. + final String owningProjectId; + + /// The business glossary status. + final GlossaryStatus status; + + /// The timestamp of when the glossary was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the glossary. + final String? createdBy; + + /// The business glossary description. + final String? description; + + /// The timestamp of when the business glossary was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the business glossary. + final String? updatedBy; + + GlossaryItem({ + required this.domainId, + required this.id, + required this.name, + required this.owningProjectId, + required this.status, + this.createdAt, + this.createdBy, + this.description, + this.updatedAt, + this.updatedBy, + }); + + factory GlossaryItem.fromJson(Map json) { + return GlossaryItem( + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + status: (json['status'] as String).toGlossaryStatus(), + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + description: json['description'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final status = this.status; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final description = this.description; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + 'status': status.toValue(), + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (description != null) 'description': description, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum GlossaryStatus { + disabled, + enabled, +} + +extension GlossaryStatusValueExtension on GlossaryStatus { + String toValue() { + switch (this) { + case GlossaryStatus.disabled: + return 'DISABLED'; + case GlossaryStatus.enabled: + return 'ENABLED'; + } + } +} + +extension GlossaryStatusFromString on String { + GlossaryStatus toGlossaryStatus() { + switch (this) { + case 'DISABLED': + return GlossaryStatus.disabled; + case 'ENABLED': + return GlossaryStatus.enabled; + } + throw Exception('$this is not known in enum GlossaryStatus'); + } +} + +/// The details of a business glossary term. +class GlossaryTermItem { + /// The identifier of the Amazon DataZone domain in which the business glossary + /// exists. + final String domainId; + + /// The identifier of the business glossary to which the term belongs. + final String glossaryId; + + /// The identifier of the business glossary term. + final String id; + + /// The name of the business glossary term. + final String name; + + /// The status of the business glossary term. + final GlossaryTermStatus status; + + /// The timestamp of when a business glossary term was created. + final DateTime? createdAt; + + /// The Amazon DataZone user who created the business glossary. + final String? createdBy; + + /// The long description of the business glossary term. + final String? longDescription; + + /// The short description of the business glossary term. + final String? shortDescription; + + /// The relations of the business glossary term. + final TermRelations? termRelations; + + /// The timestamp of when a business glossary term was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the business glossary term. + final String? updatedBy; + + GlossaryTermItem({ + required this.domainId, + required this.glossaryId, + required this.id, + required this.name, + required this.status, + this.createdAt, + this.createdBy, + this.longDescription, + this.shortDescription, + this.termRelations, + this.updatedAt, + this.updatedBy, + }); + + factory GlossaryTermItem.fromJson(Map json) { + return GlossaryTermItem( + domainId: json['domainId'] as String, + glossaryId: json['glossaryId'] as String, + id: json['id'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGlossaryTermStatus(), + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + longDescription: json['longDescription'] as String?, + shortDescription: json['shortDescription'] as String?, + termRelations: json['termRelations'] != null + ? TermRelations.fromJson( + json['termRelations'] as Map) + : null, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final domainId = this.domainId; + final glossaryId = this.glossaryId; + final id = this.id; + final name = this.name; + final status = this.status; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final longDescription = this.longDescription; + final shortDescription = this.shortDescription; + final termRelations = this.termRelations; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'domainId': domainId, + 'glossaryId': glossaryId, + 'id': id, + 'name': name, + 'status': status.toValue(), + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (longDescription != null) 'longDescription': longDescription, + if (shortDescription != null) 'shortDescription': shortDescription, + if (termRelations != null) 'termRelations': termRelations, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum GlossaryTermStatus { + enabled, + disabled, +} + +extension GlossaryTermStatusValueExtension on GlossaryTermStatus { + String toValue() { + switch (this) { + case GlossaryTermStatus.enabled: + return 'ENABLED'; + case GlossaryTermStatus.disabled: + return 'DISABLED'; + } + } +} + +extension GlossaryTermStatusFromString on String { + GlossaryTermStatus toGlossaryTermStatus() { + switch (this) { + case 'ENABLED': + return GlossaryTermStatus.enabled; + case 'DISABLED': + return GlossaryTermStatus.disabled; + } + throw Exception('$this is not known in enum GlossaryTermStatus'); + } +} + +/// The configuration details of the Amazon Web Services Glue data source. +class GlueRunConfigurationInput { + /// The relational filter configurations included in the configuration details + /// of the Amazon Web Services Glue data source. + final List relationalFilterConfigurations; + + /// Specifies whether to automatically import data quality metrics as part of + /// the data source run. + final bool? autoImportDataQualityResult; + + /// The data access role included in the configuration details of the Amazon Web + /// Services Glue data source. + final String? dataAccessRole; + + GlueRunConfigurationInput({ + required this.relationalFilterConfigurations, + this.autoImportDataQualityResult, + this.dataAccessRole, + }); + + Map toJson() { + final relationalFilterConfigurations = this.relationalFilterConfigurations; + final autoImportDataQualityResult = this.autoImportDataQualityResult; + final dataAccessRole = this.dataAccessRole; + return { + 'relationalFilterConfigurations': relationalFilterConfigurations, + if (autoImportDataQualityResult != null) + 'autoImportDataQualityResult': autoImportDataQualityResult, + if (dataAccessRole != null) 'dataAccessRole': dataAccessRole, + }; + } +} + +/// The configuration details of the Amazon Web Services Glue data source. +class GlueRunConfigurationOutput { + /// The relational filter configurations included in the configuration details + /// of the Amazon Web Services Glue data source. + final List relationalFilterConfigurations; + + /// The Amazon Web Services account ID included in the configuration details of + /// the Amazon Web Services Glue data source. + final String? accountId; + + /// Specifies whether to automatically import data quality metrics as part of + /// the data source run. + final bool? autoImportDataQualityResult; + + /// The data access role included in the configuration details of the Amazon Web + /// Services Glue data source. + final String? dataAccessRole; + + /// The Amazon Web Services region included in the configuration details of the + /// Amazon Web Services Glue data source. + final String? region; + + GlueRunConfigurationOutput({ + required this.relationalFilterConfigurations, + this.accountId, + this.autoImportDataQualityResult, + this.dataAccessRole, + this.region, + }); + + factory GlueRunConfigurationOutput.fromJson(Map json) { + return GlueRunConfigurationOutput( + relationalFilterConfigurations: (json['relationalFilterConfigurations'] + as List) + .whereNotNull() + .map((e) => + RelationalFilterConfiguration.fromJson(e as Map)) + .toList(), + accountId: json['accountId'] as String?, + autoImportDataQualityResult: json['autoImportDataQualityResult'] as bool?, + dataAccessRole: json['dataAccessRole'] as String?, + region: json['region'] as String?, + ); + } + + Map toJson() { + final relationalFilterConfigurations = this.relationalFilterConfigurations; + final accountId = this.accountId; + final autoImportDataQualityResult = this.autoImportDataQualityResult; + final dataAccessRole = this.dataAccessRole; + final region = this.region; + return { + 'relationalFilterConfigurations': relationalFilterConfigurations, + if (accountId != null) 'accountId': accountId, + if (autoImportDataQualityResult != null) + 'autoImportDataQualityResult': autoImportDataQualityResult, + if (dataAccessRole != null) 'dataAccessRole': dataAccessRole, + if (region != null) 'region': region, + }; + } +} + +/// The details of a listing for which a subscription is granted. +class GrantedEntity { + /// The listing for which a subscription is granted. + final ListingRevision? listing; + + GrantedEntity({ + this.listing, + }); + + factory GrantedEntity.fromJson(Map json) { + return GrantedEntity( + listing: json['listing'] != null + ? ListingRevision.fromJson(json['listing'] as Map) + : null, + ); + } + + Map toJson() { + final listing = this.listing; + return { + if (listing != null) 'listing': listing, + }; + } +} + +/// The details of a listing for which a subscription is to be granted. +class GrantedEntityInput { + /// The listing for which a subscription is to be granted. + final ListingRevisionInput? listing; + + GrantedEntityInput({ + this.listing, + }); + + Map toJson() { + final listing = this.listing; + return { + if (listing != null) 'listing': listing, + }; + } +} + +/// The details of a group in Amazon DataZone. +class GroupDetails { + /// The identifier of the group in Amazon DataZone. + final String groupId; + + GroupDetails({ + required this.groupId, + }); + + factory GroupDetails.fromJson(Map json) { + return GroupDetails( + groupId: json['groupId'] as String, + ); + } + + Map toJson() { + final groupId = this.groupId; + return { + 'groupId': groupId, + }; + } +} + +enum GroupProfileStatus { + assigned, + notAssigned, +} + +extension GroupProfileStatusValueExtension on GroupProfileStatus { + String toValue() { + switch (this) { + case GroupProfileStatus.assigned: + return 'ASSIGNED'; + case GroupProfileStatus.notAssigned: + return 'NOT_ASSIGNED'; + } + } +} + +extension GroupProfileStatusFromString on String { + GroupProfileStatus toGroupProfileStatus() { + switch (this) { + case 'ASSIGNED': + return GroupProfileStatus.assigned; + case 'NOT_ASSIGNED': + return GroupProfileStatus.notAssigned; + } + throw Exception('$this is not known in enum GroupProfileStatus'); + } +} + +/// The details of a group profile. +class GroupProfileSummary { + /// The ID of the Amazon DataZone domain of a group profile. + final String? domainId; + + /// The group name of a group profile. + final String? groupName; + + /// The ID of a group profile. + final String? id; + + /// The status of a group profile. + final GroupProfileStatus? status; + + GroupProfileSummary({ + this.domainId, + this.groupName, + this.id, + this.status, + }); + + factory GroupProfileSummary.fromJson(Map json) { + return GroupProfileSummary( + domainId: json['domainId'] as String?, + groupName: json['groupName'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toGroupProfileStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final groupName = this.groupName; + final id = this.id; + final status = this.status; + return { + if (domainId != null) 'domainId': domainId, + if (groupName != null) 'groupName': groupName, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + }; + } +} + +enum GroupSearchType { + ssoGroup, + datazoneSsoGroup, +} + +extension GroupSearchTypeValueExtension on GroupSearchType { + String toValue() { + switch (this) { + case GroupSearchType.ssoGroup: + return 'SSO_GROUP'; + case GroupSearchType.datazoneSsoGroup: + return 'DATAZONE_SSO_GROUP'; + } + } +} + +extension GroupSearchTypeFromString on String { + GroupSearchType toGroupSearchType() { + switch (this) { + case 'SSO_GROUP': + return GroupSearchType.ssoGroup; + case 'DATAZONE_SSO_GROUP': + return GroupSearchType.datazoneSsoGroup; + } + throw Exception('$this is not known in enum GroupSearchType'); + } +} + +/// The details of an IAM user profile in Amazon DataZone. +class IamUserProfileDetails { + /// The ARN of an IAM user profile in Amazon DataZone. + final String? arn; + + IamUserProfileDetails({ + this.arn, + }); + + factory IamUserProfileDetails.fromJson(Map json) { + return IamUserProfileDetails( + arn: json['arn'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + return { + if (arn != null) 'arn': arn, + }; + } +} + +/// The details of the import of the metadata form type. +class Import { + /// The name of the import. + final String name; + + /// The revision of the import. + final String revision; + + Import({ + required this.name, + required this.revision, + }); + + factory Import.fromJson(Map json) { + return Import( + name: json['name'] as String, + revision: json['revision'] as String, + ); + } + + Map toJson() { + final name = this.name; + final revision = this.revision; + return { + 'name': name, + 'revision': revision, + }; + } +} + +enum InventorySearchScope { + asset, + glossary, + glossaryTerm, +} + +extension InventorySearchScopeValueExtension on InventorySearchScope { + String toValue() { + switch (this) { + case InventorySearchScope.asset: + return 'ASSET'; + case InventorySearchScope.glossary: + return 'GLOSSARY'; + case InventorySearchScope.glossaryTerm: + return 'GLOSSARY_TERM'; + } + } +} + +extension InventorySearchScopeFromString on String { + InventorySearchScope toInventorySearchScope() { + switch (this) { + case 'ASSET': + return InventorySearchScope.asset; + case 'GLOSSARY': + return InventorySearchScope.glossary; + case 'GLOSSARY_TERM': + return InventorySearchScope.glossaryTerm; + } + throw Exception('$this is not known in enum InventorySearchScope'); + } +} + +class ListAssetRevisionsOutput { + /// The results of the ListAssetRevisions action. + final List? items; + + /// When the number of revisions is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of revisions, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListAssetRevisions to list the next set of revisions. + final String? nextToken; + + ListAssetRevisionsOutput({ + this.items, + this.nextToken, + }); + + factory ListAssetRevisionsOutput.fromJson(Map json) { + return ListAssetRevisionsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => AssetRevision.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListDataSourceRunActivitiesOutput { + /// The results of the ListDataSourceRunActivities action. + final List items; + + /// When the number of activities is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of activities, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListDataSourceRunActivities to list the next set of activities. + final String? nextToken; + + ListDataSourceRunActivitiesOutput({ + required this.items, + this.nextToken, + }); + + factory ListDataSourceRunActivitiesOutput.fromJson( + Map json) { + return ListDataSourceRunActivitiesOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => DataSourceRunActivity.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListDataSourceRunsOutput { + /// The results of the ListDataSourceRuns action. + final List items; + + /// When the number of runs is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of runs, the response + /// includes a pagination token named NextToken. You can specify + /// this NextToken value in a subsequent call to + /// ListDataSourceRuns to list the next set of runs. + final String? nextToken; + + ListDataSourceRunsOutput({ + required this.items, + this.nextToken, + }); + + factory ListDataSourceRunsOutput.fromJson(Map json) { + return ListDataSourceRunsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => DataSourceRunSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListDataSourcesOutput { + /// The results of the ListDataSources action. + final List items; + + /// When the number of data sources is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of data sources, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListDataSources to list the next set of data sources. + final String? nextToken; + + ListDataSourcesOutput({ + required this.items, + this.nextToken, + }); + + factory ListDataSourcesOutput.fromJson(Map json) { + return ListDataSourcesOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => DataSourceSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListDomainsOutput { + /// The results of the ListDomains action. + final List items; + + /// When the number of domains is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of domains, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListDomains to list the next set of domains. + final String? nextToken; + + ListDomainsOutput({ + required this.items, + this.nextToken, + }); + + factory ListDomainsOutput.fromJson(Map json) { + return ListDomainsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => DomainSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListEnvironmentBlueprintConfigurationsOutput { + /// The results of the ListEnvironmentBlueprintConfigurations + /// action. + final List? items; + + /// When the number of blueprint configurations is greater than the default + /// value for the MaxResults parameter, or if you explicitly + /// specify a value for MaxResults that is less than the number of + /// configurations, the response includes a pagination token named + /// NextToken. You can specify this NextToken value in + /// a subsequent call to ListEnvironmentBlueprintConfigurations to + /// list the next set of configurations. + final String? nextToken; + + ListEnvironmentBlueprintConfigurationsOutput({ + this.items, + this.nextToken, + }); + + factory ListEnvironmentBlueprintConfigurationsOutput.fromJson( + Map json) { + return ListEnvironmentBlueprintConfigurationsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => EnvironmentBlueprintConfigurationItem.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListEnvironmentBlueprintsOutput { + /// The results of the ListEnvironmentBlueprints action. + final List items; + + /// When the number of blueprints in the environment is greater than the default + /// value for the MaxResults parameter, or if you explicitly + /// specify a value for MaxResults that is less than the number of + /// blueprints in the environment, the response includes a pagination token + /// named NextToken. You can specify this NextToken + /// value in a subsequent call to ListEnvironmentBlueprintsto list + /// the next set of blueprints. + final String? nextToken; + + ListEnvironmentBlueprintsOutput({ + required this.items, + this.nextToken, + }); + + factory ListEnvironmentBlueprintsOutput.fromJson(Map json) { + return ListEnvironmentBlueprintsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => + EnvironmentBlueprintSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListEnvironmentProfilesOutput { + /// The results of the ListEnvironmentProfiles action. + final List items; + + /// When the number of environment profiles is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// environment profiles, the response includes a pagination token named + /// NextToken. You can specify this NextToken value in + /// a subsequent call to ListEnvironmentProfiles to list the next + /// set of environment profiles. + final String? nextToken; + + ListEnvironmentProfilesOutput({ + required this.items, + this.nextToken, + }); + + factory ListEnvironmentProfilesOutput.fromJson(Map json) { + return ListEnvironmentProfilesOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => + EnvironmentProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListEnvironmentsOutput { + /// The results of the ListEnvironments action. + final List items; + + /// When the number of environments is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of environments, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListEnvironments to list the next set of environments. + final String? nextToken; + + ListEnvironmentsOutput({ + required this.items, + this.nextToken, + }); + + factory ListEnvironmentsOutput.fromJson(Map json) { + return ListEnvironmentsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => EnvironmentSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListMetadataGenerationRunsOutput { + /// The results of the ListMetadataGenerationRuns action. + final List? items; + + /// When the number of metadata generation runs is greater than the default + /// value for the MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of metadata generation runs, the + /// response includes a pagination token named NextToken. You can specify this + /// NextToken value in a subsequent call to ListMetadataGenerationRuns to list + /// the next set of revisions. + final String? nextToken; + + ListMetadataGenerationRunsOutput({ + this.items, + this.nextToken, + }); + + factory ListMetadataGenerationRunsOutput.fromJson(Map json) { + return ListMetadataGenerationRunsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => + MetadataGenerationRunItem.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListNotificationsOutput { + /// When the number of notifications is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of notifications, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListNotifications to list the next set of notifications. + final String? nextToken; + + /// The results of the ListNotifications action. + final List? notifications; + + ListNotificationsOutput({ + this.nextToken, + this.notifications, + }); + + factory ListNotificationsOutput.fromJson(Map json) { + return ListNotificationsOutput( + nextToken: json['nextToken'] as String?, + notifications: (json['notifications'] as List?) + ?.whereNotNull() + .map((e) => NotificationOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final nextToken = this.nextToken; + final notifications = this.notifications; + return { + if (nextToken != null) 'nextToken': nextToken, + if (notifications != null) 'notifications': notifications, + }; + } +} + +class ListProjectMembershipsOutput { + /// The members of the project. + final List members; + + /// When the number of memberships is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of memberships, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListProjectMemberships to list the next set of memberships. + final String? nextToken; + + ListProjectMembershipsOutput({ + required this.members, + this.nextToken, + }); + + factory ListProjectMembershipsOutput.fromJson(Map json) { + return ListProjectMembershipsOutput( + members: (json['members'] as List) + .whereNotNull() + .map((e) => ProjectMember.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final members = this.members; + final nextToken = this.nextToken; + return { + 'members': members, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListProjectsOutput { + /// The results of the ListProjects action. + final List? items; + + /// When the number of projects is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of projects, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListProjects to list the next set of projects. + final String? nextToken; + + ListProjectsOutput({ + this.items, + this.nextToken, + }); + + factory ListProjectsOutput.fromJson(Map json) { + return ListProjectsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => ProjectSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSubscriptionGrantsOutput { + /// The results of the ListSubscriptionGrants action. + final List items; + + /// When the number of subscription grants is greater than the default value for + /// the MaxResults parameter, or if you explicitly specify a value + /// for MaxResults that is less than the number of subscription + /// grants, the response includes a pagination token named + /// NextToken. You can specify this NextToken value in + /// a subsequent call to ListSubscriptionGrants to list the next + /// set of subscription grants. + final String? nextToken; + + ListSubscriptionGrantsOutput({ + required this.items, + this.nextToken, + }); + + factory ListSubscriptionGrantsOutput.fromJson(Map json) { + return ListSubscriptionGrantsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => + SubscriptionGrantSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSubscriptionRequestsOutput { + /// The results of the ListSubscriptionRequests action. + final List items; + + /// When the number of subscription requests is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// subscription requests, the response includes a pagination token named + /// NextToken. You can specify this NextToken value in + /// a subsequent call to ListSubscriptionRequests to list the next + /// set of subscription requests. + final String? nextToken; + + ListSubscriptionRequestsOutput({ + required this.items, + this.nextToken, + }); + + factory ListSubscriptionRequestsOutput.fromJson(Map json) { + return ListSubscriptionRequestsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => + SubscriptionRequestSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSubscriptionTargetsOutput { + /// The results of the ListSubscriptionTargets action. + final List items; + + /// When the number of subscription targets is greater than the default value + /// for the MaxResults parameter, or if you explicitly specify a + /// value for MaxResults that is less than the number of + /// subscription targets, the response includes a pagination token named + /// NextToken. You can specify this NextToken value in + /// a subsequent call to ListSubscriptionTargets to list the next + /// set of subscription targets. + final String? nextToken; + + ListSubscriptionTargetsOutput({ + required this.items, + this.nextToken, + }); + + factory ListSubscriptionTargetsOutput.fromJson(Map json) { + return ListSubscriptionTargetsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => + SubscriptionTargetSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSubscriptionsOutput { + /// The results of the ListSubscriptions action. + final List items; + + /// When the number of subscriptions is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of subscriptions, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// ListSubscriptions to list the next set of subscriptions. + final String? nextToken; + + ListSubscriptionsOutput({ + required this.items, + this.nextToken, + }); + + factory ListSubscriptionsOutput.fromJson(Map json) { + return ListSubscriptionsOutput( + items: (json['items'] as List) + .whereNotNull() + .map((e) => SubscriptionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// The tags of the specified resource. + final Map? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +class ListTimeSeriesDataPointsOutput { + /// The results of the ListTimeSeriesDataPoints action. + final List? items; + + /// When the number of data points is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for MaxResults + /// that is less than the number of data points, the response includes a + /// pagination token named NextToken. You can specify this NextToken value in a + /// subsequent call to ListTimeSeriesDataPoints to list the next set of data + /// points. + final String? nextToken; + + ListTimeSeriesDataPointsOutput({ + this.items, + this.nextToken, + }); + + factory ListTimeSeriesDataPointsOutput.fromJson(Map json) { + return ListTimeSeriesDataPointsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => TimeSeriesDataPointSummaryFormOutput.fromJson( + e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +/// The details of a listing (aka asset published in a Amazon DataZone catalog). +class ListingItem { + /// An asset published in an Amazon DataZone catalog. + final AssetListing? assetListing; + + ListingItem({ + this.assetListing, + }); + + factory ListingItem.fromJson(Map json) { + return ListingItem( + assetListing: json['assetListing'] != null + ? AssetListing.fromJson(json['assetListing'] as Map) + : null, + ); + } + + Map toJson() { + final assetListing = this.assetListing; + return { + if (assetListing != null) 'assetListing': assetListing, + }; + } +} + +/// A revision of an asset published in a Amazon DataZone catalog. +class ListingRevision { + /// An identifier of a revision of an asset published in a Amazon DataZone + /// catalog. + final String id; + + /// The details of a revision of an asset published in a Amazon DataZone + /// catalog. + final String revision; + + ListingRevision({ + required this.id, + required this.revision, + }); + + factory ListingRevision.fromJson(Map json) { + return ListingRevision( + id: json['id'] as String, + revision: json['revision'] as String, + ); + } + + Map toJson() { + final id = this.id; + final revision = this.revision; + return { + 'id': id, + 'revision': revision, + }; + } +} + +/// A revision to be made to an asset published in a Amazon DataZone catalog. +class ListingRevisionInput { + /// An identifier of revision to be made to an asset published in a Amazon + /// DataZone catalog. + final String identifier; + + /// The details of a revision to be made to an asset published in a Amazon + /// DataZone catalog. + final String revision; + + ListingRevisionInput({ + required this.identifier, + required this.revision, + }); + + Map toJson() { + final identifier = this.identifier; + final revision = this.revision; + return { + 'identifier': identifier, + 'revision': revision, + }; + } +} + +enum ListingStatus { + creating, + active, + inactive, +} + +extension ListingStatusValueExtension on ListingStatus { + String toValue() { + switch (this) { + case ListingStatus.creating: + return 'CREATING'; + case ListingStatus.active: + return 'ACTIVE'; + case ListingStatus.inactive: + return 'INACTIVE'; + } + } +} + +extension ListingStatusFromString on String { + ListingStatus toListingStatus() { + switch (this) { + case 'CREATING': + return ListingStatus.creating; + case 'ACTIVE': + return ListingStatus.active; + case 'INACTIVE': + return ListingStatus.inactive; + } + throw Exception('$this is not known in enum ListingStatus'); + } +} + +/// The details about a project member. +class Member { + /// The ID of the group of a project member. + final String? groupIdentifier; + + /// The user ID of a project member. + final String? userIdentifier; + + Member({ + this.groupIdentifier, + this.userIdentifier, + }); + + Map toJson() { + final groupIdentifier = this.groupIdentifier; + final userIdentifier = this.userIdentifier; + return { + if (groupIdentifier != null) 'groupIdentifier': groupIdentifier, + if (userIdentifier != null) 'userIdentifier': userIdentifier, + }; + } +} + +/// The details about a project member. +class MemberDetails { + /// The group details of a project member. + final GroupDetails? group; + + /// The user details of a project member. + final UserDetails? user; + + MemberDetails({ + this.group, + this.user, + }); + + factory MemberDetails.fromJson(Map json) { + return MemberDetails( + group: json['group'] != null + ? GroupDetails.fromJson(json['group'] as Map) + : null, + user: json['user'] != null + ? UserDetails.fromJson(json['user'] as Map) + : null, + ); + } + + Map toJson() { + final group = this.group; + final user = this.user; + return { + if (group != null) 'group': group, + if (user != null) 'user': user, + }; + } +} + +/// The metadata generation run. +class MetadataGenerationRunItem { + /// The ID of the Amazon DataZone domain in which the metadata generation run + /// was created. + final String domainId; + + /// The ID of the metadata generation run. + final String id; + + /// The ID of the project that owns the asset for which the metadata generation + /// was ran. + final String owningProjectId; + + /// The timestamp at which the metadata generation run was created. + final DateTime? createdAt; + + /// The user who created the metadata generation run. + final String? createdBy; + + /// The status of the metadata generation run. + final MetadataGenerationRunStatus? status; + + /// The asset for which metadata was generated. + final MetadataGenerationRunTarget? target; + + /// The type of the metadata generation run. + final MetadataGenerationRunType? type; + + MetadataGenerationRunItem({ + required this.domainId, + required this.id, + required this.owningProjectId, + this.createdAt, + this.createdBy, + this.status, + this.target, + this.type, + }); + + factory MetadataGenerationRunItem.fromJson(Map json) { + return MetadataGenerationRunItem( + domainId: json['domainId'] as String, + id: json['id'] as String, + owningProjectId: json['owningProjectId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + status: (json['status'] as String?)?.toMetadataGenerationRunStatus(), + target: json['target'] != null + ? MetadataGenerationRunTarget.fromJson( + json['target'] as Map) + : null, + type: (json['type'] as String?)?.toMetadataGenerationRunType(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final owningProjectId = this.owningProjectId; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final status = this.status; + final target = this.target; + final type = this.type; + return { + 'domainId': domainId, + 'id': id, + 'owningProjectId': owningProjectId, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (status != null) 'status': status.toValue(), + if (target != null) 'target': target, + if (type != null) 'type': type.toValue(), + }; + } +} + +enum MetadataGenerationRunStatus { + submitted, + inProgress, + canceled, + succeeded, + failed, +} + +extension MetadataGenerationRunStatusValueExtension + on MetadataGenerationRunStatus { + String toValue() { + switch (this) { + case MetadataGenerationRunStatus.submitted: + return 'SUBMITTED'; + case MetadataGenerationRunStatus.inProgress: + return 'IN_PROGRESS'; + case MetadataGenerationRunStatus.canceled: + return 'CANCELED'; + case MetadataGenerationRunStatus.succeeded: + return 'SUCCEEDED'; + case MetadataGenerationRunStatus.failed: + return 'FAILED'; + } + } +} + +extension MetadataGenerationRunStatusFromString on String { + MetadataGenerationRunStatus toMetadataGenerationRunStatus() { + switch (this) { + case 'SUBMITTED': + return MetadataGenerationRunStatus.submitted; + case 'IN_PROGRESS': + return MetadataGenerationRunStatus.inProgress; + case 'CANCELED': + return MetadataGenerationRunStatus.canceled; + case 'SUCCEEDED': + return MetadataGenerationRunStatus.succeeded; + case 'FAILED': + return MetadataGenerationRunStatus.failed; + } + throw Exception('$this is not known in enum MetadataGenerationRunStatus'); + } +} + +/// The asset for which metadata was generated. +class MetadataGenerationRunTarget { + /// The ID of the metadata generation run's target. + final String identifier; + + /// The type of the asset for which metadata was generated. + final MetadataGenerationTargetType type; + + /// The revision of the asset for which metadata was generated. + final String? revision; + + MetadataGenerationRunTarget({ + required this.identifier, + required this.type, + this.revision, + }); + + factory MetadataGenerationRunTarget.fromJson(Map json) { + return MetadataGenerationRunTarget( + identifier: json['identifier'] as String, + type: (json['type'] as String).toMetadataGenerationTargetType(), + revision: json['revision'] as String?, + ); + } + + Map toJson() { + final identifier = this.identifier; + final type = this.type; + final revision = this.revision; + return { + 'identifier': identifier, + 'type': type.toValue(), + if (revision != null) 'revision': revision, + }; + } +} + +enum MetadataGenerationRunType { + businessDescriptions, +} + +extension MetadataGenerationRunTypeValueExtension on MetadataGenerationRunType { + String toValue() { + switch (this) { + case MetadataGenerationRunType.businessDescriptions: + return 'BUSINESS_DESCRIPTIONS'; + } + } +} + +extension MetadataGenerationRunTypeFromString on String { + MetadataGenerationRunType toMetadataGenerationRunType() { + switch (this) { + case 'BUSINESS_DESCRIPTIONS': + return MetadataGenerationRunType.businessDescriptions; + } + throw Exception('$this is not known in enum MetadataGenerationRunType'); + } +} + +enum MetadataGenerationTargetType { + asset, +} + +extension MetadataGenerationTargetTypeValueExtension + on MetadataGenerationTargetType { + String toValue() { + switch (this) { + case MetadataGenerationTargetType.asset: + return 'ASSET'; + } + } +} + +extension MetadataGenerationTargetTypeFromString on String { + MetadataGenerationTargetType toMetadataGenerationTargetType() { + switch (this) { + case 'ASSET': + return MetadataGenerationTargetType.asset; + } + throw Exception('$this is not known in enum MetadataGenerationTargetType'); + } +} + +/// The model of the API. +class Model { + /// Indicates the smithy model of the API. + final String? smithy; + + Model({ + this.smithy, + }); + + factory Model.fromJson(Map json) { + return Model( + smithy: json['smithy'] as String?, + ); + } + + Map toJson() { + final smithy = this.smithy; + return { + if (smithy != null) 'smithy': smithy, + }; + } +} + +/// The details of a notification generated in Amazon DataZone. +class NotificationOutput { + /// The action link included in the notification. + final String actionLink; + + /// The timestamp of when a notification was created. + final DateTime creationTimestamp; + + /// The identifier of a Amazon DataZone domain in which the notification exists. + final String domainIdentifier; + + /// The identifier of the notification. + final String identifier; + + /// The timestamp of when the notification was last updated. + final DateTime lastUpdatedTimestamp; + + /// The message included in the notification. + final String message; + + /// The title of the notification. + final String title; + + /// The topic of the notification. + final Topic topic; + + /// The type of the notification. + final NotificationType type; + + /// The metadata included in the notification. + final Map? metadata; + + /// The status included in the notification. + final TaskStatus? status; + + NotificationOutput({ + required this.actionLink, + required this.creationTimestamp, + required this.domainIdentifier, + required this.identifier, + required this.lastUpdatedTimestamp, + required this.message, + required this.title, + required this.topic, + required this.type, + this.metadata, + this.status, + }); + + factory NotificationOutput.fromJson(Map json) { + return NotificationOutput( + actionLink: json['actionLink'] as String, + creationTimestamp: + nonNullableTimeStampFromJson(json['creationTimestamp'] as Object), + domainIdentifier: json['domainIdentifier'] as String, + identifier: json['identifier'] as String, + lastUpdatedTimestamp: + nonNullableTimeStampFromJson(json['lastUpdatedTimestamp'] as Object), + message: json['message'] as String, + title: json['title'] as String, + topic: Topic.fromJson(json['topic'] as Map), + type: (json['type'] as String).toNotificationType(), + metadata: (json['metadata'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + status: (json['status'] as String?)?.toTaskStatus(), + ); + } + + Map toJson() { + final actionLink = this.actionLink; + final creationTimestamp = this.creationTimestamp; + final domainIdentifier = this.domainIdentifier; + final identifier = this.identifier; + final lastUpdatedTimestamp = this.lastUpdatedTimestamp; + final message = this.message; + final title = this.title; + final topic = this.topic; + final type = this.type; + final metadata = this.metadata; + final status = this.status; + return { + 'actionLink': actionLink, + 'creationTimestamp': unixTimestampToJson(creationTimestamp), + 'domainIdentifier': domainIdentifier, + 'identifier': identifier, + 'lastUpdatedTimestamp': unixTimestampToJson(lastUpdatedTimestamp), + 'message': message, + 'title': title, + 'topic': topic, + 'type': type.toValue(), + if (metadata != null) 'metadata': metadata, + if (status != null) 'status': status.toValue(), + }; + } +} + +/// The details of the resource mentioned in a notification. +class NotificationResource { + /// The ID of the resource mentioned in a notification. + final String id; + + /// The type of the resource mentioned in a notification. + final NotificationResourceType type; + + /// The name of the resource mentioned in a notification. + final String? name; + + NotificationResource({ + required this.id, + required this.type, + this.name, + }); + + factory NotificationResource.fromJson(Map json) { + return NotificationResource( + id: json['id'] as String, + type: (json['type'] as String).toNotificationResourceType(), + name: json['name'] as String?, + ); + } + + Map toJson() { + final id = this.id; + final type = this.type; + final name = this.name; + return { + 'id': id, + 'type': type.toValue(), + if (name != null) 'name': name, + }; + } +} + +enum NotificationResourceType { + project, +} + +extension NotificationResourceTypeValueExtension on NotificationResourceType { + String toValue() { + switch (this) { + case NotificationResourceType.project: + return 'PROJECT'; + } + } +} + +extension NotificationResourceTypeFromString on String { + NotificationResourceType toNotificationResourceType() { + switch (this) { + case 'PROJECT': + return NotificationResourceType.project; + } + throw Exception('$this is not known in enum NotificationResourceType'); + } +} + +enum NotificationRole { + projectOwner, + projectContributor, + projectViewer, + domainOwner, + projectSubscriber, +} + +extension NotificationRoleValueExtension on NotificationRole { + String toValue() { + switch (this) { + case NotificationRole.projectOwner: + return 'PROJECT_OWNER'; + case NotificationRole.projectContributor: + return 'PROJECT_CONTRIBUTOR'; + case NotificationRole.projectViewer: + return 'PROJECT_VIEWER'; + case NotificationRole.domainOwner: + return 'DOMAIN_OWNER'; + case NotificationRole.projectSubscriber: + return 'PROJECT_SUBSCRIBER'; + } + } +} + +extension NotificationRoleFromString on String { + NotificationRole toNotificationRole() { + switch (this) { + case 'PROJECT_OWNER': + return NotificationRole.projectOwner; + case 'PROJECT_CONTRIBUTOR': + return NotificationRole.projectContributor; + case 'PROJECT_VIEWER': + return NotificationRole.projectViewer; + case 'DOMAIN_OWNER': + return NotificationRole.domainOwner; + case 'PROJECT_SUBSCRIBER': + return NotificationRole.projectSubscriber; + } + throw Exception('$this is not known in enum NotificationRole'); + } +} + +enum NotificationType { + task, + event, +} + +extension NotificationTypeValueExtension on NotificationType { + String toValue() { + switch (this) { + case NotificationType.task: + return 'TASK'; + case NotificationType.event: + return 'EVENT'; + } + } +} + +extension NotificationTypeFromString on String { + NotificationType toNotificationType() { + switch (this) { + case 'TASK': + return NotificationType.task; + case 'EVENT': + return NotificationType.event; + } + throw Exception('$this is not known in enum NotificationType'); + } +} + +class PostTimeSeriesDataPointsOutput { + /// The ID of the Amazon DataZone domain in which you want to post time series + /// data points. + final String? domainId; + + /// The ID of the asset for which you want to post time series data points. + final String? entityId; + + /// The type of the asset for which you want to post data points. + final TimeSeriesEntityType? entityType; + + /// The forms that contain the data points that you have posted. + final List? forms; + + PostTimeSeriesDataPointsOutput({ + this.domainId, + this.entityId, + this.entityType, + this.forms, + }); + + factory PostTimeSeriesDataPointsOutput.fromJson(Map json) { + return PostTimeSeriesDataPointsOutput( + domainId: json['domainId'] as String?, + entityId: json['entityId'] as String?, + entityType: (json['entityType'] as String?)?.toTimeSeriesEntityType(), + forms: (json['forms'] as List?) + ?.whereNotNull() + .map((e) => + TimeSeriesDataPointFormOutput.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final entityId = this.entityId; + final entityType = this.entityType; + final forms = this.forms; + return { + if (domainId != null) 'domainId': domainId, + if (entityId != null) 'entityId': entityId, + if (entityType != null) 'entityType': entityType.toValue(), + if (forms != null) 'forms': forms, + }; + } +} + +/// The configuration of the prediction. +class PredictionConfiguration { + /// The business name generation mechanism. + final BusinessNameGenerationConfiguration? businessNameGeneration; + + PredictionConfiguration({ + this.businessNameGeneration, + }); + + factory PredictionConfiguration.fromJson(Map json) { + return PredictionConfiguration( + businessNameGeneration: json['businessNameGeneration'] != null + ? BusinessNameGenerationConfiguration.fromJson( + json['businessNameGeneration'] as Map) + : null, + ); + } + + Map toJson() { + final businessNameGeneration = this.businessNameGeneration; + return { + if (businessNameGeneration != null) + 'businessNameGeneration': businessNameGeneration, + }; + } +} + +/// Specifies the error message that is returned if the operation cannot be +/// successfully completed. +class ProjectDeletionError { + /// The code of the project deletion error. + final String? code; + + /// The message of the project deletion error. + final String? message; + + ProjectDeletionError({ + this.code, + this.message, + }); + + factory ProjectDeletionError.fromJson(Map json) { + return ProjectDeletionError( + code: json['code'] as String?, + message: json['message'] as String?, + ); + } + + Map toJson() { + final code = this.code; + final message = this.message; + return { + if (code != null) 'code': code, + if (message != null) 'message': message, + }; + } +} + +/// The details of a project member. +class ProjectMember { + /// The designated role of a project member. + final UserDesignation designation; + + /// The membership details of a project member. + final MemberDetails memberDetails; + + ProjectMember({ + required this.designation, + required this.memberDetails, + }); + + factory ProjectMember.fromJson(Map json) { + return ProjectMember( + designation: (json['designation'] as String).toUserDesignation(), + memberDetails: + MemberDetails.fromJson(json['memberDetails'] as Map), + ); + } + + Map toJson() { + final designation = this.designation; + final memberDetails = this.memberDetails; + return { + 'designation': designation.toValue(), + 'memberDetails': memberDetails, + }; + } +} + +enum ProjectStatus { + active, + deleting, + deleteFailed, +} + +extension ProjectStatusValueExtension on ProjectStatus { + String toValue() { + switch (this) { + case ProjectStatus.active: + return 'ACTIVE'; + case ProjectStatus.deleting: + return 'DELETING'; + case ProjectStatus.deleteFailed: + return 'DELETE_FAILED'; + } + } +} + +extension ProjectStatusFromString on String { + ProjectStatus toProjectStatus() { + switch (this) { + case 'ACTIVE': + return ProjectStatus.active; + case 'DELETING': + return ProjectStatus.deleting; + case 'DELETE_FAILED': + return ProjectStatus.deleteFailed; + } + throw Exception('$this is not known in enum ProjectStatus'); + } +} + +/// The details of a Amazon DataZone project. +class ProjectSummary { + /// The Amazon DataZone user who created the project. + final String createdBy; + + /// The identifier of a Amazon DataZone domain where the project exists. + final String domainId; + + /// The identifier of a project. + final String id; + + /// The name of a project. + final String name; + + /// The timestamp of when a project was created. + final DateTime? createdAt; + + /// The description of a project. + final String? description; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final List? failureReasons; + + /// The status of the project. + final ProjectStatus? projectStatus; + + /// The timestamp of when the project was updated. + final DateTime? updatedAt; + + ProjectSummary({ + required this.createdBy, + required this.domainId, + required this.id, + required this.name, + this.createdAt, + this.description, + this.failureReasons, + this.projectStatus, + this.updatedAt, + }); + + factory ProjectSummary.fromJson(Map json) { + return ProjectSummary( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => ProjectDeletionError.fromJson(e as Map)) + .toList(), + projectStatus: (json['projectStatus'] as String?)?.toProjectStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final createdAt = this.createdAt; + final description = this.description; + final failureReasons = this.failureReasons; + final projectStatus = this.projectStatus; + final updatedAt = this.updatedAt; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'name': name, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (projectStatus != null) 'projectStatus': projectStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// The provisioning properties of an environment blueprint. +class ProvisioningProperties { + /// The cloud formation properties included as part of the provisioning + /// properties of an environment blueprint. + final CloudFormationProperties? cloudFormation; + + ProvisioningProperties({ + this.cloudFormation, + }); + + factory ProvisioningProperties.fromJson(Map json) { + return ProvisioningProperties( + cloudFormation: json['cloudFormation'] != null + ? CloudFormationProperties.fromJson( + json['cloudFormation'] as Map) + : null, + ); + } + + Map toJson() { + final cloudFormation = this.cloudFormation; + return { + if (cloudFormation != null) 'cloudFormation': cloudFormation, + }; + } +} + +class PutEnvironmentBlueprintConfigurationOutput { + /// The identifier of the Amazon DataZone domain. + final String domainId; + + /// The identifier of the environment blueprint. + final String environmentBlueprintId; + + /// The timestamp of when the environment blueprint was created. + final DateTime? createdAt; + + /// Specifies the enabled Amazon Web Services Regions. + final List? enabledRegions; + + /// The ARN of the manage access role. + final String? manageAccessRoleArn; + + /// The ARN of the provisioning role. + final String? provisioningRoleArn; + + /// The regional parameters in the environment blueprint. + final Map>? regionalParameters; + + /// The timestamp of when the environment blueprint was updated. + final DateTime? updatedAt; + + PutEnvironmentBlueprintConfigurationOutput({ + required this.domainId, + required this.environmentBlueprintId, + this.createdAt, + this.enabledRegions, + this.manageAccessRoleArn, + this.provisioningRoleArn, + this.regionalParameters, + this.updatedAt, + }); + + factory PutEnvironmentBlueprintConfigurationOutput.fromJson( + Map json) { + return PutEnvironmentBlueprintConfigurationOutput( + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + createdAt: timeStampFromJson(json['createdAt']), + enabledRegions: (json['enabledRegions'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + manageAccessRoleArn: json['manageAccessRoleArn'] as String?, + provisioningRoleArn: json['provisioningRoleArn'] as String?, + regionalParameters: (json['regionalParameters'] as Map?) + ?.map((k, e) => MapEntry( + k, + (e as Map) + .map((k, e) => MapEntry(k, e as String)))), + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final createdAt = this.createdAt; + final enabledRegions = this.enabledRegions; + final manageAccessRoleArn = this.manageAccessRoleArn; + final provisioningRoleArn = this.provisioningRoleArn; + final regionalParameters = this.regionalParameters; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (enabledRegions != null) 'enabledRegions': enabledRegions, + if (manageAccessRoleArn != null) + 'manageAccessRoleArn': manageAccessRoleArn, + if (provisioningRoleArn != null) + 'provisioningRoleArn': provisioningRoleArn, + if (regionalParameters != null) 'regionalParameters': regionalParameters, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +/// The recommendation to be updated as part of the +/// UpdateDataSource action. +class RecommendationConfiguration { + /// Specifies whether automatic business name generation is to be enabled or not + /// as part of the recommendation configuration. + final bool? enableBusinessNameGeneration; + + RecommendationConfiguration({ + this.enableBusinessNameGeneration, + }); + + factory RecommendationConfiguration.fromJson(Map json) { + return RecommendationConfiguration( + enableBusinessNameGeneration: + json['enableBusinessNameGeneration'] as bool?, + ); + } + + Map toJson() { + final enableBusinessNameGeneration = this.enableBusinessNameGeneration; + return { + if (enableBusinessNameGeneration != null) + 'enableBusinessNameGeneration': enableBusinessNameGeneration, + }; + } +} + +/// The details of the Amazon Redshift cluster storage. +class RedshiftClusterStorage { + /// The name of an Amazon Redshift cluster. + final String clusterName; + + RedshiftClusterStorage({ + required this.clusterName, + }); + + factory RedshiftClusterStorage.fromJson(Map json) { + return RedshiftClusterStorage( + clusterName: json['clusterName'] as String, + ); + } + + Map toJson() { + final clusterName = this.clusterName; + return { + 'clusterName': clusterName, + }; + } +} + +/// The details of the credentials required to access an Amazon Redshift +/// cluster. +class RedshiftCredentialConfiguration { + /// The ARN of a secret manager for an Amazon Redshift cluster. + final String secretManagerArn; + + RedshiftCredentialConfiguration({ + required this.secretManagerArn, + }); + + factory RedshiftCredentialConfiguration.fromJson(Map json) { + return RedshiftCredentialConfiguration( + secretManagerArn: json['secretManagerArn'] as String, + ); + } + + Map toJson() { + final secretManagerArn = this.secretManagerArn; + return { + 'secretManagerArn': secretManagerArn, + }; + } +} + +/// The configuration details of the Amazon Redshift data source. +class RedshiftRunConfigurationInput { + final RedshiftCredentialConfiguration redshiftCredentialConfiguration; + final RedshiftStorage redshiftStorage; + + /// The relational filger configurations included in the configuration details + /// of the Amazon Redshift data source. + final List relationalFilterConfigurations; + + /// The data access role included in the configuration details of the Amazon + /// Redshift data source. + final String? dataAccessRole; + + RedshiftRunConfigurationInput({ + required this.redshiftCredentialConfiguration, + required this.redshiftStorage, + required this.relationalFilterConfigurations, + this.dataAccessRole, + }); + + Map toJson() { + final redshiftCredentialConfiguration = + this.redshiftCredentialConfiguration; + final redshiftStorage = this.redshiftStorage; + final relationalFilterConfigurations = this.relationalFilterConfigurations; + final dataAccessRole = this.dataAccessRole; + return { + 'redshiftCredentialConfiguration': redshiftCredentialConfiguration, + 'redshiftStorage': redshiftStorage, + 'relationalFilterConfigurations': relationalFilterConfigurations, + if (dataAccessRole != null) 'dataAccessRole': dataAccessRole, + }; + } +} + +/// The configuration details of the Amazon Redshift data source. +class RedshiftRunConfigurationOutput { + final RedshiftCredentialConfiguration redshiftCredentialConfiguration; + final RedshiftStorage redshiftStorage; + + /// The relational filger configurations included in the configuration details + /// of the Amazon Redshift data source. + final List relationalFilterConfigurations; + + /// The ID of the Amazon Web Services account included in the configuration + /// details of the Amazon Redshift data source. + final String? accountId; + + /// The data access role included in the configuration details of the Amazon + /// Redshift data source. + final String? dataAccessRole; + + /// The Amazon Web Services region included in the configuration details of the + /// Amazon Redshift data source. + final String? region; + + RedshiftRunConfigurationOutput({ + required this.redshiftCredentialConfiguration, + required this.redshiftStorage, + required this.relationalFilterConfigurations, + this.accountId, + this.dataAccessRole, + this.region, + }); + + factory RedshiftRunConfigurationOutput.fromJson(Map json) { + return RedshiftRunConfigurationOutput( + redshiftCredentialConfiguration: RedshiftCredentialConfiguration.fromJson( + json['redshiftCredentialConfiguration'] as Map), + redshiftStorage: RedshiftStorage.fromJson( + json['redshiftStorage'] as Map), + relationalFilterConfigurations: (json['relationalFilterConfigurations'] + as List) + .whereNotNull() + .map((e) => + RelationalFilterConfiguration.fromJson(e as Map)) + .toList(), + accountId: json['accountId'] as String?, + dataAccessRole: json['dataAccessRole'] as String?, + region: json['region'] as String?, + ); + } + + Map toJson() { + final redshiftCredentialConfiguration = + this.redshiftCredentialConfiguration; + final redshiftStorage = this.redshiftStorage; + final relationalFilterConfigurations = this.relationalFilterConfigurations; + final accountId = this.accountId; + final dataAccessRole = this.dataAccessRole; + final region = this.region; + return { + 'redshiftCredentialConfiguration': redshiftCredentialConfiguration, + 'redshiftStorage': redshiftStorage, + 'relationalFilterConfigurations': relationalFilterConfigurations, + if (accountId != null) 'accountId': accountId, + if (dataAccessRole != null) 'dataAccessRole': dataAccessRole, + if (region != null) 'region': region, + }; + } +} + +/// The details of the Amazon Redshift Serverless workgroup storage. +class RedshiftServerlessStorage { + /// The name of the Amazon Redshift Serverless workgroup. + final String workgroupName; + + RedshiftServerlessStorage({ + required this.workgroupName, + }); + + factory RedshiftServerlessStorage.fromJson(Map json) { + return RedshiftServerlessStorage( + workgroupName: json['workgroupName'] as String, + ); + } + + Map toJson() { + final workgroupName = this.workgroupName; + return { + 'workgroupName': workgroupName, + }; + } +} + +/// The details of the Amazon Redshift storage as part of the configuration of +/// an Amazon Redshift data source run. +class RedshiftStorage { + /// The details of the Amazon Redshift cluster source. + final RedshiftClusterStorage? redshiftClusterSource; + + /// The details of the Amazon Redshift Serverless workgroup source. + final RedshiftServerlessStorage? redshiftServerlessSource; + + RedshiftStorage({ + this.redshiftClusterSource, + this.redshiftServerlessSource, + }); + + factory RedshiftStorage.fromJson(Map json) { + return RedshiftStorage( + redshiftClusterSource: json['redshiftClusterSource'] != null + ? RedshiftClusterStorage.fromJson( + json['redshiftClusterSource'] as Map) + : null, + redshiftServerlessSource: json['redshiftServerlessSource'] != null + ? RedshiftServerlessStorage.fromJson( + json['redshiftServerlessSource'] as Map) + : null, + ); + } + + Map toJson() { + final redshiftClusterSource = this.redshiftClusterSource; + final redshiftServerlessSource = this.redshiftServerlessSource; + return { + if (redshiftClusterSource != null) + 'redshiftClusterSource': redshiftClusterSource, + if (redshiftServerlessSource != null) + 'redshiftServerlessSource': redshiftServerlessSource, + }; + } +} + +/// The details of the automatically generated business metadata that is +/// rejected. +class RejectChoice { + /// Specifies the target (for example, a column name) where a prediction can be + /// rejected. + final String predictionTarget; + + /// Specifies the the automatically generated business metadata that can be + /// rejected. + final List? predictionChoices; + + RejectChoice({ + required this.predictionTarget, + this.predictionChoices, + }); + + Map toJson() { + final predictionTarget = this.predictionTarget; + final predictionChoices = this.predictionChoices; + return { + 'predictionTarget': predictionTarget, + if (predictionChoices != null) 'predictionChoices': predictionChoices, + }; + } +} + +class RejectPredictionsOutput { + /// The ID of the asset. + final String assetId; + + /// The revision that is to be made to the asset. + final String assetRevision; + + /// The ID of the Amazon DataZone domain. + final String domainId; + + RejectPredictionsOutput({ + required this.assetId, + required this.assetRevision, + required this.domainId, + }); + + factory RejectPredictionsOutput.fromJson(Map json) { + return RejectPredictionsOutput( + assetId: json['assetId'] as String, + assetRevision: json['assetRevision'] as String, + domainId: json['domainId'] as String, + ); + } + + Map toJson() { + final assetId = this.assetId; + final assetRevision = this.assetRevision; + final domainId = this.domainId; + return { + 'assetId': assetId, + 'assetRevision': assetRevision, + 'domainId': domainId, + }; + } +} + +/// Specifies the rule and the threshold under which a prediction can be +/// rejected. +class RejectRule { + /// Specifies whether you want to reject the top prediction for all targets or + /// none. + final RejectRuleBehavior? rule; + + /// The confidence score that specifies the condition at which a prediction can + /// be rejected. + final double? threshold; + + RejectRule({ + this.rule, + this.threshold, + }); + + Map toJson() { + final rule = this.rule; + final threshold = this.threshold; + return { + if (rule != null) 'rule': rule.toValue(), + if (threshold != null) 'threshold': threshold, + }; + } +} + +enum RejectRuleBehavior { + all, + none, +} + +extension RejectRuleBehaviorValueExtension on RejectRuleBehavior { + String toValue() { + switch (this) { + case RejectRuleBehavior.all: + return 'ALL'; + case RejectRuleBehavior.none: + return 'NONE'; + } + } +} + +extension RejectRuleBehaviorFromString on String { + RejectRuleBehavior toRejectRuleBehavior() { + switch (this) { + case 'ALL': + return RejectRuleBehavior.all; + case 'NONE': + return RejectRuleBehavior.none; + } + throw Exception('$this is not known in enum RejectRuleBehavior'); + } +} + +class RejectSubscriptionRequestOutput { + /// The timestamp of when the subscription request was rejected. + final DateTime createdAt; + + /// The timestamp of when the subscription request was rejected. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the subscription + /// request was rejected. + final String domainId; + + /// The identifier of the subscription request that was rejected. + final String id; + + /// The reason for the subscription request. + final String requestReason; + + /// The status of the subscription request. + final SubscriptionRequestStatus status; + + /// The subscribed listings of the subscription request. + final List subscribedListings; + + /// The subscribed principals of the subscription request. + final List subscribedPrincipals; + + /// The timestamp of when the subscription request was updated. + final DateTime updatedAt; + + /// The decision comment of the rejected subscription request. + final String? decisionComment; + + /// The identifier of the subscription request reviewer. + final String? reviewerId; + + /// The Amazon DataZone user who updated the subscription request. + final String? updatedBy; + + RejectSubscriptionRequestOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory RejectSubscriptionRequestOutput.fromJson(Map json) { + return RejectSubscriptionRequestOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The relational filter configuration for the data source. +class RelationalFilterConfiguration { + /// The database name specified in the relational filter configuration for the + /// data source. + final String databaseName; + + /// The filter expressions specified in the relational filter configuration for + /// the data source. + final List? filterExpressions; + + /// The schema name specified in the relational filter configuration for the + /// data source. + final String? schemaName; + + RelationalFilterConfiguration({ + required this.databaseName, + this.filterExpressions, + this.schemaName, + }); + + factory RelationalFilterConfiguration.fromJson(Map json) { + return RelationalFilterConfiguration( + databaseName: json['databaseName'] as String, + filterExpressions: (json['filterExpressions'] as List?) + ?.whereNotNull() + .map((e) => FilterExpression.fromJson(e as Map)) + .toList(), + schemaName: json['schemaName'] as String?, + ); + } + + Map toJson() { + final databaseName = this.databaseName; + final filterExpressions = this.filterExpressions; + final schemaName = this.schemaName; + return { + 'databaseName': databaseName, + if (filterExpressions != null) 'filterExpressions': filterExpressions, + if (schemaName != null) 'schemaName': schemaName, + }; + } +} + +/// The details of a provisioned resource of this Amazon DataZone environment. +class Resource { + /// The type of a provisioned resource of this Amazon DataZone environment. + final String type; + + /// The value of a provisioned resource of this Amazon DataZone environment. + final String value; + + /// The name of a provisioned resource of this Amazon DataZone environment. + final String? name; + + /// The provider of a provisioned resource of this Amazon DataZone environment. + final String? provider; + + Resource({ + required this.type, + required this.value, + this.name, + this.provider, + }); + + factory Resource.fromJson(Map json) { + return Resource( + type: json['type'] as String, + value: json['value'] as String, + name: json['name'] as String?, + provider: json['provider'] as String?, + ); + } + + Map toJson() { + final type = this.type; + final value = this.value; + final name = this.name; + final provider = this.provider; + return { + 'type': type, + 'value': value, + if (name != null) 'name': name, + if (provider != null) 'provider': provider, + }; + } +} + +class RevokeSubscriptionOutput { + /// The timestamp of when the subscription was revoked. + final DateTime createdAt; + + /// The identifier of the user who revoked the subscription. + final String createdBy; + + /// The identifier of the Amazon DataZone domain where you want to revoke a + /// subscription. + final String domainId; + + /// The identifier of the revoked subscription. + final String id; + + /// The status of the revoked subscription. + final SubscriptionStatus status; + + /// The subscribed listing of the revoked subscription. + final SubscribedListing subscribedListing; + + /// The subscribed principal of the revoked subscription. + final SubscribedPrincipal subscribedPrincipal; + + /// The timestamp of when the subscription was revoked. + final DateTime updatedAt; + + /// Specifies whether permissions are retained when the subscription is revoked. + final bool? retainPermissions; + + /// The identifier of the subscription request for the revoked subscription. + final String? subscriptionRequestId; + + /// The Amazon DataZone user who revoked the subscription. + final String? updatedBy; + + RevokeSubscriptionOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.status, + required this.subscribedListing, + required this.subscribedPrincipal, + required this.updatedAt, + this.retainPermissions, + this.subscriptionRequestId, + this.updatedBy, + }); + + factory RevokeSubscriptionOutput.fromJson(Map json) { + return RevokeSubscriptionOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionStatus(), + subscribedListing: SubscribedListing.fromJson( + json['subscribedListing'] as Map), + subscribedPrincipal: SubscribedPrincipal.fromJson( + json['subscribedPrincipal'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + retainPermissions: json['retainPermissions'] as bool?, + subscriptionRequestId: json['subscriptionRequestId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final subscribedListing = this.subscribedListing; + final subscribedPrincipal = this.subscribedPrincipal; + final updatedAt = this.updatedAt; + final retainPermissions = this.retainPermissions; + final subscriptionRequestId = this.subscriptionRequestId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'status': status.toValue(), + 'subscribedListing': subscribedListing, + 'subscribedPrincipal': subscribedPrincipal, + 'updatedAt': unixTimestampToJson(updatedAt), + if (retainPermissions != null) 'retainPermissions': retainPermissions, + if (subscriptionRequestId != null) + 'subscriptionRequestId': subscriptionRequestId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The asset statistics from the data source run. +class RunStatisticsForAssets { + /// The added statistic for the data source run. + final int? added; + + /// The failed statistic for the data source run. + final int? failed; + + /// The skipped statistic for the data source run. + final int? skipped; + + /// The unchanged statistic for the data source run. + final int? unchanged; + + /// The updated statistic for the data source run. + final int? updated; + + RunStatisticsForAssets({ + this.added, + this.failed, + this.skipped, + this.unchanged, + this.updated, + }); + + factory RunStatisticsForAssets.fromJson(Map json) { + return RunStatisticsForAssets( + added: json['added'] as int?, + failed: json['failed'] as int?, + skipped: json['skipped'] as int?, + unchanged: json['unchanged'] as int?, + updated: json['updated'] as int?, + ); + } + + Map toJson() { + final added = this.added; + final failed = this.failed; + final skipped = this.skipped; + final unchanged = this.unchanged; + final updated = this.updated; + return { + if (added != null) 'added': added, + if (failed != null) 'failed': failed, + if (skipped != null) 'skipped': skipped, + if (unchanged != null) 'unchanged': unchanged, + if (updated != null) 'updated': updated, + }; + } +} + +/// The details of the schedule of the data source runs. +class ScheduleConfiguration { + /// The schedule of the data source runs. + final String? schedule; + + /// The timezone of the data source run. + final Timezone? timezone; + + ScheduleConfiguration({ + this.schedule, + this.timezone, + }); + + factory ScheduleConfiguration.fromJson(Map json) { + return ScheduleConfiguration( + schedule: json['schedule'] as String?, + timezone: (json['timezone'] as String?)?.toTimezone(), + ); + } + + Map toJson() { + final schedule = this.schedule; + final timezone = this.timezone; + return { + if (schedule != null) 'schedule': schedule, + if (timezone != null) 'timezone': timezone.toValue(), + }; + } +} + +class SearchGroupProfilesOutput { + /// The results of the SearchGroupProfiles action. + final List? items; + + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchGroupProfiles to list the next set of results. + final String? nextToken; + + SearchGroupProfilesOutput({ + this.items, + this.nextToken, + }); + + factory SearchGroupProfilesOutput.fromJson(Map json) { + return SearchGroupProfilesOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => GroupProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +/// The details of the search. +class SearchInItem { + /// The search attribute. + final String attribute; + + SearchInItem({ + required this.attribute, + }); + + Map toJson() { + final attribute = this.attribute; + return { + 'attribute': attribute, + }; + } +} + +/// The details of the search results. +class SearchInventoryResultItem { + /// The asset item included in the search results. + final AssetItem? assetItem; + + /// The data product item included in the search results. + final DataProductSummary? dataProductItem; + + /// The glossary item included in the search results. + final GlossaryItem? glossaryItem; + + /// The glossary term item included in the search results. + final GlossaryTermItem? glossaryTermItem; + + SearchInventoryResultItem({ + this.assetItem, + this.dataProductItem, + this.glossaryItem, + this.glossaryTermItem, + }); + + factory SearchInventoryResultItem.fromJson(Map json) { + return SearchInventoryResultItem( + assetItem: json['assetItem'] != null + ? AssetItem.fromJson(json['assetItem'] as Map) + : null, + dataProductItem: json['dataProductItem'] != null + ? DataProductSummary.fromJson( + json['dataProductItem'] as Map) + : null, + glossaryItem: json['glossaryItem'] != null + ? GlossaryItem.fromJson(json['glossaryItem'] as Map) + : null, + glossaryTermItem: json['glossaryTermItem'] != null + ? GlossaryTermItem.fromJson( + json['glossaryTermItem'] as Map) + : null, + ); + } + + Map toJson() { + final assetItem = this.assetItem; + final dataProductItem = this.dataProductItem; + final glossaryItem = this.glossaryItem; + final glossaryTermItem = this.glossaryTermItem; + return { + if (assetItem != null) 'assetItem': assetItem, + if (dataProductItem != null) 'dataProductItem': dataProductItem, + if (glossaryItem != null) 'glossaryItem': glossaryItem, + if (glossaryTermItem != null) 'glossaryTermItem': glossaryTermItem, + }; + } +} + +class SearchListingsOutput { + /// The results of the SearchListings action. + final List? items; + + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchListings to list the next set of results. + final String? nextToken; + + /// Total number of search results. + final int? totalMatchCount; + + SearchListingsOutput({ + this.items, + this.nextToken, + this.totalMatchCount, + }); + + factory SearchListingsOutput.fromJson(Map json) { + return SearchListingsOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => SearchResultItem.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + totalMatchCount: json['totalMatchCount'] as int?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + final totalMatchCount = this.totalMatchCount; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + if (totalMatchCount != null) 'totalMatchCount': totalMatchCount, + }; + } +} + +class SearchOutput { + /// The results of the Search action. + final List? items; + + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// Search to list the next set of results. + final String? nextToken; + + /// Total number of search results. + final int? totalMatchCount; + + SearchOutput({ + this.items, + this.nextToken, + this.totalMatchCount, + }); + + factory SearchOutput.fromJson(Map json) { + return SearchOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => + SearchInventoryResultItem.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + totalMatchCount: json['totalMatchCount'] as int?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + final totalMatchCount = this.totalMatchCount; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + if (totalMatchCount != null) 'totalMatchCount': totalMatchCount, + }; + } +} + +enum SearchOutputAdditionalAttribute { + forms, + timeSeriesDataPointForms, +} + +extension SearchOutputAdditionalAttributeValueExtension + on SearchOutputAdditionalAttribute { + String toValue() { + switch (this) { + case SearchOutputAdditionalAttribute.forms: + return 'FORMS'; + case SearchOutputAdditionalAttribute.timeSeriesDataPointForms: + return 'TIME_SERIES_DATA_POINT_FORMS'; + } + } +} + +extension SearchOutputAdditionalAttributeFromString on String { + SearchOutputAdditionalAttribute toSearchOutputAdditionalAttribute() { + switch (this) { + case 'FORMS': + return SearchOutputAdditionalAttribute.forms; + case 'TIME_SERIES_DATA_POINT_FORMS': + return SearchOutputAdditionalAttribute.timeSeriesDataPointForms; + } + throw Exception( + '$this is not known in enum SearchOutputAdditionalAttribute'); + } +} + +/// The details of the results of the SearchListings action. +class SearchResultItem { + /// The asset listing included in the results of the SearchListings + /// action. + final AssetListingItem? assetListing; + + SearchResultItem({ + this.assetListing, + }); + + factory SearchResultItem.fromJson(Map json) { + return SearchResultItem( + assetListing: json['assetListing'] != null + ? AssetListingItem.fromJson( + json['assetListing'] as Map) + : null, + ); + } + + Map toJson() { + final assetListing = this.assetListing; + return { + if (assetListing != null) 'assetListing': assetListing, + }; + } +} + +/// The details of the way to sort search results. +class SearchSort { + /// The attribute detail of the way to sort search results. + final String attribute; + + /// The order detail of the wya to sort search results. + final SortOrder? order; + + SearchSort({ + required this.attribute, + this.order, + }); + + Map toJson() { + final attribute = this.attribute; + final order = this.order; + return { + 'attribute': attribute, + if (order != null) 'order': order.toValue(), + }; + } +} + +class SearchTypesOutput { + /// The results of the SearchTypes action. + final List? items; + + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchTypes to list the next set of results. + final String? nextToken; + + /// Total number of search results. + final int? totalMatchCount; + + SearchTypesOutput({ + this.items, + this.nextToken, + this.totalMatchCount, + }); + + factory SearchTypesOutput.fromJson(Map json) { + return SearchTypesOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => SearchTypesResultItem.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + totalMatchCount: json['totalMatchCount'] as int?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + final totalMatchCount = this.totalMatchCount; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + if (totalMatchCount != null) 'totalMatchCount': totalMatchCount, + }; + } +} + +/// The details of the results of the SearchTypes action. +class SearchTypesResultItem { + /// The asset type included in the results of the SearchTypes + /// action. + final AssetTypeItem? assetTypeItem; + + /// The form type included in the results of the SearchTypes + /// action. + final FormTypeData? formTypeItem; + + SearchTypesResultItem({ + this.assetTypeItem, + this.formTypeItem, + }); + + factory SearchTypesResultItem.fromJson(Map json) { + return SearchTypesResultItem( + assetTypeItem: json['assetTypeItem'] != null + ? AssetTypeItem.fromJson( + json['assetTypeItem'] as Map) + : null, + formTypeItem: json['formTypeItem'] != null + ? FormTypeData.fromJson(json['formTypeItem'] as Map) + : null, + ); + } + + Map toJson() { + final assetTypeItem = this.assetTypeItem; + final formTypeItem = this.formTypeItem; + return { + if (assetTypeItem != null) 'assetTypeItem': assetTypeItem, + if (formTypeItem != null) 'formTypeItem': formTypeItem, + }; + } +} + +class SearchUserProfilesOutput { + /// The results of the SearchUserProfiles action. + final List? items; + + /// When the number of results is greater than the default value for the + /// MaxResults parameter, or if you explicitly specify a value for + /// MaxResults that is less than the number of results, the + /// response includes a pagination token named NextToken. You can + /// specify this NextToken value in a subsequent call to + /// SearchUserProfiles to list the next set of results. + final String? nextToken; + + SearchUserProfilesOutput({ + this.items, + this.nextToken, + }); + + factory SearchUserProfilesOutput.fromJson(Map json) { + return SearchUserProfilesOutput( + items: (json['items'] as List?) + ?.whereNotNull() + .map((e) => UserProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final items = this.items; + final nextToken = this.nextToken; + return { + if (items != null) 'items': items, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +/// The single sign-on details in Amazon DataZone. +class SingleSignOn { + /// The type of single sign-on in Amazon DataZone. + final AuthType? type; + + /// The single sign-on user assignment in Amazon DataZone. + final UserAssignment? userAssignment; + + SingleSignOn({ + this.type, + this.userAssignment, + }); + + factory SingleSignOn.fromJson(Map json) { + return SingleSignOn( + type: (json['type'] as String?)?.toAuthType(), + userAssignment: (json['userAssignment'] as String?)?.toUserAssignment(), + ); + } + + Map toJson() { + final type = this.type; + final userAssignment = this.userAssignment; + return { + if (type != null) 'type': type.toValue(), + if (userAssignment != null) 'userAssignment': userAssignment.toValue(), + }; + } +} + +enum SortFieldProject { + name, +} + +extension SortFieldProjectValueExtension on SortFieldProject { + String toValue() { + switch (this) { + case SortFieldProject.name: + return 'NAME'; + } + } +} + +extension SortFieldProjectFromString on String { + SortFieldProject toSortFieldProject() { + switch (this) { + case 'NAME': + return SortFieldProject.name; + } + throw Exception('$this is not known in enum SortFieldProject'); + } +} + +enum SortKey { + createdAt, + updatedAt, +} + +extension SortKeyValueExtension on SortKey { + String toValue() { + switch (this) { + case SortKey.createdAt: + return 'CREATED_AT'; + case SortKey.updatedAt: + return 'UPDATED_AT'; + } + } +} + +extension SortKeyFromString on String { + SortKey toSortKey() { + switch (this) { + case 'CREATED_AT': + return SortKey.createdAt; + case 'UPDATED_AT': + return SortKey.updatedAt; + } + throw Exception('$this is not known in enum SortKey'); + } +} + +enum SortOrder { + ascending, + descending, +} + +extension SortOrderValueExtension on SortOrder { + String toValue() { + switch (this) { + case SortOrder.ascending: + return 'ASCENDING'; + case SortOrder.descending: + return 'DESCENDING'; + } + } +} + +extension SortOrderFromString on String { + SortOrder toSortOrder() { + switch (this) { + case 'ASCENDING': + return SortOrder.ascending; + case 'DESCENDING': + return SortOrder.descending; + } + throw Exception('$this is not known in enum SortOrder'); + } +} + +/// The single sign-on details of the user profile. +class SsoUserProfileDetails { + /// The first name included in the single sign-on details of the user profile. + final String? firstName; + + /// The last name included in the single sign-on details of the user profile. + final String? lastName; + + /// The username included in the single sign-on details of the user profile. + final String? username; + + SsoUserProfileDetails({ + this.firstName, + this.lastName, + this.username, + }); + + factory SsoUserProfileDetails.fromJson(Map json) { + return SsoUserProfileDetails( + firstName: json['firstName'] as String?, + lastName: json['lastName'] as String?, + username: json['username'] as String?, + ); + } + + Map toJson() { + final firstName = this.firstName; + final lastName = this.lastName; + final username = this.username; + return { + if (firstName != null) 'firstName': firstName, + if (lastName != null) 'lastName': lastName, + if (username != null) 'username': username, + }; + } +} + +class StartDataSourceRunOutput { + /// The timestamp of when data source run was created. + final DateTime createdAt; + + /// The identifier of the data source. + final String dataSourceId; + + /// The identifier of the Amazon DataZone domain in which to start a data source + /// run. + final String domainId; + + /// The identifier of the data source run. + final String id; + + /// The identifier of the project. + final String projectId; + + /// The status of the data source run. + final DataSourceRunStatus status; + + /// The type of the data source run. + final DataSourceRunType type; + + /// The timestamp of when the data source run was updated. + final DateTime updatedAt; + + /// The configuration snapshot of the data source that is being run. + final String? dataSourceConfigurationSnapshot; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// Specifies run statistics for assets. + final RunStatisticsForAssets? runStatisticsForAssets; + + /// The timestamp of when the data source run was started. + final DateTime? startedAt; + + /// The timestamp of when the data source run was stopped. + final DateTime? stoppedAt; + + StartDataSourceRunOutput({ + required this.createdAt, + required this.dataSourceId, + required this.domainId, + required this.id, + required this.projectId, + required this.status, + required this.type, + required this.updatedAt, + this.dataSourceConfigurationSnapshot, + this.errorMessage, + this.runStatisticsForAssets, + this.startedAt, + this.stoppedAt, + }); + + factory StartDataSourceRunOutput.fromJson(Map json) { + return StartDataSourceRunOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + dataSourceId: json['dataSourceId'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + projectId: json['projectId'] as String, + status: (json['status'] as String).toDataSourceRunStatus(), + type: (json['type'] as String).toDataSourceRunType(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + dataSourceConfigurationSnapshot: + json['dataSourceConfigurationSnapshot'] as String?, + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + runStatisticsForAssets: json['runStatisticsForAssets'] != null + ? RunStatisticsForAssets.fromJson( + json['runStatisticsForAssets'] as Map) + : null, + startedAt: timeStampFromJson(json['startedAt']), + stoppedAt: timeStampFromJson(json['stoppedAt']), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final dataSourceId = this.dataSourceId; + final domainId = this.domainId; + final id = this.id; + final projectId = this.projectId; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + final dataSourceConfigurationSnapshot = + this.dataSourceConfigurationSnapshot; + final errorMessage = this.errorMessage; + final runStatisticsForAssets = this.runStatisticsForAssets; + final startedAt = this.startedAt; + final stoppedAt = this.stoppedAt; + return { + 'createdAt': iso8601ToJson(createdAt), + 'dataSourceId': dataSourceId, + 'domainId': domainId, + 'id': id, + 'projectId': projectId, + 'status': status.toValue(), + 'type': type.toValue(), + 'updatedAt': iso8601ToJson(updatedAt), + if (dataSourceConfigurationSnapshot != null) + 'dataSourceConfigurationSnapshot': dataSourceConfigurationSnapshot, + if (errorMessage != null) 'errorMessage': errorMessage, + if (runStatisticsForAssets != null) + 'runStatisticsForAssets': runStatisticsForAssets, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (stoppedAt != null) 'stoppedAt': iso8601ToJson(stoppedAt), + }; + } +} + +class StartMetadataGenerationRunOutput { + /// The ID of the Amazon DataZone domain in which the metadata generation run + /// was started. + final String domainId; + + /// The ID of the metadata generation run. + final String id; + + /// The timestamp at which the metadata generation run was started. + final DateTime? createdAt; + + /// The ID of the user who started the metadata generation run. + final String? createdBy; + + /// The ID of the project that owns the asset for which the metadata generation + /// run was started. + final String? owningProjectId; + + /// The status of the metadata generation run. + final MetadataGenerationRunStatus? status; + + /// The type of the metadata generation run. + final MetadataGenerationRunType? type; + + StartMetadataGenerationRunOutput({ + required this.domainId, + required this.id, + this.createdAt, + this.createdBy, + this.owningProjectId, + this.status, + this.type, + }); + + factory StartMetadataGenerationRunOutput.fromJson(Map json) { + return StartMetadataGenerationRunOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + owningProjectId: json['owningProjectId'] as String?, + status: (json['status'] as String?)?.toMetadataGenerationRunStatus(), + type: (json['type'] as String?)?.toMetadataGenerationRunType(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final owningProjectId = this.owningProjectId; + final status = this.status; + final type = this.type; + return { + 'domainId': domainId, + 'id': id, + if (createdAt != null) 'createdAt': unixTimestampToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (owningProjectId != null) 'owningProjectId': owningProjectId, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +/// The details of the asset for which the subscription grant is created. +class SubscribedAsset { + /// The identifier of the asset for which the subscription grant is created. + final String assetId; + + /// The revision of the asset for which the subscription grant is created. + final String assetRevision; + + /// The status of the asset for which the subscription grant is created. + final SubscriptionGrantStatus status; + + /// The failure cause included in the details of the asset for which the + /// subscription grant is created. + final FailureCause? failureCause; + + /// The failure timestamp included in the details of the asset for which the + /// subscription grant is created. + final DateTime? failureTimestamp; + + /// The timestamp of when the subscription grant to the asset is created. + final DateTime? grantedTimestamp; + + /// The target name of the asset for which the subscription grant is created. + final String? targetName; + + SubscribedAsset({ + required this.assetId, + required this.assetRevision, + required this.status, + this.failureCause, + this.failureTimestamp, + this.grantedTimestamp, + this.targetName, + }); + + factory SubscribedAsset.fromJson(Map json) { + return SubscribedAsset( + assetId: json['assetId'] as String, + assetRevision: json['assetRevision'] as String, + status: (json['status'] as String).toSubscriptionGrantStatus(), + failureCause: json['failureCause'] != null + ? FailureCause.fromJson(json['failureCause'] as Map) + : null, + failureTimestamp: timeStampFromJson(json['failureTimestamp']), + grantedTimestamp: timeStampFromJson(json['grantedTimestamp']), + targetName: json['targetName'] as String?, + ); + } + + Map toJson() { + final assetId = this.assetId; + final assetRevision = this.assetRevision; + final status = this.status; + final failureCause = this.failureCause; + final failureTimestamp = this.failureTimestamp; + final grantedTimestamp = this.grantedTimestamp; + final targetName = this.targetName; + return { + 'assetId': assetId, + 'assetRevision': assetRevision, + 'status': status.toValue(), + if (failureCause != null) 'failureCause': failureCause, + if (failureTimestamp != null) + 'failureTimestamp': unixTimestampToJson(failureTimestamp), + if (grantedTimestamp != null) + 'grantedTimestamp': unixTimestampToJson(grantedTimestamp), + if (targetName != null) 'targetName': targetName, + }; + } +} + +/// The details of the published asset for which the subscription grant is +/// created. +class SubscribedAssetListing { + /// The identifier of the published asset for which the subscription grant is + /// created. + final String? entityId; + + /// The revision of the published asset for which the subscription grant is + /// created. + final String? entityRevision; + + /// The type of the published asset for which the subscription grant is created. + final String? entityType; + + /// The forms attached to the published asset for which the subscription grant + /// is created. + final String? forms; + + /// The glossary terms attached to the published asset for which the + /// subscription grant is created. + final List? glossaryTerms; + + SubscribedAssetListing({ + this.entityId, + this.entityRevision, + this.entityType, + this.forms, + this.glossaryTerms, + }); + + factory SubscribedAssetListing.fromJson(Map json) { + return SubscribedAssetListing( + entityId: json['entityId'] as String?, + entityRevision: json['entityRevision'] as String?, + entityType: json['entityType'] as String?, + forms: json['forms'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => DetailedGlossaryTerm.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final entityId = this.entityId; + final entityRevision = this.entityRevision; + final entityType = this.entityType; + final forms = this.forms; + final glossaryTerms = this.glossaryTerms; + return { + if (entityId != null) 'entityId': entityId, + if (entityRevision != null) 'entityRevision': entityRevision, + if (entityType != null) 'entityType': entityType, + if (forms != null) 'forms': forms, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + }; + } +} + +/// The details of the published asset for which the subscription grant is +/// created. +class SubscribedListing { + /// The description of the published asset for which the subscription grant is + /// created. + final String description; + + /// The identifier of the published asset for which the subscription grant is + /// created. + final String id; + + /// The published asset for which the subscription grant is created. + final SubscribedListingItem item; + + /// The name of the published asset for which the subscription grant is created. + final String name; + + /// The identifier of the project of the published asset for which the + /// subscription grant is created. + final String ownerProjectId; + + /// The name of the project that owns the published asset for which the + /// subscription grant is created. + final String? ownerProjectName; + + /// The revision of the published asset for which the subscription grant is + /// created. + final String? revision; + + SubscribedListing({ + required this.description, + required this.id, + required this.item, + required this.name, + required this.ownerProjectId, + this.ownerProjectName, + this.revision, + }); + + factory SubscribedListing.fromJson(Map json) { + return SubscribedListing( + description: json['description'] as String, + id: json['id'] as String, + item: + SubscribedListingItem.fromJson(json['item'] as Map), + name: json['name'] as String, + ownerProjectId: json['ownerProjectId'] as String, + ownerProjectName: json['ownerProjectName'] as String?, + revision: json['revision'] as String?, + ); + } + + Map toJson() { + final description = this.description; + final id = this.id; + final item = this.item; + final name = this.name; + final ownerProjectId = this.ownerProjectId; + final ownerProjectName = this.ownerProjectName; + final revision = this.revision; + return { + 'description': description, + 'id': id, + 'item': item, + 'name': name, + 'ownerProjectId': ownerProjectId, + if (ownerProjectName != null) 'ownerProjectName': ownerProjectName, + if (revision != null) 'revision': revision, + }; + } +} + +/// The published asset for which the subscription grant is to be created. +class SubscribedListingInput { + /// The identifier of the published asset for which the subscription grant is to + /// be created. + final String identifier; + + SubscribedListingInput({ + required this.identifier, + }); + + Map toJson() { + final identifier = this.identifier; + return { + 'identifier': identifier, + }; + } +} + +/// The published asset for which the subscription grant is created. +class SubscribedListingItem { + /// The asset for which the subscription grant is created. + final SubscribedAssetListing? assetListing; + + SubscribedListingItem({ + this.assetListing, + }); + + factory SubscribedListingItem.fromJson(Map json) { + return SubscribedListingItem( + assetListing: json['assetListing'] != null + ? SubscribedAssetListing.fromJson( + json['assetListing'] as Map) + : null, + ); + } + + Map toJson() { + final assetListing = this.assetListing; + return { + if (assetListing != null) 'assetListing': assetListing, + }; + } +} + +/// The principal that has the subscription grant for the asset. +class SubscribedPrincipal { + /// The project that has the subscription grant. + final SubscribedProject? project; + + SubscribedPrincipal({ + this.project, + }); + + factory SubscribedPrincipal.fromJson(Map json) { + return SubscribedPrincipal( + project: json['project'] != null + ? SubscribedProject.fromJson(json['project'] as Map) + : null, + ); + } + + Map toJson() { + final project = this.project; + return { + if (project != null) 'project': project, + }; + } +} + +/// The principal that is to be given a subscriptiong grant. +class SubscribedPrincipalInput { + /// The project that is to be given a subscription grant. + final SubscribedProjectInput? project; + + SubscribedPrincipalInput({ + this.project, + }); + + Map toJson() { + final project = this.project; + return { + if (project != null) 'project': project, + }; + } +} + +/// The project that has the subscription grant. +class SubscribedProject { + /// The identifier of the project that has the subscription grant. + final String? id; + + /// The name of the project that has the subscription grant. + final String? name; + + SubscribedProject({ + this.id, + this.name, + }); + + factory SubscribedProject.fromJson(Map json) { + return SubscribedProject( + id: json['id'] as String?, + name: json['name'] as String?, + ); + } + + Map toJson() { + final id = this.id; + final name = this.name; + return { + if (id != null) 'id': id, + if (name != null) 'name': name, + }; + } +} + +/// The project that is to be given a subscription grant. +class SubscribedProjectInput { + /// The identifier of the project that is to be given a subscription grant. + final String? identifier; + + SubscribedProjectInput({ + this.identifier, + }); + + Map toJson() { + final identifier = this.identifier; + return { + if (identifier != null) 'identifier': identifier, + }; + } +} + +enum SubscriptionGrantOverallStatus { + pending, + inProgress, + grantFailed, + revokeFailed, + grantAndRevokeFailed, + completed, + inaccessible, +} + +extension SubscriptionGrantOverallStatusValueExtension + on SubscriptionGrantOverallStatus { + String toValue() { + switch (this) { + case SubscriptionGrantOverallStatus.pending: + return 'PENDING'; + case SubscriptionGrantOverallStatus.inProgress: + return 'IN_PROGRESS'; + case SubscriptionGrantOverallStatus.grantFailed: + return 'GRANT_FAILED'; + case SubscriptionGrantOverallStatus.revokeFailed: + return 'REVOKE_FAILED'; + case SubscriptionGrantOverallStatus.grantAndRevokeFailed: + return 'GRANT_AND_REVOKE_FAILED'; + case SubscriptionGrantOverallStatus.completed: + return 'COMPLETED'; + case SubscriptionGrantOverallStatus.inaccessible: + return 'INACCESSIBLE'; + } + } +} + +extension SubscriptionGrantOverallStatusFromString on String { + SubscriptionGrantOverallStatus toSubscriptionGrantOverallStatus() { + switch (this) { + case 'PENDING': + return SubscriptionGrantOverallStatus.pending; + case 'IN_PROGRESS': + return SubscriptionGrantOverallStatus.inProgress; + case 'GRANT_FAILED': + return SubscriptionGrantOverallStatus.grantFailed; + case 'REVOKE_FAILED': + return SubscriptionGrantOverallStatus.revokeFailed; + case 'GRANT_AND_REVOKE_FAILED': + return SubscriptionGrantOverallStatus.grantAndRevokeFailed; + case 'COMPLETED': + return SubscriptionGrantOverallStatus.completed; + case 'INACCESSIBLE': + return SubscriptionGrantOverallStatus.inaccessible; + } + throw Exception( + '$this is not known in enum SubscriptionGrantOverallStatus'); + } +} + +enum SubscriptionGrantStatus { + grantPending, + revokePending, + grantInProgress, + revokeInProgress, + granted, + revoked, + grantFailed, + revokeFailed, +} + +extension SubscriptionGrantStatusValueExtension on SubscriptionGrantStatus { + String toValue() { + switch (this) { + case SubscriptionGrantStatus.grantPending: + return 'GRANT_PENDING'; + case SubscriptionGrantStatus.revokePending: + return 'REVOKE_PENDING'; + case SubscriptionGrantStatus.grantInProgress: + return 'GRANT_IN_PROGRESS'; + case SubscriptionGrantStatus.revokeInProgress: + return 'REVOKE_IN_PROGRESS'; + case SubscriptionGrantStatus.granted: + return 'GRANTED'; + case SubscriptionGrantStatus.revoked: + return 'REVOKED'; + case SubscriptionGrantStatus.grantFailed: + return 'GRANT_FAILED'; + case SubscriptionGrantStatus.revokeFailed: + return 'REVOKE_FAILED'; + } + } +} + +extension SubscriptionGrantStatusFromString on String { + SubscriptionGrantStatus toSubscriptionGrantStatus() { + switch (this) { + case 'GRANT_PENDING': + return SubscriptionGrantStatus.grantPending; + case 'REVOKE_PENDING': + return SubscriptionGrantStatus.revokePending; + case 'GRANT_IN_PROGRESS': + return SubscriptionGrantStatus.grantInProgress; + case 'REVOKE_IN_PROGRESS': + return SubscriptionGrantStatus.revokeInProgress; + case 'GRANTED': + return SubscriptionGrantStatus.granted; + case 'REVOKED': + return SubscriptionGrantStatus.revoked; + case 'GRANT_FAILED': + return SubscriptionGrantStatus.grantFailed; + case 'REVOKE_FAILED': + return SubscriptionGrantStatus.revokeFailed; + } + throw Exception('$this is not known in enum SubscriptionGrantStatus'); + } +} + +/// The details of the subscription grant. +class SubscriptionGrantSummary { + /// The timestamp of when a subscription grant was created. + final DateTime createdAt; + + /// The datazone user who created the subscription grant. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription grant + /// exists. + final String domainId; + + /// The entity to which the subscription is granted. + final GrantedEntity grantedEntity; + + /// The identifier of the subscription grant. + final String id; + + /// The status of the subscription grant. + final SubscriptionGrantOverallStatus status; + + /// The identifier of the target of the subscription grant. + final String subscriptionTargetId; + + /// The timestampf of when the subscription grant was updated. + final DateTime updatedAt; + + /// The assets included in the subscription grant. + final List? assets; + + /// The ID of the subscription grant. + final String? subscriptionId; + + /// The Amazon DataZone user who updated the subscription grant. + final String? updatedBy; + + SubscriptionGrantSummary({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.grantedEntity, + required this.id, + required this.status, + required this.subscriptionTargetId, + required this.updatedAt, + this.assets, + this.subscriptionId, + this.updatedBy, + }); + + factory SubscriptionGrantSummary.fromJson(Map json) { + return SubscriptionGrantSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + grantedEntity: + GrantedEntity.fromJson(json['grantedEntity'] as Map), + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionGrantOverallStatus(), + subscriptionTargetId: json['subscriptionTargetId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + assets: (json['assets'] as List?) + ?.whereNotNull() + .map((e) => SubscribedAsset.fromJson(e as Map)) + .toList(), + subscriptionId: json['subscriptionId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final grantedEntity = this.grantedEntity; + final id = this.id; + final status = this.status; + final subscriptionTargetId = this.subscriptionTargetId; + final updatedAt = this.updatedAt; + final assets = this.assets; + final subscriptionId = this.subscriptionId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'grantedEntity': grantedEntity, + 'id': id, + 'status': status.toValue(), + 'subscriptionTargetId': subscriptionTargetId, + 'updatedAt': unixTimestampToJson(updatedAt), + if (assets != null) 'assets': assets, + if (subscriptionId != null) 'subscriptionId': subscriptionId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum SubscriptionRequestStatus { + pending, + accepted, + rejected, +} + +extension SubscriptionRequestStatusValueExtension on SubscriptionRequestStatus { + String toValue() { + switch (this) { + case SubscriptionRequestStatus.pending: + return 'PENDING'; + case SubscriptionRequestStatus.accepted: + return 'ACCEPTED'; + case SubscriptionRequestStatus.rejected: + return 'REJECTED'; + } + } +} + +extension SubscriptionRequestStatusFromString on String { + SubscriptionRequestStatus toSubscriptionRequestStatus() { + switch (this) { + case 'PENDING': + return SubscriptionRequestStatus.pending; + case 'ACCEPTED': + return SubscriptionRequestStatus.accepted; + case 'REJECTED': + return SubscriptionRequestStatus.rejected; + } + throw Exception('$this is not known in enum SubscriptionRequestStatus'); + } +} + +/// The details of the subscription request. +class SubscriptionRequestSummary { + /// The timestamp of when a subscription request was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription request. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription request + /// exists. + final String domainId; + + /// The identifier of the subscription request. + final String id; + + /// The reason for the subscription request. + final String requestReason; + + /// The status of the subscription request. + final SubscriptionRequestStatus status; + + /// The listings included in the subscription request. + final List subscribedListings; + + /// The principals included in the subscription request. + final List subscribedPrincipals; + + /// The timestamp of when the subscription request was updated. + final DateTime updatedAt; + + /// The decision comment of the subscription request. + final String? decisionComment; + + /// The identifier of the subscription request reviewer. + final String? reviewerId; + + /// The identifier of the Amazon DataZone user who updated the subscription + /// request. + final String? updatedBy; + + SubscriptionRequestSummary({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory SubscriptionRequestSummary.fromJson(Map json) { + return SubscriptionRequestSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum SubscriptionStatus { + approved, + revoked, + cancelled, +} + +extension SubscriptionStatusValueExtension on SubscriptionStatus { + String toValue() { + switch (this) { + case SubscriptionStatus.approved: + return 'APPROVED'; + case SubscriptionStatus.revoked: + return 'REVOKED'; + case SubscriptionStatus.cancelled: + return 'CANCELLED'; + } + } +} + +extension SubscriptionStatusFromString on String { + SubscriptionStatus toSubscriptionStatus() { + switch (this) { + case 'APPROVED': + return SubscriptionStatus.approved; + case 'REVOKED': + return SubscriptionStatus.revoked; + case 'CANCELLED': + return SubscriptionStatus.cancelled; + } + throw Exception('$this is not known in enum SubscriptionStatus'); + } +} + +/// The details of the subscription. +class SubscriptionSummary { + /// The timestamp of when the subscription was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription exists. + final String domainId; + + /// The identifier of the subscription. + final String id; + + /// The status of the subscription. + final SubscriptionStatus status; + + /// The listing included in the subscription. + final SubscribedListing subscribedListing; + + /// The principal included in the subscription. + final SubscribedPrincipal subscribedPrincipal; + + /// The timestamp of when the subscription was updated. + final DateTime updatedAt; + + /// The retain permissions included in the subscription. + final bool? retainPermissions; + + /// The identifier of the subscription request for the subscription. + final String? subscriptionRequestId; + + /// The Amazon DataZone user who updated the subscription. + final String? updatedBy; + + SubscriptionSummary({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.status, + required this.subscribedListing, + required this.subscribedPrincipal, + required this.updatedAt, + this.retainPermissions, + this.subscriptionRequestId, + this.updatedBy, + }); + + factory SubscriptionSummary.fromJson(Map json) { + return SubscriptionSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionStatus(), + subscribedListing: SubscribedListing.fromJson( + json['subscribedListing'] as Map), + subscribedPrincipal: SubscribedPrincipal.fromJson( + json['subscribedPrincipal'] as Map), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + retainPermissions: json['retainPermissions'] as bool?, + subscriptionRequestId: json['subscriptionRequestId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final subscribedListing = this.subscribedListing; + final subscribedPrincipal = this.subscribedPrincipal; + final updatedAt = this.updatedAt; + final retainPermissions = this.retainPermissions; + final subscriptionRequestId = this.subscriptionRequestId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'status': status.toValue(), + 'subscribedListing': subscribedListing, + 'subscribedPrincipal': subscribedPrincipal, + 'updatedAt': unixTimestampToJson(updatedAt), + if (retainPermissions != null) 'retainPermissions': retainPermissions, + if (subscriptionRequestId != null) + 'subscriptionRequestId': subscriptionRequestId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The details of the subscription target configuration. +class SubscriptionTargetForm { + /// The content of the subscription target configuration. + final String content; + + /// The form name included in the subscription target configuration. + final String formName; + + SubscriptionTargetForm({ + required this.content, + required this.formName, + }); + + factory SubscriptionTargetForm.fromJson(Map json) { + return SubscriptionTargetForm( + content: json['content'] as String, + formName: json['formName'] as String, + ); + } + + Map toJson() { + final content = this.content; + final formName = this.formName; + return { + 'content': content, + 'formName': formName, + }; + } +} + +/// The details of the subscription target. +class SubscriptionTargetSummary { + /// The asset types included in the subscription target. + final List applicableAssetTypes; + + /// The authorized principals included in the subscription target. + final List authorizedPrincipals; + + /// The timestamp of when the subscription target was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription target. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the subscription + /// target exists. + final String domainId; + + /// The identifier of the environment of the subscription target. + final String environmentId; + + /// The identifier of the subscription target. + final String id; + + /// The manage access role specified in the subscription target. + final String manageAccessRole; + + /// The name of the subscription target. + final String name; + + /// The identifier of the project specified in the subscription target. + final String projectId; + + /// The provider of the subscription target. + final String provider; + + /// The configuration of the subscription target. + final List subscriptionTargetConfig; + + /// The type of the subscription target. + final String type; + + /// The timestamp of when the subscription target was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the subscription target. + final String? updatedBy; + + SubscriptionTargetSummary({ + required this.applicableAssetTypes, + required this.authorizedPrincipals, + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.environmentId, + required this.id, + required this.manageAccessRole, + required this.name, + required this.projectId, + required this.provider, + required this.subscriptionTargetConfig, + required this.type, + this.updatedAt, + this.updatedBy, + }); + + factory SubscriptionTargetSummary.fromJson(Map json) { + return SubscriptionTargetSummary( + applicableAssetTypes: (json['applicableAssetTypes'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + authorizedPrincipals: (json['authorizedPrincipals'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + manageAccessRole: json['manageAccessRole'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + subscriptionTargetConfig: (json['subscriptionTargetConfig'] as List) + .whereNotNull() + .map( + (e) => SubscriptionTargetForm.fromJson(e as Map)) + .toList(), + type: json['type'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final applicableAssetTypes = this.applicableAssetTypes; + final authorizedPrincipals = this.authorizedPrincipals; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final manageAccessRole = this.manageAccessRole; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final subscriptionTargetConfig = this.subscriptionTargetConfig; + final type = this.type; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'applicableAssetTypes': applicableAssetTypes, + 'authorizedPrincipals': authorizedPrincipals, + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'manageAccessRole': manageAccessRole, + 'name': name, + 'projectId': projectId, + 'provider': provider, + 'subscriptionTargetConfig': subscriptionTargetConfig, + 'type': type, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +enum TaskStatus { + active, + inactive, +} + +extension TaskStatusValueExtension on TaskStatus { + String toValue() { + switch (this) { + case TaskStatus.active: + return 'ACTIVE'; + case TaskStatus.inactive: + return 'INACTIVE'; + } + } +} + +extension TaskStatusFromString on String { + TaskStatus toTaskStatus() { + switch (this) { + case 'ACTIVE': + return TaskStatus.active; + case 'INACTIVE': + return TaskStatus.inactive; + } + throw Exception('$this is not known in enum TaskStatus'); + } +} + +/// The details of the term relations. +class TermRelations { + /// The classifies of the term relations. + final List? classifies; + + /// The isA property of the term relations. + final List? isA; + + TermRelations({ + this.classifies, + this.isA, + }); + + factory TermRelations.fromJson(Map json) { + return TermRelations( + classifies: (json['classifies'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + isA: (json['isA'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final classifies = this.classifies; + final isA = this.isA; + return { + if (classifies != null) 'classifies': classifies, + if (isA != null) 'isA': isA, + }; + } +} + +/// The time series data points form. +class TimeSeriesDataPointFormInput { + /// The name of the time series data points form. + final String formName; + + /// The timestamp of the time series data points form. + final DateTime timestamp; + + /// The ID of the type of the time series data points form. + final String typeIdentifier; + + /// The content of the time series data points form. + final String? content; + + /// The revision type of the time series data points form. + final String? typeRevision; + + TimeSeriesDataPointFormInput({ + required this.formName, + required this.timestamp, + required this.typeIdentifier, + this.content, + this.typeRevision, + }); + + Map toJson() { + final formName = this.formName; + final timestamp = this.timestamp; + final typeIdentifier = this.typeIdentifier; + final content = this.content; + final typeRevision = this.typeRevision; + return { + 'formName': formName, + 'timestamp': unixTimestampToJson(timestamp), + 'typeIdentifier': typeIdentifier, + if (content != null) 'content': content, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + } +} + +/// The time series data points form. +class TimeSeriesDataPointFormOutput { + /// The name of the time series data points form. + final String formName; + + /// The timestamp of the time series data points form. + final DateTime timestamp; + + /// The ID of the type of the time series data points form. + final String typeIdentifier; + + /// The content of the time series data points form. + final String? content; + + /// The ID of the time series data points form. + final String? id; + + /// The revision type of the time series data points form. + final String? typeRevision; + + TimeSeriesDataPointFormOutput({ + required this.formName, + required this.timestamp, + required this.typeIdentifier, + this.content, + this.id, + this.typeRevision, + }); + + factory TimeSeriesDataPointFormOutput.fromJson(Map json) { + return TimeSeriesDataPointFormOutput( + formName: json['formName'] as String, + timestamp: nonNullableTimeStampFromJson(json['timestamp'] as Object), + typeIdentifier: json['typeIdentifier'] as String, + content: json['content'] as String?, + id: json['id'] as String?, + typeRevision: json['typeRevision'] as String?, + ); + } + + Map toJson() { + final formName = this.formName; + final timestamp = this.timestamp; + final typeIdentifier = this.typeIdentifier; + final content = this.content; + final id = this.id; + final typeRevision = this.typeRevision; + return { + 'formName': formName, + 'timestamp': unixTimestampToJson(timestamp), + 'typeIdentifier': typeIdentifier, + if (content != null) 'content': content, + if (id != null) 'id': id, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + } +} + +/// The summary of the time series data points form. +class TimeSeriesDataPointSummaryFormOutput { + /// The name of the time series data points summary form. + final String formName; + + /// The timestamp of the time series data points summary form. + final DateTime timestamp; + + /// The type ID of the time series data points summary form. + final String typeIdentifier; + + /// The content of the summary of the time series data points form. + final String? contentSummary; + + /// The ID of the time series data points summary form. + final String? id; + + /// The type revision of the time series data points summary form. + final String? typeRevision; + + TimeSeriesDataPointSummaryFormOutput({ + required this.formName, + required this.timestamp, + required this.typeIdentifier, + this.contentSummary, + this.id, + this.typeRevision, + }); + + factory TimeSeriesDataPointSummaryFormOutput.fromJson( + Map json) { + return TimeSeriesDataPointSummaryFormOutput( + formName: json['formName'] as String, + timestamp: nonNullableTimeStampFromJson(json['timestamp'] as Object), + typeIdentifier: json['typeIdentifier'] as String, + contentSummary: json['contentSummary'] as String?, + id: json['id'] as String?, + typeRevision: json['typeRevision'] as String?, + ); + } + + Map toJson() { + final formName = this.formName; + final timestamp = this.timestamp; + final typeIdentifier = this.typeIdentifier; + final contentSummary = this.contentSummary; + final id = this.id; + final typeRevision = this.typeRevision; + return { + 'formName': formName, + 'timestamp': unixTimestampToJson(timestamp), + 'typeIdentifier': typeIdentifier, + if (contentSummary != null) 'contentSummary': contentSummary, + if (id != null) 'id': id, + if (typeRevision != null) 'typeRevision': typeRevision, + }; + } +} + +enum TimeSeriesEntityType { + asset, + listing, +} + +extension TimeSeriesEntityTypeValueExtension on TimeSeriesEntityType { + String toValue() { + switch (this) { + case TimeSeriesEntityType.asset: + return 'ASSET'; + case TimeSeriesEntityType.listing: + return 'LISTING'; + } + } +} + +extension TimeSeriesEntityTypeFromString on String { + TimeSeriesEntityType toTimeSeriesEntityType() { + switch (this) { + case 'ASSET': + return TimeSeriesEntityType.asset; + case 'LISTING': + return TimeSeriesEntityType.listing; + } + throw Exception('$this is not known in enum TimeSeriesEntityType'); + } +} + +enum Timezone { + utc, + africaJohannesburg, + americaMontreal, + americaSaoPaulo, + asiaBahrain, + asiaBangkok, + asiaCalcutta, + asiaDubai, + asiaHongKong, + asiaJakarta, + asiaKualaLumpur, + asiaSeoul, + asiaShanghai, + asiaSingapore, + asiaTaipei, + asiaTokyo, + australiaMelbourne, + australiaSydney, + canadaCentral, + cet, + cst6cdt, + etcGmt, + etcGmt0, + etcGmtAdd_0, + etcGmtAdd_1, + etcGmtAdd_10, + etcGmtAdd_11, + etcGmtAdd_12, + etcGmtAdd_2, + etcGmtAdd_3, + etcGmtAdd_4, + etcGmtAdd_5, + etcGmtAdd_6, + etcGmtAdd_7, + etcGmtAdd_8, + etcGmtAdd_9, + etcGmtNeg_0, + etcGmtNeg_1, + etcGmtNeg_10, + etcGmtNeg_11, + etcGmtNeg_12, + etcGmtNeg_13, + etcGmtNeg_14, + etcGmtNeg_2, + etcGmtNeg_3, + etcGmtNeg_4, + etcGmtNeg_5, + etcGmtNeg_6, + etcGmtNeg_7, + etcGmtNeg_8, + etcGmtNeg_9, + europeDublin, + europeLondon, + europeParis, + europeStockholm, + europeZurich, + israel, + mexicoGeneral, + mst7mdt, + pacificAuckland, + usCentral, + usEastern, + usMountain, + usPacific, +} + +extension TimezoneValueExtension on Timezone { + String toValue() { + switch (this) { + case Timezone.utc: + return 'UTC'; + case Timezone.africaJohannesburg: + return 'AFRICA_JOHANNESBURG'; + case Timezone.americaMontreal: + return 'AMERICA_MONTREAL'; + case Timezone.americaSaoPaulo: + return 'AMERICA_SAO_PAULO'; + case Timezone.asiaBahrain: + return 'ASIA_BAHRAIN'; + case Timezone.asiaBangkok: + return 'ASIA_BANGKOK'; + case Timezone.asiaCalcutta: + return 'ASIA_CALCUTTA'; + case Timezone.asiaDubai: + return 'ASIA_DUBAI'; + case Timezone.asiaHongKong: + return 'ASIA_HONG_KONG'; + case Timezone.asiaJakarta: + return 'ASIA_JAKARTA'; + case Timezone.asiaKualaLumpur: + return 'ASIA_KUALA_LUMPUR'; + case Timezone.asiaSeoul: + return 'ASIA_SEOUL'; + case Timezone.asiaShanghai: + return 'ASIA_SHANGHAI'; + case Timezone.asiaSingapore: + return 'ASIA_SINGAPORE'; + case Timezone.asiaTaipei: + return 'ASIA_TAIPEI'; + case Timezone.asiaTokyo: + return 'ASIA_TOKYO'; + case Timezone.australiaMelbourne: + return 'AUSTRALIA_MELBOURNE'; + case Timezone.australiaSydney: + return 'AUSTRALIA_SYDNEY'; + case Timezone.canadaCentral: + return 'CANADA_CENTRAL'; + case Timezone.cet: + return 'CET'; + case Timezone.cst6cdt: + return 'CST6CDT'; + case Timezone.etcGmt: + return 'ETC_GMT'; + case Timezone.etcGmt0: + return 'ETC_GMT0'; + case Timezone.etcGmtAdd_0: + return 'ETC_GMT_ADD_0'; + case Timezone.etcGmtAdd_1: + return 'ETC_GMT_ADD_1'; + case Timezone.etcGmtAdd_10: + return 'ETC_GMT_ADD_10'; + case Timezone.etcGmtAdd_11: + return 'ETC_GMT_ADD_11'; + case Timezone.etcGmtAdd_12: + return 'ETC_GMT_ADD_12'; + case Timezone.etcGmtAdd_2: + return 'ETC_GMT_ADD_2'; + case Timezone.etcGmtAdd_3: + return 'ETC_GMT_ADD_3'; + case Timezone.etcGmtAdd_4: + return 'ETC_GMT_ADD_4'; + case Timezone.etcGmtAdd_5: + return 'ETC_GMT_ADD_5'; + case Timezone.etcGmtAdd_6: + return 'ETC_GMT_ADD_6'; + case Timezone.etcGmtAdd_7: + return 'ETC_GMT_ADD_7'; + case Timezone.etcGmtAdd_8: + return 'ETC_GMT_ADD_8'; + case Timezone.etcGmtAdd_9: + return 'ETC_GMT_ADD_9'; + case Timezone.etcGmtNeg_0: + return 'ETC_GMT_NEG_0'; + case Timezone.etcGmtNeg_1: + return 'ETC_GMT_NEG_1'; + case Timezone.etcGmtNeg_10: + return 'ETC_GMT_NEG_10'; + case Timezone.etcGmtNeg_11: + return 'ETC_GMT_NEG_11'; + case Timezone.etcGmtNeg_12: + return 'ETC_GMT_NEG_12'; + case Timezone.etcGmtNeg_13: + return 'ETC_GMT_NEG_13'; + case Timezone.etcGmtNeg_14: + return 'ETC_GMT_NEG_14'; + case Timezone.etcGmtNeg_2: + return 'ETC_GMT_NEG_2'; + case Timezone.etcGmtNeg_3: + return 'ETC_GMT_NEG_3'; + case Timezone.etcGmtNeg_4: + return 'ETC_GMT_NEG_4'; + case Timezone.etcGmtNeg_5: + return 'ETC_GMT_NEG_5'; + case Timezone.etcGmtNeg_6: + return 'ETC_GMT_NEG_6'; + case Timezone.etcGmtNeg_7: + return 'ETC_GMT_NEG_7'; + case Timezone.etcGmtNeg_8: + return 'ETC_GMT_NEG_8'; + case Timezone.etcGmtNeg_9: + return 'ETC_GMT_NEG_9'; + case Timezone.europeDublin: + return 'EUROPE_DUBLIN'; + case Timezone.europeLondon: + return 'EUROPE_LONDON'; + case Timezone.europeParis: + return 'EUROPE_PARIS'; + case Timezone.europeStockholm: + return 'EUROPE_STOCKHOLM'; + case Timezone.europeZurich: + return 'EUROPE_ZURICH'; + case Timezone.israel: + return 'ISRAEL'; + case Timezone.mexicoGeneral: + return 'MEXICO_GENERAL'; + case Timezone.mst7mdt: + return 'MST7MDT'; + case Timezone.pacificAuckland: + return 'PACIFIC_AUCKLAND'; + case Timezone.usCentral: + return 'US_CENTRAL'; + case Timezone.usEastern: + return 'US_EASTERN'; + case Timezone.usMountain: + return 'US_MOUNTAIN'; + case Timezone.usPacific: + return 'US_PACIFIC'; + } + } +} + +extension TimezoneFromString on String { + Timezone toTimezone() { + switch (this) { + case 'UTC': + return Timezone.utc; + case 'AFRICA_JOHANNESBURG': + return Timezone.africaJohannesburg; + case 'AMERICA_MONTREAL': + return Timezone.americaMontreal; + case 'AMERICA_SAO_PAULO': + return Timezone.americaSaoPaulo; + case 'ASIA_BAHRAIN': + return Timezone.asiaBahrain; + case 'ASIA_BANGKOK': + return Timezone.asiaBangkok; + case 'ASIA_CALCUTTA': + return Timezone.asiaCalcutta; + case 'ASIA_DUBAI': + return Timezone.asiaDubai; + case 'ASIA_HONG_KONG': + return Timezone.asiaHongKong; + case 'ASIA_JAKARTA': + return Timezone.asiaJakarta; + case 'ASIA_KUALA_LUMPUR': + return Timezone.asiaKualaLumpur; + case 'ASIA_SEOUL': + return Timezone.asiaSeoul; + case 'ASIA_SHANGHAI': + return Timezone.asiaShanghai; + case 'ASIA_SINGAPORE': + return Timezone.asiaSingapore; + case 'ASIA_TAIPEI': + return Timezone.asiaTaipei; + case 'ASIA_TOKYO': + return Timezone.asiaTokyo; + case 'AUSTRALIA_MELBOURNE': + return Timezone.australiaMelbourne; + case 'AUSTRALIA_SYDNEY': + return Timezone.australiaSydney; + case 'CANADA_CENTRAL': + return Timezone.canadaCentral; + case 'CET': + return Timezone.cet; + case 'CST6CDT': + return Timezone.cst6cdt; + case 'ETC_GMT': + return Timezone.etcGmt; + case 'ETC_GMT0': + return Timezone.etcGmt0; + case 'ETC_GMT_ADD_0': + return Timezone.etcGmtAdd_0; + case 'ETC_GMT_ADD_1': + return Timezone.etcGmtAdd_1; + case 'ETC_GMT_ADD_10': + return Timezone.etcGmtAdd_10; + case 'ETC_GMT_ADD_11': + return Timezone.etcGmtAdd_11; + case 'ETC_GMT_ADD_12': + return Timezone.etcGmtAdd_12; + case 'ETC_GMT_ADD_2': + return Timezone.etcGmtAdd_2; + case 'ETC_GMT_ADD_3': + return Timezone.etcGmtAdd_3; + case 'ETC_GMT_ADD_4': + return Timezone.etcGmtAdd_4; + case 'ETC_GMT_ADD_5': + return Timezone.etcGmtAdd_5; + case 'ETC_GMT_ADD_6': + return Timezone.etcGmtAdd_6; + case 'ETC_GMT_ADD_7': + return Timezone.etcGmtAdd_7; + case 'ETC_GMT_ADD_8': + return Timezone.etcGmtAdd_8; + case 'ETC_GMT_ADD_9': + return Timezone.etcGmtAdd_9; + case 'ETC_GMT_NEG_0': + return Timezone.etcGmtNeg_0; + case 'ETC_GMT_NEG_1': + return Timezone.etcGmtNeg_1; + case 'ETC_GMT_NEG_10': + return Timezone.etcGmtNeg_10; + case 'ETC_GMT_NEG_11': + return Timezone.etcGmtNeg_11; + case 'ETC_GMT_NEG_12': + return Timezone.etcGmtNeg_12; + case 'ETC_GMT_NEG_13': + return Timezone.etcGmtNeg_13; + case 'ETC_GMT_NEG_14': + return Timezone.etcGmtNeg_14; + case 'ETC_GMT_NEG_2': + return Timezone.etcGmtNeg_2; + case 'ETC_GMT_NEG_3': + return Timezone.etcGmtNeg_3; + case 'ETC_GMT_NEG_4': + return Timezone.etcGmtNeg_4; + case 'ETC_GMT_NEG_5': + return Timezone.etcGmtNeg_5; + case 'ETC_GMT_NEG_6': + return Timezone.etcGmtNeg_6; + case 'ETC_GMT_NEG_7': + return Timezone.etcGmtNeg_7; + case 'ETC_GMT_NEG_8': + return Timezone.etcGmtNeg_8; + case 'ETC_GMT_NEG_9': + return Timezone.etcGmtNeg_9; + case 'EUROPE_DUBLIN': + return Timezone.europeDublin; + case 'EUROPE_LONDON': + return Timezone.europeLondon; + case 'EUROPE_PARIS': + return Timezone.europeParis; + case 'EUROPE_STOCKHOLM': + return Timezone.europeStockholm; + case 'EUROPE_ZURICH': + return Timezone.europeZurich; + case 'ISRAEL': + return Timezone.israel; + case 'MEXICO_GENERAL': + return Timezone.mexicoGeneral; + case 'MST7MDT': + return Timezone.mst7mdt; + case 'PACIFIC_AUCKLAND': + return Timezone.pacificAuckland; + case 'US_CENTRAL': + return Timezone.usCentral; + case 'US_EASTERN': + return Timezone.usEastern; + case 'US_MOUNTAIN': + return Timezone.usMountain; + case 'US_PACIFIC': + return Timezone.usPacific; + } + throw Exception('$this is not known in enum Timezone'); + } +} + +/// The topic of the notification. +class Topic { + final NotificationResource resource; + + /// The role of the resource mentioned in a notification. + final NotificationRole role; + + /// The subject of the resource mentioned in a notification. + final String subject; + + Topic({ + required this.resource, + required this.role, + required this.subject, + }); + + factory Topic.fromJson(Map json) { + return Topic( + resource: NotificationResource.fromJson( + json['resource'] as Map), + role: (json['role'] as String).toNotificationRole(), + subject: json['subject'] as String, + ); + } + + Map toJson() { + final resource = this.resource; + final role = this.role; + final subject = this.subject; + return { + 'resource': resource, + 'role': role.toValue(), + 'subject': subject, + }; + } +} + +enum TypesSearchScope { + assetType, + formType, +} + +extension TypesSearchScopeValueExtension on TypesSearchScope { + String toValue() { + switch (this) { + case TypesSearchScope.assetType: + return 'ASSET_TYPE'; + case TypesSearchScope.formType: + return 'FORM_TYPE'; + } + } +} + +extension TypesSearchScopeFromString on String { + TypesSearchScope toTypesSearchScope() { + switch (this) { + case 'ASSET_TYPE': + return TypesSearchScope.assetType; + case 'FORM_TYPE': + return TypesSearchScope.formType; + } + throw Exception('$this is not known in enum TypesSearchScope'); + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateDataSourceOutput { + /// The identifier of the Amazon DataZone domain in which a data source is to be + /// updated. + final String domainId; + + /// The identifier of the environment in which a data source is to be updated. + final String environmentId; + + /// The identifier of the data source to be updated. + final String id; + + /// The name to be updated as part of the UpdateDataSource action. + final String name; + + /// The identifier of the project where data source is to be updated. + final String projectId; + + /// The asset forms to be updated as part of the UpdateDataSource + /// action. + final List? assetFormsOutput; + + /// The configuration to be updated as part of the UpdateDataSource + /// action. + final DataSourceConfigurationOutput? configuration; + + /// The timestamp of when the data source was updated. + final DateTime? createdAt; + + /// The description to be updated as part of the UpdateDataSource + /// action. + final String? description; + + /// The enable setting to be updated as part of the + /// UpdateDataSource action. + final EnableSetting? enableSetting; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final DataSourceErrorMessage? errorMessage; + + /// The timestamp of when the data source was last run. + final DateTime? lastRunAt; + + /// The last run error message of the data source. + final DataSourceErrorMessage? lastRunErrorMessage; + + /// The last run status of the data source. + final DataSourceRunStatus? lastRunStatus; + + /// The publish on import setting to be updated as part of the + /// UpdateDataSource action. + final bool? publishOnImport; + + /// The recommendation to be updated as part of the + /// UpdateDataSource action. + final RecommendationConfiguration? recommendation; + + /// The schedule to be updated as part of the UpdateDataSource + /// action. + final ScheduleConfiguration? schedule; + + /// The status to be updated as part of the UpdateDataSource + /// action. + final DataSourceStatus? status; + + /// The type to be updated as part of the UpdateDataSource action. + final String? type; + + /// The timestamp of when the data source was updated. + final DateTime? updatedAt; + + UpdateDataSourceOutput({ + required this.domainId, + required this.environmentId, + required this.id, + required this.name, + required this.projectId, + this.assetFormsOutput, + this.configuration, + this.createdAt, + this.description, + this.enableSetting, + this.errorMessage, + this.lastRunAt, + this.lastRunErrorMessage, + this.lastRunStatus, + this.publishOnImport, + this.recommendation, + this.schedule, + this.status, + this.type, + this.updatedAt, + }); + + factory UpdateDataSourceOutput.fromJson(Map json) { + return UpdateDataSourceOutput( + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + assetFormsOutput: (json['assetFormsOutput'] as List?) + ?.whereNotNull() + .map((e) => FormOutput.fromJson(e as Map)) + .toList(), + configuration: json['configuration'] != null + ? DataSourceConfigurationOutput.fromJson( + json['configuration'] as Map) + : null, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + enableSetting: (json['enableSetting'] as String?)?.toEnableSetting(), + errorMessage: json['errorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['errorMessage'] as Map) + : null, + lastRunAt: timeStampFromJson(json['lastRunAt']), + lastRunErrorMessage: json['lastRunErrorMessage'] != null + ? DataSourceErrorMessage.fromJson( + json['lastRunErrorMessage'] as Map) + : null, + lastRunStatus: + (json['lastRunStatus'] as String?)?.toDataSourceRunStatus(), + publishOnImport: json['publishOnImport'] as bool?, + recommendation: json['recommendation'] != null + ? RecommendationConfiguration.fromJson( + json['recommendation'] as Map) + : null, + schedule: json['schedule'] != null + ? ScheduleConfiguration.fromJson( + json['schedule'] as Map) + : null, + status: (json['status'] as String?)?.toDataSourceStatus(), + type: json['type'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + ); + } + + Map toJson() { + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final name = this.name; + final projectId = this.projectId; + final assetFormsOutput = this.assetFormsOutput; + final configuration = this.configuration; + final createdAt = this.createdAt; + final description = this.description; + final enableSetting = this.enableSetting; + final errorMessage = this.errorMessage; + final lastRunAt = this.lastRunAt; + final lastRunErrorMessage = this.lastRunErrorMessage; + final lastRunStatus = this.lastRunStatus; + final publishOnImport = this.publishOnImport; + final recommendation = this.recommendation; + final schedule = this.schedule; + final status = this.status; + final type = this.type; + final updatedAt = this.updatedAt; + return { + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'name': name, + 'projectId': projectId, + if (assetFormsOutput != null) 'assetFormsOutput': assetFormsOutput, + if (configuration != null) 'configuration': configuration, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (enableSetting != null) 'enableSetting': enableSetting.toValue(), + if (errorMessage != null) 'errorMessage': errorMessage, + if (lastRunAt != null) 'lastRunAt': iso8601ToJson(lastRunAt), + if (lastRunErrorMessage != null) + 'lastRunErrorMessage': lastRunErrorMessage, + if (lastRunStatus != null) 'lastRunStatus': lastRunStatus.toValue(), + if (publishOnImport != null) 'publishOnImport': publishOnImport, + if (recommendation != null) 'recommendation': recommendation, + if (schedule != null) 'schedule': schedule, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +class UpdateDomainOutput { + /// The identifier of the Amazon DataZone domain. + final String id; + + /// The description to be updated as part of the UpdateDomain + /// action. + final String? description; + + /// The domain execution role to be updated as part of the + /// UpdateDomain action. + final String? domainExecutionRole; + + /// Specifies the timestamp of when the domain was last updated. + final DateTime? lastUpdatedAt; + + /// The name to be updated as part of the UpdateDomain action. + final String? name; + + /// The single sign-on option of the Amazon DataZone domain. + final SingleSignOn? singleSignOn; + + UpdateDomainOutput({ + required this.id, + this.description, + this.domainExecutionRole, + this.lastUpdatedAt, + this.name, + this.singleSignOn, + }); + + factory UpdateDomainOutput.fromJson(Map json) { + return UpdateDomainOutput( + id: json['id'] as String, + description: json['description'] as String?, + domainExecutionRole: json['domainExecutionRole'] as String?, + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + name: json['name'] as String?, + singleSignOn: json['singleSignOn'] != null + ? SingleSignOn.fromJson(json['singleSignOn'] as Map) + : null, + ); + } + + Map toJson() { + final id = this.id; + final description = this.description; + final domainExecutionRole = this.domainExecutionRole; + final lastUpdatedAt = this.lastUpdatedAt; + final name = this.name; + final singleSignOn = this.singleSignOn; + return { + 'id': id, + if (description != null) 'description': description, + if (domainExecutionRole != null) + 'domainExecutionRole': domainExecutionRole, + if (lastUpdatedAt != null) + 'lastUpdatedAt': unixTimestampToJson(lastUpdatedAt), + if (name != null) 'name': name, + if (singleSignOn != null) 'singleSignOn': singleSignOn, + }; + } +} + +class UpdateEnvironmentOutput { + /// The Amazon DataZone user who created the environment. + final String createdBy; + + /// The identifier of the domain in which the environment is to be updated. + final String domainId; + + /// The profile identifier of the environment. + final String environmentProfileId; + + /// The name to be updated as part of the UpdateEnvironment action. + final String name; + + /// The project identifier of the environment. + final String projectId; + + /// The provider identifier of the environment. + final String provider; + + /// The identifier of the Amazon Web Services account in which the environment + /// is to be updated. + final String? awsAccountId; + + /// The Amazon Web Services Region in which the environment is updated. + final String? awsAccountRegion; + + /// The timestamp of when the environment was created. + final DateTime? createdAt; + + /// The deployment properties to be updated as part of the + /// UpdateEnvironment action. + final DeploymentProperties? deploymentProperties; + + /// The description to be updated as part of the UpdateEnvironment + /// action. + final String? description; + + /// The environment actions to be updated as part of the + /// UpdateEnvironment action. + final List? environmentActions; + + /// The blueprint identifier of the environment. + final String? environmentBlueprintId; + + /// The glossary terms to be updated as part of the + /// UpdateEnvironment action. + final List? glossaryTerms; + + /// The identifier of the environment that is to be updated. + final String? id; + + /// The last deployment of the environment. + final Deployment? lastDeployment; + + /// The provisioned resources to be updated as part of the + /// UpdateEnvironment action. + final List? provisionedResources; + + /// The provisioning properties to be updated as part of the + /// UpdateEnvironment action. + final ProvisioningProperties? provisioningProperties; + + /// The status to be updated as part of the UpdateEnvironment + /// action. + final EnvironmentStatus? status; + + /// The timestamp of when the environment was updated. + final DateTime? updatedAt; + + /// The user parameters to be updated as part of the + /// UpdateEnvironment action. + final List? userParameters; + + UpdateEnvironmentOutput({ + required this.createdBy, + required this.domainId, + required this.environmentProfileId, + required this.name, + required this.projectId, + required this.provider, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.deploymentProperties, + this.description, + this.environmentActions, + this.environmentBlueprintId, + this.glossaryTerms, + this.id, + this.lastDeployment, + this.provisionedResources, + this.provisioningProperties, + this.status, + this.updatedAt, + this.userParameters, + }); + + factory UpdateEnvironmentOutput.fromJson(Map json) { + return UpdateEnvironmentOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentProfileId: json['environmentProfileId'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + deploymentProperties: json['deploymentProperties'] != null + ? DeploymentProperties.fromJson( + json['deploymentProperties'] as Map) + : null, + description: json['description'] as String?, + environmentActions: (json['environmentActions'] as List?) + ?.whereNotNull() + .map((e) => + ConfigurableEnvironmentAction.fromJson(e as Map)) + .toList(), + environmentBlueprintId: json['environmentBlueprintId'] as String?, + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + id: json['id'] as String?, + lastDeployment: json['lastDeployment'] != null + ? Deployment.fromJson(json['lastDeployment'] as Map) + : null, + provisionedResources: (json['provisionedResources'] as List?) + ?.whereNotNull() + .map((e) => Resource.fromJson(e as Map)) + .toList(), + provisioningProperties: json['provisioningProperties'] != null + ? ProvisioningProperties.fromJson( + json['provisioningProperties'] as Map) + : null, + status: (json['status'] as String?)?.toEnvironmentStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentProfileId = this.environmentProfileId; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final deploymentProperties = this.deploymentProperties; + final description = this.description; + final environmentActions = this.environmentActions; + final environmentBlueprintId = this.environmentBlueprintId; + final glossaryTerms = this.glossaryTerms; + final id = this.id; + final lastDeployment = this.lastDeployment; + final provisionedResources = this.provisionedResources; + final provisioningProperties = this.provisioningProperties; + final status = this.status; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentProfileId': environmentProfileId, + 'name': name, + 'projectId': projectId, + 'provider': provider, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (deploymentProperties != null) + 'deploymentProperties': deploymentProperties, + if (description != null) 'description': description, + if (environmentActions != null) 'environmentActions': environmentActions, + if (environmentBlueprintId != null) + 'environmentBlueprintId': environmentBlueprintId, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (id != null) 'id': id, + if (lastDeployment != null) 'lastDeployment': lastDeployment, + if (provisionedResources != null) + 'provisionedResources': provisionedResources, + if (provisioningProperties != null) + 'provisioningProperties': provisioningProperties, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class UpdateEnvironmentProfileOutput { + /// The Amazon DataZone user who created the environment profile. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which the environment + /// profile is to be updated. + final String domainId; + + /// The identifier of the blueprint of the environment profile that is to be + /// updated. + final String environmentBlueprintId; + + /// The identifier of the environment profile that is to be udpated. + final String id; + + /// The name to be updated as part of the UpdateEnvironmentProfile + /// action. + final String name; + + /// The Amazon Web Services account in which a specified environment profile is + /// to be udpated. + final String? awsAccountId; + + /// The Amazon Web Services Region in which a specified environment profile is + /// to be updated. + final String? awsAccountRegion; + + /// The timestamp of when the environment profile was created. + final DateTime? createdAt; + + /// The description to be updated as part of the + /// UpdateEnvironmentProfile action. + final String? description; + + /// The identifier of the project of the environment profile that is to be + /// updated. + final String? projectId; + + /// The timestamp of when the environment profile was updated. + final DateTime? updatedAt; + + /// The user parameters to be updated as part of the + /// UpdateEnvironmentProfile action. + final List? userParameters; + + UpdateEnvironmentProfileOutput({ + required this.createdBy, + required this.domainId, + required this.environmentBlueprintId, + required this.id, + required this.name, + this.awsAccountId, + this.awsAccountRegion, + this.createdAt, + this.description, + this.projectId, + this.updatedAt, + this.userParameters, + }); + + factory UpdateEnvironmentProfileOutput.fromJson(Map json) { + return UpdateEnvironmentProfileOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentBlueprintId: json['environmentBlueprintId'] as String, + id: json['id'] as String, + name: json['name'] as String, + awsAccountId: json['awsAccountId'] as String?, + awsAccountRegion: json['awsAccountRegion'] as String?, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + projectId: json['projectId'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + userParameters: (json['userParameters'] as List?) + ?.whereNotNull() + .map((e) => CustomParameter.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentBlueprintId = this.environmentBlueprintId; + final id = this.id; + final name = this.name; + final awsAccountId = this.awsAccountId; + final awsAccountRegion = this.awsAccountRegion; + final createdAt = this.createdAt; + final description = this.description; + final projectId = this.projectId; + final updatedAt = this.updatedAt; + final userParameters = this.userParameters; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentBlueprintId': environmentBlueprintId, + 'id': id, + 'name': name, + if (awsAccountId != null) 'awsAccountId': awsAccountId, + if (awsAccountRegion != null) 'awsAccountRegion': awsAccountRegion, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (projectId != null) 'projectId': projectId, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (userParameters != null) 'userParameters': userParameters, + }; + } +} + +class UpdateGlossaryOutput { + /// The identifier of the Amazon DataZone domain in which a business glossary is + /// to be updated. + final String domainId; + + /// The identifier of the business glossary that is to be updated. + final String id; + + /// The name to be updated as part of the UpdateGlossary action. + final String name; + + /// The identifier of the project in which to update a business glossary. + final String owningProjectId; + + /// The description to be updated as part of the UpdateGlossary + /// action. + final String? description; + + /// The status to be updated as part of the UpdateGlossary action. + final GlossaryStatus? status; + + UpdateGlossaryOutput({ + required this.domainId, + required this.id, + required this.name, + required this.owningProjectId, + this.description, + this.status, + }); + + factory UpdateGlossaryOutput.fromJson(Map json) { + return UpdateGlossaryOutput( + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + owningProjectId: json['owningProjectId'] as String, + description: json['description'] as String?, + status: (json['status'] as String?)?.toGlossaryStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final owningProjectId = this.owningProjectId; + final description = this.description; + final status = this.status; + return { + 'domainId': domainId, + 'id': id, + 'name': name, + 'owningProjectId': owningProjectId, + if (description != null) 'description': description, + if (status != null) 'status': status.toValue(), + }; + } +} + +class UpdateGlossaryTermOutput { + /// The identifier of the Amazon DataZone domain in which a business glossary + /// term is to be updated. + final String domainId; + + /// The identifier of the business glossary in which a term is to be updated. + final String glossaryId; + + /// The identifier of the business glossary term that is to be updated. + final String id; + + /// The name to be updated as part of the UpdateGlossaryTerm + /// action. + final String name; + + /// The status to be updated as part of the UpdateGlossaryTerm + /// action. + final GlossaryTermStatus status; + + /// The long description to be updated as part of the + /// UpdateGlossaryTerm action. + final String? longDescription; + + /// The short description to be updated as part of the + /// UpdateGlossaryTerm action. + final String? shortDescription; + + /// The term relations to be updated as part of the + /// UpdateGlossaryTerm action. + final TermRelations? termRelations; + + UpdateGlossaryTermOutput({ + required this.domainId, + required this.glossaryId, + required this.id, + required this.name, + required this.status, + this.longDescription, + this.shortDescription, + this.termRelations, + }); + + factory UpdateGlossaryTermOutput.fromJson(Map json) { + return UpdateGlossaryTermOutput( + domainId: json['domainId'] as String, + glossaryId: json['glossaryId'] as String, + id: json['id'] as String, + name: json['name'] as String, + status: (json['status'] as String).toGlossaryTermStatus(), + longDescription: json['longDescription'] as String?, + shortDescription: json['shortDescription'] as String?, + termRelations: json['termRelations'] != null + ? TermRelations.fromJson( + json['termRelations'] as Map) + : null, + ); + } + + Map toJson() { + final domainId = this.domainId; + final glossaryId = this.glossaryId; + final id = this.id; + final name = this.name; + final status = this.status; + final longDescription = this.longDescription; + final shortDescription = this.shortDescription; + final termRelations = this.termRelations; + return { + 'domainId': domainId, + 'glossaryId': glossaryId, + 'id': id, + 'name': name, + 'status': status.toValue(), + if (longDescription != null) 'longDescription': longDescription, + if (shortDescription != null) 'shortDescription': shortDescription, + if (termRelations != null) 'termRelations': termRelations, + }; + } +} + +class UpdateGroupProfileOutput { + /// The identifier of the Amazon DataZone domain in which a group profile is + /// updated. + final String? domainId; + + /// The name of the group profile that is updated. + final String? groupName; + + /// The identifier of the group profile that is updated. + final String? id; + + /// The status of the group profile that is updated. + final GroupProfileStatus? status; + + UpdateGroupProfileOutput({ + this.domainId, + this.groupName, + this.id, + this.status, + }); + + factory UpdateGroupProfileOutput.fromJson(Map json) { + return UpdateGroupProfileOutput( + domainId: json['domainId'] as String?, + groupName: json['groupName'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toGroupProfileStatus(), + ); + } + + Map toJson() { + final domainId = this.domainId; + final groupName = this.groupName; + final id = this.id; + final status = this.status; + return { + if (domainId != null) 'domainId': domainId, + if (groupName != null) 'groupName': groupName, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + }; + } +} + +class UpdateProjectOutput { + /// The Amazon DataZone user who created the project. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a project is updated. + final String domainId; + + /// The identifier of the project that is to be updated. + final String id; + + /// The name of the project that is to be updated. + final String name; + + /// The timestamp of when the project was created. + final DateTime? createdAt; + + /// The description of the project that is to be updated. + final String? description; + + /// Specifies the error message that is returned if the operation cannot be + /// successfully completed. + final List? failureReasons; + + /// The glossary terms of the project that are to be updated. + final List? glossaryTerms; + + /// The timestamp of when the project was last updated. + final DateTime? lastUpdatedAt; + + /// The status of the project. + final ProjectStatus? projectStatus; + + UpdateProjectOutput({ + required this.createdBy, + required this.domainId, + required this.id, + required this.name, + this.createdAt, + this.description, + this.failureReasons, + this.glossaryTerms, + this.lastUpdatedAt, + this.projectStatus, + }); + + factory UpdateProjectOutput.fromJson(Map json) { + return UpdateProjectOutput( + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + name: json['name'] as String, + createdAt: timeStampFromJson(json['createdAt']), + description: json['description'] as String?, + failureReasons: (json['failureReasons'] as List?) + ?.whereNotNull() + .map((e) => ProjectDeletionError.fromJson(e as Map)) + .toList(), + glossaryTerms: (json['glossaryTerms'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']), + projectStatus: (json['projectStatus'] as String?)?.toProjectStatus(), + ); + } + + Map toJson() { + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final name = this.name; + final createdAt = this.createdAt; + final description = this.description; + final failureReasons = this.failureReasons; + final glossaryTerms = this.glossaryTerms; + final lastUpdatedAt = this.lastUpdatedAt; + final projectStatus = this.projectStatus; + return { + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'name': name, + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (description != null) 'description': description, + if (failureReasons != null) 'failureReasons': failureReasons, + if (glossaryTerms != null) 'glossaryTerms': glossaryTerms, + if (lastUpdatedAt != null) 'lastUpdatedAt': iso8601ToJson(lastUpdatedAt), + if (projectStatus != null) 'projectStatus': projectStatus.toValue(), + }; + } +} + +class UpdateSubscriptionGrantStatusOutput { + /// The timestamp of when the subscription grant status was created. + final DateTime createdAt; + + /// The Amazon DataZone domain user who created the subscription grant status. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription grant + /// status is to be updated. + final String domainId; + + /// The granted entity to be updated as part of the + /// UpdateSubscriptionGrantStatus action. + final GrantedEntity grantedEntity; + + /// The identifier of the subscription grant. + final String id; + + /// The status to be updated as part of the + /// UpdateSubscriptionGrantStatus action. + final SubscriptionGrantOverallStatus status; + + /// The identifier of the subscription target whose subscription grant status is + /// to be updated. + final String subscriptionTargetId; + + /// The timestamp of when the subscription grant status is to be updated. + final DateTime updatedAt; + + /// The details of the asset for which the subscription grant is created. + final List? assets; + + /// The identifier of the subscription. + final String? subscriptionId; + + /// The Amazon DataZone user who updated the subscription grant status. + final String? updatedBy; + + UpdateSubscriptionGrantStatusOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.grantedEntity, + required this.id, + required this.status, + required this.subscriptionTargetId, + required this.updatedAt, + this.assets, + this.subscriptionId, + this.updatedBy, + }); + + factory UpdateSubscriptionGrantStatusOutput.fromJson( + Map json) { + return UpdateSubscriptionGrantStatusOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + grantedEntity: + GrantedEntity.fromJson(json['grantedEntity'] as Map), + id: json['id'] as String, + status: (json['status'] as String).toSubscriptionGrantOverallStatus(), + subscriptionTargetId: json['subscriptionTargetId'] as String, + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + assets: (json['assets'] as List?) + ?.whereNotNull() + .map((e) => SubscribedAsset.fromJson(e as Map)) + .toList(), + subscriptionId: json['subscriptionId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final grantedEntity = this.grantedEntity; + final id = this.id; + final status = this.status; + final subscriptionTargetId = this.subscriptionTargetId; + final updatedAt = this.updatedAt; + final assets = this.assets; + final subscriptionId = this.subscriptionId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'grantedEntity': grantedEntity, + 'id': id, + 'status': status.toValue(), + 'subscriptionTargetId': subscriptionTargetId, + 'updatedAt': unixTimestampToJson(updatedAt), + if (assets != null) 'assets': assets, + if (subscriptionId != null) 'subscriptionId': subscriptionId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class UpdateSubscriptionRequestOutput { + /// The timestamp of when the subscription request was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription request. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription request + /// is to be updated. + final String domainId; + + /// The identifier of the subscription request that is to be updated. + final String id; + + /// The reason for the UpdateSubscriptionRequest action. + final String requestReason; + + /// The status of the subscription request. + final SubscriptionRequestStatus status; + + /// The subscribed listings of the subscription request. + final List subscribedListings; + + /// The subscribed principals of the subscription request. + final List subscribedPrincipals; + + /// The timestamp of when the subscription request was updated. + final DateTime updatedAt; + + /// The decision comment of the UpdateSubscriptionRequest action. + final String? decisionComment; + + /// The identifier of the Amazon DataZone user who reviews the subscription + /// request. + final String? reviewerId; + + /// The Amazon DataZone user who updated the subscription request. + final String? updatedBy; + + UpdateSubscriptionRequestOutput({ + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.id, + required this.requestReason, + required this.status, + required this.subscribedListings, + required this.subscribedPrincipals, + required this.updatedAt, + this.decisionComment, + this.reviewerId, + this.updatedBy, + }); + + factory UpdateSubscriptionRequestOutput.fromJson(Map json) { + return UpdateSubscriptionRequestOutput( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + id: json['id'] as String, + requestReason: json['requestReason'] as String, + status: (json['status'] as String).toSubscriptionRequestStatus(), + subscribedListings: (json['subscribedListings'] as List) + .whereNotNull() + .map((e) => SubscribedListing.fromJson(e as Map)) + .toList(), + subscribedPrincipals: (json['subscribedPrincipals'] as List) + .whereNotNull() + .map((e) => SubscribedPrincipal.fromJson(e as Map)) + .toList(), + updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object), + decisionComment: json['decisionComment'] as String?, + reviewerId: json['reviewerId'] as String?, + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final id = this.id; + final requestReason = this.requestReason; + final status = this.status; + final subscribedListings = this.subscribedListings; + final subscribedPrincipals = this.subscribedPrincipals; + final updatedAt = this.updatedAt; + final decisionComment = this.decisionComment; + final reviewerId = this.reviewerId; + final updatedBy = this.updatedBy; + return { + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'id': id, + 'requestReason': requestReason, + 'status': status.toValue(), + 'subscribedListings': subscribedListings, + 'subscribedPrincipals': subscribedPrincipals, + 'updatedAt': unixTimestampToJson(updatedAt), + if (decisionComment != null) 'decisionComment': decisionComment, + if (reviewerId != null) 'reviewerId': reviewerId, + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class UpdateSubscriptionTargetOutput { + /// The applicable asset types to be updated as part of the + /// UpdateSubscriptionTarget action. + final List applicableAssetTypes; + + /// The authorized principals to be updated as part of the + /// UpdateSubscriptionTarget action. + final List authorizedPrincipals; + + /// The timestamp of when a subscription target was created. + final DateTime createdAt; + + /// The Amazon DataZone user who created the subscription target. + final String createdBy; + + /// The identifier of the Amazon DataZone domain in which a subscription target + /// is to be updated. + final String domainId; + + /// The identifier of the environment in which a subscription target is to be + /// updated. + final String environmentId; + + /// Identifier of the subscription target that is to be updated. + final String id; + + /// The manage access role to be updated as part of the + /// UpdateSubscriptionTarget action. + final String manageAccessRole; + + /// The name to be updated as part of the UpdateSubscriptionTarget + /// action. + final String name; + + /// The identifier of the project in which a subscription target is to be + /// updated. + final String projectId; + + /// The provider to be updated as part of the + /// UpdateSubscriptionTarget action. + final String provider; + + /// The configuration to be updated as part of the + /// UpdateSubscriptionTarget action. + final List subscriptionTargetConfig; + + /// The type to be updated as part of the UpdateSubscriptionTarget + /// action. + final String type; + + /// The timestamp of when the subscription target was updated. + final DateTime? updatedAt; + + /// The Amazon DataZone user who updated the subscription target. + final String? updatedBy; + + UpdateSubscriptionTargetOutput({ + required this.applicableAssetTypes, + required this.authorizedPrincipals, + required this.createdAt, + required this.createdBy, + required this.domainId, + required this.environmentId, + required this.id, + required this.manageAccessRole, + required this.name, + required this.projectId, + required this.provider, + required this.subscriptionTargetConfig, + required this.type, + this.updatedAt, + this.updatedBy, + }); + + factory UpdateSubscriptionTargetOutput.fromJson(Map json) { + return UpdateSubscriptionTargetOutput( + applicableAssetTypes: (json['applicableAssetTypes'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + authorizedPrincipals: (json['authorizedPrincipals'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + domainId: json['domainId'] as String, + environmentId: json['environmentId'] as String, + id: json['id'] as String, + manageAccessRole: json['manageAccessRole'] as String, + name: json['name'] as String, + projectId: json['projectId'] as String, + provider: json['provider'] as String, + subscriptionTargetConfig: (json['subscriptionTargetConfig'] as List) + .whereNotNull() + .map( + (e) => SubscriptionTargetForm.fromJson(e as Map)) + .toList(), + type: json['type'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final applicableAssetTypes = this.applicableAssetTypes; + final authorizedPrincipals = this.authorizedPrincipals; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final domainId = this.domainId; + final environmentId = this.environmentId; + final id = this.id; + final manageAccessRole = this.manageAccessRole; + final name = this.name; + final projectId = this.projectId; + final provider = this.provider; + final subscriptionTargetConfig = this.subscriptionTargetConfig; + final type = this.type; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'applicableAssetTypes': applicableAssetTypes, + 'authorizedPrincipals': authorizedPrincipals, + 'createdAt': unixTimestampToJson(createdAt), + 'createdBy': createdBy, + 'domainId': domainId, + 'environmentId': environmentId, + 'id': id, + 'manageAccessRole': manageAccessRole, + 'name': name, + 'projectId': projectId, + 'provider': provider, + 'subscriptionTargetConfig': subscriptionTargetConfig, + 'type': type, + if (updatedAt != null) 'updatedAt': unixTimestampToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class UpdateUserProfileOutput { + final UserProfileDetails? details; + + /// The identifier of the Amazon DataZone domain in which a user profile is + /// updated. + final String? domainId; + + /// The identifier of the user profile. + final String? id; + + /// The status of the user profile. + final UserProfileStatus? status; + + /// The type of the user profile. + final UserProfileType? type; + + UpdateUserProfileOutput({ + this.details, + this.domainId, + this.id, + this.status, + this.type, + }); + + factory UpdateUserProfileOutput.fromJson(Map json) { + return UpdateUserProfileOutput( + details: json['details'] != null + ? UserProfileDetails.fromJson(json['details'] as Map) + : null, + domainId: json['domainId'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toUserProfileStatus(), + type: (json['type'] as String?)?.toUserProfileType(), + ); + } + + Map toJson() { + final details = this.details; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final type = this.type; + return { + if (details != null) 'details': details, + if (domainId != null) 'domainId': domainId, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +enum UserAssignment { + automatic, + manual, +} + +extension UserAssignmentValueExtension on UserAssignment { + String toValue() { + switch (this) { + case UserAssignment.automatic: + return 'AUTOMATIC'; + case UserAssignment.manual: + return 'MANUAL'; + } + } +} + +extension UserAssignmentFromString on String { + UserAssignment toUserAssignment() { + switch (this) { + case 'AUTOMATIC': + return UserAssignment.automatic; + case 'MANUAL': + return UserAssignment.manual; + } + throw Exception('$this is not known in enum UserAssignment'); + } +} + +enum UserDesignation { + projectOwner, + projectContributor, +} + +extension UserDesignationValueExtension on UserDesignation { + String toValue() { + switch (this) { + case UserDesignation.projectOwner: + return 'PROJECT_OWNER'; + case UserDesignation.projectContributor: + return 'PROJECT_CONTRIBUTOR'; + } + } +} + +extension UserDesignationFromString on String { + UserDesignation toUserDesignation() { + switch (this) { + case 'PROJECT_OWNER': + return UserDesignation.projectOwner; + case 'PROJECT_CONTRIBUTOR': + return UserDesignation.projectContributor; + } + throw Exception('$this is not known in enum UserDesignation'); + } +} + +/// The user details of a project member. +class UserDetails { + /// The identifier of the Amazon DataZone user. + final String userId; + + UserDetails({ + required this.userId, + }); + + factory UserDetails.fromJson(Map json) { + return UserDetails( + userId: json['userId'] as String, + ); + } + + Map toJson() { + final userId = this.userId; + return { + 'userId': userId, + }; + } +} + +/// The details of the user profile in Amazon DataZone. +class UserProfileDetails { + /// The IAM details included in the user profile details. + final IamUserProfileDetails? iam; + + /// The single sign-on details included in the user profile details. + final SsoUserProfileDetails? sso; + + UserProfileDetails({ + this.iam, + this.sso, + }); + + factory UserProfileDetails.fromJson(Map json) { + return UserProfileDetails( + iam: json['iam'] != null + ? IamUserProfileDetails.fromJson(json['iam'] as Map) + : null, + sso: json['sso'] != null + ? SsoUserProfileDetails.fromJson(json['sso'] as Map) + : null, + ); + } + + Map toJson() { + final iam = this.iam; + final sso = this.sso; + return { + if (iam != null) 'iam': iam, + if (sso != null) 'sso': sso, + }; + } +} + +enum UserProfileStatus { + assigned, + notAssigned, + activated, + deactivated, +} + +extension UserProfileStatusValueExtension on UserProfileStatus { + String toValue() { + switch (this) { + case UserProfileStatus.assigned: + return 'ASSIGNED'; + case UserProfileStatus.notAssigned: + return 'NOT_ASSIGNED'; + case UserProfileStatus.activated: + return 'ACTIVATED'; + case UserProfileStatus.deactivated: + return 'DEACTIVATED'; + } + } +} + +extension UserProfileStatusFromString on String { + UserProfileStatus toUserProfileStatus() { + switch (this) { + case 'ASSIGNED': + return UserProfileStatus.assigned; + case 'NOT_ASSIGNED': + return UserProfileStatus.notAssigned; + case 'ACTIVATED': + return UserProfileStatus.activated; + case 'DEACTIVATED': + return UserProfileStatus.deactivated; + } + throw Exception('$this is not known in enum UserProfileStatus'); + } +} + +/// The details of the user profile. +class UserProfileSummary { + /// The details of the user profile. + final UserProfileDetails? details; + + /// The ID of the Amazon DataZone domain of the user profile. + final String? domainId; + + /// The ID of the user profile. + final String? id; + + /// The status of the user profile. + final UserProfileStatus? status; + + /// The type of the user profile. + final UserProfileType? type; + + UserProfileSummary({ + this.details, + this.domainId, + this.id, + this.status, + this.type, + }); + + factory UserProfileSummary.fromJson(Map json) { + return UserProfileSummary( + details: json['details'] != null + ? UserProfileDetails.fromJson(json['details'] as Map) + : null, + domainId: json['domainId'] as String?, + id: json['id'] as String?, + status: (json['status'] as String?)?.toUserProfileStatus(), + type: (json['type'] as String?)?.toUserProfileType(), + ); + } + + Map toJson() { + final details = this.details; + final domainId = this.domainId; + final id = this.id; + final status = this.status; + final type = this.type; + return { + if (details != null) 'details': details, + if (domainId != null) 'domainId': domainId, + if (id != null) 'id': id, + if (status != null) 'status': status.toValue(), + if (type != null) 'type': type.toValue(), + }; + } +} + +enum UserProfileType { + iam, + sso, +} + +extension UserProfileTypeValueExtension on UserProfileType { + String toValue() { + switch (this) { + case UserProfileType.iam: + return 'IAM'; + case UserProfileType.sso: + return 'SSO'; + } + } +} + +extension UserProfileTypeFromString on String { + UserProfileType toUserProfileType() { + switch (this) { + case 'IAM': + return UserProfileType.iam; + case 'SSO': + return UserProfileType.sso; + } + throw Exception('$this is not known in enum UserProfileType'); + } +} + +enum UserSearchType { + ssoUser, + datazoneUser, + datazoneSsoUser, + datazoneIamUser, +} + +extension UserSearchTypeValueExtension on UserSearchType { + String toValue() { + switch (this) { + case UserSearchType.ssoUser: + return 'SSO_USER'; + case UserSearchType.datazoneUser: + return 'DATAZONE_USER'; + case UserSearchType.datazoneSsoUser: + return 'DATAZONE_SSO_USER'; + case UserSearchType.datazoneIamUser: + return 'DATAZONE_IAM_USER'; + } + } +} + +extension UserSearchTypeFromString on String { + UserSearchType toUserSearchType() { + switch (this) { + case 'SSO_USER': + return UserSearchType.ssoUser; + case 'DATAZONE_USER': + return UserSearchType.datazoneUser; + case 'DATAZONE_SSO_USER': + return UserSearchType.datazoneSsoUser; + case 'DATAZONE_IAM_USER': + return UserSearchType.datazoneIamUser; + } + throw Exception('$this is not known in enum UserSearchType'); + } +} + +enum UserType { + iamUser, + iamRole, + ssoUser, +} + +extension UserTypeValueExtension on UserType { + String toValue() { + switch (this) { + case UserType.iamUser: + return 'IAM_USER'; + case UserType.iamRole: + return 'IAM_ROLE'; + case UserType.ssoUser: + return 'SSO_USER'; + } + } +} + +extension UserTypeFromString on String { + UserType toUserType() { + switch (this) { + case 'IAM_USER': + return UserType.iamUser; + case 'IAM_ROLE': + return UserType.iamRole; + case 'SSO_USER': + return UserType.ssoUser; + } + throw Exception('$this is not known in enum UserType'); + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerException extends _s.GenericAwsException { + InternalServerException({String? type, String? message}) + : super(type: type, code: 'InternalServerException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class UnauthorizedException extends _s.GenericAwsException { + UnauthorizedException({String? type, String? message}) + : super(type: type, code: 'UnauthorizedException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerException': (type, message) => + InternalServerException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'UnauthorizedException': (type, message) => + UnauthorizedException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/database_migration_service/v2016_01_01.dart b/aws_client/lib/src/generated/database_migration_service/v2016_01_01.dart index 12f666fcf..20afbdc45 100644 --- a/aws_client/lib/src/generated/database_migration_service/v2016_01_01.dart +++ b/aws_client/lib/src/generated/database_migration_service/v2016_01_01.dart @@ -227,6 +227,61 @@ class DatabaseMigration { jsonResponse.body); } + /// Creates a data provider using the provided settings. A data provider + /// stores a data store type and location information about your database. + /// + /// May throw [ResourceQuotaExceededFault]. + /// May throw [AccessDeniedFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// + /// Parameter [engine] : + /// The type of database engine for the data provider. Valid values include + /// "aurora", "aurora-postgresql", + /// "mysql", "oracle", "postgres", + /// "sqlserver", redshift, mariadb, + /// mongodb, and docdb. A value of + /// "aurora" represents Amazon Aurora MySQL-Compatible Edition. + /// + /// Parameter [settings] : + /// The settings in JSON format for a data provider. + /// + /// Parameter [dataProviderName] : + /// A user-friendly name for the data provider. + /// + /// Parameter [description] : + /// A user-friendly description of the data provider. + /// + /// Parameter [tags] : + /// One or more tags to be assigned to the data provider. + Future createDataProvider({ + required String engine, + required DataProviderSettings settings, + String? dataProviderName, + String? description, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.CreateDataProvider' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'Engine': engine, + 'Settings': settings, + if (dataProviderName != null) 'DataProviderName': dataProviderName, + if (description != null) 'Description': description, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateDataProviderResponse.fromJson(jsonResponse.body); + } + /// Creates an endpoint using the provided settings. /// /// For a MySQL source or target endpoint, don't explicitly specify the @@ -461,6 +516,9 @@ class DatabaseMigration { /// Parameter [tags] : /// One or more tags to be assigned to the endpoint. /// + /// Parameter [timestreamSettings] : + /// Settings in JSON format for the target Amazon Timestream endpoint. + /// /// Parameter [username] : /// The user name to be used to log in to the endpoint database. Future createEndpoint({ @@ -497,6 +555,7 @@ class DatabaseMigration { DmsSslModeValue? sslMode, SybaseSettings? sybaseSettings, List? tags, + TimestreamSettings? timestreamSettings, String? username, }) async { final headers = { @@ -551,6 +610,8 @@ class DatabaseMigration { if (sslMode != null) 'SslMode': sslMode.toValue(), if (sybaseSettings != null) 'SybaseSettings': sybaseSettings, if (tags != null) 'Tags': tags, + if (timestreamSettings != null) + 'TimestreamSettings': timestreamSettings, if (username != null) 'Username': username, }, ); @@ -713,6 +774,317 @@ class DatabaseMigration { return CreateFleetAdvisorCollectorResponse.fromJson(jsonResponse.body); } + /// Creates the instance profile using the specified parameters. + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. + /// + /// Parameter [availabilityZone] : + /// The Availability Zone where the instance profile will be created. The + /// default value is a random, system-chosen Availability Zone in the Amazon + /// Web Services Region where your data provider is created, for examplem + /// us-east-1d. + /// + /// Parameter [description] : + /// A user-friendly description of the instance profile. + /// + /// Parameter [instanceProfileName] : + /// A user-friendly name for the instance profile. + /// + /// Parameter [kmsKeyArn] : + /// The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the + /// connection parameters for the instance profile. + /// + /// If you don't specify a value for the KmsKeyArn parameter, + /// then DMS uses your default encryption key. + /// + /// KMS creates the default encryption key for your Amazon Web Services + /// account. Your Amazon Web Services account has a different default + /// encryption key for each Amazon Web Services Region. + /// + /// Parameter [networkType] : + /// Specifies the network type for the instance profile. A value of + /// IPV4 represents an instance profile with IPv4 network type + /// and only supports IPv4 addressing. A value of IPV6 represents + /// an instance profile with IPv6 network type and only supports IPv6 + /// addressing. A value of DUAL represents an instance profile + /// with dual network type that supports IPv4 and IPv6 addressing. + /// + /// Parameter [publiclyAccessible] : + /// Specifies the accessibility options for the instance profile. A value of + /// true represents an instance profile with a public IP address. + /// A value of false represents an instance profile with a + /// private IP address. The default value is true. + /// + /// Parameter [subnetGroupIdentifier] : + /// A subnet group to associate with the instance profile. + /// + /// Parameter [tags] : + /// One or more tags to be assigned to the instance profile. + /// + /// Parameter [vpcSecurityGroups] : + /// Specifies the VPC security group names to be used with the instance + /// profile. The VPC security group must work with the VPC containing the + /// instance profile. + Future createInstanceProfile({ + String? availabilityZone, + String? description, + String? instanceProfileName, + String? kmsKeyArn, + String? networkType, + bool? publiclyAccessible, + String? subnetGroupIdentifier, + List? tags, + List? vpcSecurityGroups, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.CreateInstanceProfile' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (availabilityZone != null) 'AvailabilityZone': availabilityZone, + if (description != null) 'Description': description, + if (instanceProfileName != null) + 'InstanceProfileName': instanceProfileName, + if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn, + if (networkType != null) 'NetworkType': networkType, + if (publiclyAccessible != null) + 'PubliclyAccessible': publiclyAccessible, + if (subnetGroupIdentifier != null) + 'SubnetGroupIdentifier': subnetGroupIdentifier, + if (tags != null) 'Tags': tags, + if (vpcSecurityGroups != null) 'VpcSecurityGroups': vpcSecurityGroups, + }, + ); + + return CreateInstanceProfileResponse.fromJson(jsonResponse.body); + } + + /// Creates the migration project using the specified parameters. + /// + /// You can run this action only after you create an instance profile and data + /// providers using CreateInstanceProfile + /// and CreateDataProvider. + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. + /// + /// Parameter [instanceProfileIdentifier] : + /// The identifier of the associated instance profile. Identifiers must begin + /// with a letter and must contain only ASCII letters, digits, and hyphens. + /// They can't end with a hyphen, or contain two consecutive hyphens. + /// + /// Parameter [sourceDataProviderDescriptors] : + /// Information about the source data provider, including the name, ARN, and + /// Secrets Manager parameters. + /// + /// Parameter [targetDataProviderDescriptors] : + /// Information about the target data provider, including the name, ARN, and + /// Amazon Web Services Secrets Manager parameters. + /// + /// Parameter [description] : + /// A user-friendly description of the migration project. + /// + /// Parameter [migrationProjectName] : + /// A user-friendly name for the migration project. + /// + /// Parameter [schemaConversionApplicationAttributes] : + /// The schema conversion application attributes, including the Amazon S3 + /// bucket name and Amazon S3 role ARN. + /// + /// Parameter [tags] : + /// One or more tags to be assigned to the migration project. + /// + /// Parameter [transformationRules] : + /// The settings in JSON format for migration rules. Migration rules make it + /// possible for you to change the object names according to the rules that + /// you specify. For example, you can change an object name to lowercase or + /// uppercase, add or remove a prefix or suffix, or rename objects. + Future createMigrationProject({ + required String instanceProfileIdentifier, + required List + sourceDataProviderDescriptors, + required List + targetDataProviderDescriptors, + String? description, + String? migrationProjectName, + SCApplicationAttributes? schemaConversionApplicationAttributes, + List? tags, + String? transformationRules, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.CreateMigrationProject' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'InstanceProfileIdentifier': instanceProfileIdentifier, + 'SourceDataProviderDescriptors': sourceDataProviderDescriptors, + 'TargetDataProviderDescriptors': targetDataProviderDescriptors, + if (description != null) 'Description': description, + if (migrationProjectName != null) + 'MigrationProjectName': migrationProjectName, + if (schemaConversionApplicationAttributes != null) + 'SchemaConversionApplicationAttributes': + schemaConversionApplicationAttributes, + if (tags != null) 'Tags': tags, + if (transformationRules != null) + 'TransformationRules': transformationRules, + }, + ); + + return CreateMigrationProjectResponse.fromJson(jsonResponse.body); + } + + /// Creates a configuration that you can later provide to configure and start + /// an DMS Serverless replication. You can also provide options to validate + /// the configuration inputs before you start the replication. + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [ReplicationSubnetGroupDoesNotCoverEnoughAZs]. + /// May throw [InvalidSubnet]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. + /// + /// Parameter [computeConfig] : + /// Configuration parameters for provisioning an DMS Serverless replication. + /// + /// Parameter [replicationConfigIdentifier] : + /// A unique identifier that you want to use to create a + /// ReplicationConfigArn that is returned as part of the output + /// from this action. You can then pass this output + /// ReplicationConfigArn as the value of the + /// ReplicationConfigArn option for other actions to identify + /// both DMS Serverless replications and replication configurations that you + /// want those actions to operate on. For some actions, you can also use + /// either this unique identifier or a corresponding ARN in action filters to + /// identify the specific replication and replication configuration to operate + /// on. + /// + /// Parameter [replicationType] : + /// The type of DMS Serverless replication to provision using this replication + /// configuration. + /// + /// Possible values: + /// + ///

        + ///
      • + /// "full-load" + ///
      • + ///
      • + /// "cdc" + ///
      • + ///
      • + /// "full-load-and-cdc" + ///
      • + ///
      + /// + /// Parameter [sourceEndpointArn] : + /// The Amazon Resource Name (ARN) of the source endpoint for this DMS + /// Serverless replication configuration. + /// + /// Parameter [tableMappings] : + /// JSON table mappings for DMS Serverless replications that are provisioned + /// using this replication configuration. For more information, see + /// Specifying table selection and transformations rules using JSON. + /// + /// Parameter [targetEndpointArn] : + /// The Amazon Resource Name (ARN) of the target endpoint for this DMS + /// serverless replication configuration. + /// + /// Parameter [replicationSettings] : + /// Optional JSON settings for DMS Serverless replications that are + /// provisioned using this replication configuration. For example, see + /// Change processing tuning settings. + /// + /// Parameter [resourceIdentifier] : + /// Optional unique value or name that you set for a given resource that can + /// be used to construct an Amazon Resource Name (ARN) for that resource. For + /// more information, see + /// Fine-grained access control using resource names and tags. + /// + /// Parameter [supplementalSettings] : + /// Optional JSON settings for specifying supplemental data. For more + /// information, see + /// Specifying supplemental data for task settings. + /// + /// Parameter [tags] : + /// One or more optional tags associated with resources used by the DMS + /// Serverless replication. For more information, see + /// Tagging resources in Database Migration Service. + Future createReplicationConfig({ + required ComputeConfig computeConfig, + required String replicationConfigIdentifier, + required MigrationTypeValue replicationType, + required String sourceEndpointArn, + required String tableMappings, + required String targetEndpointArn, + String? replicationSettings, + String? resourceIdentifier, + String? supplementalSettings, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.CreateReplicationConfig' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ComputeConfig': computeConfig, + 'ReplicationConfigIdentifier': replicationConfigIdentifier, + 'ReplicationType': replicationType.toValue(), + 'SourceEndpointArn': sourceEndpointArn, + 'TableMappings': tableMappings, + 'TargetEndpointArn': targetEndpointArn, + if (replicationSettings != null) + 'ReplicationSettings': replicationSettings, + if (resourceIdentifier != null) + 'ResourceIdentifier': resourceIdentifier, + if (supplementalSettings != null) + 'SupplementalSettings': supplementalSettings, + if (tags != null) 'Tags': tags, + }, + ); + + return CreateReplicationConfigResponse.fromJson(jsonResponse.body); + } + /// Creates the replication instance using the specified parameters. /// /// DMS requires that your account have certain roles with appropriate @@ -723,6 +1095,13 @@ class DatabaseMigration { /// required permissions, see IAM /// Permissions Needed to Use DMS. + /// + /// If you don't specify a version when creating a replication instance, DMS + /// will create the instance using the default engine version. For information + /// about the default engine version, see Release + /// Notes. + /// /// /// May throw [AccessDeniedFault]. /// May throw [ResourceAlreadyExistsFault]. @@ -743,8 +1122,10 @@ class DatabaseMigration { /// /// For more information on the settings and capacities for the available /// replication instance classes, see - /// Selecting the right DMS replication instance for your migration. + /// href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.Types.html + /// "> Choosing the right DMS replication instance; and, Selecting + /// the best size for a replication instance. /// /// Parameter [replicationInstanceIdentifier] : /// The replication instance identifier. This parameter is stored as a @@ -776,20 +1157,11 @@ class DatabaseMigration { /// /// Default: true /// - /// When AutoMinorVersionUpgrade is enabled, DMS uses the current - /// default engine version when you create a replication instance. For - /// example, if you set EngineVersion to a lower version number - /// than the current default version, DMS uses the default version. - /// - /// If AutoMinorVersionUpgrade isn’t enabled when you - /// create a replication instance, DMS uses the engine version specified by - /// the EngineVersion parameter. - /// /// Parameter [availabilityZone] : /// The Availability Zone where the replication instance will be created. The /// default value is a random, system-chosen Availability Zone in the /// endpoint's Amazon Web Services Region, for example: - /// us-east-1d + /// us-east-1d. /// /// Parameter [dnsNameServers] : /// A list of custom DNS name servers supported for the replication instance @@ -933,6 +1305,14 @@ class DatabaseMigration { /// zones in the Amazon Web Services Region, otherwise the service will throw /// a ReplicationSubnetGroupDoesNotCoverEnoughAZs exception. /// + /// If a replication subnet group exists in your Amazon Web Services account, + /// the CreateReplicationSubnetGroup action returns the following error + /// message: The Replication Subnet Group already exists. In this case, delete + /// the existing replication subnet group. To do so, use the DeleteReplicationSubnetGroup + /// action. Optionally, choose Subnet groups in the DMS console, then choose + /// your subnet group. Next, choose Delete from Actions. + /// /// May throw [AccessDeniedFault]. /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. @@ -953,7 +1333,7 @@ class DatabaseMigration { /// Example: mySubnetgroup /// /// Parameter [subnetIds] : - /// One or more subnet IDs to be assigned to the subnet group. + /// Two or more subnet IDs to be assigned to the subnet group. /// /// Parameter [tags] : /// One or more tags to be assigned to the subnet group. @@ -1068,8 +1448,7 @@ class DatabaseMigration { /// /// Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12” /// - /// Commit time example: --cdc-stop-position “commit_time: - /// 2018-02-09T12:12:12“ + /// Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“ /// /// Parameter [replicationTaskSettings] : /// Overall settings for the task, in JSON format. For more information, see @@ -1211,6 +1590,39 @@ class DatabaseMigration { return DeleteConnectionResponse.fromJson(jsonResponse.body); } + /// Deletes the specified data provider. + /// + /// All migration projects associated with the data provider must be deleted + /// or modified before you can delete the data provider. + /// + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [dataProviderIdentifier] : + /// The identifier of the data provider to delete. + Future deleteDataProvider({ + required String dataProviderIdentifier, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteDataProvider' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'DataProviderIdentifier': dataProviderIdentifier, + }, + ); + + return DeleteDataProviderResponse.fromJson(jsonResponse.body); + } + /// Deletes the specified endpoint. /// /// All tasks associated with the endpoint must be deleted before you can @@ -1326,23 +1738,24 @@ class DatabaseMigration { return DeleteFleetAdvisorDatabasesResponse.fromJson(jsonResponse.body); } - /// Deletes the specified replication instance. + /// Deletes the specified instance profile. /// - /// You must delete any migration tasks that are associated with the - /// replication instance before you can delete it. - ///

      + /// All migration projects associated with the instance profile must be + /// deleted or modified before you can delete the instance profile. + /// /// - /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. /// - /// Parameter [replicationInstanceArn] : - /// The Amazon Resource Name (ARN) of the replication instance to be deleted. - Future deleteReplicationInstance({ - required String replicationInstanceArn, + /// Parameter [instanceProfileIdentifier] : + /// The identifier of the instance profile to delete. + Future deleteInstanceProfile({ + required String instanceProfileIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DeleteReplicationInstance' + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteInstanceProfile' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -1351,47 +1764,144 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationInstanceArn': replicationInstanceArn, + 'InstanceProfileIdentifier': instanceProfileIdentifier, }, ); - return DeleteReplicationInstanceResponse.fromJson(jsonResponse.body); + return DeleteInstanceProfileResponse.fromJson(jsonResponse.body); } - /// Deletes a subnet group. + /// Deletes the specified migration project. + /// + /// The migration project must be closed before you can delete it. + /// /// - /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. /// - /// Parameter [replicationSubnetGroupIdentifier] : - /// The subnet group name of the replication instance. - Future deleteReplicationSubnetGroup({ - required String replicationSubnetGroupIdentifier, + /// Parameter [migrationProjectIdentifier] : + /// The name or Amazon Resource Name (ARN) of the migration project to delete. + Future deleteMigrationProject({ + required String migrationProjectIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DeleteReplicationSubnetGroup' + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteMigrationProject' }; - await _protocol.send( + final jsonResponse = await _protocol.send( method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, payload: { - 'ReplicationSubnetGroupIdentifier': replicationSubnetGroupIdentifier, + 'MigrationProjectIdentifier': migrationProjectIdentifier, }, ); + + return DeleteMigrationProjectResponse.fromJson(jsonResponse.body); } - /// Deletes the specified replication task. + /// Deletes an DMS Serverless replication configuration. This effectively + /// deprovisions any and all replications that use this configuration. You + /// can't delete the configuration for an DMS Serverless replication that is + /// ongoing. You can delete the configuration when the replication is in a + /// non-RUNNING and non-STARTING state. /// + /// May throw [AccessDeniedFault]. /// May throw [ResourceNotFoundFault]. /// May throw [InvalidResourceStateFault]. /// - /// Parameter [replicationTaskArn] : - /// The Amazon Resource Name (ARN) of the replication task to be deleted. - Future deleteReplicationTask({ + /// Parameter [replicationConfigArn] : + /// The replication config to delete. + Future deleteReplicationConfig({ + required String replicationConfigArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteReplicationConfig' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationConfigArn': replicationConfigArn, + }, + ); + + return DeleteReplicationConfigResponse.fromJson(jsonResponse.body); + } + + /// Deletes the specified replication instance. + /// + /// You must delete any migration tasks that are associated with the + /// replication instance before you can delete it. + ///

      + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [replicationInstanceArn] : + /// The Amazon Resource Name (ARN) of the replication instance to be deleted. + Future deleteReplicationInstance({ + required String replicationInstanceArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteReplicationInstance' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationInstanceArn': replicationInstanceArn, + }, + ); + + return DeleteReplicationInstanceResponse.fromJson(jsonResponse.body); + } + + /// Deletes a subnet group. + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [replicationSubnetGroupIdentifier] : + /// The subnet group name of the replication instance. + Future deleteReplicationSubnetGroup({ + required String replicationSubnetGroupIdentifier, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DeleteReplicationSubnetGroup' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationSubnetGroupIdentifier': replicationSubnetGroupIdentifier, + }, + ); + } + + /// Deletes the specified replication task. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [replicationTaskArn] : + /// The Amazon Resource Name (ARN) of the replication task to be deleted. + Future deleteReplicationTask({ required String replicationTaskArn, }) async { final headers = { @@ -1665,11 +2175,93 @@ class DatabaseMigration { return DescribeConnectionsResponse.fromJson(jsonResponse.body); } + /// Returns configuration parameters for a schema conversion project. + /// + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [migrationProjectIdentifier] : + /// The name or Amazon Resource Name (ARN) for the schema conversion project + /// to describe. + Future + describeConversionConfiguration({ + required String migrationProjectIdentifier, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeConversionConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, + }, + ); + + return DescribeConversionConfigurationResponse.fromJson(jsonResponse.body); + } + + /// Returns a paginated list of data providers for your account in the current + /// region. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [filters] : + /// Filters applied to the data providers described in the form of key-value + /// pairs. + /// + /// Valid filter names: data-provider-identifier + /// + /// Parameter [marker] : + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future describeDataProviders({ + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeDataProviders' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeDataProvidersResponse.fromJson(jsonResponse.body); + } + /// Returns information about the possible endpoint settings available when /// you create an endpoint for a specific database engine. /// /// Parameter [engineName] : - /// The databse engine used for your source or target endpoint. + /// The database engine used for your source or target endpoint. /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -1802,6 +2394,42 @@ class DatabaseMigration { return DescribeEndpointsResponse.fromJson(jsonResponse.body); } + /// Returns information about the replication instance versions used in the + /// project. + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + Future describeEngineVersions({ + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeEngineVersions' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeEngineVersionsResponse.fromJson(jsonResponse.body); + } + /// Lists categories for all event source types, or, if specified, for a /// specified source type. You can see a list of the event categories and /// source types in MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future + describeExtensionPackAssociations({ + required String migrationProjectIdentifier, + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeExtensionPackAssociations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeExtensionPackAssociationsResponse.fromJson( + jsonResponse.body); + } + /// Returns a list of the Fleet Advisor collectors in your account. /// /// May throw [InvalidResourceStateFault]. @@ -2269,31 +2954,40 @@ class DatabaseMigration { return DescribeFleetAdvisorSchemasResponse.fromJson(jsonResponse.body); } - /// Returns information about the replication instance types that can be - /// created in the specified region. + /// Returns a paginated list of instance profiles for your account in the + /// current region. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [filters] : + /// Filters applied to the instance profiles described in the form of + /// key-value pairs. /// /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. /// /// Parameter [maxRecords] : /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. - /// - /// Default: 100 - /// - /// Constraints: Minimum 20, maximum 100. - Future - describeOrderableReplicationInstances({ + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future describeInstanceProfiles({ + List? filters, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeOrderableReplicationInstances' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeInstanceProfiles' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2302,49 +2996,53 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return DescribeOrderableReplicationInstancesResponse.fromJson( - jsonResponse.body); + return DescribeInstanceProfilesResponse.fromJson(jsonResponse.body); } - /// For internal use only + /// Returns a paginated list of metadata model assessments for your account in + /// the current region. /// /// May throw [ResourceNotFoundFault]. /// + /// Parameter [migrationProjectIdentifier] : + /// The name or Amazon Resource Name (ARN) of the migration project. + /// /// Parameter [filters] : - ///

      + /// Filters applied to the metadata model assessments described in the form of + /// key-value pairs. /// /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. /// /// Parameter [maxRecords] : /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. - /// - /// Default: 100 - /// - /// Constraints: Minimum 20, maximum 100. - /// - /// Parameter [replicationInstanceArn] : - /// The Amazon Resource Name (ARN) of the replication instance. - Future - describePendingMaintenanceActions({ + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future + describeMetadataModelAssessments({ + required String migrationProjectIdentifier, List? filters, String? marker, int? maxRecords, - String? replicationInstanceArn, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribePendingMaintenanceActions' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMetadataModelAssessments' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2353,53 +3051,54 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, - if (replicationInstanceArn != null) - 'ReplicationInstanceArn': replicationInstanceArn, }, ); - return DescribePendingMaintenanceActionsResponse.fromJson( - jsonResponse.body); + return DescribeMetadataModelAssessmentsResponse.fromJson(jsonResponse.body); } - /// Returns a paginated list of limitations for recommendations of target - /// Amazon Web Services engines. + /// Returns a paginated list of metadata model conversions for a migration + /// project. /// - /// May throw [InvalidResourceStateFault]. - /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [filters] : - /// Filters applied to the limitations described in the form of key-value - /// pairs. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [maxRecords] : - /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, Fleet Advisor - /// includes a pagination token in the response so that you can retrieve the - /// remaining results. + /// Parameter [filters] : + /// Filters applied to the metadata model conversions described in the form of + /// key-value pairs. /// - /// Parameter [nextToken] : + /// Parameter [marker] : /// Specifies the unique pagination token that makes it possible to display /// the next page of results. If this parameter is specified, the response /// includes only records beyond the marker, up to the value specified by /// MaxRecords. /// - /// If NextToken is returned by a previous response, there are - /// more results available. The value of NextToken is a unique - /// pagination token for each page. Make the call again using the returned - /// token to retrieve the next page. Keep all other arguments unchanged. - Future - describeRecommendationLimitations({ + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future + describeMetadataModelConversions({ + required String migrationProjectIdentifier, List? filters, + String? marker, int? maxRecords, - String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRecommendationLimitations' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMetadataModelConversions' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2408,50 +3107,53 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, - if (nextToken != null) 'NextToken': nextToken, }, ); - return DescribeRecommendationLimitationsResponse.fromJson( - jsonResponse.body); + return DescribeMetadataModelConversionsResponse.fromJson(jsonResponse.body); } - /// Returns a paginated list of target engine recommendations for your source - /// databases. + /// Returns a paginated list of metadata model exports. /// - /// May throw [InvalidResourceStateFault]. - /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [filters] : - /// Filters applied to the target engine recommendations described in the form - /// of key-value pairs. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [maxRecords] : - /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, Fleet Advisor - /// includes a pagination token in the response so that you can retrieve the - /// remaining results. + /// Parameter [filters] : + /// Filters applied to the metadata model exports described in the form of + /// key-value pairs. /// - /// Parameter [nextToken] : + /// Parameter [marker] : /// Specifies the unique pagination token that makes it possible to display /// the next page of results. If this parameter is specified, the response /// includes only records beyond the marker, up to the value specified by /// MaxRecords. /// - /// If NextToken is returned by a previous response, there are - /// more results available. The value of NextToken is a unique - /// pagination token for each page. Make the call again using the returned - /// token to retrieve the next page. Keep all other arguments unchanged. - Future describeRecommendations({ + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future + describeMetadataModelExportsAsScript({ + required String migrationProjectIdentifier, List? filters, + String? marker, int? maxRecords, - String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRecommendations' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMetadataModelExportsAsScript' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2460,75 +3162,54 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, - if (nextToken != null) 'NextToken': nextToken, }, ); - return DescribeRecommendationsResponse.fromJson(jsonResponse.body); + return DescribeMetadataModelExportsAsScriptResponse.fromJson( + jsonResponse.body); } - /// Returns the status of the RefreshSchemas operation. + /// Returns a paginated list of metadata model exports. /// - /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. /// - /// Parameter [endpointArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the - /// endpoint. - Future describeRefreshSchemasStatus({ - required String endpointArn, - }) async { - final headers = { - 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRefreshSchemasStatus' - }; - final jsonResponse = await _protocol.send( - method: 'POST', - requestUri: '/', - exceptionFnMap: _exceptionFns, - // TODO queryParams - headers: headers, - payload: { - 'EndpointArn': endpointArn, - }, - ); - - return DescribeRefreshSchemasStatusResponse.fromJson(jsonResponse.body); - } - - /// Returns information about the task logs for the specified task. - /// - /// May throw [ResourceNotFoundFault]. - /// May throw [InvalidResourceStateFault]. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [replicationInstanceArn] : - /// The Amazon Resource Name (ARN) of the replication instance. + /// Parameter [filters] : + /// Filters applied to the metadata model exports described in the form of + /// key-value pairs. /// /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. /// /// Parameter [maxRecords] : /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. - /// - /// Default: 100 - /// - /// Constraints: Minimum 20, maximum 100. - Future - describeReplicationInstanceTaskLogs({ - required String replicationInstanceArn, + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future + describeMetadataModelExportsToTarget({ + required String migrationProjectIdentifier, + List? filters, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationInstanceTaskLogs' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMetadataModelExportsToTarget' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2537,49 +3218,50 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationInstanceArn': replicationInstanceArn, + 'MigrationProjectIdentifier': migrationProjectIdentifier, + if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return DescribeReplicationInstanceTaskLogsResponse.fromJson( + return DescribeMetadataModelExportsToTargetResponse.fromJson( jsonResponse.body); } - /// Returns information about replication instances for your account in the - /// current region. + /// Returns a paginated list of metadata model imports. /// /// May throw [ResourceNotFoundFault]. /// - /// Parameter [filters] : - /// Filters applied to replication instances. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Valid filter names: replication-instance-arn | replication-instance-id | - /// replication-instance-class | engine-version + /// Parameter [filters] : + /// Filters applied to the metadata model imports described in the form of + /// key-value pairs. /// /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. - /// - /// Parameter [maxRecords] : - /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. /// - /// Default: 100 + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. /// - /// Constraints: Minimum 20, maximum 100. - Future describeReplicationInstances({ + /// Parameter [maxRecords] : + /// A paginated list of metadata model imports. + Future describeMetadataModelImports({ + required String migrationProjectIdentifier, List? filters, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationInstances' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMetadataModelImports' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2588,47 +3270,50 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return DescribeReplicationInstancesResponse.fromJson(jsonResponse.body); + return DescribeMetadataModelImportsResponse.fromJson(jsonResponse.body); } - /// Returns information about the replication subnet groups. + /// Returns a paginated list of migration projects for your account in the + /// current region. /// /// May throw [ResourceNotFoundFault]. + /// May throw [AccessDeniedFault]. /// /// Parameter [filters] : - /// Filters applied to replication subnet groups. - /// - /// Valid filter names: replication-subnet-group-id + /// Filters applied to the migration projects described in the form of + /// key-value pairs. /// /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. /// /// Parameter [maxRecords] : /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. - /// - /// Default: 100 - /// - /// Constraints: Minimum 20, maximum 100. - Future - describeReplicationSubnetGroups({ + /// exist than the specified MaxRecords value, DMS includes a + /// pagination token in the response so that you can retrieve the remaining + /// results. + Future describeMigrationProjects({ List? filters, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationSubnetGroups' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeMigrationProjects' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2643,19 +3328,11 @@ class DatabaseMigration { }, ); - return DescribeReplicationSubnetGroupsResponse.fromJson(jsonResponse.body); + return DescribeMigrationProjectsResponse.fromJson(jsonResponse.body); } - /// Returns the task assessment results from the Amazon S3 bucket that DMS - /// creates in your Amazon Web Services account. This action always returns - /// the latest results. - /// - /// For more information about DMS task assessments, see Creating - /// a task assessment report in the Database Migration Service User - /// Guide. - /// - /// May throw [ResourceNotFoundFault]. + /// Returns information about the replication instance types that can be + /// created in the specified region. /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -2671,22 +3348,14 @@ class DatabaseMigration { /// Default: 100 /// /// Constraints: Minimum 20, maximum 100. - /// - /// Parameter [replicationTaskArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the task. - /// When this input parameter is specified, the API returns only one result - /// and ignore the values of the MaxRecords and - /// Marker parameters. - Future - describeReplicationTaskAssessmentResults({ + Future + describeOrderableReplicationInstances({ String? marker, int? maxRecords, - String? replicationTaskArn, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': - 'AmazonDMSv20160101.DescribeReplicationTaskAssessmentResults' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeOrderableReplicationInstances' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2697,36 +3366,19 @@ class DatabaseMigration { payload: { if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, - if (replicationTaskArn != null) - 'ReplicationTaskArn': replicationTaskArn, }, ); - return DescribeReplicationTaskAssessmentResultsResponse.fromJson( + return DescribeOrderableReplicationInstancesResponse.fromJson( jsonResponse.body); } - /// Returns a paginated list of premigration assessment runs based on filter - /// settings. - /// - /// These filter settings can specify a combination of premigration assessment - /// runs, migration tasks, replication instances, and assessment run status - /// values. - /// - /// This operation doesn't return information about individual assessments. - /// For this information, see the - /// DescribeReplicationTaskIndividualAssessments operation. - /// + /// For internal use only /// /// May throw [ResourceNotFoundFault]. /// /// Parameter [filters] : - /// Filters applied to the premigration assessment runs described in the form - /// of key-value pairs. - /// - /// Valid filter names: replication-task-assessment-run-arn, - /// replication-task-arn, replication-instance-arn, - /// status + ///

      /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -2738,15 +3390,23 @@ class DatabaseMigration { /// exist than the specified MaxRecords value, a pagination token /// called a marker is included in the response so that the remaining results /// can be retrieved. - Future - describeReplicationTaskAssessmentRuns({ + /// + /// Default: 100 + /// + /// Constraints: Minimum 20, maximum 100. + /// + /// Parameter [replicationInstanceArn] : + /// The Amazon Resource Name (ARN) of the replication instance. + Future + describePendingMaintenanceActions({ List? filters, String? marker, int? maxRecords, + String? replicationInstanceArn, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationTaskAssessmentRuns' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribePendingMaintenanceActions' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2758,48 +3418,102 @@ class DatabaseMigration { if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, + if (replicationInstanceArn != null) + 'ReplicationInstanceArn': replicationInstanceArn, }, ); - return DescribeReplicationTaskAssessmentRunsResponse.fromJson( + return DescribePendingMaintenanceActionsResponse.fromJson( jsonResponse.body); } - /// Returns a paginated list of individual assessments based on filter - /// settings. - /// - /// These filter settings can specify a combination of premigration assessment - /// runs, migration tasks, and assessment status values. + /// Returns a paginated list of limitations for recommendations of target + /// Amazon Web Services engines. /// - /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. /// /// Parameter [filters] : - /// Filters applied to the individual assessments described in the form of - /// key-value pairs. + /// Filters applied to the limitations described in the form of key-value + /// pairs. /// - /// Valid filter names: replication-task-assessment-run-arn, - /// replication-task-arn, status + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, Fleet Advisor + /// includes a pagination token in the response so that you can retrieve the + /// remaining results. /// - /// Parameter [marker] : - /// An optional pagination token provided by a previous request. If this - /// parameter is specified, the response includes only records beyond the - /// marker, up to the value specified by MaxRecords. + /// Parameter [nextToken] : + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If NextToken is returned by a previous response, there are + /// more results available. The value of NextToken is a unique + /// pagination token for each page. Make the call again using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + Future + describeRecommendationLimitations({ + List? filters, + int? maxRecords, + String? nextToken, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRecommendationLimitations' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (maxRecords != null) 'MaxRecords': maxRecords, + if (nextToken != null) 'NextToken': nextToken, + }, + ); + + return DescribeRecommendationLimitationsResponse.fromJson( + jsonResponse.body); + } + + /// Returns a paginated list of target engine recommendations for your source + /// databases. + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [filters] : + /// Filters applied to the target engine recommendations described in the form + /// of key-value pairs. /// /// Parameter [maxRecords] : /// The maximum number of records to include in the response. If more records - /// exist than the specified MaxRecords value, a pagination token - /// called a marker is included in the response so that the remaining results - /// can be retrieved. - Future - describeReplicationTaskIndividualAssessments({ + /// exist than the specified MaxRecords value, Fleet Advisor + /// includes a pagination token in the response so that you can retrieve the + /// remaining results. + /// + /// Parameter [nextToken] : + /// Specifies the unique pagination token that makes it possible to display + /// the next page of results. If this parameter is specified, the response + /// includes only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If NextToken is returned by a previous response, there are + /// more results available. The value of NextToken is a unique + /// pagination token for each page. Make the call again using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + Future describeRecommendations({ List? filters, - String? marker, int? maxRecords, + String? nextToken, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': - 'AmazonDMSv20160101.DescribeReplicationTaskIndividualAssessments' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRecommendations' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2809,25 +3523,50 @@ class DatabaseMigration { headers: headers, payload: { if (filters != null) 'Filters': filters, - if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, + if (nextToken != null) 'NextToken': nextToken, }, ); - return DescribeReplicationTaskIndividualAssessmentsResponse.fromJson( - jsonResponse.body); + return DescribeRecommendationsResponse.fromJson(jsonResponse.body); } - /// Returns information about replication tasks for your account in the - /// current region. + /// Returns the status of the RefreshSchemas operation. /// + /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. /// - /// Parameter [filters] : - /// Filters applied to replication tasks. + /// Parameter [endpointArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the + /// endpoint. + Future describeRefreshSchemasStatus({ + required String endpointArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeRefreshSchemasStatus' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EndpointArn': endpointArn, + }, + ); + + return DescribeRefreshSchemasStatusResponse.fromJson(jsonResponse.body); + } + + /// Returns one or more existing DMS Serverless replication configurations as + /// a list of structures. /// - /// Valid filter names: replication-task-arn | replication-task-id | - /// migration-type | endpoint-arn | replication-instance-arn + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [filters] : + /// Filters applied to the replication configs. /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -2839,25 +3578,14 @@ class DatabaseMigration { /// exist than the specified MaxRecords value, a pagination token /// called a marker is included in the response so that the remaining results /// can be retrieved. - /// - /// Default: 100 - /// - /// Constraints: Minimum 20, maximum 100. - /// - /// Parameter [withoutSettings] : - /// An option to set to avoid returning information about settings. Use this - /// to reduce overhead when setting information is too large. To use this - /// option, choose true; otherwise, choose false - /// (the default). - Future describeReplicationTasks({ + Future describeReplicationConfigs({ List? filters, String? marker, int? maxRecords, - bool? withoutSettings, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationTasks' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationConfigs' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2869,22 +3597,19 @@ class DatabaseMigration { if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, - if (withoutSettings != null) 'WithoutSettings': withoutSettings, }, ); - return DescribeReplicationTasksResponse.fromJson(jsonResponse.body); + return DescribeReplicationConfigsResponse.fromJson(jsonResponse.body); } - /// Returns information about the schema for the specified endpoint. - ///

      + /// Returns information about the task logs for the specified task. /// - /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. /// - /// Parameter [endpointArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the - /// endpoint. + /// Parameter [replicationInstanceArn] : + /// The Amazon Resource Name (ARN) of the replication instance. /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -2900,14 +3625,15 @@ class DatabaseMigration { /// Default: 100 /// /// Constraints: Minimum 20, maximum 100. - Future describeSchemas({ - required String endpointArn, + Future + describeReplicationInstanceTaskLogs({ + required String replicationInstanceArn, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeSchemas' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationInstanceTaskLogs' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2916,35 +3642,26 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'EndpointArn': endpointArn, + 'ReplicationInstanceArn': replicationInstanceArn, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return DescribeSchemasResponse.fromJson(jsonResponse.body); + return DescribeReplicationInstanceTaskLogsResponse.fromJson( + jsonResponse.body); } - /// Returns table statistics on the database migration task, including table - /// name, rows inserted, rows updated, and rows deleted. - /// - /// Note that the "last updated" column the DMS console only indicates the - /// time that DMS last updated the table statistics record for a table. It - /// does not indicate the time of the last update to the table. + /// Returns information about replication instances for your account in the + /// current region. /// /// May throw [ResourceNotFoundFault]. - /// May throw [InvalidResourceStateFault]. - /// - /// Parameter [replicationTaskArn] : - /// The Amazon Resource Name (ARN) of the replication task. /// /// Parameter [filters] : - /// Filters applied to table statistics. - /// - /// Valid filter names: schema-name | table-name | table-state + /// Filters applied to replication instances. /// - /// A combination of filters creates an AND condition where each record - /// matches all specified filters. + /// Valid filter names: replication-instance-arn | replication-instance-id | + /// replication-instance-class | engine-version /// /// Parameter [marker] : /// An optional pagination token provided by a previous request. If this @@ -2959,16 +3676,15 @@ class DatabaseMigration { /// /// Default: 100 /// - /// Constraints: Minimum 20, maximum 500. - Future describeTableStatistics({ - required String replicationTaskArn, + /// Constraints: Minimum 20, maximum 100. + Future describeReplicationInstances({ List? filters, String? marker, int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.DescribeTableStatistics' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationInstances' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -2977,49 +3693,47 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationTaskArn': replicationTaskArn, if (filters != null) 'Filters': filters, if (marker != null) 'Marker': marker, if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return DescribeTableStatisticsResponse.fromJson(jsonResponse.body); + return DescribeReplicationInstancesResponse.fromJson(jsonResponse.body); } - /// Uploads the specified certificate. + /// Returns information about the replication subnet groups. /// - /// May throw [ResourceAlreadyExistsFault]. - /// May throw [InvalidCertificateFault]. - /// May throw [ResourceQuotaExceededFault]. + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [certificateIdentifier] : - /// A customer-assigned name for the certificate. Identifiers must begin with - /// a letter and must contain only ASCII letters, digits, and hyphens. They - /// can't end with a hyphen or contain two consecutive hyphens. + /// Parameter [filters] : + /// Filters applied to replication subnet groups. /// - /// Parameter [certificatePem] : - /// The contents of a .pem file, which contains an X.509 - /// certificate. + /// Valid filter names: replication-subnet-group-id /// - /// Parameter [certificateWallet] : - /// The location of an imported Oracle Wallet certificate for use with SSL. - /// Provide the name of a .sso file using the - /// fileb:// prefix. You can't provide the certificate inline. + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. /// - /// Example: filebase64("${path.root}/rds-ca-2019-root.sso") + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. /// - /// Parameter [tags] : - /// The tags associated with the certificate. - Future importCertificate({ - required String certificateIdentifier, - String? certificatePem, - Uint8List? certificateWallet, - List? tags, + /// Default: 100 + /// + /// Constraints: Minimum 20, maximum 100. + Future + describeReplicationSubnetGroups({ + List? filters, + String? marker, + int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ImportCertificate' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationSubnetGroups' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3028,43 +3742,47 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'CertificateIdentifier': certificateIdentifier, - if (certificatePem != null) 'CertificatePem': certificatePem, - if (certificateWallet != null) - 'CertificateWallet': base64Encode(certificateWallet), - if (tags != null) 'Tags': tags, - }, + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, ); - return ImportCertificateResponse.fromJson(jsonResponse.body); + return DescribeReplicationSubnetGroupsResponse.fromJson(jsonResponse.body); } - /// Lists all metadata tags attached to an DMS resource, including replication - /// instance, endpoint, subnet group, and migration task. For more - /// information, see - /// Tag data type description. + /// Returns table and schema statistics for one or more provisioned + /// replications that use a given DMS Serverless replication configuration. /// /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. /// - /// Parameter [resourceArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the DMS - /// resource to list tags for. This returns a list of keys (names of tags) - /// created for the resource and their associated tag values. + /// Parameter [replicationConfigArn] : + /// The replication config to describe. /// - /// Parameter [resourceArnList] : - /// List of ARNs that identify multiple DMS resources that you want to list - /// tags for. This returns a list of keys (tag names) and their associated tag - /// values. It also returns each tag's associated ResourceArn - /// value, which is the ARN of the resource for which each listed tag is - /// created. - Future listTagsForResource({ - String? resourceArn, - List? resourceArnList, + /// Parameter [filters] : + /// Filters applied to the replication table statistics. + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + Future + describeReplicationTableStatistics({ + required String replicationConfigArn, + List? filters, + String? marker, + int? maxRecords, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ListTagsForResource' + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationTableStatistics' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3073,290 +3791,1632 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - if (resourceArn != null) 'ResourceArn': resourceArn, - if (resourceArnList != null) 'ResourceArnList': resourceArnList, + 'ReplicationConfigArn': replicationConfigArn, + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, }, ); - return ListTagsForResourceResponse.fromJson(jsonResponse.body); + return DescribeReplicationTableStatisticsResponse.fromJson( + jsonResponse.body); } - /// Modifies the specified endpoint. - /// - /// For a MySQL source or target endpoint, don't explicitly specify the - /// database using the DatabaseName request parameter on the - /// ModifyEndpoint API call. Specifying DatabaseName - /// when you modify a MySQL endpoint replicates all the task tables to this - /// single database. For MySQL endpoints, you specify the database only when - /// you specify the schema in the table-mapping rules of the DMS task. - /// + /// Returns the task assessment results from the Amazon S3 bucket that DMS + /// creates in your Amazon Web Services account. This action always returns + /// the latest results. + /// + /// For more information about DMS task assessments, see Creating + /// a task assessment report in the Database Migration Service User + /// Guide. /// - /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. - /// May throw [ResourceAlreadyExistsFault]. - /// May throw [KMSKeyNotAccessibleFault]. - /// May throw [AccessDeniedFault]. /// - /// Parameter [endpointArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the - /// endpoint. + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. /// - /// Parameter [certificateArn] : - /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. /// - /// Parameter [databaseName] : - /// The name of the endpoint database. For a MySQL source or target endpoint, - /// do not specify DatabaseName. + /// Default: 100 /// - /// Parameter [dmsTransferSettings] : - /// The settings in JSON format for the DMS transfer type of source endpoint. + /// Constraints: Minimum 20, maximum 100. /// - /// Attributes include the following: + /// Parameter [replicationTaskArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the task. + /// When this input parameter is specified, the API returns only one result + /// and ignore the values of the MaxRecords and + /// Marker parameters. + Future + describeReplicationTaskAssessmentResults({ + String? marker, + int? maxRecords, + String? replicationTaskArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AmazonDMSv20160101.DescribeReplicationTaskAssessmentResults' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + if (replicationTaskArn != null) + 'ReplicationTaskArn': replicationTaskArn, + }, + ); + + return DescribeReplicationTaskAssessmentResultsResponse.fromJson( + jsonResponse.body); + } + + /// Returns a paginated list of premigration assessment runs based on filter + /// settings. /// - ///

        - ///
      • - /// serviceAccessRoleArn - The Amazon Resource Name (ARN) used by the service - /// access IAM role. The role must allow the iam:PassRole action. - ///
      • - ///
      • - /// BucketName - The name of the S3 bucket to use. - ///
      • - ///
      - /// Shorthand syntax for these settings is as follows: - /// ServiceAccessRoleArn=string ,BucketName=string + /// These filter settings can specify a combination of premigration assessment + /// runs, migration tasks, replication instances, and assessment run status + /// values. + /// + /// This operation doesn't return information about individual assessments. + /// For this information, see the + /// DescribeReplicationTaskIndividualAssessments operation. + /// /// - /// JSON syntax for these settings is as follows: { - /// "ServiceAccessRoleArn": "string", "BucketName": "string"} + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [docDbSettings] : - /// Settings in JSON format for the source DocumentDB endpoint. For more - /// information about the available settings, see the configuration properties - /// section in - /// Using DocumentDB as a Target for Database Migration Service in the - /// Database Migration Service User Guide. + /// Parameter [filters] : + /// Filters applied to the premigration assessment runs described in the form + /// of key-value pairs. /// - /// Parameter [dynamoDbSettings] : - /// Settings in JSON format for the target Amazon DynamoDB endpoint. For - /// information about other available settings, see Using - /// Object Mapping to Migrate Data to DynamoDB in the Database - /// Migration Service User Guide. + /// Valid filter names: replication-task-assessment-run-arn, + /// replication-task-arn, replication-instance-arn, + /// status /// - /// Parameter [elasticsearchSettings] : - /// Settings in JSON format for the target OpenSearch endpoint. For more - /// information about the available settings, see Extra - /// Connection Attributes When Using OpenSearch as a Target for DMS in the - /// Database Migration Service User Guide. + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. /// - /// Parameter [endpointIdentifier] : - /// The database endpoint identifier. Identifiers must begin with a letter and - /// must contain only ASCII letters, digits, and hyphens. They can't end with - /// a hyphen or contain two consecutive hyphens. + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + Future + describeReplicationTaskAssessmentRuns({ + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationTaskAssessmentRuns' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeReplicationTaskAssessmentRunsResponse.fromJson( + jsonResponse.body); + } + + /// Returns a paginated list of individual assessments based on filter + /// settings. /// - /// Parameter [endpointType] : - /// The type of endpoint. Valid values are source and - /// target. + /// These filter settings can specify a combination of premigration assessment + /// runs, migration tasks, and assessment status values. /// - /// Parameter [engineName] : - /// The database engine name. Valid values, depending on the EndpointType, - /// include "mysql", "oracle", - /// "postgres", "mariadb", "aurora", - /// "aurora-postgresql", "redshift", - /// "s3", "db2", "db2-zos", - /// "azuredb", "sybase", "dynamodb", - /// "mongodb", "kinesis", "kafka", - /// "elasticsearch", "documentdb", - /// "sqlserver", "neptune", and - /// "babelfish". + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [exactSettings] : - /// If this attribute is Y, the current call to ModifyEndpoint - /// replaces all existing endpoint settings with the exact settings that you - /// specify in this call. If this attribute is N, the current call to - /// ModifyEndpoint does two things: + /// Parameter [filters] : + /// Filters applied to the individual assessments described in the form of + /// key-value pairs. /// - ///
        - ///
      • - /// It replaces any endpoint settings that already exist with new values, for - /// settings with the same names. - ///
      • - ///
      • - /// It creates new endpoint settings that you specify in the call, for - /// settings with different names. - ///
      • - ///
      - /// For example, if you call create-endpoint ... --endpoint-settings - /// '{"a":1}' ..., the endpoint has the following endpoint settings: - /// '{"a":1}'. If you then call modify-endpoint ... - /// --endpoint-settings '{"b":2}' ... for the same endpoint, the - /// endpoint has the following settings: '{"a":1,"b":2}'. + /// Valid filter names: replication-task-assessment-run-arn, + /// replication-task-arn, status + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + Future + describeReplicationTaskIndividualAssessments({ + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': + 'AmazonDMSv20160101.DescribeReplicationTaskIndividualAssessments' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeReplicationTaskIndividualAssessmentsResponse.fromJson( + jsonResponse.body); + } + + /// Returns information about replication tasks for your account in the + /// current region. + /// + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [filters] : + /// Filters applied to replication tasks. + /// + /// Valid filter names: replication-task-arn | replication-task-id | + /// migration-type | endpoint-arn | replication-instance-arn + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + /// + /// Default: 100 + /// + /// Constraints: Minimum 20, maximum 100. + /// + /// Parameter [withoutSettings] : + /// An option to set to avoid returning information about settings. Use this + /// to reduce overhead when setting information is too large. To use this + /// option, choose true; otherwise, choose false + /// (the default). + Future describeReplicationTasks({ + List? filters, + String? marker, + int? maxRecords, + bool? withoutSettings, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplicationTasks' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + if (withoutSettings != null) 'WithoutSettings': withoutSettings, + }, + ); + + return DescribeReplicationTasksResponse.fromJson(jsonResponse.body); + } + + /// Provides details on replication progress by returning status information + /// for one or more provisioned DMS Serverless replications. + /// + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [filters] : + /// Filters applied to the replications. + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + Future describeReplications({ + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeReplications' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeReplicationsResponse.fromJson(jsonResponse.body); + } + + /// Returns information about the schema for the specified endpoint. + ///

      + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [endpointArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the + /// endpoint. + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + /// + /// Default: 100 + /// + /// Constraints: Minimum 20, maximum 100. + Future describeSchemas({ + required String endpointArn, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeSchemas' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EndpointArn': endpointArn, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeSchemasResponse.fromJson(jsonResponse.body); + } + + /// Returns table statistics on the database migration task, including table + /// name, rows inserted, rows updated, and rows deleted. + /// + /// Note that the "last updated" column the DMS console only indicates the + /// time that DMS last updated the table statistics record for a table. It + /// does not indicate the time of the last update to the table. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [replicationTaskArn] : + /// The Amazon Resource Name (ARN) of the replication task. + /// + /// Parameter [filters] : + /// Filters applied to table statistics. + /// + /// Valid filter names: schema-name | table-name | table-state + /// + /// A combination of filters creates an AND condition where each record + /// matches all specified filters. + /// + /// Parameter [marker] : + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + /// + /// Parameter [maxRecords] : + /// The maximum number of records to include in the response. If more records + /// exist than the specified MaxRecords value, a pagination token + /// called a marker is included in the response so that the remaining results + /// can be retrieved. + /// + /// Default: 100 + /// + /// Constraints: Minimum 20, maximum 500. + Future describeTableStatistics({ + required String replicationTaskArn, + List? filters, + String? marker, + int? maxRecords, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.DescribeTableStatistics' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationTaskArn': replicationTaskArn, + if (filters != null) 'Filters': filters, + if (marker != null) 'Marker': marker, + if (maxRecords != null) 'MaxRecords': maxRecords, + }, + ); + + return DescribeTableStatisticsResponse.fromJson(jsonResponse.body); + } + + /// Saves a copy of a database migration assessment report to your Amazon S3 + /// bucket. DMS can save your assessment report as a comma-separated value + /// (CSV) or a PDF file. + /// + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). + /// + /// Parameter [selectionRules] : + /// A value that specifies the database objects to assess. + /// + /// Parameter [assessmentReportTypes] : + /// The file format of the assessment file. + /// + /// Parameter [fileName] : + /// The name of the assessment file to create in your Amazon S3 bucket. + Future exportMetadataModelAssessment({ + required String migrationProjectIdentifier, + required String selectionRules, + List? assessmentReportTypes, + String? fileName, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ExportMetadataModelAssessment' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'SelectionRules': selectionRules, + if (assessmentReportTypes != null) + 'AssessmentReportTypes': + assessmentReportTypes.map((e) => e.toValue()).toList(), + if (fileName != null) 'FileName': fileName, + }, + ); + + return ExportMetadataModelAssessmentResponse.fromJson(jsonResponse.body); + } + + /// Uploads the specified certificate. + /// + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [InvalidCertificateFault]. + /// May throw [ResourceQuotaExceededFault]. + /// + /// Parameter [certificateIdentifier] : + /// A customer-assigned name for the certificate. Identifiers must begin with + /// a letter and must contain only ASCII letters, digits, and hyphens. They + /// can't end with a hyphen or contain two consecutive hyphens. + /// + /// Parameter [certificatePem] : + /// The contents of a .pem file, which contains an X.509 + /// certificate. + /// + /// Parameter [certificateWallet] : + /// The location of an imported Oracle Wallet certificate for use with SSL. + /// Provide the name of a .sso file using the + /// fileb:// prefix. You can't provide the certificate inline. + /// + /// Example: filebase64("${path.root}/rds-ca-2019-root.sso") + /// + /// Parameter [tags] : + /// The tags associated with the certificate. + Future importCertificate({ + required String certificateIdentifier, + String? certificatePem, + Uint8List? certificateWallet, + List? tags, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ImportCertificate' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'CertificateIdentifier': certificateIdentifier, + if (certificatePem != null) 'CertificatePem': certificatePem, + if (certificateWallet != null) + 'CertificateWallet': base64Encode(certificateWallet), + if (tags != null) 'Tags': tags, + }, + ); + + return ImportCertificateResponse.fromJson(jsonResponse.body); + } + + /// Lists all metadata tags attached to an DMS resource, including replication + /// instance, endpoint, subnet group, and migration task. For more + /// information, see + /// Tag data type description. + /// + /// May throw [ResourceNotFoundFault]. + /// + /// Parameter [resourceArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the DMS + /// resource to list tags for. This returns a list of keys (names of tags) + /// created for the resource and their associated tag values. + /// + /// Parameter [resourceArnList] : + /// List of ARNs that identify multiple DMS resources that you want to list + /// tags for. This returns a list of keys (tag names) and their associated tag + /// values. It also returns each tag's associated ResourceArn + /// value, which is the ARN of the resource for which each listed tag is + /// created. + Future listTagsForResource({ + String? resourceArn, + List? resourceArnList, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ListTagsForResource' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + if (resourceArn != null) 'ResourceArn': resourceArn, + if (resourceArnList != null) 'ResourceArnList': resourceArnList, + }, + ); + + return ListTagsForResourceResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified schema conversion configuration using the provided + /// parameters. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [conversionConfiguration] : + /// The new conversion configuration. + /// + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). + Future modifyConversionConfiguration({ + required String conversionConfiguration, + required String migrationProjectIdentifier, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyConversionConfiguration' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ConversionConfiguration': conversionConfiguration, + 'MigrationProjectIdentifier': migrationProjectIdentifier, + }, + ); + + return ModifyConversionConfigurationResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified data provider using the provided settings. + /// + /// You must remove the data provider from all migration projects before you + /// can modify it. + /// + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [dataProviderIdentifier] : + /// The identifier of the data provider. Identifiers must begin with a letter + /// and must contain only ASCII letters, digits, and hyphens. They can't end + /// with a hyphen, or contain two consecutive hyphens. + /// + /// Parameter [dataProviderName] : + /// The name of the data provider. + /// + /// Parameter [description] : + /// A user-friendly description of the data provider. + /// + /// Parameter [engine] : + /// The type of database engine for the data provider. Valid values include + /// "aurora", "aurora-postgresql", + /// "mysql", "oracle", "postgres", + /// "sqlserver", redshift, mariadb, + /// mongodb, and docdb. A value of + /// "aurora" represents Amazon Aurora MySQL-Compatible Edition. + /// + /// Parameter [exactSettings] : + /// If this attribute is Y, the current call to + /// ModifyDataProvider replaces all existing data provider + /// settings with the exact settings that you specify in this call. If this + /// attribute is N, the current call to ModifyDataProvider does + /// two things: + /// + ///

        + ///
      • + /// It replaces any data provider settings that already exist with new values, + /// for settings with the same names. + ///
      • + ///
      • + /// It creates new data provider settings that you specify in the call, for + /// settings with different names. + ///
      • + ///
      + /// + /// Parameter [settings] : + /// The settings in JSON format for a data provider. + Future modifyDataProvider({ + required String dataProviderIdentifier, + String? dataProviderName, + String? description, + String? engine, + bool? exactSettings, + DataProviderSettings? settings, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyDataProvider' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'DataProviderIdentifier': dataProviderIdentifier, + if (dataProviderName != null) 'DataProviderName': dataProviderName, + if (description != null) 'Description': description, + if (engine != null) 'Engine': engine, + if (exactSettings != null) 'ExactSettings': exactSettings, + if (settings != null) 'Settings': settings, + }, + ); + + return ModifyDataProviderResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified endpoint. + /// + /// For a MySQL source or target endpoint, don't explicitly specify the + /// database using the DatabaseName request parameter on the + /// ModifyEndpoint API call. Specifying DatabaseName + /// when you modify a MySQL endpoint replicates all the task tables to this + /// single database. For MySQL endpoints, you specify the database only when + /// you specify the schema in the table-mapping rules of the DMS task. + /// + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [endpointArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the + /// endpoint. + /// + /// Parameter [certificateArn] : + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + /// + /// Parameter [databaseName] : + /// The name of the endpoint database. For a MySQL source or target endpoint, + /// do not specify DatabaseName. + /// + /// Parameter [dmsTransferSettings] : + /// The settings in JSON format for the DMS transfer type of source endpoint. + /// + /// Attributes include the following: + /// + ///
        + ///
      • + /// serviceAccessRoleArn - The Amazon Resource Name (ARN) used by the service + /// access IAM role. The role must allow the iam:PassRole action. + ///
      • + ///
      • + /// BucketName - The name of the S3 bucket to use. + ///
      • + ///
      + /// Shorthand syntax for these settings is as follows: + /// ServiceAccessRoleArn=string ,BucketName=string + /// + /// JSON syntax for these settings is as follows: { + /// "ServiceAccessRoleArn": "string", "BucketName": "string"} + /// + /// Parameter [docDbSettings] : + /// Settings in JSON format for the source DocumentDB endpoint. For more + /// information about the available settings, see the configuration properties + /// section in + /// Using DocumentDB as a Target for Database Migration Service in the + /// Database Migration Service User Guide. + /// + /// Parameter [dynamoDbSettings] : + /// Settings in JSON format for the target Amazon DynamoDB endpoint. For + /// information about other available settings, see Using + /// Object Mapping to Migrate Data to DynamoDB in the Database + /// Migration Service User Guide. + /// + /// Parameter [elasticsearchSettings] : + /// Settings in JSON format for the target OpenSearch endpoint. For more + /// information about the available settings, see Extra + /// Connection Attributes When Using OpenSearch as a Target for DMS in the + /// Database Migration Service User Guide. + /// + /// Parameter [endpointIdentifier] : + /// The database endpoint identifier. Identifiers must begin with a letter and + /// must contain only ASCII letters, digits, and hyphens. They can't end with + /// a hyphen or contain two consecutive hyphens. + /// + /// Parameter [endpointType] : + /// The type of endpoint. Valid values are source and + /// target. + /// + /// Parameter [engineName] : + /// The database engine name. Valid values, depending on the EndpointType, + /// include "mysql", "oracle", + /// "postgres", "mariadb", "aurora", + /// "aurora-postgresql", "redshift", + /// "s3", "db2", "db2-zos", + /// "azuredb", "sybase", "dynamodb", + /// "mongodb", "kinesis", "kafka", + /// "elasticsearch", "documentdb", + /// "sqlserver", "neptune", and + /// "babelfish". + /// + /// Parameter [exactSettings] : + /// If this attribute is Y, the current call to ModifyEndpoint + /// replaces all existing endpoint settings with the exact settings that you + /// specify in this call. If this attribute is N, the current call to + /// ModifyEndpoint does two things: + /// + ///
        + ///
      • + /// It replaces any endpoint settings that already exist with new values, for + /// settings with the same names. + ///
      • + ///
      • + /// It creates new endpoint settings that you specify in the call, for + /// settings with different names. + ///
      • + ///
      + /// For example, if you call create-endpoint ... --endpoint-settings + /// '{"a":1}' ..., the endpoint has the following endpoint settings: + /// '{"a":1}'. If you then call modify-endpoint ... + /// --endpoint-settings '{"b":2}' ... for the same endpoint, the + /// endpoint has the following settings: '{"a":1,"b":2}'. + /// + /// However, suppose that you follow this with a call to modify-endpoint + /// ... --endpoint-settings '{"b":2}' --exact-settings ... for that + /// same endpoint again. Then the endpoint has the following settings: + /// '{"b":2}'. All existing settings are replaced with the exact + /// settings that you specify. + /// + /// Parameter [externalTableDefinition] : + /// The external table definition. + /// + /// Parameter [extraConnectionAttributes] : + /// Additional attributes associated with the connection. To reset this + /// parameter, pass the empty string ("") as an argument. + /// + /// Parameter [gcpMySQLSettings] : + /// Settings in JSON format for the source GCP MySQL endpoint. + /// + /// Parameter [iBMDb2Settings] : + /// Settings in JSON format for the source IBM Db2 LUW endpoint. For + /// information about other available settings, see Extra + /// connection attributes when using Db2 LUW as a source for DMS in the + /// Database Migration Service User Guide. + /// + /// Parameter [kafkaSettings] : + /// Settings in JSON format for the target Apache Kafka endpoint. For more + /// information about the available settings, see Using + /// object mapping to migrate data to a Kafka topic in the Database + /// Migration Service User Guide. + /// + /// Parameter [kinesisSettings] : + /// Settings in JSON format for the target endpoint for Amazon Kinesis Data + /// Streams. For more information about the available settings, see Using + /// object mapping to migrate data to a Kinesis data stream in the + /// Database Migration Service User Guide. + /// + /// Parameter [microsoftSQLServerSettings] : + /// Settings in JSON format for the source and target Microsoft SQL Server + /// endpoint. For information about other available settings, see Extra + /// connection attributes when using SQL Server as a source for DMS and + /// Extra connection attributes when using SQL Server as a target for DMS + /// in the Database Migration Service User Guide. + /// + /// Parameter [mongoDbSettings] : + /// Settings in JSON format for the source MongoDB endpoint. For more + /// information about the available settings, see the configuration properties + /// section in Endpoint + /// configuration settings when using MongoDB as a source for Database + /// Migration Service in the Database Migration Service User Guide. + /// + /// Parameter [mySQLSettings] : + /// Settings in JSON format for the source and target MySQL endpoint. For + /// information about other available settings, see Extra + /// connection attributes when using MySQL as a source for DMS and Extra + /// connection attributes when using a MySQL-compatible database as a target + /// for DMS in the Database Migration Service User Guide. + /// + /// Parameter [neptuneSettings] : + /// Settings in JSON format for the target Amazon Neptune endpoint. For more + /// information about the available settings, see Specifying + /// graph-mapping rules using Gremlin and R2RML for Amazon Neptune as a + /// target in the Database Migration Service User Guide. + /// + /// Parameter [oracleSettings] : + /// Settings in JSON format for the source and target Oracle endpoint. For + /// information about other available settings, see Extra + /// connection attributes when using Oracle as a source for DMS and + /// Extra connection attributes when using Oracle as a target for DMS in + /// the Database Migration Service User Guide. + /// + /// Parameter [password] : + /// The password to be used to login to the endpoint database. + /// + /// Parameter [port] : + /// The port used by the endpoint database. + /// + /// Parameter [postgreSQLSettings] : + /// Settings in JSON format for the source and target PostgreSQL endpoint. For + /// information about other available settings, see Extra + /// connection attributes when using PostgreSQL as a source for DMS and + /// Extra connection attributes when using PostgreSQL as a target for DMS + /// in the Database Migration Service User Guide. + /// + /// Parameter [redisSettings] : + /// Settings in JSON format for the Redis target endpoint. + /// + /// Parameter [s3Settings] : + /// Settings in JSON format for the target Amazon S3 endpoint. For more + /// information about the available settings, see Extra + /// Connection Attributes When Using Amazon S3 as a Target for DMS in the + /// Database Migration Service User Guide. + /// + /// Parameter [serverName] : + /// The name of the server where the endpoint database resides. + /// + /// Parameter [serviceAccessRoleArn] : + /// The Amazon Resource Name (ARN) for the IAM role you want to use to modify + /// the endpoint. The role must allow the iam:PassRole action. + /// + /// Parameter [sslMode] : + /// The SSL mode used to connect to the endpoint. The default value is + /// none. + /// + /// Parameter [sybaseSettings] : + /// Settings in JSON format for the source and target SAP ASE endpoint. For + /// information about other available settings, see Extra + /// connection attributes when using SAP ASE as a source for DMS and Extra + /// connection attributes when using SAP ASE as a target for DMS in the + /// Database Migration Service User Guide. + /// + /// Parameter [timestreamSettings] : + /// Settings in JSON format for the target Amazon Timestream endpoint. + /// + /// Parameter [username] : + /// The user name to be used to login to the endpoint database. + Future modifyEndpoint({ + required String endpointArn, + String? certificateArn, + String? databaseName, + DmsTransferSettings? dmsTransferSettings, + DocDbSettings? docDbSettings, + DynamoDbSettings? dynamoDbSettings, + ElasticsearchSettings? elasticsearchSettings, + String? endpointIdentifier, + ReplicationEndpointTypeValue? endpointType, + String? engineName, + bool? exactSettings, + String? externalTableDefinition, + String? extraConnectionAttributes, + GcpMySQLSettings? gcpMySQLSettings, + IBMDb2Settings? iBMDb2Settings, + KafkaSettings? kafkaSettings, + KinesisSettings? kinesisSettings, + MicrosoftSQLServerSettings? microsoftSQLServerSettings, + MongoDbSettings? mongoDbSettings, + MySQLSettings? mySQLSettings, + NeptuneSettings? neptuneSettings, + OracleSettings? oracleSettings, + String? password, + int? port, + PostgreSQLSettings? postgreSQLSettings, + RedisSettings? redisSettings, + RedshiftSettings? redshiftSettings, + S3Settings? s3Settings, + String? serverName, + String? serviceAccessRoleArn, + DmsSslModeValue? sslMode, + SybaseSettings? sybaseSettings, + TimestreamSettings? timestreamSettings, + String? username, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyEndpoint' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'EndpointArn': endpointArn, + if (certificateArn != null) 'CertificateArn': certificateArn, + if (databaseName != null) 'DatabaseName': databaseName, + if (dmsTransferSettings != null) + 'DmsTransferSettings': dmsTransferSettings, + if (docDbSettings != null) 'DocDbSettings': docDbSettings, + if (dynamoDbSettings != null) 'DynamoDbSettings': dynamoDbSettings, + if (elasticsearchSettings != null) + 'ElasticsearchSettings': elasticsearchSettings, + if (endpointIdentifier != null) + 'EndpointIdentifier': endpointIdentifier, + if (endpointType != null) 'EndpointType': endpointType.toValue(), + if (engineName != null) 'EngineName': engineName, + if (exactSettings != null) 'ExactSettings': exactSettings, + if (externalTableDefinition != null) + 'ExternalTableDefinition': externalTableDefinition, + if (extraConnectionAttributes != null) + 'ExtraConnectionAttributes': extraConnectionAttributes, + if (gcpMySQLSettings != null) 'GcpMySQLSettings': gcpMySQLSettings, + if (iBMDb2Settings != null) 'IBMDb2Settings': iBMDb2Settings, + if (kafkaSettings != null) 'KafkaSettings': kafkaSettings, + if (kinesisSettings != null) 'KinesisSettings': kinesisSettings, + if (microsoftSQLServerSettings != null) + 'MicrosoftSQLServerSettings': microsoftSQLServerSettings, + if (mongoDbSettings != null) 'MongoDbSettings': mongoDbSettings, + if (mySQLSettings != null) 'MySQLSettings': mySQLSettings, + if (neptuneSettings != null) 'NeptuneSettings': neptuneSettings, + if (oracleSettings != null) 'OracleSettings': oracleSettings, + if (password != null) 'Password': password, + if (port != null) 'Port': port, + if (postgreSQLSettings != null) + 'PostgreSQLSettings': postgreSQLSettings, + if (redisSettings != null) 'RedisSettings': redisSettings, + if (redshiftSettings != null) 'RedshiftSettings': redshiftSettings, + if (s3Settings != null) 'S3Settings': s3Settings, + if (serverName != null) 'ServerName': serverName, + if (serviceAccessRoleArn != null) + 'ServiceAccessRoleArn': serviceAccessRoleArn, + if (sslMode != null) 'SslMode': sslMode.toValue(), + if (sybaseSettings != null) 'SybaseSettings': sybaseSettings, + if (timestreamSettings != null) + 'TimestreamSettings': timestreamSettings, + if (username != null) 'Username': username, + }, + ); + + return ModifyEndpointResponse.fromJson(jsonResponse.body); + } + + /// Modifies an existing DMS event notification subscription. + /// + /// May throw [ResourceQuotaExceededFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [SNSInvalidTopicFault]. + /// May throw [SNSNoAuthorizationFault]. + /// May throw [KMSAccessDeniedFault]. + /// May throw [KMSDisabledFault]. + /// May throw [KMSInvalidStateFault]. + /// May throw [KMSNotFoundFault]. + /// May throw [KMSThrottlingFault]. + /// + /// Parameter [subscriptionName] : + /// The name of the DMS event notification subscription to be modified. + /// + /// Parameter [enabled] : + /// A Boolean value; set to true to activate the subscription. + /// + /// Parameter [eventCategories] : + /// A list of event categories for a source type that you want to subscribe + /// to. Use the DescribeEventCategories action to see a list of + /// event categories. + /// + /// Parameter [snsTopicArn] : + /// The Amazon Resource Name (ARN) of the Amazon SNS topic created for event + /// notification. The ARN is created by Amazon SNS when you create a topic and + /// subscribe to it. + /// + /// Parameter [sourceType] : + /// The type of DMS resource that generates the events you want to subscribe + /// to. + /// + /// Valid values: replication-instance | replication-task + Future modifyEventSubscription({ + required String subscriptionName, + bool? enabled, + List? eventCategories, + String? snsTopicArn, + String? sourceType, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyEventSubscription' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'SubscriptionName': subscriptionName, + if (enabled != null) 'Enabled': enabled, + if (eventCategories != null) 'EventCategories': eventCategories, + if (snsTopicArn != null) 'SnsTopicArn': snsTopicArn, + if (sourceType != null) 'SourceType': sourceType, + }, + ); + + return ModifyEventSubscriptionResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified instance profile using the provided parameters. + /// + /// All migration projects associated with the instance profile must be + /// deleted or modified before you can modify the instance profile. + /// + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. + /// + /// Parameter [instanceProfileIdentifier] : + /// The identifier of the instance profile. Identifiers must begin with a + /// letter and must contain only ASCII letters, digits, and hyphens. They + /// can't end with a hyphen, or contain two consecutive hyphens. + /// + /// Parameter [availabilityZone] : + /// The Availability Zone where the instance profile runs. + /// + /// Parameter [description] : + /// A user-friendly description for the instance profile. + /// + /// Parameter [instanceProfileName] : + /// A user-friendly name for the instance profile. + /// + /// Parameter [kmsKeyArn] : + /// The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the + /// connection parameters for the instance profile. + /// + /// If you don't specify a value for the KmsKeyArn parameter, + /// then DMS uses your default encryption key. + /// + /// KMS creates the default encryption key for your Amazon Web Services + /// account. Your Amazon Web Services account has a different default + /// encryption key for each Amazon Web Services Region. + /// + /// Parameter [networkType] : + /// Specifies the network type for the instance profile. A value of + /// IPV4 represents an instance profile with IPv4 network type + /// and only supports IPv4 addressing. A value of IPV6 represents + /// an instance profile with IPv6 network type and only supports IPv6 + /// addressing. A value of DUAL represents an instance profile + /// with dual network type that supports IPv4 and IPv6 addressing. + /// + /// Parameter [publiclyAccessible] : + /// Specifies the accessibility options for the instance profile. A value of + /// true represents an instance profile with a public IP address. + /// A value of false represents an instance profile with a + /// private IP address. The default value is true. + /// + /// Parameter [subnetGroupIdentifier] : + /// A subnet group to associate with the instance profile. + /// + /// Parameter [vpcSecurityGroups] : + /// Specifies the VPC security groups to be used with the instance profile. + /// The VPC security group must work with the VPC containing the instance + /// profile. + Future modifyInstanceProfile({ + required String instanceProfileIdentifier, + String? availabilityZone, + String? description, + String? instanceProfileName, + String? kmsKeyArn, + String? networkType, + bool? publiclyAccessible, + String? subnetGroupIdentifier, + List? vpcSecurityGroups, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyInstanceProfile' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'InstanceProfileIdentifier': instanceProfileIdentifier, + if (availabilityZone != null) 'AvailabilityZone': availabilityZone, + if (description != null) 'Description': description, + if (instanceProfileName != null) + 'InstanceProfileName': instanceProfileName, + if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn, + if (networkType != null) 'NetworkType': networkType, + if (publiclyAccessible != null) + 'PubliclyAccessible': publiclyAccessible, + if (subnetGroupIdentifier != null) + 'SubnetGroupIdentifier': subnetGroupIdentifier, + if (vpcSecurityGroups != null) 'VpcSecurityGroups': vpcSecurityGroups, + }, + ); + + return ModifyInstanceProfileResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified migration project using the provided parameters. + /// + /// The migration project must be closed before you can modify it. + /// + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. + /// + /// Parameter [migrationProjectIdentifier] : + /// The identifier of the migration project. Identifiers must begin with a + /// letter and must contain only ASCII letters, digits, and hyphens. They + /// can't end with a hyphen, or contain two consecutive hyphens. + /// + /// Parameter [description] : + /// A user-friendly description of the migration project. + /// + /// Parameter [instanceProfileIdentifier] : + /// The name or Amazon Resource Name (ARN) for the instance profile. + /// + /// Parameter [migrationProjectName] : + /// A user-friendly name for the migration project. + /// + /// Parameter [schemaConversionApplicationAttributes] : + /// The schema conversion application attributes, including the Amazon S3 + /// bucket name and Amazon S3 role ARN. + /// + /// Parameter [sourceDataProviderDescriptors] : + /// Information about the source data provider, including the name, ARN, and + /// Amazon Web Services Secrets Manager parameters. + /// + /// Parameter [targetDataProviderDescriptors] : + /// Information about the target data provider, including the name, ARN, and + /// Amazon Web Services Secrets Manager parameters. + /// + /// Parameter [transformationRules] : + /// The settings in JSON format for migration rules. Migration rules make it + /// possible for you to change the object names according to the rules that + /// you specify. For example, you can change an object name to lowercase or + /// uppercase, add or remove a prefix or suffix, or rename objects. + Future modifyMigrationProject({ + required String migrationProjectIdentifier, + String? description, + String? instanceProfileIdentifier, + String? migrationProjectName, + SCApplicationAttributes? schemaConversionApplicationAttributes, + List? sourceDataProviderDescriptors, + List? targetDataProviderDescriptors, + String? transformationRules, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyMigrationProject' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, + if (description != null) 'Description': description, + if (instanceProfileIdentifier != null) + 'InstanceProfileIdentifier': instanceProfileIdentifier, + if (migrationProjectName != null) + 'MigrationProjectName': migrationProjectName, + if (schemaConversionApplicationAttributes != null) + 'SchemaConversionApplicationAttributes': + schemaConversionApplicationAttributes, + if (sourceDataProviderDescriptors != null) + 'SourceDataProviderDescriptors': sourceDataProviderDescriptors, + if (targetDataProviderDescriptors != null) + 'TargetDataProviderDescriptors': targetDataProviderDescriptors, + if (transformationRules != null) + 'TransformationRules': transformationRules, + }, + ); + + return ModifyMigrationProjectResponse.fromJson(jsonResponse.body); + } + + /// Modifies an existing DMS Serverless replication configuration that you can + /// use to start a replication. This command includes input validation and + /// logic to check the state of any replication that uses this configuration. + /// You can only modify a replication configuration before any replication + /// that uses it has started. As soon as you have initially started a + /// replication with a given configuiration, you can't modify that + /// configuration, even if you stop it. + /// + /// Other run statuses that allow you to run this command include FAILED and + /// CREATED. A provisioning state that allows you to run this command is + /// FAILED_PROVISION. + /// + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [ReplicationSubnetGroupDoesNotCoverEnoughAZs]. + /// May throw [InvalidSubnet]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [InvalidResourceStateFault]. + /// + /// Parameter [replicationConfigArn] : + /// The Amazon Resource Name of the replication to modify. + /// + /// Parameter [computeConfig] : + /// Configuration parameters for provisioning an DMS Serverless replication. + /// + /// Parameter [replicationConfigIdentifier] : + /// The new replication config to apply to the replication. + /// + /// Parameter [replicationSettings] : + /// The settings for the replication. + /// + /// Parameter [replicationType] : + /// The type of replication. + /// + /// Parameter [sourceEndpointArn] : + /// The Amazon Resource Name (ARN) of the source endpoint for this DMS + /// serverless replication configuration. + /// + /// Parameter [supplementalSettings] : + /// Additional settings for the replication. + /// + /// Parameter [tableMappings] : + /// Table mappings specified in the replication. + /// + /// Parameter [targetEndpointArn] : + /// The Amazon Resource Name (ARN) of the target endpoint for this DMS + /// serverless replication configuration. + Future modifyReplicationConfig({ + required String replicationConfigArn, + ComputeConfig? computeConfig, + String? replicationConfigIdentifier, + String? replicationSettings, + MigrationTypeValue? replicationType, + String? sourceEndpointArn, + String? supplementalSettings, + String? tableMappings, + String? targetEndpointArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationConfig' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationConfigArn': replicationConfigArn, + if (computeConfig != null) 'ComputeConfig': computeConfig, + if (replicationConfigIdentifier != null) + 'ReplicationConfigIdentifier': replicationConfigIdentifier, + if (replicationSettings != null) + 'ReplicationSettings': replicationSettings, + if (replicationType != null) + 'ReplicationType': replicationType.toValue(), + if (sourceEndpointArn != null) 'SourceEndpointArn': sourceEndpointArn, + if (supplementalSettings != null) + 'SupplementalSettings': supplementalSettings, + if (tableMappings != null) 'TableMappings': tableMappings, + if (targetEndpointArn != null) 'TargetEndpointArn': targetEndpointArn, + }, + ); + + return ModifyReplicationConfigResponse.fromJson(jsonResponse.body); + } + + /// Modifies the replication instance to apply new settings. You can change + /// one or more parameters by specifying these parameters and the new values + /// in the request. + /// + /// Some settings are applied during the maintenance window. + ///

      + /// + /// May throw [AccessDeniedFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [InsufficientResourceCapacityFault]. + /// May throw [StorageQuotaExceededFault]. + /// May throw [UpgradeDependencyFailureFault]. + /// + /// Parameter [replicationInstanceArn] : + /// The Amazon Resource Name (ARN) of the replication instance. + /// + /// Parameter [allocatedStorage] : + /// The amount of storage (in gigabytes) to be allocated for the replication + /// instance. + /// + /// Parameter [allowMajorVersionUpgrade] : + /// Indicates that major version upgrades are allowed. Changing this parameter + /// does not result in an outage, and the change is asynchronously applied as + /// soon as possible. + /// + /// This parameter must be set to true when specifying a value + /// for the EngineVersion parameter that is a different major + /// version than the replication instance's current version. + /// + /// Parameter [applyImmediately] : + /// Indicates whether the changes should be applied immediately or during the + /// next maintenance window. + /// + /// Parameter [autoMinorVersionUpgrade] : + /// A value that indicates that minor version upgrades are applied + /// automatically to the replication instance during the maintenance window. + /// Changing this parameter doesn't result in an outage, except in the case + /// described following. The change is asynchronously applied as soon as + /// possible. + /// + /// An outage does result if these factors apply: + /// + ///

        + ///
      • + /// This parameter is set to true during the maintenance window. + ///
      • + ///
      • + /// A newer minor version is available. + ///
      • + ///
      • + /// DMS has enabled automatic patching for the given engine version. + ///
      • + ///
      + /// + /// Parameter [engineVersion] : + /// The engine version number of the replication instance. + /// + /// When modifying a major engine version of an instance, also set + /// AllowMajorVersionUpgrade to true. + /// + /// Parameter [multiAZ] : + /// Specifies whether the replication instance is a Multi-AZ deployment. You + /// can't set the AvailabilityZone parameter if the Multi-AZ + /// parameter is set to true. + /// + /// Parameter [networkType] : + /// The type of IP address protocol used by a replication instance, such as + /// IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 + /// only is not yet supported. + /// + /// Parameter [preferredMaintenanceWindow] : + /// The weekly time range (in UTC) during which system maintenance can occur, + /// which might result in an outage. Changing this parameter does not result + /// in an outage, except in the following situation, and the change is + /// asynchronously applied as soon as possible. If moving this window to the + /// current time, there must be at least 30 minutes between the current time + /// and end of the window to ensure pending changes are applied. + /// + /// Default: Uses existing setting + /// + /// Format: ddd:hh24:mi-ddd:hh24:mi + /// + /// Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun + /// + /// Constraints: Must be at least 30 minutes + /// + /// Parameter [replicationInstanceClass] : + /// The compute and memory capacity of the replication instance as defined for + /// the specified replication instance class. For example to specify the + /// instance class dms.c4.large, set this parameter to + /// "dms.c4.large". + /// + /// For more information on the settings and capacities for the available + /// replication instance classes, see + /// Selecting the right DMS replication instance for your migration. + /// + /// Parameter [replicationInstanceIdentifier] : + /// The replication instance identifier. This parameter is stored as a + /// lowercase string. + /// + /// Parameter [vpcSecurityGroupIds] : + /// Specifies the VPC security group to be used with the replication instance. + /// The VPC security group must work with the VPC containing the replication + /// instance. + Future modifyReplicationInstance({ + required String replicationInstanceArn, + int? allocatedStorage, + bool? allowMajorVersionUpgrade, + bool? applyImmediately, + bool? autoMinorVersionUpgrade, + String? engineVersion, + bool? multiAZ, + String? networkType, + String? preferredMaintenanceWindow, + String? replicationInstanceClass, + String? replicationInstanceIdentifier, + List? vpcSecurityGroupIds, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationInstance' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationInstanceArn': replicationInstanceArn, + if (allocatedStorage != null) 'AllocatedStorage': allocatedStorage, + if (allowMajorVersionUpgrade != null) + 'AllowMajorVersionUpgrade': allowMajorVersionUpgrade, + if (applyImmediately != null) 'ApplyImmediately': applyImmediately, + if (autoMinorVersionUpgrade != null) + 'AutoMinorVersionUpgrade': autoMinorVersionUpgrade, + if (engineVersion != null) 'EngineVersion': engineVersion, + if (multiAZ != null) 'MultiAZ': multiAZ, + if (networkType != null) 'NetworkType': networkType, + if (preferredMaintenanceWindow != null) + 'PreferredMaintenanceWindow': preferredMaintenanceWindow, + if (replicationInstanceClass != null) + 'ReplicationInstanceClass': replicationInstanceClass, + if (replicationInstanceIdentifier != null) + 'ReplicationInstanceIdentifier': replicationInstanceIdentifier, + if (vpcSecurityGroupIds != null) + 'VpcSecurityGroupIds': vpcSecurityGroupIds, + }, + ); + + return ModifyReplicationInstanceResponse.fromJson(jsonResponse.body); + } + + /// Modifies the settings for the specified replication subnet group. /// - /// However, suppose that you follow this with a call to modify-endpoint - /// ... --endpoint-settings '{"b":2}' --exact-settings ... for that - /// same endpoint again. Then the endpoint has the following settings: - /// '{"b":2}'. All existing settings are replaced with the exact - /// settings that you specify. + /// May throw [AccessDeniedFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [SubnetAlreadyInUse]. + /// May throw [ReplicationSubnetGroupDoesNotCoverEnoughAZs]. + /// May throw [InvalidSubnet]. /// - /// Parameter [externalTableDefinition] : - /// The external table definition. + /// Parameter [replicationSubnetGroupIdentifier] : + /// The name of the replication instance subnet group. /// - /// Parameter [extraConnectionAttributes] : - /// Additional attributes associated with the connection. To reset this - /// parameter, pass the empty string ("") as an argument. + /// Parameter [subnetIds] : + /// A list of subnet IDs. /// - /// Parameter [gcpMySQLSettings] : - /// Settings in JSON format for the source GCP MySQL endpoint. + /// Parameter [replicationSubnetGroupDescription] : + /// A description for the replication instance subnet group. + Future modifyReplicationSubnetGroup({ + required String replicationSubnetGroupIdentifier, + required List subnetIds, + String? replicationSubnetGroupDescription, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationSubnetGroup' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationSubnetGroupIdentifier': replicationSubnetGroupIdentifier, + 'SubnetIds': subnetIds, + if (replicationSubnetGroupDescription != null) + 'ReplicationSubnetGroupDescription': + replicationSubnetGroupDescription, + }, + ); + + return ModifyReplicationSubnetGroupResponse.fromJson(jsonResponse.body); + } + + /// Modifies the specified replication task. /// - /// Parameter [iBMDb2Settings] : - /// Settings in JSON format for the source IBM Db2 LUW endpoint. For - /// information about other available settings, see Extra - /// connection attributes when using Db2 LUW as a source for DMS in the - /// Database Migration Service User Guide. + /// You can't modify the task endpoints. The task must be stopped before you + /// can modify it. /// - /// Parameter [kafkaSettings] : - /// Settings in JSON format for the target Apache Kafka endpoint. For more - /// information about the available settings, see Using - /// object mapping to migrate data to a Kafka topic in the Database - /// Migration Service User Guide. + /// For more information about DMS tasks, see Working + /// with Migration Tasks in the Database Migration Service User + /// Guide. /// - /// Parameter [kinesisSettings] : - /// Settings in JSON format for the target endpoint for Amazon Kinesis Data - /// Streams. For more information about the available settings, see Using - /// object mapping to migrate data to a Kinesis data stream in the - /// Database Migration Service User Guide. + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [KMSKeyNotAccessibleFault]. /// - /// Parameter [microsoftSQLServerSettings] : - /// Settings in JSON format for the source and target Microsoft SQL Server - /// endpoint. For information about other available settings, see Extra - /// connection attributes when using SQL Server as a source for DMS and - /// Extra connection attributes when using SQL Server as a target for DMS - /// in the Database Migration Service User Guide. + /// Parameter [replicationTaskArn] : + /// The Amazon Resource Name (ARN) of the replication task. /// - /// Parameter [mongoDbSettings] : - /// Settings in JSON format for the source MongoDB endpoint. For more - /// information about the available settings, see the configuration properties - /// section in Endpoint - /// configuration settings when using MongoDB as a source for Database - /// Migration Service in the Database Migration Service User Guide. + /// Parameter [cdcStartPosition] : + /// Indicates when you want a change data capture (CDC) operation to start. + /// Use either CdcStartPosition or CdcStartTime to specify when you want a CDC + /// operation to start. Specifying both values results in an error. /// - /// Parameter [mySQLSettings] : - /// Settings in JSON format for the source and target MySQL endpoint. For - /// information about other available settings, see Extra - /// connection attributes when using MySQL as a source for DMS and Extra - /// connection attributes when using a MySQL-compatible database as a target - /// for DMS in the Database Migration Service User Guide. + /// The value can be in date, checkpoint, or LSN/SCN format. /// - /// Parameter [neptuneSettings] : - /// Settings in JSON format for the target Amazon Neptune endpoint. For more - /// information about the available settings, see Specifying - /// graph-mapping rules using Gremlin and R2RML for Amazon Neptune as a - /// target in the Database Migration Service User Guide. + /// Date Example: --cdc-start-position “2018-03-08T12:12:12” /// - /// Parameter [oracleSettings] : - /// Settings in JSON format for the source and target Oracle endpoint. For - /// information about other available settings, see Extra - /// connection attributes when using Oracle as a source for DMS and - /// Extra connection attributes when using Oracle as a target for DMS in - /// the Database Migration Service User Guide. + /// Checkpoint Example: --cdc-start-position + /// "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" /// - /// Parameter [password] : - /// The password to be used to login to the endpoint database. + /// LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” + /// + /// When you use this task setting with a source PostgreSQL database, a + /// logical replication slot should already be created and associated with the + /// source endpoint. You can verify this by setting the slotName + /// extra connection attribute to the name of this logical replication slot. + /// For more information, see Extra + /// Connection Attributes When Using PostgreSQL as a Source for DMS. + /// /// - /// Parameter [port] : - /// The port used by the endpoint database. + /// Parameter [cdcStartTime] : + /// Indicates the start time for a change data capture (CDC) operation. Use + /// either CdcStartTime or CdcStartPosition to specify when you want a CDC + /// operation to start. Specifying both values results in an error. /// - /// Parameter [postgreSQLSettings] : - /// Settings in JSON format for the source and target PostgreSQL endpoint. For - /// information about other available settings, see Extra - /// connection attributes when using PostgreSQL as a source for DMS and - /// Extra connection attributes when using PostgreSQL as a target for DMS - /// in the Database Migration Service User Guide. + /// Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” /// - /// Parameter [redisSettings] : - /// Settings in JSON format for the Redis target endpoint. + /// Parameter [cdcStopPosition] : + /// Indicates when you want a change data capture (CDC) operation to stop. The + /// value can be either server time or commit time. /// - /// Parameter [s3Settings] : - /// Settings in JSON format for the target Amazon S3 endpoint. For more - /// information about the available settings, see Extra - /// Connection Attributes When Using Amazon S3 as a Target for DMS in the - /// Database Migration Service User Guide. + /// Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12” /// - /// Parameter [serverName] : - /// The name of the server where the endpoint database resides. + /// Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“ /// - /// Parameter [serviceAccessRoleArn] : - /// The Amazon Resource Name (ARN) for the IAM role you want to use to modify - /// the endpoint. The role must allow the iam:PassRole action. + /// Parameter [migrationType] : + /// The migration type. Valid values: full-load | + /// cdc | full-load-and-cdc /// - /// Parameter [sslMode] : - /// The SSL mode used to connect to the endpoint. The default value is - /// none. + /// Parameter [replicationTaskIdentifier] : + /// The replication task identifier. /// - /// Parameter [sybaseSettings] : - /// Settings in JSON format for the source and target SAP ASE endpoint. For - /// information about other available settings, see Extra - /// connection attributes when using SAP ASE as a source for DMS and Extra - /// connection attributes when using SAP ASE as a target for DMS in the - /// Database Migration Service User Guide. + /// Constraints: /// - /// Parameter [username] : - /// The user name to be used to login to the endpoint database. - Future modifyEndpoint({ - required String endpointArn, - String? certificateArn, - String? databaseName, - DmsTransferSettings? dmsTransferSettings, - DocDbSettings? docDbSettings, - DynamoDbSettings? dynamoDbSettings, - ElasticsearchSettings? elasticsearchSettings, - String? endpointIdentifier, - ReplicationEndpointTypeValue? endpointType, - String? engineName, - bool? exactSettings, - String? externalTableDefinition, - String? extraConnectionAttributes, - GcpMySQLSettings? gcpMySQLSettings, - IBMDb2Settings? iBMDb2Settings, - KafkaSettings? kafkaSettings, - KinesisSettings? kinesisSettings, - MicrosoftSQLServerSettings? microsoftSQLServerSettings, - MongoDbSettings? mongoDbSettings, - MySQLSettings? mySQLSettings, - NeptuneSettings? neptuneSettings, - OracleSettings? oracleSettings, - String? password, - int? port, - PostgreSQLSettings? postgreSQLSettings, - RedisSettings? redisSettings, - RedshiftSettings? redshiftSettings, - S3Settings? s3Settings, - String? serverName, - String? serviceAccessRoleArn, - DmsSslModeValue? sslMode, - SybaseSettings? sybaseSettings, - String? username, + ///
        + ///
      • + /// Must contain 1-255 alphanumeric characters or hyphens. + ///
      • + ///
      • + /// First character must be a letter. + ///
      • + ///
      • + /// Cannot end with a hyphen or contain two consecutive hyphens. + ///
      • + ///
      + /// + /// Parameter [replicationTaskSettings] : + /// JSON file that contains settings for the task, such as task metadata + /// settings. + /// + /// Parameter [tableMappings] : + /// When using the CLI or boto3, provide the path of the JSON file that + /// contains the table mappings. Precede the path with file://. + /// For example, --table-mappings file://mappingfile.json. When + /// working with the DMS API, provide the JSON as the parameter value. + /// + /// Parameter [taskData] : + /// Supplemental information that the task requires to migrate the data for + /// certain source and target endpoints. For more information, see Specifying + /// Supplemental Data for Task Settings in the Database Migration + /// Service User Guide. + Future modifyReplicationTask({ + required String replicationTaskArn, + String? cdcStartPosition, + DateTime? cdcStartTime, + String? cdcStopPosition, + MigrationTypeValue? migrationType, + String? replicationTaskIdentifier, + String? replicationTaskSettings, + String? tableMappings, + String? taskData, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ModifyEndpoint' + 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationTask' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3365,96 +5425,47 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'EndpointArn': endpointArn, - if (certificateArn != null) 'CertificateArn': certificateArn, - if (databaseName != null) 'DatabaseName': databaseName, - if (dmsTransferSettings != null) - 'DmsTransferSettings': dmsTransferSettings, - if (docDbSettings != null) 'DocDbSettings': docDbSettings, - if (dynamoDbSettings != null) 'DynamoDbSettings': dynamoDbSettings, - if (elasticsearchSettings != null) - 'ElasticsearchSettings': elasticsearchSettings, - if (endpointIdentifier != null) - 'EndpointIdentifier': endpointIdentifier, - if (endpointType != null) 'EndpointType': endpointType.toValue(), - if (engineName != null) 'EngineName': engineName, - if (exactSettings != null) 'ExactSettings': exactSettings, - if (externalTableDefinition != null) - 'ExternalTableDefinition': externalTableDefinition, - if (extraConnectionAttributes != null) - 'ExtraConnectionAttributes': extraConnectionAttributes, - if (gcpMySQLSettings != null) 'GcpMySQLSettings': gcpMySQLSettings, - if (iBMDb2Settings != null) 'IBMDb2Settings': iBMDb2Settings, - if (kafkaSettings != null) 'KafkaSettings': kafkaSettings, - if (kinesisSettings != null) 'KinesisSettings': kinesisSettings, - if (microsoftSQLServerSettings != null) - 'MicrosoftSQLServerSettings': microsoftSQLServerSettings, - if (mongoDbSettings != null) 'MongoDbSettings': mongoDbSettings, - if (mySQLSettings != null) 'MySQLSettings': mySQLSettings, - if (neptuneSettings != null) 'NeptuneSettings': neptuneSettings, - if (oracleSettings != null) 'OracleSettings': oracleSettings, - if (password != null) 'Password': password, - if (port != null) 'Port': port, - if (postgreSQLSettings != null) - 'PostgreSQLSettings': postgreSQLSettings, - if (redisSettings != null) 'RedisSettings': redisSettings, - if (redshiftSettings != null) 'RedshiftSettings': redshiftSettings, - if (s3Settings != null) 'S3Settings': s3Settings, - if (serverName != null) 'ServerName': serverName, - if (serviceAccessRoleArn != null) - 'ServiceAccessRoleArn': serviceAccessRoleArn, - if (sslMode != null) 'SslMode': sslMode.toValue(), - if (sybaseSettings != null) 'SybaseSettings': sybaseSettings, - if (username != null) 'Username': username, + 'ReplicationTaskArn': replicationTaskArn, + if (cdcStartPosition != null) 'CdcStartPosition': cdcStartPosition, + if (cdcStartTime != null) + 'CdcStartTime': unixTimestampToJson(cdcStartTime), + if (cdcStopPosition != null) 'CdcStopPosition': cdcStopPosition, + if (migrationType != null) 'MigrationType': migrationType.toValue(), + if (replicationTaskIdentifier != null) + 'ReplicationTaskIdentifier': replicationTaskIdentifier, + if (replicationTaskSettings != null) + 'ReplicationTaskSettings': replicationTaskSettings, + if (tableMappings != null) 'TableMappings': tableMappings, + if (taskData != null) 'TaskData': taskData, }, ); - return ModifyEndpointResponse.fromJson(jsonResponse.body); + return ModifyReplicationTaskResponse.fromJson(jsonResponse.body); } - /// Modifies an existing DMS event notification subscription. + /// Moves a replication task from its current replication instance to a + /// different target replication instance using the specified parameters. The + /// target replication instance must be created with the same or later DMS + /// version as the current replication instance. /// - /// May throw [ResourceQuotaExceededFault]. + /// May throw [AccessDeniedFault]. + /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. - /// May throw [SNSInvalidTopicFault]. - /// May throw [SNSNoAuthorizationFault]. - /// May throw [KMSAccessDeniedFault]. - /// May throw [KMSDisabledFault]. - /// May throw [KMSInvalidStateFault]. - /// May throw [KMSNotFoundFault]. - /// May throw [KMSThrottlingFault]. - /// - /// Parameter [subscriptionName] : - /// The name of the DMS event notification subscription to be modified. - /// - /// Parameter [enabled] : - /// A Boolean value; set to true to activate the subscription. - /// - /// Parameter [eventCategories] : - /// A list of event categories for a source type that you want to subscribe - /// to. Use the DescribeEventCategories action to see a list of - /// event categories. - /// - /// Parameter [snsTopicArn] : - /// The Amazon Resource Name (ARN) of the Amazon SNS topic created for event - /// notification. The ARN is created by Amazon SNS when you create a topic and - /// subscribe to it. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. /// - /// Parameter [sourceType] : - /// The type of DMS resource that generates the events you want to subscribe - /// to. + /// Parameter [replicationTaskArn] : + /// The Amazon Resource Name (ARN) of the task that you want to move. /// - /// Valid values: replication-instance | replication-task - Future modifyEventSubscription({ - required String subscriptionName, - bool? enabled, - List? eventCategories, - String? snsTopicArn, - String? sourceType, + /// Parameter [targetReplicationInstanceArn] : + /// The ARN of the replication instance where you want to move the task to. + Future moveReplicationTask({ + required String replicationTaskArn, + required String targetReplicationInstanceArn, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ModifyEventSubscription' + 'X-Amz-Target': 'AmazonDMSv20160101.MoveReplicationTask' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3463,149 +5474,84 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'SubscriptionName': subscriptionName, - if (enabled != null) 'Enabled': enabled, - if (eventCategories != null) 'EventCategories': eventCategories, - if (snsTopicArn != null) 'SnsTopicArn': snsTopicArn, - if (sourceType != null) 'SourceType': sourceType, + 'ReplicationTaskArn': replicationTaskArn, + 'TargetReplicationInstanceArn': targetReplicationInstanceArn, }, ); - return ModifyEventSubscriptionResponse.fromJson(jsonResponse.body); + return MoveReplicationTaskResponse.fromJson(jsonResponse.body); } - /// Modifies the replication instance to apply new settings. You can change - /// one or more parameters by specifying these parameters and the new values - /// in the request. - /// - /// Some settings are applied during the maintenance window. - ///

      + /// Reboots a replication instance. Rebooting results in a momentary outage, + /// until the replication instance becomes available again. /// - /// May throw [AccessDeniedFault]. - /// May throw [InvalidResourceStateFault]. - /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. - /// May throw [InsufficientResourceCapacityFault]. - /// May throw [StorageQuotaExceededFault]. - /// May throw [UpgradeDependencyFailureFault]. + /// May throw [InvalidResourceStateFault]. /// /// Parameter [replicationInstanceArn] : /// The Amazon Resource Name (ARN) of the replication instance. /// - /// Parameter [allocatedStorage] : - /// The amount of storage (in gigabytes) to be allocated for the replication - /// instance. - /// - /// Parameter [allowMajorVersionUpgrade] : - /// Indicates that major version upgrades are allowed. Changing this parameter - /// does not result in an outage, and the change is asynchronously applied as - /// soon as possible. - /// - /// This parameter must be set to true when specifying a value - /// for the EngineVersion parameter that is a different major - /// version than the replication instance's current version. - /// - /// Parameter [applyImmediately] : - /// Indicates whether the changes should be applied immediately or during the - /// next maintenance window. - /// - /// Parameter [autoMinorVersionUpgrade] : - /// A value that indicates that minor version upgrades are applied - /// automatically to the replication instance during the maintenance window. - /// Changing this parameter doesn't result in an outage, except in the case - /// described following. The change is asynchronously applied as soon as - /// possible. - /// - /// An outage does result if these factors apply: - /// - ///

        - ///
      • - /// This parameter is set to true during the maintenance window. - ///
      • - ///
      • - /// A newer minor version is available. - ///
      • - ///
      • - /// DMS has enabled automatic patching for the given engine version. - ///
      • - ///
      - /// When AutoMinorVersionUpgrade is enabled, DMS uses the current - /// default engine version when you modify a replication instance. For - /// example, if you set EngineVersion to a lower version number - /// than the current default version, DMS uses the default version. - /// - /// If AutoMinorVersionUpgrade isn’t enabled when you - /// modify a replication instance, DMS uses the engine version specified by - /// the EngineVersion parameter. - /// - /// Parameter [engineVersion] : - /// The engine version number of the replication instance. - /// - /// When modifying a major engine version of an instance, also set - /// AllowMajorVersionUpgrade to true. - /// - /// Parameter [multiAZ] : - /// Specifies whether the replication instance is a Multi-AZ deployment. You - /// can't set the AvailabilityZone parameter if the Multi-AZ - /// parameter is set to true. - /// - /// Parameter [networkType] : - /// The type of IP address protocol used by a replication instance, such as - /// IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 - /// only is not yet supported. - /// - /// Parameter [preferredMaintenanceWindow] : - /// The weekly time range (in UTC) during which system maintenance can occur, - /// which might result in an outage. Changing this parameter does not result - /// in an outage, except in the following situation, and the change is - /// asynchronously applied as soon as possible. If moving this window to the - /// current time, there must be at least 30 minutes between the current time - /// and end of the window to ensure pending changes are applied. - /// - /// Default: Uses existing setting - /// - /// Format: ddd:hh24:mi-ddd:hh24:mi - /// - /// Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun - /// - /// Constraints: Must be at least 30 minutes + /// Parameter [forceFailover] : + /// If this parameter is true, the reboot is conducted through a + /// Multi-AZ failover. If the instance isn't configured for Multi-AZ, then you + /// can't specify true. ( --force-planned-failover + /// and --force-failover can't both be set to true.) /// - /// Parameter [replicationInstanceClass] : - /// The compute and memory capacity of the replication instance as defined for - /// the specified replication instance class. For example to specify the - /// instance class dms.c4.large, set this parameter to - /// "dms.c4.large". + /// Parameter [forcePlannedFailover] : + /// If this parameter is true, the reboot is conducted through a + /// planned Multi-AZ failover where resources are released and cleaned up + /// prior to conducting the failover. If the instance isn''t configured for + /// Multi-AZ, then you can't specify true. ( + /// --force-planned-failover and --force-failover + /// can't both be set to true.) + Future rebootReplicationInstance({ + required String replicationInstanceArn, + bool? forceFailover, + bool? forcePlannedFailover, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.RebootReplicationInstance' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationInstanceArn': replicationInstanceArn, + if (forceFailover != null) 'ForceFailover': forceFailover, + if (forcePlannedFailover != null) + 'ForcePlannedFailover': forcePlannedFailover, + }, + ); + + return RebootReplicationInstanceResponse.fromJson(jsonResponse.body); + } + + /// Populates the schema for the specified endpoint. This is an asynchronous + /// operation and can take several minutes. You can check the status of this + /// operation by calling the DescribeRefreshSchemasStatus operation. /// - /// For more information on the settings and capacities for the available - /// replication instance classes, see - /// Selecting the right DMS replication instance for your migration. + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. /// - /// Parameter [replicationInstanceIdentifier] : - /// The replication instance identifier. This parameter is stored as a - /// lowercase string. + /// Parameter [endpointArn] : + /// The Amazon Resource Name (ARN) string that uniquely identifies the + /// endpoint. /// - /// Parameter [vpcSecurityGroupIds] : - /// Specifies the VPC security group to be used with the replication instance. - /// The VPC security group must work with the VPC containing the replication - /// instance. - Future modifyReplicationInstance({ + /// Parameter [replicationInstanceArn] : + /// The Amazon Resource Name (ARN) of the replication instance. + Future refreshSchemas({ + required String endpointArn, required String replicationInstanceArn, - int? allocatedStorage, - bool? allowMajorVersionUpgrade, - bool? applyImmediately, - bool? autoMinorVersionUpgrade, - String? engineVersion, - bool? multiAZ, - String? networkType, - String? preferredMaintenanceWindow, - String? replicationInstanceClass, - String? replicationInstanceIdentifier, - List? vpcSecurityGroupIds, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationInstance' + 'X-Amz-Target': 'AmazonDMSv20160101.RefreshSchemas' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3614,55 +5560,44 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { + 'EndpointArn': endpointArn, 'ReplicationInstanceArn': replicationInstanceArn, - if (allocatedStorage != null) 'AllocatedStorage': allocatedStorage, - if (allowMajorVersionUpgrade != null) - 'AllowMajorVersionUpgrade': allowMajorVersionUpgrade, - if (applyImmediately != null) 'ApplyImmediately': applyImmediately, - if (autoMinorVersionUpgrade != null) - 'AutoMinorVersionUpgrade': autoMinorVersionUpgrade, - if (engineVersion != null) 'EngineVersion': engineVersion, - if (multiAZ != null) 'MultiAZ': multiAZ, - if (networkType != null) 'NetworkType': networkType, - if (preferredMaintenanceWindow != null) - 'PreferredMaintenanceWindow': preferredMaintenanceWindow, - if (replicationInstanceClass != null) - 'ReplicationInstanceClass': replicationInstanceClass, - if (replicationInstanceIdentifier != null) - 'ReplicationInstanceIdentifier': replicationInstanceIdentifier, - if (vpcSecurityGroupIds != null) - 'VpcSecurityGroupIds': vpcSecurityGroupIds, }, ); - return ModifyReplicationInstanceResponse.fromJson(jsonResponse.body); + return RefreshSchemasResponse.fromJson(jsonResponse.body); } - /// Modifies the settings for the specified replication subnet group. + /// Reloads the target database table with the source data for a given DMS + /// Serverless replication configuration. + /// + /// You can only use this operation with a task in the RUNNING state, + /// otherwise the service will throw an InvalidResourceStateFault + /// exception. /// - /// May throw [AccessDeniedFault]. /// May throw [ResourceNotFoundFault]. - /// May throw [ResourceQuotaExceededFault]. - /// May throw [SubnetAlreadyInUse]. - /// May throw [ReplicationSubnetGroupDoesNotCoverEnoughAZs]. - /// May throw [InvalidSubnet]. + /// May throw [InvalidResourceStateFault]. /// - /// Parameter [replicationSubnetGroupIdentifier] : - /// The name of the replication instance subnet group. + /// Parameter [replicationConfigArn] : + /// The Amazon Resource Name of the replication config for which to reload + /// tables. /// - /// Parameter [subnetIds] : - /// A list of subnet IDs. + /// Parameter [tablesToReload] : + /// The list of tables to reload. /// - /// Parameter [replicationSubnetGroupDescription] : - /// A description for the replication instance subnet group. - Future modifyReplicationSubnetGroup({ - required String replicationSubnetGroupIdentifier, - required List subnetIds, - String? replicationSubnetGroupDescription, + /// Parameter [reloadOption] : + /// Options for reload. Specify data-reload to reload the data + /// and re-validate it if validation is enabled. Specify + /// validate-only to re-validate the table. This option applies + /// only when validation is enabled for the replication. + Future reloadReplicationTables({ + required String replicationConfigArn, + required List tablesToReload, + ReloadOptionValue? reloadOption, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationSubnetGroup' + 'X-Amz-Target': 'AmazonDMSv20160101.ReloadReplicationTables' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3671,125 +5606,109 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationSubnetGroupIdentifier': replicationSubnetGroupIdentifier, - 'SubnetIds': subnetIds, - if (replicationSubnetGroupDescription != null) - 'ReplicationSubnetGroupDescription': - replicationSubnetGroupDescription, + 'ReplicationConfigArn': replicationConfigArn, + 'TablesToReload': tablesToReload, + if (reloadOption != null) 'ReloadOption': reloadOption.toValue(), }, ); - return ModifyReplicationSubnetGroupResponse.fromJson(jsonResponse.body); + return ReloadReplicationTablesResponse.fromJson(jsonResponse.body); } - /// Modifies the specified replication task. - /// - /// You can't modify the task endpoints. The task must be stopped before you - /// can modify it. + /// Reloads the target database table with the source data. /// - /// For more information about DMS tasks, see Working - /// with Migration Tasks in the Database Migration Service User - /// Guide. + /// You can only use this operation with a task in the RUNNING + /// state, otherwise the service will throw an + /// InvalidResourceStateFault exception. /// - /// May throw [InvalidResourceStateFault]. /// May throw [ResourceNotFoundFault]. - /// May throw [ResourceAlreadyExistsFault]. - /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [InvalidResourceStateFault]. /// /// Parameter [replicationTaskArn] : /// The Amazon Resource Name (ARN) of the replication task. /// - /// Parameter [cdcStartPosition] : - /// Indicates when you want a change data capture (CDC) operation to start. - /// Use either CdcStartPosition or CdcStartTime to specify when you want a CDC - /// operation to start. Specifying both values results in an error. - /// - /// The value can be in date, checkpoint, or LSN/SCN format. - /// - /// Date Example: --cdc-start-position “2018-03-08T12:12:12” - /// - /// Checkpoint Example: --cdc-start-position - /// "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" - /// - /// LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” - /// - /// When you use this task setting with a source PostgreSQL database, a - /// logical replication slot should already be created and associated with the - /// source endpoint. You can verify this by setting the slotName - /// extra connection attribute to the name of this logical replication slot. - /// For more information, see Extra - /// Connection Attributes When Using PostgreSQL as a Source for DMS. - /// - /// - /// Parameter [cdcStartTime] : - /// Indicates the start time for a change data capture (CDC) operation. Use - /// either CdcStartTime or CdcStartPosition to specify when you want a CDC - /// operation to start. Specifying both values results in an error. - /// - /// Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” - /// - /// Parameter [cdcStopPosition] : - /// Indicates when you want a change data capture (CDC) operation to stop. The - /// value can be either server time or commit time. - /// - /// Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12” - /// - /// Commit time example: --cdc-stop-position “commit_time: - /// 2018-02-09T12:12:12“ - /// - /// Parameter [migrationType] : - /// The migration type. Valid values: full-load | - /// cdc | full-load-and-cdc + /// Parameter [tablesToReload] : + /// The name and schema of the table to be reloaded. /// - /// Parameter [replicationTaskIdentifier] : - /// The replication task identifier. + /// Parameter [reloadOption] : + /// Options for reload. Specify data-reload to reload the data + /// and re-validate it if validation is enabled. Specify + /// validate-only to re-validate the table. This option applies + /// only when validation is enabled for the task. /// - /// Constraints: + /// Valid values: data-reload, validate-only /// - ///
        - ///
      • - /// Must contain 1-255 alphanumeric characters or hyphens. - ///
      • - ///
      • - /// First character must be a letter. - ///
      • - ///
      • - /// Cannot end with a hyphen or contain two consecutive hyphens. - ///
      • - ///
      + /// Default value is data-reload. + Future reloadTables({ + required String replicationTaskArn, + required List tablesToReload, + ReloadOptionValue? reloadOption, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.ReloadTables' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationTaskArn': replicationTaskArn, + 'TablesToReload': tablesToReload, + if (reloadOption != null) 'ReloadOption': reloadOption.toValue(), + }, + ); + + return ReloadTablesResponse.fromJson(jsonResponse.body); + } + + /// Removes metadata tags from an DMS resource, including replication + /// instance, endpoint, subnet group, and migration task. For more + /// information, see + /// Tag data type description. /// - /// Parameter [replicationTaskSettings] : - /// JSON file that contains settings for the task, such as task metadata - /// settings. + /// May throw [ResourceNotFoundFault]. /// - /// Parameter [tableMappings] : - /// When using the CLI or boto3, provide the path of the JSON file that - /// contains the table mappings. Precede the path with file://. - /// For example, --table-mappings file://mappingfile.json. When - /// working with the DMS API, provide the JSON as the parameter value. + /// Parameter [resourceArn] : + /// An DMS resource from which you want to remove tag(s). The value for this + /// parameter is an Amazon Resource Name (ARN). /// - /// Parameter [taskData] : - /// Supplemental information that the task requires to migrate the data for - /// certain source and target endpoints. For more information, see Specifying - /// Supplemental Data for Task Settings in the Database Migration - /// Service User Guide. - Future modifyReplicationTask({ - required String replicationTaskArn, - String? cdcStartPosition, - DateTime? cdcStartTime, - String? cdcStopPosition, - MigrationTypeValue? migrationType, - String? replicationTaskIdentifier, - String? replicationTaskSettings, - String? tableMappings, - String? taskData, + /// Parameter [tagKeys] : + /// The tag key (name) of the tag to be removed. + Future removeTagsFromResource({ + required String resourceArn, + required List tagKeys, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ModifyReplicationTask' + 'X-Amz-Target': 'AmazonDMSv20160101.RemoveTagsFromResource' + }; + await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ResourceArn': resourceArn, + 'TagKeys': tagKeys, + }, + ); + } + + /// Runs large-scale assessment (LSA) analysis on every Fleet Advisor + /// collector in your account. + /// + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceNotFoundFault]. + Future + runFleetAdvisorLsaAnalysis() async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.RunFleetAdvisorLsaAnalysis' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3797,48 +5716,32 @@ class DatabaseMigration { exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, - payload: { - 'ReplicationTaskArn': replicationTaskArn, - if (cdcStartPosition != null) 'CdcStartPosition': cdcStartPosition, - if (cdcStartTime != null) - 'CdcStartTime': unixTimestampToJson(cdcStartTime), - if (cdcStopPosition != null) 'CdcStopPosition': cdcStopPosition, - if (migrationType != null) 'MigrationType': migrationType.toValue(), - if (replicationTaskIdentifier != null) - 'ReplicationTaskIdentifier': replicationTaskIdentifier, - if (replicationTaskSettings != null) - 'ReplicationTaskSettings': replicationTaskSettings, - if (tableMappings != null) 'TableMappings': tableMappings, - if (taskData != null) 'TaskData': taskData, - }, ); - return ModifyReplicationTaskResponse.fromJson(jsonResponse.body); + return RunFleetAdvisorLsaAnalysisResponse.fromJson(jsonResponse.body); } - /// Moves a replication task from its current replication instance to a - /// different target replication instance using the specified parameters. The - /// target replication instance must be created with the same or later DMS - /// version as the current replication instance. + /// Applies the extension pack to your target database. An extension pack is + /// an add-on module that emulates functions present in a source database that + /// are required when converting objects to the target database. /// /// May throw [AccessDeniedFault]. /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. /// May throw [KMSKeyNotAccessibleFault]. /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. /// - /// Parameter [replicationTaskArn] : - /// The Amazon Resource Name (ARN) of the task that you want to move. - /// - /// Parameter [targetReplicationInstanceArn] : - /// The ARN of the replication instance where you want to move the task to. - Future moveReplicationTask({ - required String replicationTaskArn, - required String targetReplicationInstanceArn, + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). + Future startExtensionPackAssociation({ + required String migrationProjectIdentifier, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.MoveReplicationTask' + 'X-Amz-Target': 'AmazonDMSv20160101.StartExtensionPackAssociation' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3847,44 +5750,40 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationTaskArn': replicationTaskArn, - 'TargetReplicationInstanceArn': targetReplicationInstanceArn, + 'MigrationProjectIdentifier': migrationProjectIdentifier, }, ); - return MoveReplicationTaskResponse.fromJson(jsonResponse.body); + return StartExtensionPackAssociationResponse.fromJson(jsonResponse.body); } - /// Reboots a replication instance. Rebooting results in a momentary outage, - /// until the replication instance becomes available again. + /// Creates a database migration assessment report by assessing the migration + /// complexity for your source database. A database migration assessment + /// report summarizes all of the schema conversion tasks. It also details the + /// action items for database objects that can't be converted to the database + /// engine of your target database instance. /// - /// May throw [ResourceNotFoundFault]. + /// May throw [AccessDeniedFault]. /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. /// - /// Parameter [replicationInstanceArn] : - /// The Amazon Resource Name (ARN) of the replication instance. - /// - /// Parameter [forceFailover] : - /// If this parameter is true, the reboot is conducted through a - /// Multi-AZ failover. If the instance isn't configured for Multi-AZ, then you - /// can't specify true. ( --force-planned-failover - /// and --force-failover can't both be set to true.) + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [forcePlannedFailover] : - /// If this parameter is true, the reboot is conducted through a - /// planned Multi-AZ failover where resources are released and cleaned up - /// prior to conducting the failover. If the instance isn''t configured for - /// Multi-AZ, then you can't specify true. ( - /// --force-planned-failover and --force-failover - /// can't both be set to true.) - Future rebootReplicationInstance({ - required String replicationInstanceArn, - bool? forceFailover, - bool? forcePlannedFailover, + /// Parameter [selectionRules] : + /// A value that specifies the database objects to assess. + Future startMetadataModelAssessment({ + required String migrationProjectIdentifier, + required String selectionRules, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.RebootReplicationInstance' + 'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelAssessment' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3893,38 +5792,38 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationInstanceArn': replicationInstanceArn, - if (forceFailover != null) 'ForceFailover': forceFailover, - if (forcePlannedFailover != null) - 'ForcePlannedFailover': forcePlannedFailover, + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'SelectionRules': selectionRules, }, ); - return RebootReplicationInstanceResponse.fromJson(jsonResponse.body); + return StartMetadataModelAssessmentResponse.fromJson(jsonResponse.body); } - /// Populates the schema for the specified endpoint. This is an asynchronous - /// operation and can take several minutes. You can check the status of this - /// operation by calling the DescribeRefreshSchemasStatus operation. + /// Converts your source database objects to a format compatible with the + /// target database. /// + /// May throw [AccessDeniedFault]. /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. /// May throw [KMSKeyNotAccessibleFault]. /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. /// - /// Parameter [endpointArn] : - /// The Amazon Resource Name (ARN) string that uniquely identifies the - /// endpoint. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [replicationInstanceArn] : - /// The Amazon Resource Name (ARN) of the replication instance. - Future refreshSchemas({ - required String endpointArn, - required String replicationInstanceArn, + /// Parameter [selectionRules] : + /// A value that specifies the database objects to convert. + Future startMetadataModelConversion({ + required String migrationProjectIdentifier, + required String selectionRules, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.RefreshSchemas' + 'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelConversion' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3933,46 +5832,47 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'EndpointArn': endpointArn, - 'ReplicationInstanceArn': replicationInstanceArn, + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'SelectionRules': selectionRules, }, ); - return RefreshSchemasResponse.fromJson(jsonResponse.body); + return StartMetadataModelConversionResponse.fromJson(jsonResponse.body); } - /// Reloads the target database table with the source data. - /// - /// You can only use this operation with a task in the RUNNING - /// state, otherwise the service will throw an - /// InvalidResourceStateFault exception. + /// Saves your converted code to a file as a SQL script, and stores this file + /// on your Amazon S3 bucket. /// - /// May throw [ResourceNotFoundFault]. + /// May throw [AccessDeniedFault]. /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. + /// May throw [ResourceNotFoundFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. /// - /// Parameter [replicationTaskArn] : - /// The Amazon Resource Name (ARN) of the replication task. - /// - /// Parameter [tablesToReload] : - /// The name and schema of the table to be reloaded. + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). /// - /// Parameter [reloadOption] : - /// Options for reload. Specify data-reload to reload the data - /// and re-validate it if validation is enabled. Specify - /// validate-only to re-validate the table. This option applies - /// only when validation is enabled for the task. + /// Parameter [origin] : + /// Whether to export the metadata model from the source or the target. /// - /// Valid values: data-reload, validate-only + /// Parameter [selectionRules] : + /// A value that specifies the database objects to export. /// - /// Default value is data-reload. - Future reloadTables({ - required String replicationTaskArn, - required List tablesToReload, - ReloadOptionValue? reloadOption, + /// Parameter [fileName] : + /// The name of the model file to create in the Amazon S3 bucket. + Future + startMetadataModelExportAsScript({ + required String migrationProjectIdentifier, + required OriginTypeValue origin, + required String selectionRules, + String? fileName, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.ReloadTables' + 'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelExportAsScript' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -3981,60 +5881,100 @@ class DatabaseMigration { // TODO queryParams headers: headers, payload: { - 'ReplicationTaskArn': replicationTaskArn, - 'TablesToReload': tablesToReload, - if (reloadOption != null) 'ReloadOption': reloadOption.toValue(), + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'Origin': origin.toValue(), + 'SelectionRules': selectionRules, + if (fileName != null) 'FileName': fileName, }, ); - return ReloadTablesResponse.fromJson(jsonResponse.body); + return StartMetadataModelExportAsScriptResponse.fromJson(jsonResponse.body); } - /// Removes metadata tags from an DMS resource, including replication - /// instance, endpoint, subnet group, and migration task. For more - /// information, see - /// Tag data type description. + /// Applies converted database objects to your target database. /// + /// May throw [AccessDeniedFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. /// - /// Parameter [resourceArn] : - /// An DMS resource from which you want to remove tag(s). The value for this - /// parameter is an Amazon Resource Name (ARN). - /// - /// Parameter [tagKeys] : - /// The tag key (name) of the tag to be removed. - Future removeTagsFromResource({ - required String resourceArn, - required List tagKeys, + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). + /// + /// Parameter [selectionRules] : + /// A value that specifies the database objects to export. + /// + /// Parameter [overwriteExtensionPack] : + /// Whether to overwrite the migration project extension pack. An extension + /// pack is an add-on module that emulates functions present in a source + /// database that are required when converting objects to the target database. + Future + startMetadataModelExportToTarget({ + required String migrationProjectIdentifier, + required String selectionRules, + bool? overwriteExtensionPack, }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.RemoveTagsFromResource' + 'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelExportToTarget' }; - await _protocol.send( + final jsonResponse = await _protocol.send( method: 'POST', requestUri: '/', exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, payload: { - 'ResourceArn': resourceArn, - 'TagKeys': tagKeys, + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'SelectionRules': selectionRules, + if (overwriteExtensionPack != null) + 'OverwriteExtensionPack': overwriteExtensionPack, }, ); + + return StartMetadataModelExportToTargetResponse.fromJson(jsonResponse.body); } - /// Runs large-scale assessment (LSA) analysis on every Fleet Advisor - /// collector in your account. + /// Loads the metadata for all the dependent database objects of the parent + /// object. + /// + /// This operation uses your project's Amazon S3 bucket as a metadata cache to + /// improve performance. /// + /// May throw [AccessDeniedFault]. /// May throw [InvalidResourceStateFault]. + /// May throw [ResourceAlreadyExistsFault]. /// May throw [ResourceNotFoundFault]. - Future - runFleetAdvisorLsaAnalysis() async { + /// May throw [KMSKeyNotAccessibleFault]. + /// May throw [ResourceQuotaExceededFault]. + /// May throw [S3ResourceNotFoundFault]. + /// May throw [S3AccessDeniedFault]. + /// + /// Parameter [migrationProjectIdentifier] : + /// The migration project name or Amazon Resource Name (ARN). + /// + /// Parameter [origin] : + /// Whether to load metadata to the source or target database. + /// + /// Parameter [selectionRules] : + /// A value that specifies the database objects to import. + /// + /// Parameter [refresh] : + /// If true, DMS loads metadata for the specified objects from + /// the source database. + Future startMetadataModelImport({ + required String migrationProjectIdentifier, + required OriginTypeValue origin, + required String selectionRules, + bool? refresh, + }) async { final headers = { 'Content-Type': 'application/x-amz-json-1.1', - 'X-Amz-Target': 'AmazonDMSv20160101.RunFleetAdvisorLsaAnalysis' + 'X-Amz-Target': 'AmazonDMSv20160101.StartMetadataModelImport' }; final jsonResponse = await _protocol.send( method: 'POST', @@ -4042,9 +5982,15 @@ class DatabaseMigration { exceptionFnMap: _exceptionFns, // TODO queryParams headers: headers, + payload: { + 'MigrationProjectIdentifier': migrationProjectIdentifier, + 'Origin': origin.toValue(), + 'SelectionRules': selectionRules, + if (refresh != null) 'Refresh': refresh, + }, ); - return RunFleetAdvisorLsaAnalysisResponse.fromJson(jsonResponse.body); + return StartMetadataModelImportResponse.fromJson(jsonResponse.body); } /// Starts the analysis of your source database to provide recommendations of @@ -4090,6 +6036,71 @@ class DatabaseMigration { ); } + /// For a given DMS Serverless replication configuration, DMS connects to the + /// source endpoint and collects the metadata to analyze the replication + /// workload. Using this metadata, DMS then computes and provisions the + /// required capacity and starts replicating to the target endpoint using the + /// server resources that DMS has provisioned for the DMS Serverless + /// replication. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [replicationConfigArn] : + /// The Amazon Resource Name of the replication for which to start + /// replication. + /// + /// Parameter [startReplicationType] : + /// The replication type. + /// + /// Parameter [cdcStartPosition] : + /// Indicates when you want a change data capture (CDC) operation to start. + /// Use either CdcStartPosition or CdcStartTime to + /// specify when you want a CDC operation to start. Specifying both values + /// results in an error. + /// + /// The value can be in date, checkpoint, or LSN/SCN format. + /// + /// Parameter [cdcStartTime] : + /// Indicates the start time for a change data capture (CDC) operation. Use + /// either CdcStartTime or CdcStartPosition to + /// specify when you want a CDC operation to start. Specifying both values + /// results in an error. + /// + /// Parameter [cdcStopPosition] : + /// Indicates when you want a change data capture (CDC) operation to stop. The + /// value can be either server time or commit time. + Future startReplication({ + required String replicationConfigArn, + required String startReplicationType, + String? cdcStartPosition, + DateTime? cdcStartTime, + String? cdcStopPosition, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.StartReplication' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationConfigArn': replicationConfigArn, + 'StartReplicationType': startReplicationType, + if (cdcStartPosition != null) 'CdcStartPosition': cdcStartPosition, + if (cdcStartTime != null) + 'CdcStartTime': unixTimestampToJson(cdcStartTime), + if (cdcStopPosition != null) 'CdcStopPosition': cdcStopPosition, + }, + ); + + return StartReplicationResponse.fromJson(jsonResponse.body); + } + /// Starts the replication task. /// /// For more information about DMS tasks, see startReplicationTask({ required String replicationTaskArn, required StartReplicationTaskTypeValue startReplicationTaskType, @@ -4376,6 +6386,37 @@ class DatabaseMigration { jsonResponse.body); } + /// For a given DMS Serverless replication configuration, DMS stops any and + /// all ongoing DMS Serverless replications. This command doesn't deprovision + /// the stopped replications. + /// + /// May throw [ResourceNotFoundFault]. + /// May throw [InvalidResourceStateFault]. + /// May throw [AccessDeniedFault]. + /// + /// Parameter [replicationConfigArn] : + /// The Amazon Resource Name of the replication to stop. + Future stopReplication({ + required String replicationConfigArn, + }) async { + final headers = { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AmazonDMSv20160101.StopReplication' + }; + final jsonResponse = await _protocol.send( + method: 'POST', + requestUri: '/', + exceptionFnMap: _exceptionFns, + // TODO queryParams + headers: headers, + payload: { + 'ReplicationConfigArn': replicationConfigArn, + }, + ); + + return StopReplicationResponse.fromJson(jsonResponse.body); + } + /// Stops the replication task. /// /// May throw [ResourceNotFoundFault]. @@ -4444,11 +6485,11 @@ class DatabaseMigration { /// Migrates 10 active and enabled Amazon SNS subscriptions at a time and /// converts them to corresponding Amazon EventBridge rules. By default, this /// operation migrates subscriptions only when all your replication instance - /// versions are 3.4.6 or higher. If any replication instances are from - /// versions earlier than 3.4.6, the operation raises an error and tells you - /// to upgrade these instances to version 3.4.6 or higher. To enable migration + /// versions are 3.4.5 or higher. If any replication instances are from + /// versions earlier than 3.4.5, the operation raises an error and tells you + /// to upgrade these instances to version 3.4.5 or higher. To enable migration /// regardless of version, set the Force option to true. However, - /// if you don't upgrade instances earlier than version 3.4.6, some types of + /// if you don't upgrade instances earlier than version 3.4.5, some types of /// events might not be available when you use Amazon EventBridge. /// /// To call this operation, make sure that you have certain permissions added @@ -4464,7 +6505,7 @@ class DatabaseMigration { /// When set to true, this operation migrates DMS subscriptions for Amazon SNS /// notifications no matter what your replication instance version is. If not /// set or set to false, this operation runs only when all your replication - /// instances are from DMS version 3.4.6 or higher. + /// instances are from DMS version 3.4.5 or higher. Future updateSubscriptionsToEventBridge({ bool? forceMove, @@ -4570,6 +6611,34 @@ class ApplyPendingMaintenanceActionResponse { } } +enum AssessmentReportType { + pdf, + csv, +} + +extension AssessmentReportTypeValueExtension on AssessmentReportType { + String toValue() { + switch (this) { + case AssessmentReportType.pdf: + return 'pdf'; + case AssessmentReportType.csv: + return 'csv'; + } + } +} + +extension AssessmentReportTypeFromString on String { + AssessmentReportType toAssessmentReportType() { + switch (this) { + case 'pdf': + return AssessmentReportType.pdf; + case 'csv': + return AssessmentReportType.csv; + } + throw Exception('$this is not known in enum AssessmentReportType'); + } +} + enum AuthMechanismValue { $default, mongodbCr, @@ -5203,6 +7272,137 @@ extension CompressionTypeValueFromString on String { } } +/// Configuration parameters for provisioning an DMS Serverless replication. +class ComputeConfig { + /// The Availability Zone where the DMS Serverless replication using this + /// configuration will run. The default value is a random, system-chosen + /// Availability Zone in the configuration's Amazon Web Services Region, for + /// example, "us-west-2". You can't set this parameter if the + /// MultiAZ parameter is set to true. + final String? availabilityZone; + + /// A list of custom DNS name servers supported for the DMS Serverless + /// replication to access your source or target database. This list overrides + /// the default name servers supported by the DMS Serverless replication. You + /// can specify a comma-separated list of internet addresses for up to four DNS + /// name servers. For example: "1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4" + final String? dnsNameServers; + + /// An Key Management Service (KMS) key Amazon Resource Name (ARN) that is used + /// to encrypt the data during DMS Serverless replication. + /// + /// If you don't specify a value for the KmsKeyId parameter, DMS + /// uses your default encryption key. + /// + /// KMS creates the default encryption key for your Amazon Web Services account. + /// Your Amazon Web Services account has a different default encryption key for + /// each Amazon Web Services Region. + final String? kmsKeyId; + + /// Specifies the maximum value of the DMS capacity units (DCUs) for which a + /// given DMS Serverless replication can be provisioned. A single DCU is 2GB of + /// RAM, with 1 DCU as the minimum value allowed. The list of valid DCU values + /// includes 1, 2, 4, 8, 16, 32, 64, 128, 192, 256, and 384. So, the maximum + /// value that you can specify for DMS Serverless is 384. The + /// MaxCapacityUnits parameter is the only DCU parameter you are + /// required to specify. + final int? maxCapacityUnits; + + /// Specifies the minimum value of the DMS capacity units (DCUs) for which a + /// given DMS Serverless replication can be provisioned. A single DCU is 2GB of + /// RAM, with 1 DCU as the minimum value allowed. The list of valid DCU values + /// includes 1, 2, 4, 8, 16, 32, 64, 128, 192, 256, and 384. So, the minimum DCU + /// value that you can specify for DMS Serverless is 1. You don't have to + /// specify a value for the MinCapacityUnits parameter. If you + /// don't set this value, DMS scans the current activity of available source + /// tables to identify an optimum setting for this parameter. If there is no + /// current source activity or DMS can't otherwise identify a more appropriate + /// value, it sets this parameter to the minimum DCU value allowed, 1. + final int? minCapacityUnits; + + /// Specifies whether the DMS Serverless replication is a Multi-AZ deployment. + /// You can't set the AvailabilityZone parameter if the + /// MultiAZ parameter is set to true. + final bool? multiAZ; + + /// The weekly time range during which system maintenance can occur for the DMS + /// Serverless replication, in Universal Coordinated Time (UTC). The format is + /// ddd:hh24:mi-ddd:hh24:mi. + /// + /// The default is a 30-minute window selected at random from an 8-hour block of + /// time per Amazon Web Services Region. This maintenance occurs on a random day + /// of the week. Valid values for days of the week include Mon, + /// Tue, Wed, Thu, Fri, + /// Sat, and Sun. + /// + /// Constraints include a minimum 30-minute window. + final String? preferredMaintenanceWindow; + + /// Specifies a subnet group identifier to associate with the DMS Serverless + /// replication. + final String? replicationSubnetGroupId; + + /// Specifies the virtual private cloud (VPC) security group to use with the DMS + /// Serverless replication. The VPC security group must work with the VPC + /// containing the replication. + final List? vpcSecurityGroupIds; + + ComputeConfig({ + this.availabilityZone, + this.dnsNameServers, + this.kmsKeyId, + this.maxCapacityUnits, + this.minCapacityUnits, + this.multiAZ, + this.preferredMaintenanceWindow, + this.replicationSubnetGroupId, + this.vpcSecurityGroupIds, + }); + + factory ComputeConfig.fromJson(Map json) { + return ComputeConfig( + availabilityZone: json['AvailabilityZone'] as String?, + dnsNameServers: json['DnsNameServers'] as String?, + kmsKeyId: json['KmsKeyId'] as String?, + maxCapacityUnits: json['MaxCapacityUnits'] as int?, + minCapacityUnits: json['MinCapacityUnits'] as int?, + multiAZ: json['MultiAZ'] as bool?, + preferredMaintenanceWindow: json['PreferredMaintenanceWindow'] as String?, + replicationSubnetGroupId: json['ReplicationSubnetGroupId'] as String?, + vpcSecurityGroupIds: (json['VpcSecurityGroupIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final availabilityZone = this.availabilityZone; + final dnsNameServers = this.dnsNameServers; + final kmsKeyId = this.kmsKeyId; + final maxCapacityUnits = this.maxCapacityUnits; + final minCapacityUnits = this.minCapacityUnits; + final multiAZ = this.multiAZ; + final preferredMaintenanceWindow = this.preferredMaintenanceWindow; + final replicationSubnetGroupId = this.replicationSubnetGroupId; + final vpcSecurityGroupIds = this.vpcSecurityGroupIds; + return { + if (availabilityZone != null) 'AvailabilityZone': availabilityZone, + if (dnsNameServers != null) 'DnsNameServers': dnsNameServers, + if (kmsKeyId != null) 'KmsKeyId': kmsKeyId, + if (maxCapacityUnits != null) 'MaxCapacityUnits': maxCapacityUnits, + if (minCapacityUnits != null) 'MinCapacityUnits': minCapacityUnits, + if (multiAZ != null) 'MultiAZ': multiAZ, + if (preferredMaintenanceWindow != null) + 'PreferredMaintenanceWindow': preferredMaintenanceWindow, + if (replicationSubnetGroupId != null) + 'ReplicationSubnetGroupId': replicationSubnetGroupId, + if (vpcSecurityGroupIds != null) + 'VpcSecurityGroupIds': vpcSecurityGroupIds, + }; + } +} + /// Status of the connection between an endpoint and a replication instance, /// including Amazon Resource Names (ARNs) and the last error message issued. class Connection { @@ -5284,6 +7484,30 @@ class Connection { } } +class CreateDataProviderResponse { + /// The data provider that was created. + final DataProvider? dataProvider; + + CreateDataProviderResponse({ + this.dataProvider, + }); + + factory CreateDataProviderResponse.fromJson(Map json) { + return CreateDataProviderResponse( + dataProvider: json['DataProvider'] != null + ? DataProvider.fromJson(json['DataProvider'] as Map) + : null, + ); + } + + Map toJson() { + final dataProvider = this.dataProvider; + return { + if (dataProvider != null) 'DataProvider': dataProvider, + }; + } +} + ///

      class CreateEndpointResponse { /// The endpoint that was created. @@ -5390,6 +7614,83 @@ class CreateFleetAdvisorCollectorResponse { } } +class CreateInstanceProfileResponse { + /// The instance profile that was created. + final InstanceProfile? instanceProfile; + + CreateInstanceProfileResponse({ + this.instanceProfile, + }); + + factory CreateInstanceProfileResponse.fromJson(Map json) { + return CreateInstanceProfileResponse( + instanceProfile: json['InstanceProfile'] != null + ? InstanceProfile.fromJson( + json['InstanceProfile'] as Map) + : null, + ); + } + + Map toJson() { + final instanceProfile = this.instanceProfile; + return { + if (instanceProfile != null) 'InstanceProfile': instanceProfile, + }; + } +} + +class CreateMigrationProjectResponse { + /// The migration project that was created. + final MigrationProject? migrationProject; + + CreateMigrationProjectResponse({ + this.migrationProject, + }); + + factory CreateMigrationProjectResponse.fromJson(Map json) { + return CreateMigrationProjectResponse( + migrationProject: json['MigrationProject'] != null + ? MigrationProject.fromJson( + json['MigrationProject'] as Map) + : null, + ); + } + + Map toJson() { + final migrationProject = this.migrationProject; + return { + if (migrationProject != null) 'MigrationProject': migrationProject, + }; + } +} + +///

      +class CreateReplicationConfigResponse { + /// Configuration parameters returned from the DMS Serverless replication after + /// it is created. + final ReplicationConfig? replicationConfig; + + CreateReplicationConfigResponse({ + this.replicationConfig, + }); + + factory CreateReplicationConfigResponse.fromJson(Map json) { + return CreateReplicationConfigResponse( + replicationConfig: json['ReplicationConfig'] != null + ? ReplicationConfig.fromJson( + json['ReplicationConfig'] as Map) + : null, + ); + } + + Map toJson() { + final replicationConfig = this.replicationConfig; + return { + if (replicationConfig != null) 'ReplicationConfig': replicationConfig, + }; + } +} + ///

      class CreateReplicationInstanceResponse { /// The replication instance that was created. @@ -5418,88 +7719,326 @@ class CreateReplicationInstanceResponse { } } -///

      -class CreateReplicationSubnetGroupResponse { - /// The replication subnet group that was created. - final ReplicationSubnetGroup? replicationSubnetGroup; +///

      +class CreateReplicationSubnetGroupResponse { + /// The replication subnet group that was created. + final ReplicationSubnetGroup? replicationSubnetGroup; + + CreateReplicationSubnetGroupResponse({ + this.replicationSubnetGroup, + }); + + factory CreateReplicationSubnetGroupResponse.fromJson( + Map json) { + return CreateReplicationSubnetGroupResponse( + replicationSubnetGroup: json['ReplicationSubnetGroup'] != null + ? ReplicationSubnetGroup.fromJson( + json['ReplicationSubnetGroup'] as Map) + : null, + ); + } + + Map toJson() { + final replicationSubnetGroup = this.replicationSubnetGroup; + return { + if (replicationSubnetGroup != null) + 'ReplicationSubnetGroup': replicationSubnetGroup, + }; + } +} + +///

      +class CreateReplicationTaskResponse { + /// The replication task that was created. + final ReplicationTask? replicationTask; + + CreateReplicationTaskResponse({ + this.replicationTask, + }); + + factory CreateReplicationTaskResponse.fromJson(Map json) { + return CreateReplicationTaskResponse( + replicationTask: json['ReplicationTask'] != null + ? ReplicationTask.fromJson( + json['ReplicationTask'] as Map) + : null, + ); + } + + Map toJson() { + final replicationTask = this.replicationTask; + return { + if (replicationTask != null) 'ReplicationTask': replicationTask, + }; + } +} + +enum DataFormatValue { + csv, + parquet, +} + +extension DataFormatValueValueExtension on DataFormatValue { + String toValue() { + switch (this) { + case DataFormatValue.csv: + return 'csv'; + case DataFormatValue.parquet: + return 'parquet'; + } + } +} + +extension DataFormatValueFromString on String { + DataFormatValue toDataFormatValue() { + switch (this) { + case 'csv': + return DataFormatValue.csv; + case 'parquet': + return DataFormatValue.parquet; + } + throw Exception('$this is not known in enum DataFormatValue'); + } +} + +/// Provides information that defines a data provider. +class DataProvider { + /// The Amazon Resource Name (ARN) string that uniquely identifies the data + /// provider. + final String? dataProviderArn; + + /// The time the data provider was created. + final DateTime? dataProviderCreationTime; + + /// The name of the data provider. + final String? dataProviderName; + + /// A description of the data provider. Descriptions can have up to 31 + /// characters. A description can contain only ASCII letters, digits, and + /// hyphens ('-'). Also, it can't end with a hyphen or contain two consecutive + /// hyphens, and can only begin with a letter. + final String? description; + + /// The type of database engine for the data provider. Valid values include + /// "aurora", "aurora-postgresql", + /// "mysql", "oracle", "postgres", + /// "sqlserver", redshift, mariadb, + /// mongodb, and docdb. A value of + /// "aurora" represents Amazon Aurora MySQL-Compatible Edition. + final String? engine; + + /// The settings in JSON format for a data provider. + final DataProviderSettings? settings; + + DataProvider({ + this.dataProviderArn, + this.dataProviderCreationTime, + this.dataProviderName, + this.description, + this.engine, + this.settings, + }); + + factory DataProvider.fromJson(Map json) { + return DataProvider( + dataProviderArn: json['DataProviderArn'] as String?, + dataProviderCreationTime: + timeStampFromJson(json['DataProviderCreationTime']), + dataProviderName: json['DataProviderName'] as String?, + description: json['Description'] as String?, + engine: json['Engine'] as String?, + settings: json['Settings'] != null + ? DataProviderSettings.fromJson( + json['Settings'] as Map) + : null, + ); + } + + Map toJson() { + final dataProviderArn = this.dataProviderArn; + final dataProviderCreationTime = this.dataProviderCreationTime; + final dataProviderName = this.dataProviderName; + final description = this.description; + final engine = this.engine; + final settings = this.settings; + return { + if (dataProviderArn != null) 'DataProviderArn': dataProviderArn, + if (dataProviderCreationTime != null) + 'DataProviderCreationTime': iso8601ToJson(dataProviderCreationTime), + if (dataProviderName != null) 'DataProviderName': dataProviderName, + if (description != null) 'Description': description, + if (engine != null) 'Engine': engine, + if (settings != null) 'Settings': settings, + }; + } +} + +/// Information about a data provider. +class DataProviderDescriptor { + /// The Amazon Resource Name (ARN) of the data provider. + final String? dataProviderArn; + + /// The user-friendly name of the data provider. + final String? dataProviderName; + + /// The ARN of the role used to access Amazon Web Services Secrets Manager. + final String? secretsManagerAccessRoleArn; + + /// The identifier of the Amazon Web Services Secrets Manager Secret used to + /// store access credentials for the data provider. + final String? secretsManagerSecretId; + + DataProviderDescriptor({ + this.dataProviderArn, + this.dataProviderName, + this.secretsManagerAccessRoleArn, + this.secretsManagerSecretId, + }); + + factory DataProviderDescriptor.fromJson(Map json) { + return DataProviderDescriptor( + dataProviderArn: json['DataProviderArn'] as String?, + dataProviderName: json['DataProviderName'] as String?, + secretsManagerAccessRoleArn: + json['SecretsManagerAccessRoleArn'] as String?, + secretsManagerSecretId: json['SecretsManagerSecretId'] as String?, + ); + } + + Map toJson() { + final dataProviderArn = this.dataProviderArn; + final dataProviderName = this.dataProviderName; + final secretsManagerAccessRoleArn = this.secretsManagerAccessRoleArn; + final secretsManagerSecretId = this.secretsManagerSecretId; + return { + if (dataProviderArn != null) 'DataProviderArn': dataProviderArn, + if (dataProviderName != null) 'DataProviderName': dataProviderName, + if (secretsManagerAccessRoleArn != null) + 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, + if (secretsManagerSecretId != null) + 'SecretsManagerSecretId': secretsManagerSecretId, + }; + } +} + +/// Information about a data provider. +class DataProviderDescriptorDefinition { + /// The name or Amazon Resource Name (ARN) of the data provider. + final String dataProviderIdentifier; - CreateReplicationSubnetGroupResponse({ - this.replicationSubnetGroup, - }); + /// The ARN of the role used to access Amazon Web Services Secrets Manager. + final String? secretsManagerAccessRoleArn; - factory CreateReplicationSubnetGroupResponse.fromJson( - Map json) { - return CreateReplicationSubnetGroupResponse( - replicationSubnetGroup: json['ReplicationSubnetGroup'] != null - ? ReplicationSubnetGroup.fromJson( - json['ReplicationSubnetGroup'] as Map) - : null, - ); - } + /// The identifier of the Amazon Web Services Secrets Manager Secret used to + /// store access credentials for the data provider. + final String? secretsManagerSecretId; + + DataProviderDescriptorDefinition({ + required this.dataProviderIdentifier, + this.secretsManagerAccessRoleArn, + this.secretsManagerSecretId, + }); Map toJson() { - final replicationSubnetGroup = this.replicationSubnetGroup; + final dataProviderIdentifier = this.dataProviderIdentifier; + final secretsManagerAccessRoleArn = this.secretsManagerAccessRoleArn; + final secretsManagerSecretId = this.secretsManagerSecretId; return { - if (replicationSubnetGroup != null) - 'ReplicationSubnetGroup': replicationSubnetGroup, + 'DataProviderIdentifier': dataProviderIdentifier, + if (secretsManagerAccessRoleArn != null) + 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, + if (secretsManagerSecretId != null) + 'SecretsManagerSecretId': secretsManagerSecretId, }; } } -///

      -class CreateReplicationTaskResponse { - /// The replication task that was created. - final ReplicationTask? replicationTask; +/// Provides information that defines a data provider. +class DataProviderSettings { + final DocDbDataProviderSettings? docDbSettings; - CreateReplicationTaskResponse({ - this.replicationTask, + /// Provides information that defines a MariaDB data provider. + final MariaDbDataProviderSettings? mariaDbSettings; + final MicrosoftSqlServerDataProviderSettings? microsoftSqlServerSettings; + + /// Provides information that defines a MongoDB data provider. + final MongoDbDataProviderSettings? mongoDbSettings; + final MySqlDataProviderSettings? mySqlSettings; + final OracleDataProviderSettings? oracleSettings; + final PostgreSqlDataProviderSettings? postgreSqlSettings; + final RedshiftDataProviderSettings? redshiftSettings; + + DataProviderSettings({ + this.docDbSettings, + this.mariaDbSettings, + this.microsoftSqlServerSettings, + this.mongoDbSettings, + this.mySqlSettings, + this.oracleSettings, + this.postgreSqlSettings, + this.redshiftSettings, }); - factory CreateReplicationTaskResponse.fromJson(Map json) { - return CreateReplicationTaskResponse( - replicationTask: json['ReplicationTask'] != null - ? ReplicationTask.fromJson( - json['ReplicationTask'] as Map) + factory DataProviderSettings.fromJson(Map json) { + return DataProviderSettings( + docDbSettings: json['DocDbSettings'] != null + ? DocDbDataProviderSettings.fromJson( + json['DocDbSettings'] as Map) + : null, + mariaDbSettings: json['MariaDbSettings'] != null + ? MariaDbDataProviderSettings.fromJson( + json['MariaDbSettings'] as Map) + : null, + microsoftSqlServerSettings: json['MicrosoftSqlServerSettings'] != null + ? MicrosoftSqlServerDataProviderSettings.fromJson( + json['MicrosoftSqlServerSettings'] as Map) + : null, + mongoDbSettings: json['MongoDbSettings'] != null + ? MongoDbDataProviderSettings.fromJson( + json['MongoDbSettings'] as Map) + : null, + mySqlSettings: json['MySqlSettings'] != null + ? MySqlDataProviderSettings.fromJson( + json['MySqlSettings'] as Map) + : null, + oracleSettings: json['OracleSettings'] != null + ? OracleDataProviderSettings.fromJson( + json['OracleSettings'] as Map) + : null, + postgreSqlSettings: json['PostgreSqlSettings'] != null + ? PostgreSqlDataProviderSettings.fromJson( + json['PostgreSqlSettings'] as Map) + : null, + redshiftSettings: json['RedshiftSettings'] != null + ? RedshiftDataProviderSettings.fromJson( + json['RedshiftSettings'] as Map) : null, ); } Map toJson() { - final replicationTask = this.replicationTask; + final docDbSettings = this.docDbSettings; + final mariaDbSettings = this.mariaDbSettings; + final microsoftSqlServerSettings = this.microsoftSqlServerSettings; + final mongoDbSettings = this.mongoDbSettings; + final mySqlSettings = this.mySqlSettings; + final oracleSettings = this.oracleSettings; + final postgreSqlSettings = this.postgreSqlSettings; + final redshiftSettings = this.redshiftSettings; return { - if (replicationTask != null) 'ReplicationTask': replicationTask, + if (docDbSettings != null) 'DocDbSettings': docDbSettings, + if (mariaDbSettings != null) 'MariaDbSettings': mariaDbSettings, + if (microsoftSqlServerSettings != null) + 'MicrosoftSqlServerSettings': microsoftSqlServerSettings, + if (mongoDbSettings != null) 'MongoDbSettings': mongoDbSettings, + if (mySqlSettings != null) 'MySqlSettings': mySqlSettings, + if (oracleSettings != null) 'OracleSettings': oracleSettings, + if (postgreSqlSettings != null) 'PostgreSqlSettings': postgreSqlSettings, + if (redshiftSettings != null) 'RedshiftSettings': redshiftSettings, }; } } -enum DataFormatValue { - csv, - parquet, -} - -extension DataFormatValueValueExtension on DataFormatValue { - String toValue() { - switch (this) { - case DataFormatValue.csv: - return 'csv'; - case DataFormatValue.parquet: - return 'parquet'; - } - } -} - -extension DataFormatValueFromString on String { - DataFormatValue toDataFormatValue() { - switch (this) { - case 'csv': - return DataFormatValue.csv; - case 'parquet': - return DataFormatValue.parquet; - } - throw Exception('$this is not known in enum DataFormatValue'); - } -} - /// Describes an inventory database instance for a Fleet Advisor collector. class DatabaseInstanceSoftwareDetailsResponse { /// The database engine of a database in a Fleet Advisor collector inventory, @@ -5571,6 +8110,34 @@ class DatabaseInstanceSoftwareDetailsResponse { } } +enum DatabaseMode { + $default, + babelfish, +} + +extension DatabaseModeValueExtension on DatabaseMode { + String toValue() { + switch (this) { + case DatabaseMode.$default: + return 'default'; + case DatabaseMode.babelfish: + return 'babelfish'; + } + } +} + +extension DatabaseModeFromString on String { + DatabaseMode toDatabaseMode() { + switch (this) { + case 'default': + return DatabaseMode.$default; + case 'babelfish': + return DatabaseMode.babelfish; + } + throw Exception('$this is not known in enum DatabaseMode'); + } +} + /// Describes a database in a Fleet Advisor collector inventory. class DatabaseResponse { /// A list of collectors associated with the database. @@ -5775,6 +8342,29 @@ extension DatePartitionSequenceValueFromString on String { } } +/// Provides error information about a schema conversion operation. +class DefaultErrorDetails { + /// The error message. + final String? message; + + DefaultErrorDetails({ + this.message, + }); + + factory DefaultErrorDetails.fromJson(Map json) { + return DefaultErrorDetails( + message: json['Message'] as String?, + ); + } + + Map toJson() { + final message = this.message; + return { + if (message != null) 'Message': message, + }; + } +} + class DeleteCertificateResponse { /// The Secure Sockets Layer (SSL) certificate. final Certificate? certificate; @@ -5824,6 +8414,30 @@ class DeleteConnectionResponse { } } +class DeleteDataProviderResponse { + /// The data provider that was deleted. + final DataProvider? dataProvider; + + DeleteDataProviderResponse({ + this.dataProvider, + }); + + factory DeleteDataProviderResponse.fromJson(Map json) { + return DeleteDataProviderResponse( + dataProvider: json['DataProvider'] != null + ? DataProvider.fromJson(json['DataProvider'] as Map) + : null, + ); + } + + Map toJson() { + final dataProvider = this.dataProvider; + return { + if (dataProvider != null) 'DataProvider': dataProvider, + }; + } +} + ///

      class DeleteEndpointResponse { /// The endpoint that was deleted. @@ -5901,6 +8515,83 @@ class DeleteFleetAdvisorDatabasesResponse { } } +class DeleteInstanceProfileResponse { + /// The instance profile that was deleted. + final InstanceProfile? instanceProfile; + + DeleteInstanceProfileResponse({ + this.instanceProfile, + }); + + factory DeleteInstanceProfileResponse.fromJson(Map json) { + return DeleteInstanceProfileResponse( + instanceProfile: json['InstanceProfile'] != null + ? InstanceProfile.fromJson( + json['InstanceProfile'] as Map) + : null, + ); + } + + Map toJson() { + final instanceProfile = this.instanceProfile; + return { + if (instanceProfile != null) 'InstanceProfile': instanceProfile, + }; + } +} + +class DeleteMigrationProjectResponse { + /// The migration project that was deleted. + final MigrationProject? migrationProject; + + DeleteMigrationProjectResponse({ + this.migrationProject, + }); + + factory DeleteMigrationProjectResponse.fromJson(Map json) { + return DeleteMigrationProjectResponse( + migrationProject: json['MigrationProject'] != null + ? MigrationProject.fromJson( + json['MigrationProject'] as Map) + : null, + ); + } + + Map toJson() { + final migrationProject = this.migrationProject; + return { + if (migrationProject != null) 'MigrationProject': migrationProject, + }; + } +} + +///

      +class DeleteReplicationConfigResponse { + /// Configuration parameters returned for the DMS Serverless replication after + /// it is deleted. + final ReplicationConfig? replicationConfig; + + DeleteReplicationConfigResponse({ + this.replicationConfig, + }); + + factory DeleteReplicationConfigResponse.fromJson(Map json) { + return DeleteReplicationConfigResponse( + replicationConfig: json['ReplicationConfig'] != null + ? ReplicationConfig.fromJson( + json['ReplicationConfig'] as Map) + : null, + ); + } + + Map toJson() { + final replicationConfig = this.replicationConfig; + return { + if (replicationConfig != null) 'ReplicationConfig': replicationConfig, + }; + } +} + ///

      class DeleteReplicationInstanceResponse { /// The replication instance that was deleted. @@ -6157,6 +8848,78 @@ class DescribeConnectionsResponse { } } +class DescribeConversionConfigurationResponse { + /// The configuration parameters for the schema conversion project. + final String? conversionConfiguration; + + /// The name or Amazon Resource Name (ARN) for the schema conversion project. + final String? migrationProjectIdentifier; + + DescribeConversionConfigurationResponse({ + this.conversionConfiguration, + this.migrationProjectIdentifier, + }); + + factory DescribeConversionConfigurationResponse.fromJson( + Map json) { + return DescribeConversionConfigurationResponse( + conversionConfiguration: json['ConversionConfiguration'] as String?, + migrationProjectIdentifier: json['MigrationProjectIdentifier'] as String?, + ); + } + + Map toJson() { + final conversionConfiguration = this.conversionConfiguration; + final migrationProjectIdentifier = this.migrationProjectIdentifier; + return { + if (conversionConfiguration != null) + 'ConversionConfiguration': conversionConfiguration, + if (migrationProjectIdentifier != null) + 'MigrationProjectIdentifier': migrationProjectIdentifier, + }; + } +} + +class DescribeDataProvidersResponse { + /// A description of data providers. + final List? dataProviders; + + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + DescribeDataProvidersResponse({ + this.dataProviders, + this.marker, + }); + + factory DescribeDataProvidersResponse.fromJson(Map json) { + return DescribeDataProvidersResponse( + dataProviders: (json['DataProviders'] as List?) + ?.whereNotNull() + .map((e) => DataProvider.fromJson(e as Map)) + .toList(), + marker: json['Marker'] as String?, + ); + } + + Map toJson() { + final dataProviders = this.dataProviders; + final marker = this.marker; + return { + if (dataProviders != null) 'DataProviders': dataProviders, + if (marker != null) 'Marker': marker, + }; + } +} + class DescribeEndpointSettingsResponse { /// Descriptions of the endpoint settings available for your source or target /// database engine. @@ -6243,21 +9006,56 @@ class DescribeEndpointsResponse { this.marker, }); - factory DescribeEndpointsResponse.fromJson(Map json) { - return DescribeEndpointsResponse( - endpoints: (json['Endpoints'] as List?) + factory DescribeEndpointsResponse.fromJson(Map json) { + return DescribeEndpointsResponse( + endpoints: (json['Endpoints'] as List?) + ?.whereNotNull() + .map((e) => Endpoint.fromJson(e as Map)) + .toList(), + marker: json['Marker'] as String?, + ); + } + + Map toJson() { + final endpoints = this.endpoints; + final marker = this.marker; + return { + if (endpoints != null) 'Endpoints': endpoints, + if (marker != null) 'Marker': marker, + }; + } +} + +class DescribeEngineVersionsResponse { + /// Returned EngineVersion objects that describe the replication + /// instance engine versions used in the project. + final List? engineVersions; + + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + final String? marker; + + DescribeEngineVersionsResponse({ + this.engineVersions, + this.marker, + }); + + factory DescribeEngineVersionsResponse.fromJson(Map json) { + return DescribeEngineVersionsResponse( + engineVersions: (json['EngineVersions'] as List?) ?.whereNotNull() - .map((e) => Endpoint.fromJson(e as Map)) + .map((e) => EngineVersion.fromJson(e as Map)) .toList(), marker: json['Marker'] as String?, ); } Map toJson() { - final endpoints = this.endpoints; + final engineVersions = this.engineVersions; final marker = this.marker; return { - if (endpoints != null) 'Endpoints': endpoints, + if (engineVersions != null) 'EngineVersions': engineVersions, if (marker != null) 'Marker': marker, }; } @@ -6362,6 +9160,49 @@ class DescribeEventsResponse { } } +class DescribeExtensionPackAssociationsResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of extension pack associations for the specified migration + /// project. + final List? requests; + + DescribeExtensionPackAssociationsResponse({ + this.marker, + this.requests, + }); + + factory DescribeExtensionPackAssociationsResponse.fromJson( + Map json) { + return DescribeExtensionPackAssociationsResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + class DescribeFleetAdvisorCollectorsResponse { /// Provides descriptions of the Fleet Advisor collectors, including the /// collectors' name and ID, and the latest inventory data. @@ -6548,6 +9389,298 @@ class DescribeFleetAdvisorSchemasResponse { } } +class DescribeInstanceProfilesResponse { + /// A description of instance profiles. + final List? instanceProfiles; + + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + DescribeInstanceProfilesResponse({ + this.instanceProfiles, + this.marker, + }); + + factory DescribeInstanceProfilesResponse.fromJson(Map json) { + return DescribeInstanceProfilesResponse( + instanceProfiles: (json['InstanceProfiles'] as List?) + ?.whereNotNull() + .map((e) => InstanceProfile.fromJson(e as Map)) + .toList(), + marker: json['Marker'] as String?, + ); + } + + Map toJson() { + final instanceProfiles = this.instanceProfiles; + final marker = this.marker; + return { + if (instanceProfiles != null) 'InstanceProfiles': instanceProfiles, + if (marker != null) 'Marker': marker, + }; + } +} + +class DescribeMetadataModelAssessmentsResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of metadata model assessments for the specified migration + /// project. + final List? requests; + + DescribeMetadataModelAssessmentsResponse({ + this.marker, + this.requests, + }); + + factory DescribeMetadataModelAssessmentsResponse.fromJson( + Map json) { + return DescribeMetadataModelAssessmentsResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + +class DescribeMetadataModelConversionsResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of metadata model conversions. + final List? requests; + + DescribeMetadataModelConversionsResponse({ + this.marker, + this.requests, + }); + + factory DescribeMetadataModelConversionsResponse.fromJson( + Map json) { + return DescribeMetadataModelConversionsResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + +class DescribeMetadataModelExportsAsScriptResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of metadata model exports. + final List? requests; + + DescribeMetadataModelExportsAsScriptResponse({ + this.marker, + this.requests, + }); + + factory DescribeMetadataModelExportsAsScriptResponse.fromJson( + Map json) { + return DescribeMetadataModelExportsAsScriptResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + +class DescribeMetadataModelExportsToTargetResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of metadata model exports. + final List? requests; + + DescribeMetadataModelExportsToTargetResponse({ + this.marker, + this.requests, + }); + + factory DescribeMetadataModelExportsToTargetResponse.fromJson( + Map json) { + return DescribeMetadataModelExportsToTargetResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + +class DescribeMetadataModelImportsResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A paginated list of metadata model imports. + final List? requests; + + DescribeMetadataModelImportsResponse({ + this.marker, + this.requests, + }); + + factory DescribeMetadataModelImportsResponse.fromJson( + Map json) { + return DescribeMetadataModelImportsResponse( + marker: json['Marker'] as String?, + requests: (json['Requests'] as List?) + ?.whereNotNull() + .map((e) => + SchemaConversionRequest.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final requests = this.requests; + return { + if (marker != null) 'Marker': marker, + if (requests != null) 'Requests': requests, + }; + } +} + +class DescribeMigrationProjectsResponse { + /// Specifies the unique pagination token that makes it possible to display the + /// next page of results. If this parameter is specified, the response includes + /// only records beyond the marker, up to the value specified by + /// MaxRecords. + /// + /// If Marker is returned by a previous response, there are more + /// results available. The value of Marker is a unique pagination + /// token for each page. To retrieve the next page, make the call again using + /// the returned token and keeping all other arguments unchanged. + final String? marker; + + /// A description of migration projects. + final List? migrationProjects; + + DescribeMigrationProjectsResponse({ + this.marker, + this.migrationProjects, + }); + + factory DescribeMigrationProjectsResponse.fromJson( + Map json) { + return DescribeMigrationProjectsResponse( + marker: json['Marker'] as String?, + migrationProjects: (json['MigrationProjects'] as List?) + ?.whereNotNull() + .map((e) => MigrationProject.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final migrationProjects = this.migrationProjects; + return { + if (marker != null) 'Marker': marker, + if (migrationProjects != null) 'MigrationProjects': migrationProjects, + }; + } +} + ///

      class DescribeOrderableReplicationInstancesResponse { /// An optional pagination token provided by a previous request. If this @@ -6728,6 +9861,43 @@ class DescribeRefreshSchemasStatusResponse { } } +///

      +class DescribeReplicationConfigsResponse { + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + final String? marker; + + /// Returned configuration parameters that describe each provisioned DMS + /// Serverless replication. + final List? replicationConfigs; + + DescribeReplicationConfigsResponse({ + this.marker, + this.replicationConfigs, + }); + + factory DescribeReplicationConfigsResponse.fromJson( + Map json) { + return DescribeReplicationConfigsResponse( + marker: json['Marker'] as String?, + replicationConfigs: (json['ReplicationConfigs'] as List?) + ?.whereNotNull() + .map((e) => ReplicationConfig.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final replicationConfigs = this.replicationConfigs; + return { + if (marker != null) 'Marker': marker, + if (replicationConfigs != null) 'ReplicationConfigs': replicationConfigs, + }; + } +} + class DescribeReplicationInstanceTaskLogsResponse { /// An optional pagination token provided by a previous request. If this /// parameter is specified, the response includes only records beyond the @@ -6813,39 +9983,85 @@ class DescribeReplicationInstancesResponse { } ///

      -class DescribeReplicationSubnetGroupsResponse { +class DescribeReplicationSubnetGroupsResponse { + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + final String? marker; + + /// A description of the replication subnet groups. + final List? replicationSubnetGroups; + + DescribeReplicationSubnetGroupsResponse({ + this.marker, + this.replicationSubnetGroups, + }); + + factory DescribeReplicationSubnetGroupsResponse.fromJson( + Map json) { + return DescribeReplicationSubnetGroupsResponse( + marker: json['Marker'] as String?, + replicationSubnetGroups: (json['ReplicationSubnetGroups'] as List?) + ?.whereNotNull() + .map( + (e) => ReplicationSubnetGroup.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final replicationSubnetGroups = this.replicationSubnetGroups; + return { + if (marker != null) 'Marker': marker, + if (replicationSubnetGroups != null) + 'ReplicationSubnetGroups': replicationSubnetGroups, + }; + } +} + +///

      +class DescribeReplicationTableStatisticsResponse { /// An optional pagination token provided by a previous request. If this /// parameter is specified, the response includes only records beyond the /// marker, up to the value specified by MaxRecords. final String? marker; - /// A description of the replication subnet groups. - final List? replicationSubnetGroups; + /// The Amazon Resource Name of the replication config. + final String? replicationConfigArn; - DescribeReplicationSubnetGroupsResponse({ + /// Returns table statistics on the replication, including table name, rows + /// inserted, rows updated, and rows deleted. + final List? replicationTableStatistics; + + DescribeReplicationTableStatisticsResponse({ this.marker, - this.replicationSubnetGroups, + this.replicationConfigArn, + this.replicationTableStatistics, }); - factory DescribeReplicationSubnetGroupsResponse.fromJson( + factory DescribeReplicationTableStatisticsResponse.fromJson( Map json) { - return DescribeReplicationSubnetGroupsResponse( + return DescribeReplicationTableStatisticsResponse( marker: json['Marker'] as String?, - replicationSubnetGroups: (json['ReplicationSubnetGroups'] as List?) + replicationConfigArn: json['ReplicationConfigArn'] as String?, + replicationTableStatistics: (json['ReplicationTableStatistics'] as List?) ?.whereNotNull() - .map( - (e) => ReplicationSubnetGroup.fromJson(e as Map)) + .map((e) => TableStatistics.fromJson(e as Map)) .toList(), ); } Map toJson() { final marker = this.marker; - final replicationSubnetGroups = this.replicationSubnetGroups; + final replicationConfigArn = this.replicationConfigArn; + final replicationTableStatistics = this.replicationTableStatistics; return { if (marker != null) 'Marker': marker, - if (replicationSubnetGroups != null) - 'ReplicationSubnetGroups': replicationSubnetGroups, + if (replicationConfigArn != null) + 'ReplicationConfigArn': replicationConfigArn, + if (replicationTableStatistics != null) + 'ReplicationTableStatistics': replicationTableStatistics, }; } } @@ -7016,6 +10232,41 @@ class DescribeReplicationTasksResponse { } } +///

      +class DescribeReplicationsResponse { + /// An optional pagination token provided by a previous request. If this + /// parameter is specified, the response includes only records beyond the + /// marker, up to the value specified by MaxRecords. + final String? marker; + + /// The replication descriptions. + final List? replications; + + DescribeReplicationsResponse({ + this.marker, + this.replications, + }); + + factory DescribeReplicationsResponse.fromJson(Map json) { + return DescribeReplicationsResponse( + marker: json['Marker'] as String?, + replications: (json['Replications'] as List?) + ?.whereNotNull() + .map((e) => Replication.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final marker = this.marker; + final replications = this.replications; + return { + if (marker != null) 'Marker': marker, + if (replications != null) 'Replications': replications, + }; + } +} + ///

      class DescribeSchemasResponse { /// An optional pagination token provided by a previous request. If this @@ -7163,6 +10414,58 @@ class DmsTransferSettings { } } +/// Provides information that defines a DocumentDB data provider. +class DocDbDataProviderSettings { + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The database name on the DocumentDB data provider. + final String? databaseName; + + /// The port value for the DocumentDB data provider. + final int? port; + + /// The name of the source DocumentDB server. + final String? serverName; + + /// The SSL mode used to connect to the DocumentDB data provider. The default + /// value is none. + final DmsSslModeValue? sslMode; + + DocDbDataProviderSettings({ + this.certificateArn, + this.databaseName, + this.port, + this.serverName, + this.sslMode, + }); + + factory DocDbDataProviderSettings.fromJson(Map json) { + return DocDbDataProviderSettings( + certificateArn: json['CertificateArn'] as String?, + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final certificateArn = this.certificateArn; + final databaseName = this.databaseName; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (certificateArn != null) 'CertificateArn': certificateArn, + if (databaseName != null) 'DatabaseName': databaseName, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + /// Provides information that defines a DocumentDB endpoint. class DocDbSettings { /// The database name on the DocumentDB source endpoint. @@ -7203,6 +10506,21 @@ class DocDbSettings { /// The port value for the DocumentDB source endpoint. final int? port; + /// If true, DMS replicates data to shard collections. DMS only + /// uses this setting if the target endpoint is a DocumentDB elastic cluster. + /// + /// When this setting is true, note the following: + /// + ///

        + ///
      • + /// You must set TargetTablePrepMode to nothing. + ///
      • + ///
      • + /// DMS automatically sets useUpdateLookup to false. + ///
      • + ///
      + final bool? replicateShardCollections; + /// The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as /// the trusted entity and grants the required permissions to access the value /// in SecretsManagerSecret. The role must allow the @@ -7232,6 +10550,12 @@ class DocDbSettings { /// The name of the server on the DocumentDB source endpoint. final String? serverName; + /// If true, DMS retrieves the entire document from the DocumentDB + /// source during migration. This may cause a migration failure if the server + /// response exceeds bandwidth limits. To fetch only updates and deletes during + /// migration, set this parameter to false. + final bool? useUpdateLookUp; + /// The user name you use to access the DocumentDB source endpoint. final String? username; @@ -7243,9 +10567,11 @@ class DocDbSettings { this.nestingLevel, this.password, this.port, + this.replicateShardCollections, this.secretsManagerAccessRoleArn, this.secretsManagerSecretId, this.serverName, + this.useUpdateLookUp, this.username, }); @@ -7258,10 +10584,12 @@ class DocDbSettings { nestingLevel: (json['NestingLevel'] as String?)?.toNestingLevelValue(), password: json['Password'] as String?, port: json['Port'] as int?, + replicateShardCollections: json['ReplicateShardCollections'] as bool?, secretsManagerAccessRoleArn: json['SecretsManagerAccessRoleArn'] as String?, secretsManagerSecretId: json['SecretsManagerSecretId'] as String?, serverName: json['ServerName'] as String?, + useUpdateLookUp: json['UseUpdateLookUp'] as bool?, username: json['Username'] as String?, ); } @@ -7274,9 +10602,11 @@ class DocDbSettings { final nestingLevel = this.nestingLevel; final password = this.password; final port = this.port; + final replicateShardCollections = this.replicateShardCollections; final secretsManagerAccessRoleArn = this.secretsManagerAccessRoleArn; final secretsManagerSecretId = this.secretsManagerSecretId; final serverName = this.serverName; + final useUpdateLookUp = this.useUpdateLookUp; final username = this.username; return { if (databaseName != null) 'DatabaseName': databaseName, @@ -7286,11 +10616,14 @@ class DocDbSettings { if (nestingLevel != null) 'NestingLevel': nestingLevel.toValue(), if (password != null) 'Password': password, if (port != null) 'Port': port, + if (replicateShardCollections != null) + 'ReplicateShardCollections': replicateShardCollections, if (secretsManagerAccessRoleArn != null) 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, if (secretsManagerSecretId != null) 'SecretsManagerSecretId': secretsManagerSecretId, if (serverName != null) 'ServerName': serverName, + if (useUpdateLookUp != null) 'UseUpdateLookUp': useUpdateLookUp, if (username != null) 'Username': username, }; } @@ -7501,12 +10834,12 @@ class Endpoint { /// include "mysql", "oracle", /// "postgres", "mariadb", "aurora", /// "aurora-postgresql", "redshift", - /// "s3", "db2", "db2-zos", - /// "azuredb", "sybase", "dynamodb", - /// "mongodb", "kinesis", "kafka", - /// "elasticsearch", "documentdb", - /// "sqlserver", "neptune", and - /// "babelfish". + /// "redshift-serverless", "s3", "db2", + /// "db2-zos", "azuredb", "sybase", + /// "dynamodb", "mongodb", "kinesis", + /// "kafka", "elasticsearch", + /// "documentdb", "sqlserver", "neptune", + /// and "babelfish". final String? engineName; /// Value returned by a call to CreateEndpoint that can be used for @@ -7602,6 +10935,10 @@ class Endpoint { /// information, see the SybaseSettings structure. final SybaseSettings? sybaseSettings; + /// The settings for the Amazon Timestream target endpoint. For more + /// information, see the TimestreamSettings structure. + final TimestreamSettings? timestreamSettings; + /// The user name used to connect to the endpoint. final String? username; @@ -7640,6 +10977,7 @@ class Endpoint { this.sslMode, this.status, this.sybaseSettings, + this.timestreamSettings, this.username, }); @@ -7733,6 +11071,10 @@ class Endpoint { ? SybaseSettings.fromJson( json['SybaseSettings'] as Map) : null, + timestreamSettings: json['TimestreamSettings'] != null + ? TimestreamSettings.fromJson( + json['TimestreamSettings'] as Map) + : null, username: json['Username'] as String?, ); } @@ -7772,6 +11114,7 @@ class Endpoint { final sslMode = this.sslMode; final status = this.status; final sybaseSettings = this.sybaseSettings; + final timestreamSettings = this.timestreamSettings; final username = this.username; return { if (certificateArn != null) 'CertificateArn': certificateArn, @@ -7814,6 +11157,7 @@ class Endpoint { if (sslMode != null) 'SslMode': sslMode.toValue(), if (status != null) 'Status': status, if (sybaseSettings != null) 'SybaseSettings': sybaseSettings, + if (timestreamSettings != null) 'TimestreamSettings': timestreamSettings, if (username != null) 'Username': username, }; } @@ -7942,6 +11286,117 @@ extension EndpointSettingTypeValueFromString on String { } } +/// Provides information about a replication instance version. +class EngineVersion { + /// The date when the replication instance will be automatically upgraded. This + /// setting only applies if the auto-minor-version setting is + /// enabled. + final DateTime? autoUpgradeDate; + + /// The list of valid replication instance versions that you can upgrade to. + final List? availableUpgrades; + + /// The date when the replication instance version will be deprecated and can no + /// longer be requested. + final DateTime? deprecationDate; + + /// The date when the replication instance will have a version upgrade forced. + final DateTime? forceUpgradeDate; + + /// The date when the replication instance version became publicly available. + final DateTime? launchDate; + + /// The lifecycle status of the replication instance version. Valid values are + /// DEPRECATED, DEFAULT_VERSION, and + /// ACTIVE. + final String? lifecycle; + + /// The release status of the replication instance version. + final ReleaseStatusValues? releaseStatus; + + /// The version number of the replication instance. + final String? version; + + EngineVersion({ + this.autoUpgradeDate, + this.availableUpgrades, + this.deprecationDate, + this.forceUpgradeDate, + this.launchDate, + this.lifecycle, + this.releaseStatus, + this.version, + }); + + factory EngineVersion.fromJson(Map json) { + return EngineVersion( + autoUpgradeDate: timeStampFromJson(json['AutoUpgradeDate']), + availableUpgrades: (json['AvailableUpgrades'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + deprecationDate: timeStampFromJson(json['DeprecationDate']), + forceUpgradeDate: timeStampFromJson(json['ForceUpgradeDate']), + launchDate: timeStampFromJson(json['LaunchDate']), + lifecycle: json['Lifecycle'] as String?, + releaseStatus: + (json['ReleaseStatus'] as String?)?.toReleaseStatusValues(), + version: json['Version'] as String?, + ); + } + + Map toJson() { + final autoUpgradeDate = this.autoUpgradeDate; + final availableUpgrades = this.availableUpgrades; + final deprecationDate = this.deprecationDate; + final forceUpgradeDate = this.forceUpgradeDate; + final launchDate = this.launchDate; + final lifecycle = this.lifecycle; + final releaseStatus = this.releaseStatus; + final version = this.version; + return { + if (autoUpgradeDate != null) + 'AutoUpgradeDate': unixTimestampToJson(autoUpgradeDate), + if (availableUpgrades != null) 'AvailableUpgrades': availableUpgrades, + if (deprecationDate != null) + 'DeprecationDate': unixTimestampToJson(deprecationDate), + if (forceUpgradeDate != null) + 'ForceUpgradeDate': unixTimestampToJson(forceUpgradeDate), + if (launchDate != null) 'LaunchDate': unixTimestampToJson(launchDate), + if (lifecycle != null) 'Lifecycle': lifecycle, + if (releaseStatus != null) 'ReleaseStatus': releaseStatus.toValue(), + if (version != null) 'Version': version, + }; + } +} + +/// Provides error information about a project. +class ErrorDetails { + /// Error information about a project. + final DefaultErrorDetails? defaultErrorDetails; + + ErrorDetails({ + this.defaultErrorDetails, + }); + + factory ErrorDetails.fromJson(Map json) { + return ErrorDetails( + defaultErrorDetails: json['defaultErrorDetails'] != null + ? DefaultErrorDetails.fromJson( + json['defaultErrorDetails'] as Map) + : null, + ); + } + + Map toJson() { + final defaultErrorDetails = this.defaultErrorDetails; + return { + if (defaultErrorDetails != null) + 'defaultErrorDetails': defaultErrorDetails, + }; + } +} + /// Describes an identifiable significant activity that affects a replication /// instance or task. This object can provide the message, the available event /// categories, the date and source of the event, and the DMS resource type. @@ -8140,6 +11595,105 @@ class EventSubscription { } } +class ExportMetadataModelAssessmentResponse { + /// The Amazon S3 details for an assessment exported in CSV format. + final ExportMetadataModelAssessmentResultEntry? csvReport; + + /// The Amazon S3 details for an assessment exported in PDF format. + final ExportMetadataModelAssessmentResultEntry? pdfReport; + + ExportMetadataModelAssessmentResponse({ + this.csvReport, + this.pdfReport, + }); + + factory ExportMetadataModelAssessmentResponse.fromJson( + Map json) { + return ExportMetadataModelAssessmentResponse( + csvReport: json['CsvReport'] != null + ? ExportMetadataModelAssessmentResultEntry.fromJson( + json['CsvReport'] as Map) + : null, + pdfReport: json['PdfReport'] != null + ? ExportMetadataModelAssessmentResultEntry.fromJson( + json['PdfReport'] as Map) + : null, + ); + } + + Map toJson() { + final csvReport = this.csvReport; + final pdfReport = this.pdfReport; + return { + if (csvReport != null) 'CsvReport': csvReport, + if (pdfReport != null) 'PdfReport': pdfReport, + }; + } +} + +/// Provides information about an exported metadata model assessment. +class ExportMetadataModelAssessmentResultEntry { + /// The URL for the object containing the exported metadata model assessment. + final String? objectURL; + + /// The object key for the object containing the exported metadata model + /// assessment. + final String? s3ObjectKey; + + ExportMetadataModelAssessmentResultEntry({ + this.objectURL, + this.s3ObjectKey, + }); + + factory ExportMetadataModelAssessmentResultEntry.fromJson( + Map json) { + return ExportMetadataModelAssessmentResultEntry( + objectURL: json['ObjectURL'] as String?, + s3ObjectKey: json['S3ObjectKey'] as String?, + ); + } + + Map toJson() { + final objectURL = this.objectURL; + final s3ObjectKey = this.s3ObjectKey; + return { + if (objectURL != null) 'ObjectURL': objectURL, + if (s3ObjectKey != null) 'S3ObjectKey': s3ObjectKey, + }; + } +} + +/// Provides information about a metadata model assessment exported to SQL. +class ExportSqlDetails { + /// The URL for the object containing the exported metadata model assessment. + final String? objectURL; + + /// The Amazon S3 object key for the object containing the exported metadata + /// model assessment. + final String? s3ObjectKey; + + ExportSqlDetails({ + this.objectURL, + this.s3ObjectKey, + }); + + factory ExportSqlDetails.fromJson(Map json) { + return ExportSqlDetails( + objectURL: json['ObjectURL'] as String?, + s3ObjectKey: json['S3ObjectKey'] as String?, + ); + } + + Map toJson() { + final objectURL = this.objectURL; + final s3ObjectKey = this.s3ObjectKey; + return { + if (objectURL != null) 'ObjectURL': objectURL, + if (s3ObjectKey != null) 'S3ObjectKey': s3ObjectKey, + }; + } +} + /// Identifies the name and value of a filter object. This filter is used to /// limit the number and type of DMS objects that are returned for a particular /// Describe* call or similar operation. Filters are used as an @@ -8454,6 +12008,20 @@ class IBMDb2Settings { /// Database name for the endpoint. final String? databaseName; + /// If true, DMS saves any .csv files to the Db2 LUW target that were used to + /// replicate data. DMS uses these files for analysis and troubleshooting. + /// + /// The default value is false. + final bool? keepCsvFiles; + + /// The amount of time (in milliseconds) before DMS times out operations + /// performed by DMS on the Db2 target. The default value is 1200 (20 minutes). + final int? loadTimeout; + + /// Specifies the maximum size (in KB) of .csv files used to transfer data to + /// Db2 LUW. + final int? maxFileSize; + /// Maximum number of bytes per read, as a NUMBER value. The default is 64 KB. final int? maxKBytesPerRead; @@ -8498,9 +12066,17 @@ class IBMDb2Settings { /// Endpoint connection user name. final String? username; + /// The size (in KB) of the in-memory file write buffer used when generating + /// .csv files on the local disk on the DMS replication instance. The default + /// value is 1024 (1 MB). + final int? writeBufferSize; + IBMDb2Settings({ this.currentLsn, this.databaseName, + this.keepCsvFiles, + this.loadTimeout, + this.maxFileSize, this.maxKBytesPerRead, this.password, this.port, @@ -8509,12 +12085,16 @@ class IBMDb2Settings { this.serverName, this.setDataCaptureChanges, this.username, + this.writeBufferSize, }); factory IBMDb2Settings.fromJson(Map json) { return IBMDb2Settings( currentLsn: json['CurrentLsn'] as String?, databaseName: json['DatabaseName'] as String?, + keepCsvFiles: json['KeepCsvFiles'] as bool?, + loadTimeout: json['LoadTimeout'] as int?, + maxFileSize: json['MaxFileSize'] as int?, maxKBytesPerRead: json['MaxKBytesPerRead'] as int?, password: json['Password'] as String?, port: json['Port'] as int?, @@ -8524,12 +12104,16 @@ class IBMDb2Settings { serverName: json['ServerName'] as String?, setDataCaptureChanges: json['SetDataCaptureChanges'] as bool?, username: json['Username'] as String?, + writeBufferSize: json['WriteBufferSize'] as int?, ); } Map toJson() { final currentLsn = this.currentLsn; final databaseName = this.databaseName; + final keepCsvFiles = this.keepCsvFiles; + final loadTimeout = this.loadTimeout; + final maxFileSize = this.maxFileSize; final maxKBytesPerRead = this.maxKBytesPerRead; final password = this.password; final port = this.port; @@ -8538,9 +12122,13 @@ class IBMDb2Settings { final serverName = this.serverName; final setDataCaptureChanges = this.setDataCaptureChanges; final username = this.username; + final writeBufferSize = this.writeBufferSize; return { if (currentLsn != null) 'CurrentLsn': currentLsn, if (databaseName != null) 'DatabaseName': databaseName, + if (keepCsvFiles != null) 'KeepCsvFiles': keepCsvFiles, + if (loadTimeout != null) 'LoadTimeout': loadTimeout, + if (maxFileSize != null) 'MaxFileSize': maxFileSize, if (maxKBytesPerRead != null) 'MaxKBytesPerRead': maxKBytesPerRead, if (password != null) 'Password': password, if (port != null) 'Port': port, @@ -8552,6 +12140,7 @@ class IBMDb2Settings { if (setDataCaptureChanges != null) 'SetDataCaptureChanges': setDataCaptureChanges, if (username != null) 'Username': username, + if (writeBufferSize != null) 'WriteBufferSize': writeBufferSize, }; } } @@ -8580,6 +12169,122 @@ class ImportCertificateResponse { } } +/// Provides information that defines an instance profile. +class InstanceProfile { + /// The Availability Zone where the instance profile runs. + final String? availabilityZone; + + /// A description of the instance profile. Descriptions can have up to 31 + /// characters. A description can contain only ASCII letters, digits, and + /// hyphens ('-'). Also, it can't end with a hyphen or contain two consecutive + /// hyphens, and can only begin with a letter. + final String? description; + + /// The Amazon Resource Name (ARN) string that uniquely identifies the instance + /// profile. + final String? instanceProfileArn; + + /// The time the instance profile was created. + final DateTime? instanceProfileCreationTime; + + /// The user-friendly name for the instance profile. + final String? instanceProfileName; + + /// The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the + /// connection parameters for the instance profile. + /// + /// If you don't specify a value for the KmsKeyArn parameter, then + /// DMS uses your default encryption key. + /// + /// KMS creates the default encryption key for your Amazon Web Services account. + /// Your Amazon Web Services account has a different default encryption key for + /// each Amazon Web Services Region. + final String? kmsKeyArn; + + /// Specifies the network type for the instance profile. A value of + /// IPV4 represents an instance profile with IPv4 network type and + /// only supports IPv4 addressing. A value of IPV6 represents an + /// instance profile with IPv6 network type and only supports IPv6 addressing. A + /// value of DUAL represents an instance profile with dual network + /// type that supports IPv4 and IPv6 addressing. + final String? networkType; + + /// Specifies the accessibility options for the instance profile. A value of + /// true represents an instance profile with a public IP address. A + /// value of false represents an instance profile with a private IP + /// address. The default value is true. + final bool? publiclyAccessible; + + /// The identifier of the subnet group that is associated with the instance + /// profile. + final String? subnetGroupIdentifier; + + /// The VPC security groups that are used with the instance profile. The VPC + /// security group must work with the VPC containing the instance profile. + final List? vpcSecurityGroups; + + InstanceProfile({ + this.availabilityZone, + this.description, + this.instanceProfileArn, + this.instanceProfileCreationTime, + this.instanceProfileName, + this.kmsKeyArn, + this.networkType, + this.publiclyAccessible, + this.subnetGroupIdentifier, + this.vpcSecurityGroups, + }); + + factory InstanceProfile.fromJson(Map json) { + return InstanceProfile( + availabilityZone: json['AvailabilityZone'] as String?, + description: json['Description'] as String?, + instanceProfileArn: json['InstanceProfileArn'] as String?, + instanceProfileCreationTime: + timeStampFromJson(json['InstanceProfileCreationTime']), + instanceProfileName: json['InstanceProfileName'] as String?, + kmsKeyArn: json['KmsKeyArn'] as String?, + networkType: json['NetworkType'] as String?, + publiclyAccessible: json['PubliclyAccessible'] as bool?, + subnetGroupIdentifier: json['SubnetGroupIdentifier'] as String?, + vpcSecurityGroups: (json['VpcSecurityGroups'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final availabilityZone = this.availabilityZone; + final description = this.description; + final instanceProfileArn = this.instanceProfileArn; + final instanceProfileCreationTime = this.instanceProfileCreationTime; + final instanceProfileName = this.instanceProfileName; + final kmsKeyArn = this.kmsKeyArn; + final networkType = this.networkType; + final publiclyAccessible = this.publiclyAccessible; + final subnetGroupIdentifier = this.subnetGroupIdentifier; + final vpcSecurityGroups = this.vpcSecurityGroups; + return { + if (availabilityZone != null) 'AvailabilityZone': availabilityZone, + if (description != null) 'Description': description, + if (instanceProfileArn != null) 'InstanceProfileArn': instanceProfileArn, + if (instanceProfileCreationTime != null) + 'InstanceProfileCreationTime': + iso8601ToJson(instanceProfileCreationTime), + if (instanceProfileName != null) + 'InstanceProfileName': instanceProfileName, + if (kmsKeyArn != null) 'KmsKeyArn': kmsKeyArn, + if (networkType != null) 'NetworkType': networkType, + if (publiclyAccessible != null) 'PubliclyAccessible': publiclyAccessible, + if (subnetGroupIdentifier != null) + 'SubnetGroupIdentifier': subnetGroupIdentifier, + if (vpcSecurityGroups != null) 'VpcSecurityGroups': vpcSecurityGroups, + }; + } +} + /// Describes a Fleet Advisor collector inventory. class InventoryData { /// The number of databases in the Fleet Advisor collector inventory. @@ -8781,6 +12486,11 @@ class KafkaSettings { /// target endpoint. final String? sslClientKeyPassword; + /// Sets hostname verification for the certificate. This setting is supported in + /// DMS version 3.5.1 and later. + final KafkaSslEndpointIdentificationAlgorithm? + sslEndpointIdentificationAlgorithm; + /// The topic to which you migrate the data. If you don't specify a topic, DMS /// specifies "kafka-default-topic" as the migration topic. final String? topic; @@ -8804,6 +12514,7 @@ class KafkaSettings { this.sslClientCertificateArn, this.sslClientKeyArn, this.sslClientKeyPassword, + this.sslEndpointIdentificationAlgorithm, this.topic, }); @@ -8828,6 +12539,9 @@ class KafkaSettings { sslClientCertificateArn: json['SslClientCertificateArn'] as String?, sslClientKeyArn: json['SslClientKeyArn'] as String?, sslClientKeyPassword: json['SslClientKeyPassword'] as String?, + sslEndpointIdentificationAlgorithm: + (json['SslEndpointIdentificationAlgorithm'] as String?) + ?.toKafkaSslEndpointIdentificationAlgorithm(), topic: json['Topic'] as String?, ); } @@ -8851,6 +12565,8 @@ class KafkaSettings { final sslClientCertificateArn = this.sslClientCertificateArn; final sslClientKeyArn = this.sslClientKeyArn; final sslClientKeyPassword = this.sslClientKeyPassword; + final sslEndpointIdentificationAlgorithm = + this.sslEndpointIdentificationAlgorithm; final topic = this.topic; return { if (broker != null) 'Broker': broker, @@ -8881,11 +12597,45 @@ class KafkaSettings { if (sslClientKeyArn != null) 'SslClientKeyArn': sslClientKeyArn, if (sslClientKeyPassword != null) 'SslClientKeyPassword': sslClientKeyPassword, + if (sslEndpointIdentificationAlgorithm != null) + 'SslEndpointIdentificationAlgorithm': + sslEndpointIdentificationAlgorithm.toValue(), if (topic != null) 'Topic': topic, }; } } +enum KafkaSslEndpointIdentificationAlgorithm { + none, + https, +} + +extension KafkaSslEndpointIdentificationAlgorithmValueExtension + on KafkaSslEndpointIdentificationAlgorithm { + String toValue() { + switch (this) { + case KafkaSslEndpointIdentificationAlgorithm.none: + return 'none'; + case KafkaSslEndpointIdentificationAlgorithm.https: + return 'https'; + } + } +} + +extension KafkaSslEndpointIdentificationAlgorithmFromString on String { + KafkaSslEndpointIdentificationAlgorithm + toKafkaSslEndpointIdentificationAlgorithm() { + switch (this) { + case 'none': + return KafkaSslEndpointIdentificationAlgorithm.none; + case 'https': + return KafkaSslEndpointIdentificationAlgorithm.https; + } + throw Exception( + '$this is not known in enum KafkaSslEndpointIdentificationAlgorithm'); + } +} + /// Provides information that describes an Amazon Kinesis Data Stream endpoint. /// This information includes the output format of records applied to the /// endpoint and details of transaction and control table data information. @@ -9109,6 +12859,84 @@ class ListTagsForResourceResponse { } } +enum LongVarcharMappingType { + wstring, + clob, + nclob, +} + +extension LongVarcharMappingTypeValueExtension on LongVarcharMappingType { + String toValue() { + switch (this) { + case LongVarcharMappingType.wstring: + return 'wstring'; + case LongVarcharMappingType.clob: + return 'clob'; + case LongVarcharMappingType.nclob: + return 'nclob'; + } + } +} + +extension LongVarcharMappingTypeFromString on String { + LongVarcharMappingType toLongVarcharMappingType() { + switch (this) { + case 'wstring': + return LongVarcharMappingType.wstring; + case 'clob': + return LongVarcharMappingType.clob; + case 'nclob': + return LongVarcharMappingType.nclob; + } + throw Exception('$this is not known in enum LongVarcharMappingType'); + } +} + +/// Provides information that defines a MariaDB data provider. +class MariaDbDataProviderSettings { + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The port value for the MariaDB data provider + final int? port; + + /// The name of the MariaDB server. + final String? serverName; + + /// The SSL mode used to connect to the MariaDB data provider. The default value + /// is none. + final DmsSslModeValue? sslMode; + + MariaDbDataProviderSettings({ + this.certificateArn, + this.port, + this.serverName, + this.sslMode, + }); + + factory MariaDbDataProviderSettings.fromJson(Map json) { + return MariaDbDataProviderSettings( + certificateArn: json['CertificateArn'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final certificateArn = this.certificateArn; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (certificateArn != null) 'CertificateArn': certificateArn, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + enum MessageFormatValue { json, jsonUnformatted, @@ -9229,8 +13057,9 @@ class MicrosoftSQLServerSettings { /// Indicates the mode used to fetch CDC data. final TlogAccessMode? tlogAccessMode; - /// Use the TrimSpaceInChar source endpoint setting to trim data on - /// CHAR and NCHAR data types during migration. The default value is + /// Use the TrimSpaceInChar source endpoint setting to right-trim + /// data on CHAR and NCHAR data types during migration. Setting + /// TrimSpaceInChar does not left-trim data. The default value is /// true. final bool? trimSpaceInChar; @@ -9335,6 +13164,179 @@ class MicrosoftSQLServerSettings { } } +/// Provides information that defines a Microsoft SQL Server data provider. +class MicrosoftSqlServerDataProviderSettings { + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The database name on the Microsoft SQL Server data provider. + final String? databaseName; + + /// The port value for the Microsoft SQL Server data provider. + final int? port; + + /// The name of the Microsoft SQL Server server. + final String? serverName; + + /// The SSL mode used to connect to the Microsoft SQL Server data provider. The + /// default value is none. + final DmsSslModeValue? sslMode; + + MicrosoftSqlServerDataProviderSettings({ + this.certificateArn, + this.databaseName, + this.port, + this.serverName, + this.sslMode, + }); + + factory MicrosoftSqlServerDataProviderSettings.fromJson( + Map json) { + return MicrosoftSqlServerDataProviderSettings( + certificateArn: json['CertificateArn'] as String?, + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final certificateArn = this.certificateArn; + final databaseName = this.databaseName; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (certificateArn != null) 'CertificateArn': certificateArn, + if (databaseName != null) 'DatabaseName': databaseName, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + +/// Provides information that defines a migration project. +class MigrationProject { + /// A user-friendly description of the migration project. + final String? description; + + /// The Amazon Resource Name (ARN) of the instance profile for your migration + /// project. + final String? instanceProfileArn; + + /// The name of the associated instance profile. + final String? instanceProfileName; + + /// The ARN string that uniquely identifies the migration project. + final String? migrationProjectArn; + + /// The time when the migration project was created. + final DateTime? migrationProjectCreationTime; + + /// The name of the migration project. + final String? migrationProjectName; + + /// The schema conversion application attributes, including the Amazon S3 bucket + /// name and Amazon S3 role ARN. + final SCApplicationAttributes? schemaConversionApplicationAttributes; + + /// Information about the source data provider, including the name or ARN, and + /// Secrets Manager parameters. + final List? sourceDataProviderDescriptors; + + /// Information about the target data provider, including the name or ARN, and + /// Secrets Manager parameters. + final List? targetDataProviderDescriptors; + + /// The settings in JSON format for migration rules. Migration rules make it + /// possible for you to change the object names according to the rules that you + /// specify. For example, you can change an object name to lowercase or + /// uppercase, add or remove a prefix or suffix, or rename objects. + final String? transformationRules; + + MigrationProject({ + this.description, + this.instanceProfileArn, + this.instanceProfileName, + this.migrationProjectArn, + this.migrationProjectCreationTime, + this.migrationProjectName, + this.schemaConversionApplicationAttributes, + this.sourceDataProviderDescriptors, + this.targetDataProviderDescriptors, + this.transformationRules, + }); + + factory MigrationProject.fromJson(Map json) { + return MigrationProject( + description: json['Description'] as String?, + instanceProfileArn: json['InstanceProfileArn'] as String?, + instanceProfileName: json['InstanceProfileName'] as String?, + migrationProjectArn: json['MigrationProjectArn'] as String?, + migrationProjectCreationTime: + timeStampFromJson(json['MigrationProjectCreationTime']), + migrationProjectName: json['MigrationProjectName'] as String?, + schemaConversionApplicationAttributes: + json['SchemaConversionApplicationAttributes'] != null + ? SCApplicationAttributes.fromJson( + json['SchemaConversionApplicationAttributes'] + as Map) + : null, + sourceDataProviderDescriptors: (json['SourceDataProviderDescriptors'] + as List?) + ?.whereNotNull() + .map( + (e) => DataProviderDescriptor.fromJson(e as Map)) + .toList(), + targetDataProviderDescriptors: (json['TargetDataProviderDescriptors'] + as List?) + ?.whereNotNull() + .map( + (e) => DataProviderDescriptor.fromJson(e as Map)) + .toList(), + transformationRules: json['TransformationRules'] as String?, + ); + } + + Map toJson() { + final description = this.description; + final instanceProfileArn = this.instanceProfileArn; + final instanceProfileName = this.instanceProfileName; + final migrationProjectArn = this.migrationProjectArn; + final migrationProjectCreationTime = this.migrationProjectCreationTime; + final migrationProjectName = this.migrationProjectName; + final schemaConversionApplicationAttributes = + this.schemaConversionApplicationAttributes; + final sourceDataProviderDescriptors = this.sourceDataProviderDescriptors; + final targetDataProviderDescriptors = this.targetDataProviderDescriptors; + final transformationRules = this.transformationRules; + return { + if (description != null) 'Description': description, + if (instanceProfileArn != null) 'InstanceProfileArn': instanceProfileArn, + if (instanceProfileName != null) + 'InstanceProfileName': instanceProfileName, + if (migrationProjectArn != null) + 'MigrationProjectArn': migrationProjectArn, + if (migrationProjectCreationTime != null) + 'MigrationProjectCreationTime': + iso8601ToJson(migrationProjectCreationTime), + if (migrationProjectName != null) + 'MigrationProjectName': migrationProjectName, + if (schemaConversionApplicationAttributes != null) + 'SchemaConversionApplicationAttributes': + schemaConversionApplicationAttributes, + if (sourceDataProviderDescriptors != null) + 'SourceDataProviderDescriptors': sourceDataProviderDescriptors, + if (targetDataProviderDescriptors != null) + 'TargetDataProviderDescriptors': targetDataProviderDescriptors, + if (transformationRules != null) + 'TransformationRules': transformationRules, + }; + } +} + enum MigrationTypeValue { fullLoad, cdc, @@ -9368,6 +13370,54 @@ extension MigrationTypeValueFromString on String { } } +class ModifyConversionConfigurationResponse { + /// The name or Amazon Resource Name (ARN) of the modified configuration. + final String? migrationProjectIdentifier; + + ModifyConversionConfigurationResponse({ + this.migrationProjectIdentifier, + }); + + factory ModifyConversionConfigurationResponse.fromJson( + Map json) { + return ModifyConversionConfigurationResponse( + migrationProjectIdentifier: json['MigrationProjectIdentifier'] as String?, + ); + } + + Map toJson() { + final migrationProjectIdentifier = this.migrationProjectIdentifier; + return { + if (migrationProjectIdentifier != null) + 'MigrationProjectIdentifier': migrationProjectIdentifier, + }; + } +} + +class ModifyDataProviderResponse { + /// The data provider that was modified. + final DataProvider? dataProvider; + + ModifyDataProviderResponse({ + this.dataProvider, + }); + + factory ModifyDataProviderResponse.fromJson(Map json) { + return ModifyDataProviderResponse( + dataProvider: json['DataProvider'] != null + ? DataProvider.fromJson(json['DataProvider'] as Map) + : null, + ); + } + + Map toJson() { + final dataProvider = this.dataProvider; + return { + if (dataProvider != null) 'DataProvider': dataProvider, + }; + } +} + ///

      class ModifyEndpointResponse { /// The modified endpoint. @@ -9419,6 +13469,81 @@ class ModifyEventSubscriptionResponse { } } +class ModifyInstanceProfileResponse { + /// The instance profile that was modified. + final InstanceProfile? instanceProfile; + + ModifyInstanceProfileResponse({ + this.instanceProfile, + }); + + factory ModifyInstanceProfileResponse.fromJson(Map json) { + return ModifyInstanceProfileResponse( + instanceProfile: json['InstanceProfile'] != null + ? InstanceProfile.fromJson( + json['InstanceProfile'] as Map) + : null, + ); + } + + Map toJson() { + final instanceProfile = this.instanceProfile; + return { + if (instanceProfile != null) 'InstanceProfile': instanceProfile, + }; + } +} + +class ModifyMigrationProjectResponse { + /// The migration project that was modified. + final MigrationProject? migrationProject; + + ModifyMigrationProjectResponse({ + this.migrationProject, + }); + + factory ModifyMigrationProjectResponse.fromJson(Map json) { + return ModifyMigrationProjectResponse( + migrationProject: json['MigrationProject'] != null + ? MigrationProject.fromJson( + json['MigrationProject'] as Map) + : null, + ); + } + + Map toJson() { + final migrationProject = this.migrationProject; + return { + if (migrationProject != null) 'MigrationProject': migrationProject, + }; + } +} + +class ModifyReplicationConfigResponse { + /// Information about the serverless replication config that was modified. + final ReplicationConfig? replicationConfig; + + ModifyReplicationConfigResponse({ + this.replicationConfig, + }); + + factory ModifyReplicationConfigResponse.fromJson(Map json) { + return ModifyReplicationConfigResponse( + replicationConfig: json['ReplicationConfig'] != null + ? ReplicationConfig.fromJson( + json['ReplicationConfig'] as Map) + : null, + ); + } + + Map toJson() { + final replicationConfig = this.replicationConfig; + return { + if (replicationConfig != null) 'ReplicationConfig': replicationConfig, + }; + } +} + ///

      class ModifyReplicationInstanceResponse { /// The modified replication instance. @@ -9480,23 +13605,101 @@ class ModifyReplicationTaskResponse { /// The replication task that was modified. final ReplicationTask? replicationTask; - ModifyReplicationTaskResponse({ - this.replicationTask, + ModifyReplicationTaskResponse({ + this.replicationTask, + }); + + factory ModifyReplicationTaskResponse.fromJson(Map json) { + return ModifyReplicationTaskResponse( + replicationTask: json['ReplicationTask'] != null + ? ReplicationTask.fromJson( + json['ReplicationTask'] as Map) + : null, + ); + } + + Map toJson() { + final replicationTask = this.replicationTask; + return { + if (replicationTask != null) 'ReplicationTask': replicationTask, + }; + } +} + +/// Provides information that defines a MongoDB data provider. +class MongoDbDataProviderSettings { + /// The authentication method for connecting to the data provider. Valid values + /// are DEFAULT, MONGODB_CR, or SCRAM_SHA_1. + final AuthMechanismValue? authMechanism; + + /// The MongoDB database name. This setting isn't used when + /// AuthType is set to "no". + /// + /// The default is "admin". + final String? authSource; + + /// The authentication type for the database connection. Valid values are + /// PASSWORD or NO. + final AuthTypeValue? authType; + + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The database name on the MongoDB data provider. + final String? databaseName; + + /// The port value for the MongoDB data provider. + final int? port; + + /// The name of the MongoDB server. + final String? serverName; + + /// The SSL mode used to connect to the MongoDB data provider. The default value + /// is none. + final DmsSslModeValue? sslMode; + + MongoDbDataProviderSettings({ + this.authMechanism, + this.authSource, + this.authType, + this.certificateArn, + this.databaseName, + this.port, + this.serverName, + this.sslMode, }); - factory ModifyReplicationTaskResponse.fromJson(Map json) { - return ModifyReplicationTaskResponse( - replicationTask: json['ReplicationTask'] != null - ? ReplicationTask.fromJson( - json['ReplicationTask'] as Map) - : null, + factory MongoDbDataProviderSettings.fromJson(Map json) { + return MongoDbDataProviderSettings( + authMechanism: (json['AuthMechanism'] as String?)?.toAuthMechanismValue(), + authSource: json['AuthSource'] as String?, + authType: (json['AuthType'] as String?)?.toAuthTypeValue(), + certificateArn: json['CertificateArn'] as String?, + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), ); } Map toJson() { - final replicationTask = this.replicationTask; + final authMechanism = this.authMechanism; + final authSource = this.authSource; + final authType = this.authType; + final certificateArn = this.certificateArn; + final databaseName = this.databaseName; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; return { - if (replicationTask != null) 'ReplicationTask': replicationTask, + if (authMechanism != null) 'AuthMechanism': authMechanism.toValue(), + if (authSource != null) 'AuthSource': authSource, + if (authType != null) 'AuthType': authType.toValue(), + if (certificateArn != null) 'CertificateArn': certificateArn, + if (databaseName != null) 'DatabaseName': databaseName, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), }; } } @@ -9561,6 +13764,21 @@ class MongoDbSettings { /// The port value for the MongoDB source endpoint. final int? port; + /// If true, DMS replicates data to shard collections. DMS only + /// uses this setting if the target endpoint is a DocumentDB elastic cluster. + /// + /// When this setting is true, note the following: + /// + ///

        + ///
      • + /// You must set TargetTablePrepMode to nothing. + ///
      • + ///
      • + /// DMS automatically sets useUpdateLookup to false. + ///
      • + ///
      + final bool? replicateShardCollections; + /// The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as /// the trusted entity and grants the required permissions to access the value /// in SecretsManagerSecret. The role must allow the @@ -9587,9 +13805,16 @@ class MongoDbSettings { /// connection details. final String? secretsManagerSecretId; - /// The name of the server on the MongoDB source endpoint. + /// The name of the server on the MongoDB source endpoint. For MongoDB Atlas, + /// provide the server name for any of the servers in the replication set. final String? serverName; + /// If true, DMS retrieves the entire document from the MongoDB + /// source during migration. This may cause a migration failure if the server + /// response exceeds bandwidth limits. To fetch only updates and deletes during + /// migration, set this parameter to false. + final bool? useUpdateLookUp; + /// The user name you use to access the MongoDB source endpoint. final String? username; @@ -9604,9 +13829,11 @@ class MongoDbSettings { this.nestingLevel, this.password, this.port, + this.replicateShardCollections, this.secretsManagerAccessRoleArn, this.secretsManagerSecretId, this.serverName, + this.useUpdateLookUp, this.username, }); @@ -9622,10 +13849,12 @@ class MongoDbSettings { nestingLevel: (json['NestingLevel'] as String?)?.toNestingLevelValue(), password: json['Password'] as String?, port: json['Port'] as int?, + replicateShardCollections: json['ReplicateShardCollections'] as bool?, secretsManagerAccessRoleArn: json['SecretsManagerAccessRoleArn'] as String?, secretsManagerSecretId: json['SecretsManagerSecretId'] as String?, serverName: json['ServerName'] as String?, + useUpdateLookUp: json['UseUpdateLookUp'] as bool?, username: json['Username'] as String?, ); } @@ -9641,9 +13870,11 @@ class MongoDbSettings { final nestingLevel = this.nestingLevel; final password = this.password; final port = this.port; + final replicateShardCollections = this.replicateShardCollections; final secretsManagerAccessRoleArn = this.secretsManagerAccessRoleArn; final secretsManagerSecretId = this.secretsManagerSecretId; final serverName = this.serverName; + final useUpdateLookUp = this.useUpdateLookUp; final username = this.username; return { if (authMechanism != null) 'AuthMechanism': authMechanism.toValue(), @@ -9656,11 +13887,14 @@ class MongoDbSettings { if (nestingLevel != null) 'NestingLevel': nestingLevel.toValue(), if (password != null) 'Password': password, if (port != null) 'Port': port, + if (replicateShardCollections != null) + 'ReplicateShardCollections': replicateShardCollections, if (secretsManagerAccessRoleArn != null) 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, if (secretsManagerSecretId != null) 'SecretsManagerSecretId': secretsManagerSecretId, if (serverName != null) 'ServerName': serverName, + if (useUpdateLookUp != null) 'UseUpdateLookUp': useUpdateLookUp, if (username != null) 'Username': username, }; } @@ -9726,6 +13960,9 @@ class MySQLSettings { /// seconds. final int? eventsPollInterval; + /// Sets the client statement timeout (in seconds) for a MySQL source endpoint. + final int? executeTimeout; + /// Specifies the maximum size (in KB) of any .csv file used to transfer data to /// a MySQL-compatible database. /// @@ -9809,6 +14046,7 @@ class MySQLSettings { this.cleanSourceMetadataOnMismatch, this.databaseName, this.eventsPollInterval, + this.executeTimeout, this.maxFileSize, this.parallelLoadThreads, this.password, @@ -9828,6 +14066,7 @@ class MySQLSettings { json['CleanSourceMetadataOnMismatch'] as bool?, databaseName: json['DatabaseName'] as String?, eventsPollInterval: json['EventsPollInterval'] as int?, + executeTimeout: json['ExecuteTimeout'] as int?, maxFileSize: json['MaxFileSize'] as int?, parallelLoadThreads: json['ParallelLoadThreads'] as int?, password: json['Password'] as String?, @@ -9847,6 +14086,7 @@ class MySQLSettings { final cleanSourceMetadataOnMismatch = this.cleanSourceMetadataOnMismatch; final databaseName = this.databaseName; final eventsPollInterval = this.eventsPollInterval; + final executeTimeout = this.executeTimeout; final maxFileSize = this.maxFileSize; final parallelLoadThreads = this.parallelLoadThreads; final password = this.password; @@ -9863,6 +14103,7 @@ class MySQLSettings { 'CleanSourceMetadataOnMismatch': cleanSourceMetadataOnMismatch, if (databaseName != null) 'DatabaseName': databaseName, if (eventsPollInterval != null) 'EventsPollInterval': eventsPollInterval, + if (executeTimeout != null) 'ExecuteTimeout': executeTimeout, if (maxFileSize != null) 'MaxFileSize': maxFileSize, if (parallelLoadThreads != null) 'ParallelLoadThreads': parallelLoadThreads, @@ -9880,6 +14121,51 @@ class MySQLSettings { } } +/// Provides information that defines a MySQL data provider. +class MySqlDataProviderSettings { + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The port value for the MySQL data provider. + final int? port; + + /// The name of the MySQL server. + final String? serverName; + + /// The SSL mode used to connect to the MySQL data provider. The default value + /// is none. + final DmsSslModeValue? sslMode; + + MySqlDataProviderSettings({ + this.certificateArn, + this.port, + this.serverName, + this.sslMode, + }); + + factory MySqlDataProviderSettings.fromJson(Map json) { + return MySqlDataProviderSettings( + certificateArn: json['CertificateArn'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final certificateArn = this.certificateArn; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (certificateArn != null) 'CertificateArn': certificateArn, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + /// Provides information that defines an Amazon Neptune endpoint. class NeptuneSettings { /// A folder path where you want DMS to store migrated graph data in the S3 @@ -9992,6 +14278,121 @@ extension NestingLevelValueFromString on String { } } +/// Provides information that defines an Oracle data provider. +class OracleDataProviderSettings { + /// The address of your Oracle Automatic Storage Management (ASM) server. You + /// can set this value from the asm_server value. You set + /// asm_server as part of the extra connection attribute string to + /// access an Oracle server with Binary Reader that uses ASM. For more + /// information, see
      Configuration + /// for change data capture (CDC) on an Oracle source database. + final String? asmServer; + + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The database name on the Oracle data provider. + final String? databaseName; + + /// The port value for the Oracle data provider. + final int? port; + + /// The ARN of the IAM role that provides access to the secret in Secrets + /// Manager that contains the Oracle ASM connection details. + final String? secretsManagerOracleAsmAccessRoleArn; + + /// The identifier of the secret in Secrets Manager that contains the Oracle ASM + /// connection details. + /// + /// Required only if your data provider uses the Oracle ASM server. + final String? secretsManagerOracleAsmSecretId; + + /// The ARN of the IAM role that provides access to the secret in Secrets + /// Manager that contains the TDE password. + final String? secretsManagerSecurityDbEncryptionAccessRoleArn; + + /// The identifier of the secret in Secrets Manager that contains the + /// transparent data encryption (TDE) password. DMS requires this password to + /// access Oracle redo logs encrypted by TDE using Binary Reader. + final String? secretsManagerSecurityDbEncryptionSecretId; + + /// The name of the Oracle server. + final String? serverName; + + /// The SSL mode used to connect to the Oracle data provider. The default value + /// is none. + final DmsSslModeValue? sslMode; + + OracleDataProviderSettings({ + this.asmServer, + this.certificateArn, + this.databaseName, + this.port, + this.secretsManagerOracleAsmAccessRoleArn, + this.secretsManagerOracleAsmSecretId, + this.secretsManagerSecurityDbEncryptionAccessRoleArn, + this.secretsManagerSecurityDbEncryptionSecretId, + this.serverName, + this.sslMode, + }); + + factory OracleDataProviderSettings.fromJson(Map json) { + return OracleDataProviderSettings( + asmServer: json['AsmServer'] as String?, + certificateArn: json['CertificateArn'] as String?, + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + secretsManagerOracleAsmAccessRoleArn: + json['SecretsManagerOracleAsmAccessRoleArn'] as String?, + secretsManagerOracleAsmSecretId: + json['SecretsManagerOracleAsmSecretId'] as String?, + secretsManagerSecurityDbEncryptionAccessRoleArn: + json['SecretsManagerSecurityDbEncryptionAccessRoleArn'] as String?, + secretsManagerSecurityDbEncryptionSecretId: + json['SecretsManagerSecurityDbEncryptionSecretId'] as String?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final asmServer = this.asmServer; + final certificateArn = this.certificateArn; + final databaseName = this.databaseName; + final port = this.port; + final secretsManagerOracleAsmAccessRoleArn = + this.secretsManagerOracleAsmAccessRoleArn; + final secretsManagerOracleAsmSecretId = + this.secretsManagerOracleAsmSecretId; + final secretsManagerSecurityDbEncryptionAccessRoleArn = + this.secretsManagerSecurityDbEncryptionAccessRoleArn; + final secretsManagerSecurityDbEncryptionSecretId = + this.secretsManagerSecurityDbEncryptionSecretId; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (asmServer != null) 'AsmServer': asmServer, + if (certificateArn != null) 'CertificateArn': certificateArn, + if (databaseName != null) 'DatabaseName': databaseName, + if (port != null) 'Port': port, + if (secretsManagerOracleAsmAccessRoleArn != null) + 'SecretsManagerOracleAsmAccessRoleArn': + secretsManagerOracleAsmAccessRoleArn, + if (secretsManagerOracleAsmSecretId != null) + 'SecretsManagerOracleAsmSecretId': secretsManagerOracleAsmSecretId, + if (secretsManagerSecurityDbEncryptionAccessRoleArn != null) + 'SecretsManagerSecurityDbEncryptionAccessRoleArn': + secretsManagerSecurityDbEncryptionAccessRoleArn, + if (secretsManagerSecurityDbEncryptionSecretId != null) + 'SecretsManagerSecurityDbEncryptionSecretId': + secretsManagerSecurityDbEncryptionSecretId, + if (serverName != null) 'ServerName': serverName, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + /// Provides information that defines an Oracle endpoint. class OracleSettings { /// Set this attribute to false in order to use the Binary Reader @@ -10140,6 +14541,17 @@ class OracleSettings { /// Example: numberDataTypeScale=12 final int? numberDatatypeScale; + /// The timeframe in minutes to check for open transactions for a CDC-only task. + /// + /// You can specify an integer value between 0 (the default) and 240 (the + /// maximum). + /// + /// This parameter is only valid in DMS version 3.5.0 and later. DMS supports a + /// window of up to 9.5 hours including the value for + /// OpenTransactionWindow. + /// + final int? openTransactionWindow; + /// Set this string attribute to the required value in order to use the Binary /// Reader to capture change data for an Amazon RDS for Oracle as the source. /// This value specifies the default Oracle root used to access the redo logs. @@ -10211,7 +14623,7 @@ class OracleSettings { /// You can specify one of two sets of values for these permissions. You can /// specify the values for this setting and /// SecretsManagerOracleAsmSecretId. Or you can specify clear-text - /// values for AsmUserName, AsmPassword, and + /// values for AsmUser, AsmPassword, and /// AsmServerName. You can't specify both. For more information on /// creating this SecretsManagerOracleAsmSecret and the /// SecretsManagerOracleAsmAccessRoleArn and @@ -10349,6 +14761,7 @@ class OracleSettings { this.extraArchivedLogDestIds, this.failTasksOnLobTruncation, this.numberDatatypeScale, + this.openTransactionWindow, this.oraclePathPrefix, this.parallelAsmReadThreads, this.password, @@ -10400,6 +14813,7 @@ class OracleSettings { .toList(), failTasksOnLobTruncation: json['FailTasksOnLobTruncation'] as bool?, numberDatatypeScale: json['NumberDatatypeScale'] as int?, + openTransactionWindow: json['OpenTransactionWindow'] as int?, oraclePathPrefix: json['OraclePathPrefix'] as String?, parallelAsmReadThreads: json['ParallelAsmReadThreads'] as int?, password: json['Password'] as String?, @@ -10450,6 +14864,7 @@ class OracleSettings { final extraArchivedLogDestIds = this.extraArchivedLogDestIds; final failTasksOnLobTruncation = this.failTasksOnLobTruncation; final numberDatatypeScale = this.numberDatatypeScale; + final openTransactionWindow = this.openTransactionWindow; final oraclePathPrefix = this.oraclePathPrefix; final parallelAsmReadThreads = this.parallelAsmReadThreads; final password = this.password; @@ -10507,6 +14922,8 @@ class OracleSettings { 'FailTasksOnLobTruncation': failTasksOnLobTruncation, if (numberDatatypeScale != null) 'NumberDatatypeScale': numberDatatypeScale, + if (openTransactionWindow != null) + 'OpenTransactionWindow': openTransactionWindow, if (oraclePathPrefix != null) 'OraclePathPrefix': oraclePathPrefix, if (parallelAsmReadThreads != null) 'ParallelAsmReadThreads': parallelAsmReadThreads, @@ -10656,6 +15073,34 @@ class OrderableReplicationInstance { } } +enum OriginTypeValue { + source, + target, +} + +extension OriginTypeValueValueExtension on OriginTypeValue { + String toValue() { + switch (this) { + case OriginTypeValue.source: + return 'SOURCE'; + case OriginTypeValue.target: + return 'TARGET'; + } + } +} + +extension OriginTypeValueFromString on String { + OriginTypeValue toOriginTypeValue() { + switch (this) { + case 'SOURCE': + return OriginTypeValue.source; + case 'TARGET': + return OriginTypeValue.target; + } + throw Exception('$this is not known in enum OriginTypeValue'); + } +} + enum ParquetVersionValue { parquet_1_0, parquet_2_0, @@ -10802,6 +15247,9 @@ class PostgreSQLSettings { /// session_replication_role='replica' final String? afterConnectScript; + /// The Babelfish for Aurora PostgreSQL database name for the endpoint. + final String? babelfishDatabaseName; + /// To capture DDL events, DMS creates various artifacts in the PostgreSQL /// database when the task starts. You can later remove these artifacts. /// @@ -10809,6 +15257,11 @@ class PostgreSQLSettings { /// triggers on the source database. final bool? captureDdls; + /// Specifies the default behavior of the replication's handling of PostgreSQL- + /// compatible endpoints that require some additional configuration, such as + /// Babelfish endpoints. + final DatabaseMode? databaseMode; + /// Database name for the endpoint. final String? databaseName; @@ -10845,9 +15298,16 @@ class PostgreSQLSettings { final String? heartbeatSchema; /// When true, lets PostgreSQL migrate the boolean type as boolean. By default, - /// PostgreSQL migrates booleans as varchar(5). + /// PostgreSQL migrates booleans as varchar(5). You must set this + /// setting on both the source and target endpoints for it to take effect. final bool? mapBooleanAsBoolean; + /// When true, DMS migrates JSONB values as CLOB. + final bool? mapJsonbAsClob; + + /// When true, DMS migrates LONG values as VARCHAR. + final LongVarcharMappingType? mapLongVarcharAs; + /// Specifies the maximum size (in KB) of any .csv file used to transfer data to /// PostgreSQL. /// @@ -10915,7 +15375,7 @@ class PostgreSQLSettings { /// /// For more information about setting the CdcStartPosition request /// parameter, see Determining + /// href="https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native">Determining /// a CDC native start point in the Database Migration Service User /// Guide. For more information about using CdcStartPosition, /// see json) { return PostgreSQLSettings( afterConnectScript: json['AfterConnectScript'] as String?, + babelfishDatabaseName: json['BabelfishDatabaseName'] as String?, captureDdls: json['CaptureDdls'] as bool?, + databaseMode: (json['DatabaseMode'] as String?)?.toDatabaseMode(), databaseName: json['DatabaseName'] as String?, ddlArtifactsSchema: json['DdlArtifactsSchema'] as String?, executeTimeout: json['ExecuteTimeout'] as int?, @@ -10969,6 +15435,9 @@ class PostgreSQLSettings { heartbeatFrequency: json['HeartbeatFrequency'] as int?, heartbeatSchema: json['HeartbeatSchema'] as String?, mapBooleanAsBoolean: json['MapBooleanAsBoolean'] as bool?, + mapJsonbAsClob: json['MapJsonbAsClob'] as bool?, + mapLongVarcharAs: + (json['MapLongVarcharAs'] as String?)?.toLongVarcharMappingType(), maxFileSize: json['MaxFileSize'] as int?, password: json['Password'] as String?, pluginName: (json['PluginName'] as String?)?.toPluginNameValue(), @@ -10985,7 +15454,9 @@ class PostgreSQLSettings { Map toJson() { final afterConnectScript = this.afterConnectScript; + final babelfishDatabaseName = this.babelfishDatabaseName; final captureDdls = this.captureDdls; + final databaseMode = this.databaseMode; final databaseName = this.databaseName; final ddlArtifactsSchema = this.ddlArtifactsSchema; final executeTimeout = this.executeTimeout; @@ -10994,6 +15465,8 @@ class PostgreSQLSettings { final heartbeatFrequency = this.heartbeatFrequency; final heartbeatSchema = this.heartbeatSchema; final mapBooleanAsBoolean = this.mapBooleanAsBoolean; + final mapJsonbAsClob = this.mapJsonbAsClob; + final mapLongVarcharAs = this.mapLongVarcharAs; final maxFileSize = this.maxFileSize; final password = this.password; final pluginName = this.pluginName; @@ -11005,30 +15478,156 @@ class PostgreSQLSettings { final trimSpaceInChar = this.trimSpaceInChar; final username = this.username; return { - if (afterConnectScript != null) 'AfterConnectScript': afterConnectScript, - if (captureDdls != null) 'CaptureDdls': captureDdls, + if (afterConnectScript != null) 'AfterConnectScript': afterConnectScript, + if (babelfishDatabaseName != null) + 'BabelfishDatabaseName': babelfishDatabaseName, + if (captureDdls != null) 'CaptureDdls': captureDdls, + if (databaseMode != null) 'DatabaseMode': databaseMode.toValue(), + if (databaseName != null) 'DatabaseName': databaseName, + if (ddlArtifactsSchema != null) 'DdlArtifactsSchema': ddlArtifactsSchema, + if (executeTimeout != null) 'ExecuteTimeout': executeTimeout, + if (failTasksOnLobTruncation != null) + 'FailTasksOnLobTruncation': failTasksOnLobTruncation, + if (heartbeatEnable != null) 'HeartbeatEnable': heartbeatEnable, + if (heartbeatFrequency != null) 'HeartbeatFrequency': heartbeatFrequency, + if (heartbeatSchema != null) 'HeartbeatSchema': heartbeatSchema, + if (mapBooleanAsBoolean != null) + 'MapBooleanAsBoolean': mapBooleanAsBoolean, + if (mapJsonbAsClob != null) 'MapJsonbAsClob': mapJsonbAsClob, + if (mapLongVarcharAs != null) + 'MapLongVarcharAs': mapLongVarcharAs.toValue(), + if (maxFileSize != null) 'MaxFileSize': maxFileSize, + if (password != null) 'Password': password, + if (pluginName != null) 'PluginName': pluginName.toValue(), + if (port != null) 'Port': port, + if (secretsManagerAccessRoleArn != null) + 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, + if (secretsManagerSecretId != null) + 'SecretsManagerSecretId': secretsManagerSecretId, + if (serverName != null) 'ServerName': serverName, + if (slotName != null) 'SlotName': slotName, + if (trimSpaceInChar != null) 'TrimSpaceInChar': trimSpaceInChar, + if (username != null) 'Username': username, + }; + } +} + +/// Provides information that defines a PostgreSQL data provider. +class PostgreSqlDataProviderSettings { + /// The Amazon Resource Name (ARN) of the certificate used for SSL connection. + final String? certificateArn; + + /// The database name on the PostgreSQL data provider. + final String? databaseName; + + /// The port value for the PostgreSQL data provider. + final int? port; + + /// The name of the PostgreSQL server. + final String? serverName; + + /// The SSL mode used to connect to the PostgreSQL data provider. The default + /// value is none. + final DmsSslModeValue? sslMode; + + PostgreSqlDataProviderSettings({ + this.certificateArn, + this.databaseName, + this.port, + this.serverName, + this.sslMode, + }); + + factory PostgreSqlDataProviderSettings.fromJson(Map json) { + return PostgreSqlDataProviderSettings( + certificateArn: json['CertificateArn'] as String?, + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + sslMode: (json['SslMode'] as String?)?.toDmsSslModeValue(), + ); + } + + Map toJson() { + final certificateArn = this.certificateArn; + final databaseName = this.databaseName; + final port = this.port; + final serverName = this.serverName; + final sslMode = this.sslMode; + return { + if (certificateArn != null) 'CertificateArn': certificateArn, if (databaseName != null) 'DatabaseName': databaseName, - if (ddlArtifactsSchema != null) 'DdlArtifactsSchema': ddlArtifactsSchema, - if (executeTimeout != null) 'ExecuteTimeout': executeTimeout, - if (failTasksOnLobTruncation != null) - 'FailTasksOnLobTruncation': failTasksOnLobTruncation, - if (heartbeatEnable != null) 'HeartbeatEnable': heartbeatEnable, - if (heartbeatFrequency != null) 'HeartbeatFrequency': heartbeatFrequency, - if (heartbeatSchema != null) 'HeartbeatSchema': heartbeatSchema, - if (mapBooleanAsBoolean != null) - 'MapBooleanAsBoolean': mapBooleanAsBoolean, - if (maxFileSize != null) 'MaxFileSize': maxFileSize, - if (password != null) 'Password': password, - if (pluginName != null) 'PluginName': pluginName.toValue(), if (port != null) 'Port': port, - if (secretsManagerAccessRoleArn != null) - 'SecretsManagerAccessRoleArn': secretsManagerAccessRoleArn, - if (secretsManagerSecretId != null) - 'SecretsManagerSecretId': secretsManagerSecretId, if (serverName != null) 'ServerName': serverName, - if (slotName != null) 'SlotName': slotName, - if (trimSpaceInChar != null) 'TrimSpaceInChar': trimSpaceInChar, - if (username != null) 'Username': username, + if (sslMode != null) 'SslMode': sslMode.toValue(), + }; + } +} + +/// Information about provisioning resources for an DMS serverless replication. +class ProvisionData { + /// The timestamp when provisioning became available. + final DateTime? dateNewProvisioningDataAvailable; + + /// The timestamp when DMS provisioned replication resources. + final DateTime? dateProvisioned; + + /// Whether the new provisioning is available to the replication. + final bool? isNewProvisioningAvailable; + + /// The current provisioning state + final String? provisionState; + + /// The number of capacity units the replication is using. + final int? provisionedCapacityUnits; + + /// A message describing the reason that DMS provisioned new resources for the + /// serverless replication. + final String? reasonForNewProvisioningData; + + ProvisionData({ + this.dateNewProvisioningDataAvailable, + this.dateProvisioned, + this.isNewProvisioningAvailable, + this.provisionState, + this.provisionedCapacityUnits, + this.reasonForNewProvisioningData, + }); + + factory ProvisionData.fromJson(Map json) { + return ProvisionData( + dateNewProvisioningDataAvailable: + timeStampFromJson(json['DateNewProvisioningDataAvailable']), + dateProvisioned: timeStampFromJson(json['DateProvisioned']), + isNewProvisioningAvailable: json['IsNewProvisioningAvailable'] as bool?, + provisionState: json['ProvisionState'] as String?, + provisionedCapacityUnits: json['ProvisionedCapacityUnits'] as int?, + reasonForNewProvisioningData: + json['ReasonForNewProvisioningData'] as String?, + ); + } + + Map toJson() { + final dateNewProvisioningDataAvailable = + this.dateNewProvisioningDataAvailable; + final dateProvisioned = this.dateProvisioned; + final isNewProvisioningAvailable = this.isNewProvisioningAvailable; + final provisionState = this.provisionState; + final provisionedCapacityUnits = this.provisionedCapacityUnits; + final reasonForNewProvisioningData = this.reasonForNewProvisioningData; + return { + if (dateNewProvisioningDataAvailable != null) + 'DateNewProvisioningDataAvailable': + unixTimestampToJson(dateNewProvisioningDataAvailable), + if (dateProvisioned != null) + 'DateProvisioned': unixTimestampToJson(dateProvisioned), + if (isNewProvisioningAvailable != null) + 'IsNewProvisioningAvailable': isNewProvisioningAvailable, + if (provisionState != null) 'ProvisionState': provisionState, + if (provisionedCapacityUnits != null) + 'ProvisionedCapacityUnits': provisionedCapacityUnits, + if (reasonForNewProvisioningData != null) + 'ReasonForNewProvisioningData': reasonForNewProvisioningData, }; } } @@ -11044,6 +15643,9 @@ class RdsConfiguration { /// Describes the recommended target Amazon RDS engine edition. final String? engineEdition; + /// Describes the recommended target Amazon RDS engine version. + final String? engineVersion; + /// Describes the memory on the recommended Amazon RDS DB instance that meets /// your requirements. final double? instanceMemory; @@ -11074,6 +15676,7 @@ class RdsConfiguration { RdsConfiguration({ this.deploymentOption, this.engineEdition, + this.engineVersion, this.instanceMemory, this.instanceType, this.instanceVcpu, @@ -11086,6 +15689,7 @@ class RdsConfiguration { return RdsConfiguration( deploymentOption: json['DeploymentOption'] as String?, engineEdition: json['EngineEdition'] as String?, + engineVersion: json['EngineVersion'] as String?, instanceMemory: json['InstanceMemory'] as double?, instanceType: json['InstanceType'] as String?, instanceVcpu: json['InstanceVcpu'] as double?, @@ -11098,6 +15702,7 @@ class RdsConfiguration { Map toJson() { final deploymentOption = this.deploymentOption; final engineEdition = this.engineEdition; + final engineVersion = this.engineVersion; final instanceMemory = this.instanceMemory; final instanceType = this.instanceType; final instanceVcpu = this.instanceVcpu; @@ -11107,6 +15712,7 @@ class RdsConfiguration { return { if (deploymentOption != null) 'DeploymentOption': deploymentOption, if (engineEdition != null) 'EngineEdition': engineEdition, + if (engineVersion != null) 'EngineVersion': engineVersion, if (instanceMemory != null) 'InstanceMemory': instanceMemory, if (instanceType != null) 'InstanceType': instanceType, if (instanceVcpu != null) 'InstanceVcpu': instanceVcpu, @@ -11169,6 +15775,9 @@ class RdsRequirements { /// The required target Amazon RDS engine edition. final String? engineEdition; + /// The required target Amazon RDS engine version. + final String? engineVersion; + /// The required memory on the Amazon RDS DB instance. final double? instanceMemory; @@ -11185,6 +15794,7 @@ class RdsRequirements { RdsRequirements({ this.deploymentOption, this.engineEdition, + this.engineVersion, this.instanceMemory, this.instanceVcpu, this.storageIops, @@ -11195,6 +15805,7 @@ class RdsRequirements { return RdsRequirements( deploymentOption: json['DeploymentOption'] as String?, engineEdition: json['EngineEdition'] as String?, + engineVersion: json['EngineVersion'] as String?, instanceMemory: json['InstanceMemory'] as double?, instanceVcpu: json['InstanceVcpu'] as double?, storageIops: json['StorageIops'] as int?, @@ -11205,6 +15816,7 @@ class RdsRequirements { Map toJson() { final deploymentOption = this.deploymentOption; final engineEdition = this.engineEdition; + final engineVersion = this.engineVersion; final instanceMemory = this.instanceMemory; final instanceVcpu = this.instanceVcpu; final storageIops = this.storageIops; @@ -11212,6 +15824,7 @@ class RdsRequirements { return { if (deploymentOption != null) 'DeploymentOption': deploymentOption, if (engineEdition != null) 'EngineEdition': engineEdition, + if (engineVersion != null) 'EngineVersion': engineVersion, if (instanceMemory != null) 'InstanceMemory': instanceMemory, if (instanceVcpu != null) 'InstanceVcpu': instanceVcpu, if (storageIops != null) 'StorageIops': storageIops, @@ -11519,6 +16132,43 @@ class RedisSettings { } } +/// Provides information that defines an Amazon Redshift data provider. +class RedshiftDataProviderSettings { + /// The database name on the Amazon Redshift data provider. + final String? databaseName; + + /// The port value for the Amazon Redshift data provider. + final int? port; + + /// The name of the Amazon Redshift server. + final String? serverName; + + RedshiftDataProviderSettings({ + this.databaseName, + this.port, + this.serverName, + }); + + factory RedshiftDataProviderSettings.fromJson(Map json) { + return RedshiftDataProviderSettings( + databaseName: json['DatabaseName'] as String?, + port: json['Port'] as int?, + serverName: json['ServerName'] as String?, + ); + } + + Map toJson() { + final databaseName = this.databaseName; + final port = this.port; + final serverName = this.serverName; + return { + if (databaseName != null) 'DatabaseName': databaseName, + if (port != null) 'Port': port, + if (serverName != null) 'ServerName': serverName, + }; + } +} + /// Provides information that defines an Amazon Redshift endpoint. class RedshiftSettings { /// A value that indicates to allow any date format, including invalid formats @@ -11630,7 +16280,8 @@ class RedshiftSettings { final int? loadTimeout; /// When true, lets Redshift migrate the boolean type as boolean. By default, - /// Redshift migrates booleans as varchar(1). + /// Redshift migrates booleans as varchar(1). You must set this + /// setting on both the source and target endpoints for it to take effect. final bool? mapBooleanAsBoolean; /// The maximum size (in KB) of any .csv file used to load data on an S3 bucket @@ -12047,6 +16698,31 @@ extension ReloadOptionValueFromString on String { } } +///

      +class ReloadReplicationTablesResponse { + /// The Amazon Resource Name of the replication config for which to reload + /// tables. + final String? replicationConfigArn; + + ReloadReplicationTablesResponse({ + this.replicationConfigArn, + }); + + factory ReloadReplicationTablesResponse.fromJson(Map json) { + return ReloadReplicationTablesResponse( + replicationConfigArn: json['ReplicationConfigArn'] as String?, + ); + } + + Map toJson() { + final replicationConfigArn = this.replicationConfigArn; + return { + if (replicationConfigArn != null) + 'ReplicationConfigArn': replicationConfigArn, + }; + } +} + class ReloadTablesResponse { /// The Amazon Resource Name (ARN) of the replication task. final String? replicationTaskArn; @@ -12078,7 +16754,358 @@ class RemoveTagsFromResourceResponse { } Map toJson() { - return {}; + return {}; + } +} + +/// Provides information that describes a serverless replication created by the +/// CreateReplication operation. +class Replication { + /// Indicates the start time for a change data capture (CDC) operation. Use + /// either CdcStartTime or CdcStartPosition to specify + /// when you want a CDC operation to start. Specifying both values results in an + /// error. + final String? cdcStartPosition; + + /// Indicates the start time for a change data capture (CDC) operation. Use + /// either CdcStartTime or CdcStartPosition to specify + /// when you want a CDC operation to start. Specifying both values results in an + /// error. + final DateTime? cdcStartTime; + + /// Indicates when you want a change data capture (CDC) operation to stop. The + /// value can be either server time or commit time. + final String? cdcStopPosition; + + /// Error and other information about why a serverless replication failed. + final List? failureMessages; + + /// Information about provisioning resources for an DMS serverless replication. + final ProvisionData? provisionData; + + /// Indicates the last checkpoint that occurred during a change data capture + /// (CDC) operation. You can provide this value to the + /// CdcStartPosition parameter to start a CDC operation that begins + /// at that checkpoint. + final String? recoveryCheckpoint; + + /// The Amazon Resource Name for the ReplicationConfig associated + /// with the replication. + final String? replicationConfigArn; + + /// The identifier for the ReplicationConfig associated with the + /// replication. + final String? replicationConfigIdentifier; + + /// The time the serverless replication was created. + final DateTime? replicationCreateTime; + + /// The timestamp when DMS will deprovision the replication. + final DateTime? replicationDeprovisionTime; + + /// The timestamp when replication was last stopped. + final DateTime? replicationLastStopTime; + + /// This object provides a collection of statistics about a serverless + /// replication. + final ReplicationStats? replicationStats; + + /// The type of the serverless replication. + final MigrationTypeValue? replicationType; + + /// The time the serverless replication was updated. + final DateTime? replicationUpdateTime; + + /// The Amazon Resource Name for an existing Endpoint the + /// serverless replication uses for its data source. + final String? sourceEndpointArn; + + /// The replication type. + final String? startReplicationType; + + /// The current status of the serverless replication. + final String? status; + + /// The reason the replication task was stopped. This response parameter can + /// return one of the following values: + /// + ///

        + ///
      • + /// "Stop Reason NORMAL" + ///
      • + ///
      • + /// "Stop Reason RECOVERABLE_ERROR" + ///
      • + ///
      • + /// "Stop Reason FATAL_ERROR" + ///
      • + ///
      • + /// "Stop Reason FULL_LOAD_ONLY_FINISHED" + ///
      • + ///
      • + /// "Stop Reason STOPPED_AFTER_FULL_LOAD" – Full load completed, + /// with cached changes not applied + ///
      • + ///
      • + /// "Stop Reason STOPPED_AFTER_CACHED_EVENTS" – Full load + /// completed, with cached changes applied + ///
      • + ///
      • + /// "Stop Reason EXPRESS_LICENSE_LIMITS_REACHED" + ///
      • + ///
      • + /// "Stop Reason STOPPED_AFTER_DDL_APPLY" – User-defined stop task + /// after DDL applied + ///
      • + ///
      • + /// "Stop Reason STOPPED_DUE_TO_LOW_MEMORY" + ///
      • + ///
      • + /// "Stop Reason STOPPED_DUE_TO_LOW_DISK" + ///
      • + ///
      • + /// "Stop Reason STOPPED_AT_SERVER_TIME" – User-defined server time + /// for stopping task + ///
      • + ///
      • + /// "Stop Reason STOPPED_AT_COMMIT_TIME" – User-defined commit time + /// for stopping task + ///
      • + ///
      • + /// "Stop Reason RECONFIGURATION_RESTART" + ///
      • + ///
      • + /// "Stop Reason RECYCLE_TASK" + ///
      • + ///
      + final String? stopReason; + + /// The Amazon Resource Name for an existing Endpoint the + /// serverless replication uses for its data target. + final String? targetEndpointArn; + + Replication({ + this.cdcStartPosition, + this.cdcStartTime, + this.cdcStopPosition, + this.failureMessages, + this.provisionData, + this.recoveryCheckpoint, + this.replicationConfigArn, + this.replicationConfigIdentifier, + this.replicationCreateTime, + this.replicationDeprovisionTime, + this.replicationLastStopTime, + this.replicationStats, + this.replicationType, + this.replicationUpdateTime, + this.sourceEndpointArn, + this.startReplicationType, + this.status, + this.stopReason, + this.targetEndpointArn, + }); + + factory Replication.fromJson(Map json) { + return Replication( + cdcStartPosition: json['CdcStartPosition'] as String?, + cdcStartTime: timeStampFromJson(json['CdcStartTime']), + cdcStopPosition: json['CdcStopPosition'] as String?, + failureMessages: (json['FailureMessages'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + provisionData: json['ProvisionData'] != null + ? ProvisionData.fromJson( + json['ProvisionData'] as Map) + : null, + recoveryCheckpoint: json['RecoveryCheckpoint'] as String?, + replicationConfigArn: json['ReplicationConfigArn'] as String?, + replicationConfigIdentifier: + json['ReplicationConfigIdentifier'] as String?, + replicationCreateTime: timeStampFromJson(json['ReplicationCreateTime']), + replicationDeprovisionTime: + timeStampFromJson(json['ReplicationDeprovisionTime']), + replicationLastStopTime: + timeStampFromJson(json['ReplicationLastStopTime']), + replicationStats: json['ReplicationStats'] != null + ? ReplicationStats.fromJson( + json['ReplicationStats'] as Map) + : null, + replicationType: + (json['ReplicationType'] as String?)?.toMigrationTypeValue(), + replicationUpdateTime: timeStampFromJson(json['ReplicationUpdateTime']), + sourceEndpointArn: json['SourceEndpointArn'] as String?, + startReplicationType: json['StartReplicationType'] as String?, + status: json['Status'] as String?, + stopReason: json['StopReason'] as String?, + targetEndpointArn: json['TargetEndpointArn'] as String?, + ); + } + + Map toJson() { + final cdcStartPosition = this.cdcStartPosition; + final cdcStartTime = this.cdcStartTime; + final cdcStopPosition = this.cdcStopPosition; + final failureMessages = this.failureMessages; + final provisionData = this.provisionData; + final recoveryCheckpoint = this.recoveryCheckpoint; + final replicationConfigArn = this.replicationConfigArn; + final replicationConfigIdentifier = this.replicationConfigIdentifier; + final replicationCreateTime = this.replicationCreateTime; + final replicationDeprovisionTime = this.replicationDeprovisionTime; + final replicationLastStopTime = this.replicationLastStopTime; + final replicationStats = this.replicationStats; + final replicationType = this.replicationType; + final replicationUpdateTime = this.replicationUpdateTime; + final sourceEndpointArn = this.sourceEndpointArn; + final startReplicationType = this.startReplicationType; + final status = this.status; + final stopReason = this.stopReason; + final targetEndpointArn = this.targetEndpointArn; + return { + if (cdcStartPosition != null) 'CdcStartPosition': cdcStartPosition, + if (cdcStartTime != null) + 'CdcStartTime': unixTimestampToJson(cdcStartTime), + if (cdcStopPosition != null) 'CdcStopPosition': cdcStopPosition, + if (failureMessages != null) 'FailureMessages': failureMessages, + if (provisionData != null) 'ProvisionData': provisionData, + if (recoveryCheckpoint != null) 'RecoveryCheckpoint': recoveryCheckpoint, + if (replicationConfigArn != null) + 'ReplicationConfigArn': replicationConfigArn, + if (replicationConfigIdentifier != null) + 'ReplicationConfigIdentifier': replicationConfigIdentifier, + if (replicationCreateTime != null) + 'ReplicationCreateTime': unixTimestampToJson(replicationCreateTime), + if (replicationDeprovisionTime != null) + 'ReplicationDeprovisionTime': + unixTimestampToJson(replicationDeprovisionTime), + if (replicationLastStopTime != null) + 'ReplicationLastStopTime': unixTimestampToJson(replicationLastStopTime), + if (replicationStats != null) 'ReplicationStats': replicationStats, + if (replicationType != null) 'ReplicationType': replicationType.toValue(), + if (replicationUpdateTime != null) + 'ReplicationUpdateTime': unixTimestampToJson(replicationUpdateTime), + if (sourceEndpointArn != null) 'SourceEndpointArn': sourceEndpointArn, + if (startReplicationType != null) + 'StartReplicationType': startReplicationType, + if (status != null) 'Status': status, + if (stopReason != null) 'StopReason': stopReason, + if (targetEndpointArn != null) 'TargetEndpointArn': targetEndpointArn, + }; + } +} + +/// This object provides configuration information about a serverless +/// replication. +class ReplicationConfig { + /// Configuration parameters for provisioning an DMS serverless replication. + final ComputeConfig? computeConfig; + + /// The Amazon Resource Name (ARN) of this DMS Serverless replication + /// configuration. + final String? replicationConfigArn; + + /// The time the serverless replication config was created. + final DateTime? replicationConfigCreateTime; + + /// The identifier for the ReplicationConfig associated with the + /// replication. + final String? replicationConfigIdentifier; + + /// The time the serverless replication config was updated. + final DateTime? replicationConfigUpdateTime; + + /// Configuration parameters for an DMS serverless replication. + final String? replicationSettings; + + /// The type of the replication. + final MigrationTypeValue? replicationType; + + /// The Amazon Resource Name (ARN) of the source endpoint for this DMS + /// serverless replication configuration. + final String? sourceEndpointArn; + + /// Additional parameters for an DMS serverless replication. + final String? supplementalSettings; + + /// Table mappings specified in the replication. + final String? tableMappings; + + /// The Amazon Resource Name (ARN) of the target endpoint for this DMS + /// serverless replication configuration. + final String? targetEndpointArn; + + ReplicationConfig({ + this.computeConfig, + this.replicationConfigArn, + this.replicationConfigCreateTime, + this.replicationConfigIdentifier, + this.replicationConfigUpdateTime, + this.replicationSettings, + this.replicationType, + this.sourceEndpointArn, + this.supplementalSettings, + this.tableMappings, + this.targetEndpointArn, + }); + + factory ReplicationConfig.fromJson(Map json) { + return ReplicationConfig( + computeConfig: json['ComputeConfig'] != null + ? ComputeConfig.fromJson( + json['ComputeConfig'] as Map) + : null, + replicationConfigArn: json['ReplicationConfigArn'] as String?, + replicationConfigCreateTime: + timeStampFromJson(json['ReplicationConfigCreateTime']), + replicationConfigIdentifier: + json['ReplicationConfigIdentifier'] as String?, + replicationConfigUpdateTime: + timeStampFromJson(json['ReplicationConfigUpdateTime']), + replicationSettings: json['ReplicationSettings'] as String?, + replicationType: + (json['ReplicationType'] as String?)?.toMigrationTypeValue(), + sourceEndpointArn: json['SourceEndpointArn'] as String?, + supplementalSettings: json['SupplementalSettings'] as String?, + tableMappings: json['TableMappings'] as String?, + targetEndpointArn: json['TargetEndpointArn'] as String?, + ); + } + + Map toJson() { + final computeConfig = this.computeConfig; + final replicationConfigArn = this.replicationConfigArn; + final replicationConfigCreateTime = this.replicationConfigCreateTime; + final replicationConfigIdentifier = this.replicationConfigIdentifier; + final replicationConfigUpdateTime = this.replicationConfigUpdateTime; + final replicationSettings = this.replicationSettings; + final replicationType = this.replicationType; + final sourceEndpointArn = this.sourceEndpointArn; + final supplementalSettings = this.supplementalSettings; + final tableMappings = this.tableMappings; + final targetEndpointArn = this.targetEndpointArn; + return { + if (computeConfig != null) 'ComputeConfig': computeConfig, + if (replicationConfigArn != null) + 'ReplicationConfigArn': replicationConfigArn, + if (replicationConfigCreateTime != null) + 'ReplicationConfigCreateTime': + unixTimestampToJson(replicationConfigCreateTime), + if (replicationConfigIdentifier != null) + 'ReplicationConfigIdentifier': replicationConfigIdentifier, + if (replicationConfigUpdateTime != null) + 'ReplicationConfigUpdateTime': + unixTimestampToJson(replicationConfigUpdateTime), + if (replicationSettings != null) + 'ReplicationSettings': replicationSettings, + if (replicationType != null) 'ReplicationType': replicationType.toValue(), + if (sourceEndpointArn != null) 'SourceEndpointArn': sourceEndpointArn, + if (supplementalSettings != null) + 'SupplementalSettings': supplementalSettings, + if (tableMappings != null) 'TableMappings': tableMappings, + if (targetEndpointArn != null) 'TargetEndpointArn': targetEndpointArn, + }; } } @@ -12549,6 +17576,105 @@ class ReplicationPendingModifiedValues { } } +/// This object provides a collection of statistics about a serverless +/// replication. +class ReplicationStats { + /// The elapsed time of the replication, in milliseconds. + final int? elapsedTimeMillis; + + /// The date the replication was started either with a fresh start or a target + /// reload. + final DateTime? freshStartDate; + + /// The date the replication full load was finished. + final DateTime? fullLoadFinishDate; + + /// The percent complete for the full load serverless replication. + final int? fullLoadProgressPercent; + + /// The date the replication full load was started. + final DateTime? fullLoadStartDate; + + /// The date the replication is scheduled to start. + final DateTime? startDate; + + /// The date the replication was stopped. + final DateTime? stopDate; + + /// The number of errors that have occured for this replication. + final int? tablesErrored; + + /// The number of tables loaded for this replication. + final int? tablesLoaded; + + /// The number of tables currently loading for this replication. + final int? tablesLoading; + + /// The number of tables queued for this replication. + final int? tablesQueued; + + ReplicationStats({ + this.elapsedTimeMillis, + this.freshStartDate, + this.fullLoadFinishDate, + this.fullLoadProgressPercent, + this.fullLoadStartDate, + this.startDate, + this.stopDate, + this.tablesErrored, + this.tablesLoaded, + this.tablesLoading, + this.tablesQueued, + }); + + factory ReplicationStats.fromJson(Map json) { + return ReplicationStats( + elapsedTimeMillis: json['ElapsedTimeMillis'] as int?, + freshStartDate: timeStampFromJson(json['FreshStartDate']), + fullLoadFinishDate: timeStampFromJson(json['FullLoadFinishDate']), + fullLoadProgressPercent: json['FullLoadProgressPercent'] as int?, + fullLoadStartDate: timeStampFromJson(json['FullLoadStartDate']), + startDate: timeStampFromJson(json['StartDate']), + stopDate: timeStampFromJson(json['StopDate']), + tablesErrored: json['TablesErrored'] as int?, + tablesLoaded: json['TablesLoaded'] as int?, + tablesLoading: json['TablesLoading'] as int?, + tablesQueued: json['TablesQueued'] as int?, + ); + } + + Map toJson() { + final elapsedTimeMillis = this.elapsedTimeMillis; + final freshStartDate = this.freshStartDate; + final fullLoadFinishDate = this.fullLoadFinishDate; + final fullLoadProgressPercent = this.fullLoadProgressPercent; + final fullLoadStartDate = this.fullLoadStartDate; + final startDate = this.startDate; + final stopDate = this.stopDate; + final tablesErrored = this.tablesErrored; + final tablesLoaded = this.tablesLoaded; + final tablesLoading = this.tablesLoading; + final tablesQueued = this.tablesQueued; + return { + if (elapsedTimeMillis != null) 'ElapsedTimeMillis': elapsedTimeMillis, + if (freshStartDate != null) + 'FreshStartDate': unixTimestampToJson(freshStartDate), + if (fullLoadFinishDate != null) + 'FullLoadFinishDate': unixTimestampToJson(fullLoadFinishDate), + if (fullLoadProgressPercent != null) + 'FullLoadProgressPercent': fullLoadProgressPercent, + if (fullLoadStartDate != null) + 'FullLoadStartDate': unixTimestampToJson(fullLoadStartDate), + if (startDate != null) 'StartDate': unixTimestampToJson(startDate), + if (stopDate != null) 'StopDate': unixTimestampToJson(stopDate), + if (tablesErrored != null) 'TablesErrored': tablesErrored, + if (tablesLoaded != null) 'TablesLoaded': tablesLoaded, + if (tablesLoading != null) 'TablesLoading': tablesLoading, + if (tablesQueued != null) 'TablesQueued': tablesQueued, + }; + } +} + /// Describes a subnet group in response to a request by the /// DescribeReplicationSubnetGroups operation. class ReplicationSubnetGroup { @@ -12646,7 +17772,7 @@ class ReplicationTask { /// /// Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12” /// - /// Commit time example: --cdc-stop-position “commit_time: 2018-02-09T12:12:12“ + /// Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“ final String? cdcStopPosition; /// The last error (failure) message generated for the replication task. @@ -13565,9 +18691,11 @@ class S3Settings { /// CdcInsertsAndUpdates is set to true or /// y, only INSERTs and UPDATEs from the source database are /// migrated to the .csv or .parquet file. - /// - /// For .csv file format only, how these INSERTs and UPDATEs are recorded - /// depends on the value of the IncludeOpForFullLoad parameter. If + /// + /// DMS supports the use of the .parquet files in versions 3.4.7 and later. + /// + /// How these INSERTs and UPDATEs are recorded depends on the value of the + /// IncludeOpForFullLoad parameter. If /// IncludeOpForFullLoad is set to true, the first /// field of every CDC record is set to either I or U /// to indicate INSERT and UPDATE operations at the source. But if @@ -13702,7 +18830,7 @@ class S3Settings { /// An optional parameter that specifies how DMS treats null values. While /// handling the null value, you can use this parameter to pass a user-defined /// string as null when writing to the target. For example, when target columns - /// are not nullable, you can use this option to differentiate between the empty + /// are nullable, you can use this option to differentiate between the empty /// string value and the null value. So, if you set this parameter value to the /// empty string ("" or ''), DMS treats the empty string as the null value /// instead of NULL. @@ -13874,11 +19002,14 @@ class S3Settings { final int? ignoreHeaderRows; /// A value that enables a full load to write INSERT operations to the - /// comma-separated value (.csv) output files only to indicate how the rows were - /// added to the source database. + /// comma-separated value (.csv) or .parquet output files only to indicate how + /// the rows were added to the source database. /// /// DMS supports the IncludeOpForFullLoad parameter in versions /// 3.1.4 and later. + /// + /// DMS supports the use of the .parquet files with the + /// IncludeOpForFullLoad parameter in versions 3.4.7 and later. /// /// For full load, records can only be inserted. By default (the /// false setting), no information is recorded in these output @@ -14245,6 +19376,37 @@ class S3Settings { } } +/// Provides information that defines a schema conversion application. +class SCApplicationAttributes { + /// The path for the Amazon S3 bucket that the application uses for exporting + /// assessment reports. + final String? s3BucketPath; + + /// The ARN for the role the application uses to access its Amazon S3 bucket. + final String? s3BucketRoleArn; + + SCApplicationAttributes({ + this.s3BucketPath, + this.s3BucketRoleArn, + }); + + factory SCApplicationAttributes.fromJson(Map json) { + return SCApplicationAttributes( + s3BucketPath: json['S3BucketPath'] as String?, + s3BucketRoleArn: json['S3BucketRoleArn'] as String?, + ); + } + + Map toJson() { + final s3BucketPath = this.s3BucketPath; + final s3BucketRoleArn = this.s3BucketRoleArn; + return { + if (s3BucketPath != null) 'S3BucketPath': s3BucketPath, + if (s3BucketRoleArn != null) 'S3BucketRoleArn': s3BucketRoleArn, + }; + } +} + enum SafeguardPolicy { relyOnSqlServerReplicationAgent, exclusiveAutomaticTruncation, @@ -14278,6 +19440,60 @@ extension SafeguardPolicyFromString on String { } } +/// Provides information about a schema conversion action. +class SchemaConversionRequest { + final ErrorDetails? error; + final ExportSqlDetails? exportSqlDetails; + + /// The migration project ARN. + final String? migrationProjectArn; + + /// The identifier for the schema conversion action. + final String? requestIdentifier; + + /// The schema conversion action status. + final String? status; + + SchemaConversionRequest({ + this.error, + this.exportSqlDetails, + this.migrationProjectArn, + this.requestIdentifier, + this.status, + }); + + factory SchemaConversionRequest.fromJson(Map json) { + return SchemaConversionRequest( + error: json['Error'] != null + ? ErrorDetails.fromJson(json['Error'] as Map) + : null, + exportSqlDetails: json['ExportSqlDetails'] != null + ? ExportSqlDetails.fromJson( + json['ExportSqlDetails'] as Map) + : null, + migrationProjectArn: json['MigrationProjectArn'] as String?, + requestIdentifier: json['RequestIdentifier'] as String?, + status: json['Status'] as String?, + ); + } + + Map toJson() { + final error = this.error; + final exportSqlDetails = this.exportSqlDetails; + final migrationProjectArn = this.migrationProjectArn; + final requestIdentifier = this.requestIdentifier; + final status = this.status; + return { + if (error != null) 'Error': error, + if (exportSqlDetails != null) 'ExportSqlDetails': exportSqlDetails, + if (migrationProjectArn != null) + 'MigrationProjectArn': migrationProjectArn, + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + if (status != null) 'Status': status, + }; + } +} + /// Describes a schema in a Fleet Advisor collector inventory. class SchemaResponse { /// The number of lines of code in a schema in a Fleet Advisor collector @@ -14507,6 +19723,143 @@ extension SslSecurityProtocolValueFromString on String { } } +class StartExtensionPackAssociationResponse { + /// The identifier for the request operation. + final String? requestIdentifier; + + StartExtensionPackAssociationResponse({ + this.requestIdentifier, + }); + + factory StartExtensionPackAssociationResponse.fromJson( + Map json) { + return StartExtensionPackAssociationResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + +class StartMetadataModelAssessmentResponse { + /// The identifier for the assessment operation. + final String? requestIdentifier; + + StartMetadataModelAssessmentResponse({ + this.requestIdentifier, + }); + + factory StartMetadataModelAssessmentResponse.fromJson( + Map json) { + return StartMetadataModelAssessmentResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + +class StartMetadataModelConversionResponse { + /// The identifier for the conversion operation. + final String? requestIdentifier; + + StartMetadataModelConversionResponse({ + this.requestIdentifier, + }); + + factory StartMetadataModelConversionResponse.fromJson( + Map json) { + return StartMetadataModelConversionResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + +class StartMetadataModelExportAsScriptResponse { + /// The identifier for the export operation. + final String? requestIdentifier; + + StartMetadataModelExportAsScriptResponse({ + this.requestIdentifier, + }); + + factory StartMetadataModelExportAsScriptResponse.fromJson( + Map json) { + return StartMetadataModelExportAsScriptResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + +class StartMetadataModelExportToTargetResponse { + /// The identifier for the export operation. + final String? requestIdentifier; + + StartMetadataModelExportToTargetResponse({ + this.requestIdentifier, + }); + + factory StartMetadataModelExportToTargetResponse.fromJson( + Map json) { + return StartMetadataModelExportToTargetResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + +class StartMetadataModelImportResponse { + /// The identifier for the import operation. + final String? requestIdentifier; + + StartMetadataModelImportResponse({ + this.requestIdentifier, + }); + + factory StartMetadataModelImportResponse.fromJson(Map json) { + return StartMetadataModelImportResponse( + requestIdentifier: json['RequestIdentifier'] as String?, + ); + } + + Map toJson() { + final requestIdentifier = this.requestIdentifier; + return { + if (requestIdentifier != null) 'RequestIdentifier': requestIdentifier, + }; + } +} + /// Provides information about the source database to analyze and provide target /// recommendations according to the specified requirements. class StartRecommendationsRequestEntry { @@ -14531,6 +19884,31 @@ class StartRecommendationsRequestEntry { } } +///

      +class StartReplicationResponse { + /// The replication that DMS started. + final Replication? replication; + + StartReplicationResponse({ + this.replication, + }); + + factory StartReplicationResponse.fromJson(Map json) { + return StartReplicationResponse( + replication: json['Replication'] != null + ? Replication.fromJson(json['Replication'] as Map) + : null, + ); + } + + Map toJson() { + final replication = this.replication; + return { + if (replication != null) 'Replication': replication, + }; + } +} + ///

      class StartReplicationTaskAssessmentResponse { /// The assessed replication task. @@ -14646,6 +20024,30 @@ extension StartReplicationTaskTypeValueFromString on String { } } +class StopReplicationResponse { + /// The replication that DMS stopped. + final Replication? replication; + + StopReplicationResponse({ + this.replication, + }); + + factory StopReplicationResponse.fromJson(Map json) { + return StopReplicationResponse( + replication: json['Replication'] != null + ? Replication.fromJson(json['Replication'] as Map) + : null, + ); + } + + Map toJson() { + final replication = this.replication; + return { + if (replication != null) 'Replication': replication, + }; + } +} + ///

      class StopReplicationTaskResponse { /// The replication task stopped. @@ -15250,6 +20652,81 @@ class TestConnectionResponse { } } +/// Provides information that defines an Amazon Timestream endpoint. +class TimestreamSettings { + /// Database name for the endpoint. + final String databaseName; + + /// Set this attribute to specify the default magnetic duration applied to the + /// Amazon Timestream tables in days. This is the number of days that records + /// remain in magnetic store before being discarded. For more information, see + /// Storage + /// in the Amazon + /// Timestream Developer Guide. + final int magneticDuration; + + /// Set this attribute to specify the length of time to store all of the tables + /// in memory that are migrated into Amazon Timestream from the source database. + /// Time is measured in units of hours. When Timestream data comes in, it first + /// resides in memory for the specified duration, which allows quick access to + /// it. + final int memoryDuration; + + /// Set this attribute to true to specify that DMS only applies + /// inserts and updates, and not deletes. Amazon Timestream does not allow + /// deleting records, so if this value is false, DMS nulls out the + /// corresponding record in the Timestream database rather than deleting it. + final bool? cdcInsertsAndUpdates; + + /// Set this attribute to true to enable memory store writes. When + /// this value is false, DMS does not write records that are older + /// in days than the value specified in MagneticDuration, because + /// Amazon Timestream does not allow memory writes by default. For more + /// information, see Storage + /// in the Amazon + /// Timestream Developer Guide. + final bool? enableMagneticStoreWrites; + + TimestreamSettings({ + required this.databaseName, + required this.magneticDuration, + required this.memoryDuration, + this.cdcInsertsAndUpdates, + this.enableMagneticStoreWrites, + }); + + factory TimestreamSettings.fromJson(Map json) { + return TimestreamSettings( + databaseName: json['DatabaseName'] as String, + magneticDuration: json['MagneticDuration'] as int, + memoryDuration: json['MemoryDuration'] as int, + cdcInsertsAndUpdates: json['CdcInsertsAndUpdates'] as bool?, + enableMagneticStoreWrites: json['EnableMagneticStoreWrites'] as bool?, + ); + } + + Map toJson() { + final databaseName = this.databaseName; + final magneticDuration = this.magneticDuration; + final memoryDuration = this.memoryDuration; + final cdcInsertsAndUpdates = this.cdcInsertsAndUpdates; + final enableMagneticStoreWrites = this.enableMagneticStoreWrites; + return { + 'DatabaseName': databaseName, + 'MagneticDuration': magneticDuration, + 'MemoryDuration': memoryDuration, + if (cdcInsertsAndUpdates != null) + 'CdcInsertsAndUpdates': cdcInsertsAndUpdates, + if (enableMagneticStoreWrites != null) + 'EnableMagneticStoreWrites': enableMagneticStoreWrites, + }; + } +} + enum TlogAccessMode { backupOnly, preferBackup, diff --git a/aws_client/lib/src/generated/deadline/v2023_10_12.dart b/aws_client/lib/src/generated/deadline/v2023_10_12.dart new file mode 100644 index 000000000..bcd46a465 --- /dev/null +++ b/aws_client/lib/src/generated/deadline/v2023_10_12.dart @@ -0,0 +1,16009 @@ +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name + +import 'dart:convert'; +import 'dart:typed_data'; + +import '../../shared/shared.dart' as _s; +import '../../shared/shared.dart' + show + rfc822ToJson, + iso8601ToJson, + unixTimestampToJson, + nonNullableTimeStampFromJson, + timeStampFromJson; + +export '../../shared/shared.dart' show AwsClientCredentials; + +/// The Amazon Web Services Deadline Cloud API provides infrastructure and +/// centralized management for your projects. Use the Deadline Cloud API to +/// onboard users, assign projects, and attach permissions specific to their job +/// function. +/// +/// With Deadline Cloud, content production teams can deploy resources for their +/// workforce securely in the cloud, reducing the costs of added physical +/// infrastructure. Keep your content production operations secure, while +/// allowing your contributors to access the tools they need, such as scalable +/// high-speed storage, licenses, and cost management services. +class DeadlineCloud { + final _s.RestJsonProtocol _protocol; + DeadlineCloud({ + required String region, + _s.AwsClientCredentials? credentials, + _s.AwsClientCredentialsProvider? credentialsProvider, + _s.Client? client, + String? endpointUrl, + }) : _protocol = _s.RestJsonProtocol( + client: client, + service: _s.ServiceMetadata( + endpointPrefix: 'deadline', + signingName: 'deadline', + ), + region: region, + credentials: credentials, + credentialsProvider: credentialsProvider, + endpointUrl: endpointUrl, + ); + + /// Closes the internal HTTP client if none was provided at creation. + /// If a client was passed as a constructor argument, this becomes a noop. + /// + /// It's important to close all clients when it's done being used; failing to + /// do so can cause the Dart process to hang. + void close() { + _protocol.close(); + } + + /// Assigns a farm membership level to a member. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The ID of the farm to associate with the member. + /// + /// Parameter [identityStoreId] : + /// The identity store ID of the member to associate with the farm. + /// + /// Parameter [membershipLevel] : + /// The principal's membership level for the associated farm. + /// + /// Parameter [principalId] : + /// The member's principal ID to associate with the farm. + /// + /// Parameter [principalType] : + /// The principal type of the member to associate with the farm. + Future associateMemberToFarm({ + required String farmId, + required String identityStoreId, + required MembershipLevel membershipLevel, + required String principalId, + required PrincipalType principalType, + }) async { + final $payload = { + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalType': principalType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Assigns a fleet membership level to a member. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID of the fleet to associate with the member. + /// + /// Parameter [fleetId] : + /// The ID of the fleet to associate with a member. + /// + /// Parameter [identityStoreId] : + /// The member's identity store ID to associate with the fleet. + /// + /// Parameter [membershipLevel] : + /// The principal's membership level for the associated fleet. + /// + /// Parameter [principalId] : + /// The member's principal ID to associate with a fleet. + /// + /// Parameter [principalType] : + /// The member's principal type to associate with the fleet. + Future associateMemberToFleet({ + required String farmId, + required String fleetId, + required String identityStoreId, + required MembershipLevel membershipLevel, + required String principalId, + required PrincipalType principalType, + }) async { + final $payload = { + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalType': principalType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Assigns a job membership level to a member + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID of the job to associate with the member. + /// + /// Parameter [identityStoreId] : + /// The member's identity store ID to associate with the job. + /// + /// Parameter [jobId] : + /// The job ID to associate with the member. + /// + /// Parameter [membershipLevel] : + /// The principal's membership level for the associated job. + /// + /// Parameter [principalId] : + /// The member's principal ID to associate with the job. + /// + /// Parameter [principalType] : + /// The member's principal type to associate with the job. + /// + /// Parameter [queueId] : + /// The queue ID to associate to the member. + Future associateMemberToJob({ + required String farmId, + required String identityStoreId, + required String jobId, + required MembershipLevel membershipLevel, + required String principalId, + required PrincipalType principalType, + required String queueId, + }) async { + final $payload = { + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalType': principalType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Assigns a queue membership level to a member + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID of the queue to associate with the member. + /// + /// Parameter [identityStoreId] : + /// The member's identity store ID to associate with the queue. + /// + /// Parameter [membershipLevel] : + /// The principal's membership level for the associated queue. + /// + /// Parameter [principalId] : + /// The member's principal ID to associate with the queue. + /// + /// Parameter [principalType] : + /// The member's principal type to associate with the queue. + /// + /// Parameter [queueId] : + /// The ID of the queue to associate to the member. + Future associateMemberToQueue({ + required String farmId, + required String identityStoreId, + required MembershipLevel membershipLevel, + required String principalId, + required PrincipalType principalType, + required String queueId, + }) async { + final $payload = { + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalType': principalType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Get Amazon Web Services credentials from the fleet role. The IAM + /// permissions of the credentials are scoped down to have read-only access. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the fleet's farm. + /// + /// Parameter [fleetId] : + /// The fleet ID. + Future assumeFleetRoleForRead({ + required String farmId, + required String fleetId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/read-roles', + exceptionFnMap: _exceptionFns, + ); + return AssumeFleetRoleForReadResponse.fromJson(response); + } + + /// Get credentials from the fleet role for a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the fleet's farm. + /// + /// Parameter [fleetId] : + /// The fleet ID that contains the worker. + /// + /// Parameter [workerId] : + /// The ID of the worker assuming the fleet role. + Future assumeFleetRoleForWorker({ + required String farmId, + required String fleetId, + required String workerId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}/fleet-roles', + exceptionFnMap: _exceptionFns, + ); + return AssumeFleetRoleForWorkerResponse.fromJson(response); + } + + /// Gets Amazon Web Services credentials from the queue role. The IAM + /// permissions of the credentials are scoped down to have read-only access. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm containing the queue. + /// + /// Parameter [queueId] : + /// The queue ID. + Future assumeQueueRoleForRead({ + required String farmId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/read-roles', + exceptionFnMap: _exceptionFns, + ); + return AssumeQueueRoleForReadResponse.fromJson(response); + } + + /// Allows a user to assume a role for a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the queue that the user assumes the role for. + /// + /// Parameter [queueId] : + /// The queue ID of the queue that the user assumes the role for. + Future assumeQueueRoleForUser({ + required String farmId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/user-roles', + exceptionFnMap: _exceptionFns, + ); + return AssumeQueueRoleForUserResponse.fromJson(response); + } + + /// Allows a worker to assume a queue role. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the worker assuming the queue role. + /// + /// Parameter [fleetId] : + /// The fleet ID of the worker assuming the queue role. + /// + /// Parameter [queueId] : + /// The queue ID of the worker assuming the queue role. + /// + /// Parameter [workerId] : + /// The worker ID of the worker assuming the queue role. + Future assumeQueueRoleForWorker({ + required String farmId, + required String fleetId, + required String queueId, + required String workerId, + }) async { + final $query = >{ + 'queueId': [queueId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}/queue-roles', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return AssumeQueueRoleForWorkerResponse.fromJson(response); + } + + /// Get batched job details for a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the worker that's fetching job details. The worker must + /// have an assignment on a job to fetch job details. + /// + /// Parameter [fleetId] : + /// The fleet ID of the worker that's fetching job details. The worker must + /// have an assignment on a job to fetch job details. + /// + /// Parameter [identifiers] : + /// The job identifiers to include within the job entity batch details. + /// + /// Parameter [workerId] : + /// The worker ID of the worker containing the job details to get. + Future batchGetJobEntity({ + required String farmId, + required String fleetId, + required List identifiers, + required String workerId, + }) async { + final $payload = { + 'identifiers': identifiers, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}/batchGetJobEntity', + exceptionFnMap: _exceptionFns, + ); + return BatchGetJobEntityResponse.fromJson(response); + } + + /// Copies a job template to an Amazon S3 bucket. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to copy. + /// + /// Parameter [jobId] : + /// The job ID to copy. + /// + /// Parameter [queueId] : + /// The queue ID to copy. + /// + /// Parameter [targetS3Location] : + /// The Amazon S3 bucket name and key where you would like to add a copy of + /// the job template. + Future copyJobTemplate({ + required String farmId, + required String jobId, + required String queueId, + required S3Location targetS3Location, + }) async { + final $payload = { + 'targetS3Location': targetS3Location, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/template', + exceptionFnMap: _exceptionFns, + ); + return CopyJobTemplateResponse.fromJson(response); + } + + /// Creates a budget to set spending thresholds for your rendering activity. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [actions] : + /// The budget actions to specify what happens when the budget runs out. + /// + /// Parameter [approximateDollarLimit] : + /// The dollar limit based on consumed usage. + /// + /// Parameter [displayName] : + /// The display name of the budget. + /// + /// Parameter [farmId] : + /// The farm ID to include in this budget. + /// + /// Parameter [schedule] : + /// The schedule to associate with this budget. + /// + /// Parameter [usageTrackingResource] : + /// The queue ID provided to this budget to track usage. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [description] : + /// The description of the budget. + Future createBudget({ + required List actions, + required double approximateDollarLimit, + required String displayName, + required String farmId, + required BudgetSchedule schedule, + required UsageTrackingResource usageTrackingResource, + String? clientToken, + String? description, + }) async { + _s.validateNumRange( + 'approximateDollarLimit', + approximateDollarLimit, + 0.01, + 1152921504606846976, + isRequired: true, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'actions': actions, + 'approximateDollarLimit': approximateDollarLimit, + 'displayName': displayName, + 'schedule': schedule, + 'usageTrackingResource': usageTrackingResource, + if (description != null) 'description': description, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/budgets', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateBudgetResponse.fromJson(response); + } + + /// Creates a farm to allow space for queues and fleets. Farms are the space + /// where the components of your renders gather and are pieced together in the + /// cloud. Farms contain budgets and allow you to enforce permissions. + /// Deadline Cloud farms are a useful container for large projects. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [displayName] : + /// The display name of the farm. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [description] : + /// The description of the farm. + /// + /// Parameter [kmsKeyArn] : + /// The ARN of the KMS key to use on the farm. + /// + /// Parameter [tags] : + /// The tags to add to your farm. Each tag consists of a tag key and a tag + /// value. Tag keys and values are both required, but tag values can be empty + /// strings. + Future createFarm({ + required String displayName, + String? clientToken, + String? description, + String? kmsKeyArn, + Map? tags, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'displayName': displayName, + if (description != null) 'description': description, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/farms', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateFarmResponse.fromJson(response); + } + + /// Creates a fleet. Fleets gather information relating to compute, or + /// capacity, for renders within your farms. You can choose to manage your own + /// capacity or opt to have fleets fully managed by Deadline Cloud. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [configuration] : + /// The configuration settings for the fleet. Customer managed fleets are + /// self-managed. Service managed Amazon EC2 fleets are managed by Deadline + /// Cloud. + /// + /// Parameter [displayName] : + /// The display name of the fleet. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the fleet. + /// + /// Parameter [maxWorkerCount] : + /// The maximum number of workers for the fleet. + /// + /// Parameter [roleArn] : + /// The IAM role ARN for the role that the fleet's workers will use. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [description] : + /// The description of the fleet. + /// + /// Parameter [minWorkerCount] : + /// The minimum number of workers for the fleet. + /// + /// Parameter [tags] : + /// Each tag consists of a tag key and a tag value. Tag keys and values are + /// both required, but tag values can be empty strings. + Future createFleet({ + required FleetConfiguration configuration, + required String displayName, + required String farmId, + required int maxWorkerCount, + required String roleArn, + String? clientToken, + String? description, + int? minWorkerCount, + Map? tags, + }) async { + _s.validateNumRange( + 'maxWorkerCount', + maxWorkerCount, + 0, + 2147483647, + isRequired: true, + ); + _s.validateNumRange( + 'minWorkerCount', + minWorkerCount, + 0, + 2147483647, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'configuration': configuration, + 'displayName': displayName, + 'maxWorkerCount': maxWorkerCount, + 'roleArn': roleArn, + if (description != null) 'description': description, + if (minWorkerCount != null) 'minWorkerCount': minWorkerCount, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateFleetResponse.fromJson(response); + } + + /// Creates a job. A job is a render submission submitted by a user. It + /// contains specific job properties outlined as steps and tasks. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the job. + /// + /// Parameter [priority] : + /// The priority of the job on a scale of 1 to 100. The highest priority is 1. + /// + /// Parameter [queueId] : + /// The ID of the queue that the job is submitted to. + /// + /// Parameter [template] : + /// The job template to use for this job. + /// + /// Parameter [templateType] : + /// The file type for the job template. + /// + /// Parameter [attachments] : + /// The attachments for the job. Attach files required for the job to run to a + /// render job. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [maxFailedTasksCount] : + /// The number of task failures before the job stops running and is marked as + /// FAILED. + /// + /// Parameter [maxRetriesPerTask] : + /// The maximum number of retries for a job. + /// + /// Parameter [parameters] : + /// The parameters for the job. + /// + /// Parameter [storageProfileId] : + /// The storage profile ID for the storage profile to connect to the job. + /// + /// Parameter [targetTaskRunStatus] : + /// The initial status of the job's tasks when they are created. Tasks that + /// are created with a SUSPENDED status will not run until you + /// update their status. + Future createJob({ + required String farmId, + required int priority, + required String queueId, + required String template, + required JobTemplateType templateType, + Attachments? attachments, + String? clientToken, + int? maxFailedTasksCount, + int? maxRetriesPerTask, + Map? parameters, + String? storageProfileId, + CreateJobTargetTaskRunStatus? targetTaskRunStatus, + }) async { + _s.validateNumRange( + 'priority', + priority, + 0, + 100, + isRequired: true, + ); + _s.validateNumRange( + 'maxFailedTasksCount', + maxFailedTasksCount, + 0, + 2147483647, + ); + _s.validateNumRange( + 'maxRetriesPerTask', + maxRetriesPerTask, + 0, + 2147483647, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'priority': priority, + 'template': template, + 'templateType': templateType.toValue(), + if (attachments != null) 'attachments': attachments, + if (maxFailedTasksCount != null) + 'maxFailedTasksCount': maxFailedTasksCount, + if (maxRetriesPerTask != null) 'maxRetriesPerTask': maxRetriesPerTask, + if (parameters != null) 'parameters': parameters, + if (storageProfileId != null) 'storageProfileId': storageProfileId, + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateJobResponse.fromJson(response); + } + + /// Creates a license endpoint to integrate your various licensed software + /// used for rendering on Deadline Cloud. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [securityGroupIds] : + /// The security group IDs. + /// + /// Parameter [subnetIds] : + /// The subnet IDs. + /// + /// Parameter [vpcId] : + /// The VPC (virtual private cloud) ID to use with the license endpoint. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [tags] : + /// Each tag consists of a tag key and a tag value. Tag keys and values are + /// both required, but tag values can be empty strings. + Future createLicenseEndpoint({ + required List securityGroupIds, + required List subnetIds, + required String vpcId, + String? clientToken, + Map? tags, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'securityGroupIds': securityGroupIds, + 'subnetIds': subnetIds, + 'vpcId': vpcId, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/license-endpoints', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateLicenseEndpointResponse.fromJson(response); + } + + /// Creates an Amazon Web Services Deadline Cloud monitor that you can use to + /// view your farms, queues, and fleets. After you submit a job, you can track + /// the progress of the tasks and steps that make up the job, and then + /// download the job's results. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [displayName] : + /// The name that you give the monitor that is displayed in the Deadline Cloud + /// console. + /// + /// Parameter [identityCenterInstanceArn] : + /// The Amazon Resource Name (ARN) of the IAM Identity Center instance that + /// authenticates monitor users. + /// + /// Parameter [roleArn] : + /// The Amazon Resource Name (ARN) of the IAM role that the monitor uses to + /// connect to Deadline Cloud. Every user that signs in to the monitor using + /// IAM Identity Center uses this role to access Deadline Cloud resources. + /// + /// Parameter [subdomain] : + /// The subdomain to use when creating the monitor URL. The full URL of the + /// monitor is subdomain.Region.deadlinecloud.amazonaws.com. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future createMonitor({ + required String displayName, + required String identityCenterInstanceArn, + required String roleArn, + required String subdomain, + String? clientToken, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'displayName': displayName, + 'identityCenterInstanceArn': identityCenterInstanceArn, + 'roleArn': roleArn, + 'subdomain': subdomain, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/monitors', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateMonitorResponse.fromJson(response); + } + + /// Creates a queue to coordinate the order in which jobs run on a farm. A + /// queue can also specify where to pull resources and indicate where to + /// output completed jobs. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [displayName] : + /// The display name of the queue. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the queue. + /// + /// Parameter [allowedStorageProfileIds] : + /// The storage profile IDs to include in the queue. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [defaultBudgetAction] : + /// The default action to take on a queue if a budget isn't configured. + /// + /// Parameter [description] : + /// The description of the queue. + /// + /// Parameter [jobAttachmentSettings] : + /// The job attachment settings for the queue. These are the Amazon S3 bucket + /// name and the Amazon S3 prefix. + /// + /// Parameter [jobRunAsUser] : + /// The jobs in the queue run as the specified POSIX user. + /// + /// Parameter [requiredFileSystemLocationNames] : + /// The file system location name to include in the queue. + /// + /// Parameter [roleArn] : + /// The IAM role ARN that workers will use while running jobs for this queue. + /// + /// Parameter [tags] : + /// Each tag consists of a tag key and a tag value. Tag keys and values are + /// both required, but tag values can be empty strings. + Future createQueue({ + required String displayName, + required String farmId, + List? allowedStorageProfileIds, + String? clientToken, + DefaultQueueBudgetAction? defaultBudgetAction, + String? description, + JobAttachmentSettings? jobAttachmentSettings, + JobRunAsUser? jobRunAsUser, + List? requiredFileSystemLocationNames, + String? roleArn, + Map? tags, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'displayName': displayName, + if (allowedStorageProfileIds != null) + 'allowedStorageProfileIds': allowedStorageProfileIds, + if (defaultBudgetAction != null) + 'defaultBudgetAction': defaultBudgetAction.toValue(), + if (description != null) 'description': description, + if (jobAttachmentSettings != null) + 'jobAttachmentSettings': jobAttachmentSettings, + if (jobRunAsUser != null) 'jobRunAsUser': jobRunAsUser, + if (requiredFileSystemLocationNames != null) + 'requiredFileSystemLocationNames': requiredFileSystemLocationNames, + if (roleArn != null) 'roleArn': roleArn, + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateQueueResponse.fromJson(response); + } + + /// Creates an environment for a queue that defines how jobs in the queue run. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the environment. + /// + /// Parameter [priority] : + /// Sets the priority of the environments in the queue from 0 to 10,000, where + /// 0 is the highest priority. If two environments share the same priority + /// value, the environment created first takes higher priority. + /// + /// Parameter [queueId] : + /// The queue ID to connect the queue and environment. + /// + /// Parameter [template] : + /// The environment template to use in the queue. + /// + /// Parameter [templateType] : + /// The template's file type, JSON or YAML. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future createQueueEnvironment({ + required String farmId, + required int priority, + required String queueId, + required String template, + required EnvironmentTemplateType templateType, + String? clientToken, + }) async { + _s.validateNumRange( + 'priority', + priority, + 0, + 10000, + isRequired: true, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'priority': priority, + 'template': template, + 'templateType': templateType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/environments', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateQueueEnvironmentResponse.fromJson(response); + } + + /// Creates an association between a queue and a fleet. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The ID of the farm that the queue and fleet belong to. + /// + /// Parameter [fleetId] : + /// The fleet ID. + /// + /// Parameter [queueId] : + /// The queue ID. + Future createQueueFleetAssociation({ + required String farmId, + required String fleetId, + required String queueId, + }) async { + final $payload = { + 'fleetId': fleetId, + 'queueId': queueId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PUT', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queue-fleet-associations', + exceptionFnMap: _exceptionFns, + ); + } + + /// Creates a storage profile that specifies the operating system, file type, + /// and file location of resources used on a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [displayName] : + /// The display name of the storage profile. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the storage profile. + /// + /// Parameter [osFamily] : + /// The type of operating system (OS) for the storage profile. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [fileSystemLocations] : + /// File system paths to include in the storage profile. + Future createStorageProfile({ + required String displayName, + required String farmId, + required StorageProfileOperatingSystemFamily osFamily, + String? clientToken, + List? fileSystemLocations, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'displayName': displayName, + 'osFamily': osFamily.toValue(), + if (fileSystemLocations != null) + 'fileSystemLocations': fileSystemLocations, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/storage-profiles', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateStorageProfileResponse.fromJson(response); + } + + /// Creates a worker. A worker tells your instance how much processing power + /// (vCPU), and memory (GiB) you’ll need to assemble the digital assets held + /// within a particular instance. You can specify certain instance types to + /// use, or let the worker know which instances types to exclude. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to connect to the worker. + /// + /// Parameter [fleetId] : + /// The fleet ID to connect to the worker. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [hostProperties] : + /// The IP address and host name of the worker. + Future createWorker({ + required String farmId, + required String fleetId, + String? clientToken, + HostPropertiesRequest? hostProperties, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (hostProperties != null) 'hostProperties': hostProperties, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + return CreateWorkerResponse.fromJson(response); + } + + /// Deletes a budget. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [budgetId] : + /// The budget ID of the budget to delete. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to remove from the budget. + Future deleteBudget({ + required String budgetId, + required String farmId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/budgets/${Uri.encodeComponent(budgetId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to delete. + Future deleteFarm({ + required String farmId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a fleet. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to remove from the fleet. + /// + /// Parameter [fleetId] : + /// The fleet ID of the fleet to delete. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future deleteFleet({ + required String farmId, + required String fleetId, + String? clientToken, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a license endpoint. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [licenseEndpointId] : + /// The license endpoint ID of the license endpoint to delete. + Future deleteLicenseEndpoint({ + required String licenseEndpointId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/license-endpoints/${Uri.encodeComponent(licenseEndpointId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a metered product. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [licenseEndpointId] : + /// The ID of the license endpoint from which to remove the metered product. + /// + /// Parameter [productId] : + /// The product ID to remove from the license endpoint. + Future deleteMeteredProduct({ + required String licenseEndpointId, + required String productId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/license-endpoints/${Uri.encodeComponent(licenseEndpointId)}/metered-products/${Uri.encodeComponent(productId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes a Deadline Cloud monitor. After you delete a monitor, you can + /// create a new one and attach farms to the monitor. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [monitorId] : + /// The unique identifier of the monitor to delete. This ID is returned by the + /// CreateMonitor operation, and is included in the response to + /// the GetMonitor operation. + Future deleteMonitor({ + required String monitorId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/2023-10-12/monitors/${Uri.encodeComponent(monitorId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The ID of the farm from which to remove the queue. + /// + /// Parameter [queueId] : + /// The queue ID of the queue to delete. + Future deleteQueue({ + required String farmId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a queue environment. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm from which to remove the queue environment. + /// + /// Parameter [queueEnvironmentId] : + /// The queue environment ID of the queue environment to delete. + /// + /// Parameter [queueId] : + /// The queue ID of the queue environment to delete. + Future deleteQueueEnvironment({ + required String farmId, + required String queueEnvironmentId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/environments/${Uri.encodeComponent(queueEnvironmentId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a queue-fleet association. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm that holds the queue-fleet association. + /// + /// Parameter [fleetId] : + /// The fleet ID of the queue-fleet association. + /// + /// Parameter [queueId] : + /// The queue ID of the queue-fleet association. + Future deleteQueueFleetAssociation({ + required String farmId, + required String fleetId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queue-fleet-associations/${Uri.encodeComponent(queueId)}/${Uri.encodeComponent(fleetId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a storage profile. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm from which to remove the storage profile. + /// + /// Parameter [storageProfileId] : + /// The storage profile ID of the storage profile to delete. + Future deleteStorageProfile({ + required String farmId, + required String storageProfileId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/storage-profiles/${Uri.encodeComponent(storageProfileId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Deletes a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the worker to delete. + /// + /// Parameter [fleetId] : + /// The fleet ID of the worker to delete. + /// + /// Parameter [workerId] : + /// The worker ID of the worker to delete. + Future deleteWorker({ + required String farmId, + required String fleetId, + required String workerId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Disassociates a member from a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm to disassociate from the member. + /// + /// Parameter [principalId] : + /// A member's principal ID to disassociate from a farm. + Future disassociateMemberFromFarm({ + required String farmId, + required String principalId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Disassociates a member from a fleet. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the fleet to disassociate a member from. + /// + /// Parameter [fleetId] : + /// The fleet ID of the fleet to from which to disassociate a member. + /// + /// Parameter [principalId] : + /// A member's principal ID to disassociate from a fleet. + Future disassociateMemberFromFleet({ + required String farmId, + required String fleetId, + required String principalId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Disassociates a member from a job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the job to disassociate from the member. + /// + /// Parameter [jobId] : + /// The job ID to disassociate from a member in a job. + /// + /// Parameter [principalId] : + /// A member's principal ID to disassociate from a job. + /// + /// Parameter [queueId] : + /// The queue ID connected to a job for which you're disassociating a member. + Future disassociateMemberFromJob({ + required String farmId, + required String jobId, + required String principalId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Disassociates a member from a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue to disassociate from a member. + /// + /// Parameter [principalId] : + /// A member's principal ID to disassociate from a queue. + /// + /// Parameter [queueId] : + /// The queue ID of the queue in which you're disassociating from a member. + Future disassociateMemberFromQueue({ + required String farmId, + required String principalId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/members/${Uri.encodeComponent(principalId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Get a budget. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [budgetId] : + /// The budget ID. + /// + /// Parameter [farmId] : + /// The farm ID of the farm connected to the budget. + Future getBudget({ + required String budgetId, + required String farmId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/budgets/${Uri.encodeComponent(budgetId)}', + exceptionFnMap: _exceptionFns, + ); + return GetBudgetResponse.fromJson(response); + } + + /// Get a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm. + Future getFarm({ + required String farmId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}', + exceptionFnMap: _exceptionFns, + ); + return GetFarmResponse.fromJson(response); + } + + /// Get a fleet. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm in the fleet. + /// + /// Parameter [fleetId] : + /// The fleet ID of the fleet to get. + Future getFleet({ + required String farmId, + required String fleetId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}', + exceptionFnMap: _exceptionFns, + ); + return GetFleetResponse.fromJson(response); + } + + /// Gets a Deadline Cloud job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm in the job. + /// + /// Parameter [jobId] : + /// The job ID. + /// + /// Parameter [queueId] : + /// The queue ID associated with the job. + Future getJob({ + required String farmId, + required String jobId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}', + exceptionFnMap: _exceptionFns, + ); + return GetJobResponse.fromJson(response); + } + + /// Gets a licence endpoint. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [licenseEndpointId] : + /// The license endpoint ID. + Future getLicenseEndpoint({ + required String licenseEndpointId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/license-endpoints/${Uri.encodeComponent(licenseEndpointId)}', + exceptionFnMap: _exceptionFns, + ); + return GetLicenseEndpointResponse.fromJson(response); + } + + /// Gets information about the specified monitor. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [monitorId] : + /// The unique identifier for the monitor. This ID is returned by the + /// CreateMonitor operation. + Future getMonitor({ + required String monitorId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/monitors/${Uri.encodeComponent(monitorId)}', + exceptionFnMap: _exceptionFns, + ); + return GetMonitorResponse.fromJson(response); + } + + /// Gets a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm in the queue. + /// + /// Parameter [queueId] : + /// The queue ID for the queue to retrieve. + Future getQueue({ + required String farmId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}', + exceptionFnMap: _exceptionFns, + ); + return GetQueueResponse.fromJson(response); + } + + /// Gets a queue environment. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue environment. + /// + /// Parameter [queueEnvironmentId] : + /// The queue environment ID. + /// + /// Parameter [queueId] : + /// The queue ID for the queue environment. + Future getQueueEnvironment({ + required String farmId, + required String queueEnvironmentId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/environments/${Uri.encodeComponent(queueEnvironmentId)}', + exceptionFnMap: _exceptionFns, + ); + return GetQueueEnvironmentResponse.fromJson(response); + } + + /// Gets a queue-fleet association. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm that contains the queue-fleet association. + /// + /// Parameter [fleetId] : + /// The fleet ID for the queue-fleet association. + /// + /// Parameter [queueId] : + /// The queue ID for the queue-fleet association. + Future getQueueFleetAssociation({ + required String farmId, + required String fleetId, + required String queueId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queue-fleet-associations/${Uri.encodeComponent(queueId)}/${Uri.encodeComponent(fleetId)}', + exceptionFnMap: _exceptionFns, + ); + return GetQueueFleetAssociationResponse.fromJson(response); + } + + /// Gets a session. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the session. + /// + /// Parameter [jobId] : + /// The job ID for the session. + /// + /// Parameter [queueId] : + /// The queue ID for the session. + /// + /// Parameter [sessionId] : + /// The session ID. + Future getSession({ + required String farmId, + required String jobId, + required String queueId, + required String sessionId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/sessions/${Uri.encodeComponent(sessionId)}', + exceptionFnMap: _exceptionFns, + ); + return GetSessionResponse.fromJson(response); + } + + /// Gets a session action for the job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the session action. + /// + /// Parameter [jobId] : + /// The job ID for the session. + /// + /// Parameter [queueId] : + /// The queue ID for the session action. + /// + /// Parameter [sessionActionId] : + /// The session action ID for the session. + Future getSessionAction({ + required String farmId, + required String jobId, + required String queueId, + required String sessionActionId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/session-actions/${Uri.encodeComponent(sessionActionId)}', + exceptionFnMap: _exceptionFns, + ); + return GetSessionActionResponse.fromJson(response); + } + + /// Gets a set of statistics for queues or farms. Before you can call the + /// GetSessionStatisticsAggregation operation, you must first + /// call the StartSessionsStatisticsAggregation operation. + /// Statistics are available for 1 hour after you call the + /// StartSessionsStatisticsAggregation operation. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [aggregationId] : + /// The identifier returned by the + /// StartSessionsStatisticsAggregation operation that identifies + /// the aggregated statistics. + /// + /// Parameter [farmId] : + /// The identifier of the farm to include in the statistics. This should be + /// the same as the farm ID used in the call to the + /// StartSessionsStatisticsAggregation operation. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future + getSessionsStatisticsAggregation({ + required String aggregationId, + required String farmId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + 'aggregationId': [aggregationId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/sessions-statistics-aggregation', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return GetSessionsStatisticsAggregationResponse.fromJson(response); + } + + /// Gets a step. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the step. + /// + /// Parameter [jobId] : + /// The job ID for the step. + /// + /// Parameter [queueId] : + /// The queue ID for the step. + /// + /// Parameter [stepId] : + /// The step ID. + Future getStep({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}', + exceptionFnMap: _exceptionFns, + ); + return GetStepResponse.fromJson(response); + } + + /// Gets a storage profile. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the storage profile. + /// + /// Parameter [storageProfileId] : + /// The storage profile ID. + Future getStorageProfile({ + required String farmId, + required String storageProfileId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/storage-profiles/${Uri.encodeComponent(storageProfileId)}', + exceptionFnMap: _exceptionFns, + ); + return GetStorageProfileResponse.fromJson(response); + } + + /// Gets a storage profile for a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue in storage profile. + /// + /// Parameter [queueId] : + /// The queue ID the queue in the storage profile. + /// + /// Parameter [storageProfileId] : + /// The storage profile ID for the storage profile in the queue. + Future getStorageProfileForQueue({ + required String farmId, + required String queueId, + required String storageProfileId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/storage-profiles/${Uri.encodeComponent(storageProfileId)}', + exceptionFnMap: _exceptionFns, + ); + return GetStorageProfileForQueueResponse.fromJson(response); + } + + /// Gets a task. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the farm connected to the task. + /// + /// Parameter [jobId] : + /// The job ID of the job connected to the task. + /// + /// Parameter [queueId] : + /// The queue ID for the queue connected to the task. + /// + /// Parameter [stepId] : + /// The step ID for the step connected to the task. + /// + /// Parameter [taskId] : + /// The task ID. + Future getTask({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + required String taskId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}/tasks/${Uri.encodeComponent(taskId)}', + exceptionFnMap: _exceptionFns, + ); + return GetTaskResponse.fromJson(response); + } + + /// Gets a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the worker. + /// + /// Parameter [fleetId] : + /// The fleet ID of the worker. + /// + /// Parameter [workerId] : + /// The worker ID. + Future getWorker({ + required String farmId, + required String fleetId, + required String workerId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}', + exceptionFnMap: _exceptionFns, + ); + return GetWorkerResponse.fromJson(response); + } + + /// A list of the available metered products. + /// + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listAvailableMeteredProducts({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/metered-products', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListAvailableMeteredProductsResponse.fromJson(response); + } + + /// A list of budgets in a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID associated with the budgets. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [status] : + /// The status to list for the budgets. + Future listBudgets({ + required String farmId, + int? maxResults, + String? nextToken, + BudgetStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/budgets', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListBudgetsResponse.fromJson(response); + } + + /// Lists the members of a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listFarmMembers({ + required String farmId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/members', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFarmMembersResponse.fromJson(response); + } + + /// Lists farms. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [principalId] : + /// The principal ID of the member to list on the farm. + Future listFarms({ + int? maxResults, + String? nextToken, + String? principalId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (principalId != null) 'principalId': [principalId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFarmsResponse.fromJson(response); + } + + /// Lists fleet members. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the fleet. + /// + /// Parameter [fleetId] : + /// The fleet ID to include on the list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listFleetMembers({ + required String farmId, + required String fleetId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/members', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFleetMembersResponse.fromJson(response); + } + + /// Lists fleets. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the fleets. + /// + /// Parameter [displayName] : + /// The display names of a list of fleets. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [principalId] : + /// The principal ID of the members to include in the fleet. + /// + /// Parameter [status] : + /// The status of the fleet. + Future listFleets({ + required String farmId, + String? displayName, + int? maxResults, + String? nextToken, + String? principalId, + FleetStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (displayName != null) 'displayName': [displayName], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (principalId != null) 'principalId': [principalId], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListFleetsResponse.fromJson(response); + } + + /// Lists members on a job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the job to list. + /// + /// Parameter [jobId] : + /// The job ID to include on the list. + /// + /// Parameter [queueId] : + /// The queue ID to include on the list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listJobMembers({ + required String farmId, + required String jobId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/members', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListJobMembersResponse.fromJson(response); + } + + /// Lists jobs. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the jobs. + /// + /// Parameter [queueId] : + /// The queue ID for the job. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [principalId] : + /// The principal ID of the members on the jobs. + Future listJobs({ + required String farmId, + required String queueId, + int? maxResults, + String? nextToken, + String? principalId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (principalId != null) 'principalId': [principalId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListJobsResponse.fromJson(response); + } + + /// Lists license endpoints. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listLicenseEndpoints({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/license-endpoints', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListLicenseEndpointsResponse.fromJson(response); + } + + /// Lists metered products. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [licenseEndpointId] : + /// The license endpoint ID to include on the list of metered products. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listMeteredProducts({ + required String licenseEndpointId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/license-endpoints/${Uri.encodeComponent(licenseEndpointId)}/metered-products', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListMeteredProductsResponse.fromJson(response); + } + + /// Gets a list of your monitors in Deadline Cloud. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listMonitors({ + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/monitors', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListMonitorsResponse.fromJson(response); + } + + /// Lists queue environments. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue environment list. + /// + /// Parameter [queueId] : + /// The queue ID for the queue environment list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listQueueEnvironments({ + required String farmId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/environments', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListQueueEnvironmentsResponse.fromJson(response); + } + + /// Lists queue-fleet associations. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue-fleet association list. + /// + /// Parameter [fleetId] : + /// The fleet ID for the queue-fleet association list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [queueId] : + /// The queue ID for the queue-fleet association list. + Future listQueueFleetAssociations({ + required String farmId, + String? fleetId, + int? maxResults, + String? nextToken, + String? queueId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (fleetId != null) 'fleetId': [fleetId], + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (queueId != null) 'queueId': [queueId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queue-fleet-associations', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListQueueFleetAssociationsResponse.fromJson(response); + } + + /// Lists the members in a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the queue. + /// + /// Parameter [queueId] : + /// The queue ID to include on the list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listQueueMembers({ + required String farmId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/members', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListQueueMembersResponse.fromJson(response); + } + + /// Lists queues. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the queue. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [principalId] : + /// The principal ID. This filter is only valid when using Nimble Studio + /// credentials and should match the user ID in the credentials of the caller. + /// + /// Parameter [status] : + /// The status of the queues listed. + /// + ///

        + ///
      • + /// ACTIVE–The queues are active. + ///
      • + ///
      • + /// SCHEDULING–The queues are scheduling. + ///
      • + ///
      • + /// SCHEDULING_BLOCKED–The queue scheduling is blocked for these + /// queues. + ///
      • + ///
      + Future listQueues({ + required String farmId, + int? maxResults, + String? nextToken, + String? principalId, + QueueStatus? status, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (principalId != null) 'principalId': [principalId], + if (status != null) 'status': [status.toValue()], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListQueuesResponse.fromJson(response); + } + + /// Lists session actions. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the session actions list. + /// + /// Parameter [jobId] : + /// The job ID for the session actions list. + /// + /// Parameter [queueId] : + /// The queue ID for the session actions list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + /// + /// Parameter [sessionId] : + /// The session ID to include on the sessions action list. + /// + /// Parameter [taskId] : + /// The task ID for the session actions list. + Future listSessionActions({ + required String farmId, + required String jobId, + required String queueId, + int? maxResults, + String? nextToken, + String? sessionId, + String? taskId, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + if (sessionId != null) 'sessionId': [sessionId], + if (taskId != null) 'taskId': [taskId], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/session-actions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSessionActionsResponse.fromJson(response); + } + + /// Lists sessions. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the list of sessions. + /// + /// Parameter [jobId] : + /// The job ID for the list of sessions. + /// + /// Parameter [queueId] : + /// The queue ID for the list of sessions + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listSessions({ + required String farmId, + required String jobId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/sessions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSessionsResponse.fromJson(response); + } + + /// Lists sessions for a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the session. + /// + /// Parameter [fleetId] : + /// The fleet ID for the session. + /// + /// Parameter [workerId] : + /// The worker ID for the session. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listSessionsForWorker({ + required String farmId, + required String fleetId, + required String workerId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}/sessions', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListSessionsForWorkerResponse.fromJson(response); + } + + /// Lists step consumers. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the list of step consumers. + /// + /// Parameter [jobId] : + /// The job ID for the step consumer. + /// + /// Parameter [queueId] : + /// The queue ID for the step consumer. + /// + /// Parameter [stepId] : + /// The step ID to include on the list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listStepConsumers({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}/consumers', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListStepConsumersResponse.fromJson(response); + } + + /// Lists the dependencies for a step. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID for the step dependencies list. + /// + /// Parameter [jobId] : + /// The job ID for the step dependencies list. + /// + /// Parameter [queueId] : + /// The queue ID for the step dependencies list. + /// + /// Parameter [stepId] : + /// The step ID to include on the list. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listStepDependencies({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 1000, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}/dependencies', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListStepDependenciesResponse.fromJson(response); + } + + /// Lists steps for a job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to include on the list of steps. + /// + /// Parameter [jobId] : + /// The job ID to include on the list of steps. + /// + /// Parameter [queueId] : + /// The queue ID to include on the list of steps. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listSteps({ + required String farmId, + required String jobId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListStepsResponse.fromJson(response); + } + + /// Lists storage profiles. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the storage profile. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listStorageProfiles({ + required String farmId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/storage-profiles', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListStorageProfilesResponse.fromJson(response); + } + + /// Lists storage profiles for a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the queue's storage profile. + /// + /// Parameter [queueId] : + /// The queue ID for the storage profile. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listStorageProfilesForQueue({ + required String farmId, + required String queueId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/storage-profiles', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListStorageProfilesForQueueResponse.fromJson(response); + } + + /// Lists tags for a resource. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The resource ARN to list tags for. + Future listTagsForResource({ + required String resourceArn, + }) async { + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: '/2023-10-12/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + return ListTagsForResourceResponse.fromJson(response); + } + + /// Lists tasks for a job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID connected to the tasks. + /// + /// Parameter [jobId] : + /// The job ID for the tasks. + /// + /// Parameter [queueId] : + /// The queue ID connected to the tasks. + /// + /// Parameter [stepId] : + /// The step ID for the tasks. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listTasks({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}/tasks', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListTasksResponse.fromJson(response); + } + + /// Lists workers. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID connected to the workers. + /// + /// Parameter [fleetId] : + /// The fleet ID of the workers. + /// + /// Parameter [maxResults] : + /// The maximum number of results to return. Use this parameter with + /// NextToken to get results as a set of sequential pages. + /// + /// Parameter [nextToken] : + /// The token for the next set of results, or null to start from + /// the beginning. + Future listWorkers({ + required String farmId, + required String fleetId, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $query = >{ + if (maxResults != null) 'maxResults': [maxResults.toString()], + if (nextToken != null) 'nextToken': [nextToken], + }; + final response = await _protocol.send( + payload: null, + method: 'GET', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + return ListWorkersResponse.fromJson(response); + } + + /// Adds a metered product. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [licenseEndpointId] : + /// The license endpoint ID to add to the metered product. + /// + /// Parameter [productId] : + /// The product ID to add to the metered product. + Future putMeteredProduct({ + required String licenseEndpointId, + required String productId, + }) async { + final response = await _protocol.send( + payload: null, + method: 'PUT', + requestUri: + '/2023-10-12/license-endpoints/${Uri.encodeComponent(licenseEndpointId)}/metered-products/${Uri.encodeComponent(productId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Searches for jobs. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the job. + /// + /// Parameter [itemOffset] : + /// Defines how far into the scrollable list to start the return of results. + /// + /// Parameter [queueIds] : + /// The queue ID to use in the job search. + /// + /// Parameter [filterExpressions] : + /// The filter expression, AND or OR, to use when + /// searching among a group of search strings in a resource. + /// You can use two groupings per search each within parenthesis + /// (). + /// + /// + /// Parameter [pageSize] : + /// Specifies the number of items per page for the resource. + /// + /// Parameter [sortExpressions] : + /// The search terms for a resource. + Future searchJobs({ + required String farmId, + required int itemOffset, + required List queueIds, + SearchGroupedFilterExpressions? filterExpressions, + int? pageSize, + List? sortExpressions, + }) async { + _s.validateNumRange( + 'itemOffset', + itemOffset, + 0, + 10000, + isRequired: true, + ); + _s.validateNumRange( + 'pageSize', + pageSize, + 1, + 100, + ); + final $payload = { + 'itemOffset': itemOffset, + 'queueIds': queueIds, + if (filterExpressions != null) 'filterExpressions': filterExpressions, + if (pageSize != null) 'pageSize': pageSize, + if (sortExpressions != null) 'sortExpressions': sortExpressions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/search/jobs', + exceptionFnMap: _exceptionFns, + ); + return SearchJobsResponse.fromJson(response); + } + + /// Searches for steps. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to use for the step search. + /// + /// Parameter [itemOffset] : + /// Defines how far into the scrollable list to start the return of results. + /// + /// Parameter [queueIds] : + /// The queue IDs in the step search. + /// + /// Parameter [filterExpressions] : + /// The filter expression, AND or OR, to use when + /// searching among a group of search strings in a resource. + /// You can use two groupings per search each within parenthesis + /// (). + /// + /// + /// Parameter [jobId] : + /// The job ID to use in the step search. + /// + /// Parameter [pageSize] : + /// Specifies the number of items per page for the resource. + /// + /// Parameter [sortExpressions] : + /// The search terms for a resource. + Future searchSteps({ + required String farmId, + required int itemOffset, + required List queueIds, + SearchGroupedFilterExpressions? filterExpressions, + String? jobId, + int? pageSize, + List? sortExpressions, + }) async { + _s.validateNumRange( + 'itemOffset', + itemOffset, + 0, + 10000, + isRequired: true, + ); + _s.validateNumRange( + 'pageSize', + pageSize, + 1, + 100, + ); + final $payload = { + 'itemOffset': itemOffset, + 'queueIds': queueIds, + if (filterExpressions != null) 'filterExpressions': filterExpressions, + if (jobId != null) 'jobId': jobId, + if (pageSize != null) 'pageSize': pageSize, + if (sortExpressions != null) 'sortExpressions': sortExpressions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/search/steps', + exceptionFnMap: _exceptionFns, + ); + return SearchStepsResponse.fromJson(response); + } + + /// Searches for tasks. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the task. + /// + /// Parameter [itemOffset] : + /// Defines how far into the scrollable list to start the return of results. + /// + /// Parameter [queueIds] : + /// The queue IDs to include in the search. + /// + /// Parameter [filterExpressions] : + /// The filter expression, AND or OR, to use when + /// searching among a group of search strings in a resource. + /// You can use two groupings per search each within parenthesis + /// (). + /// + /// + /// Parameter [jobId] : + /// The job ID for the task search. + /// + /// Parameter [pageSize] : + /// Specifies the number of items per page for the resource. + /// + /// Parameter [sortExpressions] : + /// The search terms for a resource. + Future searchTasks({ + required String farmId, + required int itemOffset, + required List queueIds, + SearchGroupedFilterExpressions? filterExpressions, + String? jobId, + int? pageSize, + List? sortExpressions, + }) async { + _s.validateNumRange( + 'itemOffset', + itemOffset, + 0, + 10000, + isRequired: true, + ); + _s.validateNumRange( + 'pageSize', + pageSize, + 1, + 100, + ); + final $payload = { + 'itemOffset': itemOffset, + 'queueIds': queueIds, + if (filterExpressions != null) 'filterExpressions': filterExpressions, + if (jobId != null) 'jobId': jobId, + if (pageSize != null) 'pageSize': pageSize, + if (sortExpressions != null) 'sortExpressions': sortExpressions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/search/tasks', + exceptionFnMap: _exceptionFns, + ); + return SearchTasksResponse.fromJson(response); + } + + /// Searches for workers. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID in the workers search. + /// + /// Parameter [fleetIds] : + /// The fleet ID of the workers to search for. + /// + /// Parameter [itemOffset] : + /// Defines how far into the scrollable list to start the return of results. + /// + /// Parameter [filterExpressions] : + /// The filter expression, AND or OR, to use when + /// searching among a group of search strings in a resource. + /// You can use two groupings per search each within parenthesis + /// (). + /// + /// + /// Parameter [pageSize] : + /// Specifies the number of items per page for the resource. + /// + /// Parameter [sortExpressions] : + /// The search terms for a resource. + Future searchWorkers({ + required String farmId, + required List fleetIds, + required int itemOffset, + SearchGroupedFilterExpressions? filterExpressions, + int? pageSize, + List? sortExpressions, + }) async { + _s.validateNumRange( + 'itemOffset', + itemOffset, + 0, + 10000, + isRequired: true, + ); + _s.validateNumRange( + 'pageSize', + pageSize, + 1, + 100, + ); + final $payload = { + 'fleetIds': fleetIds, + 'itemOffset': itemOffset, + if (filterExpressions != null) 'filterExpressions': filterExpressions, + if (pageSize != null) 'pageSize': pageSize, + if (sortExpressions != null) 'sortExpressions': sortExpressions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/search/workers', + exceptionFnMap: _exceptionFns, + ); + return SearchWorkersResponse.fromJson(response); + } + + /// Starts an asynchronous request for getting aggregated statistics about + /// queues and farms. Get the statistics using the + /// GetSessionsStatisticsAggregation operation. Statistics are + /// available for 1 hour after you call the + /// StartSessionsStatisticsAggregation operation. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [endTime] : + /// The Linux timestamp of the date and time that the statistics end. + /// + /// Parameter [farmId] : + /// The identifier of the farm that contains queues or fleets to return + /// statistics for. + /// + /// Parameter [groupBy] : + /// The field to use to group the statistics. + /// + /// Parameter [resourceIds] : + /// A list of fleet IDs or queue IDs to gather statistics for. + /// + /// Parameter [startTime] : + /// The Linux timestamp of the date and time that the statistics start. + /// + /// Parameter [statistics] : + /// One to four statistics to return. + /// + /// Parameter [period] : + /// The period to aggregate the statistics. + /// + /// Parameter [timezone] : + /// The timezone to use for the statistics. Use UTC notation such as "UTC+8." + Future + startSessionsStatisticsAggregation({ + required DateTime endTime, + required String farmId, + required List groupBy, + required SessionsStatisticsResources resourceIds, + required DateTime startTime, + required List statistics, + Period? period, + String? timezone, + }) async { + final $payload = { + 'endTime': iso8601ToJson(endTime), + 'groupBy': groupBy.map((e) => e.toValue()).toList(), + 'resourceIds': resourceIds, + 'startTime': iso8601ToJson(startTime), + 'statistics': statistics.map((e) => e.toValue()).toList(), + if (period != null) 'period': period.toValue(), + if (timezone != null) 'timezone': timezone, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/sessions-statistics-aggregation', + exceptionFnMap: _exceptionFns, + ); + return StartSessionsStatisticsAggregationResponse.fromJson(response); + } + + /// Tags a resource using the resource's ARN and desired tags. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource to apply tags to. + /// + /// Parameter [tags] : + /// Each tag consists of a tag key and a tag value. Tag keys and values are + /// both required, but tag values can be empty strings. + Future tagResource({ + required String resourceArn, + Map? tags, + }) async { + final $payload = { + if (tags != null) 'tags': tags, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/2023-10-12/tags/${Uri.encodeComponent(resourceArn)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Removes a tag from a resource using the resource's ARN and tag to remove. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [resourceArn] : + /// The ARN of the resource to remove the tag from. + /// + /// Parameter [tagKeys] : + /// They keys of the tag. + Future untagResource({ + required String resourceArn, + required List tagKeys, + }) async { + final $query = >{ + 'tagKeys': tagKeys, + }; + final response = await _protocol.send( + payload: null, + method: 'DELETE', + requestUri: '/2023-10-12/tags/${Uri.encodeComponent(resourceArn)}', + queryParams: $query, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a budget that sets spending thresholds for rendering activity. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [budgetId] : + /// The budget ID to update. + /// + /// Parameter [farmId] : + /// The farm ID of the budget to update. + /// + /// Parameter [actionsToAdd] : + /// The budget actions to add. Budget actions specify what happens when the + /// budget runs out. + /// + /// Parameter [actionsToRemove] : + /// The budget actions to remove from the budget. + /// + /// Parameter [approximateDollarLimit] : + /// The dollar limit to update on the budget. Based on consumed usage. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [description] : + /// The description of the budget to update. + /// + /// Parameter [displayName] : + /// The display name of the budget to update. + /// + /// Parameter [schedule] : + /// The schedule to update. + /// + /// Parameter [status] : + /// Updates the status of the budget. + /// + ///
        + ///
      • + /// ACTIVE–The budget is being evaluated. + ///
      • + ///
      • + /// INACTIVE–The budget is inactive. This can include Expired, + /// Canceled, or deleted Deleted statuses. + ///
      • + ///
      + Future updateBudget({ + required String budgetId, + required String farmId, + List? actionsToAdd, + List? actionsToRemove, + double? approximateDollarLimit, + String? clientToken, + String? description, + String? displayName, + BudgetSchedule? schedule, + BudgetStatus? status, + }) async { + _s.validateNumRange( + 'approximateDollarLimit', + approximateDollarLimit, + 0.01, + 1152921504606846976, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (actionsToAdd != null) 'actionsToAdd': actionsToAdd, + if (actionsToRemove != null) 'actionsToRemove': actionsToRemove, + if (approximateDollarLimit != null) + 'approximateDollarLimit': approximateDollarLimit, + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + if (schedule != null) 'schedule': schedule, + if (status != null) 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/budgets/${Uri.encodeComponent(budgetId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a farm. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [description] : + /// The description of the farm to update. + /// + /// Parameter [displayName] : + /// The display name of the farm to update. + Future updateFarm({ + required String farmId, + String? description, + String? displayName, + }) async { + final $payload = { + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a fleet. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// May throw [ServiceQuotaExceededException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [fleetId] : + /// The fleet ID to update. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [configuration] : + /// The fleet configuration to update. + /// + /// Parameter [description] : + /// The description of the fleet to update. + /// + /// Parameter [displayName] : + /// The display name of the fleet to update. + /// + /// Parameter [maxWorkerCount] : + /// The maximum number of workers in the fleet. + /// + /// Parameter [minWorkerCount] : + /// The minimum number of workers in the fleet. + /// + /// Parameter [roleArn] : + /// The IAM role ARN that the fleet's workers assume while running jobs. + Future updateFleet({ + required String farmId, + required String fleetId, + String? clientToken, + FleetConfiguration? configuration, + String? description, + String? displayName, + int? maxWorkerCount, + int? minWorkerCount, + String? roleArn, + }) async { + _s.validateNumRange( + 'maxWorkerCount', + maxWorkerCount, + 0, + 2147483647, + ); + _s.validateNumRange( + 'minWorkerCount', + minWorkerCount, + 0, + 2147483647, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (configuration != null) 'configuration': configuration, + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + if (maxWorkerCount != null) 'maxWorkerCount': maxWorkerCount, + if (minWorkerCount != null) 'minWorkerCount': minWorkerCount, + if (roleArn != null) 'roleArn': roleArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a job. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the job to update. + /// + /// Parameter [jobId] : + /// The job ID to update. + /// + /// Parameter [queueId] : + /// The queue ID of the job to update. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [lifecycleStatus] : + /// The status of a job in its lifecycle. + /// + /// Parameter [maxFailedTasksCount] : + /// The number of task failures before the job stops running and is marked as + /// FAILED. + /// + /// Parameter [maxRetriesPerTask] : + /// The maximum number of retries for a job. + /// + /// Parameter [priority] : + /// The job priority to update. + /// + /// Parameter [targetTaskRunStatus] : + /// The task status to update the job's tasks to. + Future updateJob({ + required String farmId, + required String jobId, + required String queueId, + String? clientToken, + UpdateJobLifecycleStatus? lifecycleStatus, + int? maxFailedTasksCount, + int? maxRetriesPerTask, + int? priority, + JobTargetTaskRunStatus? targetTaskRunStatus, + }) async { + _s.validateNumRange( + 'maxFailedTasksCount', + maxFailedTasksCount, + 0, + 2147483647, + ); + _s.validateNumRange( + 'maxRetriesPerTask', + maxRetriesPerTask, + 0, + 2147483647, + ); + _s.validateNumRange( + 'priority', + priority, + 0, + 100, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (lifecycleStatus != null) 'lifecycleStatus': lifecycleStatus.toValue(), + if (maxFailedTasksCount != null) + 'maxFailedTasksCount': maxFailedTasksCount, + if (maxRetriesPerTask != null) 'maxRetriesPerTask': maxRetriesPerTask, + if (priority != null) 'priority': priority, + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Modifies the settings for a Deadline Cloud monitor. You can modify one or + /// all of the settings when you call UpdateMonitor. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [monitorId] : + /// The unique identifier of the monitor to update. + /// + /// Parameter [displayName] : + /// The new value to use for the monitor's display name. + /// + /// Parameter [roleArn] : + /// The Amazon Resource Name (ARN) of the new IAM role to use with the + /// monitor. + /// + /// Parameter [subdomain] : + /// The new value of the subdomain to use when forming the monitor URL. + Future updateMonitor({ + required String monitorId, + String? displayName, + String? roleArn, + String? subdomain, + }) async { + final $payload = { + if (displayName != null) 'displayName': displayName, + if (roleArn != null) 'roleArn': roleArn, + if (subdomain != null) 'subdomain': subdomain, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: '/2023-10-12/monitors/${Uri.encodeComponent(monitorId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a queue. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update in the queue. + /// + /// Parameter [queueId] : + /// The queue ID to update. + /// + /// Parameter [allowedStorageProfileIdsToAdd] : + /// The storage profile IDs to add. + /// + /// Parameter [allowedStorageProfileIdsToRemove] : + /// The storage profile ID to remove. + /// + /// Parameter [clientToken] : + /// The idempotency token to update in the queue. + /// + /// Parameter [defaultBudgetAction] : + /// The default action to take for a queue update if a budget isn't + /// configured. + /// + /// Parameter [description] : + /// The description of the queue to update. + /// + /// Parameter [displayName] : + /// The display name of the queue to update. + /// + /// Parameter [jobAttachmentSettings] : + /// The job attachment settings to update for the queue. + /// + /// Parameter [jobRunAsUser] : + /// Update the jobs in the queue to run as a specified POSIX user. + /// + /// Parameter [requiredFileSystemLocationNamesToAdd] : + /// The required file system location names to add to the queue. + /// + /// Parameter [requiredFileSystemLocationNamesToRemove] : + /// The required file system location names to remove from the queue. + /// + /// Parameter [roleArn] : + /// The IAM role ARN that's used to run jobs from this queue. + Future updateQueue({ + required String farmId, + required String queueId, + List? allowedStorageProfileIdsToAdd, + List? allowedStorageProfileIdsToRemove, + String? clientToken, + DefaultQueueBudgetAction? defaultBudgetAction, + String? description, + String? displayName, + JobAttachmentSettings? jobAttachmentSettings, + JobRunAsUser? jobRunAsUser, + List? requiredFileSystemLocationNamesToAdd, + List? requiredFileSystemLocationNamesToRemove, + String? roleArn, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (allowedStorageProfileIdsToAdd != null) + 'allowedStorageProfileIdsToAdd': allowedStorageProfileIdsToAdd, + if (allowedStorageProfileIdsToRemove != null) + 'allowedStorageProfileIdsToRemove': allowedStorageProfileIdsToRemove, + if (defaultBudgetAction != null) + 'defaultBudgetAction': defaultBudgetAction.toValue(), + if (description != null) 'description': description, + if (displayName != null) 'displayName': displayName, + if (jobAttachmentSettings != null) + 'jobAttachmentSettings': jobAttachmentSettings, + if (jobRunAsUser != null) 'jobRunAsUser': jobRunAsUser, + if (requiredFileSystemLocationNamesToAdd != null) + 'requiredFileSystemLocationNamesToAdd': + requiredFileSystemLocationNamesToAdd, + if (requiredFileSystemLocationNamesToRemove != null) + 'requiredFileSystemLocationNamesToRemove': + requiredFileSystemLocationNamesToRemove, + if (roleArn != null) 'roleArn': roleArn, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates the queue environment. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID of the queue environment to update. + /// + /// Parameter [queueEnvironmentId] : + /// The queue environment ID to update. + /// + /// Parameter [queueId] : + /// The queue ID of the queue environment to update. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [priority] : + /// The priority to update. + /// + /// Parameter [template] : + /// The template to update. + /// + /// Parameter [templateType] : + /// The template type to update. + Future updateQueueEnvironment({ + required String farmId, + required String queueEnvironmentId, + required String queueId, + String? clientToken, + int? priority, + String? template, + EnvironmentTemplateType? templateType, + }) async { + _s.validateNumRange( + 'priority', + priority, + 0, + 10000, + ); + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (priority != null) 'priority': priority, + if (template != null) 'template': template, + if (templateType != null) 'templateType': templateType.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/environments/${Uri.encodeComponent(queueEnvironmentId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a queue-fleet association. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [fleetId] : + /// The fleet ID to update. + /// + /// Parameter [queueId] : + /// The queue ID to update. + /// + /// Parameter [status] : + /// The status to update. + Future updateQueueFleetAssociation({ + required String farmId, + required String fleetId, + required String queueId, + required UpdateQueueFleetAssociationStatus status, + }) async { + final $payload = { + 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queue-fleet-associations/${Uri.encodeComponent(queueId)}/${Uri.encodeComponent(fleetId)}', + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a session. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update in the session. + /// + /// Parameter [jobId] : + /// The job ID to update in the session. + /// + /// Parameter [queueId] : + /// The queue ID to update in the session. + /// + /// Parameter [sessionId] : + /// The session ID to update. + /// + /// Parameter [targetLifecycleStatus] : + /// The life cycle status to update in the session. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future updateSession({ + required String farmId, + required String jobId, + required String queueId, + required String sessionId, + required SessionLifecycleTargetStatus targetLifecycleStatus, + String? clientToken, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'targetLifecycleStatus': targetLifecycleStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/sessions/${Uri.encodeComponent(sessionId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a step. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [jobId] : + /// The job ID to update. + /// + /// Parameter [queueId] : + /// The queue ID to update. + /// + /// Parameter [stepId] : + /// The step ID to update. + /// + /// Parameter [targetTaskRunStatus] : + /// The task status to update the step's tasks to. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future updateStep({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + required StepTargetTaskRunStatus targetTaskRunStatus, + String? clientToken, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a storage profile. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [storageProfileId] : + /// The storage profile ID to update. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + /// + /// Parameter [displayName] : + /// The display name of the storage profile to update. + /// + /// Parameter [fileSystemLocationsToAdd] : + /// The file system location names to add. + /// + /// Parameter [fileSystemLocationsToRemove] : + /// The file system location names to remove. + /// + /// Parameter [osFamily] : + /// The OS system to update. + Future updateStorageProfile({ + required String farmId, + required String storageProfileId, + String? clientToken, + String? displayName, + List? fileSystemLocationsToAdd, + List? fileSystemLocationsToRemove, + StorageProfileOperatingSystemFamily? osFamily, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + if (displayName != null) 'displayName': displayName, + if (fileSystemLocationsToAdd != null) + 'fileSystemLocationsToAdd': fileSystemLocationsToAdd, + if (fileSystemLocationsToRemove != null) + 'fileSystemLocationsToRemove': fileSystemLocationsToRemove, + if (osFamily != null) 'osFamily': osFamily.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/storage-profiles/${Uri.encodeComponent(storageProfileId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a task. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [jobId] : + /// The job ID to update. + /// + /// Parameter [queueId] : + /// The queue ID to update. + /// + /// Parameter [stepId] : + /// The step ID to update. + /// + /// Parameter [targetRunStatus] : + /// The run status with which to start the task. + /// + /// Parameter [taskId] : + /// The task ID to update. + /// + /// Parameter [clientToken] : + /// The unique token which the server uses to recognize retries of the same + /// request. + Future updateTask({ + required String farmId, + required String jobId, + required String queueId, + required String stepId, + required TaskTargetRunStatus targetRunStatus, + required String taskId, + String? clientToken, + }) async { + final headers = { + if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(), + }; + final $payload = { + 'targetRunStatus': targetRunStatus.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues/${Uri.encodeComponent(queueId)}/jobs/${Uri.encodeComponent(jobId)}/steps/${Uri.encodeComponent(stepId)}/tasks/${Uri.encodeComponent(taskId)}', + headers: headers, + exceptionFnMap: _exceptionFns, + ); + } + + /// Updates a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [fleetId] : + /// The fleet ID to update. + /// + /// Parameter [workerId] : + /// The worker ID to update. + /// + /// Parameter [capabilities] : + /// The worker capabilities to update. + /// + /// Parameter [hostProperties] : + /// The host properties to update. + /// + /// Parameter [status] : + /// The worker status to update. + Future updateWorker({ + required String farmId, + required String fleetId, + required String workerId, + WorkerCapabilities? capabilities, + HostPropertiesRequest? hostProperties, + UpdatedWorkerStatus? status, + }) async { + final $payload = { + if (capabilities != null) 'capabilities': capabilities, + if (hostProperties != null) 'hostProperties': hostProperties, + if (status != null) 'status': status.toValue(), + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}', + exceptionFnMap: _exceptionFns, + ); + return UpdateWorkerResponse.fromJson(response); + } + + /// Updates the schedule for a worker. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerErrorException]. + /// May throw [ResourceNotFoundException]. + /// May throw [ThrottlingException]. + /// May throw [ConflictException]. + /// May throw [ValidationException]. + /// + /// Parameter [farmId] : + /// The farm ID to update. + /// + /// Parameter [fleetId] : + /// The fleet ID to update. + /// + /// Parameter [workerId] : + /// The worker ID to update. + /// + /// Parameter [updatedSessionActions] : + /// The session actions associated with the worker schedule to update. + Future updateWorkerSchedule({ + required String farmId, + required String fleetId, + required String workerId, + Map? updatedSessionActions, + }) async { + final $payload = { + if (updatedSessionActions != null) + 'updatedSessionActions': updatedSessionActions, + }; + final response = await _protocol.send( + payload: $payload, + method: 'PATCH', + requestUri: + '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/fleets/${Uri.encodeComponent(fleetId)}/workers/${Uri.encodeComponent(workerId)}/schedule', + exceptionFnMap: _exceptionFns, + ); + return UpdateWorkerScheduleResponse.fromJson(response); + } +} + +/// The range for the GPU fleet acceleration. +class AcceleratorCountRange { + /// The minimum GPU for the accelerator. + final int min; + + /// The maximum GPU for the accelerator. + final int? max; + + AcceleratorCountRange({ + required this.min, + this.max, + }); + + factory AcceleratorCountRange.fromJson(Map json) { + return AcceleratorCountRange( + min: json['min'] as int, + max: json['max'] as int?, + ); + } + + Map toJson() { + final min = this.min; + final max = this.max; + return { + 'min': min, + if (max != null) 'max': max, + }; + } +} + +/// The range for memory, in MiB, to use for the accelerator. +class AcceleratorTotalMemoryMiBRange { + /// The minimum amount of memory to use for the accelerator, measured in MiB. + final int min; + + /// The maximum amount of memory to use for the accelerator, measured in MiB. + final int? max; + + AcceleratorTotalMemoryMiBRange({ + required this.min, + this.max, + }); + + factory AcceleratorTotalMemoryMiBRange.fromJson(Map json) { + return AcceleratorTotalMemoryMiBRange( + min: json['min'] as int, + max: json['max'] as int?, + ); + } + + Map toJson() { + final min = this.min; + final max = this.max; + return { + 'min': min, + if (max != null) 'max': max, + }; + } +} + +enum AcceleratorType { + gpu, +} + +extension AcceleratorTypeValueExtension on AcceleratorType { + String toValue() { + switch (this) { + case AcceleratorType.gpu: + return 'gpu'; + } + } +} + +extension AcceleratorTypeFromString on String { + AcceleratorType toAcceleratorType() { + switch (this) { + case 'gpu': + return AcceleratorType.gpu; + } + throw Exception('$this is not known in enum AcceleratorType'); + } +} + +/// The assigned starting environment for a worker during session. +class AssignedEnvironmentEnterSessionActionDefinition { + /// The environment ID of the assigned environment at the start of a session. + final String environmentId; + + AssignedEnvironmentEnterSessionActionDefinition({ + required this.environmentId, + }); + + factory AssignedEnvironmentEnterSessionActionDefinition.fromJson( + Map json) { + return AssignedEnvironmentEnterSessionActionDefinition( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +/// The assigned environment when a worker exits a session. +class AssignedEnvironmentExitSessionActionDefinition { + /// The environment ID of the assigned environment when exiting a session. + final String environmentId; + + AssignedEnvironmentExitSessionActionDefinition({ + required this.environmentId, + }); + + factory AssignedEnvironmentExitSessionActionDefinition.fromJson( + Map json) { + return AssignedEnvironmentExitSessionActionDefinition( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +/// The assigned session for the worker. +class AssignedSession { + /// The job ID for the assigned session. + final String jobId; + + /// The log configuration for the worker's assigned session. + final LogConfiguration logConfiguration; + + /// The queue ID of the assigned session. + final String queueId; + + /// The session actions to apply to the assigned session. + final List sessionActions; + + AssignedSession({ + required this.jobId, + required this.logConfiguration, + required this.queueId, + required this.sessionActions, + }); + + factory AssignedSession.fromJson(Map json) { + return AssignedSession( + jobId: json['jobId'] as String, + logConfiguration: LogConfiguration.fromJson( + json['logConfiguration'] as Map), + queueId: json['queueId'] as String, + sessionActions: (json['sessionActions'] as List) + .whereNotNull() + .map((e) => AssignedSessionAction.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final jobId = this.jobId; + final logConfiguration = this.logConfiguration; + final queueId = this.queueId; + final sessionActions = this.sessionActions; + return { + 'jobId': jobId, + 'logConfiguration': logConfiguration, + 'queueId': queueId, + 'sessionActions': sessionActions, + }; + } +} + +/// The action for a session defined by the session action ID. +class AssignedSessionAction { + /// The definition of the assigned session action. + final AssignedSessionActionDefinition definition; + + /// The session action ID for the assigned session. + final String sessionActionId; + + AssignedSessionAction({ + required this.definition, + required this.sessionActionId, + }); + + factory AssignedSessionAction.fromJson(Map json) { + return AssignedSessionAction( + definition: AssignedSessionActionDefinition.fromJson( + json['definition'] as Map), + sessionActionId: json['sessionActionId'] as String, + ); + } + + Map toJson() { + final definition = this.definition; + final sessionActionId = this.sessionActionId; + return { + 'definition': definition, + 'sessionActionId': sessionActionId, + }; + } +} + +/// The definition of the assigned session action. +class AssignedSessionActionDefinition { + /// The environment a session starts on. + final AssignedEnvironmentEnterSessionActionDefinition? envEnter; + + /// The environment a session exits from. + final AssignedEnvironmentExitSessionActionDefinition? envExit; + + /// The job attachment to sync with an assigned session action. + final AssignedSyncInputJobAttachmentsSessionActionDefinition? + syncInputJobAttachments; + + /// The task run. + final AssignedTaskRunSessionActionDefinition? taskRun; + + AssignedSessionActionDefinition({ + this.envEnter, + this.envExit, + this.syncInputJobAttachments, + this.taskRun, + }); + + factory AssignedSessionActionDefinition.fromJson(Map json) { + return AssignedSessionActionDefinition( + envEnter: json['envEnter'] != null + ? AssignedEnvironmentEnterSessionActionDefinition.fromJson( + json['envEnter'] as Map) + : null, + envExit: json['envExit'] != null + ? AssignedEnvironmentExitSessionActionDefinition.fromJson( + json['envExit'] as Map) + : null, + syncInputJobAttachments: json['syncInputJobAttachments'] != null + ? AssignedSyncInputJobAttachmentsSessionActionDefinition.fromJson( + json['syncInputJobAttachments'] as Map) + : null, + taskRun: json['taskRun'] != null + ? AssignedTaskRunSessionActionDefinition.fromJson( + json['taskRun'] as Map) + : null, + ); + } + + Map toJson() { + final envEnter = this.envEnter; + final envExit = this.envExit; + final syncInputJobAttachments = this.syncInputJobAttachments; + final taskRun = this.taskRun; + return { + if (envEnter != null) 'envEnter': envEnter, + if (envExit != null) 'envExit': envExit, + if (syncInputJobAttachments != null) + 'syncInputJobAttachments': syncInputJobAttachments, + if (taskRun != null) 'taskRun': taskRun, + }; + } +} + +/// The details for an assigned session action as it relates to a job +/// attachment. +class AssignedSyncInputJobAttachmentsSessionActionDefinition { + /// The step ID. + final String? stepId; + + AssignedSyncInputJobAttachmentsSessionActionDefinition({ + this.stepId, + }); + + factory AssignedSyncInputJobAttachmentsSessionActionDefinition.fromJson( + Map json) { + return AssignedSyncInputJobAttachmentsSessionActionDefinition( + stepId: json['stepId'] as String?, + ); + } + + Map toJson() { + final stepId = this.stepId; + return { + if (stepId != null) 'stepId': stepId, + }; + } +} + +/// The specific task, step, and parameters to include. +class AssignedTaskRunSessionActionDefinition { + /// The parameters to include. + final Map parameters; + + /// The step ID. + final String stepId; + + /// The task ID. + final String taskId; + + AssignedTaskRunSessionActionDefinition({ + required this.parameters, + required this.stepId, + required this.taskId, + }); + + factory AssignedTaskRunSessionActionDefinition.fromJson( + Map json) { + return AssignedTaskRunSessionActionDefinition( + parameters: (json['parameters'] as Map).map((k, e) => + MapEntry(k, TaskParameterValue.fromJson(e as Map))), + stepId: json['stepId'] as String, + taskId: json['taskId'] as String, + ); + } + + Map toJson() { + final parameters = this.parameters; + final stepId = this.stepId; + final taskId = this.taskId; + return { + 'parameters': parameters, + 'stepId': stepId, + 'taskId': taskId, + }; + } +} + +class AssociateMemberToFarmResponse { + AssociateMemberToFarmResponse(); + + factory AssociateMemberToFarmResponse.fromJson(Map _) { + return AssociateMemberToFarmResponse(); + } + + Map toJson() { + return {}; + } +} + +class AssociateMemberToFleetResponse { + AssociateMemberToFleetResponse(); + + factory AssociateMemberToFleetResponse.fromJson(Map _) { + return AssociateMemberToFleetResponse(); + } + + Map toJson() { + return {}; + } +} + +class AssociateMemberToJobResponse { + AssociateMemberToJobResponse(); + + factory AssociateMemberToJobResponse.fromJson(Map _) { + return AssociateMemberToJobResponse(); + } + + Map toJson() { + return {}; + } +} + +class AssociateMemberToQueueResponse { + AssociateMemberToQueueResponse(); + + factory AssociateMemberToQueueResponse.fromJson(Map _) { + return AssociateMemberToQueueResponse(); + } + + Map toJson() { + return {}; + } +} + +class AssumeFleetRoleForReadResponse { + /// The credentials for the fleet role. + final AwsCredentials credentials; + + AssumeFleetRoleForReadResponse({ + required this.credentials, + }); + + factory AssumeFleetRoleForReadResponse.fromJson(Map json) { + return AssumeFleetRoleForReadResponse( + credentials: + AwsCredentials.fromJson(json['credentials'] as Map), + ); + } + + Map toJson() { + final credentials = this.credentials; + return { + 'credentials': credentials, + }; + } +} + +class AssumeFleetRoleForWorkerResponse { + /// The credentials for the worker. + final AwsCredentials credentials; + + AssumeFleetRoleForWorkerResponse({ + required this.credentials, + }); + + factory AssumeFleetRoleForWorkerResponse.fromJson(Map json) { + return AssumeFleetRoleForWorkerResponse( + credentials: + AwsCredentials.fromJson(json['credentials'] as Map), + ); + } + + Map toJson() { + final credentials = this.credentials; + return { + 'credentials': credentials, + }; + } +} + +class AssumeQueueRoleForReadResponse { + /// The credentials for the queue role. + final AwsCredentials credentials; + + AssumeQueueRoleForReadResponse({ + required this.credentials, + }); + + factory AssumeQueueRoleForReadResponse.fromJson(Map json) { + return AssumeQueueRoleForReadResponse( + credentials: + AwsCredentials.fromJson(json['credentials'] as Map), + ); + } + + Map toJson() { + final credentials = this.credentials; + return { + 'credentials': credentials, + }; + } +} + +class AssumeQueueRoleForUserResponse { + /// The credentials for the queue role that a user has access to. + final AwsCredentials credentials; + + AssumeQueueRoleForUserResponse({ + required this.credentials, + }); + + factory AssumeQueueRoleForUserResponse.fromJson(Map json) { + return AssumeQueueRoleForUserResponse( + credentials: + AwsCredentials.fromJson(json['credentials'] as Map), + ); + } + + Map toJson() { + final credentials = this.credentials; + return { + 'credentials': credentials, + }; + } +} + +class AssumeQueueRoleForWorkerResponse { + /// The Amazon Web Services credentials for the role that the worker is + /// assuming. + final AwsCredentials? credentials; + + AssumeQueueRoleForWorkerResponse({ + this.credentials, + }); + + factory AssumeQueueRoleForWorkerResponse.fromJson(Map json) { + return AssumeQueueRoleForWorkerResponse( + credentials: json['credentials'] != null + ? AwsCredentials.fromJson(json['credentials'] as Map) + : null, + ); + } + + Map toJson() { + final credentials = this.credentials; + return { + if (credentials != null) 'credentials': credentials, + }; + } +} + +/// The attachments for jobs. +class Attachments { + /// A list of manifests which describe job attachment configurations. + final List manifests; + + /// The file system. + final JobAttachmentsFileSystem? fileSystem; + + Attachments({ + required this.manifests, + this.fileSystem, + }); + + factory Attachments.fromJson(Map json) { + return Attachments( + manifests: (json['manifests'] as List) + .whereNotNull() + .map((e) => ManifestProperties.fromJson(e as Map)) + .toList(), + fileSystem: (json['fileSystem'] as String?)?.toJobAttachmentsFileSystem(), + ); + } + + Map toJson() { + final manifests = this.manifests; + final fileSystem = this.fileSystem; + return { + 'manifests': manifests, + if (fileSystem != null) 'fileSystem': fileSystem.toValue(), + }; + } +} + +enum AutoScalingMode { + noScaling, + eventBasedAutoScaling, +} + +extension AutoScalingModeValueExtension on AutoScalingMode { + String toValue() { + switch (this) { + case AutoScalingMode.noScaling: + return 'NO_SCALING'; + case AutoScalingMode.eventBasedAutoScaling: + return 'EVENT_BASED_AUTO_SCALING'; + } + } +} + +extension AutoScalingModeFromString on String { + AutoScalingMode toAutoScalingMode() { + switch (this) { + case 'NO_SCALING': + return AutoScalingMode.noScaling; + case 'EVENT_BASED_AUTO_SCALING': + return AutoScalingMode.eventBasedAutoScaling; + } + throw Exception('$this is not known in enum AutoScalingMode'); + } +} + +enum AutoScalingStatus { + growing, + steady, + shrinking, +} + +extension AutoScalingStatusValueExtension on AutoScalingStatus { + String toValue() { + switch (this) { + case AutoScalingStatus.growing: + return 'GROWING'; + case AutoScalingStatus.steady: + return 'STEADY'; + case AutoScalingStatus.shrinking: + return 'SHRINKING'; + } + } +} + +extension AutoScalingStatusFromString on String { + AutoScalingStatus toAutoScalingStatus() { + switch (this) { + case 'GROWING': + return AutoScalingStatus.growing; + case 'STEADY': + return AutoScalingStatus.steady; + case 'SHRINKING': + return AutoScalingStatus.shrinking; + } + throw Exception('$this is not known in enum AutoScalingStatus'); + } +} + +/// The Identity and Access Management credentials. +class AwsCredentials { + /// The IAM access key ID. + final String accessKeyId; + + /// The expiration date and time of the IAM credentials. + final DateTime expiration; + + /// The IAM secret access key. + final String secretAccessKey; + + /// The IAM session token + final String sessionToken; + + AwsCredentials({ + required this.accessKeyId, + required this.expiration, + required this.secretAccessKey, + required this.sessionToken, + }); + + factory AwsCredentials.fromJson(Map json) { + return AwsCredentials( + accessKeyId: json['accessKeyId'] as String, + expiration: nonNullableTimeStampFromJson(json['expiration'] as Object), + secretAccessKey: json['secretAccessKey'] as String, + sessionToken: json['sessionToken'] as String, + ); + } + + Map toJson() { + final accessKeyId = this.accessKeyId; + final expiration = this.expiration; + final secretAccessKey = this.secretAccessKey; + final sessionToken = this.sessionToken; + return { + 'accessKeyId': accessKeyId, + 'expiration': iso8601ToJson(expiration), + 'secretAccessKey': secretAccessKey, + 'sessionToken': sessionToken, + }; + } +} + +class BatchGetJobEntityResponse { + /// A list of the job entities, or details, in the batch. + final List entities; + + /// A list of errors from the job error logs for the batch. + final List errors; + + BatchGetJobEntityResponse({ + required this.entities, + required this.errors, + }); + + factory BatchGetJobEntityResponse.fromJson(Map json) { + return BatchGetJobEntityResponse( + entities: (json['entities'] as List) + .whereNotNull() + .map((e) => JobEntity.fromJson(e as Map)) + .toList(), + errors: (json['errors'] as List) + .whereNotNull() + .map((e) => GetJobEntityError.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final entities = this.entities; + final errors = this.errors; + return { + 'entities': entities, + 'errors': errors, + }; + } +} + +/// The budget action to add. +class BudgetActionToAdd { + /// The percentage threshold for the budget action to add. + final double thresholdPercentage; + + /// The type of budget action to add. + final BudgetActionType type; + + /// A description for the budget action to add. + final String? description; + + BudgetActionToAdd({ + required this.thresholdPercentage, + required this.type, + this.description, + }); + + Map toJson() { + final thresholdPercentage = this.thresholdPercentage; + final type = this.type; + final description = this.description; + return { + 'thresholdPercentage': thresholdPercentage, + 'type': type.toValue(), + if (description != null) 'description': description, + }; + } +} + +/// The budget action to remove. +class BudgetActionToRemove { + /// The percentage threshold for the budget action to remove. + final double thresholdPercentage; + + /// The type of budget action to remove. + final BudgetActionType type; + + BudgetActionToRemove({ + required this.thresholdPercentage, + required this.type, + }); + + Map toJson() { + final thresholdPercentage = this.thresholdPercentage; + final type = this.type; + return { + 'thresholdPercentage': thresholdPercentage, + 'type': type.toValue(), + }; + } +} + +enum BudgetActionType { + stopSchedulingAndCompleteTasks, + stopSchedulingAndCancelTasks, +} + +extension BudgetActionTypeValueExtension on BudgetActionType { + String toValue() { + switch (this) { + case BudgetActionType.stopSchedulingAndCompleteTasks: + return 'STOP_SCHEDULING_AND_COMPLETE_TASKS'; + case BudgetActionType.stopSchedulingAndCancelTasks: + return 'STOP_SCHEDULING_AND_CANCEL_TASKS'; + } + } +} + +extension BudgetActionTypeFromString on String { + BudgetActionType toBudgetActionType() { + switch (this) { + case 'STOP_SCHEDULING_AND_COMPLETE_TASKS': + return BudgetActionType.stopSchedulingAndCompleteTasks; + case 'STOP_SCHEDULING_AND_CANCEL_TASKS': + return BudgetActionType.stopSchedulingAndCancelTasks; + } + throw Exception('$this is not known in enum BudgetActionType'); + } +} + +/// The start and end time of the budget. +class BudgetSchedule { + /// The fixed start and end time of the budget's schedule. + final FixedBudgetSchedule? fixed; + + BudgetSchedule({ + this.fixed, + }); + + factory BudgetSchedule.fromJson(Map json) { + return BudgetSchedule( + fixed: json['fixed'] != null + ? FixedBudgetSchedule.fromJson(json['fixed'] as Map) + : null, + ); + } + + Map toJson() { + final fixed = this.fixed; + return { + if (fixed != null) 'fixed': fixed, + }; + } +} + +enum BudgetStatus { + active, + inactive, +} + +extension BudgetStatusValueExtension on BudgetStatus { + String toValue() { + switch (this) { + case BudgetStatus.active: + return 'ACTIVE'; + case BudgetStatus.inactive: + return 'INACTIVE'; + } + } +} + +extension BudgetStatusFromString on String { + BudgetStatus toBudgetStatus() { + switch (this) { + case 'ACTIVE': + return BudgetStatus.active; + case 'INACTIVE': + return BudgetStatus.inactive; + } + throw Exception('$this is not known in enum BudgetStatus'); + } +} + +/// The budget summary. +class BudgetSummary { + /// The approximate dollar limit of the budget. + final double approximateDollarLimit; + + /// The budget ID. + final String budgetId; + + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the budget summary to update. + final String displayName; + + /// The status of the budget. + /// + ///
        + ///
      • + /// ACTIVE–The budget is being evaluated. + ///
      • + ///
      • + /// INACTIVE–The budget is inactive. This can include Expired, + /// Canceled, or deleted Deleted statuses. + ///
      • + ///
      + final BudgetStatus status; + + /// The resource used to track expenditure in the budget. + final UsageTrackingResource usageTrackingResource; + + /// The consumed usage for the budget. + final ConsumedUsages usages; + + /// The description of the budget summary. + final String? description; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + BudgetSummary({ + required this.approximateDollarLimit, + required this.budgetId, + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.status, + required this.usageTrackingResource, + required this.usages, + this.description, + this.updatedAt, + this.updatedBy, + }); + + factory BudgetSummary.fromJson(Map json) { + return BudgetSummary( + approximateDollarLimit: json['approximateDollarLimit'] as double, + budgetId: json['budgetId'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + status: (json['status'] as String).toBudgetStatus(), + usageTrackingResource: UsageTrackingResource.fromJson( + json['usageTrackingResource'] as Map), + usages: ConsumedUsages.fromJson(json['usages'] as Map), + description: json['description'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final approximateDollarLimit = this.approximateDollarLimit; + final budgetId = this.budgetId; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final status = this.status; + final usageTrackingResource = this.usageTrackingResource; + final usages = this.usages; + final description = this.description; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'approximateDollarLimit': approximateDollarLimit, + 'budgetId': budgetId, + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'status': status.toValue(), + 'usageTrackingResource': usageTrackingResource, + 'usages': usages, + if (description != null) 'description': description, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum ComparisonOperator { + equal, + notEqual, + greaterThanEqualTo, + greaterThan, + lessThanEqualTo, + lessThan, +} + +extension ComparisonOperatorValueExtension on ComparisonOperator { + String toValue() { + switch (this) { + case ComparisonOperator.equal: + return 'EQUAL'; + case ComparisonOperator.notEqual: + return 'NOT_EQUAL'; + case ComparisonOperator.greaterThanEqualTo: + return 'GREATER_THAN_EQUAL_TO'; + case ComparisonOperator.greaterThan: + return 'GREATER_THAN'; + case ComparisonOperator.lessThanEqualTo: + return 'LESS_THAN_EQUAL_TO'; + case ComparisonOperator.lessThan: + return 'LESS_THAN'; + } + } +} + +extension ComparisonOperatorFromString on String { + ComparisonOperator toComparisonOperator() { + switch (this) { + case 'EQUAL': + return ComparisonOperator.equal; + case 'NOT_EQUAL': + return ComparisonOperator.notEqual; + case 'GREATER_THAN_EQUAL_TO': + return ComparisonOperator.greaterThanEqualTo; + case 'GREATER_THAN': + return ComparisonOperator.greaterThan; + case 'LESS_THAN_EQUAL_TO': + return ComparisonOperator.lessThanEqualTo; + case 'LESS_THAN': + return ComparisonOperator.lessThan; + } + throw Exception('$this is not known in enum ComparisonOperator'); + } +} + +enum CompletedStatus { + succeeded, + failed, + interrupted, + canceled, + neverAttempted, +} + +extension CompletedStatusValueExtension on CompletedStatus { + String toValue() { + switch (this) { + case CompletedStatus.succeeded: + return 'SUCCEEDED'; + case CompletedStatus.failed: + return 'FAILED'; + case CompletedStatus.interrupted: + return 'INTERRUPTED'; + case CompletedStatus.canceled: + return 'CANCELED'; + case CompletedStatus.neverAttempted: + return 'NEVER_ATTEMPTED'; + } + } +} + +extension CompletedStatusFromString on String { + CompletedStatus toCompletedStatus() { + switch (this) { + case 'SUCCEEDED': + return CompletedStatus.succeeded; + case 'FAILED': + return CompletedStatus.failed; + case 'INTERRUPTED': + return CompletedStatus.interrupted; + case 'CANCELED': + return CompletedStatus.canceled; + case 'NEVER_ATTEMPTED': + return CompletedStatus.neverAttempted; + } + throw Exception('$this is not known in enum CompletedStatus'); + } +} + +/// The consumed usage for the resource. +class ConsumedUsages { + /// The amount of the budget consumed. + final double approximateDollarUsage; + + ConsumedUsages({ + required this.approximateDollarUsage, + }); + + factory ConsumedUsages.fromJson(Map json) { + return ConsumedUsages( + approximateDollarUsage: json['approximateDollarUsage'] as double, + ); + } + + Map toJson() { + final approximateDollarUsage = this.approximateDollarUsage; + return { + 'approximateDollarUsage': approximateDollarUsage, + }; + } +} + +class CopyJobTemplateResponse { + /// The format of the job template, either JSON or + /// YAML. + final JobTemplateType templateType; + + CopyJobTemplateResponse({ + required this.templateType, + }); + + factory CopyJobTemplateResponse.fromJson(Map json) { + return CopyJobTemplateResponse( + templateType: (json['templateType'] as String).toJobTemplateType(), + ); + } + + Map toJson() { + final templateType = this.templateType; + return { + 'templateType': templateType.toValue(), + }; + } +} + +enum CpuArchitectureType { + x86_64, + arm64, +} + +extension CpuArchitectureTypeValueExtension on CpuArchitectureType { + String toValue() { + switch (this) { + case CpuArchitectureType.x86_64: + return 'x86_64'; + case CpuArchitectureType.arm64: + return 'arm64'; + } + } +} + +extension CpuArchitectureTypeFromString on String { + CpuArchitectureType toCpuArchitectureType() { + switch (this) { + case 'x86_64': + return CpuArchitectureType.x86_64; + case 'arm64': + return CpuArchitectureType.arm64; + } + throw Exception('$this is not known in enum CpuArchitectureType'); + } +} + +class CreateBudgetResponse { + /// The budget ID. + final String budgetId; + + CreateBudgetResponse({ + required this.budgetId, + }); + + factory CreateBudgetResponse.fromJson(Map json) { + return CreateBudgetResponse( + budgetId: json['budgetId'] as String, + ); + } + + Map toJson() { + final budgetId = this.budgetId; + return { + 'budgetId': budgetId, + }; + } +} + +class CreateFarmResponse { + /// The farm ID. + final String farmId; + + CreateFarmResponse({ + required this.farmId, + }); + + factory CreateFarmResponse.fromJson(Map json) { + return CreateFarmResponse( + farmId: json['farmId'] as String, + ); + } + + Map toJson() { + final farmId = this.farmId; + return { + 'farmId': farmId, + }; + } +} + +class CreateFleetResponse { + /// The fleet ID. + final String fleetId; + + CreateFleetResponse({ + required this.fleetId, + }); + + factory CreateFleetResponse.fromJson(Map json) { + return CreateFleetResponse( + fleetId: json['fleetId'] as String, + ); + } + + Map toJson() { + final fleetId = this.fleetId; + return { + 'fleetId': fleetId, + }; + } +} + +class CreateJobResponse { + /// The job ID. + final String jobId; + + CreateJobResponse({ + required this.jobId, + }); + + factory CreateJobResponse.fromJson(Map json) { + return CreateJobResponse( + jobId: json['jobId'] as String, + ); + } + + Map toJson() { + final jobId = this.jobId; + return { + 'jobId': jobId, + }; + } +} + +enum CreateJobTargetTaskRunStatus { + ready, + suspended, +} + +extension CreateJobTargetTaskRunStatusValueExtension + on CreateJobTargetTaskRunStatus { + String toValue() { + switch (this) { + case CreateJobTargetTaskRunStatus.ready: + return 'READY'; + case CreateJobTargetTaskRunStatus.suspended: + return 'SUSPENDED'; + } + } +} + +extension CreateJobTargetTaskRunStatusFromString on String { + CreateJobTargetTaskRunStatus toCreateJobTargetTaskRunStatus() { + switch (this) { + case 'READY': + return CreateJobTargetTaskRunStatus.ready; + case 'SUSPENDED': + return CreateJobTargetTaskRunStatus.suspended; + } + throw Exception('$this is not known in enum CreateJobTargetTaskRunStatus'); + } +} + +class CreateLicenseEndpointResponse { + /// The license endpoint ID. + final String licenseEndpointId; + + CreateLicenseEndpointResponse({ + required this.licenseEndpointId, + }); + + factory CreateLicenseEndpointResponse.fromJson(Map json) { + return CreateLicenseEndpointResponse( + licenseEndpointId: json['licenseEndpointId'] as String, + ); + } + + Map toJson() { + final licenseEndpointId = this.licenseEndpointId; + return { + 'licenseEndpointId': licenseEndpointId, + }; + } +} + +class CreateMonitorResponse { + /// The Amazon Resource Name (ARN) that IAM Identity Center assigns to the + /// monitor. + final String identityCenterApplicationArn; + + /// The unique identifier of the monitor. + final String monitorId; + + CreateMonitorResponse({ + required this.identityCenterApplicationArn, + required this.monitorId, + }); + + factory CreateMonitorResponse.fromJson(Map json) { + return CreateMonitorResponse( + identityCenterApplicationArn: + json['identityCenterApplicationArn'] as String, + monitorId: json['monitorId'] as String, + ); + } + + Map toJson() { + final identityCenterApplicationArn = this.identityCenterApplicationArn; + final monitorId = this.monitorId; + return { + 'identityCenterApplicationArn': identityCenterApplicationArn, + 'monitorId': monitorId, + }; + } +} + +class CreateQueueEnvironmentResponse { + /// The queue environment ID. + final String queueEnvironmentId; + + CreateQueueEnvironmentResponse({ + required this.queueEnvironmentId, + }); + + factory CreateQueueEnvironmentResponse.fromJson(Map json) { + return CreateQueueEnvironmentResponse( + queueEnvironmentId: json['queueEnvironmentId'] as String, + ); + } + + Map toJson() { + final queueEnvironmentId = this.queueEnvironmentId; + return { + 'queueEnvironmentId': queueEnvironmentId, + }; + } +} + +class CreateQueueFleetAssociationResponse { + CreateQueueFleetAssociationResponse(); + + factory CreateQueueFleetAssociationResponse.fromJson(Map _) { + return CreateQueueFleetAssociationResponse(); + } + + Map toJson() { + return {}; + } +} + +class CreateQueueResponse { + /// The queue ID. + final String queueId; + + CreateQueueResponse({ + required this.queueId, + }); + + factory CreateQueueResponse.fromJson(Map json) { + return CreateQueueResponse( + queueId: json['queueId'] as String, + ); + } + + Map toJson() { + final queueId = this.queueId; + return { + 'queueId': queueId, + }; + } +} + +class CreateStorageProfileResponse { + /// The storage profile ID. + final String storageProfileId; + + CreateStorageProfileResponse({ + required this.storageProfileId, + }); + + factory CreateStorageProfileResponse.fromJson(Map json) { + return CreateStorageProfileResponse( + storageProfileId: json['storageProfileId'] as String, + ); + } + + Map toJson() { + final storageProfileId = this.storageProfileId; + return { + 'storageProfileId': storageProfileId, + }; + } +} + +class CreateWorkerResponse { + /// The worker ID. + final String workerId; + + CreateWorkerResponse({ + required this.workerId, + }); + + factory CreateWorkerResponse.fromJson(Map json) { + return CreateWorkerResponse( + workerId: json['workerId'] as String, + ); + } + + Map toJson() { + final workerId = this.workerId; + return { + 'workerId': workerId, + }; + } +} + +/// The details of a customer managed fleet configuration. +class CustomerManagedFleetConfiguration { + /// The Auto Scaling mode for the customer managed fleet configuration. + final AutoScalingMode mode; + + /// The worker capabilities for a customer managed fleet configuration. + final CustomerManagedWorkerCapabilities workerCapabilities; + + /// The storage profile ID. + final String? storageProfileId; + + CustomerManagedFleetConfiguration({ + required this.mode, + required this.workerCapabilities, + this.storageProfileId, + }); + + factory CustomerManagedFleetConfiguration.fromJson( + Map json) { + return CustomerManagedFleetConfiguration( + mode: (json['mode'] as String).toAutoScalingMode(), + workerCapabilities: CustomerManagedWorkerCapabilities.fromJson( + json['workerCapabilities'] as Map), + storageProfileId: json['storageProfileId'] as String?, + ); + } + + Map toJson() { + final mode = this.mode; + final workerCapabilities = this.workerCapabilities; + final storageProfileId = this.storageProfileId; + return { + 'mode': mode.toValue(), + 'workerCapabilities': workerCapabilities, + if (storageProfileId != null) 'storageProfileId': storageProfileId, + }; + } +} + +enum CustomerManagedFleetOperatingSystemFamily { + windows, + linux, + macos, +} + +extension CustomerManagedFleetOperatingSystemFamilyValueExtension + on CustomerManagedFleetOperatingSystemFamily { + String toValue() { + switch (this) { + case CustomerManagedFleetOperatingSystemFamily.windows: + return 'WINDOWS'; + case CustomerManagedFleetOperatingSystemFamily.linux: + return 'LINUX'; + case CustomerManagedFleetOperatingSystemFamily.macos: + return 'MACOS'; + } + } +} + +extension CustomerManagedFleetOperatingSystemFamilyFromString on String { + CustomerManagedFleetOperatingSystemFamily + toCustomerManagedFleetOperatingSystemFamily() { + switch (this) { + case 'WINDOWS': + return CustomerManagedFleetOperatingSystemFamily.windows; + case 'LINUX': + return CustomerManagedFleetOperatingSystemFamily.linux; + case 'MACOS': + return CustomerManagedFleetOperatingSystemFamily.macos; + } + throw Exception( + '$this is not known in enum CustomerManagedFleetOperatingSystemFamily'); + } +} + +/// The worker capabilities for a customer managed workflow. +class CustomerManagedWorkerCapabilities { + /// The CPU architecture type for the customer managed worker capabilities. + final CpuArchitectureType cpuArchitectureType; + + /// The memory (MiB). + final MemoryMiBRange memoryMiB; + + /// The operating system (OS) family. + final CustomerManagedFleetOperatingSystemFamily osFamily; + + /// The vCPU count for the customer manged worker capabilities. + final VCpuCountRange vCpuCount; + + /// The range of the accelerator. + final AcceleratorCountRange? acceleratorCount; + + /// The total memory (MiB) for the customer managed worker capabilities. + final AcceleratorTotalMemoryMiBRange? acceleratorTotalMemoryMiB; + + /// The accelerator types for the customer managed worker capabilities. + final List? acceleratorTypes; + + /// Custom requirement ranges for customer managed worker capabilities. + final List? customAmounts; + + /// Custom attributes for the customer manged worker capabilities. + final List? customAttributes; + + CustomerManagedWorkerCapabilities({ + required this.cpuArchitectureType, + required this.memoryMiB, + required this.osFamily, + required this.vCpuCount, + this.acceleratorCount, + this.acceleratorTotalMemoryMiB, + this.acceleratorTypes, + this.customAmounts, + this.customAttributes, + }); + + factory CustomerManagedWorkerCapabilities.fromJson( + Map json) { + return CustomerManagedWorkerCapabilities( + cpuArchitectureType: + (json['cpuArchitectureType'] as String).toCpuArchitectureType(), + memoryMiB: + MemoryMiBRange.fromJson(json['memoryMiB'] as Map), + osFamily: (json['osFamily'] as String) + .toCustomerManagedFleetOperatingSystemFamily(), + vCpuCount: + VCpuCountRange.fromJson(json['vCpuCount'] as Map), + acceleratorCount: json['acceleratorCount'] != null + ? AcceleratorCountRange.fromJson( + json['acceleratorCount'] as Map) + : null, + acceleratorTotalMemoryMiB: json['acceleratorTotalMemoryMiB'] != null + ? AcceleratorTotalMemoryMiBRange.fromJson( + json['acceleratorTotalMemoryMiB'] as Map) + : null, + acceleratorTypes: (json['acceleratorTypes'] as List?) + ?.whereNotNull() + .map((e) => (e as String).toAcceleratorType()) + .toList(), + customAmounts: (json['customAmounts'] as List?) + ?.whereNotNull() + .map((e) => FleetAmountCapability.fromJson(e as Map)) + .toList(), + customAttributes: (json['customAttributes'] as List?) + ?.whereNotNull() + .map((e) => + FleetAttributeCapability.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final cpuArchitectureType = this.cpuArchitectureType; + final memoryMiB = this.memoryMiB; + final osFamily = this.osFamily; + final vCpuCount = this.vCpuCount; + final acceleratorCount = this.acceleratorCount; + final acceleratorTotalMemoryMiB = this.acceleratorTotalMemoryMiB; + final acceleratorTypes = this.acceleratorTypes; + final customAmounts = this.customAmounts; + final customAttributes = this.customAttributes; + return { + 'cpuArchitectureType': cpuArchitectureType.toValue(), + 'memoryMiB': memoryMiB, + 'osFamily': osFamily.toValue(), + 'vCpuCount': vCpuCount, + if (acceleratorCount != null) 'acceleratorCount': acceleratorCount, + if (acceleratorTotalMemoryMiB != null) + 'acceleratorTotalMemoryMiB': acceleratorTotalMemoryMiB, + if (acceleratorTypes != null) + 'acceleratorTypes': acceleratorTypes.map((e) => e.toValue()).toList(), + if (customAmounts != null) 'customAmounts': customAmounts, + if (customAttributes != null) 'customAttributes': customAttributes, + }; + } +} + +/// The time stamp in date-time format. +class DateTimeFilterExpression { + /// The date and time. + final DateTime dateTime; + + /// The name of the date-time field to filter on. + final String name; + + /// The type of comparison to use to filter the results. + final ComparisonOperator operator; + + DateTimeFilterExpression({ + required this.dateTime, + required this.name, + required this.operator, + }); + + Map toJson() { + final dateTime = this.dateTime; + final name = this.name; + final operator = this.operator; + return { + 'dateTime': iso8601ToJson(dateTime), + 'name': name, + 'operator': operator.toValue(), + }; + } +} + +enum DefaultQueueBudgetAction { + none, + stopSchedulingAndCompleteTasks, + stopSchedulingAndCancelTasks, +} + +extension DefaultQueueBudgetActionValueExtension on DefaultQueueBudgetAction { + String toValue() { + switch (this) { + case DefaultQueueBudgetAction.none: + return 'NONE'; + case DefaultQueueBudgetAction.stopSchedulingAndCompleteTasks: + return 'STOP_SCHEDULING_AND_COMPLETE_TASKS'; + case DefaultQueueBudgetAction.stopSchedulingAndCancelTasks: + return 'STOP_SCHEDULING_AND_CANCEL_TASKS'; + } + } +} + +extension DefaultQueueBudgetActionFromString on String { + DefaultQueueBudgetAction toDefaultQueueBudgetAction() { + switch (this) { + case 'NONE': + return DefaultQueueBudgetAction.none; + case 'STOP_SCHEDULING_AND_COMPLETE_TASKS': + return DefaultQueueBudgetAction.stopSchedulingAndCompleteTasks; + case 'STOP_SCHEDULING_AND_CANCEL_TASKS': + return DefaultQueueBudgetAction.stopSchedulingAndCancelTasks; + } + throw Exception('$this is not known in enum DefaultQueueBudgetAction'); + } +} + +class DeleteBudgetResponse { + DeleteBudgetResponse(); + + factory DeleteBudgetResponse.fromJson(Map _) { + return DeleteBudgetResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteFarmResponse { + DeleteFarmResponse(); + + factory DeleteFarmResponse.fromJson(Map _) { + return DeleteFarmResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteFleetResponse { + DeleteFleetResponse(); + + factory DeleteFleetResponse.fromJson(Map _) { + return DeleteFleetResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteLicenseEndpointResponse { + DeleteLicenseEndpointResponse(); + + factory DeleteLicenseEndpointResponse.fromJson(Map _) { + return DeleteLicenseEndpointResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteMeteredProductResponse { + DeleteMeteredProductResponse(); + + factory DeleteMeteredProductResponse.fromJson(Map _) { + return DeleteMeteredProductResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteMonitorResponse { + DeleteMonitorResponse(); + + factory DeleteMonitorResponse.fromJson(Map _) { + return DeleteMonitorResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteQueueEnvironmentResponse { + DeleteQueueEnvironmentResponse(); + + factory DeleteQueueEnvironmentResponse.fromJson(Map _) { + return DeleteQueueEnvironmentResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteQueueFleetAssociationResponse { + DeleteQueueFleetAssociationResponse(); + + factory DeleteQueueFleetAssociationResponse.fromJson(Map _) { + return DeleteQueueFleetAssociationResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteQueueResponse { + DeleteQueueResponse(); + + factory DeleteQueueResponse.fromJson(Map _) { + return DeleteQueueResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteStorageProfileResponse { + DeleteStorageProfileResponse(); + + factory DeleteStorageProfileResponse.fromJson(Map _) { + return DeleteStorageProfileResponse(); + } + + Map toJson() { + return {}; + } +} + +class DeleteWorkerResponse { + DeleteWorkerResponse(); + + factory DeleteWorkerResponse.fromJson(Map _) { + return DeleteWorkerResponse(); + } + + Map toJson() { + return {}; + } +} + +enum DependencyConsumerResolutionStatus { + resolved, + unresolved, +} + +extension DependencyConsumerResolutionStatusValueExtension + on DependencyConsumerResolutionStatus { + String toValue() { + switch (this) { + case DependencyConsumerResolutionStatus.resolved: + return 'RESOLVED'; + case DependencyConsumerResolutionStatus.unresolved: + return 'UNRESOLVED'; + } + } +} + +extension DependencyConsumerResolutionStatusFromString on String { + DependencyConsumerResolutionStatus toDependencyConsumerResolutionStatus() { + switch (this) { + case 'RESOLVED': + return DependencyConsumerResolutionStatus.resolved; + case 'UNRESOLVED': + return DependencyConsumerResolutionStatus.unresolved; + } + throw Exception( + '$this is not known in enum DependencyConsumerResolutionStatus'); + } +} + +/// The number of dependencies for the consumer. +class DependencyCounts { + /// The number of consumers resolved. + final int consumersResolved; + + /// The number of unresolved consumers. + final int consumersUnresolved; + + /// The number of resolved dependencies. + final int dependenciesResolved; + + /// The number of unresolved dependencies. + final int dependenciesUnresolved; + + DependencyCounts({ + required this.consumersResolved, + required this.consumersUnresolved, + required this.dependenciesResolved, + required this.dependenciesUnresolved, + }); + + factory DependencyCounts.fromJson(Map json) { + return DependencyCounts( + consumersResolved: json['consumersResolved'] as int, + consumersUnresolved: json['consumersUnresolved'] as int, + dependenciesResolved: json['dependenciesResolved'] as int, + dependenciesUnresolved: json['dependenciesUnresolved'] as int, + ); + } + + Map toJson() { + final consumersResolved = this.consumersResolved; + final consumersUnresolved = this.consumersUnresolved; + final dependenciesResolved = this.dependenciesResolved; + final dependenciesUnresolved = this.dependenciesUnresolved; + return { + 'consumersResolved': consumersResolved, + 'consumersUnresolved': consumersUnresolved, + 'dependenciesResolved': dependenciesResolved, + 'dependenciesUnresolved': dependenciesUnresolved, + }; + } +} + +enum DesiredWorkerStatus { + stopped, +} + +extension DesiredWorkerStatusValueExtension on DesiredWorkerStatus { + String toValue() { + switch (this) { + case DesiredWorkerStatus.stopped: + return 'STOPPED'; + } + } +} + +extension DesiredWorkerStatusFromString on String { + DesiredWorkerStatus toDesiredWorkerStatus() { + switch (this) { + case 'STOPPED': + return DesiredWorkerStatus.stopped; + } + throw Exception('$this is not known in enum DesiredWorkerStatus'); + } +} + +class DisassociateMemberFromFarmResponse { + DisassociateMemberFromFarmResponse(); + + factory DisassociateMemberFromFarmResponse.fromJson(Map _) { + return DisassociateMemberFromFarmResponse(); + } + + Map toJson() { + return {}; + } +} + +class DisassociateMemberFromFleetResponse { + DisassociateMemberFromFleetResponse(); + + factory DisassociateMemberFromFleetResponse.fromJson(Map _) { + return DisassociateMemberFromFleetResponse(); + } + + Map toJson() { + return {}; + } +} + +class DisassociateMemberFromJobResponse { + DisassociateMemberFromJobResponse(); + + factory DisassociateMemberFromJobResponse.fromJson(Map _) { + return DisassociateMemberFromJobResponse(); + } + + Map toJson() { + return {}; + } +} + +class DisassociateMemberFromQueueResponse { + DisassociateMemberFromQueueResponse(); + + factory DisassociateMemberFromQueueResponse.fromJson(Map _) { + return DisassociateMemberFromQueueResponse(); + } + + Map toJson() { + return {}; + } +} + +class Document { + Document(); + + factory Document.fromJson(Map _) { + return Document(); + } + + Map toJson() { + return {}; + } +} + +/// Specifies the EBS volume. +class Ec2EbsVolume { + /// The IOPS per volume. + final int? iops; + + /// The EBS volume size in GiB. + final int? sizeGiB; + + /// The throughput per volume in MiB. + final int? throughputMiB; + + Ec2EbsVolume({ + this.iops, + this.sizeGiB, + this.throughputMiB, + }); + + factory Ec2EbsVolume.fromJson(Map json) { + return Ec2EbsVolume( + iops: json['iops'] as int?, + sizeGiB: json['sizeGiB'] as int?, + throughputMiB: json['throughputMiB'] as int?, + ); + } + + Map toJson() { + final iops = this.iops; + final sizeGiB = this.sizeGiB; + final throughputMiB = this.throughputMiB; + return { + if (iops != null) 'iops': iops, + if (sizeGiB != null) 'sizeGiB': sizeGiB, + if (throughputMiB != null) 'throughputMiB': throughputMiB, + }; + } +} + +enum Ec2MarketType { + onDemand, + spot, +} + +extension Ec2MarketTypeValueExtension on Ec2MarketType { + String toValue() { + switch (this) { + case Ec2MarketType.onDemand: + return 'on-demand'; + case Ec2MarketType.spot: + return 'spot'; + } + } +} + +extension Ec2MarketTypeFromString on String { + Ec2MarketType toEc2MarketType() { + switch (this) { + case 'on-demand': + return Ec2MarketType.onDemand; + case 'spot': + return Ec2MarketType.spot; + } + throw Exception('$this is not known in enum Ec2MarketType'); + } +} + +/// The details of a specified environment. +class EnvironmentDetailsEntity { + /// The environment ID. + final String environmentId; + + /// The job ID. + final String jobId; + + /// The schema version in the environment. + final String schemaVersion; + + /// The template used for the environment. + final Document template; + + EnvironmentDetailsEntity({ + required this.environmentId, + required this.jobId, + required this.schemaVersion, + required this.template, + }); + + factory EnvironmentDetailsEntity.fromJson(Map json) { + return EnvironmentDetailsEntity( + environmentId: json['environmentId'] as String, + jobId: json['jobId'] as String, + schemaVersion: json['schemaVersion'] as String, + template: Document.fromJson(json['template'] as Map), + ); + } + + Map toJson() { + final environmentId = this.environmentId; + final jobId = this.jobId; + final schemaVersion = this.schemaVersion; + final template = this.template; + return { + 'environmentId': environmentId, + 'jobId': jobId, + 'schemaVersion': schemaVersion, + 'template': template, + }; + } +} + +/// The error details for the environment. +class EnvironmentDetailsError { + /// The error code. + final JobEntityErrorCode code; + + /// The environment ID. + final String environmentId; + + /// The job ID. + final String jobId; + + /// The error message detailing the error's cause. + final String message; + + EnvironmentDetailsError({ + required this.code, + required this.environmentId, + required this.jobId, + required this.message, + }); + + factory EnvironmentDetailsError.fromJson(Map json) { + return EnvironmentDetailsError( + code: (json['code'] as String).toJobEntityErrorCode(), + environmentId: json['environmentId'] as String, + jobId: json['jobId'] as String, + message: json['message'] as String, + ); + } + + Map toJson() { + final code = this.code; + final environmentId = this.environmentId; + final jobId = this.jobId; + final message = this.message; + return { + 'code': code.toValue(), + 'environmentId': environmentId, + 'jobId': jobId, + 'message': message, + }; + } +} + +/// The IDs of the job and environment. +class EnvironmentDetailsIdentifiers { + /// The environment ID. + final String environmentId; + + /// The job ID. + final String jobId; + + EnvironmentDetailsIdentifiers({ + required this.environmentId, + required this.jobId, + }); + + Map toJson() { + final environmentId = this.environmentId; + final jobId = this.jobId; + return { + 'environmentId': environmentId, + 'jobId': jobId, + }; + } +} + +/// The environment ID to use to enter a session action. +class EnvironmentEnterSessionActionDefinition { + /// The environment ID. + final String environmentId; + + EnvironmentEnterSessionActionDefinition({ + required this.environmentId, + }); + + factory EnvironmentEnterSessionActionDefinition.fromJson( + Map json) { + return EnvironmentEnterSessionActionDefinition( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +/// Defines the environment a session action enters in. +class EnvironmentEnterSessionActionDefinitionSummary { + /// The environment ID. + final String environmentId; + + EnvironmentEnterSessionActionDefinitionSummary({ + required this.environmentId, + }); + + factory EnvironmentEnterSessionActionDefinitionSummary.fromJson( + Map json) { + return EnvironmentEnterSessionActionDefinitionSummary( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +/// Defines the environment a session action exits from. +class EnvironmentExitSessionActionDefinition { + /// The environment ID. + final String environmentId; + + EnvironmentExitSessionActionDefinition({ + required this.environmentId, + }); + + factory EnvironmentExitSessionActionDefinition.fromJson( + Map json) { + return EnvironmentExitSessionActionDefinition( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +/// A summary of the environment details for which a session action to exits. +class EnvironmentExitSessionActionDefinitionSummary { + /// The environment ID. + final String environmentId; + + EnvironmentExitSessionActionDefinitionSummary({ + required this.environmentId, + }); + + factory EnvironmentExitSessionActionDefinitionSummary.fromJson( + Map json) { + return EnvironmentExitSessionActionDefinitionSummary( + environmentId: json['environmentId'] as String, + ); + } + + Map toJson() { + final environmentId = this.environmentId; + return { + 'environmentId': environmentId, + }; + } +} + +enum EnvironmentTemplateType { + json, + yaml, +} + +extension EnvironmentTemplateTypeValueExtension on EnvironmentTemplateType { + String toValue() { + switch (this) { + case EnvironmentTemplateType.json: + return 'JSON'; + case EnvironmentTemplateType.yaml: + return 'YAML'; + } + } +} + +extension EnvironmentTemplateTypeFromString on String { + EnvironmentTemplateType toEnvironmentTemplateType() { + switch (this) { + case 'JSON': + return EnvironmentTemplateType.json; + case 'YAML': + return EnvironmentTemplateType.yaml; + } + throw Exception('$this is not known in enum EnvironmentTemplateType'); + } +} + +/// The member of a farm. +class FarmMember { + /// The farm ID of the farm member. + final String farmId; + + /// The identity store ID of the farm member. + final String identityStoreId; + + /// The farm member's membership level. + final MembershipLevel membershipLevel; + + /// The principal ID of the farm member. + final String principalId; + + /// The principal type of the farm member. + final PrincipalType principalType; + + FarmMember({ + required this.farmId, + required this.identityStoreId, + required this.membershipLevel, + required this.principalId, + required this.principalType, + }); + + factory FarmMember.fromJson(Map json) { + return FarmMember( + farmId: json['farmId'] as String, + identityStoreId: json['identityStoreId'] as String, + membershipLevel: (json['membershipLevel'] as String).toMembershipLevel(), + principalId: json['principalId'] as String, + principalType: (json['principalType'] as String).toPrincipalType(), + ); + } + + Map toJson() { + final farmId = this.farmId; + final identityStoreId = this.identityStoreId; + final membershipLevel = this.membershipLevel; + final principalId = this.principalId; + final principalType = this.principalType; + return { + 'farmId': farmId, + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalId': principalId, + 'principalType': principalType.toValue(), + }; + } +} + +/// The summary of details for a farm. +class FarmSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the farm. + final String displayName; + + /// The farm ID. + final String farmId; + + /// The ARN for the KMS key. + final String? kmsKeyArn; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + FarmSummary({ + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.farmId, + this.kmsKeyArn, + this.updatedAt, + this.updatedBy, + }); + + factory FarmSummary.fromJson(Map json) { + return FarmSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + kmsKeyArn: json['kmsKeyArn'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final farmId = this.farmId; + final kmsKeyArn = this.kmsKeyArn; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'farmId': farmId, + if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The field sorting order and name of the field. +class FieldSortExpression { + /// The name of the field. + final String name; + + /// The sort order for the field. + final SortOrder sortOrder; + + FieldSortExpression({ + required this.name, + required this.sortOrder, + }); + + Map toJson() { + final name = this.name; + final sortOrder = this.sortOrder; + return { + 'name': name, + 'sortOrder': sortOrder.toValue(), + }; + } +} + +/// The details of the file system location for the resource. +class FileSystemLocation { + /// The location name. + final String name; + + /// The file path. + final String path; + + /// The type of file. + final FileSystemLocationType type; + + FileSystemLocation({ + required this.name, + required this.path, + required this.type, + }); + + factory FileSystemLocation.fromJson(Map json) { + return FileSystemLocation( + name: json['name'] as String, + path: json['path'] as String, + type: (json['type'] as String).toFileSystemLocationType(), + ); + } + + Map toJson() { + final name = this.name; + final path = this.path; + final type = this.type; + return { + 'name': name, + 'path': path, + 'type': type.toValue(), + }; + } +} + +enum FileSystemLocationType { + shared, + local, +} + +extension FileSystemLocationTypeValueExtension on FileSystemLocationType { + String toValue() { + switch (this) { + case FileSystemLocationType.shared: + return 'SHARED'; + case FileSystemLocationType.local: + return 'LOCAL'; + } + } +} + +extension FileSystemLocationTypeFromString on String { + FileSystemLocationType toFileSystemLocationType() { + switch (this) { + case 'SHARED': + return FileSystemLocationType.shared; + case 'LOCAL': + return FileSystemLocationType.local; + } + throw Exception('$this is not known in enum FileSystemLocationType'); + } +} + +/// The details of a fixed budget schedule. +class FixedBudgetSchedule { + /// When the budget ends. + final DateTime endTime; + + /// When the budget starts. + final DateTime startTime; + + FixedBudgetSchedule({ + required this.endTime, + required this.startTime, + }); + + factory FixedBudgetSchedule.fromJson(Map json) { + return FixedBudgetSchedule( + endTime: nonNullableTimeStampFromJson(json['endTime'] as Object), + startTime: nonNullableTimeStampFromJson(json['startTime'] as Object), + ); + } + + Map toJson() { + final endTime = this.endTime; + final startTime = this.startTime; + return { + 'endTime': iso8601ToJson(endTime), + 'startTime': iso8601ToJson(startTime), + }; + } +} + +/// The fleet amount and attribute capabilities. +class FleetAmountCapability { + /// The minimum amount of fleet worker capability. + final double min; + + /// The name of the fleet capability. + final String name; + + /// The maximum amount of the fleet worker capability. + final double? max; + + FleetAmountCapability({ + required this.min, + required this.name, + this.max, + }); + + factory FleetAmountCapability.fromJson(Map json) { + return FleetAmountCapability( + min: json['min'] as double, + name: json['name'] as String, + max: json['max'] as double?, + ); + } + + Map toJson() { + final min = this.min; + final name = this.name; + final max = this.max; + return { + 'min': min, + 'name': name, + if (max != null) 'max': max, + }; + } +} + +/// Defines the fleet's capability name, minimum, and maximum. +class FleetAttributeCapability { + /// The name of the fleet attribute capability for the worker. + final String name; + + /// The number of fleet attribute capabilities. + final List values; + + FleetAttributeCapability({ + required this.name, + required this.values, + }); + + factory FleetAttributeCapability.fromJson(Map json) { + return FleetAttributeCapability( + name: json['name'] as String, + values: (json['values'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final name = this.name; + final values = this.values; + return { + 'name': name, + 'values': values, + }; + } +} + +/// The amounts and attributes of fleets. +class FleetCapabilities { + /// Amount capabilities of the fleet. + final List? amounts; + + /// Attribute capabilities of the fleet. + final List? attributes; + + FleetCapabilities({ + this.amounts, + this.attributes, + }); + + factory FleetCapabilities.fromJson(Map json) { + return FleetCapabilities( + amounts: (json['amounts'] as List?) + ?.whereNotNull() + .map((e) => FleetAmountCapability.fromJson(e as Map)) + .toList(), + attributes: (json['attributes'] as List?) + ?.whereNotNull() + .map((e) => + FleetAttributeCapability.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final amounts = this.amounts; + final attributes = this.attributes; + return { + if (amounts != null) 'amounts': amounts, + if (attributes != null) 'attributes': attributes, + }; + } +} + +/// Fleet configuration details. +class FleetConfiguration { + /// The customer managed fleets within a fleet configuration. + final CustomerManagedFleetConfiguration? customerManaged; + + /// The service managed Amazon EC2 instances for a fleet configuration. + final ServiceManagedEc2FleetConfiguration? serviceManagedEc2; + + FleetConfiguration({ + this.customerManaged, + this.serviceManagedEc2, + }); + + factory FleetConfiguration.fromJson(Map json) { + return FleetConfiguration( + customerManaged: json['customerManaged'] != null + ? CustomerManagedFleetConfiguration.fromJson( + json['customerManaged'] as Map) + : null, + serviceManagedEc2: json['serviceManagedEc2'] != null + ? ServiceManagedEc2FleetConfiguration.fromJson( + json['serviceManagedEc2'] as Map) + : null, + ); + } + + Map toJson() { + final customerManaged = this.customerManaged; + final serviceManagedEc2 = this.serviceManagedEc2; + return { + if (customerManaged != null) 'customerManaged': customerManaged, + if (serviceManagedEc2 != null) 'serviceManagedEc2': serviceManagedEc2, + }; + } +} + +/// The fleet member. +class FleetMember { + /// The farm ID. + final String farmId; + + /// The fleet ID. + final String fleetId; + + /// The identity store ID. + final String identityStoreId; + + /// The fleet member's membership level. + final MembershipLevel membershipLevel; + + /// The principal ID of the fleet member. + final String principalId; + + /// The principal type of the fleet member. + final PrincipalType principalType; + + FleetMember({ + required this.farmId, + required this.fleetId, + required this.identityStoreId, + required this.membershipLevel, + required this.principalId, + required this.principalType, + }); + + factory FleetMember.fromJson(Map json) { + return FleetMember( + farmId: json['farmId'] as String, + fleetId: json['fleetId'] as String, + identityStoreId: json['identityStoreId'] as String, + membershipLevel: (json['membershipLevel'] as String).toMembershipLevel(), + principalId: json['principalId'] as String, + principalType: (json['principalType'] as String).toPrincipalType(), + ); + } + + Map toJson() { + final farmId = this.farmId; + final fleetId = this.fleetId; + final identityStoreId = this.identityStoreId; + final membershipLevel = this.membershipLevel; + final principalId = this.principalId; + final principalType = this.principalType; + return { + 'farmId': farmId, + 'fleetId': fleetId, + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalId': principalId, + 'principalType': principalType.toValue(), + }; + } +} + +enum FleetStatus { + active, + createInProgress, + updateInProgress, + createFailed, + updateFailed, +} + +extension FleetStatusValueExtension on FleetStatus { + String toValue() { + switch (this) { + case FleetStatus.active: + return 'ACTIVE'; + case FleetStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case FleetStatus.updateInProgress: + return 'UPDATE_IN_PROGRESS'; + case FleetStatus.createFailed: + return 'CREATE_FAILED'; + case FleetStatus.updateFailed: + return 'UPDATE_FAILED'; + } + } +} + +extension FleetStatusFromString on String { + FleetStatus toFleetStatus() { + switch (this) { + case 'ACTIVE': + return FleetStatus.active; + case 'CREATE_IN_PROGRESS': + return FleetStatus.createInProgress; + case 'UPDATE_IN_PROGRESS': + return FleetStatus.updateInProgress; + case 'CREATE_FAILED': + return FleetStatus.createFailed; + case 'UPDATE_FAILED': + return FleetStatus.updateFailed; + } + throw Exception('$this is not known in enum FleetStatus'); + } +} + +/// The details of a fleet. +class FleetSummary { + /// The configuration details for the fleet. + final FleetConfiguration configuration; + + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the fleet summary to update. + final String displayName; + + /// The farm ID. + final String farmId; + + /// The fleet ID. + final String fleetId; + + /// The maximum number of workers specified in the fleet. + final int maxWorkerCount; + + /// The minimum number of workers in the fleet. + final int minWorkerCount; + + /// The status of the fleet. + final FleetStatus status; + + /// The number of workers in the fleet summary. + final int workerCount; + + /// The Auto Scaling status of a fleet. + final AutoScalingStatus? autoScalingStatus; + + /// The target number of workers in a fleet. + final int? targetWorkerCount; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + FleetSummary({ + required this.configuration, + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.farmId, + required this.fleetId, + required this.maxWorkerCount, + required this.minWorkerCount, + required this.status, + required this.workerCount, + this.autoScalingStatus, + this.targetWorkerCount, + this.updatedAt, + this.updatedBy, + }); + + factory FleetSummary.fromJson(Map json) { + return FleetSummary( + configuration: FleetConfiguration.fromJson( + json['configuration'] as Map), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + fleetId: json['fleetId'] as String, + maxWorkerCount: json['maxWorkerCount'] as int, + minWorkerCount: json['minWorkerCount'] as int, + status: (json['status'] as String).toFleetStatus(), + workerCount: json['workerCount'] as int, + autoScalingStatus: + (json['autoScalingStatus'] as String?)?.toAutoScalingStatus(), + targetWorkerCount: json['targetWorkerCount'] as int?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final configuration = this.configuration; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final farmId = this.farmId; + final fleetId = this.fleetId; + final maxWorkerCount = this.maxWorkerCount; + final minWorkerCount = this.minWorkerCount; + final status = this.status; + final workerCount = this.workerCount; + final autoScalingStatus = this.autoScalingStatus; + final targetWorkerCount = this.targetWorkerCount; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'configuration': configuration, + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'farmId': farmId, + 'fleetId': fleetId, + 'maxWorkerCount': maxWorkerCount, + 'minWorkerCount': minWorkerCount, + 'status': status.toValue(), + 'workerCount': workerCount, + if (autoScalingStatus != null) + 'autoScalingStatus': autoScalingStatus.toValue(), + if (targetWorkerCount != null) 'targetWorkerCount': targetWorkerCount, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetBudgetResponse { + /// The budget actions for the budget. + final List actions; + + /// The consumed usage limit for the budget. + final double approximateDollarLimit; + + /// The budget ID. + final String budgetId; + + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the budget. + final String displayName; + + /// The budget schedule. + final BudgetSchedule schedule; + + /// The status of the budget. + /// + ///
        + ///
      • + /// ACTIVE–Get a budget being evaluated. + ///
      • + ///
      • + /// INACTIVE–Get an inactive budget. This can include expired, + /// canceled, or deleted statuses. + ///
      • + ///
      + final BudgetStatus status; + + /// The resource that the budget is tracking usage for. + final UsageTrackingResource usageTrackingResource; + + /// The usages of the budget. + final ConsumedUsages usages; + + /// The description of the budget. + final String? description; + + /// The date and time the queue stopped. + final DateTime? queueStoppedAt; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetBudgetResponse({ + required this.actions, + required this.approximateDollarLimit, + required this.budgetId, + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.schedule, + required this.status, + required this.usageTrackingResource, + required this.usages, + this.description, + this.queueStoppedAt, + this.updatedAt, + this.updatedBy, + }); + + factory GetBudgetResponse.fromJson(Map json) { + return GetBudgetResponse( + actions: (json['actions'] as List) + .whereNotNull() + .map((e) => ResponseBudgetAction.fromJson(e as Map)) + .toList(), + approximateDollarLimit: json['approximateDollarLimit'] as double, + budgetId: json['budgetId'] as String, + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + schedule: + BudgetSchedule.fromJson(json['schedule'] as Map), + status: (json['status'] as String).toBudgetStatus(), + usageTrackingResource: UsageTrackingResource.fromJson( + json['usageTrackingResource'] as Map), + usages: ConsumedUsages.fromJson(json['usages'] as Map), + description: json['description'] as String?, + queueStoppedAt: timeStampFromJson(json['queueStoppedAt']), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final actions = this.actions; + final approximateDollarLimit = this.approximateDollarLimit; + final budgetId = this.budgetId; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final schedule = this.schedule; + final status = this.status; + final usageTrackingResource = this.usageTrackingResource; + final usages = this.usages; + final description = this.description; + final queueStoppedAt = this.queueStoppedAt; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'actions': actions, + 'approximateDollarLimit': approximateDollarLimit, + 'budgetId': budgetId, + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'schedule': schedule, + 'status': status.toValue(), + 'usageTrackingResource': usageTrackingResource, + 'usages': usages, + if (description != null) 'description': description, + if (queueStoppedAt != null) + 'queueStoppedAt': iso8601ToJson(queueStoppedAt), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetFarmResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the farm. + final String displayName; + + /// The farm ID of the farm to get. + final String farmId; + + /// The ARN of the KMS key used on the farm. + final String kmsKeyArn; + + /// The description of the farm. + final String? description; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetFarmResponse({ + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.farmId, + required this.kmsKeyArn, + this.description, + this.updatedAt, + this.updatedBy, + }); + + factory GetFarmResponse.fromJson(Map json) { + return GetFarmResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + kmsKeyArn: json['kmsKeyArn'] as String, + description: json['description'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final farmId = this.farmId; + final kmsKeyArn = this.kmsKeyArn; + final description = this.description; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'farmId': farmId, + 'kmsKeyArn': kmsKeyArn, + if (description != null) 'description': description, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetFleetResponse { + /// The configuration setting for the fleet. + final FleetConfiguration configuration; + + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the fleet. + final String displayName; + + /// The farm ID of the farm in the fleet. + final String farmId; + + /// The fleet ID. + final String fleetId; + + /// The maximum number of workers specified in the fleet. + final int maxWorkerCount; + + /// The minimum number of workers specified in the fleet. + final int minWorkerCount; + + /// The IAM role ARN. + final String roleArn; + + /// The Auto Scaling status of the fleet. + final FleetStatus status; + + /// The number of workers in the fleet. + final int workerCount; + + /// The Auto Scaling status of the fleet. Either GROWING, + /// STEADY, or SHRINKING. + final AutoScalingStatus? autoScalingStatus; + + /// Outlines what the fleet is capable of for minimums, maximums, and naming, in + /// addition to attribute names and values. + final FleetCapabilities? capabilities; + + /// The description of the fleet. + final String? description; + + /// The number of target workers in the fleet. + final int? targetWorkerCount; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetFleetResponse({ + required this.configuration, + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.farmId, + required this.fleetId, + required this.maxWorkerCount, + required this.minWorkerCount, + required this.roleArn, + required this.status, + required this.workerCount, + this.autoScalingStatus, + this.capabilities, + this.description, + this.targetWorkerCount, + this.updatedAt, + this.updatedBy, + }); + + factory GetFleetResponse.fromJson(Map json) { + return GetFleetResponse( + configuration: FleetConfiguration.fromJson( + json['configuration'] as Map), + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + fleetId: json['fleetId'] as String, + maxWorkerCount: json['maxWorkerCount'] as int, + minWorkerCount: json['minWorkerCount'] as int, + roleArn: json['roleArn'] as String, + status: (json['status'] as String).toFleetStatus(), + workerCount: json['workerCount'] as int, + autoScalingStatus: + (json['autoScalingStatus'] as String?)?.toAutoScalingStatus(), + capabilities: json['capabilities'] != null + ? FleetCapabilities.fromJson( + json['capabilities'] as Map) + : null, + description: json['description'] as String?, + targetWorkerCount: json['targetWorkerCount'] as int?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final configuration = this.configuration; + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final farmId = this.farmId; + final fleetId = this.fleetId; + final maxWorkerCount = this.maxWorkerCount; + final minWorkerCount = this.minWorkerCount; + final roleArn = this.roleArn; + final status = this.status; + final workerCount = this.workerCount; + final autoScalingStatus = this.autoScalingStatus; + final capabilities = this.capabilities; + final description = this.description; + final targetWorkerCount = this.targetWorkerCount; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'configuration': configuration, + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'farmId': farmId, + 'fleetId': fleetId, + 'maxWorkerCount': maxWorkerCount, + 'minWorkerCount': minWorkerCount, + 'roleArn': roleArn, + 'status': status.toValue(), + 'workerCount': workerCount, + if (autoScalingStatus != null) + 'autoScalingStatus': autoScalingStatus.toValue(), + if (capabilities != null) 'capabilities': capabilities, + if (description != null) 'description': description, + if (targetWorkerCount != null) 'targetWorkerCount': targetWorkerCount, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The error for the job entity. +class GetJobEntityError { + /// The environment details for the failed job entity. + final EnvironmentDetailsError? environmentDetails; + + /// The job attachment details for the failed job entity. + final JobAttachmentDetailsError? jobAttachmentDetails; + + /// The job details for the failed job entity. + final JobDetailsError? jobDetails; + + /// The step details for the failed job entity. + final StepDetailsError? stepDetails; + + GetJobEntityError({ + this.environmentDetails, + this.jobAttachmentDetails, + this.jobDetails, + this.stepDetails, + }); + + factory GetJobEntityError.fromJson(Map json) { + return GetJobEntityError( + environmentDetails: json['environmentDetails'] != null + ? EnvironmentDetailsError.fromJson( + json['environmentDetails'] as Map) + : null, + jobAttachmentDetails: json['jobAttachmentDetails'] != null + ? JobAttachmentDetailsError.fromJson( + json['jobAttachmentDetails'] as Map) + : null, + jobDetails: json['jobDetails'] != null + ? JobDetailsError.fromJson(json['jobDetails'] as Map) + : null, + stepDetails: json['stepDetails'] != null + ? StepDetailsError.fromJson( + json['stepDetails'] as Map) + : null, + ); + } + + Map toJson() { + final environmentDetails = this.environmentDetails; + final jobAttachmentDetails = this.jobAttachmentDetails; + final jobDetails = this.jobDetails; + final stepDetails = this.stepDetails; + return { + if (environmentDetails != null) 'environmentDetails': environmentDetails, + if (jobAttachmentDetails != null) + 'jobAttachmentDetails': jobAttachmentDetails, + if (jobDetails != null) 'jobDetails': jobDetails, + if (stepDetails != null) 'stepDetails': stepDetails, + }; + } +} + +class GetJobResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The job ID. + final String jobId; + + /// The life cycle status for the job. + final JobLifecycleStatus lifecycleStatus; + + /// A message that communicates the status of the life cycle for the job. + final String lifecycleStatusMessage; + + /// The name of the job. + final String name; + + /// The job priority. + final int priority; + + /// The attachments for the job. + final Attachments? attachments; + + /// The description of the job. + final String? description; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The number of task failures before the job stops running and is marked as + /// FAILED. + final int? maxFailedTasksCount; + + /// The maximum number of retries per failed tasks. + final int? maxRetriesPerTask; + + /// The parameters for the job. + final Map? parameters; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The storage profile ID associated with the job. + final String? storageProfileId; + + /// The task status with which the job started. + final JobTargetTaskRunStatus? targetTaskRunStatus; + + /// The task run status for the job. + final TaskRunStatus? taskRunStatus; + + /// The number of tasks running on the job. + final Map? taskRunStatusCounts; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetJobResponse({ + required this.createdAt, + required this.createdBy, + required this.jobId, + required this.lifecycleStatus, + required this.lifecycleStatusMessage, + required this.name, + required this.priority, + this.attachments, + this.description, + this.endedAt, + this.maxFailedTasksCount, + this.maxRetriesPerTask, + this.parameters, + this.startedAt, + this.storageProfileId, + this.targetTaskRunStatus, + this.taskRunStatus, + this.taskRunStatusCounts, + this.updatedAt, + this.updatedBy, + }); + + factory GetJobResponse.fromJson(Map json) { + return GetJobResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + jobId: json['jobId'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toJobLifecycleStatus(), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String, + name: json['name'] as String, + priority: json['priority'] as int, + attachments: json['attachments'] != null + ? Attachments.fromJson(json['attachments'] as Map) + : null, + description: json['description'] as String?, + endedAt: timeStampFromJson(json['endedAt']), + maxFailedTasksCount: json['maxFailedTasksCount'] as int?, + maxRetriesPerTask: json['maxRetriesPerTask'] as int?, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, JobParameter.fromJson(e as Map))), + startedAt: timeStampFromJson(json['startedAt']), + storageProfileId: json['storageProfileId'] as String?, + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toJobTargetTaskRunStatus(), + taskRunStatus: (json['taskRunStatus'] as String?)?.toTaskRunStatus(), + taskRunStatusCounts: + (json['taskRunStatusCounts'] as Map?) + ?.map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final jobId = this.jobId; + final lifecycleStatus = this.lifecycleStatus; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final name = this.name; + final priority = this.priority; + final attachments = this.attachments; + final description = this.description; + final endedAt = this.endedAt; + final maxFailedTasksCount = this.maxFailedTasksCount; + final maxRetriesPerTask = this.maxRetriesPerTask; + final parameters = this.parameters; + final startedAt = this.startedAt; + final storageProfileId = this.storageProfileId; + final targetTaskRunStatus = this.targetTaskRunStatus; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'jobId': jobId, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'lifecycleStatusMessage': lifecycleStatusMessage, + 'name': name, + 'priority': priority, + if (attachments != null) 'attachments': attachments, + if (description != null) 'description': description, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (maxFailedTasksCount != null) + 'maxFailedTasksCount': maxFailedTasksCount, + if (maxRetriesPerTask != null) 'maxRetriesPerTask': maxRetriesPerTask, + if (parameters != null) 'parameters': parameters, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (storageProfileId != null) 'storageProfileId': storageProfileId, + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (taskRunStatus != null) 'taskRunStatus': taskRunStatus.toValue(), + if (taskRunStatusCounts != null) + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetLicenseEndpointResponse { + /// The license endpoint ID. + final String licenseEndpointId; + + /// The status of the license endpoint. + final LicenseEndpointStatus status; + + /// The status message of the license endpoint. + final String statusMessage; + + /// The DNS name. + final String? dnsName; + + /// The security group IDs for the license endpoint. + final List? securityGroupIds; + + /// The subnet IDs. + final List? subnetIds; + + /// The VCP(virtual private cloud) ID associated with the license endpoint. + final String? vpcId; + + GetLicenseEndpointResponse({ + required this.licenseEndpointId, + required this.status, + required this.statusMessage, + this.dnsName, + this.securityGroupIds, + this.subnetIds, + this.vpcId, + }); + + factory GetLicenseEndpointResponse.fromJson(Map json) { + return GetLicenseEndpointResponse( + licenseEndpointId: json['licenseEndpointId'] as String, + status: (json['status'] as String).toLicenseEndpointStatus(), + statusMessage: json['statusMessage'] as String, + dnsName: json['dnsName'] as String?, + securityGroupIds: (json['securityGroupIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + subnetIds: (json['subnetIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + vpcId: json['vpcId'] as String?, + ); + } + + Map toJson() { + final licenseEndpointId = this.licenseEndpointId; + final status = this.status; + final statusMessage = this.statusMessage; + final dnsName = this.dnsName; + final securityGroupIds = this.securityGroupIds; + final subnetIds = this.subnetIds; + final vpcId = this.vpcId; + return { + 'licenseEndpointId': licenseEndpointId, + 'status': status.toValue(), + 'statusMessage': statusMessage, + if (dnsName != null) 'dnsName': dnsName, + if (securityGroupIds != null) 'securityGroupIds': securityGroupIds, + if (subnetIds != null) 'subnetIds': subnetIds, + if (vpcId != null) 'vpcId': vpcId, + }; + } +} + +class GetMonitorResponse { + /// The UNIX timestamp of the date and time that the monitor was created. + final DateTime createdAt; + + /// The user name of the person that created the monitor. + final String createdBy; + + /// The name used to identify the monitor on the Deadline Cloud console. + final String displayName; + + /// The Amazon Resource Name (ARN) that the IAM Identity Center assigned to the + /// monitor when it was created. + final String identityCenterApplicationArn; + + /// The Amazon Resource Name (ARN) of the IAM Identity Center instance + /// responsible for authenticating monitor users. + final String identityCenterInstanceArn; + + /// The unique identifier for the monitor. + final String monitorId; + + /// The Amazon Resource Name (ARN) of the IAM role for the monitor. Users of the + /// monitor use this role to access Deadline Cloud resources. + final String roleArn; + + /// The subdomain used for the monitor URL. The full URL of the monitor is + /// subdomain.Region.deadlinecloud.amazonaws.com. + final String subdomain; + + /// The complete URL of the monitor. The full URL of the monitor is + /// subdomain.Region.deadlinecloud.amazonaws.com. + final String url; + + /// The UNIX timestamp of the last date and time that the monitor was updated. + final DateTime? updatedAt; + + /// The user name of the person that last updated the monitor. + final String? updatedBy; + + GetMonitorResponse({ + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.identityCenterApplicationArn, + required this.identityCenterInstanceArn, + required this.monitorId, + required this.roleArn, + required this.subdomain, + required this.url, + this.updatedAt, + this.updatedBy, + }); + + factory GetMonitorResponse.fromJson(Map json) { + return GetMonitorResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + identityCenterApplicationArn: + json['identityCenterApplicationArn'] as String, + identityCenterInstanceArn: json['identityCenterInstanceArn'] as String, + monitorId: json['monitorId'] as String, + roleArn: json['roleArn'] as String, + subdomain: json['subdomain'] as String, + url: json['url'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final identityCenterApplicationArn = this.identityCenterApplicationArn; + final identityCenterInstanceArn = this.identityCenterInstanceArn; + final monitorId = this.monitorId; + final roleArn = this.roleArn; + final subdomain = this.subdomain; + final url = this.url; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'identityCenterApplicationArn': identityCenterApplicationArn, + 'identityCenterInstanceArn': identityCenterInstanceArn, + 'monitorId': monitorId, + 'roleArn': roleArn, + 'subdomain': subdomain, + 'url': url, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetQueueEnvironmentResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource.> + final String createdBy; + + /// The name of the queue environment. + final String name; + + /// The priority of the queue environment. + final int priority; + + /// The queue environment ID. + final String queueEnvironmentId; + + /// The template for the queue environment. + final String template; + + /// The type of template for the queue environment. + final EnvironmentTemplateType templateType; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetQueueEnvironmentResponse({ + required this.createdAt, + required this.createdBy, + required this.name, + required this.priority, + required this.queueEnvironmentId, + required this.template, + required this.templateType, + this.updatedAt, + this.updatedBy, + }); + + factory GetQueueEnvironmentResponse.fromJson(Map json) { + return GetQueueEnvironmentResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + name: json['name'] as String, + priority: json['priority'] as int, + queueEnvironmentId: json['queueEnvironmentId'] as String, + template: json['template'] as String, + templateType: + (json['templateType'] as String).toEnvironmentTemplateType(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final name = this.name; + final priority = this.priority; + final queueEnvironmentId = this.queueEnvironmentId; + final template = this.template; + final templateType = this.templateType; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'name': name, + 'priority': priority, + 'queueEnvironmentId': queueEnvironmentId, + 'template': template, + 'templateType': templateType.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetQueueFleetAssociationResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The fleet ID for the queue-fleet association. + final String fleetId; + + /// The queue ID for the queue-fleet association. + final String queueId; + + /// The status of the queue-fleet association. + final QueueFleetAssociationStatus status; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetQueueFleetAssociationResponse({ + required this.createdAt, + required this.createdBy, + required this.fleetId, + required this.queueId, + required this.status, + this.updatedAt, + this.updatedBy, + }); + + factory GetQueueFleetAssociationResponse.fromJson(Map json) { + return GetQueueFleetAssociationResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + fleetId: json['fleetId'] as String, + queueId: json['queueId'] as String, + status: (json['status'] as String).toQueueFleetAssociationStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final fleetId = this.fleetId; + final queueId = this.queueId; + final status = this.status; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'fleetId': fleetId, + 'queueId': queueId, + 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetQueueResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The default action taken on a queue if a budget wasn't configured. + final DefaultQueueBudgetAction defaultBudgetAction; + + /// The display name of the queue. + final String displayName; + + /// The farm ID for the queue. + final String farmId; + + /// The queue ID. + final String queueId; + + /// The status of the queue. + /// + ///
        + ///
      • + /// ACTIVE–The queue is active. + ///
      • + ///
      • + /// SCHEDULING–The queue is scheduling. + ///
      • + ///
      • + /// SCHEDULING_BLOCKED–The queue scheduling is blocked. See the + /// provided reason. + ///
      • + ///
      + final QueueStatus status; + + /// The storage profile IDs for the queue. + final List? allowedStorageProfileIds; + + /// The reason the queue was blocked. + final QueueBlockedReason? blockedReason; + + /// The description of the queue. + final String? description; + + /// The job attachment settings for the queue. + final JobAttachmentSettings? jobAttachmentSettings; + + /// The jobs in the queue ran as this specified POSIX user. + final JobRunAsUser? jobRunAsUser; + + /// A list of the required file system location names in the queue. + final List? requiredFileSystemLocationNames; + + /// The IAM role ARN. + final String? roleArn; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetQueueResponse({ + required this.createdAt, + required this.createdBy, + required this.defaultBudgetAction, + required this.displayName, + required this.farmId, + required this.queueId, + required this.status, + this.allowedStorageProfileIds, + this.blockedReason, + this.description, + this.jobAttachmentSettings, + this.jobRunAsUser, + this.requiredFileSystemLocationNames, + this.roleArn, + this.updatedAt, + this.updatedBy, + }); + + factory GetQueueResponse.fromJson(Map json) { + return GetQueueResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + defaultBudgetAction: + (json['defaultBudgetAction'] as String).toDefaultQueueBudgetAction(), + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + queueId: json['queueId'] as String, + status: (json['status'] as String).toQueueStatus(), + allowedStorageProfileIds: (json['allowedStorageProfileIds'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + blockedReason: (json['blockedReason'] as String?)?.toQueueBlockedReason(), + description: json['description'] as String?, + jobAttachmentSettings: json['jobAttachmentSettings'] != null + ? JobAttachmentSettings.fromJson( + json['jobAttachmentSettings'] as Map) + : null, + jobRunAsUser: json['jobRunAsUser'] != null + ? JobRunAsUser.fromJson(json['jobRunAsUser'] as Map) + : null, + requiredFileSystemLocationNames: + (json['requiredFileSystemLocationNames'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + roleArn: json['roleArn'] as String?, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final defaultBudgetAction = this.defaultBudgetAction; + final displayName = this.displayName; + final farmId = this.farmId; + final queueId = this.queueId; + final status = this.status; + final allowedStorageProfileIds = this.allowedStorageProfileIds; + final blockedReason = this.blockedReason; + final description = this.description; + final jobAttachmentSettings = this.jobAttachmentSettings; + final jobRunAsUser = this.jobRunAsUser; + final requiredFileSystemLocationNames = + this.requiredFileSystemLocationNames; + final roleArn = this.roleArn; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'defaultBudgetAction': defaultBudgetAction.toValue(), + 'displayName': displayName, + 'farmId': farmId, + 'queueId': queueId, + 'status': status.toValue(), + if (allowedStorageProfileIds != null) + 'allowedStorageProfileIds': allowedStorageProfileIds, + if (blockedReason != null) 'blockedReason': blockedReason.toValue(), + if (description != null) 'description': description, + if (jobAttachmentSettings != null) + 'jobAttachmentSettings': jobAttachmentSettings, + if (jobRunAsUser != null) 'jobRunAsUser': jobRunAsUser, + if (requiredFileSystemLocationNames != null) + 'requiredFileSystemLocationNames': requiredFileSystemLocationNames, + if (roleArn != null) 'roleArn': roleArn, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetSessionActionResponse { + /// The session action definition. + final SessionActionDefinition definition; + + /// The session action ID. + final String sessionActionId; + + /// The session ID for the session action. + final String sessionId; + + /// The status of the session action. + final SessionActionStatus status; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The exit code to exit the session. + final int? processExitCode; + + /// The message that communicates the progress of the session action. + final String? progressMessage; + + /// The percentage completed for a session action. + final double? progressPercent; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The Linux timestamp of the date and time the session action was last + /// updated. + final DateTime? workerUpdatedAt; + + GetSessionActionResponse({ + required this.definition, + required this.sessionActionId, + required this.sessionId, + required this.status, + this.endedAt, + this.processExitCode, + this.progressMessage, + this.progressPercent, + this.startedAt, + this.workerUpdatedAt, + }); + + factory GetSessionActionResponse.fromJson(Map json) { + return GetSessionActionResponse( + definition: SessionActionDefinition.fromJson( + json['definition'] as Map), + sessionActionId: json['sessionActionId'] as String, + sessionId: json['sessionId'] as String, + status: (json['status'] as String).toSessionActionStatus(), + endedAt: timeStampFromJson(json['endedAt']), + processExitCode: json['processExitCode'] as int?, + progressMessage: json['progressMessage'] as String?, + progressPercent: json['progressPercent'] as double?, + startedAt: timeStampFromJson(json['startedAt']), + workerUpdatedAt: timeStampFromJson(json['workerUpdatedAt']), + ); + } + + Map toJson() { + final definition = this.definition; + final sessionActionId = this.sessionActionId; + final sessionId = this.sessionId; + final status = this.status; + final endedAt = this.endedAt; + final processExitCode = this.processExitCode; + final progressMessage = this.progressMessage; + final progressPercent = this.progressPercent; + final startedAt = this.startedAt; + final workerUpdatedAt = this.workerUpdatedAt; + return { + 'definition': definition, + 'sessionActionId': sessionActionId, + 'sessionId': sessionId, + 'status': status.toValue(), + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (processExitCode != null) 'processExitCode': processExitCode, + if (progressMessage != null) 'progressMessage': progressMessage, + if (progressPercent != null) 'progressPercent': progressPercent, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (workerUpdatedAt != null) + 'workerUpdatedAt': iso8601ToJson(workerUpdatedAt), + }; + } +} + +class GetSessionResponse { + /// The fleet ID for the session. + final String fleetId; + + /// The life cycle status of the session. + final SessionLifecycleStatus lifecycleStatus; + + /// The session log. + final LogConfiguration log; + + /// The session ID. + final String sessionId; + + /// The date and time the resource started running. + final DateTime startedAt; + + /// The worker ID for the session. + final String workerId; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// Provides the Amazon EC2 properties of the host. + final HostPropertiesResponse? hostProperties; + + /// The life cycle status with which the session started. + final SessionLifecycleTargetStatus? targetLifecycleStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + /// The worker log for the session. + final LogConfiguration? workerLog; + + GetSessionResponse({ + required this.fleetId, + required this.lifecycleStatus, + required this.log, + required this.sessionId, + required this.startedAt, + required this.workerId, + this.endedAt, + this.hostProperties, + this.targetLifecycleStatus, + this.updatedAt, + this.updatedBy, + this.workerLog, + }); + + factory GetSessionResponse.fromJson(Map json) { + return GetSessionResponse( + fleetId: json['fleetId'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toSessionLifecycleStatus(), + log: LogConfiguration.fromJson(json['log'] as Map), + sessionId: json['sessionId'] as String, + startedAt: nonNullableTimeStampFromJson(json['startedAt'] as Object), + workerId: json['workerId'] as String, + endedAt: timeStampFromJson(json['endedAt']), + hostProperties: json['hostProperties'] != null + ? HostPropertiesResponse.fromJson( + json['hostProperties'] as Map) + : null, + targetLifecycleStatus: (json['targetLifecycleStatus'] as String?) + ?.toSessionLifecycleTargetStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + workerLog: json['workerLog'] != null + ? LogConfiguration.fromJson(json['workerLog'] as Map) + : null, + ); + } + + Map toJson() { + final fleetId = this.fleetId; + final lifecycleStatus = this.lifecycleStatus; + final log = this.log; + final sessionId = this.sessionId; + final startedAt = this.startedAt; + final workerId = this.workerId; + final endedAt = this.endedAt; + final hostProperties = this.hostProperties; + final targetLifecycleStatus = this.targetLifecycleStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + final workerLog = this.workerLog; + return { + 'fleetId': fleetId, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'log': log, + 'sessionId': sessionId, + 'startedAt': iso8601ToJson(startedAt), + 'workerId': workerId, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (hostProperties != null) 'hostProperties': hostProperties, + if (targetLifecycleStatus != null) + 'targetLifecycleStatus': targetLifecycleStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + if (workerLog != null) 'workerLog': workerLog, + }; + } +} + +class GetSessionsStatisticsAggregationResponse { + /// The status of the aggregated results. + final SessionsStatisticsAggregationStatus status; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + /// The statistics for the specified fleets or queues. + final List? statistics; + + /// A message that describes the status. + final String? statusMessage; + + GetSessionsStatisticsAggregationResponse({ + required this.status, + this.nextToken, + this.statistics, + this.statusMessage, + }); + + factory GetSessionsStatisticsAggregationResponse.fromJson( + Map json) { + return GetSessionsStatisticsAggregationResponse( + status: + (json['status'] as String).toSessionsStatisticsAggregationStatus(), + nextToken: json['nextToken'] as String?, + statistics: (json['statistics'] as List?) + ?.whereNotNull() + .map((e) => Statistics.fromJson(e as Map)) + .toList(), + statusMessage: json['statusMessage'] as String?, + ); + } + + Map toJson() { + final status = this.status; + final nextToken = this.nextToken; + final statistics = this.statistics; + final statusMessage = this.statusMessage; + return { + 'status': status.toValue(), + if (nextToken != null) 'nextToken': nextToken, + if (statistics != null) 'statistics': statistics, + if (statusMessage != null) 'statusMessage': statusMessage, + }; + } +} + +class GetStepResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The life cycle status of the step. + final StepLifecycleStatus lifecycleStatus; + + /// The name of the step. + final String name; + + /// The step ID. + final String stepId; + + /// The task run status for the job. + final TaskRunStatus taskRunStatus; + + /// The number of tasks running on the job. + final Map taskRunStatusCounts; + + /// The number of dependencies in the step. + final DependencyCounts? dependencyCounts; + + /// The description of the step. + final String? description; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// A message that describes the lifecycle status of the step. + final String? lifecycleStatusMessage; + + /// A list of step parameters and the combination expression for the step. + final ParameterSpace? parameterSpace; + + /// The required capabilities of the step. + final StepRequiredCapabilities? requiredCapabilities; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The task status with which the job started. + final StepTargetTaskRunStatus? targetTaskRunStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetStepResponse({ + required this.createdAt, + required this.createdBy, + required this.lifecycleStatus, + required this.name, + required this.stepId, + required this.taskRunStatus, + required this.taskRunStatusCounts, + this.dependencyCounts, + this.description, + this.endedAt, + this.lifecycleStatusMessage, + this.parameterSpace, + this.requiredCapabilities, + this.startedAt, + this.targetTaskRunStatus, + this.updatedAt, + this.updatedBy, + }); + + factory GetStepResponse.fromJson(Map json) { + return GetStepResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toStepLifecycleStatus(), + name: json['name'] as String, + stepId: json['stepId'] as String, + taskRunStatus: (json['taskRunStatus'] as String).toTaskRunStatus(), + taskRunStatusCounts: (json['taskRunStatusCounts'] as Map) + .map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + dependencyCounts: json['dependencyCounts'] != null + ? DependencyCounts.fromJson( + json['dependencyCounts'] as Map) + : null, + description: json['description'] as String?, + endedAt: timeStampFromJson(json['endedAt']), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String?, + parameterSpace: json['parameterSpace'] != null + ? ParameterSpace.fromJson( + json['parameterSpace'] as Map) + : null, + requiredCapabilities: json['requiredCapabilities'] != null + ? StepRequiredCapabilities.fromJson( + json['requiredCapabilities'] as Map) + : null, + startedAt: timeStampFromJson(json['startedAt']), + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toStepTargetTaskRunStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final lifecycleStatus = this.lifecycleStatus; + final name = this.name; + final stepId = this.stepId; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + final dependencyCounts = this.dependencyCounts; + final description = this.description; + final endedAt = this.endedAt; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final parameterSpace = this.parameterSpace; + final requiredCapabilities = this.requiredCapabilities; + final startedAt = this.startedAt; + final targetTaskRunStatus = this.targetTaskRunStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'name': name, + 'stepId': stepId, + 'taskRunStatus': taskRunStatus.toValue(), + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + if (dependencyCounts != null) 'dependencyCounts': dependencyCounts, + if (description != null) 'description': description, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (lifecycleStatusMessage != null) + 'lifecycleStatusMessage': lifecycleStatusMessage, + if (parameterSpace != null) 'parameterSpace': parameterSpace, + if (requiredCapabilities != null) + 'requiredCapabilities': requiredCapabilities, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetStorageProfileForQueueResponse { + /// The display name of the storage profile connected to a queue. + final String displayName; + + /// The operating system of the storage profile in the queue. + final StorageProfileOperatingSystemFamily osFamily; + + /// The storage profile ID. + final String storageProfileId; + + /// The location of the files for the storage profile within the queue. + final List? fileSystemLocations; + + GetStorageProfileForQueueResponse({ + required this.displayName, + required this.osFamily, + required this.storageProfileId, + this.fileSystemLocations, + }); + + factory GetStorageProfileForQueueResponse.fromJson( + Map json) { + return GetStorageProfileForQueueResponse( + displayName: json['displayName'] as String, + osFamily: + (json['osFamily'] as String).toStorageProfileOperatingSystemFamily(), + storageProfileId: json['storageProfileId'] as String, + fileSystemLocations: (json['fileSystemLocations'] as List?) + ?.whereNotNull() + .map((e) => FileSystemLocation.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final displayName = this.displayName; + final osFamily = this.osFamily; + final storageProfileId = this.storageProfileId; + final fileSystemLocations = this.fileSystemLocations; + return { + 'displayName': displayName, + 'osFamily': osFamily.toValue(), + 'storageProfileId': storageProfileId, + if (fileSystemLocations != null) + 'fileSystemLocations': fileSystemLocations, + }; + } +} + +class GetStorageProfileResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The display name of the storage profile. + final String displayName; + + /// The operating system (OS) for the storage profile. + final StorageProfileOperatingSystemFamily osFamily; + + /// The storage profile ID. + final String storageProfileId; + + /// The location of the files for the storage profile. + final List? fileSystemLocations; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetStorageProfileResponse({ + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.osFamily, + required this.storageProfileId, + this.fileSystemLocations, + this.updatedAt, + this.updatedBy, + }); + + factory GetStorageProfileResponse.fromJson(Map json) { + return GetStorageProfileResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + osFamily: + (json['osFamily'] as String).toStorageProfileOperatingSystemFamily(), + storageProfileId: json['storageProfileId'] as String, + fileSystemLocations: (json['fileSystemLocations'] as List?) + ?.whereNotNull() + .map((e) => FileSystemLocation.fromJson(e as Map)) + .toList(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final osFamily = this.osFamily; + final storageProfileId = this.storageProfileId; + final fileSystemLocations = this.fileSystemLocations; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'osFamily': osFamily.toValue(), + 'storageProfileId': storageProfileId, + if (fileSystemLocations != null) + 'fileSystemLocations': fileSystemLocations, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetTaskResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The run status for the task. + final TaskRunStatus runStatus; + + /// The task ID. + final String taskId; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The number of times that the task failed and was retried. + final int? failureRetryCount; + + /// The latest session ID for the task. + final String? latestSessionActionId; + + /// The parameters for the task. + final Map? parameters; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The run status with which to start the task. + final TaskTargetRunStatus? targetRunStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetTaskResponse({ + required this.createdAt, + required this.createdBy, + required this.runStatus, + required this.taskId, + this.endedAt, + this.failureRetryCount, + this.latestSessionActionId, + this.parameters, + this.startedAt, + this.targetRunStatus, + this.updatedAt, + this.updatedBy, + }); + + factory GetTaskResponse.fromJson(Map json) { + return GetTaskResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + runStatus: (json['runStatus'] as String).toTaskRunStatus(), + taskId: json['taskId'] as String, + endedAt: timeStampFromJson(json['endedAt']), + failureRetryCount: json['failureRetryCount'] as int?, + latestSessionActionId: json['latestSessionActionId'] as String?, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, TaskParameterValue.fromJson(e as Map))), + startedAt: timeStampFromJson(json['startedAt']), + targetRunStatus: + (json['targetRunStatus'] as String?)?.toTaskTargetRunStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final runStatus = this.runStatus; + final taskId = this.taskId; + final endedAt = this.endedAt; + final failureRetryCount = this.failureRetryCount; + final latestSessionActionId = this.latestSessionActionId; + final parameters = this.parameters; + final startedAt = this.startedAt; + final targetRunStatus = this.targetRunStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'runStatus': runStatus.toValue(), + 'taskId': taskId, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (failureRetryCount != null) 'failureRetryCount': failureRetryCount, + if (latestSessionActionId != null) + 'latestSessionActionId': latestSessionActionId, + if (parameters != null) 'parameters': parameters, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetRunStatus != null) 'targetRunStatus': targetRunStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class GetWorkerResponse { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The farm ID. + final String farmId; + + /// The fleet ID. + final String fleetId; + + /// The status of the worker. + final WorkerStatus status; + + /// The worker ID. + final String workerId; + + /// The host properties for the worker. + final HostPropertiesResponse? hostProperties; + + /// The logs for the associated worker. + final LogConfiguration? log; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + GetWorkerResponse({ + required this.createdAt, + required this.createdBy, + required this.farmId, + required this.fleetId, + required this.status, + required this.workerId, + this.hostProperties, + this.log, + this.updatedAt, + this.updatedBy, + }); + + factory GetWorkerResponse.fromJson(Map json) { + return GetWorkerResponse( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + farmId: json['farmId'] as String, + fleetId: json['fleetId'] as String, + status: (json['status'] as String).toWorkerStatus(), + workerId: json['workerId'] as String, + hostProperties: json['hostProperties'] != null + ? HostPropertiesResponse.fromJson( + json['hostProperties'] as Map) + : null, + log: json['log'] != null + ? LogConfiguration.fromJson(json['log'] as Map) + : null, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final farmId = this.farmId; + final fleetId = this.fleetId; + final status = this.status; + final workerId = this.workerId; + final hostProperties = this.hostProperties; + final log = this.log; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'farmId': farmId, + 'fleetId': fleetId, + 'status': status.toValue(), + 'workerId': workerId, + if (hostProperties != null) 'hostProperties': hostProperties, + if (log != null) 'log': log, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The host property details. +class HostPropertiesRequest { + /// The host name. + final String? hostName; + + /// The IP address of the host. + final IpAddresses? ipAddresses; + + HostPropertiesRequest({ + this.hostName, + this.ipAddresses, + }); + + Map toJson() { + final hostName = this.hostName; + final ipAddresses = this.ipAddresses; + return { + if (hostName != null) 'hostName': hostName, + if (ipAddresses != null) 'ipAddresses': ipAddresses, + }; + } +} + +/// The host property details. +class HostPropertiesResponse { + /// The ARN of the host EC2 instance. + final String? ec2InstanceArn; + + /// The instance type of the host EC2 instance. + final String? ec2InstanceType; + + /// The host name. + final String? hostName; + + /// The IP address of the host. + final IpAddresses? ipAddresses; + + HostPropertiesResponse({ + this.ec2InstanceArn, + this.ec2InstanceType, + this.hostName, + this.ipAddresses, + }); + + factory HostPropertiesResponse.fromJson(Map json) { + return HostPropertiesResponse( + ec2InstanceArn: json['ec2InstanceArn'] as String?, + ec2InstanceType: json['ec2InstanceType'] as String?, + hostName: json['hostName'] as String?, + ipAddresses: json['ipAddresses'] != null + ? IpAddresses.fromJson(json['ipAddresses'] as Map) + : null, + ); + } + + Map toJson() { + final ec2InstanceArn = this.ec2InstanceArn; + final ec2InstanceType = this.ec2InstanceType; + final hostName = this.hostName; + final ipAddresses = this.ipAddresses; + return { + if (ec2InstanceArn != null) 'ec2InstanceArn': ec2InstanceArn, + if (ec2InstanceType != null) 'ec2InstanceType': ec2InstanceType, + if (hostName != null) 'hostName': hostName, + if (ipAddresses != null) 'ipAddresses': ipAddresses, + }; + } +} + +/// The IP addresses for a host. +class IpAddresses { + /// The IpV4 address of the network. + final List? ipV4Addresses; + + /// The IpV6 address for the network and node component. + final List? ipV6Addresses; + + IpAddresses({ + this.ipV4Addresses, + this.ipV6Addresses, + }); + + factory IpAddresses.fromJson(Map json) { + return IpAddresses( + ipV4Addresses: (json['ipV4Addresses'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ipV6Addresses: (json['ipV6Addresses'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final ipV4Addresses = this.ipV4Addresses; + final ipV6Addresses = this.ipV6Addresses; + return { + if (ipV4Addresses != null) 'ipV4Addresses': ipV4Addresses, + if (ipV6Addresses != null) 'ipV6Addresses': ipV6Addresses, + }; + } +} + +/// The job attachments. +class JobAttachmentDetailsEntity { + /// The job attachments. + final Attachments attachments; + + /// The job ID. + final String jobId; + + JobAttachmentDetailsEntity({ + required this.attachments, + required this.jobId, + }); + + factory JobAttachmentDetailsEntity.fromJson(Map json) { + return JobAttachmentDetailsEntity( + attachments: + Attachments.fromJson(json['attachments'] as Map), + jobId: json['jobId'] as String, + ); + } + + Map toJson() { + final attachments = this.attachments; + final jobId = this.jobId; + return { + 'attachments': attachments, + 'jobId': jobId, + }; + } +} + +/// The error details for job attachments. +class JobAttachmentDetailsError { + /// The error code. + final JobEntityErrorCode code; + + /// The job ID. + final String jobId; + + /// The error message detailing the error's cause. + final String message; + + JobAttachmentDetailsError({ + required this.code, + required this.jobId, + required this.message, + }); + + factory JobAttachmentDetailsError.fromJson(Map json) { + return JobAttachmentDetailsError( + code: (json['code'] as String).toJobEntityErrorCode(), + jobId: json['jobId'] as String, + message: json['message'] as String, + ); + } + + Map toJson() { + final code = this.code; + final jobId = this.jobId; + final message = this.message; + return { + 'code': code.toValue(), + 'jobId': jobId, + 'message': message, + }; + } +} + +/// Identifier details for job attachments. +class JobAttachmentDetailsIdentifiers { + /// The job ID. + final String jobId; + + JobAttachmentDetailsIdentifiers({ + required this.jobId, + }); + + Map toJson() { + final jobId = this.jobId; + return { + 'jobId': jobId, + }; + } +} + +/// The job attachment settings. These are the Amazon S3 bucket name and the +/// Amazon S3 prefix. +class JobAttachmentSettings { + /// The root prefix. + final String rootPrefix; + + /// The Amazon S3 bucket name. + final String s3BucketName; + + JobAttachmentSettings({ + required this.rootPrefix, + required this.s3BucketName, + }); + + factory JobAttachmentSettings.fromJson(Map json) { + return JobAttachmentSettings( + rootPrefix: json['rootPrefix'] as String, + s3BucketName: json['s3BucketName'] as String, + ); + } + + Map toJson() { + final rootPrefix = this.rootPrefix; + final s3BucketName = this.s3BucketName; + return { + 'rootPrefix': rootPrefix, + 's3BucketName': s3BucketName, + }; + } +} + +enum JobAttachmentsFileSystem { + copied, + virtual, +} + +extension JobAttachmentsFileSystemValueExtension on JobAttachmentsFileSystem { + String toValue() { + switch (this) { + case JobAttachmentsFileSystem.copied: + return 'COPIED'; + case JobAttachmentsFileSystem.virtual: + return 'VIRTUAL'; + } + } +} + +extension JobAttachmentsFileSystemFromString on String { + JobAttachmentsFileSystem toJobAttachmentsFileSystem() { + switch (this) { + case 'COPIED': + return JobAttachmentsFileSystem.copied; + case 'VIRTUAL': + return JobAttachmentsFileSystem.virtual; + } + throw Exception('$this is not known in enum JobAttachmentsFileSystem'); + } +} + +/// The job details for a specific job. +class JobDetailsEntity { + /// The job ID. + final String jobId; + + /// The log group name. + final String logGroupName; + + /// The schema version. + final String schemaVersion; + + /// The job attachment settings. + final JobAttachmentSettings? jobAttachmentSettings; + + /// The user name and group that the job uses when run. + final JobRunAsUser? jobRunAsUser; + + /// The parameters. + final Map? parameters; + + /// The path mapping rules. + final List? pathMappingRules; + + /// The queue role ARN. + final String? queueRoleArn; + + JobDetailsEntity({ + required this.jobId, + required this.logGroupName, + required this.schemaVersion, + this.jobAttachmentSettings, + this.jobRunAsUser, + this.parameters, + this.pathMappingRules, + this.queueRoleArn, + }); + + factory JobDetailsEntity.fromJson(Map json) { + return JobDetailsEntity( + jobId: json['jobId'] as String, + logGroupName: json['logGroupName'] as String, + schemaVersion: json['schemaVersion'] as String, + jobAttachmentSettings: json['jobAttachmentSettings'] != null + ? JobAttachmentSettings.fromJson( + json['jobAttachmentSettings'] as Map) + : null, + jobRunAsUser: json['jobRunAsUser'] != null + ? JobRunAsUser.fromJson(json['jobRunAsUser'] as Map) + : null, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, JobParameter.fromJson(e as Map))), + pathMappingRules: (json['pathMappingRules'] as List?) + ?.whereNotNull() + .map((e) => PathMappingRule.fromJson(e as Map)) + .toList(), + queueRoleArn: json['queueRoleArn'] as String?, + ); + } + + Map toJson() { + final jobId = this.jobId; + final logGroupName = this.logGroupName; + final schemaVersion = this.schemaVersion; + final jobAttachmentSettings = this.jobAttachmentSettings; + final jobRunAsUser = this.jobRunAsUser; + final parameters = this.parameters; + final pathMappingRules = this.pathMappingRules; + final queueRoleArn = this.queueRoleArn; + return { + 'jobId': jobId, + 'logGroupName': logGroupName, + 'schemaVersion': schemaVersion, + if (jobAttachmentSettings != null) + 'jobAttachmentSettings': jobAttachmentSettings, + if (jobRunAsUser != null) 'jobRunAsUser': jobRunAsUser, + if (parameters != null) 'parameters': parameters, + if (pathMappingRules != null) 'pathMappingRules': pathMappingRules, + if (queueRoleArn != null) 'queueRoleArn': queueRoleArn, + }; + } +} + +/// The details of a job error. +class JobDetailsError { + /// The error code. + final JobEntityErrorCode code; + + /// The job ID. + final String jobId; + + /// The error message detailing the error's cause. + final String message; + + JobDetailsError({ + required this.code, + required this.jobId, + required this.message, + }); + + factory JobDetailsError.fromJson(Map json) { + return JobDetailsError( + code: (json['code'] as String).toJobEntityErrorCode(), + jobId: json['jobId'] as String, + message: json['message'] as String, + ); + } + + Map toJson() { + final code = this.code; + final jobId = this.jobId; + final message = this.message; + return { + 'code': code.toValue(), + 'jobId': jobId, + 'message': message, + }; + } +} + +/// The identifiers for a job. +class JobDetailsIdentifiers { + /// The job ID. + final String jobId; + + JobDetailsIdentifiers({ + required this.jobId, + }); + + Map toJson() { + final jobId = this.jobId; + return { + 'jobId': jobId, + }; + } +} + +/// The details of a job entity. +class JobEntity { + /// The environment details for the job entity. + final EnvironmentDetailsEntity? environmentDetails; + + /// The job attachment details. + final JobAttachmentDetailsEntity? jobAttachmentDetails; + + /// The job details. + final JobDetailsEntity? jobDetails; + + /// The step details. + final StepDetailsEntity? stepDetails; + + JobEntity({ + this.environmentDetails, + this.jobAttachmentDetails, + this.jobDetails, + this.stepDetails, + }); + + factory JobEntity.fromJson(Map json) { + return JobEntity( + environmentDetails: json['environmentDetails'] != null + ? EnvironmentDetailsEntity.fromJson( + json['environmentDetails'] as Map) + : null, + jobAttachmentDetails: json['jobAttachmentDetails'] != null + ? JobAttachmentDetailsEntity.fromJson( + json['jobAttachmentDetails'] as Map) + : null, + jobDetails: json['jobDetails'] != null + ? JobDetailsEntity.fromJson( + json['jobDetails'] as Map) + : null, + stepDetails: json['stepDetails'] != null + ? StepDetailsEntity.fromJson( + json['stepDetails'] as Map) + : null, + ); + } + + Map toJson() { + final environmentDetails = this.environmentDetails; + final jobAttachmentDetails = this.jobAttachmentDetails; + final jobDetails = this.jobDetails; + final stepDetails = this.stepDetails; + return { + if (environmentDetails != null) 'environmentDetails': environmentDetails, + if (jobAttachmentDetails != null) + 'jobAttachmentDetails': jobAttachmentDetails, + if (jobDetails != null) 'jobDetails': jobDetails, + if (stepDetails != null) 'stepDetails': stepDetails, + }; + } +} + +enum JobEntityErrorCode { + accessDeniedException, + internalServerException, + validationException, + resourceNotFoundException, + maxPayloadSizeExceeded, + conflictException, +} + +extension JobEntityErrorCodeValueExtension on JobEntityErrorCode { + String toValue() { + switch (this) { + case JobEntityErrorCode.accessDeniedException: + return 'AccessDeniedException'; + case JobEntityErrorCode.internalServerException: + return 'InternalServerException'; + case JobEntityErrorCode.validationException: + return 'ValidationException'; + case JobEntityErrorCode.resourceNotFoundException: + return 'ResourceNotFoundException'; + case JobEntityErrorCode.maxPayloadSizeExceeded: + return 'MaxPayloadSizeExceeded'; + case JobEntityErrorCode.conflictException: + return 'ConflictException'; + } + } +} + +extension JobEntityErrorCodeFromString on String { + JobEntityErrorCode toJobEntityErrorCode() { + switch (this) { + case 'AccessDeniedException': + return JobEntityErrorCode.accessDeniedException; + case 'InternalServerException': + return JobEntityErrorCode.internalServerException; + case 'ValidationException': + return JobEntityErrorCode.validationException; + case 'ResourceNotFoundException': + return JobEntityErrorCode.resourceNotFoundException; + case 'MaxPayloadSizeExceeded': + return JobEntityErrorCode.maxPayloadSizeExceeded; + case 'ConflictException': + return JobEntityErrorCode.conflictException; + } + throw Exception('$this is not known in enum JobEntityErrorCode'); + } +} + +/// The details of a job entity identifier. +class JobEntityIdentifiersUnion { + /// The environment details. + final EnvironmentDetailsIdentifiers? environmentDetails; + + /// The job attachment details. + final JobAttachmentDetailsIdentifiers? jobAttachmentDetails; + + /// The job details. + final JobDetailsIdentifiers? jobDetails; + + /// The step details. + final StepDetailsIdentifiers? stepDetails; + + JobEntityIdentifiersUnion({ + this.environmentDetails, + this.jobAttachmentDetails, + this.jobDetails, + this.stepDetails, + }); + + Map toJson() { + final environmentDetails = this.environmentDetails; + final jobAttachmentDetails = this.jobAttachmentDetails; + final jobDetails = this.jobDetails; + final stepDetails = this.stepDetails; + return { + if (environmentDetails != null) 'environmentDetails': environmentDetails, + if (jobAttachmentDetails != null) + 'jobAttachmentDetails': jobAttachmentDetails, + if (jobDetails != null) 'jobDetails': jobDetails, + if (stepDetails != null) 'stepDetails': stepDetails, + }; + } +} + +enum JobLifecycleStatus { + createInProgress, + createFailed, + createComplete, + uploadInProgress, + uploadFailed, + updateInProgress, + updateFailed, + updateSucceeded, + archived, +} + +extension JobLifecycleStatusValueExtension on JobLifecycleStatus { + String toValue() { + switch (this) { + case JobLifecycleStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case JobLifecycleStatus.createFailed: + return 'CREATE_FAILED'; + case JobLifecycleStatus.createComplete: + return 'CREATE_COMPLETE'; + case JobLifecycleStatus.uploadInProgress: + return 'UPLOAD_IN_PROGRESS'; + case JobLifecycleStatus.uploadFailed: + return 'UPLOAD_FAILED'; + case JobLifecycleStatus.updateInProgress: + return 'UPDATE_IN_PROGRESS'; + case JobLifecycleStatus.updateFailed: + return 'UPDATE_FAILED'; + case JobLifecycleStatus.updateSucceeded: + return 'UPDATE_SUCCEEDED'; + case JobLifecycleStatus.archived: + return 'ARCHIVED'; + } + } +} + +extension JobLifecycleStatusFromString on String { + JobLifecycleStatus toJobLifecycleStatus() { + switch (this) { + case 'CREATE_IN_PROGRESS': + return JobLifecycleStatus.createInProgress; + case 'CREATE_FAILED': + return JobLifecycleStatus.createFailed; + case 'CREATE_COMPLETE': + return JobLifecycleStatus.createComplete; + case 'UPLOAD_IN_PROGRESS': + return JobLifecycleStatus.uploadInProgress; + case 'UPLOAD_FAILED': + return JobLifecycleStatus.uploadFailed; + case 'UPDATE_IN_PROGRESS': + return JobLifecycleStatus.updateInProgress; + case 'UPDATE_FAILED': + return JobLifecycleStatus.updateFailed; + case 'UPDATE_SUCCEEDED': + return JobLifecycleStatus.updateSucceeded; + case 'ARCHIVED': + return JobLifecycleStatus.archived; + } + throw Exception('$this is not known in enum JobLifecycleStatus'); + } +} + +/// The details for a job member. +class JobMember { + /// The farm ID. + final String farmId; + + /// The identity store ID. + final String identityStoreId; + + /// The job ID. + final String jobId; + + /// The job member's membership level. + final MembershipLevel membershipLevel; + + /// The principal ID of the job member. + final String principalId; + + /// The principal type of the job member. + final PrincipalType principalType; + + /// The queue ID. + final String queueId; + + JobMember({ + required this.farmId, + required this.identityStoreId, + required this.jobId, + required this.membershipLevel, + required this.principalId, + required this.principalType, + required this.queueId, + }); + + factory JobMember.fromJson(Map json) { + return JobMember( + farmId: json['farmId'] as String, + identityStoreId: json['identityStoreId'] as String, + jobId: json['jobId'] as String, + membershipLevel: (json['membershipLevel'] as String).toMembershipLevel(), + principalId: json['principalId'] as String, + principalType: (json['principalType'] as String).toPrincipalType(), + queueId: json['queueId'] as String, + ); + } + + Map toJson() { + final farmId = this.farmId; + final identityStoreId = this.identityStoreId; + final jobId = this.jobId; + final membershipLevel = this.membershipLevel; + final principalId = this.principalId; + final principalType = this.principalType; + final queueId = this.queueId; + return { + 'farmId': farmId, + 'identityStoreId': identityStoreId, + 'jobId': jobId, + 'membershipLevel': membershipLevel.toValue(), + 'principalId': principalId, + 'principalType': principalType.toValue(), + 'queueId': queueId, + }; + } +} + +/// The details of job parameters. +class JobParameter { + /// A double precision IEEE-754 floating point number represented as a string. + final String? float; + + /// A signed integer represented as a string. + final String? intValue; + + /// A file system path represented as a string. + final String? path; + + /// A UTF-8 string. + final String? string; + + JobParameter({ + this.float, + this.intValue, + this.path, + this.string, + }); + + factory JobParameter.fromJson(Map json) { + return JobParameter( + float: json['float'] as String?, + intValue: json['int'] as String?, + path: json['path'] as String?, + string: json['string'] as String?, + ); + } + + Map toJson() { + final float = this.float; + final intValue = this.intValue; + final path = this.path; + final string = this.string; + return { + if (float != null) 'float': float, + if (intValue != null) 'int': intValue, + if (path != null) 'path': path, + if (string != null) 'string': string, + }; + } +} + +/// Identifies the user for a job. +class JobRunAsUser { + /// Specifies whether the job should run using the queue's system user or if the + /// job should run using the worker agent system user. + final RunAs runAs; + + /// The user and group that the jobs in the queue run as. + final PosixUser? posix; + + /// Identifies a Microsoft Windows user. + final WindowsUser? windows; + + JobRunAsUser({ + required this.runAs, + this.posix, + this.windows, + }); + + factory JobRunAsUser.fromJson(Map json) { + return JobRunAsUser( + runAs: (json['runAs'] as String).toRunAs(), + posix: json['posix'] != null + ? PosixUser.fromJson(json['posix'] as Map) + : null, + windows: json['windows'] != null + ? WindowsUser.fromJson(json['windows'] as Map) + : null, + ); + } + + Map toJson() { + final runAs = this.runAs; + final posix = this.posix; + final windows = this.windows; + return { + 'runAs': runAs.toValue(), + if (posix != null) 'posix': posix, + if (windows != null) 'windows': windows, + }; + } +} + +/// The details of a job search. +class JobSearchSummary { + /// The date and time the resource was created. + final DateTime? createdAt; + + /// The user or system that created this resource. + final String? createdBy; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The job ID. + final String? jobId; + + /// The job parameters. + final Map? jobParameters; + + /// The life cycle status. + final JobLifecycleStatus? lifecycleStatus; + + /// The life cycle status message. + final String? lifecycleStatusMessage; + + /// The number of task failures before the job stops running and is marked as + /// FAILED. + final int? maxFailedTasksCount; + + /// The maximum number of retries for a job. + final int? maxRetriesPerTask; + + /// The job name. + final String? name; + + /// The job priority. + final int? priority; + + /// The queue ID. + final String? queueId; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The task status to start with on the job. + final JobTargetTaskRunStatus? targetTaskRunStatus; + + /// task run status for the job. + /// + ///
        + ///
      • + /// PENDING–pending and waiting for resources. + ///
      • + ///
      • + /// READY–ready to be processed. + ///
      • + ///
      • + /// ASSIGNED–assigned and will run next on a worker. + ///
      • + ///
      • + /// SCHEDULED–scheduled to be run on a worker. + ///
      • + ///
      • + /// INTERRUPTING–being interrupted. + ///
      • + ///
      • + /// RUNNING–running on a worker. + ///
      • + ///
      • + /// SUSPENDED–the task is suspended. + ///
      • + ///
      • + /// CANCELED–the task has been canceled. + ///
      • + ///
      • + /// FAILED–the task has failed. + ///
      • + ///
      • + /// SUCCEEDED–the task has succeeded. + ///
      • + ///
      + final TaskRunStatus? taskRunStatus; + + /// The number of tasks running on the job. + final Map? taskRunStatusCounts; + + JobSearchSummary({ + this.createdAt, + this.createdBy, + this.endedAt, + this.jobId, + this.jobParameters, + this.lifecycleStatus, + this.lifecycleStatusMessage, + this.maxFailedTasksCount, + this.maxRetriesPerTask, + this.name, + this.priority, + this.queueId, + this.startedAt, + this.targetTaskRunStatus, + this.taskRunStatus, + this.taskRunStatusCounts, + }); + + factory JobSearchSummary.fromJson(Map json) { + return JobSearchSummary( + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + endedAt: timeStampFromJson(json['endedAt']), + jobId: json['jobId'] as String?, + jobParameters: (json['jobParameters'] as Map?)?.map( + (k, e) => + MapEntry(k, JobParameter.fromJson(e as Map))), + lifecycleStatus: + (json['lifecycleStatus'] as String?)?.toJobLifecycleStatus(), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String?, + maxFailedTasksCount: json['maxFailedTasksCount'] as int?, + maxRetriesPerTask: json['maxRetriesPerTask'] as int?, + name: json['name'] as String?, + priority: json['priority'] as int?, + queueId: json['queueId'] as String?, + startedAt: timeStampFromJson(json['startedAt']), + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toJobTargetTaskRunStatus(), + taskRunStatus: (json['taskRunStatus'] as String?)?.toTaskRunStatus(), + taskRunStatusCounts: + (json['taskRunStatusCounts'] as Map?) + ?.map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final endedAt = this.endedAt; + final jobId = this.jobId; + final jobParameters = this.jobParameters; + final lifecycleStatus = this.lifecycleStatus; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final maxFailedTasksCount = this.maxFailedTasksCount; + final maxRetriesPerTask = this.maxRetriesPerTask; + final name = this.name; + final priority = this.priority; + final queueId = this.queueId; + final startedAt = this.startedAt; + final targetTaskRunStatus = this.targetTaskRunStatus; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + return { + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (jobId != null) 'jobId': jobId, + if (jobParameters != null) 'jobParameters': jobParameters, + if (lifecycleStatus != null) 'lifecycleStatus': lifecycleStatus.toValue(), + if (lifecycleStatusMessage != null) + 'lifecycleStatusMessage': lifecycleStatusMessage, + if (maxFailedTasksCount != null) + 'maxFailedTasksCount': maxFailedTasksCount, + if (maxRetriesPerTask != null) 'maxRetriesPerTask': maxRetriesPerTask, + if (name != null) 'name': name, + if (priority != null) 'priority': priority, + if (queueId != null) 'queueId': queueId, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (taskRunStatus != null) 'taskRunStatus': taskRunStatus.toValue(), + if (taskRunStatusCounts != null) + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + }; + } +} + +/// A summary of job details. +class JobSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The job ID. + final String jobId; + + /// The life cycle status. + final JobLifecycleStatus lifecycleStatus; + + /// The life cycle status message. + final String lifecycleStatusMessage; + + /// The job name. + final String name; + + /// The job priority. + final int priority; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The number of task failures before the job stops running and is marked as + /// FAILED. + final int? maxFailedTasksCount; + + /// The maximum number of retries for a job. + final int? maxRetriesPerTask; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The task status to start with on the job. + final JobTargetTaskRunStatus? targetTaskRunStatus; + + /// The task run status for the job. + /// + ///
        + ///
      • + /// PENDING–pending and waiting for resources. + ///
      • + ///
      • + /// READY–ready to be processed. + ///
      • + ///
      • + /// ASSIGNED–assigned and will run next on a worker. + ///
      • + ///
      • + /// SCHEDULED–scheduled to be run on a worker. + ///
      • + ///
      • + /// INTERRUPTING–being interrupted. + ///
      • + ///
      • + /// RUNNING–running on a worker. + ///
      • + ///
      • + /// SUSPENDED–the task is suspended. + ///
      • + ///
      • + /// CANCELED–the task has been canceled. + ///
      • + ///
      • + /// FAILED–the task has failed. + ///
      • + ///
      • + /// SUCCEEDED–the task has succeeded. + ///
      • + ///
      + final TaskRunStatus? taskRunStatus; + + /// The number of tasks running on the job. + final Map? taskRunStatusCounts; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + JobSummary({ + required this.createdAt, + required this.createdBy, + required this.jobId, + required this.lifecycleStatus, + required this.lifecycleStatusMessage, + required this.name, + required this.priority, + this.endedAt, + this.maxFailedTasksCount, + this.maxRetriesPerTask, + this.startedAt, + this.targetTaskRunStatus, + this.taskRunStatus, + this.taskRunStatusCounts, + this.updatedAt, + this.updatedBy, + }); + + factory JobSummary.fromJson(Map json) { + return JobSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + jobId: json['jobId'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toJobLifecycleStatus(), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String, + name: json['name'] as String, + priority: json['priority'] as int, + endedAt: timeStampFromJson(json['endedAt']), + maxFailedTasksCount: json['maxFailedTasksCount'] as int?, + maxRetriesPerTask: json['maxRetriesPerTask'] as int?, + startedAt: timeStampFromJson(json['startedAt']), + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toJobTargetTaskRunStatus(), + taskRunStatus: (json['taskRunStatus'] as String?)?.toTaskRunStatus(), + taskRunStatusCounts: + (json['taskRunStatusCounts'] as Map?) + ?.map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final jobId = this.jobId; + final lifecycleStatus = this.lifecycleStatus; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final name = this.name; + final priority = this.priority; + final endedAt = this.endedAt; + final maxFailedTasksCount = this.maxFailedTasksCount; + final maxRetriesPerTask = this.maxRetriesPerTask; + final startedAt = this.startedAt; + final targetTaskRunStatus = this.targetTaskRunStatus; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'jobId': jobId, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'lifecycleStatusMessage': lifecycleStatusMessage, + 'name': name, + 'priority': priority, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (maxFailedTasksCount != null) + 'maxFailedTasksCount': maxFailedTasksCount, + if (maxRetriesPerTask != null) 'maxRetriesPerTask': maxRetriesPerTask, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (taskRunStatus != null) 'taskRunStatus': taskRunStatus.toValue(), + if (taskRunStatusCounts != null) + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum JobTargetTaskRunStatus { + ready, + failed, + succeeded, + canceled, + suspended, + pending, +} + +extension JobTargetTaskRunStatusValueExtension on JobTargetTaskRunStatus { + String toValue() { + switch (this) { + case JobTargetTaskRunStatus.ready: + return 'READY'; + case JobTargetTaskRunStatus.failed: + return 'FAILED'; + case JobTargetTaskRunStatus.succeeded: + return 'SUCCEEDED'; + case JobTargetTaskRunStatus.canceled: + return 'CANCELED'; + case JobTargetTaskRunStatus.suspended: + return 'SUSPENDED'; + case JobTargetTaskRunStatus.pending: + return 'PENDING'; + } + } +} + +extension JobTargetTaskRunStatusFromString on String { + JobTargetTaskRunStatus toJobTargetTaskRunStatus() { + switch (this) { + case 'READY': + return JobTargetTaskRunStatus.ready; + case 'FAILED': + return JobTargetTaskRunStatus.failed; + case 'SUCCEEDED': + return JobTargetTaskRunStatus.succeeded; + case 'CANCELED': + return JobTargetTaskRunStatus.canceled; + case 'SUSPENDED': + return JobTargetTaskRunStatus.suspended; + case 'PENDING': + return JobTargetTaskRunStatus.pending; + } + throw Exception('$this is not known in enum JobTargetTaskRunStatus'); + } +} + +enum JobTemplateType { + json, + yaml, +} + +extension JobTemplateTypeValueExtension on JobTemplateType { + String toValue() { + switch (this) { + case JobTemplateType.json: + return 'JSON'; + case JobTemplateType.yaml: + return 'YAML'; + } + } +} + +extension JobTemplateTypeFromString on String { + JobTemplateType toJobTemplateType() { + switch (this) { + case 'JSON': + return JobTemplateType.json; + case 'YAML': + return JobTemplateType.yaml; + } + throw Exception('$this is not known in enum JobTemplateType'); + } +} + +enum LicenseEndpointStatus { + createInProgress, + deleteInProgress, + ready, + notReady, +} + +extension LicenseEndpointStatusValueExtension on LicenseEndpointStatus { + String toValue() { + switch (this) { + case LicenseEndpointStatus.createInProgress: + return 'CREATE_IN_PROGRESS'; + case LicenseEndpointStatus.deleteInProgress: + return 'DELETE_IN_PROGRESS'; + case LicenseEndpointStatus.ready: + return 'READY'; + case LicenseEndpointStatus.notReady: + return 'NOT_READY'; + } + } +} + +extension LicenseEndpointStatusFromString on String { + LicenseEndpointStatus toLicenseEndpointStatus() { + switch (this) { + case 'CREATE_IN_PROGRESS': + return LicenseEndpointStatus.createInProgress; + case 'DELETE_IN_PROGRESS': + return LicenseEndpointStatus.deleteInProgress; + case 'READY': + return LicenseEndpointStatus.ready; + case 'NOT_READY': + return LicenseEndpointStatus.notReady; + } + throw Exception('$this is not known in enum LicenseEndpointStatus'); + } +} + +/// The details for a license endpoint. +class LicenseEndpointSummary { + /// The license endpoint ID. + final String? licenseEndpointId; + + /// The status of the license endpoint. + final LicenseEndpointStatus? status; + + /// The status message of the license endpoint. + final String? statusMessage; + + /// The VCP(virtual private cloud) ID associated with the license endpoint. + final String? vpcId; + + LicenseEndpointSummary({ + this.licenseEndpointId, + this.status, + this.statusMessage, + this.vpcId, + }); + + factory LicenseEndpointSummary.fromJson(Map json) { + return LicenseEndpointSummary( + licenseEndpointId: json['licenseEndpointId'] as String?, + status: (json['status'] as String?)?.toLicenseEndpointStatus(), + statusMessage: json['statusMessage'] as String?, + vpcId: json['vpcId'] as String?, + ); + } + + Map toJson() { + final licenseEndpointId = this.licenseEndpointId; + final status = this.status; + final statusMessage = this.statusMessage; + final vpcId = this.vpcId; + return { + if (licenseEndpointId != null) 'licenseEndpointId': licenseEndpointId, + if (status != null) 'status': status.toValue(), + if (statusMessage != null) 'statusMessage': statusMessage, + if (vpcId != null) 'vpcId': vpcId, + }; + } +} + +class ListAvailableMeteredProductsResponse { + /// The metered products. + final List meteredProducts; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListAvailableMeteredProductsResponse({ + required this.meteredProducts, + this.nextToken, + }); + + factory ListAvailableMeteredProductsResponse.fromJson( + Map json) { + return ListAvailableMeteredProductsResponse( + meteredProducts: (json['meteredProducts'] as List) + .whereNotNull() + .map((e) => MeteredProductSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final meteredProducts = this.meteredProducts; + final nextToken = this.nextToken; + return { + 'meteredProducts': meteredProducts, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListBudgetsResponse { + /// The budgets to include on the list. + final List budgets; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListBudgetsResponse({ + required this.budgets, + this.nextToken, + }); + + factory ListBudgetsResponse.fromJson(Map json) { + return ListBudgetsResponse( + budgets: (json['budgets'] as List) + .whereNotNull() + .map((e) => BudgetSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final budgets = this.budgets; + final nextToken = this.nextToken; + return { + 'budgets': budgets, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListFarmMembersResponse { + /// The members on the list. + final List members; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListFarmMembersResponse({ + required this.members, + this.nextToken, + }); + + factory ListFarmMembersResponse.fromJson(Map json) { + return ListFarmMembersResponse( + members: (json['members'] as List) + .whereNotNull() + .map((e) => FarmMember.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final members = this.members; + final nextToken = this.nextToken; + return { + 'members': members, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListFarmsResponse { + /// Farms on the list. + final List farms; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListFarmsResponse({ + required this.farms, + this.nextToken, + }); + + factory ListFarmsResponse.fromJson(Map json) { + return ListFarmsResponse( + farms: (json['farms'] as List) + .whereNotNull() + .map((e) => FarmSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final farms = this.farms; + final nextToken = this.nextToken; + return { + 'farms': farms, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListFleetMembersResponse { + /// The members on the list. + final List members; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListFleetMembersResponse({ + required this.members, + this.nextToken, + }); + + factory ListFleetMembersResponse.fromJson(Map json) { + return ListFleetMembersResponse( + members: (json['members'] as List) + .whereNotNull() + .map((e) => FleetMember.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final members = this.members; + final nextToken = this.nextToken; + return { + 'members': members, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListFleetsResponse { + /// The fleets on the list. + final List fleets; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListFleetsResponse({ + required this.fleets, + this.nextToken, + }); + + factory ListFleetsResponse.fromJson(Map json) { + return ListFleetsResponse( + fleets: (json['fleets'] as List) + .whereNotNull() + .map((e) => FleetSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final fleets = this.fleets; + final nextToken = this.nextToken; + return { + 'fleets': fleets, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListJobMembersResponse { + /// The members on the list. + final List members; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListJobMembersResponse({ + required this.members, + this.nextToken, + }); + + factory ListJobMembersResponse.fromJson(Map json) { + return ListJobMembersResponse( + members: (json['members'] as List) + .whereNotNull() + .map((e) => JobMember.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final members = this.members; + final nextToken = this.nextToken; + return { + 'members': members, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListJobsResponse { + /// The jobs on the list. + final List jobs; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListJobsResponse({ + required this.jobs, + this.nextToken, + }); + + factory ListJobsResponse.fromJson(Map json) { + return ListJobsResponse( + jobs: (json['jobs'] as List) + .whereNotNull() + .map((e) => JobSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final jobs = this.jobs; + final nextToken = this.nextToken; + return { + 'jobs': jobs, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListLicenseEndpointsResponse { + /// The license endpoints. + final List licenseEndpoints; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListLicenseEndpointsResponse({ + required this.licenseEndpoints, + this.nextToken, + }); + + factory ListLicenseEndpointsResponse.fromJson(Map json) { + return ListLicenseEndpointsResponse( + licenseEndpoints: (json['licenseEndpoints'] as List) + .whereNotNull() + .map( + (e) => LicenseEndpointSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final licenseEndpoints = this.licenseEndpoints; + final nextToken = this.nextToken; + return { + 'licenseEndpoints': licenseEndpoints, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListMeteredProductsResponse { + /// The metered products to list. + final List meteredProducts; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListMeteredProductsResponse({ + required this.meteredProducts, + this.nextToken, + }); + + factory ListMeteredProductsResponse.fromJson(Map json) { + return ListMeteredProductsResponse( + meteredProducts: (json['meteredProducts'] as List) + .whereNotNull() + .map((e) => MeteredProductSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final meteredProducts = this.meteredProducts; + final nextToken = this.nextToken; + return { + 'meteredProducts': meteredProducts, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListMonitorsResponse { + /// A list of MonitorSummary objects that describe your monitors in + /// the Deadline Cloud. + final List monitors; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListMonitorsResponse({ + required this.monitors, + this.nextToken, + }); + + factory ListMonitorsResponse.fromJson(Map json) { + return ListMonitorsResponse( + monitors: (json['monitors'] as List) + .whereNotNull() + .map((e) => MonitorSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final monitors = this.monitors; + final nextToken = this.nextToken; + return { + 'monitors': monitors, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListQueueEnvironmentsResponse { + /// The environments to include in the queue environments list. + final List environments; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListQueueEnvironmentsResponse({ + required this.environments, + this.nextToken, + }); + + factory ListQueueEnvironmentsResponse.fromJson(Map json) { + return ListQueueEnvironmentsResponse( + environments: (json['environments'] as List) + .whereNotNull() + .map((e) => + QueueEnvironmentSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final environments = this.environments; + final nextToken = this.nextToken; + return { + 'environments': environments, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListQueueFleetAssociationsResponse { + /// The queue-fleet associations on the list. + final List queueFleetAssociations; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListQueueFleetAssociationsResponse({ + required this.queueFleetAssociations, + this.nextToken, + }); + + factory ListQueueFleetAssociationsResponse.fromJson( + Map json) { + return ListQueueFleetAssociationsResponse( + queueFleetAssociations: (json['queueFleetAssociations'] as List) + .whereNotNull() + .map((e) => + QueueFleetAssociationSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final queueFleetAssociations = this.queueFleetAssociations; + final nextToken = this.nextToken; + return { + 'queueFleetAssociations': queueFleetAssociations, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListQueueMembersResponse { + /// The members on the list. + final List members; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListQueueMembersResponse({ + required this.members, + this.nextToken, + }); + + factory ListQueueMembersResponse.fromJson(Map json) { + return ListQueueMembersResponse( + members: (json['members'] as List) + .whereNotNull() + .map((e) => QueueMember.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final members = this.members; + final nextToken = this.nextToken; + return { + 'members': members, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListQueuesResponse { + /// The queues on the list. + final List queues; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListQueuesResponse({ + required this.queues, + this.nextToken, + }); + + factory ListQueuesResponse.fromJson(Map json) { + return ListQueuesResponse( + queues: (json['queues'] as List) + .whereNotNull() + .map((e) => QueueSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final queues = this.queues; + final nextToken = this.nextToken; + return { + 'queues': queues, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSessionActionsResponse { + /// The session actions. + final List sessionActions; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListSessionActionsResponse({ + required this.sessionActions, + this.nextToken, + }); + + factory ListSessionActionsResponse.fromJson(Map json) { + return ListSessionActionsResponse( + sessionActions: (json['sessionActions'] as List) + .whereNotNull() + .map((e) => SessionActionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final sessionActions = this.sessionActions; + final nextToken = this.nextToken; + return { + 'sessionActions': sessionActions, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSessionsForWorkerResponse { + /// The sessions in the response. + final List sessions; + + /// The token for the next set of results, or null to start from + /// the beginning. + final String? nextToken; + + ListSessionsForWorkerResponse({ + required this.sessions, + this.nextToken, + }); + + factory ListSessionsForWorkerResponse.fromJson(Map json) { + return ListSessionsForWorkerResponse( + sessions: (json['sessions'] as List) + .whereNotNull() + .map((e) => WorkerSessionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final sessions = this.sessions; + final nextToken = this.nextToken; + return { + 'sessions': sessions, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListSessionsResponse { + /// The sessions on the list. + final List sessions; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListSessionsResponse({ + required this.sessions, + this.nextToken, + }); + + factory ListSessionsResponse.fromJson(Map json) { + return ListSessionsResponse( + sessions: (json['sessions'] as List) + .whereNotNull() + .map((e) => SessionSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final sessions = this.sessions; + final nextToken = this.nextToken; + return { + 'sessions': sessions, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListStepConsumersResponse { + /// The consumers on the list. + final List consumers; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListStepConsumersResponse({ + required this.consumers, + this.nextToken, + }); + + factory ListStepConsumersResponse.fromJson(Map json) { + return ListStepConsumersResponse( + consumers: (json['consumers'] as List) + .whereNotNull() + .map((e) => StepConsumer.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final consumers = this.consumers; + final nextToken = this.nextToken; + return { + 'consumers': consumers, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListStepDependenciesResponse { + /// The dependencies on the list. + final List dependencies; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListStepDependenciesResponse({ + required this.dependencies, + this.nextToken, + }); + + factory ListStepDependenciesResponse.fromJson(Map json) { + return ListStepDependenciesResponse( + dependencies: (json['dependencies'] as List) + .whereNotNull() + .map((e) => StepDependency.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final dependencies = this.dependencies; + final nextToken = this.nextToken; + return { + 'dependencies': dependencies, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListStepsResponse { + /// The steps on the list. + final List steps; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListStepsResponse({ + required this.steps, + this.nextToken, + }); + + factory ListStepsResponse.fromJson(Map json) { + return ListStepsResponse( + steps: (json['steps'] as List) + .whereNotNull() + .map((e) => StepSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final steps = this.steps; + final nextToken = this.nextToken; + return { + 'steps': steps, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListStorageProfilesForQueueResponse { + /// The storage profiles in the queue. + final List storageProfiles; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListStorageProfilesForQueueResponse({ + required this.storageProfiles, + this.nextToken, + }); + + factory ListStorageProfilesForQueueResponse.fromJson( + Map json) { + return ListStorageProfilesForQueueResponse( + storageProfiles: (json['storageProfiles'] as List) + .whereNotNull() + .map((e) => StorageProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final storageProfiles = this.storageProfiles; + final nextToken = this.nextToken; + return { + 'storageProfiles': storageProfiles, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListStorageProfilesResponse { + /// The storage profiles. + final List storageProfiles; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListStorageProfilesResponse({ + required this.storageProfiles, + this.nextToken, + }); + + factory ListStorageProfilesResponse.fromJson(Map json) { + return ListStorageProfilesResponse( + storageProfiles: (json['storageProfiles'] as List) + .whereNotNull() + .map((e) => StorageProfileSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final storageProfiles = this.storageProfiles; + final nextToken = this.nextToken; + return { + 'storageProfiles': storageProfiles, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListTagsForResourceResponse { + /// Each tag consists of a tag key and a tag value. Tag keys and values are both + /// required, but tag values can be empty strings. + final Map? tags; + + ListTagsForResourceResponse({ + this.tags, + }); + + factory ListTagsForResourceResponse.fromJson(Map json) { + return ListTagsForResourceResponse( + tags: (json['tags'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final tags = this.tags; + return { + if (tags != null) 'tags': tags, + }; + } +} + +class ListTasksResponse { + /// Tasks for the job. + final List tasks; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListTasksResponse({ + required this.tasks, + this.nextToken, + }); + + factory ListTasksResponse.fromJson(Map json) { + return ListTasksResponse( + tasks: (json['tasks'] as List) + .whereNotNull() + .map((e) => TaskSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final tasks = this.tasks; + final nextToken = this.nextToken; + return { + 'tasks': tasks, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +class ListWorkersResponse { + /// The workers on the list. + final List workers; + + /// If Deadline Cloud returns nextToken, then there are more + /// results available. The value of nextToken is a unique + /// pagination token for each page. To retrieve the next page, call the + /// operation again using the returned token. Keep all other arguments + /// unchanged. If no results remain, then nextToken is set to + /// null. Each pagination token expires after 24 hours. If you + /// provide a token that isn't valid, then you receive an HTTP 400 + /// ValidationException error. + final String? nextToken; + + ListWorkersResponse({ + required this.workers, + this.nextToken, + }); + + factory ListWorkersResponse.fromJson(Map json) { + return ListWorkersResponse( + workers: (json['workers'] as List) + .whereNotNull() + .map((e) => WorkerSummary.fromJson(e as Map)) + .toList(), + nextToken: json['nextToken'] as String?, + ); + } + + Map toJson() { + final workers = this.workers; + final nextToken = this.nextToken; + return { + 'workers': workers, + if (nextToken != null) 'nextToken': nextToken, + }; + } +} + +/// Log configuration details. +class LogConfiguration { + /// The log drivers for worker related logs. + final String logDriver; + + /// The log configuration error details. + final String? error; + + /// The options for a log driver. + final Map? options; + + /// The parameters for the log configuration. + final Map? parameters; + + LogConfiguration({ + required this.logDriver, + this.error, + this.options, + this.parameters, + }); + + factory LogConfiguration.fromJson(Map json) { + return LogConfiguration( + logDriver: json['logDriver'] as String, + error: json['error'] as String?, + options: (json['options'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + parameters: (json['parameters'] as Map?) + ?.map((k, e) => MapEntry(k, e as String)), + ); + } + + Map toJson() { + final logDriver = this.logDriver; + final error = this.error; + final options = this.options; + final parameters = this.parameters; + return { + 'logDriver': logDriver, + if (error != null) 'error': error, + if (options != null) 'options': options, + if (parameters != null) 'parameters': parameters, + }; + } +} + +enum LogicalOperator { + and, + or, +} + +extension LogicalOperatorValueExtension on LogicalOperator { + String toValue() { + switch (this) { + case LogicalOperator.and: + return 'AND'; + case LogicalOperator.or: + return 'OR'; + } + } +} + +extension LogicalOperatorFromString on String { + LogicalOperator toLogicalOperator() { + switch (this) { + case 'AND': + return LogicalOperator.and; + case 'OR': + return LogicalOperator.or; + } + throw Exception('$this is not known in enum LogicalOperator'); + } +} + +/// The details of the manifest that links a job's source information. +class ManifestProperties { + /// The file's root path. + final String rootPath; + + /// The format of the root path. + final PathFormat rootPathFormat; + + /// The file system location name. + final String? fileSystemLocationName; + + /// The has value of the file. + final String? inputManifestHash; + + /// The file path. + final String? inputManifestPath; + + /// The file path relative to the directory. + final List? outputRelativeDirectories; + + ManifestProperties({ + required this.rootPath, + required this.rootPathFormat, + this.fileSystemLocationName, + this.inputManifestHash, + this.inputManifestPath, + this.outputRelativeDirectories, + }); + + factory ManifestProperties.fromJson(Map json) { + return ManifestProperties( + rootPath: json['rootPath'] as String, + rootPathFormat: (json['rootPathFormat'] as String).toPathFormat(), + fileSystemLocationName: json['fileSystemLocationName'] as String?, + inputManifestHash: json['inputManifestHash'] as String?, + inputManifestPath: json['inputManifestPath'] as String?, + outputRelativeDirectories: (json['outputRelativeDirectories'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final rootPath = this.rootPath; + final rootPathFormat = this.rootPathFormat; + final fileSystemLocationName = this.fileSystemLocationName; + final inputManifestHash = this.inputManifestHash; + final inputManifestPath = this.inputManifestPath; + final outputRelativeDirectories = this.outputRelativeDirectories; + return { + 'rootPath': rootPath, + 'rootPathFormat': rootPathFormat.toValue(), + if (fileSystemLocationName != null) + 'fileSystemLocationName': fileSystemLocationName, + if (inputManifestHash != null) 'inputManifestHash': inputManifestHash, + if (inputManifestPath != null) 'inputManifestPath': inputManifestPath, + if (outputRelativeDirectories != null) + 'outputRelativeDirectories': outputRelativeDirectories, + }; + } +} + +enum MembershipLevel { + viewer, + contributor, + owner, + manager, +} + +extension MembershipLevelValueExtension on MembershipLevel { + String toValue() { + switch (this) { + case MembershipLevel.viewer: + return 'VIEWER'; + case MembershipLevel.contributor: + return 'CONTRIBUTOR'; + case MembershipLevel.owner: + return 'OWNER'; + case MembershipLevel.manager: + return 'MANAGER'; + } + } +} + +extension MembershipLevelFromString on String { + MembershipLevel toMembershipLevel() { + switch (this) { + case 'VIEWER': + return MembershipLevel.viewer; + case 'CONTRIBUTOR': + return MembershipLevel.contributor; + case 'OWNER': + return MembershipLevel.owner; + case 'MANAGER': + return MembershipLevel.manager; + } + throw Exception('$this is not known in enum MembershipLevel'); + } +} + +/// The range of memory in MiB. +class MemoryMiBRange { + /// The minimum amount of memory (in MiB). + final int min; + + /// The maximum amount of memory (in MiB). + final int? max; + + MemoryMiBRange({ + required this.min, + this.max, + }); + + factory MemoryMiBRange.fromJson(Map json) { + return MemoryMiBRange( + min: json['min'] as int, + max: json['max'] as int?, + ); + } + + Map toJson() { + final min = this.min; + final max = this.max; + return { + 'min': min, + if (max != null) 'max': max, + }; + } +} + +/// The details of a metered product. +class MeteredProductSummary { + /// The family to which the metered product belongs. + final String family; + + /// The port on which the metered product should run. + final int port; + + /// The product ID. + final String productId; + + /// The vendor. + final String vendor; + + MeteredProductSummary({ + required this.family, + required this.port, + required this.productId, + required this.vendor, + }); + + factory MeteredProductSummary.fromJson(Map json) { + return MeteredProductSummary( + family: json['family'] as String, + port: json['port'] as int, + productId: json['productId'] as String, + vendor: json['vendor'] as String, + ); + } + + Map toJson() { + final family = this.family; + final port = this.port; + final productId = this.productId; + final vendor = this.vendor; + return { + 'family': family, + 'port': port, + 'productId': productId, + 'vendor': vendor, + }; + } +} + +/// Provides information about a monitor in Deadline Cloud. +class MonitorSummary { + /// The UNIX timestamp of the date and time that the monitor was created. + final DateTime createdAt; + + /// The user name of the person that created the monitor. + final String createdBy; + + /// The name of the monitor that displays on the Deadline Cloud console. + final String displayName; + + /// The Amazon Resource Name (ARN) that the IAM Identity Center assigned to the + /// monitor when it was created. + final String identityCenterApplicationArn; + + /// The Amazon Resource Name (ARN) of the IAM Identity Center instance + /// responsible for authenticating monitor users. + final String identityCenterInstanceArn; + + /// The unique identifier for the monitor. + final String monitorId; + + /// The Amazon Resource Name (ARN) of the IAM role for the monitor. Users of the + /// monitor use this role to access Deadline Cloud resources. + final String roleArn; + + /// The subdomain used for the monitor URL. The full URL of the monitor is + /// subdomain.Region.deadlinecloud.amazonaws.com. + final String subdomain; + + /// The complete URL of the monitor. The full URL of the monitor is + /// subdomain.Region.deadlinecloud.amazonaws.com. + final String url; + + /// The UNIX timestamp of the date and time that the monitor was last updated. + final DateTime? updatedAt; + + /// The user name of the person that last updated the monitor. + final String? updatedBy; + + MonitorSummary({ + required this.createdAt, + required this.createdBy, + required this.displayName, + required this.identityCenterApplicationArn, + required this.identityCenterInstanceArn, + required this.monitorId, + required this.roleArn, + required this.subdomain, + required this.url, + this.updatedAt, + this.updatedBy, + }); + + factory MonitorSummary.fromJson(Map json) { + return MonitorSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + displayName: json['displayName'] as String, + identityCenterApplicationArn: + json['identityCenterApplicationArn'] as String, + identityCenterInstanceArn: json['identityCenterInstanceArn'] as String, + monitorId: json['monitorId'] as String, + roleArn: json['roleArn'] as String, + subdomain: json['subdomain'] as String, + url: json['url'] as String, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final displayName = this.displayName; + final identityCenterApplicationArn = this.identityCenterApplicationArn; + final identityCenterInstanceArn = this.identityCenterInstanceArn; + final monitorId = this.monitorId; + final roleArn = this.roleArn; + final subdomain = this.subdomain; + final url = this.url; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'displayName': displayName, + 'identityCenterApplicationArn': identityCenterApplicationArn, + 'identityCenterInstanceArn': identityCenterInstanceArn, + 'monitorId': monitorId, + 'roleArn': roleArn, + 'subdomain': subdomain, + 'url': url, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The details of a filtered search for parameters. +class ParameterFilterExpression { + /// The name of the parameter to filter on. + final String name; + + /// The type of comparison to use to filter results. + final ComparisonOperator operator; + + /// The parameter's value. + final String value; + + ParameterFilterExpression({ + required this.name, + required this.operator, + required this.value, + }); + + Map toJson() { + final name = this.name; + final operator = this.operator; + final value = this.value; + return { + 'name': name, + 'operator': operator.toValue(), + 'value': value, + }; + } +} + +/// Organizes parameters according to your specifications. +class ParameterSortExpression { + /// The parameter name to sort by. + final String name; + + /// The sort order for the parameter. + final SortOrder sortOrder; + + ParameterSortExpression({ + required this.name, + required this.sortOrder, + }); + + Map toJson() { + final name = this.name; + final sortOrder = this.sortOrder; + return { + 'name': name, + 'sortOrder': sortOrder.toValue(), + }; + } +} + +/// The details of a search for two or more step parameters. +class ParameterSpace { + /// The parameters to search for. + final List parameters; + + /// The combination expression to use in the search. + final String? combination; + + ParameterSpace({ + required this.parameters, + this.combination, + }); + + factory ParameterSpace.fromJson(Map json) { + return ParameterSpace( + parameters: (json['parameters'] as List) + .whereNotNull() + .map((e) => StepParameter.fromJson(e as Map)) + .toList(), + combination: json['combination'] as String?, + ); + } + + Map toJson() { + final parameters = this.parameters; + final combination = this.combination; + return { + 'parameters': parameters, + if (combination != null) 'combination': combination, + }; + } +} + +enum PathFormat { + windows, + posix, +} + +extension PathFormatValueExtension on PathFormat { + String toValue() { + switch (this) { + case PathFormat.windows: + return 'windows'; + case PathFormat.posix: + return 'posix'; + } + } +} + +extension PathFormatFromString on String { + PathFormat toPathFormat() { + switch (this) { + case 'windows': + return PathFormat.windows; + case 'posix': + return PathFormat.posix; + } + throw Exception('$this is not known in enum PathFormat'); + } +} + +/// The details of a source and destination path. +class PathMappingRule { + /// The destination path. + final String destinationPath; + + /// The source path. + final String sourcePath; + + /// The source path format. + final PathFormat sourcePathFormat; + + PathMappingRule({ + required this.destinationPath, + required this.sourcePath, + required this.sourcePathFormat, + }); + + factory PathMappingRule.fromJson(Map json) { + return PathMappingRule( + destinationPath: json['destinationPath'] as String, + sourcePath: json['sourcePath'] as String, + sourcePathFormat: (json['sourcePathFormat'] as String).toPathFormat(), + ); + } + + Map toJson() { + final destinationPath = this.destinationPath; + final sourcePath = this.sourcePath; + final sourcePathFormat = this.sourcePathFormat; + return { + 'destinationPath': destinationPath, + 'sourcePath': sourcePath, + 'sourcePathFormat': sourcePathFormat.toValue(), + }; + } +} + +enum Period { + hourly, + daily, + weekly, + monthly, +} + +extension PeriodValueExtension on Period { + String toValue() { + switch (this) { + case Period.hourly: + return 'HOURLY'; + case Period.daily: + return 'DAILY'; + case Period.weekly: + return 'WEEKLY'; + case Period.monthly: + return 'MONTHLY'; + } + } +} + +extension PeriodFromString on String { + Period toPeriod() { + switch (this) { + case 'HOURLY': + return Period.hourly; + case 'DAILY': + return Period.daily; + case 'WEEKLY': + return Period.weekly; + case 'MONTHLY': + return Period.monthly; + } + throw Exception('$this is not known in enum Period'); + } +} + +/// The POSIX user. +class PosixUser { + /// The name of the POSIX user's group. + final String group; + + /// The name of the POSIX user. + final String user; + + PosixUser({ + required this.group, + required this.user, + }); + + factory PosixUser.fromJson(Map json) { + return PosixUser( + group: json['group'] as String, + user: json['user'] as String, + ); + } + + Map toJson() { + final group = this.group; + final user = this.user; + return { + 'group': group, + 'user': user, + }; + } +} + +enum PrincipalType { + user, + group, +} + +extension PrincipalTypeValueExtension on PrincipalType { + String toValue() { + switch (this) { + case PrincipalType.user: + return 'USER'; + case PrincipalType.group: + return 'GROUP'; + } + } +} + +extension PrincipalTypeFromString on String { + PrincipalType toPrincipalType() { + switch (this) { + case 'USER': + return PrincipalType.user; + case 'GROUP': + return PrincipalType.group; + } + throw Exception('$this is not known in enum PrincipalType'); + } +} + +class PutMeteredProductResponse { + PutMeteredProductResponse(); + + factory PutMeteredProductResponse.fromJson(Map _) { + return PutMeteredProductResponse(); + } + + Map toJson() { + return {}; + } +} + +enum QueueBlockedReason { + noBudgetConfigured, + budgetThresholdReached, +} + +extension QueueBlockedReasonValueExtension on QueueBlockedReason { + String toValue() { + switch (this) { + case QueueBlockedReason.noBudgetConfigured: + return 'NO_BUDGET_CONFIGURED'; + case QueueBlockedReason.budgetThresholdReached: + return 'BUDGET_THRESHOLD_REACHED'; + } + } +} + +extension QueueBlockedReasonFromString on String { + QueueBlockedReason toQueueBlockedReason() { + switch (this) { + case 'NO_BUDGET_CONFIGURED': + return QueueBlockedReason.noBudgetConfigured; + case 'BUDGET_THRESHOLD_REACHED': + return QueueBlockedReason.budgetThresholdReached; + } + throw Exception('$this is not known in enum QueueBlockedReason'); + } +} + +/// The summary of a queue environment. +class QueueEnvironmentSummary { + /// The name of the queue environment. + final String name; + + /// The queue environment's priority. + final int priority; + + /// The queue environment ID. + final String queueEnvironmentId; + + QueueEnvironmentSummary({ + required this.name, + required this.priority, + required this.queueEnvironmentId, + }); + + factory QueueEnvironmentSummary.fromJson(Map json) { + return QueueEnvironmentSummary( + name: json['name'] as String, + priority: json['priority'] as int, + queueEnvironmentId: json['queueEnvironmentId'] as String, + ); + } + + Map toJson() { + final name = this.name; + final priority = this.priority; + final queueEnvironmentId = this.queueEnvironmentId; + return { + 'name': name, + 'priority': priority, + 'queueEnvironmentId': queueEnvironmentId, + }; + } +} + +enum QueueFleetAssociationStatus { + active, + stopSchedulingAndCompleteTasks, + stopSchedulingAndCancelTasks, + stopped, +} + +extension QueueFleetAssociationStatusValueExtension + on QueueFleetAssociationStatus { + String toValue() { + switch (this) { + case QueueFleetAssociationStatus.active: + return 'ACTIVE'; + case QueueFleetAssociationStatus.stopSchedulingAndCompleteTasks: + return 'STOP_SCHEDULING_AND_COMPLETE_TASKS'; + case QueueFleetAssociationStatus.stopSchedulingAndCancelTasks: + return 'STOP_SCHEDULING_AND_CANCEL_TASKS'; + case QueueFleetAssociationStatus.stopped: + return 'STOPPED'; + } + } +} + +extension QueueFleetAssociationStatusFromString on String { + QueueFleetAssociationStatus toQueueFleetAssociationStatus() { + switch (this) { + case 'ACTIVE': + return QueueFleetAssociationStatus.active; + case 'STOP_SCHEDULING_AND_COMPLETE_TASKS': + return QueueFleetAssociationStatus.stopSchedulingAndCompleteTasks; + case 'STOP_SCHEDULING_AND_CANCEL_TASKS': + return QueueFleetAssociationStatus.stopSchedulingAndCancelTasks; + case 'STOPPED': + return QueueFleetAssociationStatus.stopped; + } + throw Exception('$this is not known in enum QueueFleetAssociationStatus'); + } +} + +/// The details of a queue-fleet association. +class QueueFleetAssociationSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The fleet ID. + final String fleetId; + + /// The queue ID. + final String queueId; + + /// The status of task scheduling in the queue-fleet association. + /// + ///
        + ///
      • + /// ACTIVE–Association is active. + ///
      • + ///
      • + /// STOP_SCHEDULING_AND_COMPLETE_TASKS–Association has stopped + /// scheduling new tasks and is completing current tasks. + ///
      • + ///
      • + /// STOP_SCHEDULING_AND_CANCEL_TASKS–Association has stopped + /// scheduling new tasks and is canceling current tasks. + ///
      • + ///
      • + /// STOPPED–Association has been stopped. + ///
      • + ///
      + final QueueFleetAssociationStatus status; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + QueueFleetAssociationSummary({ + required this.createdAt, + required this.createdBy, + required this.fleetId, + required this.queueId, + required this.status, + this.updatedAt, + this.updatedBy, + }); + + factory QueueFleetAssociationSummary.fromJson(Map json) { + return QueueFleetAssociationSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + fleetId: json['fleetId'] as String, + queueId: json['queueId'] as String, + status: (json['status'] as String).toQueueFleetAssociationStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final fleetId = this.fleetId; + final queueId = this.queueId; + final status = this.status; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'fleetId': fleetId, + 'queueId': queueId, + 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The details of a queue member. +class QueueMember { + /// The farm ID. + final String farmId; + + /// The identity store ID. + final String identityStoreId; + + /// The queue member's membership level. + final MembershipLevel membershipLevel; + + /// The principal ID of the queue member. + final String principalId; + + /// The principal type of the queue member. + final PrincipalType principalType; + + /// The queue ID. + final String queueId; + + QueueMember({ + required this.farmId, + required this.identityStoreId, + required this.membershipLevel, + required this.principalId, + required this.principalType, + required this.queueId, + }); + + factory QueueMember.fromJson(Map json) { + return QueueMember( + farmId: json['farmId'] as String, + identityStoreId: json['identityStoreId'] as String, + membershipLevel: (json['membershipLevel'] as String).toMembershipLevel(), + principalId: json['principalId'] as String, + principalType: (json['principalType'] as String).toPrincipalType(), + queueId: json['queueId'] as String, + ); + } + + Map toJson() { + final farmId = this.farmId; + final identityStoreId = this.identityStoreId; + final membershipLevel = this.membershipLevel; + final principalId = this.principalId; + final principalType = this.principalType; + final queueId = this.queueId; + return { + 'farmId': farmId, + 'identityStoreId': identityStoreId, + 'membershipLevel': membershipLevel.toValue(), + 'principalId': principalId, + 'principalType': principalType.toValue(), + 'queueId': queueId, + }; + } +} + +enum QueueStatus { + idle, + scheduling, + schedulingBlocked, +} + +extension QueueStatusValueExtension on QueueStatus { + String toValue() { + switch (this) { + case QueueStatus.idle: + return 'IDLE'; + case QueueStatus.scheduling: + return 'SCHEDULING'; + case QueueStatus.schedulingBlocked: + return 'SCHEDULING_BLOCKED'; + } + } +} + +extension QueueStatusFromString on String { + QueueStatus toQueueStatus() { + switch (this) { + case 'IDLE': + return QueueStatus.idle; + case 'SCHEDULING': + return QueueStatus.scheduling; + case 'SCHEDULING_BLOCKED': + return QueueStatus.schedulingBlocked; + } + throw Exception('$this is not known in enum QueueStatus'); + } +} + +/// The details of a queue summary. +class QueueSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The default action taken on a queue summary if a budget wasn't configured. + final DefaultQueueBudgetAction defaultBudgetAction; + + /// The display name of the queue summary to update. + final String displayName; + + /// The farm ID. + final String farmId; + + /// The queue ID. + final String queueId; + + /// That status of the queue. + final QueueStatus status; + + /// The reason the queue is blocked, if applicable. + final QueueBlockedReason? blockedReason; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + QueueSummary({ + required this.createdAt, + required this.createdBy, + required this.defaultBudgetAction, + required this.displayName, + required this.farmId, + required this.queueId, + required this.status, + this.blockedReason, + this.updatedAt, + this.updatedBy, + }); + + factory QueueSummary.fromJson(Map json) { + return QueueSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + defaultBudgetAction: + (json['defaultBudgetAction'] as String).toDefaultQueueBudgetAction(), + displayName: json['displayName'] as String, + farmId: json['farmId'] as String, + queueId: json['queueId'] as String, + status: (json['status'] as String).toQueueStatus(), + blockedReason: (json['blockedReason'] as String?)?.toQueueBlockedReason(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final defaultBudgetAction = this.defaultBudgetAction; + final displayName = this.displayName; + final farmId = this.farmId; + final queueId = this.queueId; + final status = this.status; + final blockedReason = this.blockedReason; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'defaultBudgetAction': defaultBudgetAction.toValue(), + 'displayName': displayName, + 'farmId': farmId, + 'queueId': queueId, + 'status': status.toValue(), + if (blockedReason != null) 'blockedReason': blockedReason.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +/// The details of a budget action. +class ResponseBudgetAction { + /// The percentage threshold for the budget. + final double thresholdPercentage; + + /// The action taken on the budget once scheduling stops. + final BudgetActionType type; + + /// The budget action description. + final String? description; + + ResponseBudgetAction({ + required this.thresholdPercentage, + required this.type, + this.description, + }); + + factory ResponseBudgetAction.fromJson(Map json) { + return ResponseBudgetAction( + thresholdPercentage: json['thresholdPercentage'] as double, + type: (json['type'] as String).toBudgetActionType(), + description: json['description'] as String?, + ); + } + + Map toJson() { + final thresholdPercentage = this.thresholdPercentage; + final type = this.type; + final description = this.description; + return { + 'thresholdPercentage': thresholdPercentage, + 'type': type.toValue(), + if (description != null) 'description': description, + }; + } +} + +enum RunAs { + queueConfiguredUser, + workerAgentUser, +} + +extension RunAsValueExtension on RunAs { + String toValue() { + switch (this) { + case RunAs.queueConfiguredUser: + return 'QUEUE_CONFIGURED_USER'; + case RunAs.workerAgentUser: + return 'WORKER_AGENT_USER'; + } + } +} + +extension RunAsFromString on String { + RunAs toRunAs() { + switch (this) { + case 'QUEUE_CONFIGURED_USER': + return RunAs.queueConfiguredUser; + case 'WORKER_AGENT_USER': + return RunAs.workerAgentUser; + } + throw Exception('$this is not known in enum RunAs'); + } +} + +/// The Amazon S3 location information. +class S3Location { + /// The name of the Amazon S3 bucket. + final String bucketName; + + /// The Amazon S3 object key that uniquely identifies the Amazon S3 bucket. + final String key; + + S3Location({ + required this.bucketName, + required this.key, + }); + + Map toJson() { + final bucketName = this.bucketName; + final key = this.key; + return { + 'bucketName': bucketName, + 'key': key, + }; + } +} + +/// The type of search filter to apply. +class SearchFilterExpression { + /// Filters based on date and time. + final DateTimeFilterExpression? dateTimeFilter; + + /// Filters by group. + final SearchGroupedFilterExpressions? groupFilter; + + /// Filters by parameter. + final ParameterFilterExpression? parameterFilter; + + /// Filters by a specified search term. + final SearchTermFilterExpression? searchTermFilter; + + /// Filters by a string. + final StringFilterExpression? stringFilter; + + SearchFilterExpression({ + this.dateTimeFilter, + this.groupFilter, + this.parameterFilter, + this.searchTermFilter, + this.stringFilter, + }); + + Map toJson() { + final dateTimeFilter = this.dateTimeFilter; + final groupFilter = this.groupFilter; + final parameterFilter = this.parameterFilter; + final searchTermFilter = this.searchTermFilter; + final stringFilter = this.stringFilter; + return { + if (dateTimeFilter != null) 'dateTimeFilter': dateTimeFilter, + if (groupFilter != null) 'groupFilter': groupFilter, + if (parameterFilter != null) 'parameterFilter': parameterFilter, + if (searchTermFilter != null) 'searchTermFilter': searchTermFilter, + if (stringFilter != null) 'stringFilter': stringFilter, + }; + } +} + +/// The filter expression, AND or OR, to use when +/// searching among a group of search strings in a resource. +/// You can use two groupings per search each within parenthesis +/// (). +/// +class SearchGroupedFilterExpressions { + /// The filters to use for the search. + final List filters; + + /// The operators to include in the search. + final LogicalOperator operator; + + SearchGroupedFilterExpressions({ + required this.filters, + required this.operator, + }); + + Map toJson() { + final filters = this.filters; + final operator = this.operator; + return { + 'filters': filters, + 'operator': operator.toValue(), + }; + } +} + +class SearchJobsResponse { + /// The jobs in the search. + final List jobs; + + /// The total number of results in the search. + final int totalResults; + + /// The next incremental starting point after the defined + /// itemOffset. + final int? nextItemOffset; + + SearchJobsResponse({ + required this.jobs, + required this.totalResults, + this.nextItemOffset, + }); + + factory SearchJobsResponse.fromJson(Map json) { + return SearchJobsResponse( + jobs: (json['jobs'] as List) + .whereNotNull() + .map((e) => JobSearchSummary.fromJson(e as Map)) + .toList(), + totalResults: json['totalResults'] as int, + nextItemOffset: json['nextItemOffset'] as int?, + ); + } + + Map toJson() { + final jobs = this.jobs; + final totalResults = this.totalResults; + final nextItemOffset = this.nextItemOffset; + return { + 'jobs': jobs, + 'totalResults': totalResults, + if (nextItemOffset != null) 'nextItemOffset': nextItemOffset, + }; + } +} + +/// The resources to search. +class SearchSortExpression { + /// Options for sorting by a field. + final FieldSortExpression? fieldSort; + + /// Options for sorting by a parameter. + final ParameterSortExpression? parameterSort; + + /// Options for sorting a particular user's jobs first. + final UserJobsFirst? userJobsFirst; + + SearchSortExpression({ + this.fieldSort, + this.parameterSort, + this.userJobsFirst, + }); + + Map toJson() { + final fieldSort = this.fieldSort; + final parameterSort = this.parameterSort; + final userJobsFirst = this.userJobsFirst; + return { + if (fieldSort != null) 'fieldSort': fieldSort, + if (parameterSort != null) 'parameterSort': parameterSort, + if (userJobsFirst != null) 'userJobsFirst': userJobsFirst, + }; + } +} + +class SearchStepsResponse { + /// The steps in the search. + final List steps; + + /// The total number of results in the search. + final int totalResults; + + /// The next incremental starting point after the defined + /// itemOffset. + final int? nextItemOffset; + + SearchStepsResponse({ + required this.steps, + required this.totalResults, + this.nextItemOffset, + }); + + factory SearchStepsResponse.fromJson(Map json) { + return SearchStepsResponse( + steps: (json['steps'] as List) + .whereNotNull() + .map((e) => StepSearchSummary.fromJson(e as Map)) + .toList(), + totalResults: json['totalResults'] as int, + nextItemOffset: json['nextItemOffset'] as int?, + ); + } + + Map toJson() { + final steps = this.steps; + final totalResults = this.totalResults; + final nextItemOffset = this.nextItemOffset; + return { + 'steps': steps, + 'totalResults': totalResults, + if (nextItemOffset != null) 'nextItemOffset': nextItemOffset, + }; + } +} + +class SearchTasksResponse { + /// Tasks in the search. + final List tasks; + + /// The total number of results in the search. + final int totalResults; + + /// The next incremental starting point after the defined + /// itemOffset. + final int? nextItemOffset; + + SearchTasksResponse({ + required this.tasks, + required this.totalResults, + this.nextItemOffset, + }); + + factory SearchTasksResponse.fromJson(Map json) { + return SearchTasksResponse( + tasks: (json['tasks'] as List) + .whereNotNull() + .map((e) => TaskSearchSummary.fromJson(e as Map)) + .toList(), + totalResults: json['totalResults'] as int, + nextItemOffset: json['nextItemOffset'] as int?, + ); + } + + Map toJson() { + final tasks = this.tasks; + final totalResults = this.totalResults; + final nextItemOffset = this.nextItemOffset; + return { + 'tasks': tasks, + 'totalResults': totalResults, + if (nextItemOffset != null) 'nextItemOffset': nextItemOffset, + }; + } +} + +/// Searches for a particular search term. +class SearchTermFilterExpression { + /// The term to search for. + final String searchTerm; + + SearchTermFilterExpression({ + required this.searchTerm, + }); + + Map toJson() { + final searchTerm = this.searchTerm; + return { + 'searchTerm': searchTerm, + }; + } +} + +class SearchWorkersResponse { + /// The total number of results in the search. + final int totalResults; + + /// The workers for the search. + final List workers; + + /// The next incremental starting point after the defined + /// itemOffset. + final int? nextItemOffset; + + SearchWorkersResponse({ + required this.totalResults, + required this.workers, + this.nextItemOffset, + }); + + factory SearchWorkersResponse.fromJson(Map json) { + return SearchWorkersResponse( + totalResults: json['totalResults'] as int, + workers: (json['workers'] as List) + .whereNotNull() + .map((e) => WorkerSearchSummary.fromJson(e as Map)) + .toList(), + nextItemOffset: json['nextItemOffset'] as int?, + ); + } + + Map toJson() { + final totalResults = this.totalResults; + final workers = this.workers; + final nextItemOffset = this.nextItemOffset; + return { + 'totalResults': totalResults, + 'workers': workers, + if (nextItemOffset != null) 'nextItemOffset': nextItemOffset, + }; + } +} + +/// The configuration details for a service managed Amazon EC2 fleet. +class ServiceManagedEc2FleetConfiguration { + /// The Amazon EC2 instance capabilities. + final ServiceManagedEc2InstanceCapabilities instanceCapabilities; + + /// The Amazon EC2 market type. + final ServiceManagedEc2InstanceMarketOptions instanceMarketOptions; + + ServiceManagedEc2FleetConfiguration({ + required this.instanceCapabilities, + required this.instanceMarketOptions, + }); + + factory ServiceManagedEc2FleetConfiguration.fromJson( + Map json) { + return ServiceManagedEc2FleetConfiguration( + instanceCapabilities: ServiceManagedEc2InstanceCapabilities.fromJson( + json['instanceCapabilities'] as Map), + instanceMarketOptions: ServiceManagedEc2InstanceMarketOptions.fromJson( + json['instanceMarketOptions'] as Map), + ); + } + + Map toJson() { + final instanceCapabilities = this.instanceCapabilities; + final instanceMarketOptions = this.instanceMarketOptions; + return { + 'instanceCapabilities': instanceCapabilities, + 'instanceMarketOptions': instanceMarketOptions, + }; + } +} + +/// The Amazon EC2 instance capabilities. +class ServiceManagedEc2InstanceCapabilities { + /// The CPU architecture type. + final CpuArchitectureType cpuArchitectureType; + + /// The memory, as MiB, for the Amazon EC2 instance type. + final MemoryMiBRange memoryMiB; + + /// The operating system (OS) family. + final ServiceManagedFleetOperatingSystemFamily osFamily; + + /// The amount of vCPU to require for instances in this fleet. + final VCpuCountRange vCpuCount; + + /// The allowable Amazon EC2 instance types. + final List? allowedInstanceTypes; + + /// The custom capability amounts to require for instances in this fleet. + final List? customAmounts; + + /// The custom capability attributes to require for instances in this fleet. + final List? customAttributes; + + /// The instance types to exclude from the fleet. + final List? excludedInstanceTypes; + + /// The root EBS volume. + final Ec2EbsVolume? rootEbsVolume; + + ServiceManagedEc2InstanceCapabilities({ + required this.cpuArchitectureType, + required this.memoryMiB, + required this.osFamily, + required this.vCpuCount, + this.allowedInstanceTypes, + this.customAmounts, + this.customAttributes, + this.excludedInstanceTypes, + this.rootEbsVolume, + }); + + factory ServiceManagedEc2InstanceCapabilities.fromJson( + Map json) { + return ServiceManagedEc2InstanceCapabilities( + cpuArchitectureType: + (json['cpuArchitectureType'] as String).toCpuArchitectureType(), + memoryMiB: + MemoryMiBRange.fromJson(json['memoryMiB'] as Map), + osFamily: (json['osFamily'] as String) + .toServiceManagedFleetOperatingSystemFamily(), + vCpuCount: + VCpuCountRange.fromJson(json['vCpuCount'] as Map), + allowedInstanceTypes: (json['allowedInstanceTypes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + customAmounts: (json['customAmounts'] as List?) + ?.whereNotNull() + .map((e) => FleetAmountCapability.fromJson(e as Map)) + .toList(), + customAttributes: (json['customAttributes'] as List?) + ?.whereNotNull() + .map((e) => + FleetAttributeCapability.fromJson(e as Map)) + .toList(), + excludedInstanceTypes: (json['excludedInstanceTypes'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + rootEbsVolume: json['rootEbsVolume'] != null + ? Ec2EbsVolume.fromJson(json['rootEbsVolume'] as Map) + : null, + ); + } + + Map toJson() { + final cpuArchitectureType = this.cpuArchitectureType; + final memoryMiB = this.memoryMiB; + final osFamily = this.osFamily; + final vCpuCount = this.vCpuCount; + final allowedInstanceTypes = this.allowedInstanceTypes; + final customAmounts = this.customAmounts; + final customAttributes = this.customAttributes; + final excludedInstanceTypes = this.excludedInstanceTypes; + final rootEbsVolume = this.rootEbsVolume; + return { + 'cpuArchitectureType': cpuArchitectureType.toValue(), + 'memoryMiB': memoryMiB, + 'osFamily': osFamily.toValue(), + 'vCpuCount': vCpuCount, + if (allowedInstanceTypes != null) + 'allowedInstanceTypes': allowedInstanceTypes, + if (customAmounts != null) 'customAmounts': customAmounts, + if (customAttributes != null) 'customAttributes': customAttributes, + if (excludedInstanceTypes != null) + 'excludedInstanceTypes': excludedInstanceTypes, + if (rootEbsVolume != null) 'rootEbsVolume': rootEbsVolume, + }; + } +} + +/// The details of the Amazon EC2 instance market options for a service managed +/// fleet. +class ServiceManagedEc2InstanceMarketOptions { + /// The Amazon EC2 instance type. + final Ec2MarketType type; + + ServiceManagedEc2InstanceMarketOptions({ + required this.type, + }); + + factory ServiceManagedEc2InstanceMarketOptions.fromJson( + Map json) { + return ServiceManagedEc2InstanceMarketOptions( + type: (json['type'] as String).toEc2MarketType(), + ); + } + + Map toJson() { + final type = this.type; + return { + 'type': type.toValue(), + }; + } +} + +enum ServiceManagedFleetOperatingSystemFamily { + windows, + linux, +} + +extension ServiceManagedFleetOperatingSystemFamilyValueExtension + on ServiceManagedFleetOperatingSystemFamily { + String toValue() { + switch (this) { + case ServiceManagedFleetOperatingSystemFamily.windows: + return 'WINDOWS'; + case ServiceManagedFleetOperatingSystemFamily.linux: + return 'LINUX'; + } + } +} + +extension ServiceManagedFleetOperatingSystemFamilyFromString on String { + ServiceManagedFleetOperatingSystemFamily + toServiceManagedFleetOperatingSystemFamily() { + switch (this) { + case 'WINDOWS': + return ServiceManagedFleetOperatingSystemFamily.windows; + case 'LINUX': + return ServiceManagedFleetOperatingSystemFamily.linux; + } + throw Exception( + '$this is not known in enum ServiceManagedFleetOperatingSystemFamily'); + } +} + +/// The definition of the session action. +class SessionActionDefinition { + /// The environment to enter into. + final EnvironmentEnterSessionActionDefinition? envEnter; + + /// The environment to exit from. + final EnvironmentExitSessionActionDefinition? envExit; + + /// The job attachments to sync with a session action. + final SyncInputJobAttachmentsSessionActionDefinition? syncInputJobAttachments; + + /// The task run in the session. + final TaskRunSessionActionDefinition? taskRun; + + SessionActionDefinition({ + this.envEnter, + this.envExit, + this.syncInputJobAttachments, + this.taskRun, + }); + + factory SessionActionDefinition.fromJson(Map json) { + return SessionActionDefinition( + envEnter: json['envEnter'] != null + ? EnvironmentEnterSessionActionDefinition.fromJson( + json['envEnter'] as Map) + : null, + envExit: json['envExit'] != null + ? EnvironmentExitSessionActionDefinition.fromJson( + json['envExit'] as Map) + : null, + syncInputJobAttachments: json['syncInputJobAttachments'] != null + ? SyncInputJobAttachmentsSessionActionDefinition.fromJson( + json['syncInputJobAttachments'] as Map) + : null, + taskRun: json['taskRun'] != null + ? TaskRunSessionActionDefinition.fromJson( + json['taskRun'] as Map) + : null, + ); + } + + Map toJson() { + final envEnter = this.envEnter; + final envExit = this.envExit; + final syncInputJobAttachments = this.syncInputJobAttachments; + final taskRun = this.taskRun; + return { + if (envEnter != null) 'envEnter': envEnter, + if (envExit != null) 'envExit': envExit, + if (syncInputJobAttachments != null) + 'syncInputJobAttachments': syncInputJobAttachments, + if (taskRun != null) 'taskRun': taskRun, + }; + } +} + +/// The details of a session action definition. +class SessionActionDefinitionSummary { + /// The environment to enter into. + final EnvironmentEnterSessionActionDefinitionSummary? envEnter; + + /// The environment to exit from. + final EnvironmentExitSessionActionDefinitionSummary? envExit; + + /// The job attachments to sync with the session action definition. + final SyncInputJobAttachmentsSessionActionDefinitionSummary? + syncInputJobAttachments; + + /// The task run. + final TaskRunSessionActionDefinitionSummary? taskRun; + + SessionActionDefinitionSummary({ + this.envEnter, + this.envExit, + this.syncInputJobAttachments, + this.taskRun, + }); + + factory SessionActionDefinitionSummary.fromJson(Map json) { + return SessionActionDefinitionSummary( + envEnter: json['envEnter'] != null + ? EnvironmentEnterSessionActionDefinitionSummary.fromJson( + json['envEnter'] as Map) + : null, + envExit: json['envExit'] != null + ? EnvironmentExitSessionActionDefinitionSummary.fromJson( + json['envExit'] as Map) + : null, + syncInputJobAttachments: json['syncInputJobAttachments'] != null + ? SyncInputJobAttachmentsSessionActionDefinitionSummary.fromJson( + json['syncInputJobAttachments'] as Map) + : null, + taskRun: json['taskRun'] != null + ? TaskRunSessionActionDefinitionSummary.fromJson( + json['taskRun'] as Map) + : null, + ); + } + + Map toJson() { + final envEnter = this.envEnter; + final envExit = this.envExit; + final syncInputJobAttachments = this.syncInputJobAttachments; + final taskRun = this.taskRun; + return { + if (envEnter != null) 'envEnter': envEnter, + if (envExit != null) 'envExit': envExit, + if (syncInputJobAttachments != null) + 'syncInputJobAttachments': syncInputJobAttachments, + if (taskRun != null) 'taskRun': taskRun, + }; + } +} + +enum SessionActionStatus { + assigned, + running, + canceling, + succeeded, + failed, + interrupted, + canceled, + neverAttempted, + scheduled, + reclaiming, + reclaimed, +} + +extension SessionActionStatusValueExtension on SessionActionStatus { + String toValue() { + switch (this) { + case SessionActionStatus.assigned: + return 'ASSIGNED'; + case SessionActionStatus.running: + return 'RUNNING'; + case SessionActionStatus.canceling: + return 'CANCELING'; + case SessionActionStatus.succeeded: + return 'SUCCEEDED'; + case SessionActionStatus.failed: + return 'FAILED'; + case SessionActionStatus.interrupted: + return 'INTERRUPTED'; + case SessionActionStatus.canceled: + return 'CANCELED'; + case SessionActionStatus.neverAttempted: + return 'NEVER_ATTEMPTED'; + case SessionActionStatus.scheduled: + return 'SCHEDULED'; + case SessionActionStatus.reclaiming: + return 'RECLAIMING'; + case SessionActionStatus.reclaimed: + return 'RECLAIMED'; + } + } +} + +extension SessionActionStatusFromString on String { + SessionActionStatus toSessionActionStatus() { + switch (this) { + case 'ASSIGNED': + return SessionActionStatus.assigned; + case 'RUNNING': + return SessionActionStatus.running; + case 'CANCELING': + return SessionActionStatus.canceling; + case 'SUCCEEDED': + return SessionActionStatus.succeeded; + case 'FAILED': + return SessionActionStatus.failed; + case 'INTERRUPTED': + return SessionActionStatus.interrupted; + case 'CANCELED': + return SessionActionStatus.canceled; + case 'NEVER_ATTEMPTED': + return SessionActionStatus.neverAttempted; + case 'SCHEDULED': + return SessionActionStatus.scheduled; + case 'RECLAIMING': + return SessionActionStatus.reclaiming; + case 'RECLAIMED': + return SessionActionStatus.reclaimed; + } + throw Exception('$this is not known in enum SessionActionStatus'); + } +} + +/// The details of a session action. +class SessionActionSummary { + /// The session action definition. + final SessionActionDefinitionSummary definition; + + /// The session action ID. + final String sessionActionId; + + /// The status of the session action. + final SessionActionStatus status; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The completion percentage for the session action. + final double? progressPercent; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The Linux timestamp of the last date and time that the session action was + /// updated. + final DateTime? workerUpdatedAt; + + SessionActionSummary({ + required this.definition, + required this.sessionActionId, + required this.status, + this.endedAt, + this.progressPercent, + this.startedAt, + this.workerUpdatedAt, + }); + + factory SessionActionSummary.fromJson(Map json) { + return SessionActionSummary( + definition: SessionActionDefinitionSummary.fromJson( + json['definition'] as Map), + sessionActionId: json['sessionActionId'] as String, + status: (json['status'] as String).toSessionActionStatus(), + endedAt: timeStampFromJson(json['endedAt']), + progressPercent: json['progressPercent'] as double?, + startedAt: timeStampFromJson(json['startedAt']), + workerUpdatedAt: timeStampFromJson(json['workerUpdatedAt']), + ); + } + + Map toJson() { + final definition = this.definition; + final sessionActionId = this.sessionActionId; + final status = this.status; + final endedAt = this.endedAt; + final progressPercent = this.progressPercent; + final startedAt = this.startedAt; + final workerUpdatedAt = this.workerUpdatedAt; + return { + 'definition': definition, + 'sessionActionId': sessionActionId, + 'status': status.toValue(), + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (progressPercent != null) 'progressPercent': progressPercent, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (workerUpdatedAt != null) + 'workerUpdatedAt': iso8601ToJson(workerUpdatedAt), + }; + } +} + +enum SessionLifecycleStatus { + started, + updateInProgress, + updateSucceeded, + updateFailed, + ended, +} + +extension SessionLifecycleStatusValueExtension on SessionLifecycleStatus { + String toValue() { + switch (this) { + case SessionLifecycleStatus.started: + return 'STARTED'; + case SessionLifecycleStatus.updateInProgress: + return 'UPDATE_IN_PROGRESS'; + case SessionLifecycleStatus.updateSucceeded: + return 'UPDATE_SUCCEEDED'; + case SessionLifecycleStatus.updateFailed: + return 'UPDATE_FAILED'; + case SessionLifecycleStatus.ended: + return 'ENDED'; + } + } +} + +extension SessionLifecycleStatusFromString on String { + SessionLifecycleStatus toSessionLifecycleStatus() { + switch (this) { + case 'STARTED': + return SessionLifecycleStatus.started; + case 'UPDATE_IN_PROGRESS': + return SessionLifecycleStatus.updateInProgress; + case 'UPDATE_SUCCEEDED': + return SessionLifecycleStatus.updateSucceeded; + case 'UPDATE_FAILED': + return SessionLifecycleStatus.updateFailed; + case 'ENDED': + return SessionLifecycleStatus.ended; + } + throw Exception('$this is not known in enum SessionLifecycleStatus'); + } +} + +enum SessionLifecycleTargetStatus { + ended, +} + +extension SessionLifecycleTargetStatusValueExtension + on SessionLifecycleTargetStatus { + String toValue() { + switch (this) { + case SessionLifecycleTargetStatus.ended: + return 'ENDED'; + } + } +} + +extension SessionLifecycleTargetStatusFromString on String { + SessionLifecycleTargetStatus toSessionLifecycleTargetStatus() { + switch (this) { + case 'ENDED': + return SessionLifecycleTargetStatus.ended; + } + throw Exception('$this is not known in enum SessionLifecycleTargetStatus'); + } +} + +/// The summary of a session. +class SessionSummary { + /// The fleet ID. + final String fleetId; + + /// The life cycle status for the session. + final SessionLifecycleStatus lifecycleStatus; + + /// The session ID. + final String sessionId; + + /// The date and time the resource started running. + final DateTime startedAt; + + /// The worker ID. + final String workerId; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The target life cycle status for the session. + final SessionLifecycleTargetStatus? targetLifecycleStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + SessionSummary({ + required this.fleetId, + required this.lifecycleStatus, + required this.sessionId, + required this.startedAt, + required this.workerId, + this.endedAt, + this.targetLifecycleStatus, + this.updatedAt, + this.updatedBy, + }); + + factory SessionSummary.fromJson(Map json) { + return SessionSummary( + fleetId: json['fleetId'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toSessionLifecycleStatus(), + sessionId: json['sessionId'] as String, + startedAt: nonNullableTimeStampFromJson(json['startedAt'] as Object), + workerId: json['workerId'] as String, + endedAt: timeStampFromJson(json['endedAt']), + targetLifecycleStatus: (json['targetLifecycleStatus'] as String?) + ?.toSessionLifecycleTargetStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final fleetId = this.fleetId; + final lifecycleStatus = this.lifecycleStatus; + final sessionId = this.sessionId; + final startedAt = this.startedAt; + final workerId = this.workerId; + final endedAt = this.endedAt; + final targetLifecycleStatus = this.targetLifecycleStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'fleetId': fleetId, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'sessionId': sessionId, + 'startedAt': iso8601ToJson(startedAt), + 'workerId': workerId, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (targetLifecycleStatus != null) + 'targetLifecycleStatus': targetLifecycleStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum SessionsStatisticsAggregationStatus { + inProgress, + timeout, + failed, + completed, +} + +extension SessionsStatisticsAggregationStatusValueExtension + on SessionsStatisticsAggregationStatus { + String toValue() { + switch (this) { + case SessionsStatisticsAggregationStatus.inProgress: + return 'IN_PROGRESS'; + case SessionsStatisticsAggregationStatus.timeout: + return 'TIMEOUT'; + case SessionsStatisticsAggregationStatus.failed: + return 'FAILED'; + case SessionsStatisticsAggregationStatus.completed: + return 'COMPLETED'; + } + } +} + +extension SessionsStatisticsAggregationStatusFromString on String { + SessionsStatisticsAggregationStatus toSessionsStatisticsAggregationStatus() { + switch (this) { + case 'IN_PROGRESS': + return SessionsStatisticsAggregationStatus.inProgress; + case 'TIMEOUT': + return SessionsStatisticsAggregationStatus.timeout; + case 'FAILED': + return SessionsStatisticsAggregationStatus.failed; + case 'COMPLETED': + return SessionsStatisticsAggregationStatus.completed; + } + throw Exception( + '$this is not known in enum SessionsStatisticsAggregationStatus'); + } +} + +/// Specifies the fleet IDs or queue IDs to return statistics. You can specify +/// only fleet IDs or queue IDS, not both. +class SessionsStatisticsResources { + /// One to 10 fleet IDs that specify the fleets to return statistics for. If you + /// specify the fleetIds field, you can't specify the + /// queueIds field. + final List? fleetIds; + + /// One to 10 queue IDs that specify the queues to return statistics for. If you + /// specify the queueIds field, you can't specify the + /// fleetIds field. + final List? queueIds; + + SessionsStatisticsResources({ + this.fleetIds, + this.queueIds, + }); + + Map toJson() { + final fleetIds = this.fleetIds; + final queueIds = this.queueIds; + return { + if (fleetIds != null) 'fleetIds': fleetIds, + if (queueIds != null) 'queueIds': queueIds, + }; + } +} + +enum SortOrder { + ascending, + descending, +} + +extension SortOrderValueExtension on SortOrder { + String toValue() { + switch (this) { + case SortOrder.ascending: + return 'ASCENDING'; + case SortOrder.descending: + return 'DESCENDING'; + } + } +} + +extension SortOrderFromString on String { + SortOrder toSortOrder() { + switch (this) { + case 'ASCENDING': + return SortOrder.ascending; + case 'DESCENDING': + return SortOrder.descending; + } + throw Exception('$this is not known in enum SortOrder'); + } +} + +class StartSessionsStatisticsAggregationResponse { + /// A unique identifier for the aggregated statistics. Use this identifier with + /// the GetAggregatedStatisticsForSessions operation to return the + /// statistics. + final String aggregationId; + + StartSessionsStatisticsAggregationResponse({ + required this.aggregationId, + }); + + factory StartSessionsStatisticsAggregationResponse.fromJson( + Map json) { + return StartSessionsStatisticsAggregationResponse( + aggregationId: json['aggregationId'] as String, + ); + } + + Map toJson() { + final aggregationId = this.aggregationId; + return { + 'aggregationId': aggregationId, + }; + } +} + +/// A list of statistics for a session. +class Statistics { + /// How the statistics should appear in USD. Options include: minimum, maximum, + /// average or sum. + final Stats costInUsd; + + /// The number of instances in a list of statistics. + final int count; + + /// The total aggregated runtime. + final Stats runtimeInSeconds; + + /// The end time for the aggregation. + final DateTime? aggregationEndTime; + + /// The start time for the aggregation. + final DateTime? aggregationStartTime; + + /// The fleet ID. + final String? fleetId; + + /// The type of instance. + final String? instanceType; + + /// The job ID. + final String? jobId; + + /// The job name. + final String? jobName; + + /// The licensed product. + final String? licenseProduct; + + /// The queue ID. + final String? queueId; + + /// The type of usage for the statistics. + final UsageType? usageType; + + /// The user ID. + final String? userId; + + Statistics({ + required this.costInUsd, + required this.count, + required this.runtimeInSeconds, + this.aggregationEndTime, + this.aggregationStartTime, + this.fleetId, + this.instanceType, + this.jobId, + this.jobName, + this.licenseProduct, + this.queueId, + this.usageType, + this.userId, + }); + + factory Statistics.fromJson(Map json) { + return Statistics( + costInUsd: Stats.fromJson(json['costInUsd'] as Map), + count: json['count'] as int, + runtimeInSeconds: + Stats.fromJson(json['runtimeInSeconds'] as Map), + aggregationEndTime: timeStampFromJson(json['aggregationEndTime']), + aggregationStartTime: timeStampFromJson(json['aggregationStartTime']), + fleetId: json['fleetId'] as String?, + instanceType: json['instanceType'] as String?, + jobId: json['jobId'] as String?, + jobName: json['jobName'] as String?, + licenseProduct: json['licenseProduct'] as String?, + queueId: json['queueId'] as String?, + usageType: (json['usageType'] as String?)?.toUsageType(), + userId: json['userId'] as String?, + ); + } + + Map toJson() { + final costInUsd = this.costInUsd; + final count = this.count; + final runtimeInSeconds = this.runtimeInSeconds; + final aggregationEndTime = this.aggregationEndTime; + final aggregationStartTime = this.aggregationStartTime; + final fleetId = this.fleetId; + final instanceType = this.instanceType; + final jobId = this.jobId; + final jobName = this.jobName; + final licenseProduct = this.licenseProduct; + final queueId = this.queueId; + final usageType = this.usageType; + final userId = this.userId; + return { + 'costInUsd': costInUsd, + 'count': count, + 'runtimeInSeconds': runtimeInSeconds, + if (aggregationEndTime != null) + 'aggregationEndTime': iso8601ToJson(aggregationEndTime), + if (aggregationStartTime != null) + 'aggregationStartTime': iso8601ToJson(aggregationStartTime), + if (fleetId != null) 'fleetId': fleetId, + if (instanceType != null) 'instanceType': instanceType, + if (jobId != null) 'jobId': jobId, + if (jobName != null) 'jobName': jobName, + if (licenseProduct != null) 'licenseProduct': licenseProduct, + if (queueId != null) 'queueId': queueId, + if (usageType != null) 'usageType': usageType.toValue(), + if (userId != null) 'userId': userId, + }; + } +} + +/// The minimum, maximum, average, and sum. +class Stats { + /// The average of the usage statistics. + final double? avg; + + /// The maximum among the usage statistics. + final double? max; + + /// The minimum of the usage statistics. + final double? min; + + /// The sum of the usage statistics. + final double? sum; + + Stats({ + this.avg, + this.max, + this.min, + this.sum, + }); + + factory Stats.fromJson(Map json) { + return Stats( + avg: json['avg'] as double?, + max: json['max'] as double?, + min: json['min'] as double?, + sum: json['sum'] as double?, + ); + } + + Map toJson() { + final avg = this.avg; + final max = this.max; + final min = this.min; + final sum = this.sum; + return { + if (avg != null) 'avg': avg, + if (max != null) 'max': max, + if (min != null) 'min': min, + if (sum != null) 'sum': sum, + }; + } +} + +/// The details outlining the minimum and maximum capability of a step. +class StepAmountCapability { + /// The name of the step. + final String name; + + /// The maximum amount. + final double? max; + + /// The minimum amount. + final double? min; + + /// The amount value. + final double? value; + + StepAmountCapability({ + required this.name, + this.max, + this.min, + this.value, + }); + + factory StepAmountCapability.fromJson(Map json) { + return StepAmountCapability( + name: json['name'] as String, + max: json['max'] as double?, + min: json['min'] as double?, + value: json['value'] as double?, + ); + } + + Map toJson() { + final name = this.name; + final max = this.max; + final min = this.min; + final value = this.value; + return { + 'name': name, + if (max != null) 'max': max, + if (min != null) 'min': min, + if (value != null) 'value': value, + }; + } +} + +/// The list of step attributes. +class StepAttributeCapability { + /// The name of the step attribute. + final String name; + + /// Requires all of the step attribute values. + final List? allOf; + + /// Requires any of the step attributes in a given list. + final List? anyOf; + + StepAttributeCapability({ + required this.name, + this.allOf, + this.anyOf, + }); + + factory StepAttributeCapability.fromJson(Map json) { + return StepAttributeCapability( + name: json['name'] as String, + allOf: (json['allOf'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + anyOf: (json['anyOf'] as List?) + ?.whereNotNull() + .map((e) => e as String) + .toList(), + ); + } + + Map toJson() { + final name = this.name; + final allOf = this.allOf; + final anyOf = this.anyOf; + return { + 'name': name, + if (allOf != null) 'allOf': allOf, + if (anyOf != null) 'anyOf': anyOf, + }; + } +} + +/// The details of a step consumer. +class StepConsumer { + /// The step consumer status. + final DependencyConsumerResolutionStatus status; + + /// The step ID. + final String stepId; + + StepConsumer({ + required this.status, + required this.stepId, + }); + + factory StepConsumer.fromJson(Map json) { + return StepConsumer( + status: (json['status'] as String).toDependencyConsumerResolutionStatus(), + stepId: json['stepId'] as String, + ); + } + + Map toJson() { + final status = this.status; + final stepId = this.stepId; + return { + 'status': status.toValue(), + 'stepId': stepId, + }; + } +} + +/// The details of step dependency. +class StepDependency { + /// The step dependency status. + final DependencyConsumerResolutionStatus status; + + /// The step ID. + final String stepId; + + StepDependency({ + required this.status, + required this.stepId, + }); + + factory StepDependency.fromJson(Map json) { + return StepDependency( + status: (json['status'] as String).toDependencyConsumerResolutionStatus(), + stepId: json['stepId'] as String, + ); + } + + Map toJson() { + final status = this.status; + final stepId = this.stepId; + return { + 'status': status.toValue(), + 'stepId': stepId, + }; + } +} + +/// The details of a step entity. +class StepDetailsEntity { + /// The dependencies for a step. + final List dependencies; + + /// The job ID. + final String jobId; + + /// The schema version for a step template. + final String schemaVersion; + + /// The step ID. + final String stepId; + + /// The template for a step. + final Document template; + + StepDetailsEntity({ + required this.dependencies, + required this.jobId, + required this.schemaVersion, + required this.stepId, + required this.template, + }); + + factory StepDetailsEntity.fromJson(Map json) { + return StepDetailsEntity( + dependencies: (json['dependencies'] as List) + .whereNotNull() + .map((e) => e as String) + .toList(), + jobId: json['jobId'] as String, + schemaVersion: json['schemaVersion'] as String, + stepId: json['stepId'] as String, + template: Document.fromJson(json['template'] as Map), + ); + } + + Map toJson() { + final dependencies = this.dependencies; + final jobId = this.jobId; + final schemaVersion = this.schemaVersion; + final stepId = this.stepId; + final template = this.template; + return { + 'dependencies': dependencies, + 'jobId': jobId, + 'schemaVersion': schemaVersion, + 'stepId': stepId, + 'template': template, + }; + } +} + +/// The details of the step error. +class StepDetailsError { + /// The error code. + final JobEntityErrorCode code; + + /// The job ID. + final String jobId; + + /// The error message detailing the error's cause. + final String message; + + /// The step ID. + final String stepId; + + StepDetailsError({ + required this.code, + required this.jobId, + required this.message, + required this.stepId, + }); + + factory StepDetailsError.fromJson(Map json) { + return StepDetailsError( + code: (json['code'] as String).toJobEntityErrorCode(), + jobId: json['jobId'] as String, + message: json['message'] as String, + stepId: json['stepId'] as String, + ); + } + + Map toJson() { + final code = this.code; + final jobId = this.jobId; + final message = this.message; + final stepId = this.stepId; + return { + 'code': code.toValue(), + 'jobId': jobId, + 'message': message, + 'stepId': stepId, + }; + } +} + +/// The details of identifiers for a step. +class StepDetailsIdentifiers { + /// The job ID. + final String jobId; + + /// The step ID. + final String stepId; + + StepDetailsIdentifiers({ + required this.jobId, + required this.stepId, + }); + + Map toJson() { + final jobId = this.jobId; + final stepId = this.stepId; + return { + 'jobId': jobId, + 'stepId': stepId, + }; + } +} + +enum StepLifecycleStatus { + createComplete, + updateInProgress, + updateFailed, + updateSucceeded, +} + +extension StepLifecycleStatusValueExtension on StepLifecycleStatus { + String toValue() { + switch (this) { + case StepLifecycleStatus.createComplete: + return 'CREATE_COMPLETE'; + case StepLifecycleStatus.updateInProgress: + return 'UPDATE_IN_PROGRESS'; + case StepLifecycleStatus.updateFailed: + return 'UPDATE_FAILED'; + case StepLifecycleStatus.updateSucceeded: + return 'UPDATE_SUCCEEDED'; + } + } +} + +extension StepLifecycleStatusFromString on String { + StepLifecycleStatus toStepLifecycleStatus() { + switch (this) { + case 'CREATE_COMPLETE': + return StepLifecycleStatus.createComplete; + case 'UPDATE_IN_PROGRESS': + return StepLifecycleStatus.updateInProgress; + case 'UPDATE_FAILED': + return StepLifecycleStatus.updateFailed; + case 'UPDATE_SUCCEEDED': + return StepLifecycleStatus.updateSucceeded; + } + throw Exception('$this is not known in enum StepLifecycleStatus'); + } +} + +/// The details of a step parameter. +class StepParameter { + /// The name of the parameter. + final String name; + + /// The data type of the parameter. + final StepParameterType type; + + StepParameter({ + required this.name, + required this.type, + }); + + factory StepParameter.fromJson(Map json) { + return StepParameter( + name: json['name'] as String, + type: (json['type'] as String).toStepParameterType(), + ); + } + + Map toJson() { + final name = this.name; + final type = this.type; + return { + 'name': name, + 'type': type.toValue(), + }; + } +} + +enum StepParameterType { + int, + float, + string, + path, +} + +extension StepParameterTypeValueExtension on StepParameterType { + String toValue() { + switch (this) { + case StepParameterType.int: + return 'INT'; + case StepParameterType.float: + return 'FLOAT'; + case StepParameterType.string: + return 'STRING'; + case StepParameterType.path: + return 'PATH'; + } + } +} + +extension StepParameterTypeFromString on String { + StepParameterType toStepParameterType() { + switch (this) { + case 'INT': + return StepParameterType.int; + case 'FLOAT': + return StepParameterType.float; + case 'STRING': + return StepParameterType.string; + case 'PATH': + return StepParameterType.path; + } + throw Exception('$this is not known in enum StepParameterType'); + } +} + +/// The details of required step capabilities. +class StepRequiredCapabilities { + /// The capability amounts that the step requires. + final List amounts; + + /// The capability attributes that the step requires. + final List attributes; + + StepRequiredCapabilities({ + required this.amounts, + required this.attributes, + }); + + factory StepRequiredCapabilities.fromJson(Map json) { + return StepRequiredCapabilities( + amounts: (json['amounts'] as List) + .whereNotNull() + .map((e) => StepAmountCapability.fromJson(e as Map)) + .toList(), + attributes: (json['attributes'] as List) + .whereNotNull() + .map((e) => + StepAttributeCapability.fromJson(e as Map)) + .toList(), + ); + } + + Map toJson() { + final amounts = this.amounts; + final attributes = this.attributes; + return { + 'amounts': amounts, + 'attributes': attributes, + }; + } +} + +/// The details of a step search. +class StepSearchSummary { + /// The date and time the resource was created. + final DateTime? createdAt; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The job ID. + final String? jobId; + + /// The life cycle status. + final StepLifecycleStatus? lifecycleStatus; + + /// The life cycle status message. + final String? lifecycleStatusMessage; + + /// The step name. + final String? name; + + /// The parameters and combination expressions for the search. + final ParameterSpace? parameterSpace; + + /// The queue ID. + final String? queueId; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The step ID. + final String? stepId; + + /// The task status to start with on the job. + final StepTargetTaskRunStatus? targetTaskRunStatus; + + /// The task run status for the job. + /// + ///
        + ///
      • + /// PENDING–pending and waiting for resources. + ///
      • + ///
      • + /// READY–ready to be processed. + ///
      • + ///
      • + /// ASSIGNED–assigned and will run next on a worker. + ///
      • + ///
      • + /// SCHEDULED–scheduled to be run on a worker. + ///
      • + ///
      • + /// INTERRUPTING–being interrupted. + ///
      • + ///
      • + /// RUNNING–running on a worker. + ///
      • + ///
      • + /// SUSPENDED–the task is suspended. + ///
      • + ///
      • + /// CANCELED–the task has been canceled. + ///
      • + ///
      • + /// FAILED–the task has failed. + ///
      • + ///
      • + /// SUCCEEDED–the task has succeeded. + ///
      • + ///
      + final TaskRunStatus? taskRunStatus; + + /// The number of tasks running on the job. + final Map? taskRunStatusCounts; + + StepSearchSummary({ + this.createdAt, + this.endedAt, + this.jobId, + this.lifecycleStatus, + this.lifecycleStatusMessage, + this.name, + this.parameterSpace, + this.queueId, + this.startedAt, + this.stepId, + this.targetTaskRunStatus, + this.taskRunStatus, + this.taskRunStatusCounts, + }); + + factory StepSearchSummary.fromJson(Map json) { + return StepSearchSummary( + createdAt: timeStampFromJson(json['createdAt']), + endedAt: timeStampFromJson(json['endedAt']), + jobId: json['jobId'] as String?, + lifecycleStatus: + (json['lifecycleStatus'] as String?)?.toStepLifecycleStatus(), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String?, + name: json['name'] as String?, + parameterSpace: json['parameterSpace'] != null + ? ParameterSpace.fromJson( + json['parameterSpace'] as Map) + : null, + queueId: json['queueId'] as String?, + startedAt: timeStampFromJson(json['startedAt']), + stepId: json['stepId'] as String?, + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toStepTargetTaskRunStatus(), + taskRunStatus: (json['taskRunStatus'] as String?)?.toTaskRunStatus(), + taskRunStatusCounts: + (json['taskRunStatusCounts'] as Map?) + ?.map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final endedAt = this.endedAt; + final jobId = this.jobId; + final lifecycleStatus = this.lifecycleStatus; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final name = this.name; + final parameterSpace = this.parameterSpace; + final queueId = this.queueId; + final startedAt = this.startedAt; + final stepId = this.stepId; + final targetTaskRunStatus = this.targetTaskRunStatus; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + return { + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (jobId != null) 'jobId': jobId, + if (lifecycleStatus != null) 'lifecycleStatus': lifecycleStatus.toValue(), + if (lifecycleStatusMessage != null) + 'lifecycleStatusMessage': lifecycleStatusMessage, + if (name != null) 'name': name, + if (parameterSpace != null) 'parameterSpace': parameterSpace, + if (queueId != null) 'queueId': queueId, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (stepId != null) 'stepId': stepId, + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (taskRunStatus != null) 'taskRunStatus': taskRunStatus.toValue(), + if (taskRunStatusCounts != null) + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + }; + } +} + +/// The details for a step. +class StepSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The life cycle status. + final StepLifecycleStatus lifecycleStatus; + + /// The name of the step. + final String name; + + /// The step ID. + final String stepId; + + /// The task run status for the job. + /// + ///
        + ///
      • + /// PENDING–pending and waiting for resources. + ///
      • + ///
      • + /// READY–ready to process. + ///
      • + ///
      • + /// ASSIGNED–assigned and will run next on a worker. + ///
      • + ///
      • + /// SCHEDULED–scheduled to run on a worker. + ///
      • + ///
      • + /// INTERRUPTING–being interrupted. + ///
      • + ///
      • + /// RUNNING–running on a worker. + ///
      • + ///
      • + /// SUSPENDED–the task is suspended. + ///
      • + ///
      • + /// CANCELED–the task has been canceled. + ///
      • + ///
      • + /// FAILED–the task has failed. + ///
      • + ///
      • + /// SUCCEEDED–the task has succeeded. + ///
      • + ///
      + final TaskRunStatus taskRunStatus; + + /// The number of tasks running on the job. + final Map taskRunStatusCounts; + + /// The number of dependencies for the step. + final DependencyCounts? dependencyCounts; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// A message that describes the lifecycle of the step. + final String? lifecycleStatusMessage; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The task status to start with on the job. + final StepTargetTaskRunStatus? targetTaskRunStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + StepSummary({ + required this.createdAt, + required this.createdBy, + required this.lifecycleStatus, + required this.name, + required this.stepId, + required this.taskRunStatus, + required this.taskRunStatusCounts, + this.dependencyCounts, + this.endedAt, + this.lifecycleStatusMessage, + this.startedAt, + this.targetTaskRunStatus, + this.updatedAt, + this.updatedBy, + }); + + factory StepSummary.fromJson(Map json) { + return StepSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toStepLifecycleStatus(), + name: json['name'] as String, + stepId: json['stepId'] as String, + taskRunStatus: (json['taskRunStatus'] as String).toTaskRunStatus(), + taskRunStatusCounts: (json['taskRunStatusCounts'] as Map) + .map((k, e) => MapEntry(k.toTaskRunStatus(), e as int)), + dependencyCounts: json['dependencyCounts'] != null + ? DependencyCounts.fromJson( + json['dependencyCounts'] as Map) + : null, + endedAt: timeStampFromJson(json['endedAt']), + lifecycleStatusMessage: json['lifecycleStatusMessage'] as String?, + startedAt: timeStampFromJson(json['startedAt']), + targetTaskRunStatus: + (json['targetTaskRunStatus'] as String?)?.toStepTargetTaskRunStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final lifecycleStatus = this.lifecycleStatus; + final name = this.name; + final stepId = this.stepId; + final taskRunStatus = this.taskRunStatus; + final taskRunStatusCounts = this.taskRunStatusCounts; + final dependencyCounts = this.dependencyCounts; + final endedAt = this.endedAt; + final lifecycleStatusMessage = this.lifecycleStatusMessage; + final startedAt = this.startedAt; + final targetTaskRunStatus = this.targetTaskRunStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'name': name, + 'stepId': stepId, + 'taskRunStatus': taskRunStatus.toValue(), + 'taskRunStatusCounts': + taskRunStatusCounts.map((k, e) => MapEntry(k.toValue(), e)), + if (dependencyCounts != null) 'dependencyCounts': dependencyCounts, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (lifecycleStatusMessage != null) + 'lifecycleStatusMessage': lifecycleStatusMessage, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetTaskRunStatus != null) + 'targetTaskRunStatus': targetTaskRunStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum StepTargetTaskRunStatus { + ready, + failed, + succeeded, + canceled, + suspended, + pending, +} + +extension StepTargetTaskRunStatusValueExtension on StepTargetTaskRunStatus { + String toValue() { + switch (this) { + case StepTargetTaskRunStatus.ready: + return 'READY'; + case StepTargetTaskRunStatus.failed: + return 'FAILED'; + case StepTargetTaskRunStatus.succeeded: + return 'SUCCEEDED'; + case StepTargetTaskRunStatus.canceled: + return 'CANCELED'; + case StepTargetTaskRunStatus.suspended: + return 'SUSPENDED'; + case StepTargetTaskRunStatus.pending: + return 'PENDING'; + } + } +} + +extension StepTargetTaskRunStatusFromString on String { + StepTargetTaskRunStatus toStepTargetTaskRunStatus() { + switch (this) { + case 'READY': + return StepTargetTaskRunStatus.ready; + case 'FAILED': + return StepTargetTaskRunStatus.failed; + case 'SUCCEEDED': + return StepTargetTaskRunStatus.succeeded; + case 'CANCELED': + return StepTargetTaskRunStatus.canceled; + case 'SUSPENDED': + return StepTargetTaskRunStatus.suspended; + case 'PENDING': + return StepTargetTaskRunStatus.pending; + } + throw Exception('$this is not known in enum StepTargetTaskRunStatus'); + } +} + +enum StorageProfileOperatingSystemFamily { + windows, + linux, + macos, +} + +extension StorageProfileOperatingSystemFamilyValueExtension + on StorageProfileOperatingSystemFamily { + String toValue() { + switch (this) { + case StorageProfileOperatingSystemFamily.windows: + return 'WINDOWS'; + case StorageProfileOperatingSystemFamily.linux: + return 'LINUX'; + case StorageProfileOperatingSystemFamily.macos: + return 'MACOS'; + } + } +} + +extension StorageProfileOperatingSystemFamilyFromString on String { + StorageProfileOperatingSystemFamily toStorageProfileOperatingSystemFamily() { + switch (this) { + case 'WINDOWS': + return StorageProfileOperatingSystemFamily.windows; + case 'LINUX': + return StorageProfileOperatingSystemFamily.linux; + case 'MACOS': + return StorageProfileOperatingSystemFamily.macos; + } + throw Exception( + '$this is not known in enum StorageProfileOperatingSystemFamily'); + } +} + +/// The details of a storage profile. +class StorageProfileSummary { + /// The display name of the storage profile summary to update. + final String displayName; + + /// The operating system (OS) family. + final StorageProfileOperatingSystemFamily osFamily; + + /// The storage profile ID. + final String storageProfileId; + + StorageProfileSummary({ + required this.displayName, + required this.osFamily, + required this.storageProfileId, + }); + + factory StorageProfileSummary.fromJson(Map json) { + return StorageProfileSummary( + displayName: json['displayName'] as String, + osFamily: + (json['osFamily'] as String).toStorageProfileOperatingSystemFamily(), + storageProfileId: json['storageProfileId'] as String, + ); + } + + Map toJson() { + final displayName = this.displayName; + final osFamily = this.osFamily; + final storageProfileId = this.storageProfileId; + return { + 'displayName': displayName, + 'osFamily': osFamily.toValue(), + 'storageProfileId': storageProfileId, + }; + } +} + +/// Searches for a particular string. +class StringFilterExpression { + /// The field name to search. + final String name; + + /// The type of comparison to use for this search. + final ComparisonOperator operator; + + /// The string to search for. + final String value; + + StringFilterExpression({ + required this.name, + required this.operator, + required this.value, + }); + + Map toJson() { + final name = this.name; + final operator = this.operator; + final value = this.value; + return { + 'name': name, + 'operator': operator.toValue(), + 'value': value, + }; + } +} + +/// The job attachment in a session action to sync. +class SyncInputJobAttachmentsSessionActionDefinition { + /// The step ID for the step in the job attachment. + final String? stepId; + + SyncInputJobAttachmentsSessionActionDefinition({ + this.stepId, + }); + + factory SyncInputJobAttachmentsSessionActionDefinition.fromJson( + Map json) { + return SyncInputJobAttachmentsSessionActionDefinition( + stepId: json['stepId'] as String?, + ); + } + + Map toJson() { + final stepId = this.stepId; + return { + if (stepId != null) 'stepId': stepId, + }; + } +} + +/// The details of a synced job attachment. +class SyncInputJobAttachmentsSessionActionDefinitionSummary { + /// The step ID of the step in the job attachment. + final String? stepId; + + SyncInputJobAttachmentsSessionActionDefinitionSummary({ + this.stepId, + }); + + factory SyncInputJobAttachmentsSessionActionDefinitionSummary.fromJson( + Map json) { + return SyncInputJobAttachmentsSessionActionDefinitionSummary( + stepId: json['stepId'] as String?, + ); + } + + Map toJson() { + final stepId = this.stepId; + return { + if (stepId != null) 'stepId': stepId, + }; + } +} + +class TagResourceResponse { + TagResourceResponse(); + + factory TagResourceResponse.fromJson(Map _) { + return TagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +/// The data types for the task parameters. +class TaskParameterValue { + /// A double precision IEEE-754 floating point number represented as a string. + final String? float; + + /// A signed integer represented as a string. + final String? intValue; + + /// A file system path represented as a string. + final String? path; + + /// A UTF-8 string. + final String? string; + + TaskParameterValue({ + this.float, + this.intValue, + this.path, + this.string, + }); + + factory TaskParameterValue.fromJson(Map json) { + return TaskParameterValue( + float: json['float'] as String?, + intValue: json['int'] as String?, + path: json['path'] as String?, + string: json['string'] as String?, + ); + } + + Map toJson() { + final float = this.float; + final intValue = this.intValue; + final path = this.path; + final string = this.string; + return { + if (float != null) 'float': float, + if (intValue != null) 'int': intValue, + if (path != null) 'path': path, + if (string != null) 'string': string, + }; + } +} + +/// The task, step, and parameters for the task run in the session action. +class TaskRunSessionActionDefinition { + /// The task parameters. + final Map parameters; + + /// The step ID. + final String stepId; + + /// The task ID. + final String taskId; + + TaskRunSessionActionDefinition({ + required this.parameters, + required this.stepId, + required this.taskId, + }); + + factory TaskRunSessionActionDefinition.fromJson(Map json) { + return TaskRunSessionActionDefinition( + parameters: (json['parameters'] as Map).map((k, e) => + MapEntry(k, TaskParameterValue.fromJson(e as Map))), + stepId: json['stepId'] as String, + taskId: json['taskId'] as String, + ); + } + + Map toJson() { + final parameters = this.parameters; + final stepId = this.stepId; + final taskId = this.taskId; + return { + 'parameters': parameters, + 'stepId': stepId, + 'taskId': taskId, + }; + } +} + +/// The details of a task run in a session action. +class TaskRunSessionActionDefinitionSummary { + /// The step ID. + final String stepId; + + /// The task ID. + final String taskId; + + TaskRunSessionActionDefinitionSummary({ + required this.stepId, + required this.taskId, + }); + + factory TaskRunSessionActionDefinitionSummary.fromJson( + Map json) { + return TaskRunSessionActionDefinitionSummary( + stepId: json['stepId'] as String, + taskId: json['taskId'] as String, + ); + } + + Map toJson() { + final stepId = this.stepId; + final taskId = this.taskId; + return { + 'stepId': stepId, + 'taskId': taskId, + }; + } +} + +enum TaskRunStatus { + pending, + ready, + assigned, + starting, + scheduled, + interrupting, + running, + suspended, + canceled, + failed, + succeeded, + notCompatible, +} + +extension TaskRunStatusValueExtension on TaskRunStatus { + String toValue() { + switch (this) { + case TaskRunStatus.pending: + return 'PENDING'; + case TaskRunStatus.ready: + return 'READY'; + case TaskRunStatus.assigned: + return 'ASSIGNED'; + case TaskRunStatus.starting: + return 'STARTING'; + case TaskRunStatus.scheduled: + return 'SCHEDULED'; + case TaskRunStatus.interrupting: + return 'INTERRUPTING'; + case TaskRunStatus.running: + return 'RUNNING'; + case TaskRunStatus.suspended: + return 'SUSPENDED'; + case TaskRunStatus.canceled: + return 'CANCELED'; + case TaskRunStatus.failed: + return 'FAILED'; + case TaskRunStatus.succeeded: + return 'SUCCEEDED'; + case TaskRunStatus.notCompatible: + return 'NOT_COMPATIBLE'; + } + } +} + +extension TaskRunStatusFromString on String { + TaskRunStatus toTaskRunStatus() { + switch (this) { + case 'PENDING': + return TaskRunStatus.pending; + case 'READY': + return TaskRunStatus.ready; + case 'ASSIGNED': + return TaskRunStatus.assigned; + case 'STARTING': + return TaskRunStatus.starting; + case 'SCHEDULED': + return TaskRunStatus.scheduled; + case 'INTERRUPTING': + return TaskRunStatus.interrupting; + case 'RUNNING': + return TaskRunStatus.running; + case 'SUSPENDED': + return TaskRunStatus.suspended; + case 'CANCELED': + return TaskRunStatus.canceled; + case 'FAILED': + return TaskRunStatus.failed; + case 'SUCCEEDED': + return TaskRunStatus.succeeded; + case 'NOT_COMPATIBLE': + return TaskRunStatus.notCompatible; + } + throw Exception('$this is not known in enum TaskRunStatus'); + } +} + +/// The details of a task search. +class TaskSearchSummary { + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The number of times that the task failed and was retried. + final int? failureRetryCount; + + /// The job ID. + final String? jobId; + + /// The parameters to search for. + final Map? parameters; + + /// The queue ID. + final String? queueId; + + /// The run status of the task. + final TaskRunStatus? runStatus; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The step ID. + final String? stepId; + + /// The run status that the task is being updated to. + final TaskTargetRunStatus? targetRunStatus; + + /// The task ID. + final String? taskId; + + TaskSearchSummary({ + this.endedAt, + this.failureRetryCount, + this.jobId, + this.parameters, + this.queueId, + this.runStatus, + this.startedAt, + this.stepId, + this.targetRunStatus, + this.taskId, + }); + + factory TaskSearchSummary.fromJson(Map json) { + return TaskSearchSummary( + endedAt: timeStampFromJson(json['endedAt']), + failureRetryCount: json['failureRetryCount'] as int?, + jobId: json['jobId'] as String?, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, TaskParameterValue.fromJson(e as Map))), + queueId: json['queueId'] as String?, + runStatus: (json['runStatus'] as String?)?.toTaskRunStatus(), + startedAt: timeStampFromJson(json['startedAt']), + stepId: json['stepId'] as String?, + targetRunStatus: + (json['targetRunStatus'] as String?)?.toTaskTargetRunStatus(), + taskId: json['taskId'] as String?, + ); + } + + Map toJson() { + final endedAt = this.endedAt; + final failureRetryCount = this.failureRetryCount; + final jobId = this.jobId; + final parameters = this.parameters; + final queueId = this.queueId; + final runStatus = this.runStatus; + final startedAt = this.startedAt; + final stepId = this.stepId; + final targetRunStatus = this.targetRunStatus; + final taskId = this.taskId; + return { + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (failureRetryCount != null) 'failureRetryCount': failureRetryCount, + if (jobId != null) 'jobId': jobId, + if (parameters != null) 'parameters': parameters, + if (queueId != null) 'queueId': queueId, + if (runStatus != null) 'runStatus': runStatus.toValue(), + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (stepId != null) 'stepId': stepId, + if (targetRunStatus != null) 'targetRunStatus': targetRunStatus.toValue(), + if (taskId != null) 'taskId': taskId, + }; + } +} + +/// The details of a task. +class TaskSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The run status of the task. + final TaskRunStatus runStatus; + + /// The task ID. + final String taskId; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The number of times that the task failed and was retried. + final int? failureRetryCount; + + /// The latest session action for the task. + final String? latestSessionActionId; + + /// The task parameters. + final Map? parameters; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The run status on which the started. + final TaskTargetRunStatus? targetRunStatus; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + TaskSummary({ + required this.createdAt, + required this.createdBy, + required this.runStatus, + required this.taskId, + this.endedAt, + this.failureRetryCount, + this.latestSessionActionId, + this.parameters, + this.startedAt, + this.targetRunStatus, + this.updatedAt, + this.updatedBy, + }); + + factory TaskSummary.fromJson(Map json) { + return TaskSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + runStatus: (json['runStatus'] as String).toTaskRunStatus(), + taskId: json['taskId'] as String, + endedAt: timeStampFromJson(json['endedAt']), + failureRetryCount: json['failureRetryCount'] as int?, + latestSessionActionId: json['latestSessionActionId'] as String?, + parameters: (json['parameters'] as Map?)?.map((k, e) => + MapEntry(k, TaskParameterValue.fromJson(e as Map))), + startedAt: timeStampFromJson(json['startedAt']), + targetRunStatus: + (json['targetRunStatus'] as String?)?.toTaskTargetRunStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final runStatus = this.runStatus; + final taskId = this.taskId; + final endedAt = this.endedAt; + final failureRetryCount = this.failureRetryCount; + final latestSessionActionId = this.latestSessionActionId; + final parameters = this.parameters; + final startedAt = this.startedAt; + final targetRunStatus = this.targetRunStatus; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'runStatus': runStatus.toValue(), + 'taskId': taskId, + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (failureRetryCount != null) 'failureRetryCount': failureRetryCount, + if (latestSessionActionId != null) + 'latestSessionActionId': latestSessionActionId, + if (parameters != null) 'parameters': parameters, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (targetRunStatus != null) 'targetRunStatus': targetRunStatus.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +enum TaskTargetRunStatus { + ready, + failed, + succeeded, + canceled, + suspended, + pending, +} + +extension TaskTargetRunStatusValueExtension on TaskTargetRunStatus { + String toValue() { + switch (this) { + case TaskTargetRunStatus.ready: + return 'READY'; + case TaskTargetRunStatus.failed: + return 'FAILED'; + case TaskTargetRunStatus.succeeded: + return 'SUCCEEDED'; + case TaskTargetRunStatus.canceled: + return 'CANCELED'; + case TaskTargetRunStatus.suspended: + return 'SUSPENDED'; + case TaskTargetRunStatus.pending: + return 'PENDING'; + } + } +} + +extension TaskTargetRunStatusFromString on String { + TaskTargetRunStatus toTaskTargetRunStatus() { + switch (this) { + case 'READY': + return TaskTargetRunStatus.ready; + case 'FAILED': + return TaskTargetRunStatus.failed; + case 'SUCCEEDED': + return TaskTargetRunStatus.succeeded; + case 'CANCELED': + return TaskTargetRunStatus.canceled; + case 'SUSPENDED': + return TaskTargetRunStatus.suspended; + case 'PENDING': + return TaskTargetRunStatus.pending; + } + throw Exception('$this is not known in enum TaskTargetRunStatus'); + } +} + +class UntagResourceResponse { + UntagResourceResponse(); + + factory UntagResourceResponse.fromJson(Map _) { + return UntagResourceResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateBudgetResponse { + UpdateBudgetResponse(); + + factory UpdateBudgetResponse.fromJson(Map _) { + return UpdateBudgetResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateFarmResponse { + UpdateFarmResponse(); + + factory UpdateFarmResponse.fromJson(Map _) { + return UpdateFarmResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateFleetResponse { + UpdateFleetResponse(); + + factory UpdateFleetResponse.fromJson(Map _) { + return UpdateFleetResponse(); + } + + Map toJson() { + return {}; + } +} + +enum UpdateJobLifecycleStatus { + archived, +} + +extension UpdateJobLifecycleStatusValueExtension on UpdateJobLifecycleStatus { + String toValue() { + switch (this) { + case UpdateJobLifecycleStatus.archived: + return 'ARCHIVED'; + } + } +} + +extension UpdateJobLifecycleStatusFromString on String { + UpdateJobLifecycleStatus toUpdateJobLifecycleStatus() { + switch (this) { + case 'ARCHIVED': + return UpdateJobLifecycleStatus.archived; + } + throw Exception('$this is not known in enum UpdateJobLifecycleStatus'); + } +} + +class UpdateJobResponse { + UpdateJobResponse(); + + factory UpdateJobResponse.fromJson(Map _) { + return UpdateJobResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateMonitorResponse { + UpdateMonitorResponse(); + + factory UpdateMonitorResponse.fromJson(Map _) { + return UpdateMonitorResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateQueueEnvironmentResponse { + UpdateQueueEnvironmentResponse(); + + factory UpdateQueueEnvironmentResponse.fromJson(Map _) { + return UpdateQueueEnvironmentResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateQueueFleetAssociationResponse { + UpdateQueueFleetAssociationResponse(); + + factory UpdateQueueFleetAssociationResponse.fromJson(Map _) { + return UpdateQueueFleetAssociationResponse(); + } + + Map toJson() { + return {}; + } +} + +enum UpdateQueueFleetAssociationStatus { + active, + stopSchedulingAndCompleteTasks, + stopSchedulingAndCancelTasks, +} + +extension UpdateQueueFleetAssociationStatusValueExtension + on UpdateQueueFleetAssociationStatus { + String toValue() { + switch (this) { + case UpdateQueueFleetAssociationStatus.active: + return 'ACTIVE'; + case UpdateQueueFleetAssociationStatus.stopSchedulingAndCompleteTasks: + return 'STOP_SCHEDULING_AND_COMPLETE_TASKS'; + case UpdateQueueFleetAssociationStatus.stopSchedulingAndCancelTasks: + return 'STOP_SCHEDULING_AND_CANCEL_TASKS'; + } + } +} + +extension UpdateQueueFleetAssociationStatusFromString on String { + UpdateQueueFleetAssociationStatus toUpdateQueueFleetAssociationStatus() { + switch (this) { + case 'ACTIVE': + return UpdateQueueFleetAssociationStatus.active; + case 'STOP_SCHEDULING_AND_COMPLETE_TASKS': + return UpdateQueueFleetAssociationStatus.stopSchedulingAndCompleteTasks; + case 'STOP_SCHEDULING_AND_CANCEL_TASKS': + return UpdateQueueFleetAssociationStatus.stopSchedulingAndCancelTasks; + } + throw Exception( + '$this is not known in enum UpdateQueueFleetAssociationStatus'); + } +} + +class UpdateQueueResponse { + UpdateQueueResponse(); + + factory UpdateQueueResponse.fromJson(Map _) { + return UpdateQueueResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateSessionResponse { + UpdateSessionResponse(); + + factory UpdateSessionResponse.fromJson(Map _) { + return UpdateSessionResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateStepResponse { + UpdateStepResponse(); + + factory UpdateStepResponse.fromJson(Map _) { + return UpdateStepResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateStorageProfileResponse { + UpdateStorageProfileResponse(); + + factory UpdateStorageProfileResponse.fromJson(Map _) { + return UpdateStorageProfileResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateTaskResponse { + UpdateTaskResponse(); + + factory UpdateTaskResponse.fromJson(Map _) { + return UpdateTaskResponse(); + } + + Map toJson() { + return {}; + } +} + +class UpdateWorkerResponse { + /// The worker log to update. + final LogConfiguration? log; + + UpdateWorkerResponse({ + this.log, + }); + + factory UpdateWorkerResponse.fromJson(Map json) { + return UpdateWorkerResponse( + log: json['log'] != null + ? LogConfiguration.fromJson(json['log'] as Map) + : null, + ); + } + + Map toJson() { + final log = this.log; + return { + if (log != null) 'log': log, + }; + } +} + +class UpdateWorkerScheduleResponse { + /// The assigned sessions to update. + final Map assignedSessions; + + /// The session actions associated with the worker schedule to cancel. + final Map> cancelSessionActions; + + /// Updates the time interval (in seconds) for the schedule. + final int updateIntervalSeconds; + + /// The status to update the worker to. + final DesiredWorkerStatus? desiredWorkerStatus; + + UpdateWorkerScheduleResponse({ + required this.assignedSessions, + required this.cancelSessionActions, + required this.updateIntervalSeconds, + this.desiredWorkerStatus, + }); + + factory UpdateWorkerScheduleResponse.fromJson(Map json) { + return UpdateWorkerScheduleResponse( + assignedSessions: (json['assignedSessions'] as Map).map( + (k, e) => + MapEntry(k, AssignedSession.fromJson(e as Map))), + cancelSessionActions: (json['cancelSessionActions'] + as Map) + .map((k, e) => MapEntry( + k, (e as List).whereNotNull().map((e) => e as String).toList())), + updateIntervalSeconds: json['updateIntervalSeconds'] as int, + desiredWorkerStatus: + (json['desiredWorkerStatus'] as String?)?.toDesiredWorkerStatus(), + ); + } + + Map toJson() { + final assignedSessions = this.assignedSessions; + final cancelSessionActions = this.cancelSessionActions; + final updateIntervalSeconds = this.updateIntervalSeconds; + final desiredWorkerStatus = this.desiredWorkerStatus; + return { + 'assignedSessions': assignedSessions, + 'cancelSessionActions': cancelSessionActions, + 'updateIntervalSeconds': updateIntervalSeconds, + if (desiredWorkerStatus != null) + 'desiredWorkerStatus': desiredWorkerStatus.toValue(), + }; + } +} + +/// The updated session action information as it relates to completion and +/// progress of the session. +class UpdatedSessionActionInfo { + /// The status of the session upon completion. + final CompletedStatus? completedStatus; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The process exit code. + final int? processExitCode; + + /// A message to indicate the progress of the updated session action. + final String? progressMessage; + + /// The percentage completed. + final double? progressPercent; + + /// The date and time the resource started running. + final DateTime? startedAt; + + /// The updated time. + final DateTime? updatedAt; + + UpdatedSessionActionInfo({ + this.completedStatus, + this.endedAt, + this.processExitCode, + this.progressMessage, + this.progressPercent, + this.startedAt, + this.updatedAt, + }); + + Map toJson() { + final completedStatus = this.completedStatus; + final endedAt = this.endedAt; + final processExitCode = this.processExitCode; + final progressMessage = this.progressMessage; + final progressPercent = this.progressPercent; + final startedAt = this.startedAt; + final updatedAt = this.updatedAt; + return { + if (completedStatus != null) 'completedStatus': completedStatus.toValue(), + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (processExitCode != null) 'processExitCode': processExitCode, + if (progressMessage != null) 'progressMessage': progressMessage, + if (progressPercent != null) 'progressPercent': progressPercent, + if (startedAt != null) 'startedAt': iso8601ToJson(startedAt), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + }; + } +} + +enum UpdatedWorkerStatus { + started, + stopping, + stopped, +} + +extension UpdatedWorkerStatusValueExtension on UpdatedWorkerStatus { + String toValue() { + switch (this) { + case UpdatedWorkerStatus.started: + return 'STARTED'; + case UpdatedWorkerStatus.stopping: + return 'STOPPING'; + case UpdatedWorkerStatus.stopped: + return 'STOPPED'; + } + } +} + +extension UpdatedWorkerStatusFromString on String { + UpdatedWorkerStatus toUpdatedWorkerStatus() { + switch (this) { + case 'STARTED': + return UpdatedWorkerStatus.started; + case 'STOPPING': + return UpdatedWorkerStatus.stopping; + case 'STOPPED': + return UpdatedWorkerStatus.stopped; + } + throw Exception('$this is not known in enum UpdatedWorkerStatus'); + } +} + +enum UsageGroupByField { + queueId, + fleetId, + jobId, + userId, + usageType, + instanceType, + licenseProduct, +} + +extension UsageGroupByFieldValueExtension on UsageGroupByField { + String toValue() { + switch (this) { + case UsageGroupByField.queueId: + return 'QUEUE_ID'; + case UsageGroupByField.fleetId: + return 'FLEET_ID'; + case UsageGroupByField.jobId: + return 'JOB_ID'; + case UsageGroupByField.userId: + return 'USER_ID'; + case UsageGroupByField.usageType: + return 'USAGE_TYPE'; + case UsageGroupByField.instanceType: + return 'INSTANCE_TYPE'; + case UsageGroupByField.licenseProduct: + return 'LICENSE_PRODUCT'; + } + } +} + +extension UsageGroupByFieldFromString on String { + UsageGroupByField toUsageGroupByField() { + switch (this) { + case 'QUEUE_ID': + return UsageGroupByField.queueId; + case 'FLEET_ID': + return UsageGroupByField.fleetId; + case 'JOB_ID': + return UsageGroupByField.jobId; + case 'USER_ID': + return UsageGroupByField.userId; + case 'USAGE_TYPE': + return UsageGroupByField.usageType; + case 'INSTANCE_TYPE': + return UsageGroupByField.instanceType; + case 'LICENSE_PRODUCT': + return UsageGroupByField.licenseProduct; + } + throw Exception('$this is not known in enum UsageGroupByField'); + } +} + +enum UsageStatistic { + sum, + min, + max, + avg, +} + +extension UsageStatisticValueExtension on UsageStatistic { + String toValue() { + switch (this) { + case UsageStatistic.sum: + return 'SUM'; + case UsageStatistic.min: + return 'MIN'; + case UsageStatistic.max: + return 'MAX'; + case UsageStatistic.avg: + return 'AVG'; + } + } +} + +extension UsageStatisticFromString on String { + UsageStatistic toUsageStatistic() { + switch (this) { + case 'SUM': + return UsageStatistic.sum; + case 'MIN': + return UsageStatistic.min; + case 'MAX': + return UsageStatistic.max; + case 'AVG': + return UsageStatistic.avg; + } + throw Exception('$this is not known in enum UsageStatistic'); + } +} + +/// The usage details of the allotted budget. +class UsageTrackingResource { + /// The queue ID. + final String? queueId; + + UsageTrackingResource({ + this.queueId, + }); + + factory UsageTrackingResource.fromJson(Map json) { + return UsageTrackingResource( + queueId: json['queueId'] as String?, + ); + } + + Map toJson() { + final queueId = this.queueId; + return { + if (queueId != null) 'queueId': queueId, + }; + } +} + +enum UsageType { + compute, + license, +} + +extension UsageTypeValueExtension on UsageType { + String toValue() { + switch (this) { + case UsageType.compute: + return 'COMPUTE'; + case UsageType.license: + return 'LICENSE'; + } + } +} + +extension UsageTypeFromString on String { + UsageType toUsageType() { + switch (this) { + case 'COMPUTE': + return UsageType.compute; + case 'LICENSE': + return UsageType.license; + } + throw Exception('$this is not known in enum UsageType'); + } +} + +/// Allows setting a specific user's job to run first. +class UserJobsFirst { + /// The user's ID. + final String userIdentityId; + + UserJobsFirst({ + required this.userIdentityId, + }); + + Map toJson() { + final userIdentityId = this.userIdentityId; + return { + 'userIdentityId': userIdentityId, + }; + } +} + +/// The allowable range of vCPU processing power for the fleet. +class VCpuCountRange { + /// The minimum amount of vCPU. + final int min; + + /// The maximum amount of vCPU. + final int? max; + + VCpuCountRange({ + required this.min, + this.max, + }); + + factory VCpuCountRange.fromJson(Map json) { + return VCpuCountRange( + min: json['min'] as int, + max: json['max'] as int?, + ); + } + + Map toJson() { + final min = this.min; + final max = this.max; + return { + 'min': min, + if (max != null) 'max': max, + }; + } +} + +/// The Windows user details. +class WindowsUser { + /// The password ARN for the Windows user. + final String passwordArn; + + /// The user. + final String user; + + WindowsUser({ + required this.passwordArn, + required this.user, + }); + + factory WindowsUser.fromJson(Map json) { + return WindowsUser( + passwordArn: json['passwordArn'] as String, + user: json['user'] as String, + ); + } + + Map toJson() { + final passwordArn = this.passwordArn; + final user = this.user; + return { + 'passwordArn': passwordArn, + 'user': user, + }; + } +} + +/// The details of the worker amount capability. +class WorkerAmountCapability { + /// The name of the worker amount capability. + final String name; + + /// The value of the worker amount capability. + final double value; + + WorkerAmountCapability({ + required this.name, + required this.value, + }); + + Map toJson() { + final name = this.name; + final value = this.value; + return { + 'name': name, + 'value': value, + }; + } +} + +/// The details of the worker attribute capability. +class WorkerAttributeCapability { + /// The name of the worker attribute capability. + final String name; + + /// The values of the worker amount capability. + final List values; + + WorkerAttributeCapability({ + required this.name, + required this.values, + }); + + Map toJson() { + final name = this.name; + final values = this.values; + return { + 'name': name, + 'values': values, + }; + } +} + +/// The details for worker capabilities. +class WorkerCapabilities { + /// The worker capabilities amounts on a list of worker capabilities. + final List amounts; + + /// The worker attribute capabilities in the list of attribute capabilities. + final List attributes; + + WorkerCapabilities({ + required this.amounts, + required this.attributes, + }); + + Map toJson() { + final amounts = this.amounts; + final attributes = this.attributes; + return { + 'amounts': amounts, + 'attributes': attributes, + }; + } +} + +/// The details of a worker search. +class WorkerSearchSummary { + /// The date and time the resource was created. + final DateTime? createdAt; + + /// The user or system that created this resource. + final String? createdBy; + + /// The fleet ID. + final String? fleetId; + + /// Provides the Amazon EC2 instance properties of the worker host. + final HostPropertiesResponse? hostProperties; + + /// The status of the worker search. + final WorkerStatus? status; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + /// The worker ID. + final String? workerId; + + WorkerSearchSummary({ + this.createdAt, + this.createdBy, + this.fleetId, + this.hostProperties, + this.status, + this.updatedAt, + this.updatedBy, + this.workerId, + }); + + factory WorkerSearchSummary.fromJson(Map json) { + return WorkerSearchSummary( + createdAt: timeStampFromJson(json['createdAt']), + createdBy: json['createdBy'] as String?, + fleetId: json['fleetId'] as String?, + hostProperties: json['hostProperties'] != null + ? HostPropertiesResponse.fromJson( + json['hostProperties'] as Map) + : null, + status: (json['status'] as String?)?.toWorkerStatus(), + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + workerId: json['workerId'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final fleetId = this.fleetId; + final hostProperties = this.hostProperties; + final status = this.status; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + final workerId = this.workerId; + return { + if (createdAt != null) 'createdAt': iso8601ToJson(createdAt), + if (createdBy != null) 'createdBy': createdBy, + if (fleetId != null) 'fleetId': fleetId, + if (hostProperties != null) 'hostProperties': hostProperties, + if (status != null) 'status': status.toValue(), + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + if (workerId != null) 'workerId': workerId, + }; + } +} + +/// Summarizes the session for a particular worker. +class WorkerSessionSummary { + /// The job ID for the job associated with the worker's session. + final String jobId; + + /// The life cycle status for the worker's session. + final SessionLifecycleStatus lifecycleStatus; + + /// The queue ID for the queue associated to the worker. + final String queueId; + + /// The session ID for the session action. + final String sessionId; + + /// The date and time the resource started running. + final DateTime startedAt; + + /// The date and time the resource ended running. + final DateTime? endedAt; + + /// The life cycle status + final SessionLifecycleTargetStatus? targetLifecycleStatus; + + WorkerSessionSummary({ + required this.jobId, + required this.lifecycleStatus, + required this.queueId, + required this.sessionId, + required this.startedAt, + this.endedAt, + this.targetLifecycleStatus, + }); + + factory WorkerSessionSummary.fromJson(Map json) { + return WorkerSessionSummary( + jobId: json['jobId'] as String, + lifecycleStatus: + (json['lifecycleStatus'] as String).toSessionLifecycleStatus(), + queueId: json['queueId'] as String, + sessionId: json['sessionId'] as String, + startedAt: nonNullableTimeStampFromJson(json['startedAt'] as Object), + endedAt: timeStampFromJson(json['endedAt']), + targetLifecycleStatus: (json['targetLifecycleStatus'] as String?) + ?.toSessionLifecycleTargetStatus(), + ); + } + + Map toJson() { + final jobId = this.jobId; + final lifecycleStatus = this.lifecycleStatus; + final queueId = this.queueId; + final sessionId = this.sessionId; + final startedAt = this.startedAt; + final endedAt = this.endedAt; + final targetLifecycleStatus = this.targetLifecycleStatus; + return { + 'jobId': jobId, + 'lifecycleStatus': lifecycleStatus.toValue(), + 'queueId': queueId, + 'sessionId': sessionId, + 'startedAt': iso8601ToJson(startedAt), + if (endedAt != null) 'endedAt': iso8601ToJson(endedAt), + if (targetLifecycleStatus != null) + 'targetLifecycleStatus': targetLifecycleStatus.toValue(), + }; + } +} + +enum WorkerStatus { + created, + started, + stopping, + stopped, + notResponding, + notCompatible, + running, + idle, +} + +extension WorkerStatusValueExtension on WorkerStatus { + String toValue() { + switch (this) { + case WorkerStatus.created: + return 'CREATED'; + case WorkerStatus.started: + return 'STARTED'; + case WorkerStatus.stopping: + return 'STOPPING'; + case WorkerStatus.stopped: + return 'STOPPED'; + case WorkerStatus.notResponding: + return 'NOT_RESPONDING'; + case WorkerStatus.notCompatible: + return 'NOT_COMPATIBLE'; + case WorkerStatus.running: + return 'RUNNING'; + case WorkerStatus.idle: + return 'IDLE'; + } + } +} + +extension WorkerStatusFromString on String { + WorkerStatus toWorkerStatus() { + switch (this) { + case 'CREATED': + return WorkerStatus.created; + case 'STARTED': + return WorkerStatus.started; + case 'STOPPING': + return WorkerStatus.stopping; + case 'STOPPED': + return WorkerStatus.stopped; + case 'NOT_RESPONDING': + return WorkerStatus.notResponding; + case 'NOT_COMPATIBLE': + return WorkerStatus.notCompatible; + case 'RUNNING': + return WorkerStatus.running; + case 'IDLE': + return WorkerStatus.idle; + } + throw Exception('$this is not known in enum WorkerStatus'); + } +} + +/// The summary of details for a worker. +class WorkerSummary { + /// The date and time the resource was created. + final DateTime createdAt; + + /// The user or system that created this resource. + final String createdBy; + + /// The farm ID. + final String farmId; + + /// The fleet ID. + final String fleetId; + + /// The status of the worker. + final WorkerStatus status; + + /// The worker ID. + final String workerId; + + /// The host properties of the worker. + final HostPropertiesResponse? hostProperties; + + /// The log configuration for the worker. + final LogConfiguration? log; + + /// The date and time the resource was updated. + final DateTime? updatedAt; + + /// The user or system that updated this resource. + final String? updatedBy; + + WorkerSummary({ + required this.createdAt, + required this.createdBy, + required this.farmId, + required this.fleetId, + required this.status, + required this.workerId, + this.hostProperties, + this.log, + this.updatedAt, + this.updatedBy, + }); + + factory WorkerSummary.fromJson(Map json) { + return WorkerSummary( + createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object), + createdBy: json['createdBy'] as String, + farmId: json['farmId'] as String, + fleetId: json['fleetId'] as String, + status: (json['status'] as String).toWorkerStatus(), + workerId: json['workerId'] as String, + hostProperties: json['hostProperties'] != null + ? HostPropertiesResponse.fromJson( + json['hostProperties'] as Map) + : null, + log: json['log'] != null + ? LogConfiguration.fromJson(json['log'] as Map) + : null, + updatedAt: timeStampFromJson(json['updatedAt']), + updatedBy: json['updatedBy'] as String?, + ); + } + + Map toJson() { + final createdAt = this.createdAt; + final createdBy = this.createdBy; + final farmId = this.farmId; + final fleetId = this.fleetId; + final status = this.status; + final workerId = this.workerId; + final hostProperties = this.hostProperties; + final log = this.log; + final updatedAt = this.updatedAt; + final updatedBy = this.updatedBy; + return { + 'createdAt': iso8601ToJson(createdAt), + 'createdBy': createdBy, + 'farmId': farmId, + 'fleetId': fleetId, + 'status': status.toValue(), + 'workerId': workerId, + if (hostProperties != null) 'hostProperties': hostProperties, + if (log != null) 'log': log, + if (updatedAt != null) 'updatedAt': iso8601ToJson(updatedAt), + if (updatedBy != null) 'updatedBy': updatedBy, + }; + } +} + +class AccessDeniedException extends _s.GenericAwsException { + AccessDeniedException({String? type, String? message}) + : super(type: type, code: 'AccessDeniedException', message: message); +} + +class ConflictException extends _s.GenericAwsException { + ConflictException({String? type, String? message}) + : super(type: type, code: 'ConflictException', message: message); +} + +class InternalServerErrorException extends _s.GenericAwsException { + InternalServerErrorException({String? type, String? message}) + : super( + type: type, code: 'InternalServerErrorException', message: message); +} + +class ResourceNotFoundException extends _s.GenericAwsException { + ResourceNotFoundException({String? type, String? message}) + : super(type: type, code: 'ResourceNotFoundException', message: message); +} + +class ServiceQuotaExceededException extends _s.GenericAwsException { + ServiceQuotaExceededException({String? type, String? message}) + : super( + type: type, + code: 'ServiceQuotaExceededException', + message: message); +} + +class ThrottlingException extends _s.GenericAwsException { + ThrottlingException({String? type, String? message}) + : super(type: type, code: 'ThrottlingException', message: message); +} + +class ValidationException extends _s.GenericAwsException { + ValidationException({String? type, String? message}) + : super(type: type, code: 'ValidationException', message: message); +} + +final _exceptionFns = { + 'AccessDeniedException': (type, message) => + AccessDeniedException(type: type, message: message), + 'ConflictException': (type, message) => + ConflictException(type: type, message: message), + 'InternalServerErrorException': (type, message) => + InternalServerErrorException(type: type, message: message), + 'ResourceNotFoundException': (type, message) => + ResourceNotFoundException(type: type, message: message), + 'ServiceQuotaExceededException': (type, message) => + ServiceQuotaExceededException(type: type, message: message), + 'ThrottlingException': (type, message) => + ThrottlingException(type: type, message: message), + 'ValidationException': (type, message) => + ValidationException(type: type, message: message), +}; diff --git a/aws_client/lib/src/generated/detective/v2018_10_26.dart b/aws_client/lib/src/generated/detective/v2018_10_26.dart index 92687545e..3180dc0c1 100644 --- a/aws_client/lib/src/generated/detective/v2018_10_26.dart +++ b/aws_client/lib/src/generated/detective/v2018_10_26.dart @@ -105,7 +105,7 @@ export '../../shared/shared.dart' show AwsClientCredentials; /// href="https://docs.aws.amazon.com/detective/latest/adminguide/logging-using-cloudtrail.html">Logging /// Detective API Calls with CloudTrail. /// -/// We replaced the term "master account" with the term "administrator account." +/// We replaced the term "master account" with the term "administrator account". /// An administrator account is used to centrally manage multiple accounts. In /// the case of Detective, the administrator account manages the accounts in /// their behavior graph. @@ -232,13 +232,6 @@ class Detective { /// account as the administrator account. This operation is called by the /// account that is enabling Detective. /// - /// Before you try to enable Detective, make sure that your account has been - /// enrolled in Amazon GuardDuty for at least 48 hours. If you do not meet - /// this requirement, you cannot enable Detective. If you do meet the - /// GuardDuty prerequisite, then when you make the request to enable - /// Detective, it checks whether your data volume is within the Detective - /// quota. If it exceeds the quota, then you cannot enable Detective. - /// /// The operation also enables Detective for the calling account in the /// currently selected Region. It returns the ARN of the new behavior graph. /// @@ -571,6 +564,41 @@ class Detective { ); } + /// Detective investigations lets you investigate IAM users and IAM roles + /// using indicators of compromise. An indicator of compromise (IOC) is an + /// artifact observed in or on a network, system, or environment that can + /// (with a high level of confidence) identify malicious activity or a + /// security incident. GetInvestigation returns the investigation + /// results of an investigation for a behavior graph. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [graphArn] : + /// The Amazon Resource Name (ARN) of the behavior graph. + /// + /// Parameter [investigationId] : + /// The investigation ID of the investigation report. + Future getInvestigation({ + required String graphArn, + required String investigationId, + }) async { + final $payload = { + 'GraphArn': graphArn, + 'InvestigationId': investigationId, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/investigations/getInvestigation', + exceptionFnMap: _exceptionFns, + ); + return GetInvestigationResponse.fromJson(response); + } + /// Returns the membership details for specified member accounts for a /// behavior graph. /// @@ -691,6 +719,129 @@ class Detective { return ListGraphsResponse.fromJson(response); } + /// Gets the indicators from an investigation. You can use the information + /// from the indicators to determine if an IAM user and/or IAM role is + /// involved in an unusual activity that could indicate malicious behavior and + /// its impact. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [graphArn] : + /// The Amazon Resource Name (ARN) of the behavior graph. + /// + /// Parameter [investigationId] : + /// The investigation ID of the investigation report. + /// + /// Parameter [indicatorType] : + /// For the list of indicators of compromise that are generated by Detective + /// investigations, see Detective + /// investigations. + /// + /// Parameter [maxResults] : + /// Lists the maximum number of indicators in a page. + /// + /// Parameter [nextToken] : + /// Lists if there are more results available. The value of nextToken is a + /// unique pagination token for each page. Repeat the call using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + /// + /// Each pagination token expires after 24 hours. Using an expired pagination + /// token will return a Validation Exception error. + Future listIndicators({ + required String graphArn, + required String investigationId, + IndicatorType? indicatorType, + int? maxResults, + String? nextToken, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + 'GraphArn': graphArn, + 'InvestigationId': investigationId, + if (indicatorType != null) 'IndicatorType': indicatorType.toValue(), + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/investigations/listIndicators', + exceptionFnMap: _exceptionFns, + ); + return ListIndicatorsResponse.fromJson(response); + } + + /// Detective investigations lets you investigate IAM users and IAM roles + /// using indicators of compromise. An indicator of compromise (IOC) is an + /// artifact observed in or on a network, system, or environment that can + /// (with a high level of confidence) identify malicious activity or a + /// security incident. ListInvestigations lists all active + /// Detective investigations. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [graphArn] : + /// The Amazon Resource Name (ARN) of the behavior graph. + /// + /// Parameter [filterCriteria] : + /// Filters the investigation results based on a criteria. + /// + /// Parameter [maxResults] : + /// Lists the maximum number of investigations in a page. + /// + /// Parameter [nextToken] : + /// Lists if there are more results available. The value of nextToken is a + /// unique pagination token for each page. Repeat the call using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + /// + /// Each pagination token expires after 24 hours. Using an expired pagination + /// token will return a Validation Exception error. + /// + /// Parameter [sortCriteria] : + /// Sorts the investigation results based on a criteria. + Future listInvestigations({ + required String graphArn, + FilterCriteria? filterCriteria, + int? maxResults, + String? nextToken, + SortCriteria? sortCriteria, + }) async { + _s.validateNumRange( + 'maxResults', + maxResults, + 1, + 100, + ); + final $payload = { + 'GraphArn': graphArn, + if (filterCriteria != null) 'FilterCriteria': filterCriteria, + if (maxResults != null) 'MaxResults': maxResults, + if (nextToken != null) 'NextToken': nextToken, + if (sortCriteria != null) 'SortCriteria': sortCriteria, + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/investigations/listInvestigations', + exceptionFnMap: _exceptionFns, + ); + return ListInvestigationsResponse.fromJson(response); + } + /// Retrieves the list of open and accepted behavior graph invitations for the /// member account. This operation can only be called by an invited member /// account. @@ -882,6 +1033,55 @@ class Detective { ); } + /// Detective investigations lets you investigate IAM users and IAM roles + /// using indicators of compromise. An indicator of compromise (IOC) is an + /// artifact observed in or on a network, system, or environment that can + /// (with a high level of confidence) identify malicious activity or a + /// security incident. StartInvestigation initiates an + /// investigation on an entity in a behavior graph. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [TooManyRequestsException]. + /// May throw [ResourceNotFoundException]. + /// + /// Parameter [entityArn] : + /// The unique Amazon Resource Name (ARN) of the IAM user and IAM role. + /// + /// Parameter [graphArn] : + /// The Amazon Resource Name (ARN) of the behavior graph. + /// + /// Parameter [scopeEndTime] : + /// The data and time when the investigation ended. The value is an UTC + /// ISO8601 formatted string. For example, + /// 2021-08-18T16:35:56.284Z. + /// + /// Parameter [scopeStartTime] : + /// The data and time when the investigation began. The value is an UTC + /// ISO8601 formatted string. For example, + /// 2021-08-18T16:35:56.284Z. + Future startInvestigation({ + required String entityArn, + required String graphArn, + required DateTime scopeEndTime, + required DateTime scopeStartTime, + }) async { + final $payload = { + 'EntityArn': entityArn, + 'GraphArn': graphArn, + 'ScopeEndTime': iso8601ToJson(scopeEndTime), + 'ScopeStartTime': iso8601ToJson(scopeStartTime), + }; + final response = await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/investigations/startInvestigation', + exceptionFnMap: _exceptionFns, + ); + return StartInvestigationResponse.fromJson(response); + } + /// Sends a request to enable data ingest for a member account that has a /// status of ACCEPTED_BUT_DISABLED. /// @@ -1017,6 +1217,41 @@ class Detective { ); } + /// Updates the state of an investigation. + /// + /// May throw [AccessDeniedException]. + /// May throw [InternalServerException]. + /// May throw [ValidationException]. + /// May throw [ResourceNotFoundException]. + /// May throw [TooManyRequestsException]. + /// + /// Parameter [graphArn] : + /// The Amazon Resource Name (ARN) of the behavior graph. + /// + /// Parameter [investigationId] : + /// The investigation ID of the investigation report. + /// + /// Parameter [state] : + /// The current state of the investigation. An archived investigation + /// indicates you have completed reviewing the investigation. + Future updateInvestigationState({ + required String graphArn, + required String investigationId, + required State state, + }) async { + final $payload = { + 'GraphArn': graphArn, + 'InvestigationId': investigationId, + 'State': state.toValue(), + }; + await _protocol.send( + payload: $payload, + method: 'POST', + requestUri: '/investigations/updateInvestigationState', + exceptionFnMap: _exceptionFns, + ); + } + /// Updates the configuration for the Organizations integration in the current /// Region. Can only be called by the Detective administrator account for the /// organization. @@ -1395,6 +1630,31 @@ class DatasourcePackageUsageInfo { } } +/// Contains details on the time range used to filter data. +class DateFilter { + /// A timestamp representing the end date of the time period until when data is + /// filtered, including the end date. + final DateTime endInclusive; + + /// A timestamp representing the start of the time period from when data is + /// filtered, including the start date. + final DateTime startInclusive; + + DateFilter({ + required this.endInclusive, + required this.startInclusive, + }); + + Map toJson() { + final endInclusive = this.endInclusive; + final startInclusive = this.startInclusive; + return { + 'EndInclusive': iso8601ToJson(endInclusive), + 'StartInclusive': iso8601ToJson(startInclusive), + }; + } +} + class DeleteMembersResponse { /// The list of Amazon Web Services account identifiers for the member accounts /// that Detective successfully removed from the behavior graph. @@ -1458,6 +1718,235 @@ class DescribeOrganizationConfigurationResponse { } } +enum EntityType { + iamRole, + iamUser, +} + +extension EntityTypeValueExtension on EntityType { + String toValue() { + switch (this) { + case EntityType.iamRole: + return 'IAM_ROLE'; + case EntityType.iamUser: + return 'IAM_USER'; + } + } +} + +extension EntityTypeFromString on String { + EntityType toEntityType() { + switch (this) { + case 'IAM_ROLE': + return EntityType.iamRole; + case 'IAM_USER': + return EntityType.iamUser; + } + throw Exception('$this is not known in enum EntityType'); + } +} + +enum Field { + severity, + status, + createdTime, +} + +extension FieldValueExtension on Field { + String toValue() { + switch (this) { + case Field.severity: + return 'SEVERITY'; + case Field.status: + return 'STATUS'; + case Field.createdTime: + return 'CREATED_TIME'; + } + } +} + +extension FieldFromString on String { + Field toField() { + switch (this) { + case 'SEVERITY': + return Field.severity; + case 'STATUS': + return Field.status; + case 'CREATED_TIME': + return Field.createdTime; + } + throw Exception('$this is not known in enum Field'); + } +} + +/// Details on the criteria used to define the filter for investigation results. +class FilterCriteria { + /// Filter the investigation results based on when the investigation was + /// created. + final DateFilter? createdTime; + + /// Filter the investigation results based on the Amazon Resource Name (ARN) of + /// the entity. + final StringFilter? entityArn; + + /// Filter the investigation results based on the severity. + final StringFilter? severity; + + /// Filter the investigation results based on the state. + final StringFilter? state; + + /// Filter the investigation results based on the status. + final StringFilter? status; + + FilterCriteria({ + this.createdTime, + this.entityArn, + this.severity, + this.state, + this.status, + }); + + Map toJson() { + final createdTime = this.createdTime; + final entityArn = this.entityArn; + final severity = this.severity; + final state = this.state; + final status = this.status; + return { + if (createdTime != null) 'CreatedTime': createdTime, + if (entityArn != null) 'EntityArn': entityArn, + if (severity != null) 'Severity': severity, + if (state != null) 'State': state, + if (status != null) 'Status': status, + }; + } +} + +/// Contains information on suspicious IP addresses identified as indicators of +/// compromise. This indicator is derived from Amazon Web Services threat +/// intelligence. +class FlaggedIpAddressDetail { + /// IP address of the suspicious entity. + final String? ipAddress; + + /// Details the reason the IP address was flagged as suspicious. + final Reason? reason; + + FlaggedIpAddressDetail({ + this.ipAddress, + this.reason, + }); + + factory FlaggedIpAddressDetail.fromJson(Map json) { + return FlaggedIpAddressDetail( + ipAddress: json['IpAddress'] as String?, + reason: (json['Reason'] as String?)?.toReason(), + ); + } + + Map toJson() { + final ipAddress = this.ipAddress; + final reason = this.reason; + return { + if (ipAddress != null) 'IpAddress': ipAddress, + if (reason != null) 'Reason': reason.toValue(), + }; + } +} + +class GetInvestigationResponse { + /// The creation time of the investigation report in UTC time stamp format. + final DateTime? createdTime; + + /// The unique Amazon Resource Name (ARN). Detective supports IAM user ARNs and + /// IAM role ARNs. + final String? entityArn; + + /// Type of entity. For example, Amazon Web Services accounts, such as an IAM + /// user and/or IAM role. + final EntityType? entityType; + + /// The Amazon Resource Name (ARN) of the behavior graph. + final String? graphArn; + + /// The investigation ID of the investigation report. + final String? investigationId; + + /// The data and time when the investigation began. The value is an UTC ISO8601 + /// formatted string. For example, 2021-08-18T16:35:56.284Z. + final DateTime? scopeEndTime; + + /// The start date and time used to set the scope time within which you want to + /// generate the investigation report. The value is an UTC ISO8601 formatted + /// string. For example, 2021-08-18T16:35:56.284Z. + final DateTime? scopeStartTime; + + /// The severity assigned is based on the likelihood and impact of the + /// indicators of compromise discovered in the investigation. + final Severity? severity; + + /// The current state of the investigation. An archived investigation indicates + /// that you have completed reviewing the investigation. + final State? state; + + /// The status based on the completion status of the investigation. + final Status? status; + + GetInvestigationResponse({ + this.createdTime, + this.entityArn, + this.entityType, + this.graphArn, + this.investigationId, + this.scopeEndTime, + this.scopeStartTime, + this.severity, + this.state, + this.status, + }); + + factory GetInvestigationResponse.fromJson(Map json) { + return GetInvestigationResponse( + createdTime: timeStampFromJson(json['CreatedTime']), + entityArn: json['EntityArn'] as String?, + entityType: (json['EntityType'] as String?)?.toEntityType(), + graphArn: json['GraphArn'] as String?, + investigationId: json['InvestigationId'] as String?, + scopeEndTime: timeStampFromJson(json['ScopeEndTime']), + scopeStartTime: timeStampFromJson(json['ScopeStartTime']), + severity: (json['Severity'] as String?)?.toSeverity(), + state: (json['State'] as String?)?.toState(), + status: (json['Status'] as String?)?.toStatus(), + ); + } + + Map toJson() { + final createdTime = this.createdTime; + final entityArn = this.entityArn; + final entityType = this.entityType; + final graphArn = this.graphArn; + final investigationId = this.investigationId; + final scopeEndTime = this.scopeEndTime; + final scopeStartTime = this.scopeStartTime; + final severity = this.severity; + final state = this.state; + final status = this.status; + return { + if (createdTime != null) 'CreatedTime': iso8601ToJson(createdTime), + if (entityArn != null) 'EntityArn': entityArn, + if (entityType != null) 'EntityType': entityType.toValue(), + if (graphArn != null) 'GraphArn': graphArn, + if (investigationId != null) 'InvestigationId': investigationId, + if (scopeEndTime != null) 'ScopeEndTime': iso8601ToJson(scopeEndTime), + if (scopeStartTime != null) + 'ScopeStartTime': iso8601ToJson(scopeStartTime), + if (severity != null) 'Severity': severity.toValue(), + if (state != null) 'State': state.toValue(), + if (status != null) 'Status': status.toValue(), + }; + } +} + class GetMembersResponse { /// The member account details that Detective is returning in response to the /// request. @@ -1531,18 +2020,349 @@ class Graph { } } -enum InvitationType { - invitation, - organization, -} +/// Contains information on unusual and impossible travel in an account. +class ImpossibleTravelDetail { + /// IP address where the resource was last used in the impossible travel. + final String? endingIpAddress; -extension InvitationTypeValueExtension on InvitationType { - String toValue() { - switch (this) { - case InvitationType.invitation: - return 'INVITATION'; - case InvitationType.organization: - return 'ORGANIZATION'; + /// Location where the resource was last used in the impossible travel. + final String? endingLocation; + + /// Returns the time difference between the first and last timestamp the + /// resource was used. + final int? hourlyTimeDelta; + + /// IP address where the resource was first used in the impossible travel. + final String? startingIpAddress; + + /// Location where the resource was first used in the impossible travel. + final String? startingLocation; + + ImpossibleTravelDetail({ + this.endingIpAddress, + this.endingLocation, + this.hourlyTimeDelta, + this.startingIpAddress, + this.startingLocation, + }); + + factory ImpossibleTravelDetail.fromJson(Map json) { + return ImpossibleTravelDetail( + endingIpAddress: json['EndingIpAddress'] as String?, + endingLocation: json['EndingLocation'] as String?, + hourlyTimeDelta: json['HourlyTimeDelta'] as int?, + startingIpAddress: json['StartingIpAddress'] as String?, + startingLocation: json['StartingLocation'] as String?, + ); + } + + Map toJson() { + final endingIpAddress = this.endingIpAddress; + final endingLocation = this.endingLocation; + final hourlyTimeDelta = this.hourlyTimeDelta; + final startingIpAddress = this.startingIpAddress; + final startingLocation = this.startingLocation; + return { + if (endingIpAddress != null) 'EndingIpAddress': endingIpAddress, + if (endingLocation != null) 'EndingLocation': endingLocation, + if (hourlyTimeDelta != null) 'HourlyTimeDelta': hourlyTimeDelta, + if (startingIpAddress != null) 'StartingIpAddress': startingIpAddress, + if (startingLocation != null) 'StartingLocation': startingLocation, + }; + } +} + +/// Detective investigations triages indicators of compromises such as a finding +/// and surfaces only the most critical and suspicious issues, so you can focus +/// on high-level investigations. An Indicator lets you determine +/// if an Amazon Web Services resource is involved in unusual activity that +/// could indicate malicious behavior and its impact. +class Indicator { + /// Details about the indicators of compromise that are used to determine if a + /// resource is involved in a security incident. An indicator of compromise + /// (IOC) is an artifact observed in or on a network, system, or environment + /// that can (with a high level of confidence) identify malicious activity or a + /// security incident. + final IndicatorDetail? indicatorDetail; + + /// The type of indicator. + final IndicatorType? indicatorType; + + Indicator({ + this.indicatorDetail, + this.indicatorType, + }); + + factory Indicator.fromJson(Map json) { + return Indicator( + indicatorDetail: json['IndicatorDetail'] != null + ? IndicatorDetail.fromJson( + json['IndicatorDetail'] as Map) + : null, + indicatorType: (json['IndicatorType'] as String?)?.toIndicatorType(), + ); + } + + Map toJson() { + final indicatorDetail = this.indicatorDetail; + final indicatorType = this.indicatorType; + return { + if (indicatorDetail != null) 'IndicatorDetail': indicatorDetail, + if (indicatorType != null) 'IndicatorType': indicatorType.toValue(), + }; + } +} + +/// Details about the indicators of compromise which are used to determine if a +/// resource is involved in a security incident. An indicator of compromise +/// (IOC) is an artifact observed in or on a network, system, or environment +/// that can (with a high level of confidence) identify malicious activity or a +/// security incident. For the list of indicators of compromise that are +/// generated by Detective investigations, see Detective +/// investigations. +class IndicatorDetail { + /// Suspicious IP addresses that are flagged, which indicates critical or severe + /// threats based on threat intelligence by Detective. This indicator is derived + /// from Amazon Web Services threat intelligence. + final FlaggedIpAddressDetail? flaggedIpAddressDetail; + + /// Identifies unusual and impossible user activity for an account. + final ImpossibleTravelDetail? impossibleTravelDetail; + + /// Contains details about the new Autonomous System Organization (ASO). + final NewAsoDetail? newAsoDetail; + + /// Contains details about the new geographic location. + final NewGeolocationDetail? newGeolocationDetail; + + /// Contains details about the new user agent. + final NewUserAgentDetail? newUserAgentDetail; + + /// Contains details about related findings. + final RelatedFindingDetail? relatedFindingDetail; + + /// Contains details about related finding groups. + final RelatedFindingGroupDetail? relatedFindingGroupDetail; + + /// Details about the indicator of compromise. + final TTPsObservedDetail? tTPsObservedDetail; + + IndicatorDetail({ + this.flaggedIpAddressDetail, + this.impossibleTravelDetail, + this.newAsoDetail, + this.newGeolocationDetail, + this.newUserAgentDetail, + this.relatedFindingDetail, + this.relatedFindingGroupDetail, + this.tTPsObservedDetail, + }); + + factory IndicatorDetail.fromJson(Map json) { + return IndicatorDetail( + flaggedIpAddressDetail: json['FlaggedIpAddressDetail'] != null + ? FlaggedIpAddressDetail.fromJson( + json['FlaggedIpAddressDetail'] as Map) + : null, + impossibleTravelDetail: json['ImpossibleTravelDetail'] != null + ? ImpossibleTravelDetail.fromJson( + json['ImpossibleTravelDetail'] as Map) + : null, + newAsoDetail: json['NewAsoDetail'] != null + ? NewAsoDetail.fromJson(json['NewAsoDetail'] as Map) + : null, + newGeolocationDetail: json['NewGeolocationDetail'] != null + ? NewGeolocationDetail.fromJson( + json['NewGeolocationDetail'] as Map) + : null, + newUserAgentDetail: json['NewUserAgentDetail'] != null + ? NewUserAgentDetail.fromJson( + json['NewUserAgentDetail'] as Map) + : null, + relatedFindingDetail: json['RelatedFindingDetail'] != null + ? RelatedFindingDetail.fromJson( + json['RelatedFindingDetail'] as Map) + : null, + relatedFindingGroupDetail: json['RelatedFindingGroupDetail'] != null + ? RelatedFindingGroupDetail.fromJson( + json['RelatedFindingGroupDetail'] as Map) + : null, + tTPsObservedDetail: json['TTPsObservedDetail'] != null + ? TTPsObservedDetail.fromJson( + json['TTPsObservedDetail'] as Map) + : null, + ); + } + + Map toJson() { + final flaggedIpAddressDetail = this.flaggedIpAddressDetail; + final impossibleTravelDetail = this.impossibleTravelDetail; + final newAsoDetail = this.newAsoDetail; + final newGeolocationDetail = this.newGeolocationDetail; + final newUserAgentDetail = this.newUserAgentDetail; + final relatedFindingDetail = this.relatedFindingDetail; + final relatedFindingGroupDetail = this.relatedFindingGroupDetail; + final tTPsObservedDetail = this.tTPsObservedDetail; + return { + if (flaggedIpAddressDetail != null) + 'FlaggedIpAddressDetail': flaggedIpAddressDetail, + if (impossibleTravelDetail != null) + 'ImpossibleTravelDetail': impossibleTravelDetail, + if (newAsoDetail != null) 'NewAsoDetail': newAsoDetail, + if (newGeolocationDetail != null) + 'NewGeolocationDetail': newGeolocationDetail, + if (newUserAgentDetail != null) 'NewUserAgentDetail': newUserAgentDetail, + if (relatedFindingDetail != null) + 'RelatedFindingDetail': relatedFindingDetail, + if (relatedFindingGroupDetail != null) + 'RelatedFindingGroupDetail': relatedFindingGroupDetail, + if (tTPsObservedDetail != null) 'TTPsObservedDetail': tTPsObservedDetail, + }; + } +} + +enum IndicatorType { + ttpObserved, + impossibleTravel, + flaggedIpAddress, + newGeolocation, + newAso, + newUserAgent, + relatedFinding, + relatedFindingGroup, +} + +extension IndicatorTypeValueExtension on IndicatorType { + String toValue() { + switch (this) { + case IndicatorType.ttpObserved: + return 'TTP_OBSERVED'; + case IndicatorType.impossibleTravel: + return 'IMPOSSIBLE_TRAVEL'; + case IndicatorType.flaggedIpAddress: + return 'FLAGGED_IP_ADDRESS'; + case IndicatorType.newGeolocation: + return 'NEW_GEOLOCATION'; + case IndicatorType.newAso: + return 'NEW_ASO'; + case IndicatorType.newUserAgent: + return 'NEW_USER_AGENT'; + case IndicatorType.relatedFinding: + return 'RELATED_FINDING'; + case IndicatorType.relatedFindingGroup: + return 'RELATED_FINDING_GROUP'; + } + } +} + +extension IndicatorTypeFromString on String { + IndicatorType toIndicatorType() { + switch (this) { + case 'TTP_OBSERVED': + return IndicatorType.ttpObserved; + case 'IMPOSSIBLE_TRAVEL': + return IndicatorType.impossibleTravel; + case 'FLAGGED_IP_ADDRESS': + return IndicatorType.flaggedIpAddress; + case 'NEW_GEOLOCATION': + return IndicatorType.newGeolocation; + case 'NEW_ASO': + return IndicatorType.newAso; + case 'NEW_USER_AGENT': + return IndicatorType.newUserAgent; + case 'RELATED_FINDING': + return IndicatorType.relatedFinding; + case 'RELATED_FINDING_GROUP': + return IndicatorType.relatedFindingGroup; + } + throw Exception('$this is not known in enum IndicatorType'); + } +} + +/// Details about the investigation related to a potential security event +/// identified by Detective. +class InvestigationDetail { + /// The time stamp of the creation time of the investigation report. The value + /// is an UTC ISO8601 formatted string. For example, + /// 2021-08-18T16:35:56.284Z. + final DateTime? createdTime; + + /// The unique Amazon Resource Name (ARN) of the IAM user and IAM role. + final String? entityArn; + + /// Type of entity. For example, Amazon Web Services accounts, such as IAM user + /// and role. + final EntityType? entityType; + + /// The investigation ID of the investigation report. + final String? investigationId; + + /// Severity based on the likelihood and impact of the indicators of compromise + /// discovered in the investigation. + final Severity? severity; + + /// The current state of the investigation. An archived investigation indicates + /// you have completed reviewing the investigation. + final State? state; + + /// Status based on the completion status of the investigation. + final Status? status; + + InvestigationDetail({ + this.createdTime, + this.entityArn, + this.entityType, + this.investigationId, + this.severity, + this.state, + this.status, + }); + + factory InvestigationDetail.fromJson(Map json) { + return InvestigationDetail( + createdTime: timeStampFromJson(json['CreatedTime']), + entityArn: json['EntityArn'] as String?, + entityType: (json['EntityType'] as String?)?.toEntityType(), + investigationId: json['InvestigationId'] as String?, + severity: (json['Severity'] as String?)?.toSeverity(), + state: (json['State'] as String?)?.toState(), + status: (json['Status'] as String?)?.toStatus(), + ); + } + + Map toJson() { + final createdTime = this.createdTime; + final entityArn = this.entityArn; + final entityType = this.entityType; + final investigationId = this.investigationId; + final severity = this.severity; + final state = this.state; + final status = this.status; + return { + if (createdTime != null) 'CreatedTime': iso8601ToJson(createdTime), + if (entityArn != null) 'EntityArn': entityArn, + if (entityType != null) 'EntityType': entityType.toValue(), + if (investigationId != null) 'InvestigationId': investigationId, + if (severity != null) 'Severity': severity.toValue(), + if (state != null) 'State': state.toValue(), + if (status != null) 'Status': status.toValue(), + }; + } +} + +enum InvitationType { + invitation, + organization, +} + +extension InvitationTypeValueExtension on InvitationType { + String toValue() { + switch (this) { + case InvitationType.invitation: + return 'INVITATION'; + case InvitationType.organization: + return 'ORGANIZATION'; } } } @@ -1630,6 +2450,95 @@ class ListGraphsResponse { } } +class ListIndicatorsResponse { + /// The Amazon Resource Name (ARN) of the behavior graph. + final String? graphArn; + + /// Lists the indicators of compromise. + final List? indicators; + + /// The investigation ID of the investigation report. + final String? investigationId; + + /// Lists if there are more results available. The value of nextToken is a + /// unique pagination token for each page. Repeat the call using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + /// + /// Each pagination token expires after 24 hours. Using an expired pagination + /// token will return a Validation Exception error. + final String? nextToken; + + ListIndicatorsResponse({ + this.graphArn, + this.indicators, + this.investigationId, + this.nextToken, + }); + + factory ListIndicatorsResponse.fromJson(Map json) { + return ListIndicatorsResponse( + graphArn: json['GraphArn'] as String?, + indicators: (json['Indicators'] as List?) + ?.whereNotNull() + .map((e) => Indicator.fromJson(e as Map)) + .toList(), + investigationId: json['InvestigationId'] as String?, + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final graphArn = this.graphArn; + final indicators = this.indicators; + final investigationId = this.investigationId; + final nextToken = this.nextToken; + return { + if (graphArn != null) 'GraphArn': graphArn, + if (indicators != null) 'Indicators': indicators, + if (investigationId != null) 'InvestigationId': investigationId, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + +class ListInvestigationsResponse { + /// Lists the summary of uncommon behavior or malicious activity which indicates + /// a compromise. + final List? investigationDetails; + + /// Lists if there are more results available. The value of nextToken is a + /// unique pagination token for each page. Repeat the call using the returned + /// token to retrieve the next page. Keep all other arguments unchanged. + /// + /// Each pagination token expires after 24 hours. + final String? nextToken; + + ListInvestigationsResponse({ + this.investigationDetails, + this.nextToken, + }); + + factory ListInvestigationsResponse.fromJson(Map json) { + return ListInvestigationsResponse( + investigationDetails: (json['InvestigationDetails'] as List?) + ?.whereNotNull() + .map((e) => InvestigationDetail.fromJson(e as Map)) + .toList(), + nextToken: json['NextToken'] as String?, + ); + } + + Map toJson() { + final investigationDetails = this.investigationDetails; + final nextToken = this.nextToken; + return { + if (investigationDetails != null) + 'InvestigationDetails': investigationDetails, + if (nextToken != null) 'NextToken': nextToken, + }; + } +} + class ListInvitationsResponse { /// The list of behavior graphs for which the member account has open or /// accepted invitations. @@ -2112,6 +3021,461 @@ class MembershipDatasources { } } +/// Details new Autonomous System Organizations (ASOs) used either at the +/// resource or account level. +class NewAsoDetail { + /// Details about the new Autonomous System Organization (ASO). + final String? aso; + + /// Checks if the Autonomous System Organization (ASO) is new for the entire + /// account. + final bool? isNewForEntireAccount; + + NewAsoDetail({ + this.aso, + this.isNewForEntireAccount, + }); + + factory NewAsoDetail.fromJson(Map json) { + return NewAsoDetail( + aso: json['Aso'] as String?, + isNewForEntireAccount: json['IsNewForEntireAccount'] as bool?, + ); + } + + Map toJson() { + final aso = this.aso; + final isNewForEntireAccount = this.isNewForEntireAccount; + return { + if (aso != null) 'Aso': aso, + if (isNewForEntireAccount != null) + 'IsNewForEntireAccount': isNewForEntireAccount, + }; + } +} + +/// Details new geolocations used either at the resource or account level. For +/// example, lists an observed geolocation that is an infrequent or unused +/// location based on previous user activity. +class NewGeolocationDetail { + /// IP address using which the resource was accessed. + final String? ipAddress; + + /// Checks if the geolocation is new for the entire account. + final bool? isNewForEntireAccount; + + /// Location where the resource was accessed. + final String? location; + + NewGeolocationDetail({ + this.ipAddress, + this.isNewForEntireAccount, + this.location, + }); + + factory NewGeolocationDetail.fromJson(Map json) { + return NewGeolocationDetail( + ipAddress: json['IpAddress'] as String?, + isNewForEntireAccount: json['IsNewForEntireAccount'] as bool?, + location: json['Location'] as String?, + ); + } + + Map toJson() { + final ipAddress = this.ipAddress; + final isNewForEntireAccount = this.isNewForEntireAccount; + final location = this.location; + return { + if (ipAddress != null) 'IpAddress': ipAddress, + if (isNewForEntireAccount != null) + 'IsNewForEntireAccount': isNewForEntireAccount, + if (location != null) 'Location': location, + }; + } +} + +/// Details new user agents used either at the resource or account level. +class NewUserAgentDetail { + /// Checks if the user agent is new for the entire account. + final bool? isNewForEntireAccount; + + /// New user agent which accessed the resource. + final String? userAgent; + + NewUserAgentDetail({ + this.isNewForEntireAccount, + this.userAgent, + }); + + factory NewUserAgentDetail.fromJson(Map json) { + return NewUserAgentDetail( + isNewForEntireAccount: json['IsNewForEntireAccount'] as bool?, + userAgent: json['UserAgent'] as String?, + ); + } + + Map toJson() { + final isNewForEntireAccount = this.isNewForEntireAccount; + final userAgent = this.userAgent; + return { + if (isNewForEntireAccount != null) + 'IsNewForEntireAccount': isNewForEntireAccount, + if (userAgent != null) 'UserAgent': userAgent, + }; + } +} + +enum Reason { + awsThreatIntelligence, +} + +extension ReasonValueExtension on Reason { + String toValue() { + switch (this) { + case Reason.awsThreatIntelligence: + return 'AWS_THREAT_INTELLIGENCE'; + } + } +} + +extension ReasonFromString on String { + Reason toReason() { + switch (this) { + case 'AWS_THREAT_INTELLIGENCE': + return Reason.awsThreatIntelligence; + } + throw Exception('$this is not known in enum Reason'); + } +} + +/// Details related activities associated with a potential security event. Lists +/// all distinct categories of evidence that are connected to the resource or +/// the finding group. +class RelatedFindingDetail { + /// The Amazon Resource Name (ARN) of the related finding. + final String? arn; + + /// The IP address of the finding. + final String? ipAddress; + + /// The type of finding. + final String? type; + + RelatedFindingDetail({ + this.arn, + this.ipAddress, + this.type, + }); + + factory RelatedFindingDetail.fromJson(Map json) { + return RelatedFindingDetail( + arn: json['Arn'] as String?, + ipAddress: json['IpAddress'] as String?, + type: json['Type'] as String?, + ); + } + + Map toJson() { + final arn = this.arn; + final ipAddress = this.ipAddress; + final type = this.type; + return { + if (arn != null) 'Arn': arn, + if (ipAddress != null) 'IpAddress': ipAddress, + if (type != null) 'Type': type, + }; + } +} + +/// Details multiple activities as they related to a potential security event. +/// Detective uses graph analysis technique that infers relationships between +/// findings and entities, and groups them together as a finding group. +class RelatedFindingGroupDetail { + /// The unique identifier for the finding group. + final String? id; + + RelatedFindingGroupDetail({ + this.id, + }); + + factory RelatedFindingGroupDetail.fromJson(Map json) { + return RelatedFindingGroupDetail( + id: json['Id'] as String?, + ); + } + + Map toJson() { + final id = this.id; + return { + if (id != null) 'Id': id, + }; + } +} + +enum Severity { + informational, + low, + medium, + high, + critical, +} + +extension SeverityValueExtension on Severity { + String toValue() { + switch (this) { + case Severity.informational: + return 'INFORMATIONAL'; + case Severity.low: + return 'LOW'; + case Severity.medium: + return 'MEDIUM'; + case Severity.high: + return 'HIGH'; + case Severity.critical: + return 'CRITICAL'; + } + } +} + +extension SeverityFromString on String { + Severity toSeverity() { + switch (this) { + case 'INFORMATIONAL': + return Severity.informational; + case 'LOW': + return Severity.low; + case 'MEDIUM': + return Severity.medium; + case 'HIGH': + return Severity.high; + case 'CRITICAL': + return Severity.critical; + } + throw Exception('$this is not known in enum Severity'); + } +} + +/// Details about the criteria used for sorting investigations. +class SortCriteria { + /// Represents the Field attribute to sort investigations. + final Field? field; + + /// The order by which the sorted findings are displayed. + final SortOrder? sortOrder; + + SortCriteria({ + this.field, + this.sortOrder, + }); + + Map toJson() { + final field = this.field; + final sortOrder = this.sortOrder; + return { + if (field != null) 'Field': field.toValue(), + if (sortOrder != null) 'SortOrder': sortOrder.toValue(), + }; + } +} + +enum SortOrder { + asc, + desc, +} + +extension SortOrderValueExtension on SortOrder { + String toValue() { + switch (this) { + case SortOrder.asc: + return 'ASC'; + case SortOrder.desc: + return 'DESC'; + } + } +} + +extension SortOrderFromString on String { + SortOrder toSortOrder() { + switch (this) { + case 'ASC': + return SortOrder.asc; + case 'DESC': + return SortOrder.desc; + } + throw Exception('$this is not known in enum SortOrder'); + } +} + +class StartInvestigationResponse { + /// The investigation ID of the investigation report. + final String? investigationId; + + StartInvestigationResponse({ + this.investigationId, + }); + + factory StartInvestigationResponse.fromJson(Map json) { + return StartInvestigationResponse( + investigationId: json['InvestigationId'] as String?, + ); + } + + Map toJson() { + final investigationId = this.investigationId; + return { + if (investigationId != null) 'InvestigationId': investigationId, + }; + } +} + +enum State { + active, + archived, +} + +extension StateValueExtension on State { + String toValue() { + switch (this) { + case State.active: + return 'ACTIVE'; + case State.archived: + return 'ARCHIVED'; + } + } +} + +extension StateFromString on String { + State toState() { + switch (this) { + case 'ACTIVE': + return State.active; + case 'ARCHIVED': + return State.archived; + } + throw Exception('$this is not known in enum State'); + } +} + +enum Status { + running, + failed, + successful, +} + +extension StatusValueExtension on Status { + String toValue() { + switch (this) { + case Status.running: + return 'RUNNING'; + case Status.failed: + return 'FAILED'; + case Status.successful: + return 'SUCCESSFUL'; + } + } +} + +extension StatusFromString on String { + Status toStatus() { + switch (this) { + case 'RUNNING': + return Status.running; + case 'FAILED': + return Status.failed; + case 'SUCCESSFUL': + return Status.successful; + } + throw Exception('$this is not known in enum Status'); + } +} + +/// A string for filtering Detective investigations. +class StringFilter { + /// The string filter value. + final String value; + + StringFilter({ + required this.value, + }); + + Map toJson() { + final value = this.value; + return { + 'Value': value, + }; + } +} + +/// Details tactics, techniques, and procedures (TTPs) used in a potential +/// security event. Tactics are based on MITRE ATT&CK Matrix +/// for Enterprise. +class TTPsObservedDetail { + /// The total number of failed API requests. + final int? aPIFailureCount; + + /// The name of the API where the tactics, techniques, and procedure (TTP) was + /// observed. + final String? aPIName; + + /// The total number of successful API requests. + final int? aPISuccessCount; + + /// The IP address where the tactics, techniques, and procedure (TTP) was + /// observed. + final String? ipAddress; + + /// The procedure used, identified by the investigation. + final String? procedure; + + /// The tactic used, identified by the investigation. + final String? tactic; + + /// The technique used, identified by the investigation. + final String? technique; + + TTPsObservedDetail({ + this.aPIFailureCount, + this.aPIName, + this.aPISuccessCount, + this.ipAddress, + this.procedure, + this.tactic, + this.technique, + }); + + factory TTPsObservedDetail.fromJson(Map json) { + return TTPsObservedDetail( + aPIFailureCount: json['APIFailureCount'] as int?, + aPIName: json['APIName'] as String?, + aPISuccessCount: json['APISuccessCount'] as int?, + ipAddress: json['IpAddress'] as String?, + procedure: json['Procedure'] as String?, + tactic: json['Tactic'] as String?, + technique: json['Technique'] as String?, + ); + } + + Map toJson() { + final aPIFailureCount = this.aPIFailureCount; + final aPIName = this.aPIName; + final aPISuccessCount = this.aPISuccessCount; + final ipAddress = this.ipAddress; + final procedure = this.procedure; + final tactic = this.tactic; + final technique = this.technique; + return { + if (aPIFailureCount != null) 'APIFailureCount': aPIFailureCount, + if (aPIName != null) 'APIName': aPIName, + if (aPISuccessCount != null) 'APISuccessCount': aPISuccessCount, + if (ipAddress != null) 'IpAddress': ipAddress, + if (procedure != null) 'Procedure': procedure, + if (tactic != null) 'Tactic': tactic, + if (technique != null) 'Technique': technique, + }; + } +} + class TagResourceResponse { TagResourceResponse(); diff --git a/aws_client/lib/src/generated/dev_ops_guru/v2020_12_01.dart b/aws_client/lib/src/generated/dev_ops_guru/v2020_12_01.dart index a03e7d620..ba9c90eb6 100644 --- a/aws_client/lib/src/generated/dev_ops_guru/v2020_12_01.dart +++ b/aws_client/lib/src/generated/dev_ops_guru/v2020_12_01.dart @@ -74,18 +74,12 @@ class DevOpsGuru { /// is generated. /// /// If you use an Amazon SNS topic in another account, you must attach a - /// policy to it that grants DevOps Guru permission to it notifications. + /// policy to it that grants DevOps Guru permission to send it notifications. /// DevOps Guru adds the required policy on your behalf to send notifications /// using Amazon SNS in your account. DevOps Guru only supports standard SNS /// topics. For more information, see Permissions - /// for cross account Amazon SNS topics. - /// - /// If you use an Amazon SNS topic in another account, you must attach a - /// policy to it that grants DevOps Guru permission to it notifications. - /// DevOps Guru adds the required policy on your behalf to send notifications - /// using Amazon SNS in your account. For more information, see Permissions - /// for cross account Amazon SNS topics. + /// for Amazon SNS topics. /// /// If you use an Amazon SNS topic that is encrypted by an Amazon Web Services /// Key Management Service customer-managed key (CMK), then you must add @@ -3464,6 +3458,116 @@ extension InsightTypeFromString on String { } } +/// Information about the KMS encryption used with DevOps Guru. +class KMSServerSideEncryptionIntegration { + /// Describes the specified KMS key. + /// + /// To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. + /// When using an alias name, prefix it with "alias/". If you specify a + /// predefined Amazon Web Services alias (an Amazon Web Services alias with no + /// key ID), Amazon Web Services KMS associates the alias with an Amazon Web + /// Services managed key and returns its KeyId and Arn in the response. To + /// specify a KMS key in a different Amazon Web Services account, you must use + /// the key ARN or alias ARN. + /// + /// For example: + /// + /// Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + /// + /// Key ARN: + /// arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + /// + /// Alias name: alias/ExampleAlias + /// + /// Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + final String? kMSKeyId; + + /// Specifies if DevOps Guru is enabled for customer managed keys. + final OptInStatus? optInStatus; + + /// The type of KMS key used. Customer managed keys are the KMS keys that you + /// create. Amazon Web Services owned keys are keys that are owned and managed + /// by DevOps Guru. + final ServerSideEncryptionType? type; + + KMSServerSideEncryptionIntegration({ + this.kMSKeyId, + this.optInStatus, + this.type, + }); + + factory KMSServerSideEncryptionIntegration.fromJson( + Map json) { + return KMSServerSideEncryptionIntegration( + kMSKeyId: json['KMSKeyId'] as String?, + optInStatus: (json['OptInStatus'] as String?)?.toOptInStatus(), + type: (json['Type'] as String?)?.toServerSideEncryptionType(), + ); + } + + Map toJson() { + final kMSKeyId = this.kMSKeyId; + final optInStatus = this.optInStatus; + final type = this.type; + return { + if (kMSKeyId != null) 'KMSKeyId': kMSKeyId, + if (optInStatus != null) 'OptInStatus': optInStatus.toValue(), + if (type != null) 'Type': type.toValue(), + }; + } +} + +/// Information about whether DevOps Guru is configured to encrypt server-side +/// data using KMS. +class KMSServerSideEncryptionIntegrationConfig { + /// Describes the specified KMS key. + /// + /// To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. + /// When using an alias name, prefix it with "alias/". If you specify a + /// predefined Amazon Web Services alias (an Amazon Web Services alias with no + /// key ID), Amazon Web Services KMS associates the alias with an Amazon Web + /// Services managed key and returns its KeyId and Arn in the response. To + /// specify a KMS key in a different Amazon Web Services account, you must use + /// the key ARN or alias ARN. + /// + /// For example: + /// + /// Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + /// + /// Key ARN: + /// arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + /// + /// Alias name: alias/ExampleAlias + /// + /// Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + final String? kMSKeyId; + + /// Specifies if DevOps Guru is enabled for KMS integration. + final OptInStatus? optInStatus; + + /// The type of KMS key used. Customer managed keys are the KMS keys that you + /// create. Amazon Web Services owned keys are keys that are owned and managed + /// by DevOps Guru. + final ServerSideEncryptionType? type; + + KMSServerSideEncryptionIntegrationConfig({ + this.kMSKeyId, + this.optInStatus, + this.type, + }); + + Map toJson() { + final kMSKeyId = this.kMSKeyId; + final optInStatus = this.optInStatus; + final type = this.type; + return { + if (kMSKeyId != null) 'KMSKeyId': kMSKeyId, + if (optInStatus != null) 'OptInStatus': optInStatus.toValue(), + if (type != null) 'Type': type.toValue(), + }; + } +} + /// Specifies one or more service names that are used to list anomalies. class ListAnomaliesForInsightFilters { final ServiceCollection? serviceCollection; @@ -4304,18 +4408,12 @@ class MonitoredResourceIdentifier { /// notification channel is Amazon Simple Notification Service (Amazon SNS). /// /// If you use an Amazon SNS topic in another account, you must attach a policy -/// to it that grants DevOps Guru permission to it notifications. DevOps Guru -/// adds the required policy on your behalf to send notifications using Amazon -/// SNS in your account. DevOps Guru only supports standard SNS topics. For more -/// information, see Permissions -/// for cross account Amazon SNS topics. -/// -/// If you use an Amazon SNS topic in another account, you must attach a policy -/// to it that grants DevOps Guru permission to it notifications. DevOps Guru -/// adds the required policy on your behalf to send notifications using Amazon -/// SNS in your account. For more information, see Permissions for cross account -/// Amazon SNS topics. +/// for Amazon SNS topics. /// /// If you use an Amazon SNS topic that is encrypted by an Amazon Web Services /// Key Management Service customer-managed key (CMK), then you must add @@ -4363,18 +4461,12 @@ class NotificationChannelConfig { /// notifications when insights are created. /// /// If you use an Amazon SNS topic in another account, you must attach a policy - /// to it that grants DevOps Guru permission to it notifications. DevOps Guru - /// adds the required policy on your behalf to send notifications using Amazon - /// SNS in your account. DevOps Guru only supports standard SNS topics. For more - /// information, see Permissions - /// for cross account Amazon SNS topics. - /// - /// If you use an Amazon SNS topic in another account, you must attach a policy - /// to it that grants DevOps Guru permission to it notifications. DevOps Guru - /// adds the required policy on your behalf to send notifications using Amazon - /// SNS in your account. For more information, see Permissions for cross account - /// Amazon SNS topics. + /// for Amazon SNS topics. /// /// If you use an Amazon SNS topic that is encrypted by an Amazon Web Services /// Key Management Service customer-managed key (CMK), then you must add @@ -7168,6 +7260,34 @@ class SearchOrganizationInsightsResponse { } } +enum ServerSideEncryptionType { + customerManagedKey, + awsOwnedKmsKey, +} + +extension ServerSideEncryptionTypeValueExtension on ServerSideEncryptionType { + String toValue() { + switch (this) { + case ServerSideEncryptionType.customerManagedKey: + return 'CUSTOMER_MANAGED_KEY'; + case ServerSideEncryptionType.awsOwnedKmsKey: + return 'AWS_OWNED_KMS_KEY'; + } + } +} + +extension ServerSideEncryptionTypeFromString on String { + ServerSideEncryptionType toServerSideEncryptionType() { + switch (this) { + case 'CUSTOMER_MANAGED_KEY': + return ServerSideEncryptionType.customerManagedKey; + case 'AWS_OWNED_KMS_KEY': + return ServerSideEncryptionType.awsOwnedKmsKey; + } + throw Exception('$this is not known in enum ServerSideEncryptionType'); + } +} + /// A collection of the names of Amazon Web Services services. class ServiceCollection { /// An array of strings that each specifies the name of an Amazon Web Services @@ -7276,6 +7396,10 @@ class ServiceInsightHealth { /// Information about the integration of DevOps Guru with another Amazon Web /// Services service, such as Amazon Web Services Systems Manager. class ServiceIntegrationConfig { + /// Information about whether DevOps Guru is configured to encrypt server-side + /// data using KMS. + final KMSServerSideEncryptionIntegration? kMSServerSideEncryption; + /// Information about whether DevOps Guru is configured to perform log anomaly /// detection on Amazon CloudWatch log groups. final LogsAnomalyDetectionIntegration? logsAnomalyDetection; @@ -7285,12 +7409,17 @@ class ServiceIntegrationConfig { final OpsCenterIntegration? opsCenter; ServiceIntegrationConfig({ + this.kMSServerSideEncryption, this.logsAnomalyDetection, this.opsCenter, }); factory ServiceIntegrationConfig.fromJson(Map json) { return ServiceIntegrationConfig( + kMSServerSideEncryption: json['KMSServerSideEncryption'] != null + ? KMSServerSideEncryptionIntegration.fromJson( + json['KMSServerSideEncryption'] as Map) + : null, logsAnomalyDetection: json['LogsAnomalyDetection'] != null ? LogsAnomalyDetectionIntegration.fromJson( json['LogsAnomalyDetection'] as Map) @@ -7303,9 +7432,12 @@ class ServiceIntegrationConfig { } Map toJson() { + final kMSServerSideEncryption = this.kMSServerSideEncryption; final logsAnomalyDetection = this.logsAnomalyDetection; final opsCenter = this.opsCenter; return { + if (kMSServerSideEncryption != null) + 'KMSServerSideEncryption': kMSServerSideEncryption, if (logsAnomalyDetection != null) 'LogsAnomalyDetection': logsAnomalyDetection, if (opsCenter != null) 'OpsCenter': opsCenter, @@ -7527,18 +7659,12 @@ class ServiceResourceCost { /// Service topic. /// /// If you use an Amazon SNS topic in another account, you must attach a policy -/// to it that grants DevOps Guru permission to it notifications. DevOps Guru -/// adds the required policy on your behalf to send notifications using Amazon -/// SNS in your account. DevOps Guru only supports standard SNS topics. For more -/// information, see Permissions -/// for cross account Amazon SNS topics. -/// -/// If you use an Amazon SNS topic in another account, you must attach a policy -/// to it that grants DevOps Guru permission to it notifications. DevOps Guru -/// adds the required policy on your behalf to send notifications using Amazon -/// SNS in your account. For more information, see Permissions for cross account -/// Amazon SNS topics. +/// for Amazon SNS topics. /// /// If you use an Amazon SNS topic that is encrypted by an Amazon Web Services /// Key Management Service customer-managed key (CMK), then you must add @@ -8068,20 +8194,28 @@ class UpdateResourceCollectionResponse { /// Information about updating the integration status of an Amazon Web Services /// service, such as Amazon Web Services Systems Manager, with DevOps Guru. class UpdateServiceIntegrationConfig { + /// Information about whether DevOps Guru is configured to encrypt server-side + /// data using KMS. + final KMSServerSideEncryptionIntegrationConfig? kMSServerSideEncryption; + /// Information about whether DevOps Guru is configured to perform log anomaly /// detection on Amazon CloudWatch log groups. final LogsAnomalyDetectionIntegrationConfig? logsAnomalyDetection; final OpsCenterIntegrationConfig? opsCenter; UpdateServiceIntegrationConfig({ + this.kMSServerSideEncryption, this.logsAnomalyDetection, this.opsCenter, }); Map toJson() { + final kMSServerSideEncryption = this.kMSServerSideEncryption; final logsAnomalyDetection = this.logsAnomalyDetection; final opsCenter = this.opsCenter; return { + if (kMSServerSideEncryption != null) + 'KMSServerSideEncryption': kMSServerSideEncryption, if (logsAnomalyDetection != null) 'LogsAnomalyDetection': logsAnomalyDetection, if (opsCenter != null) 'OpsCenter': opsCenter, diff --git a/aws_client/lib/src/generated/direct_connect/v2012_10_25.dart b/aws_client/lib/src/generated/direct_connect/v2012_10_25.dart index 2d8b4290c..287342793 100644 --- a/aws_client/lib/src/generated/direct_connect/v2012_10_25.dart +++ b/aws_client/lib/src/generated/direct_connect/v2012_10_25.dart @@ -2958,7 +2958,7 @@ class DirectConnect { /// support jumbo frames. Updating the connection disrupts network /// connectivity for all virtual interfaces associated with the connection for /// up to 30 seconds. To check whether your connection supports jumbo frames, - /// call DescribeConnections. To check whether your virtual q interface + /// call DescribeConnections. To check whether your virtual interface /// supports jumbo frames, call DescribeVirtualInterfaces. /// /// May throw [DirectConnectServerException]. @@ -3725,7 +3725,7 @@ class Connection { /// address family (IPv4/IPv6). final HasLogicalRedundancy? hasLogicalRedundancy; - /// Indicates whether jumbo frames (9001 MTU) are supported. + /// Indicates whether jumbo frames are supported. final bool? jumboFrameCapable; /// The ID of the LAG. @@ -5442,7 +5442,7 @@ class Interconnect { ///
    final InterconnectState? interconnectState; - /// Indicates whether jumbo frames (9001 MTU) are supported. + /// Indicates whether jumbo frames are supported. final bool? jumboFrameCapable; /// The ID of the LAG. @@ -5656,7 +5656,7 @@ class Lag { /// family (IPv4/IPv6). final HasLogicalRedundancy? hasLogicalRedundancy; - /// Indicates whether jumbo frames (9001 MTU) are supported. + /// Indicates whether jumbo frames are supported. final bool? jumboFrameCapable; /// The ID of the LAG. @@ -7112,7 +7112,7 @@ class VirtualInterface { /// The ID of the Direct Connect gateway. final String? directConnectGatewayId; - /// Indicates whether jumbo frames (9001 MTU) are supported. + /// Indicates whether jumbo frames are supported. final bool? jumboFrameCapable; /// The location of the connection. diff --git a/aws_client/lib/src/generated/dlm/v2018_01_12.dart b/aws_client/lib/src/generated/dlm/v2018_01_12.dart index 05a2aa8e9..61bcf2198 100644 --- a/aws_client/lib/src/generated/dlm/v2018_01_12.dart +++ b/aws_client/lib/src/generated/dlm/v2018_01_12.dart @@ -51,8 +51,34 @@ class Dlm { _protocol.close(); } - /// Creates a policy to manage the lifecycle of the specified Amazon Web - /// Services resources. You can create up to 100 lifecycle policies. + /// Creates an Amazon Data Lifecycle Manager lifecycle policy. Amazon Data + /// Lifecycle Manager supports the following policy types: + /// + ///
      + ///
    • + /// Custom EBS snapshot policy + ///
    • + ///
    • + /// Custom EBS-backed AMI policy + ///
    • + ///
    • + /// Cross-account copy event policy + ///
    • + ///
    • + /// Default policy for EBS snapshots + ///
    • + ///
    • + /// Default policy for EBS-backed AMIs + ///
    • + ///
    + /// For more information, see + /// Default policies vs custom policies. + /// + /// If you create a default policy, you can specify the request parameters + /// either in the request body, or in the PolicyDetails request structure, but + /// not both. + /// /// /// May throw [InvalidRequestException]. /// May throw [LimitExceededException]. @@ -66,26 +92,139 @@ class Dlm { /// The Amazon Resource Name (ARN) of the IAM role used to run the operations /// specified by the lifecycle policy. /// + /// Parameter [state] : + /// The activation state of the lifecycle policy after creation. + /// + /// Parameter [copyTags] : + /// [Default policies only] Indicates whether the policy should copy + /// tags from the source resource to the snapshot or AMI. If you do not + /// specify a value, the default is false. + /// + /// Default: false + /// + /// Parameter [createInterval] : + /// [Default policies only] Specifies how often the policy should run + /// and create snapshots or AMIs. The creation frequency can range from 1 to 7 + /// days. If you do not specify a value, the default is 1. + /// + /// Default: 1 + /// + /// Parameter [crossRegionCopyTargets] : + /// [Default policies only] Specifies destination Regions for snapshot + /// or AMI copies. You can specify up to 3 destination Regions. If you do not + /// want to create cross-Region copies, omit this parameter. + /// + /// Parameter [defaultPolicy] : + /// [Default policies only] Specify the type of default policy to + /// create. + /// + ///
      + ///
    • + /// To create a default policy for EBS snapshots, that creates snapshots of + /// all volumes in the Region that do not have recent backups, specify + /// VOLUME. + ///
    • + ///
    • + /// To create a default policy for EBS-backed AMIs, that creates EBS-backed + /// AMIs from all instances in the Region that do not have recent backups, + /// specify INSTANCE. + ///
    • + ///
    + /// + /// Parameter [exclusions] : + /// [Default policies only] Specifies exclusion parameters for volumes + /// or instances for which you do not want to create snapshots or AMIs. The + /// policy will not create snapshots or AMIs for target resources that match + /// any of the specified exclusion parameters. + /// + /// Parameter [extendDeletion] : + /// [Default policies only] Defines the snapshot or AMI retention + /// behavior for the policy if the source volume or instance is deleted, or if + /// the policy enters the error, disabled, or deleted state. + /// + /// By default (ExtendDeletion=false): + /// + ///
      + ///
    • + /// If a source resource is deleted, Amazon Data Lifecycle Manager will + /// continue to delete previously created snapshots or AMIs, up to but not + /// including the last one, based on the specified retention period. If you + /// want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, + /// including the last one, specify true. + ///
    • + ///
    • + /// If a policy enters the error, disabled, or deleted state, Amazon Data + /// Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon + /// Data Lifecycle Manager to continue deleting snapshots or AMIs, including + /// the last one, if the policy enters one of these states, specify + /// true. + ///
    • + ///
    + /// If you enable extended deletion (ExtendDeletion=true), you override + /// both default behaviors simultaneously. + /// + /// If you do not specify a value, the default is false. + /// + /// Default: false + /// /// Parameter [policyDetails] : /// The configuration details of the lifecycle policy. + /// + /// If you create a default policy, you can specify the request parameters + /// either in the request body, or in the PolicyDetails request structure, but + /// not both. + /// /// - /// Parameter [state] : - /// The desired activation state of the lifecycle policy after creation. + /// Parameter [retainInterval] : + /// [Default policies only] Specifies how long the policy should retain + /// snapshots or AMIs before deleting them. The retention period can range + /// from 2 to 14 days, but it must be greater than the creation frequency to + /// ensure that the policy retains at least 1 snapshot or AMI at any given + /// time. If you do not specify a value, the default is 7. + /// + /// Default: 7 /// /// Parameter [tags] : /// The tags to apply to the lifecycle policy during creation. Future createLifecyclePolicy({ required String description, required String executionRoleArn, - required PolicyDetails policyDetails, required SettablePolicyStateValues state, + bool? copyTags, + int? createInterval, + List? crossRegionCopyTargets, + DefaultPolicyTypeValues? defaultPolicy, + Exclusions? exclusions, + bool? extendDeletion, + PolicyDetails? policyDetails, + int? retainInterval, Map? tags, }) async { + _s.validateNumRange( + 'createInterval', + createInterval, + 1, + 1152921504606846976, + ); + _s.validateNumRange( + 'retainInterval', + retainInterval, + 1, + 1152921504606846976, + ); final $payload = { 'Description': description, 'ExecutionRoleArn': executionRoleArn, - 'PolicyDetails': policyDetails, 'State': state.toValue(), + if (copyTags != null) 'CopyTags': copyTags, + if (createInterval != null) 'CreateInterval': createInterval, + if (crossRegionCopyTargets != null) + 'CrossRegionCopyTargets': crossRegionCopyTargets, + if (defaultPolicy != null) 'DefaultPolicy': defaultPolicy.toValue(), + if (exclusions != null) 'Exclusions': exclusions, + if (extendDeletion != null) 'ExtendDeletion': extendDeletion, + if (policyDetails != null) 'PolicyDetails': policyDetails, + if (retainInterval != null) 'RetainInterval': retainInterval, if (tags != null) 'Tags': tags, }; final response = await _protocol.send( @@ -116,7 +255,7 @@ class Dlm { final response = await _protocol.send( payload: null, method: 'DELETE', - requestUri: '/policies/${Uri.encodeComponent(policyId)}/', + requestUri: '/policies/${Uri.encodeComponent(policyId)}', exceptionFnMap: _exceptionFns, ); } @@ -124,13 +263,30 @@ class Dlm { /// Gets summary information about all or the specified data lifecycle /// policies. /// - /// To get complete information about a policy, use GetLifecyclePolicy. + /// To get complete information about a policy, use GetLifecyclePolicy. /// /// May throw [ResourceNotFoundException]. /// May throw [InvalidRequestException]. /// May throw [InternalServerException]. /// May throw [LimitExceededException]. /// + /// Parameter [defaultPolicyType] : + /// [Default policies only] Specifies the type of default policy to + /// get. Specify one of the following: + /// + ///
      + ///
    • + /// VOLUME - To get only the default policy for EBS snapshots + ///
    • + ///
    • + /// INSTANCE - To get only the default policy for EBS-backed AMIs + ///
    • + ///
    • + /// ALL - To get all default policies + ///
    • + ///
    + /// /// Parameter [policyIds] : /// The identifiers of the data lifecycle policies. /// @@ -153,6 +309,7 @@ class Dlm { /// /// Tags are strings in the format key=value. Future getLifecyclePolicies({ + DefaultPoliciesTypeValues? defaultPolicyType, List? policyIds, List? resourceTypes, GettablePolicyStateValues? state, @@ -160,6 +317,8 @@ class Dlm { List? targetTags, }) async { final $query = >{ + if (defaultPolicyType != null) + 'defaultPolicyType': [defaultPolicyType.toValue()], if (policyIds != null) 'policyIds': policyIds, if (resourceTypes != null) 'resourceTypes': resourceTypes.map((e) => e.toValue()).toList(), @@ -191,7 +350,7 @@ class Dlm { final response = await _protocol.send( payload: null, method: 'GET', - requestUri: '/policies/${Uri.encodeComponent(policyId)}/', + requestUri: '/policies/${Uri.encodeComponent(policyId)}', exceptionFnMap: _exceptionFns, ); return GetLifecyclePolicyResponse.fromJson(response); @@ -284,30 +443,110 @@ class Dlm { /// Parameter [policyId] : /// The identifier of the lifecycle policy. /// + /// Parameter [copyTags] : + /// [Default policies only] Indicates whether the policy should copy + /// tags from the source resource to the snapshot or AMI. + /// + /// Parameter [createInterval] : + /// [Default policies only] Specifies how often the policy should run + /// and create snapshots or AMIs. The creation frequency can range from 1 to 7 + /// days. + /// + /// Parameter [crossRegionCopyTargets] : + /// [Default policies only] Specifies destination Regions for snapshot + /// or AMI copies. You can specify up to 3 destination Regions. If you do not + /// want to create cross-Region copies, omit this parameter. + /// /// Parameter [description] : /// A description of the lifecycle policy. /// + /// Parameter [exclusions] : + /// [Default policies only] Specifies exclusion parameters for volumes + /// or instances for which you do not want to create snapshots or AMIs. The + /// policy will not create snapshots or AMIs for target resources that match + /// any of the specified exclusion parameters. + /// /// Parameter [executionRoleArn] : /// The Amazon Resource Name (ARN) of the IAM role used to run the operations /// specified by the lifecycle policy. /// + /// Parameter [extendDeletion] : + /// [Default policies only] Defines the snapshot or AMI retention + /// behavior for the policy if the source volume or instance is deleted, or if + /// the policy enters the error, disabled, or deleted state. + /// + /// By default (ExtendDeletion=false): + /// + ///
      + ///
    • + /// If a source resource is deleted, Amazon Data Lifecycle Manager will + /// continue to delete previously created snapshots or AMIs, up to but not + /// including the last one, based on the specified retention period. If you + /// want Amazon Data Lifecycle Manager to delete all snapshots or AMIs, + /// including the last one, specify true. + ///
    • + ///
    • + /// If a policy enters the error, disabled, or deleted state, Amazon Data + /// Lifecycle Manager stops deleting snapshots and AMIs. If you want Amazon + /// Data Lifecycle Manager to continue deleting snapshots or AMIs, including + /// the last one, if the policy enters one of these states, specify + /// true. + ///
    • + ///
    + /// If you enable extended deletion (ExtendDeletion=true), you override + /// both default behaviors simultaneously. + /// + /// Default: false + /// /// Parameter [policyDetails] : /// The configuration of the lifecycle policy. You cannot update the policy /// type or the resource type. /// + /// Parameter [retainInterval] : + /// [Default policies only] Specifies how long the policy should retain + /// snapshots or AMIs before deleting them. The retention period can range + /// from 2 to 14 days, but it must be greater than the creation frequency to + /// ensure that the policy retains at least 1 snapshot or AMI at any given + /// time. + /// /// Parameter [state] : /// The desired activation state of the lifecycle policy after creation. Future updateLifecyclePolicy({ required String policyId, + bool? copyTags, + int? createInterval, + List? crossRegionCopyTargets, String? description, + Exclusions? exclusions, String? executionRoleArn, + bool? extendDeletion, PolicyDetails? policyDetails, + int? retainInterval, SettablePolicyStateValues? state, }) async { + _s.validateNumRange( + 'createInterval', + createInterval, + 1, + 1152921504606846976, + ); + _s.validateNumRange( + 'retainInterval', + retainInterval, + 1, + 1152921504606846976, + ); final $payload = { + if (copyTags != null) 'CopyTags': copyTags, + if (createInterval != null) 'CreateInterval': createInterval, + if (crossRegionCopyTargets != null) + 'CrossRegionCopyTargets': crossRegionCopyTargets, if (description != null) 'Description': description, + if (exclusions != null) 'Exclusions': exclusions, if (executionRoleArn != null) 'ExecutionRoleArn': executionRoleArn, + if (extendDeletion != null) 'ExtendDeletion': extendDeletion, if (policyDetails != null) 'PolicyDetails': policyDetails, + if (retainInterval != null) 'RetainInterval': retainInterval, if (state != null) 'State': state.toValue(), }; final response = await _protocol.send( @@ -353,8 +592,8 @@ class Action { } } -/// [Snapshot policies only] Specifies information about the archive -/// storage tier retention period. +/// [Custom snapshot policies only] Specifies information about the +/// archive storage tier retention period. class ArchiveRetainRule { /// Information about retention period in the Amazon EBS Snapshots Archive. For /// more information, see [Snapshot policies only] Specifies a snapshot archiving rule for a -/// schedule. +/// [Custom snapshot policies only] Specifies a snapshot archiving rule +/// for a schedule. class ArchiveRule { /// Information about the retention period for the snapshot archiving rule. final ArchiveRetainRule retainRule; @@ -428,8 +667,8 @@ class CreateLifecyclePolicyResponse { } } -/// [Snapshot and AMI policies only] Specifies when the policy should -/// create snapshots or AMIs. +/// [Custom snapshot and AMI policies only] Specifies when the policy +/// should create snapshots or AMIs. /// /// class CreateRule { @@ -455,11 +696,11 @@ class CreateRule { /// The interval unit. final IntervalUnitValues? intervalUnit; - /// [Snapshot policies only] Specifies the destination for snapshots - /// created by the policy. To create snapshots in the same Region as the source - /// resource, specify CLOUD. To create snapshots on the same - /// Outpost as the source resource, specify OUTPOST_LOCAL. If you - /// omit this parameter, CLOUD is used by default. + /// [Custom snapshot policies only] Specifies the destination for + /// snapshots created by the policy. To create snapshots in the same Region as + /// the source resource, specify CLOUD. To create snapshots on the + /// same Outpost as the source resource, specify OUTPOST_LOCAL. If + /// you omit this parameter, CLOUD is used by default. /// /// If the policy targets resources in an Amazon Web Services Region, then you /// must create snapshots in the same Region as the source resource. If the @@ -467,6 +708,17 @@ class CreateRule { /// same Outpost as the source resource, or in the Region of that Outpost. final LocationValues? location; + /// [Custom snapshot policies that target instances only] Specifies pre + /// and/or post scripts for a snapshot lifecycle policy that targets instances. + /// This is useful for creating application-consistent snapshots, or for + /// performing specific administrative tasks before or after Amazon Data + /// Lifecycle Manager initiates snapshot creation. + /// + /// For more information, see Automating + /// application-consistent snapshots with pre and post scripts. + final List